/* CAYMAZ Üretim Takip — Gündüz teması */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #16202e;
  --muted: #5d6879;
  --faint: #8a94a6;
  --border: #dfe4ec;
  --border-strong: #c7cfdb;
  --primary: #1d4f91;
  --primary-hover: #163f75;
  --primary-soft: #e6eef9;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #1e7b3a;
  --success-soft: #e5f5ea;
  --warning: #9a6700;
  --warning-soft: #fff5d6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 10px;

  /* Parça durum renkleri (sipariş detayı) */
  --st-bekliyor: #ffffff;
  --st-uretimde: #cfe6ff;
  --st-depo: #fff1a8;
  --st-montaj: #c9f2c7;
  --st-hata: #ffc9c9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* Kabuk: üst ve alt bölüm sabit, aradaki içerik kendi içinde kayar */
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.scroller { flex: 1; min-height: 0; overflow: auto; position: relative; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Header / Footer ---------- */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex: none;
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { height: 48px; width: auto; display: block; }
.brand .product { border-left: 1px solid var(--border); padding-left: 12px; color: var(--muted); font-size: 13px; }
.brand .product b { display: block; color: var(--text); font-size: 14px; letter-spacing: .04em; }

.header-right { display: flex; align-items: center; gap: 6px; }
.menu-anchor { position: relative; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

/* Google tarzı modül ızgarası */
.apps-panel { width: 332px; padding: 12px; border-radius: 16px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.app-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px;
  border-radius: 12px; color: var(--text); text-align: center; font-size: 12px; line-height: 1.25;
}
.app-tile:hover { background: var(--surface-2); text-decoration: none; }
.app-tile.on { background: var(--primary-soft); }
.app-tile .ico {
  width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.app-tile.on .ico { background: var(--primary); color: #fff; }
.app-tile .ico svg { width: 26px; height: 26px; }
.user-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 4px 12px 4px 4px; cursor: pointer; text-align: left;
}
.user-btn:hover { background: var(--surface-2); border-color: var(--border); }
.user-btn .who b { display: block; font-size: 13px; }
.user-btn .who span { font-size: 12px; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 30;
}
.dropdown button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.dropdown button:hover { background: var(--surface-2); }

.app-footer {
  flex: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
}

main#view { width: 100%; max-width: 1480px; margin: 0 auto; padding: 20px; position: relative; }

/* Çizgisel dönen dünya */
.globe-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
main#view > .globe-bg.faint { position: fixed; top: 64px; bottom: 45px; height: auto; opacity: .09; z-index: 0; }
main#view > .globe-bg.faint ~ * { position: relative; z-index: 1; }

/* ---------- Avatar ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 88px; height: 88px; font-size: 28px; }

/* ---------- Page chrome ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); }
.page-head .spacer { flex: 1; }
.back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.back:hover { background: var(--surface-2); text-decoration: none; }

.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 16px;
}
.filters .spacer { flex: 1; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 36px; padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 500;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn svg { width: 16px; height: 16px; }

.input, select.input, textarea.input {
  height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); min-width: 0;
}
textarea.input { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.input:focus, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.field > .input { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 12px; height: 34px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- Home: module buttons ---------- */
.home-title { text-align: center; margin: 12px 0 28px; }
.home-title h1 { font-size: 26px; }
.home-title p { color: var(--muted); margin: 6px 0 0; }
.modules {
  display: grid; gap: 20px; justify-content: center;
  grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
}
.module-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); height: 190px; padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: var(--text); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.module-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); text-decoration: none; }
.module-btn .ico {
  width: 76px; height: 76px; border-radius: 18px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.module-btn .ico svg { width: 40px; height: 40px; }
.module-btn span { font-size: 16px; font-weight: 600; text-align: center; }

/* ---------- Cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.blue { background: #e7f0fd; border-color: #c6dbfa; color: #1f5fbf; }
.badge.yellow { background: var(--warning-soft); border-color: #f3dc8a; color: var(--warning); }
.badge.green { background: var(--success-soft); border-color: #b8e3c4; color: var(--success); }
.badge.red { background: var(--danger-soft); border-color: #f5c2bd; color: var(--danger); }
.badge.gray { color: var(--muted); }
.badge.purple { background: #f1ebfd; border-color: #d9c9f7; color: #6b3fc2; }

.progress { height: 8px; border-radius: 999px; background: #e9edf3; overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.progress-line { display: flex; align-items: center; gap: 8px; }
.progress-line b { font-size: 12px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

.grid-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.order-card { padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.order-card:hover { border-color: var(--primary); }
.order-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-card .code { font-weight: 700; font-size: 15px; }
.order-card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.order-card dt { color: var(--muted); }
.order-card dd { margin: 0; text-align: right; }

/* Kanban (Todo görünümü) */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kanban-col { background: #e9edf3; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kanban-col h3 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 10px; }
.kanban-col .stack { display: flex; flex-direction: column; gap: 10px; }

/* User cards */
.user-card { padding: 20px 16px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.user-card:hover { border-color: var(--primary); }
.user-card .name { font-weight: 600; font-size: 15px; }
.user-card .uname { color: var(--muted); font-size: 12px; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.chip.x { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding: 4px 6px 4px 10px; }
.chip.x button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 4px; font-size: 15px; line-height: 1; }

/* Detay sayfası: sol alt modül menüsü */
.split { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.side-nav { padding: 8px; }
.side-nav .who { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; text-align: center; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.side-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.side-nav a:hover { background: var(--surface-2); text-decoration: none; }
.side-nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* Tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 16px; }
.tile { padding: 16px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 32px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Plane ---------- */
.plane-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.plane-stage { padding: 10px; }
.plane-stage svg { width: 100%; height: auto; display: block; max-height: calc(100dvh - 270px); }
.plane-part { stroke: #1c2230; stroke-width: 3; stroke-linejoin: round; cursor: pointer; transition: fill .15s; }
.plane-part.cover { stroke: #7a1f1f; stroke-width: 3.5; }
.plane-part.hot { stroke: #b8860b; stroke-width: 6; filter: brightness(.93); }
.plane-label { font-size: 24px; fill: #3b4555; pointer-events: none; text-anchor: middle; dominant-baseline: central; font-weight: 600; }
.plane-label.small { font-size: 17px; }
.plane-label.count { font-size: 30px; font-weight: 800; fill: #16202e; }
.plane-label.count.small { font-size: 20px; }
.plane-label.zero { fill: #b42318; }
.plane-hole { fill: #7a1f1f; pointer-events: none; }
.plane-slot { fill: none; stroke: #7a1f1f; stroke-width: 2.5; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #1c2230; display: inline-block; }
.tip {
  position: fixed; pointer-events: none; z-index: 60; display: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 13px; min-width: 170px; max-width: 280px;
}
.tip b { font-family: ui-monospace, monospace; font-size: 14px; }
.tip div { color: var(--muted); }

.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-list li:last-child { border-bottom: 0; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.timeline li.err::before { background: var(--danger); }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline img { max-width: 220px; border-radius: 8px; margin-top: 6px; display: block; border: 1px solid var(--border); }

/* ---------- Modal / toast ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto;
}
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.x-btn { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px; }

.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.pick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.pick:hover { border-color: var(--primary); }
.pick.on { border-color: var(--primary); background: var(--primary-soft); }
.pick.disabled { opacity: .55; cursor: not-allowed; }
.pick .grow { flex: 1; min-width: 0; }
.pick .grow b { display: block; }

.big-clock { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; margin: 4px 0 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid; }
.alert.warn { background: var(--warning-soft); border-color: #f3dc8a; color: #6b4a00; }
.alert.err { background: var(--danger-soft); border-color: #f5c2bd; color: var(--danger); }
.alert.info { background: var(--primary-soft); border-color: #c6dbfa; color: var(--primary); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.photo-preview { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--border); }

.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: #16202e; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 380px; }
.toast.err { background: var(--danger); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 45%, #eef4fc, #dfe8f5 70%); position: relative; overflow: hidden;
}
.login { width: 100%; max-width: 380px; padding: 28px; position: relative; z-index: 1;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(6px); }
.login img { height: 110px; width: auto; display: block; margin: 0 auto 10px; }
.login h1 { text-align: center; font-size: 18px; margin-bottom: 20px; color: var(--muted); font-weight: 500; }
.login .btn { width: 100%; }

.loading { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 1000px) {
  .plane-layout, .split { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(5, 240px); }
}
@media (max-width: 640px) {
  main#view { padding: 12px; }
  .app-header { padding: 0 12px; }
  .brand .product, .user-btn .who { display: none; }
  .brand img { height: 40px; }
  .apps-panel { width: min(332px, calc(100vw - 24px)); right: -52px; }
  .modules { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .module-btn { height: 150px; }
  .kv { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
}

/* ---------- Yazdırılabilir sipariş formu (A4, iki kopya) ---------- */
.print-area { display: none; }
@page { size: A4 portrait; margin: 10mm; }
@media print {
  html, body { height: auto; background: #fff; }
  .print-area { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; color: #000; }
}
.pf-page { width: 190mm; height: 270mm; overflow: hidden; display: flex; flex-direction: column; font-size: 10.5pt; }
.pf-copy { flex: 1 1 0; display: flex; flex-direction: column; padding: 3mm 2mm; min-height: 0; overflow: hidden; }
.pf-cut {
  flex: none; border-top: 1px dashed #555; position: relative; margin: 2mm 0; height: 0;
}
.pf-cut span {
  position: absolute; left: 50%; top: -2.2mm; transform: translateX(-50%);
  background: #fff; padding: 0 3mm; font-size: 8pt; color: #555;
}
.pf-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #1d3c78; padding-bottom: 3mm; }
.pf-logo { height: 18mm; width: auto; }
.pf-title { text-align: right; line-height: 1.5; }
.pf-title h1 { font-size: 18pt; letter-spacing: .08em; color: #1d3c78; margin: 0 0 1mm; }
.pf-table { width: 100%; border-collapse: collapse; margin-top: 3mm; }
.pf-table tr:last-child td { border-bottom: 1px solid #999; }
.pf-table th, .pf-table td { border: 1px solid #999; padding: 1.2mm 3mm; text-align: left; white-space: normal; font-size: 10pt; }
.pf-table th { width: 55mm; background: #eef2f8; color: #000; text-transform: none; letter-spacing: 0; font-weight: 600; }
.pf-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: auto; padding-top: 3mm; }
.pf-sign { border: 1px solid #999; padding: 2.5mm 3mm; }
.pf-sign-title { font-weight: 700; margin-bottom: 1.5mm; }
.pf-sign-line { display: flex; gap: 2mm; border-bottom: 1px dotted #999; padding: 1mm 0; min-height: 6mm; align-items: flex-end; }
.pf-sign-line span { color: #444; }
.pf-sign-box { height: 10mm; color: #999; font-size: 8pt; padding-top: 1mm; }
.pf-foot { display: flex; justify-content: space-between; font-size: 8pt; color: #555; margin-top: 2mm; }

/* Yarı mamul raporu */
.pf-report { gap: 4mm; }
.wr-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6mm; padding: 2mm 0; }
.wr-stat { display: flex; flex-direction: column; line-height: 1.15; min-width: 38mm; }
.wr-stat span { font-size: 10pt; color: #444; }
.wr-stat b { font-size: 30pt; }
.wr-stat small { font-size: 9pt; color: #555; }
.wr-stat.done b { color: #1e7b3a; }
.wr-stat.left { text-align: right; }
.wr-stat.left b { color: #b42318; }
.wr-bar { height: 5mm; border-radius: 3mm; background: #f3d4d1; overflow: hidden; }
.wr-bar i { display: block; height: 100%; background: #1e7b3a; }
.wr-plane { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; }
.wr-plane svg { height: 100%; width: auto; max-width: 100%; }
.wr-plane .plane-part { stroke-width: 2.5; cursor: default; }
.wr-plane .plane-label { font-size: 20px; fill: #222; }
.wr-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2mm 7mm; font-size: 10pt; }
.wr-legend span { display: inline-flex; align-items: center; gap: 2mm; }
.wr-legend i { width: 4.5mm; height: 4.5mm; border: 1px solid #333; display: inline-block; }
.wr-info { margin-top: 0; }
.wr-info th { width: auto; }

/* ---------- Uçuş raporu (ekranda A4 önizleme, baskıda sayfa sonlu) ---------- */
.fr-doc { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.fr-page {
  width: min(210mm, 100%); min-height: 297mm; background: #fff; color: #111; padding: 12mm;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 4mm; font-size: 10pt;
}
.fr-body { flex: 1; display: flex; flex-direction: column; gap: 4mm; }
.fr-page .pf-foot { margin-top: 2mm; }
.fr-section h2 { font-size: 11pt; color: #1d3c78; border-bottom: 1px solid #c9d3e3; padding-bottom: 1mm; margin: 0 0 2mm; }
.fr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; align-items: start; }
.fr-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2.5mm; }
.fr-kpi { border: 1px solid #c9d3e3; border-radius: 2mm; padding: 2mm 2.5mm; display: flex; flex-direction: column; background: #f7f9fc; }
.fr-kpi span { font-size: 8pt; color: #555; }
.fr-kpi b { font-size: 13pt; color: #1d3c78; line-height: 1.3; white-space: nowrap; }
.fr-kpi small { font-size: 7.5pt; color: #666; }
.fr-kv { margin-top: 0; }
.fr-kv th, .fr-kv td { font-size: 8.5pt; padding: .8mm 2mm; }
.fr-kv th { width: 42%; }
.fr-findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.5mm; }
.fr-findings li { display: flex; gap: 2.5mm; border-left: 3px solid; padding: 1.2mm 2mm; font-size: 8.8pt; background: #f7f9fc; }
.fr-findings li.ok { border-color: #1e7b3a; }
.fr-findings li.warn { border-color: #c26a00; background: #fff8ec; }
.fr-findings li.bad { border-color: #b42318; background: #fdeeec; }
.fr-findings .lvl { font-weight: 700; min-width: 13mm; }
.fr-findings li.ok .lvl { color: #1e7b3a; }
.fr-findings li.warn .lvl { color: #c26a00; }
.fr-findings li.bad .lvl { color: #b42318; }
.fr-note { margin: 0; font-size: 8.5pt; color: #555; }
.fr-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 5mm; }
.fr-list { margin-top: 0; }
.fr-list th, .fr-list td { font-size: 8.5pt; padding: 1mm 2mm; }
.fr-list td:first-child, .fr-list th:first-child { width: 16mm; white-space: nowrap; }
.fr-list tr.warn td { background: #fff5dc; }
.fr-list tr.bad td { background: #fdeceb; }
.fr-empty { color: #666; font-size: 9pt; }

.chart { margin: 0; break-inside: avoid; }
.chart figcaption { font-weight: 700; font-size: 9pt; color: #1d3c78; margin-bottom: 1mm; }
.chart figcaption .unit { font-weight: 400; color: #666; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-band { fill: #eef1f6; }
.chart-grid { stroke: #e3e7ee; stroke-width: 1; }
.chart-axis { stroke: #999; stroke-width: 1; }
.chart-tick { font-size: 10px; fill: #555; font-family: system-ui, sans-serif; }
.chart-thr { stroke-width: 1; stroke-dasharray: 5 4; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1mm 4mm; font-size: 8pt; color: #333; margin-top: .5mm; }
.chart-legend span { display: inline-flex; align-items: center; gap: 1.5mm; }
.chart-legend i { width: 4mm; height: 1.2mm; display: inline-block; border-radius: 1mm; }
.chart-empty { font-size: 8.5pt; color: #777; border: 1px dashed #ccc; padding: 6mm; text-align: center; }
.map-bg { fill: #f6f8fb; }
.map-grid { stroke: #e3e7ee; stroke-width: 1; }
.map-air { fill: none; stroke: #1d4f91; stroke-width: 2.2; stroke-linejoin: round; }
.map-ground { fill: none; stroke: #8a94a6; stroke-width: 1.6; stroke-dasharray: 4 3; }
.map-start { fill: #1e7b3a; }
.map-end { fill: #b42318; }
.map-home { fill: #fff; stroke: #1d4f91; stroke-width: 2; }
.map-home-t { font-size: 9px; font-weight: 700; fill: #1d4f91; font-family: system-ui, sans-serif; }
.map-scale { stroke: #333; stroke-width: 2; }
.map-north { fill: #333; }
.chart-legend i.lg-air { background: #1d4f91; }
.chart-legend i.lg-ground { background: repeating-linear-gradient(90deg, #8a94a6 0 3px, transparent 3px 5px); }
.chart-legend i.lg-start { background: #1e7b3a; width: 2.5mm; height: 2.5mm; border-radius: 50%; }
.chart-legend i.lg-end { background: #b42318; width: 2.5mm; height: 2.5mm; border-radius: 0; }
.chart-legend i.lg-home { background: #fff; border: 1.5px solid #1d4f91; width: 2.5mm; height: 2.5mm; border-radius: 50%; }

@media print {
  .fr-doc { display: block; }
  .fr-page { width: auto; min-height: 0; padding: 0; box-shadow: none; break-after: page; }
  .fr-page:last-child { break-after: auto; }
}
@media screen and (max-width: 900px) {
  .fr-kpis { grid-template-columns: repeat(3, 1fr); }
  .fr-two, .fr-charts { grid-template-columns: 1fr; }
  .fr-page { min-height: 0; padding: 16px; }
}

/* Araçlar */
.upload-card { padding: 16px; margin-bottom: 16px; }
.upload-card .row { align-items: flex-end; }
.upload-progress { margin-top: 10px; }

/* Ürün Yönetimi */
.product-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.product-card { display: flex; flex-direction: column; color: var(--text); overflow: hidden; }
.product-card:hover { border-color: var(--primary); text-decoration: none; }
.product-preview { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 12px 40px; }
.product-preview svg { width: 100%; height: 200px; display: block; }
.product-preview .plane-part { stroke-width: 4; cursor: inherit; }
.product-info { padding: 14px 16px; }
.product-info .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 16px; }
.product-info dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.product-info dt { color: var(--muted); }
.product-info dd { margin: 0; }
.part-group + .part-group { margin-top: 10px; }
.part-group h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
ol.steps { padding-left: 20px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Yalnızca yöneticilere açık modüller: kırmızı ton ---------- */
.tone-red {
  --primary: #b42318;
  --primary-hover: #912018;
  --primary-soft: #fdecea;
}
.module-btn.tone-red { border-color: #f3c9c4; background: linear-gradient(180deg, #fff, #fff6f5); }
.module-btn.tone-red .ico { background: #fdecea; color: #b42318; }
.module-btn.tone-red:hover { border-color: #b42318; }
.app-tile.tone-red .ico { background: #fdecea; color: #b42318; }
.app-tile.tone-red.on .ico { background: #b42318; color: #fff; }
main#view.tone-red .page-head h1 { color: #912018; }
main#view.tone-red .card { border-color: #f1d9d6; }

/* ---------- Yönetim paneli ---------- */
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d92d20; box-shadow: 0 0 0 0 rgba(217,45,32,.6); animation: livepulse 1.6s infinite; vertical-align: middle; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(217,45,32,.55); } 70% { box-shadow: 0 0 0 8px rgba(217,45,32,0); } 100% { box-shadow: 0 0 0 0 rgba(217,45,32,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.admin-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (min-width: 1380px) { .admin-tiles { grid-template-columns: repeat(9, 1fr); } }
.admin-tiles .tile { border-top: 3px solid #b42318; padding: 9px 12px; }
.admin-tiles .tile .label { font-size: 12px; line-height: 1.25; }
.admin-tiles .tile .small { font-size: 11px; line-height: 1.3; }
.admin-tiles .tile .value { font-size: 26px; color: #912018; margin-top: 0; }
.admin-tiles .tile.alert { background: #fff4f2; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.admin-planes { display: grid; gap: 16px; }
.admin-planes.two { grid-template-columns: 1fr 1fr; }
.admin-plane-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; flex-wrap: wrap; }
.admin-plane-head .spacer { flex: 1; }
.admin-plane svg { max-height: calc(100dvh - 290px); }
.admin-plane { padding: 8px; }
.admin-plane .plane-label.idle { fill: #9aa3b2; font-weight: 500; }
.admin-plane .plane-label.printing { fill: #0b3d7a; }
.admin-plane .plane-label .pn { font-weight: 800; font-size: 32px; }
.admin-plane .plane-label .pr { font-weight: 700; font-size: 26px; fill: #1f5fbf; }
.admin-plane .plane-label.small .pn { font-size: 24px; }
.admin-plane .plane-label.small .pr { font-size: 20px; }
.admin-side { display: flex; flex-direction: column; gap: 16px; }
.side-title { font-size: 15px; margin-bottom: 10px; }
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.online-list li { display: flex; align-items: center; gap: 10px; }
.online-list .grow { flex: 1; min-width: 0; }
.online-list .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-wrap .avatar { width: 40px; height: 40px; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #12b76a; border: 2px solid #fff; }
.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 460px; overflow: auto; }
.pcell { border: 1px solid var(--border); border-radius: 8px; padding: 5px 7px; font-size: 11px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); min-width: 0; }
.pcell b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcell span { color: var(--muted); }
.pcell.blue { background: #e7f0fd; border-color: #c6dbfa; }
.pcell.blue span { color: #1f5fbf; font-weight: 600; }
.pcell.green { background: var(--success-soft); border-color: #b8e3c4; }
.pcell.red, .pcell.yellow { background: var(--danger-soft); border-color: #f5c2bd; }
.pcell.red span, .pcell.yellow span { color: var(--danger); font-weight: 600; }
.pcell.gray { opacity: .6; }
.pbar { display: block; height: 4px; border-radius: 2px; background: #c6dbfa; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: #1f5fbf; }
@media (max-width: 1100px) { .admin-layout, .admin-planes.two { grid-template-columns: 1fr; } }

/* Yönetim: rakam seçici ve kırmızı uyarılar */
.tile-picker { width: 290px; max-height: 60vh; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.tile-picker .check { font-size: 13px; }
.picker-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.admin-tiles .tile.danger { background: #b42318; border-color: #b42318; border-top-color: #7a1010; }
.admin-tiles .tile.danger .label, .admin-tiles .tile.danger .value, .admin-tiles .tile.danger .small { color: #fff; }
.admin-tiles .tile.danger { animation: dangerpulse 2s infinite; }
@keyframes dangerpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180,35,24,.45); } 50% { box-shadow: 0 0 0 6px rgba(180,35,24,0); } }
@media (prefers-reduced-motion: reduce) { .admin-tiles .tile.danger { animation: none; } }
.pcell.stale { background: #fdecea; border: 2px solid #b42318; }
.pcell.stale span { color: #b42318; font-weight: 700; }
.pcell em { font-style: normal; font-size: 10px; color: #b42318; font-weight: 700; line-height: 1.2; }
.pcell.outside { border: 2px solid #e8590c; }
.pcell em.out { color: #c2410c; }

/* Üst çubuk uyarıları */
.alert-btn { position: relative; }
.alert-btn.warn { color: #c2410c; }
.alert-btn.danger { color: #b42318; }
.alert-count {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #b42318; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--surface);
}
.alert-btn.warn:not(.danger) .alert-count { background: #e8590c; }
.alerts-panel { width: 340px; padding: 6px; }
.alerts-head { font-weight: 700; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; color: var(--text); }
.alert-item:hover { background: var(--surface-2); text-decoration: none; }
.alert-item .n { min-width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.alert-item.danger .n { background: #b42318; }
.alert-item.warn .n { background: #e8590c; }
.alert-item b { display: block; font-size: 13px; }
.alerts-panel .empty { padding: 16px; }

/* Modül üstü özet şeridi */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.stat .v { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); line-height: 1.25; }
.stat .s { font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.alert { background: #fff4f2; border-color: #f5c2bd; }
.stat.alert .v { color: var(--danger); }
.stat.ok .v { color: var(--success); }
.stat.muted .v { color: var(--muted); }
.filters .input[type="date"] { width: 150px; }
.filters .lbl { font-size: 12px; color: var(--muted); }
.plane-label.faded { opacity: .25; }

/* Saha görev detayı */
.task-kv { grid-template-columns: 160px 1fr; }
.places-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.road-dist { height: 36px; display: flex; align-items: center; font-size: 16px; }
@media (max-width: 900px) { .places-grid { grid-template-columns: 1fr; } }
/* Akan (çok sayfalı olabilen) baskı formu */
.pf-page.pf-flow { height: auto; overflow: visible; gap: 2mm; }
.pf-flow .pf-signs { margin-top: 8mm; }
.pf-h2 { font-size: 11pt; color: #1d3c78; margin: 4mm 0 1.5mm; border-bottom: 1px solid #c9d3e3; padding-bottom: .8mm; }
.pf-list th, .pf-list td { font-size: 9pt; }
.pf-empty { font-size: 9pt; color: #666; margin: 0; }

/* Uçuş videoları */
.video-list { display: flex; flex-direction: column; gap: 6px; }
.video-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.video-item .grow { flex: 1; min-width: 0; }
.video-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-player { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }

/* ---------- Mobil: yatay kayma olmasın ---------- */
/* Izgara çocukları içerikten geniş olmasın (geniş tablolar kendi kutularında kayar) */
.split > *, .plane-layout > *, .admin-layout > *, .admin-planes > *, .fr-two > *, .places-grid > *, .row > * { min-width: 0; }
.scroller { overflow-x: hidden; overscroll-behavior-x: none; }
html, body { overscroll-behavior-x: none; max-width: 100%; }
.card-pad .table-wrap, .card .table-wrap { max-width: 100%; }
img, svg, video, canvas { max-width: 100%; }
@media (max-width: 640px) {
  /* iOS 16 px altı yazılı kutulara dokununca ekranı büyütür, sayfa yana kaymış görünür */
  .input, select.input, textarea.input, input, select, textarea { font-size: 16px; }
  .filters { gap: 8px; }
  .filters .input, .filters select, .filters > .seg { width: 100% !important; max-width: 100%; }
  .filters .spacer { display: none; }
  .filters > .btn, .filters > a.btn { flex: 1 1 auto; }
  .page-head { gap: 8px; }
  .page-head h1 { font-size: 19px; }
  .page-head > div:last-child:not(.spacer) { width: 100%; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat .v { font-size: 19px; }
  .modal-back { padding: 12px 8px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 12px 14px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .header-right { gap: 0; }
  .icon-btn { width: 38px; height: 38px; }
  .apps-panel { position: fixed; top: 60px; right: 8px; left: 8px; width: auto; }
  .alerts-panel { position: fixed; top: 60px; right: 8px; left: 8px; width: auto; }
  .tile-picker { position: fixed; top: 60px; right: 8px; left: 8px; width: auto; }
}
@media (max-width: 640px) {
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .filters > input[type="search"], .filters > .seg, .filters > .btn, .filters > a.btn, .filters > .check,
  .filters > .menu-anchor, .filters > span.small { grid-column: 1 / -1; }
  .filters > .lbl { display: none; }
  .filters .input[type="date"] { width: 100% !important; }
  .filters > .seg { display: flex; }
  .filters > .seg button { flex: 1; }
}

/* Üst çubuk bildirimleri */
.notify-btn { position: relative; }
.notify-btn.on { color: var(--primary); }
.notify-btn .alert-count { background: var(--primary); }
.alert-item.info .n { background: var(--primary); }
