/* ============================================================================
   CICUPACK PANEL — TASARIM SİSTEMİ
   Marka: lacivert #15375C · camgöbeği #00ACD8
   Yerleşim: sol sidebar (logo sol üstte) + üst şerit + içerik
   Kural: her renk, her boşluk, her yarıçap değişkenden gelir. Sabit renk yazılmaz.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* marka */
  --brand:          #15375C;
  --brand-deep:     #0E2540;
  --brand-ink:      #081726;
  --accent:         #00ACD8;
  --accent-strong:  #0090B8;
  --accent-soft:    #00acd814;
  --accent-line:    #00acd833;
  --accent-fg:      #ffffff;

  /* yüzeyler */
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f6f9fb;
  --surface-3: #eaf1f6;

  /* metin */
  --fg:   #0d2136;
  --fg-2: #43607a;
  --fg-3: #7d95a9;
  --fg-4: #a9bccb;

  /* çizgi */
  --border:        #15375c14;
  --border-strong: #15375c2b;

  /* anlam */
  --ok:   #0e8a63;  --ok-soft:   #0e8a6314;
  --warn: #b7791f;  --warn-soft: #b7791f14;
  --err:  #c0392b;  --err-soft:  #c0392b14;
  --info: #2563eb;  --info-soft: #2563eb14;

  /* sidebar (her temada koyu) */
  --nav-bg:      #0E2540;
  --nav-bg-2:    #15375C;
  --nav-fg:      #c9dbe9;
  --nav-fg-dim:  #7f9cb5;
  --nav-active:  #ffffff;
  --nav-hover:   #ffffff0f;

  /* ölçü */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --nav-w:     248px;
  --top-h:     64px;
  --shadow-1:  0 1px 2px #0d213608, 0 1px 3px #0d213610;
  --shadow-2:  0 4px 12px #0d21360f, 0 12px 32px #0d21360d;
  --shadow-3:  0 24px 64px #0d213626;

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #08131d; --surface: #0f1f2c; --surface-2: #14273600; --surface-2: #142736; --surface-3: #1b3145;
  --fg: #e8f1f7; --fg-2: #a9c2d3; --fg-3: #7793a8; --fg-4: #4f6b80;
  --border: #e8f1f712; --border-strong: #e8f1f726;
  --accent-soft: #00acd81f; --shadow-1: none; --shadow-2: 0 8px 28px #00000040;
  --nav-bg: #061019; --nav-bg-2: #0c2033;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--fg);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01'; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); text-decoration: none; }
::selection { background: var(--accent-line); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }

/* ---------------------------------------------------------------- İSKELET */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
body.logged-out .app { display: none; }

/* SIDEBAR */
.sidebar {
  background: linear-gradient(178deg, var(--nav-bg-2) 0%, var(--nav-bg) 62%);
  color: var(--nav-fg); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.sidebar-head { padding: 22px 18px 14px; display: flex; align-items: center; gap: 10px; }
.sidebar-head img { height: 52px; width: auto; max-width: 170px; object-fit: contain; display: block; }
.sidebar-head .tagline {
  font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--nav-fg-dim); margin-top: 9px; font-weight: 700;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 3px; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px; font-weight: 700;
  color: var(--nav-fg-dim); padding: 18px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border: 0; background: transparent; cursor: pointer;
  color: var(--nav-fg); font-size: 13.5px; font-weight: 500; text-align: left;
  border-radius: var(--radius-sm); position: relative; transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--nav-hover); color: #fff; }
