/* 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;
  --part-fill: #ffffff;
  --part-off: #eef0f4;
  --cover-fill: #fde9e7;
}

* { 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;
  align-items: center;
  gap: 16px;
}
.footer-copy { white-space: nowrap; }

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; }
.plane-inner { fill: none; stroke: #7a1f1f; stroke-width: 2; 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; max-width: 100%; object-fit: contain; 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; }
/* Mamul ve yedek parça kartları yan yana; kenarlık rengiyle ayrılır */
main#view .card.product-card.mamul { border: 2px solid #1d4f91; }
main#view .card.product-card.spare { border: 2px solid #d99a00; }
main#view .card.product-card.semi { border: 2px solid #1f9d55; }
.product-card.mamul:hover, .product-card.spare:hover, .product-card.semi:hover { box-shadow: var(--shadow-lg); }
.type-tag { white-space: nowrap; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
.type-tag.mamul { background: #e6eef9; color: #1d4f91; }
.type-tag.spare { background: #fff5d6; color: #9a6700; }
.type-tag.semi { background: #e5f5ea; color: #1e7b3a; }
.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 .top .grow { flex: 1; }
.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; grid-template-columns: repeat(3, 1fr); }
.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); }

/* Montaj görünümü (bölümler / bütün uçak) */
.asm-sec .asm-edge { stroke-width: 30; stroke-linejoin: round; }
.asm-sec .asm-fill { stroke-width: 8; stroke-linejoin: round; }
.asm-sec.todo .asm-edge { fill: #f2b705; stroke: #f2b705; }
.asm-sec.todo .asm-fill { fill: #fff8dc; stroke: #fff8dc; }
.asm-sec.done .asm-edge { fill: #1f9d55; stroke: #1f9d55; }
.asm-sec.done .asm-fill { fill: #e4f6ea; stroke: #e4f6ea; }
.asm-sec.clickable { cursor: pointer; }
/* Ürün ağacı görünümü (Ürün Yönetimi): durum yok, mavi */
.asm-sec.info .asm-edge { fill: #1d4f91; stroke: #1d4f91; }
.asm-sec.info .asm-fill { fill: #eef3fb; stroke: #eef3fb; }
.asm-sec.info.clickable:hover .asm-fill { fill: #dde8f7; stroke: #dde8f7; }
.asm-sec.info .asm-label .sub { fill: #1d4f91; }
.asm-sec.clickable.todo:hover .asm-edge { fill: #d99a00; stroke: #d99a00; }
.asm-sec.clickable.todo:hover .asm-fill { fill: #ffefb0; stroke: #ffefb0; }
.asm-sec.clickable.done:hover .asm-fill { fill: #d2f0dc; stroke: #d2f0dc; }
.asm-label { font-size: 54px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; fill: #1c2230; pointer-events: none; }
.asm-label .sub { font-size: 40px; font-weight: 600; fill: #6b4a00; }
.asm-sec.done .asm-label .sub { fill: #146c3a; }
.asm-label .muted { font-size: 34px; font-weight: 500; fill: #5b6475; }

/* Tarih-saat seçici */
.dt-field { display: flex; gap: 8px; align-items: center; }
.dt-field .input { flex: 1; min-width: 0; }
.flatpickr-calendar { z-index: 80 !important; font-family: inherit; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary); border-color: var(--primary); }
.checklist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.checklist label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.checklist label.on { border-color: #1f9d55; background: #e4f6ea; }
.checklist input { width: 20px; height: 20px; }
.asm-summary { display: flex; flex-direction: column; gap: 10px; }
.asm-summary .row-step { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.asm-summary .row-step.done { border-color: #9ad8b0; background: #f3fbf6; }
.asm-summary .row-step.todo { border-color: #f3dc8a; background: #fffbea; }
.section-title { font-size: 15px; margin: 4px 0 8px; }
.asm-extra .plane-part { stroke: #1c2230; stroke-width: 4; }
.asm-extra.clickable { cursor: pointer; }
.asm-extra.clickable:hover .plane-part { stroke: #b8860b; stroke-width: 8; }
.asm-label.extra { font-size: 32px; }
.asm-label.extra .sub { font-size: 24px; }

/* GÖVDE / KAPAK / ELEKTRONİK katmanı: GÖVDE'de kapak ve elektronik gizli; diğerlerinde seçilmeyen katman silik */
svg[data-layer="body"] .layer-cover, svg[data-layer="body"] .layer-electronics { display: none; }
svg[data-layer="cover"] .layer-body, svg[data-layer="cover"] .layer-electronics,
svg[data-layer="electronics"] .layer-body, svg[data-layer="electronics"] .layer-cover {
  opacity: .2; pointer-events: none;
}
svg[data-layer="cover"] .plane-label.cover-label.layer-cover,
svg[data-layer="electronics"] .plane-label.cover-label.layer-electronics { font-size: 20px; font-weight: 800; fill: #7a1f1f; }
svg[data-layer] .plane-label.cover-label.small { font-size: 11px; }
.layer-toggle { display: flex; justify-content: flex-start; margin: 2px 4px 8px; }
.layer-toggle .seg button { min-width: 84px; font-weight: 700; letter-spacing: .04em; }

/* Üretim panosu: sütun aç/kapa */
.col-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.col-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.col-toggle.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.col-toggle .n { background: #e9edf3; color: #3b4555; border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* Saha görevi: araç ekleme satırı */
.road-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.road-add select { flex: 1 1 180px; min-width: 0; }
.road-add input { flex: 0 1 140px; }

/* Yükleme çubuğu + iptal */
.upload-panel { display: flex; gap: 10px; align-items: center; }
.upload-panel .grow { flex: 1; min-width: 0; }

/* 3B uçuş oynatma (Cesium) */
.r3d-stage { position: relative; height: calc(100dvh - 190px); min-height: 420px; border-radius: var(--radius); overflow: hidden;
  background: #0b1220; box-shadow: var(--shadow); }
.r3d-map { position: absolute; inset: 0; }
.r3d-map .cesium-viewer-bottom { left: 180px; }
.r3d-loading { color: #cfd5e1; display: flex; align-items: center; justify-content: center; height: 100%; }
.r3d-hud { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(11, 18, 32, .78); color: #e6e9ef;
  border-radius: 10px; padding: 10px 12px; min-width: 210px; font-size: 13px; pointer-events: none; }
.r3d-hud > div { display: flex; justify-content: space-between; gap: 14px; line-height: 1.7; }
.r3d-hud > div span { color: #9aa4b6; }
.r3d-hud .r3d-hud-head { justify-content: flex-start; gap: 6px; align-items: center; margin-bottom: 4px; }
.r3d-hud .r3d-hud-head b { font-size: 18px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.r3d-tools { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 60%; }
@media (max-width: 640px) {
  .r3d-stage { height: calc(100dvh - 170px); }
  .r3d-hud { font-size: 12px; min-width: 0; padding: 8px 10px; }
  .r3d-tools { top: auto; bottom: 80px; right: 8px; max-width: 70%; }
}

/* Saha görevleri listesi: temel bilgi + küçük ayrıntılar */
.task-table td { vertical-align: top; white-space: normal; }
.task-table td:nth-child(3) { min-width: 260px; }
.task-sub { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.task-sub span { color: #8a93a5; }

/* Stok: uçak haritası daha büyük (yan panel dar, yükseklik sınırı ekran boyu) */
.stock-layout { grid-template-columns: minmax(0, 1fr) 260px; }
.stock-layout .plane-stage svg { max-height: calc(100dvh - 120px); min-height: 520px; }
@media (max-width: 900px) { .stock-layout .plane-stage svg { min-height: 0; } }

/* Kullanıcı menüsündeki modül bağlantıları (Araçlar, Kullanıcı Yönetimi) */
.dropdown .menu-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; text-decoration: none; }
.dropdown .menu-link:hover { background: var(--surface-2); text-decoration: none; }
.dropdown .menu-link svg { width: 18px; height: 18px; color: var(--primary); }
.dropdown .menu-link.tone-red svg { color: #b42318; }
.dropdown .menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Evrak Yönetimi ---------- */
.doc-filters { align-items: center; }
.doc-search-wrap { position: relative; flex: 1 1 360px; min-width: 0; }
.doc-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.doc-search-wrap .doc-search { width: 100%; padding-left: 38px; height: 44px; font-size: 15px; }
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; color: var(--text); text-decoration: none; }
.doc-row:hover { text-decoration: none; border-color: var(--primary); }
.doc-list.compact { gap: 0; }
.doc-list.compact .doc-row { padding: 10px 4px; border-bottom: 1px solid var(--border); align-items: center; }
.doc-list.compact .doc-row:last-child { border-bottom: 0; }
.doc-row .grow { flex: 1; min-width: 0; }
.doc-thumb { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #fff; flex: 0 0 auto; }
.doc-thumb-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--primary); }
.doc-thumb-icon svg { width: 28px; height: 28px; }
.doc-thumb-icon.video { color: #b7791f; }
.doc-thumb.big { width: 120px; height: 150px; }
.doc-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.doc-snippet { margin-top: 6px; font-size: 13px; color: #3b4555; background: var(--surface-2); border-radius: 6px; padding: 6px 8px; line-height: 1.45; }
.doc-snippet mark, .ocr-text mark { background: #ffe08a; color: inherit; border-radius: 3px; padding: 0 2px; }
.doc-chips { justify-content: flex-start; margin-top: 6px; }
.chip.light { background: var(--surface-2); color: var(--muted); }
.doc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; white-space: nowrap; }
.upload-files { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.upload-file { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; }
.upload-file .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin-top: 8px; }
.chip-x { border: 0; background: none; cursor: pointer; margin-left: 4px; font-size: 14px; line-height: 1; color: inherit; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-stage { padding: 8px; }
.doc-preview { width: 100%; max-height: calc(100dvh - 220px); object-fit: contain; display: block; border-radius: 8px; background: #0b1220; }
.doc-preview.pdf { height: calc(100dvh - 220px); border: 0; background: #fff; }
.doc-preview.none { background: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; }
.ocr-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13px; line-height: 1.55; max-height: 55vh;
  overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; }

/* ---------- Firma Yönetimi ---------- */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.co-card { display: flex; gap: 14px; align-items: center; padding: 14px; color: var(--text); text-decoration: none; }
.co-card:hover { text-decoration: none; border-color: var(--primary); }
.co-card.inactive { opacity: .6; }
.co-card .grow { flex: 1; min-width: 0; }
.co-logo { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: 0 0 auto; }
.co-logo.big { width: 88px; height: 88px; }
.co-initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary);
  background: var(--primary-soft); font-size: 18px; }
.co-logo.big.co-initials { font-size: 28px; }
.co-counts { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.co-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.co-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.co-head h2 { margin: 0 0 4px; font-size: 20px; }
.co-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.co-section-head h2 { font-size: 15px; margin: 0; flex: 1; }
@media (max-width: 900px) {
  .doc-layout, .co-layout { grid-template-columns: 1fr; }
  .doc-side { display: none; }
  .doc-preview.pdf { height: 70vh; }
}

/* Firma toplantıları */
.meet-list { display: flex; flex-direction: column; gap: 10px; }
.meet-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.meet-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.meet-head .grow { flex: 1; min-width: 160px; }
.meet-when { font-size: 13px; color: var(--primary); white-space: nowrap; }
.meet-sub { font-size: 12.5px; color: #3b4555; line-height: 1.5; }
.meet-sub span { color: var(--muted); }
.meet-notes { margin-top: 6px; font-size: 13px; white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.meet-notes.collapsed { max-height: 3.2em; overflow: hidden; position: relative; }
.meet-sides .pick-list { max-height: 34vh; }

/* İmza */
.sign-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sign-actions .btn { flex: 1 1 120px; }
.sign-block { margin-top: 10px; padding: 10px 12px; border: 1px solid #9ad8b0; background: #f3fbf6; border-radius: 10px; }
.sign-block .mono { word-break: break-all; }

/* Firma adresleri */
.addr-list { display: flex; flex-direction: column; gap: 8px; }
.addr-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.addr-item .grow { flex: 1; min-width: 0; }

/* Yedek parça stoğu */
.spare-list { display: flex; flex-direction: column; gap: 8px; }
.spare-row { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; }
.spare-row.low { border-color: #f5c2bd; background: #fff4f2; }
.spare-row .grow { flex: 1; min-width: 140px; }
.spare-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.spare-num b { font-size: 20px; color: var(--primary); }
.spare-row.low .spare-num b { color: var(--danger); }
.spare-num span { font-size: 11px; color: var(--muted); }
.spare-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.spare-stock { display: flex; align-items: baseline; gap: 8px; }
.spare-stock b { font-size: 32px; color: var(--primary); }

/* ---------- Ürün ağacı ---------- */
.tree-view-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ptree-root { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.ptree-level { border-left: 2px solid var(--border); margin-left: 12px; padding-left: 12px; display: flex; flex-direction: column; gap: 6px; }
.ptree-node { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; background: var(--surface-2); }
.ptree-node summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.ptree-node summary::-webkit-details-marker { display: none; }
.ptree-node summary::before { content: "▸"; color: var(--muted); }
.ptree-node[open] summary::before { content: "▾"; }
.ptree-node summary a { font-weight: 600; }
.ptree-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ptree-parts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ptree-part { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 1px 4px 1px 9px; font-size: 12px; color: var(--text); }
.ptree-part:hover { border-color: var(--primary); text-decoration: none; }
.tree-stock { min-width: 20px; text-align: center; border-radius: 999px; background: var(--surface-2); color: var(--faint); font-size: 11px; font-weight: 700; padding: 0 5px; }
.tree-stock.on { background: #e5f5ea; color: #1e7b3a; }

.ptree-sarf { margin-top: 8px; font-size: 13px; }
.usage-grid { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.usage-head { font-size: 12px; font-weight: 700; color: var(--muted); }
.usage-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.usage-row .input { width: 90px; height: 32px; }
.usage-row.total { border-top: 1px solid var(--border); padding-top: 6px; }

/* ---------- Firma Yönetimi: Rehber ---------- */
.dir-wrap { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.dir-index { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; }
.dir-index a { text-align: center; font-size: 12px; font-weight: 700; padding: 3px 0; border-radius: 6px; color: var(--muted); }
.dir-index a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.dir-list { display: flex; flex-direction: column; gap: 14px; }
.dir-group { scroll-margin-top: 10px; }
.dir-letter { font-size: 14px; color: var(--primary); margin: 0 0 6px 4px; }
.dir-card { padding: 0; overflow: hidden; }
.dir-row { display: grid; grid-template-columns: 42px minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; }
.dir-row + .dir-row { border-top: 1px solid var(--border); }
.dir-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.dir-main { min-width: 0; }
.dir-main b { display: block; }
.dir-company { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 3px; color: var(--text); }
.co-logo.xs { width: 20px; height: 20px; border-radius: 5px; }
.co-logo.xs.co-initials { font-size: 9px; }
.dir-note { margin-top: 2px; }
.dir-contact { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dir-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-link svg { width: 15px; height: 15px; flex: none; }
.dir-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) {
  .dir-wrap { grid-template-columns: 1fr; }
  .dir-index { display: none; }
  .dir-row { grid-template-columns: 42px minmax(0, 1fr); }
  .dir-contact, .dir-actions { grid-column: 2; justify-content: flex-start; }
}

.print-kv { margin: 0 0 12px; }
.print-kv dd { word-break: break-word; }

/* ---------- Sekmeler (firma / rehber detayı) ---------- */
.tabs-card { padding: 0; overflow: hidden; margin-top: 16px; }
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 10px; overflow-x: auto; scrollbar-width: thin; background: var(--surface-2); }
.tab { border: 0; background: none; padding: 12px 14px 10px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.tab-n { background: var(--border); color: var(--muted); border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.tab.on .tab-n { background: var(--primary-soft); color: var(--primary); }
.tab-body { padding: 16px; min-height: 160px; }
.co-top { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.co-top .co-head { flex: 1 1 320px; }
.co-top-kv { flex: 2 1 380px; margin: 0; }
.meet-item.link { color: var(--text); display: block; }
.meet-item.link:hover { border-color: var(--primary); text-decoration: none; }

/* ---------- Rehber kartları ---------- */
.dir-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dir-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 14px 14px; color: var(--text);
  transition: transform .15s, box-shadow .15s, border-color .15s; border-top: 3px solid var(--primary); min-width: 0; }
.dir-tile.user { border-top-color: #1f9d55; }
.dir-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); text-decoration: none; }
.dir-tile .dir-name { font-size: 15px; margin-top: 6px; }
.dir-tile .dir-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-tile .dir-company { justify-content: center; max-width: 100%; }
.dir-company { max-width: 100%; white-space: nowrap; }
.dir-org { overflow: hidden; text-overflow: ellipsis; }
.dir-kind { font-size: 11px; font-weight: 700; color: #1e7b3a; background: #e5f5ea; border-radius: 999px; padding: 1px 8px; flex: none; }
.dir-tile-links { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-width: 100%; }
.dir-avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.dir-avatar.xl { width: 84px; height: 84px; font-size: 26px; flex: none; }
.dir-avatar.user { background: #e5f5ea; color: #1e7b3a; }
.dir-avatar.photo { object-fit: cover; padding: 0; }
a.dir-row { color: var(--text); }
a.dir-row:hover { background: var(--surface-2); text-decoration: none; }
.contact-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.contact-head h2 { font-size: 20px; }
.contact-kv { margin: 0; flex: 1 1 280px; }

/* ---------- Notlar ---------- */
.notes-panel { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.note-add { display: flex; flex-direction: column; gap: 8px; }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-item { border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.note-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.note-meta .grow { flex: 1; }
.note-body { white-space: pre-wrap; margin-top: 6px; line-height: 1.5; }

/* ---------- Takvim ---------- */
.cal-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-bar .grow { flex: 1; }
.cal-title { font-size: 16px; margin-left: 6px; min-width: 130px; }
.cal-legend { display: inline-flex; gap: 10px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.cal-dot::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; background: var(--ev); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--border); gap: 1px; }
.cal-head { background: var(--surface-2); text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cal-cell { background: var(--surface); min-height: 96px; padding: 4px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-day { color: var(--faint); }
.cal-cell.today .cal-day { background: var(--primary); color: #fff; }
.cal-day { align-self: flex-end; font-size: 12px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-chip { --ev: #1f6feb; border: 0; text-align: left; font: inherit; font-size: 11.5px; border-radius: 5px; padding: 2px 5px; cursor: pointer;
  background: color-mix(in srgb, var(--ev) 14%, var(--surface)); color: var(--text); border-left: 3px solid var(--ev);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { background: color-mix(in srgb, var(--ev) 26%, var(--surface)); }
.cal-chip.done { text-decoration: line-through; opacity: .6; }
.cal-time { font-weight: 700; margin-right: 4px; }
.randevu, .cal-dot.randevu { --ev: #1f6feb; }
.hatirlatma, .cal-dot.hatirlatma { --ev: #d99a00; }
.toplanti, .cal-dot.toplanti { --ev: #8b5cf6; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-upcoming { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cal-upcoming h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-up { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; font: inherit; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.cal-up:hover { border-color: var(--primary); }
.cal-up.done { opacity: .6; }
.cal-up-when { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 120px; }
@media (max-width: 760px) {
  .cal-cell { min-height: 64px; }
  .cal-chip .cal-time { display: none; }
  .cal-legend { display: none; }
  .tab-body { padding: 12px; }
}

/* ---------- Ses / video evrakı: konuşma metni ve videodaki kişiler ---------- */
.doc-preview.audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 16px; }
.doc-preview.audio audio { width: min(520px, 100%); }
.tr-line { display: flex; gap: 8px; align-items: baseline; white-space: pre-wrap; padding: 1px 0; }
.tr-time { border: 0; background: var(--primary-soft); color: var(--primary); font: inherit; font-size: 11px; font-weight: 700;
  border-radius: 5px; padding: 0 6px; cursor: pointer; flex: none; font-variant-numeric: tabular-nums; }
.tr-time:hover { background: var(--primary); color: #fff; }
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font: inherit; color: var(--text);
  border: 2px solid var(--border); border-radius: 12px; background: var(--surface); padding: 8px 6px; cursor: pointer; position: relative;
  transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.face:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.face img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.face.unknown { border-style: dashed; border-color: #f3dc8a; }
.face.unknown img { filter: grayscale(.35); }
.face.known { border-color: #9ad8b0; }
.face b { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face .small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face-auto { position: absolute; top: 4px; right: 4px; font-size: 9.5px; font-weight: 700; background: var(--warning-soft); color: var(--warning);
  border-radius: 999px; padding: 0 6px; }
.face-assign { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.face-assign .grow { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.face-assign-img { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 170px; text-align: center; }
.face-assign-img img { width: 160px; height: 160px; border-radius: 14px; object-fit: cover; }
.face-pick { max-height: 50vh; overflow: auto; }
.pick-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 2px 2px; }
@media (max-width: 760px) { .face-assign-img { width: 100%; } }

/* ---------- Alt durum çubuğu (canlı sunucu durumu) ---------- */
.app-footer { padding: 6px 20px; min-height: 42px; }
.statusbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.sb-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sb-label { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sb-item b { color: var(--text); font-weight: 700; min-width: 30px; }
.sb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.sb-disk-bar { width: 90px; height: 8px; border-radius: 999px; background: var(--success-soft); border: 1px solid var(--border); overflow: hidden; }
.sb-disk-fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width .4s; }
.sb-disk-fill.warn { background: var(--warning); }
.sb-disk-fill.bad { background: var(--danger); }
.sb-val { color: var(--muted); }
.sb-spark { width: 120px; height: 26px; display: block; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.sb-line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sb-area { stroke: none; opacity: .16; }
.sb-line.cpu, .sb-cpu { stroke: #1f6feb; color: #1f6feb !important; }
.sb-area.cpu { fill: #1f6feb; }
.sb-line.gpu, .sb-gpu { stroke: #16a34a; color: #16a34a !important; }
.sb-area.gpu { fill: none; }
.sb-line.ram, .sb-ram { stroke: #9333ea; color: #9333ea !important; }
.sb-area.ram { fill: #9333ea; }
@media (max-width: 1100px) { .sb-val { display: none; } }
@media (max-width: 760px) {
  .footer-copy { display: none; }
  .app-footer { padding: 6px 10px; }
  .statusbar { gap: 10px; justify-content: space-between; width: 100%; flex-wrap: nowrap; overflow: hidden; }
  .sb-spark { display: none; }
  .sb-disk-bar { width: 50px; }
  .sb-users .sb-label { display: none; }
}

/* ---------- Gece teması (yalnızca ekranda; çıktılar her zaman açık renk) ---------- */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f141c;
    --surface: #171e29;
    --surface-2: #1d2532;
    --text: #e4e9f1;
    --muted: #a3adbd;
    --faint: #7c8798;
    --border: #2a3444;
    --border-strong: #3a4659;
    --primary: #4a8ae0;
    --primary-hover: #3a78cc;
    --primary-soft: #1c2d47;
    --danger: #f2837a;
    --danger-soft: #3a1f1f;
    --success: #5cc986;
    --success-soft: #173323;
    --warning: #e3b341;
    --warning-soft: #362c12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
    --st-bekliyor: #273142;
    --st-uretimde: #1f4a7a;
    --st-depo: #6b5a14;
    --st-montaj: #1f5a2c;
    --st-hata: #7a2626;
    --part-fill: #273142;
    --part-off: #1a212c;
    --cover-fill: #4a2626;
  }
  html[data-theme="dark"] .badge.blue, html[data-theme="dark"] .pcell.blue { background: #1c2d47; border-color: #2d4a73; color: #8bb8f5; }
  html[data-theme="dark"] .pcell.blue span { color: #8bb8f5; }
  html[data-theme="dark"] .badge.purple { background: #2a2140; border-color: #45356b; color: #c3a6f5; }
  html[data-theme="dark"] .badge.yellow { border-color: #5c4a17; }
  html[data-theme="dark"] .badge.green, html[data-theme="dark"] .pcell.green { border-color: #24583a; }
  html[data-theme="dark"] .badge.red, html[data-theme="dark"] .pcell.red, html[data-theme="dark"] .pcell.yellow,
  html[data-theme="dark"] .stat.alert, html[data-theme="dark"] .spare-row.low { border-color: #5c2a2a; background: var(--danger-soft); }
  html[data-theme="dark"] .pcell.stale, html[data-theme="dark"] .admin-tiles .tile.alert,
  html[data-theme="dark"] .module-btn.tone-red .ico, html[data-theme="dark"] .app-tile.tone-red .ico { background: var(--danger-soft); }
  html[data-theme="dark"] .progress, html[data-theme="dark"] .kanban-col, html[data-theme="dark"] .col-toggle .n { background: #232c3a; color: var(--muted); }
  html[data-theme="dark"] .login-wrap { background: radial-gradient(circle at 50% 45%, #1a2433, #0f141c 70%); }
  html[data-theme="dark"] .login { background: rgba(23, 30, 41, .9); }
  html[data-theme="dark"] .brand img, html[data-theme="dark"] .login img { filter: brightness(0) invert(1); }
  html[data-theme="dark"] .tone-red { --primary: #e5534b; --primary-hover: #c9443d; --primary-soft: #3a1f1f; }
  html[data-theme="dark"] .module-btn.tone-red { border-color: #5c2a2a; background: linear-gradient(180deg, var(--surface), #2a1a1d); }
  html[data-theme="dark"] .module-btn.tone-red .ico, html[data-theme="dark"] .app-tile.tone-red .ico { background: #3a1f1f; color: #f2837a; }
  html[data-theme="dark"] .module-btn.tone-red:hover { border-color: #e5534b; }
  html[data-theme="dark"] main#view .card.product-card.mamul { border-color: #4a8ae0; }
  html[data-theme="dark"] main#view.tone-red .card:not(.product-card) { border-color: #3a2a2d; }
  html[data-theme="dark"] .type-tag.mamul { background: #1c2d47; color: #8bb8f5; }
  html[data-theme="dark"] .alert.warn { border-color: #5c4a17; color: var(--warning); }
  html[data-theme="dark"] .alert.err { border-color: #5c2a2a; }
  html[data-theme="dark"] .alert.info { border-color: #2d4a73; }
  html[data-theme="dark"] .asm-sec.info .asm-edge { fill: #4a8ae0; stroke: #4a8ae0; }
  html[data-theme="dark"] .asm-sec.info .asm-fill { fill: #1a2638; stroke: #1a2638; }
  html[data-theme="dark"] .asm-sec.info.clickable:hover .asm-fill { fill: #213150; stroke: #213150; }
  html[data-theme="dark"] .asm-sec.info .asm-label .sub { fill: #8bb8f5; }
  html[data-theme="dark"] .tree-stock.on { background: #173323; color: #5cc986; }
  html[data-theme="dark"] .face.unknown { border-color: #5c4a17; }
  html[data-theme="dark"] .face.known { border-color: #24583a; }
  html[data-theme="dark"] .dir-kind { background: #173323; color: #5cc986; }
  html[data-theme="dark"] .dir-avatar.user { background: #173323; color: #5cc986; }
  html[data-theme="dark"] .type-tag.semi { background: #173323; color: #5cc986; }
  html[data-theme="dark"] .type-tag.spare { background: #362c12; color: #e3b341; }
  html[data-theme="dark"] .plane-part, html[data-theme="dark"] .asm-extra .plane-part { stroke: #b9c4d6; }
  html[data-theme="dark"] .plane-part.cover { stroke: #f2837a; }
  html[data-theme="dark"] .plane-part.hot { stroke: #e3b341; filter: brightness(1.2); }
  html[data-theme="dark"] .plane-label, html[data-theme="dark"] .plane-label.count, html[data-theme="dark"] .asm-label { fill: #e4e9f1; }
  html[data-theme="dark"] .plane-label.zero { fill: #f2837a; }
  html[data-theme="dark"] .plane-hole { fill: #f2837a; }
  html[data-theme="dark"] .plane-slot, html[data-theme="dark"] .plane-inner { stroke: #f2837a; }
  html[data-theme="dark"] .legend i { border-color: #b9c4d6; }
  html[data-theme="dark"] .admin-plane .plane-label.printing { fill: #8bb8f5; }
  html[data-theme="dark"] .admin-plane .plane-label .pr { fill: #8bb8f5; }
  html[data-theme="dark"] .asm-sec.todo .asm-fill { fill: #3a3112; stroke: #3a3112; }
  html[data-theme="dark"] .asm-sec.done .asm-fill { fill: #173323; stroke: #173323; }
  html[data-theme="dark"] .asm-sec.clickable.todo:hover .asm-fill { fill: #4a3e14; stroke: #4a3e14; }
  html[data-theme="dark"] .asm-sec.clickable.done:hover .asm-fill { fill: #1e4230; stroke: #1e4230; }
  html[data-theme="dark"] .asm-label .sub { fill: #e3b341; }
  html[data-theme="dark"] .asm-sec.done .asm-label .sub { fill: #5cc986; }
  html[data-theme="dark"] .asm-label .muted { fill: #a3adbd; }
  html[data-theme="dark"] .asm-summary .row-step.done, html[data-theme="dark"] .sign-block { border-color: #24583a; background: #132a1d; }
  html[data-theme="dark"] .asm-summary .row-step.todo { border-color: #5c4a17; background: #2a2410; }
  html[data-theme="dark"] .checklist label.on { border-color: #24583a; background: #173323; }
  html[data-theme="dark"] .chart-grid, html[data-theme="dark"] .map-grid { stroke: #2a3444; }
  html[data-theme="dark"] .doc-snippet mark, html[data-theme="dark"] .ocr-text mark { background: #6b5a14; }
  html[data-theme="dark"] .sb-line.cpu, html[data-theme="dark"] .sb-cpu { stroke: #6aa3f0; color: #6aa3f0 !important; }
  html[data-theme="dark"] .sb-area.cpu { fill: #6aa3f0; }
  html[data-theme="dark"] .sb-line.gpu, html[data-theme="dark"] .sb-gpu { stroke: #5cc986; color: #5cc986 !important; }
  html[data-theme="dark"] .sb-line.ram, html[data-theme="dark"] .sb-ram { stroke: #c38cf5; color: #c38cf5 !important; }
  html[data-theme="dark"] .sb-area.ram { fill: #c38cf5; }
}