.nav-item.active { background: #ffffff14; color: var(--nav-active); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav-item.active svg { opacity: 1; color: var(--accent); }
.nav-badge {
  margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--accent); color: #04222c; padding: 1px 7px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav-badge.quiet { background: #ffffff1f; color: var(--nav-fg); }
.sidebar-foot { padding: 12px 16px 16px; border-top: 1px solid #ffffff14; }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #06222c;
  display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 32px;
}
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .who b { display: block; font-size: 12.5px; color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who span { font-size: 11px; color: var(--nav-fg-dim); }
.sidebar-foot .mini-btn {
  background: transparent; border: 0; color: var(--nav-fg-dim); cursor: pointer;
  padding: 6px; border-radius: 6px; display: grid; place-items: center;
}
.sidebar-foot .mini-btn:hover { background: var(--nav-hover); color: #fff; }
.sidebar-foot .mini-btn svg { width: 16px; height: 16px; }

/* ÜST ŞERİT */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.hamburger { display: none; background: transparent; border: 0; cursor: pointer; color: var(--fg-2); padding: 6px; }
.hamburger svg { width: 22px; height: 22px; }
.crumb { font-size: 12px; color: var(--fg-3); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.topsearch {
  margin-left: auto; display: flex; align-items: center; gap: 9px; background: var(--surface-2);
  border: 1px solid transparent; border-radius: 10px; padding: 7px 12px; width: 320px; max-width: 38vw;
  transition: border-color .15s, background .15s;
}
.topsearch:focus-within { border-color: var(--accent-line); background: var(--surface); }
.topsearch svg { width: 15px; height: 15px; color: var(--fg-3); flex: none; }
.topsearch input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--fg-2); cursor: pointer; display: grid; place-items: center; transition: all .13s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }

/* İÇERİK */
.content { padding: 26px 28px 72px; max-width: 1560px; width: 100%; }
.inline-loader { padding: 60px; text-align: center; color: var(--fg-3); font-size: 13px; }

/* ---------------------------------------------------------------- SAYFA BAŞI */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.7px; line-height: 1.15; color: var(--fg); }
.page-head h1 .accent { color: var(--accent-strong); }
.page-sub { margin-top: 5px; font-size: 12.5px; color: var(--fg-3); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* BUTON */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .13s, border-color .13s, transform .08s, box-shadow .13s;
}
.btn:hover { background: var(--surface-2); border-color: var(--fg-4); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #05222c; }
.btn-accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { color: var(--err); border-color: #c0392b3d; background: transparent; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- KART / IZGARA */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 13.5px; font-weight: 700; letter-spacing: -0.2px; }
.card-head .hint { font-size: 11.5px; color: var(--fg-3); font-weight: 500; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }

/* KPI */
.kpi { position: relative; padding: 16px 18px; }
.kpi .k-label { font-size: 11.5px; font-weight: 600; color: var(--fg-3); text-transform: uppercase; letter-spacing: .7px; }
.kpi .k-value { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -1.4px; margin-top: 8px; line-height: 1; }
.kpi .k-foot { margin-top: 8px; font-size: 12px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.kpi.alert .k-value { color: var(--err); }
.kpi.good  .k-value { color: var(--ok); }
.kpi.wait  .k-value { color: var(--warn); }
.kpi::after { content: ''; position: absolute; inset: auto auto 0 0; height: 3px; width: 46px; background: var(--accent); opacity: .9; }
.kpi.alert::after { background: var(--err); } .kpi.good::after { background: var(--ok); } .kpi.wait::after { background: var(--warn); }
.kpi.clickable { cursor: pointer; transition: box-shadow .15s, transform .12s; }
.kpi.clickable:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

/* ---------------------------------------------------------------- TABLO */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--fg-3);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.open { background: var(--accent-soft); }
table.data .r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .c { text-align: center; }
table.data .strong { font-weight: 700; }
table.data .code { font-family: var(--mono); font-size: 12px; color: var(--fg-2); white-space: nowrap; }
table.data .muted { color: var(--fg-3); }
table.data tfoot td { padding: 12px 14px; border-top: 2px solid var(--border-strong); font-weight: 700; background: var(--surface-2); }
table.data.compact td, table.data.compact th { padding: 7px 10px; }

.detail-row > td { background: var(--surface-2); padding: 0 !important; }
.detail-box { padding: 18px 20px 22px; border-bottom: 1px solid var(--border); }

/* Etiket / durum rozeti */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1px; white-space: nowrap;
  background: var(--surface-3); color: var(--fg-2);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill.plain::before { display: none; }
.flag { font-size: 15px; line-height: 1; }

/* İlerleme */
.bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.bar.full > i { background: var(--ok); }

/* Filtre şeridi */
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px;
}
.chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border-strong); background: transparent;
  font-size: 12px; font-weight: 600; color: var(--fg-2); cursor: pointer; transition: all .12s;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filters .grow { flex: 1; min-width: 160px; }
.filters input[type="search"], .filters input[type="text"], .filters select {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px;
  padding: 6px 10px; font-size: 13px; outline: 0; min-width: 130px;
}
.filters input:focus, .filters select:focus { border-color: var(--accent); }
.count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--fg-3); }

/* ---------------------------------------------------------------- FORM */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.s3 { grid-column: span 3; } .field.s4 { grid-column: span 4; } .field.s8 { grid-column: span 8; }
.field.s12 { grid-column: span 12; }
.field > label { font-size: 11.5px; font-weight: 700; color: var(--fg-2); letter-spacing: .2px; }
.field > label .req { color: var(--err); }
.field .hint { font-size: 11px; color: var(--fg-3); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px;
  padding: 9px 11px; font-size: 13.5px; outline: 0; width: 100%; transition: border-color .13s, box-shadow .13s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[readonly] { background: var(--surface-2); color: var(--fg-2); }
.field textarea { min-height: 74px; resize: vertical; }
.field.inline-check { flex-direction: row; align-items: center; gap: 9px; }
.field.inline-check input { width: auto; }
.form-section {
  grid-column: span 12; font-size: 11px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--fg-3); padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px;
}

/* Yönetilebilir seçenek listesi (+ / −) */
.with-list { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.with-list select { flex: 1; min-width: 0; }
.list-btn {
  width: 34px; flex: 0 0 34px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 9px; cursor: pointer; font-size: 17px; font-weight: 700; line-height: 1;
  color: var(--fg-3); transition: all .12s;
}
.list-btn:hover { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); }
.list-inline {
  margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  background: var(--surface-2); border: 1px dashed var(--accent-line); border-radius: 10px; padding: 8px 9px;
  animation: fadeIn .14s ease both;
}
.list-inline.danger { border-color: #c0392b55; background: var(--err-soft); }
.list-inline input { flex: 1; min-width: 130px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 8px; padding: 7px 9px; font-size: 13px; outline: 0; }
.list-inline input:focus { border-color: var(--accent); }
.list-inline span { font-size: 12px; color: var(--fg-2); flex: 1; min-width: 150px; }
.list-inline i { font-style: normal; color: var(--fg-3); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

/* Kalem tablosu (teklif/sipariş satırları) */
.line-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.line-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--fg-3); font-weight: 700; padding: 7px 8px; border-bottom: 1px solid var(--border);
}
.line-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.line-table input, .line-table select {
  width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px;
  padding: 6px 7px; font-size: 12.5px; outline: 0;
}
.line-table input:hover, .line-table select:hover { border-color: var(--border-strong); }
.line-table input:focus, .line-table select:focus { border-color: var(--accent); background: var(--surface); }
.line-table input.r { text-align: right; font-family: var(--mono); }
.line-table .lt-del { color: var(--fg-4); background: transparent; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; }
.line-table .lt-del:hover { color: var(--err); background: var(--err-soft); }
.line-total-row td { background: var(--surface-2); font-weight: 700; }

/* Marj kutusu */
.margin-box { display: flex; gap: 22px; flex-wrap: wrap; padding: 13px 16px; background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.margin-box .mb-item .l { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--fg-3); font-weight: 700; }
.margin-box .mb-item .v { font-family: var(--mono); font-size: 17px; font-weight: 600; margin-top: 3px; }
.margin-box .mb-item .v.pos { color: var(--ok); } .margin-box .mb-item .v.neg { color: var(--err); }

/* Durum adımları */
.steps { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.steps .step {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px 6px 11px; background: var(--surface-2);
  color: var(--fg-3); font-size: 12px; font-weight: 600; border: 1px solid var(--border); border-right: 0;
}
.steps .step:first-child { border-radius: 20px 0 0 20px; padding-left: 14px; }
.steps .step:last-child { border-radius: 0 20px 20px 0; border-right: 1px solid var(--border); }
.steps .step.done { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); }
.steps .step.now { background: var(--brand); color: #fff; border-color: var(--brand); }
.steps .step.cancel { background: var(--err-soft); color: var(--err); }

/* Boş durum */
.empty { padding: 54px 20px; text-align: center; color: var(--fg-3); }
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 10px; }
.empty h3 { font-size: 15px; color: var(--fg-2); font-weight: 700; margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 420px; margin: 0 auto 14px; }

/* ---------------------------------------------------------------- MODAL */
.modal-scrim {
  position: fixed; inset: 0; background: #0d213666; backdrop-filter: blur(3px); z-index: 90;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow-y: auto;
}
.modal-scrim.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 620px;
  box-shadow: var(--shadow-3); animation: pop .18s cubic-bezier(.2,.9,.3,1); overflow: hidden;
}
.modal.wide { max-width: 1080px; }
.modal.xwide { max-width: 1340px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.modal-head .sub { font-size: 12px; color: var(--fg-3); font-weight: 500; margin-top: 2px; }
.modal-body { padding: 20px; max-height: calc(100vh - 230px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2); }

/* TOAST */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--fg-4);
  border-radius: 10px; box-shadow: var(--shadow-2); padding: 11px 14px; min-width: 270px; max-width: 380px;
  display: flex; gap: 10px; align-items: flex-start; animation: slideIn .2s ease both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); } .toast.info { border-left-color: var(--info); }
.toast .t-title { font-size: 13px; font-weight: 700; }
.toast .t-detail { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.toast .t-close { margin-left: auto; background: 0; border: 0; color: var(--fg-4); cursor: pointer; font-size: 16px; line-height: 1; }

/* Sekmeler */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  font-size: 13px; font-weight: 600; color: var(--fg-3); cursor: pointer; transition: all .12s;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

/* Bilgi satırları */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px 22px; }
.kv .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--fg-3); font-weight: 700; }
.kv .v { font-size: 13.5px; margin-top: 2px; font-weight: 500; word-break: break-word; }
.kv .v.mono { font-family: var(--mono); }

.note-box { background: var(--warn-soft); border: 1px solid #b7791f2e; border-radius: var(--radius);
  padding: 11px 14px; font-size: 12.5px; color: var(--fg-2); }
.note-box b { color: var(--warn); }

/* GİRİŞ EKRANI */
.login-scrim {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 20px;
  background: radial-gradient(1200px 700px at 15% 10%, #15375C 0%, #0E2540 45%, #081726 100%);
}
body.logged-out .login-scrim { display: grid; }
.login-card {
  width: 100%; max-width: 400px; background: #ffffff; border-radius: 20px; padding: 34px 30px 28px;
  box-shadow: 0 40px 90px #00000059; animation: pop .25s cubic-bezier(.2,.9,.3,1);
}
.login-card .logo { height: 40px; margin-bottom: 22px; display: block; }
.login-card h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; color: #0d2136; }
.login-card p.sub { font-size: 13px; color: #7d95a9; margin: 4px 0 22px; }
.login-card .field label { color: #43607a; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-err { background: #c0392b14; color: #c0392b; border-radius: 9px; padding: 9px 12px; font-size: 12.5px;
  font-weight: 600; margin-bottom: 12px; display: none; }
.login-foot { margin-top: 20px; text-align: center; font-size: 11px; color: #a9bccb; letter-spacing: .3px; }

/* Yükleniyor iskeleti */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; height: 12px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------------------------------------------------------------- MOBİL */
.scrim-nav { display: none; position: fixed; inset: 0; background: #0d213666; z-index: 45; }
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w); z-index: 50;
    transform: translateX(-100%); transition: transform .22s cubic-bezier(.3,.9,.3,1); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim-nav { display: block; }
  .hamburger { display: grid; }
  .content { padding: 18px 14px 60px; }
  .topsearch { width: auto; flex: 1; }
  .grid { gap: 12px; }
  .span-2,.span-3,.span-4,.span-5,.span-6,.span-7,.span-8,.span-9 { grid-column: span 12; }
  .field, .field.s3, .field.s4, .field.s8 { grid-column: span 12; }
  .page-head h1 { font-size: 22px; }
}
@media (min-width: 1001px) and (max-width: 1180px) {
  .span-3 { grid-column: span 6; } .span-4 { grid-column: span 6; }
}

/* ---------------------------------------------------------------- EVRAK (A4) */
.doc-sheet {
  background: #fff; color: #10202f; width: 210mm; min-height: 297mm; padding: 16mm 15mm;
  margin: 0 auto; font-size: 10.5pt; line-height: 1.42; box-shadow: var(--shadow-3);
}
.doc-sheet .d-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18mm;
  padding-bottom: 6mm; border-bottom: 2.5pt solid #15375C; }
.doc-sheet .d-logo { height: 17mm; }
.doc-sheet .d-co { font-size: 8.6pt; color: #43607a; line-height: 1.5; text-align: right; }
.doc-sheet .d-co b { color: #15375C; font-size: 10pt; display: block; margin-bottom: 1mm; }
.doc-sheet h1.d-title { font-size: 17pt; font-weight: 800; letter-spacing: -0.4pt; color: #15375C;
  margin: 7mm 0 1mm; text-transform: uppercase; }
.doc-sheet .d-no { font-family: var(--mono); font-size: 9pt; color: #43607a; }
.doc-sheet .d-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin: 6mm 0; }
.doc-sheet .d-party { border: 0.6pt solid #d8e3ec; border-radius: 2mm; padding: 4mm; }
.doc-sheet .d-party .lbl { font-size: 7.6pt; text-transform: uppercase; letter-spacing: .8pt; color: #7d95a9; font-weight: 700; }
.doc-sheet .d-party b { display: block; font-size: 11pt; color: #0d2136; margin: 1.5mm 0; }
.doc-sheet .d-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm 5mm; margin-bottom: 5mm; }
.doc-sheet .d-meta .k { font-size: 7.4pt; text-transform: uppercase; letter-spacing: .7pt; color: #7d95a9; font-weight: 700; }
.doc-sheet .d-meta .v { font-size: 9.6pt; font-weight: 600; }
.doc-sheet table.d-lines { width: 100%; border-collapse: collapse; margin-top: 3mm; }
.doc-sheet table.d-lines th {
  background: #15375C; color: #fff; font-size: 8pt; text-transform: uppercase; letter-spacing: .5pt;
  padding: 2.6mm 2.4mm; text-align: left; font-weight: 700;
}
.doc-sheet table.d-lines td { padding: 2.4mm; border-bottom: .5pt solid #e3ebf2; font-size: 9.4pt; vertical-align: top; }
.doc-sheet table.d-lines td.r, .doc-sheet table.d-lines th.r { text-align: right; font-variant-numeric: tabular-nums; }
.doc-sheet table.d-lines tr:nth-child(even) td { background: #f7fafc; }
.doc-sheet .d-tot { margin-top: 5mm; margin-left: auto; width: 82mm; }
.doc-sheet .d-tot div { display: flex; justify-content: space-between; padding: 1.8mm 0; font-size: 9.8pt; }
.doc-sheet .d-tot div.grand { border-top: 1.5pt solid #15375C; margin-top: 1.5mm; padding-top: 2.5mm;
  font-size: 12pt; font-weight: 800; color: #15375C; }
.doc-sheet .d-terms { margin-top: 7mm; font-size: 8.8pt; color: #43607a; }
.doc-sheet .d-terms b { color: #0d2136; }
.doc-sheet .d-sign { margin-top: 12mm; display: grid; grid-template-columns: 1fr 1fr; gap: 20mm; }
.doc-sheet .d-sign div { border-top: .6pt solid #b7c7d4; padding-top: 2mm; font-size: 8.4pt; color: #7d95a9; }
.doc-sheet .d-foot { margin-top: 8mm; padding-top: 3mm; border-top: .6pt solid #e3ebf2;
  font-size: 7.6pt; color: #92a8b8; display: flex; justify-content: space-between; gap: 6mm; }
.doc-toolbar { display: flex; gap: 8px; justify-content: center; padding: 14px; position: sticky; top: 0;
  background: var(--bg); z-index: 5; flex-wrap: wrap; }

@media print {
  body > *:not(.print-root) { display: none !important; }
  .print-root, .print-root * { visibility: visible; }
  .print-root { position: absolute; inset: 0; background: #fff; }
  .doc-toolbar { display: none !important; }
  .doc-sheet { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 12mm 10mm; }
  @page { size: A4; margin: 0; }
}
