/* ==========================================================================
   Hera Teklif — tasarım sistemi
   Marka: Hera mavisi (#1d4ea3) + lacivert. Sade yüzeyler, ince çizgiler,
   tablo ve rakam okunurluğu öncelikli.
   ========================================================================== */

:root {
    color-scheme: light;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

    --canvas: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --surface-3: #eef1f5;
    --ink: #142033;
    --ink-2: #3a4759;
    --muted: #6b7789;
    --faint: #98a2b3;
    --line: #e3e7ee;
    --line-strong: #d0d6df;

    --brand: #1d4ea3;
    --brand-hover: #173f86;
    --brand-ink: #ffffff;
    --brand-soft: #e9effa;
    --brand-soft-ink: #1a4593;
    --navy: #1b2a44;
    --focus: rgba(29, 78, 163, .22);

    --ok: #157a4a;      --ok-soft: #e6f4ec;     --ok-line: #c3e3d0;
    --warn: #9a5b00;    --warn-soft: #fdf3e1;   --warn-line: #f1dbb0;
    --bad: #b42a2a;     --bad-soft: #fcebea;    --bad-line: #f3c7c4;
    --info: #1d4ea3;    --info-soft: #e9effa;   --info-line: #c9d7f0;
    --neutral-soft: #eef1f5;

    --chart-a: #b9cbea;
    --chart-b: #1d4ea3;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(20, 32, 51, .05);
    --shadow: 0 1px 2px rgba(20, 32, 51, .04), 0 4px 16px rgba(20, 32, 51, .05);
    --shadow-lg: 0 12px 40px rgba(20, 32, 51, .16);
    --sidebar-w: 248px;
}

/* ---------- Koyu tema ---------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #0e131b;
    --surface: #151c26;
    --surface-2: #19212d;
    --surface-3: #202a38;
    --ink: #e6ebf2;
    --ink-2: #c3ccd8;
    --muted: #8d99ab;
    --faint: #66728a;
    --line: #253041;
    --line-strong: #324055;
    --brand: #5b8fe6;
    --brand-hover: #79a4ee;
    --brand-ink: #0b1220;
    --brand-soft: #1a2a46;
    --brand-soft-ink: #a9c4f5;
    --navy: #0b1018;
    --focus: rgba(91, 143, 230, .3);
    --ok: #5cc690;      --ok-soft: #13291f;     --ok-line: #23493a;
    --warn: #e7b25c;    --warn-soft: #2d2213;   --warn-line: #4d3b1e;
    --bad: #ef8a85;     --bad-soft: #301817;    --bad-line: #57302d;
    --info: #79a4ee;    --info-soft: #1a2a46;   --info-line: #2b4472;
    --neutral-soft: #202a38;
    --chart-a: #2c3f60;
    --chart-b: #5b8fe6;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

/* ---------- Temel ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
a { color: inherit; }
a:not([class]) { color: var(--brand); text-decoration: none; }
a:not([class]):hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ref { font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: -.01em; }
a.ref { color: var(--brand); text-decoration: none; }
a.ref:hover { text-decoration: underline; }
.num, .amount, td.right { font-variant-numeric: tabular-nums; }
.icon {
    width: 18px; height: 18px; flex: none;
    stroke: currentColor; fill: none; stroke-width: 1.75;
    stroke-linecap: round; stroke-linejoin: round;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Kabuk ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); flex: none;
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 14px;
    padding: 18px 14px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    transition: width .18s ease, transform .2s ease;
    overflow-y: auto;
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.sidebar .brand-logo { display: block; height: 38px; width: auto; }
.sidebar .brand-mark { display: none; height: 34px; width: auto; }
html[data-theme="dark"] .sidebar .brand-logo,
html[data-theme="dark"] .sidebar .brand-mark,
html[data-theme="dark"] .auth-logo {
    background: #fff; border-radius: 8px; padding: 4px 6px;
}
.rail-toggle {
    display: none; width: 32px; height: 32px; padding: 0; flex: none;
    align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--muted);
}
.rail-toggle:hover { background: var(--surface-3); color: var(--ink); }

.btn-new.btn-block { margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
    padding: 14px 10px 6px; font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.nav a {
    display: flex; align-items: center; gap: 10px;
    height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
    color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-soft-ink); }
.nav a.active .icon { color: var(--brand); }

.side-user {
    margin-top: auto; display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--surface-2);
}
.side-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.avatar {
    width: 34px; height: 34px; flex: none; display: grid; place-items: center;
    border-radius: 50%; background: var(--navy); color: #fff;
    font-size: 13px; font-weight: 650; text-decoration: none;
}
.who { min-width: 0; }
.who strong, .who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who strong { font-size: 13px; font-weight: 600; }
.who small { font-size: 12px; color: var(--muted); }
.side-links { display: none; }
.side-logout { margin: 0; }
.side-logout button {
    width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
}
.side-logout button:hover { background: var(--bad-soft); color: var(--bad); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 28px;
    background: color-mix(in srgb, var(--canvas) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; }
.menu-btn {
    display: none; width: 36px; height: 36px; padding: 0;
    align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.search {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    width: min(340px, 34vw); height: 36px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--muted);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.search .icon { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); }
.search kbd {
    font: 500 11px var(--font); color: var(--faint);
    border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.fx-rates {
    display: flex; align-items: center; height: 36px; flex: none;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
    font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.fx-rates span { padding: 0 10px; color: var(--ink-2); }
.fx-rates span + span { border-left: 1px solid var(--line); }
.fx-rates b { color: var(--muted); font-weight: 500; margin-right: 4px; }
.theme-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none; padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink-2); text-decoration: none;
}
.theme-btn:hover { background: var(--surface-3); }
.theme-btn .icon { width: 17px; height: 17px; }
.theme-btn .theme-moon, .theme-btn .theme-sun { display: flex; }
.theme-btn .theme-sun { display: none; }
html[data-theme="dark"] .theme-btn .theme-moon { display: none; }
html[data-theme="dark"] .theme-btn .theme-sun { display: flex; }
.theme-btn-float { position: absolute; top: 20px; right: 20px; }
.bell-count {
    position: absolute; top: -5px; right: -5px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; border: 2px solid var(--canvas);
    background: var(--bad); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 13px; text-align: center;
}
.content { flex: 1; width: 100%; min-width: 0; padding: 22px clamp(16px, 2.2vw, 40px) 48px; }

/* ---------- Sayfa başlığı ---------- */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 18px;
}
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 2px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- Bildirim şeritleri ---------- */
.banner, .flash, .errors, .brief {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; margin-bottom: 14px;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: 13.5px;
}
.banner { background: var(--info-soft); border-color: var(--info-line); color: var(--ink); justify-content: space-between; }
.banner a { color: var(--brand); font-weight: 600; }
.banner form { margin: 0; flex: none; }
.banner-close {
    width: 26px; height: 26px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 6px; background: transparent; color: var(--muted);
}
.banner-close:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.banner-close .icon { width: 15px; height: 15px; }
.flash::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor;
}
.flash-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.flash-bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.errors { display: block; list-style: none; background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.errors li { margin: 2px 0; }
.errors li::before { content: "• "; }

.brief-row { display: flex; align-items: center; gap: 8px; }
.brief-row .brief { flex: 1; }
.brief-row form { margin: 0; }
.brief { align-items: flex-start; }
.brief-text { flex: 1; min-width: 0; }
.brief-ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.brief-ico .icon { width: 17px; height: 17px; }
.brief strong { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.brief p { margin: 0; color: var(--ink); }
.brief-slim { align-items: center; padding: 8px 12px; margin-bottom: 8px; }
.brief-slim .brief-text { display: flex; align-items: baseline; gap: 10px; }
.brief-slim strong { display: inline; margin: 0; flex: none; }
.brief-kritik { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.brief-uyari { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.brief-bilgi { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.brief-slim.brief-kritik .brief-ico { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Kart ---------- */
.card, .stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card { padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 14px;
}
.card-head h2 { margin: 0; }
.card > h2:first-child { margin-bottom: 14px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 20px 0; }
.card.flush > .table-wrap { padding: 0; }
.section-title { font-size: 15px; font-weight: 650; }
.narrow { max-width: 760px; }
.lead { font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .card + .card { margin-top: 0; }
.split, .cards-2, .stat-grid, .dash-grid { display: grid; gap: 16px; }
.split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cards-2 > .card + .card { margin-top: 0; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }

/* ---------- KPI ---------- */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat > span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.stat strong { font-size: 26px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 4px; }
.stat small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-money strong { font-size: 19px; }
.stat-money strong + strong { margin-top: 0; }
.stat .stat-ico {
    width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); margin-bottom: 8px;
}
.stat-won .stat-ico { background: var(--ok-soft); color: var(--ok); }
.stat-month .stat-ico { background: var(--ok-soft); color: var(--ok); }
.stat-openamt .stat-ico { background: var(--warn-soft); color: var(--warn); }

/* Durum akışı */
.pipeline {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 16px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.pipeline a {
    position: relative; display: flex; flex-direction: column; gap: 2px;
    padding: 12px 16px; text-decoration: none;
}
.pipeline a + a { border-left: 1px solid var(--line); }
.pipeline a:hover { background: var(--surface-2); }
.pipeline a::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--pipe, var(--faint));
}
.pipeline strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pipeline span { font-size: 12.5px; color: var(--muted); }
.pipe-taslak { --pipe: var(--faint); }
.pipe-gonderildi { --pipe: var(--info); }
.pipe-revize { --pipe: var(--warn); }
.pipe-onaylandi { --pipe: var(--ok); }
.pipe-siparis { --pipe: #0f766e; }
.pipe-reddedildi { --pipe: var(--bad); }

/* Grafik */
.chart { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.swatch.all { background: var(--chart-a); }
.swatch.won { background: var(--chart-b); }

/* Listeler */
.due { display: flex; flex-direction: column; }
.due a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.due a:first-child { padding-top: 0; }
.due a:last-child { border-bottom: 0; padding-bottom: 0; }
.due a:hover .ref { color: var(--brand); }
.due a > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.due-when { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-when.late { color: var(--bad); font-weight: 500; }
.due-when.near { color: var(--warn); font-weight: 500; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline .muted { font-size: 12px; }
.dot { width: 13px; height: 13px; margin-top: 4px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.dot-taslak, .dot-suresi_doldu { background: var(--faint); }
.dot-gonderildi { background: var(--info); }
.dot-revize { background: var(--warn); }
.dot-onaylandi, .dot-siparis { background: var(--ok); }
.dot-reddedildi, .dot-iptal { background: var(--bad); }

.notices { display: flex; flex-direction: column; }
.notice {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px; border-radius: var(--radius-sm); text-decoration: none;
}
.notice + .notice { border-top: 1px solid var(--line); }
.notice:hover { background: var(--surface-2); }
.notice.unread { background: var(--brand-soft); }
.notice-copy { flex: 1; min-width: 0; }
.notice strong { display: block; font-size: 13.5px; font-weight: 600; }
.notice p { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.notice .muted { display: block; margin-top: 4px; font-size: 12px; }
.notice-ico {
    width: 32px; height: 32px; flex: none; display: grid; place-items: center;
    border-radius: 8px; background: var(--brand-soft); color: var(--brand);
}
.notice-ico .icon { width: 16px; height: 16px; }
.notice-ico-quote_status { background: var(--warn-soft); color: var(--warn); }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
    font-size: 13.5px; font-weight: 550; text-decoration: none; white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-3); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary, .btn-new { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover, .btn-new:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-pdf { color: var(--ok); }
.btn-pdf:hover { background: var(--ok-soft); border-color: var(--ok-line); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad-line); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }

/* ---------- Rozetler ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
    border-radius: 6px; font-size: 12px; font-weight: 550; white-space: nowrap;
    background: var(--neutral-soft); color: var(--ink-2);
}
.badge[class*="badge-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-taslak, .badge-suresi_doldu { background: var(--neutral-soft); color: var(--muted); }
.badge-gonderildi { background: var(--info-soft); color: var(--info); }
.badge-revize { background: var(--warn-soft); color: var(--warn); }
.badge-onaylandi, .badge-siparis { background: var(--ok-soft); color: var(--ok); }
.badge-reddedildi, .badge-iptal { background: var(--bad-soft); color: var(--bad); }
.badge-domestic, .badge-export, .badge-tr, .badge-en {
    background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500;
}
.badge-domestic::before, .badge-export::before, .badge-tr::before, .badge-en::before { display: none; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
table.data th {
    font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em;
    text-transform: uppercase; background: var(--surface-2); white-space: nowrap;
}
table.data th.right, table.data td.right { text-align: right; }
table.data tbody tr:last-child td, table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
.card > .table-wrap > table.data, .card > table.data { margin: 0 -20px; width: calc(100% + 40px); }
.card > .table-wrap { margin: 0 -20px -18px; }
.card > .table-wrap > table.data { margin: 0; width: 100%; }
.card > .table-wrap > table.data th:first-child,
.card > .table-wrap > table.data td:first-child { padding-left: 20px; }
.card > .table-wrap > table.data th:last-child,
.card > .table-wrap > table.data td:last-child { padding-right: 20px; }
.card > table.data td:first-child { padding-left: 20px; }
.card > table.data td:last-child { padding-right: 20px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }

/* ---------- Formlar ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field small.hint { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea,
.filters input, .filters select,
.quote-filters input, .quote-filters select,
.drawer-search input {
    width: 100%; height: 36px; padding: 0 11px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.field textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.field select, .filters select, .quote-filters select, .lines select {
    appearance: none; -webkit-appearance: none; padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7789' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.field input:focus, .field select:focus, .field textarea:focus,
.filters input:focus, .filters select:focus,
.quote-filters input:focus, .quote-filters select:focus,
.drawer-search input:focus, .lines input:focus, .lines select:focus, .lines textarea:focus {
    border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus);
}
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-section + .form-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section > h3 { font-size: 13px; font-weight: 650; margin-bottom: 12px; }

.filters, .tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters input:not([type="checkbox"]), .filters select { width: auto; min-width: 160px; }
.filters input[type="checkbox"] { width: auto; height: auto; }
.tabs a, .chip {
    display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none;
}
.tabs a span { margin-left: 6px; color: var(--muted); }
.tabs a:hover, .chip:hover { background: var(--surface-3); }
.tabs a.active, .chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs a.active span { color: rgba(255, 255, 255, .7); }
html[data-theme="dark"] .tabs a.active, html[data-theme="dark"] .chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.quote-filter-card { margin-bottom: 16px; container-type: inline-size; }
.quote-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1.6fr) minmax(120px, .8fr) minmax(150px, 1fr) repeat(2, minmax(130px, .9fr)) auto;
    gap: 10px 12px; align-items: end;
}
.quote-filters label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.quote-filters label span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.filter-actions { display: flex; gap: 8px; }
@container (max-width: 920px) { .quote-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 560px) {
    .quote-filters { grid-template-columns: 1fr 1fr; }
    .quote-filters .filter-search { grid-column: 1 / -1; }
}

.pager { display: flex; gap: 4px; margin-top: 16px; justify-content: flex-end; }
.pager a {
    min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 8px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
    text-decoration: none; font-size: 13px; font-variant-numeric: tabular-nums;
}
.pager a:hover { background: var(--surface-3); }
.pager a.current { background: var(--navy); border-color: var(--navy); color: #fff; }

.meta-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 500; }
.total-box { margin-left: auto; width: min(340px, 100%); font-variant-numeric: tabular-nums; }
.total-box div { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink-2); }
.total-box .grand { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line-strong); color: var(--ink); font-size: 17px; font-weight: 700; }
.change-card { margin-top: 16px; }

/* ---------- Teklif düzenleyici ---------- */
.docbar {
    position: sticky; top: 60px; z-index: 18;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    margin: -22px -28px 18px; padding: 12px 28px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(20, 32, 51, .04);
}
.docbar-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.docbar-ref { display: flex; align-items: center; gap: 10px; }
.docbar-ref .ref { font-size: 17px; font-weight: 600; }
.docbar-sums { display: flex; gap: 0; margin: 0 0 0 auto; font-variant-numeric: tabular-nums; }
.docbar-sums > div { padding: 0 18px; border-left: 1px solid var(--line); }
.docbar-sums > div:first-child { border-left: 0; }
.docbar-sums dt { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.docbar-sums dd { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; }
.docbar-sums .grand dd { font-size: 18px; font-weight: 700; color: var(--brand); letter-spacing: -.01em; }
.editor-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.editor-top > .card + .card { margin-top: 0; }
.lines-card { padding-bottom: 8px; }
.lines-foot { display: flex; padding-top: 8px; }
details.card > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    list-style: none; cursor: pointer; margin: -18px -20px; padding: 16px 20px;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
    content: ""; width: 9px; height: 9px; flex: none; margin-right: 4px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-3px); transition: transform .15s;
}
details.card[open] > summary { margin-bottom: 16px; border-bottom: 1px solid var(--line); }
details.card[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
details.card > summary h2 { margin: 0; }
details.card > summary .card-sub { margin: 2px 0 0; }

.quote-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.lines-wrap { margin: 0 -20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; }
.lines { width: max-content; min-width: 100%; table-layout: fixed; border-collapse: collapse; }
.lines th {
    position: relative; height: 34px; padding: 0 8px; text-align: left; white-space: nowrap; overflow: hidden;
    font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; text-transform: uppercase;
    background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.lines td { padding: 6px 4px; vertical-align: top; border-bottom: 1px solid var(--line); overflow: hidden; }
.lines th:first-child, .lines td:first-child { padding-left: 20px; }
.lines tbody tr:last-child td { border-bottom: 0; }
.lines tbody tr:hover td { background: var(--surface-2); }
.lines input, .lines select, .lines textarea {
    width: 100%; min-width: 0; height: 32px; padding: 0 8px;
    border: 1px solid transparent; border-radius: 6px; background: transparent; outline: none;
    font-size: 13px;
}
.lines tbody tr:hover input, .lines tbody tr:hover select { border-color: var(--line); background: var(--surface); }
.lines input:focus, .lines select:focus { background: var(--surface); }
.lines select { background-position: right 6px center; padding-right: 22px; }
.lines .desc input[data-field="sku"] { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.lines .desc input[data-field="note"] { margin-top: 4px; border-color: var(--line); background: var(--warn-soft); }
.lines .col-dim input, .lines .col-qty input, .lines .col-ton input, .lines .col-disc input,
.lines input[data-field="unit_price"] { text-align: right; font-variant-numeric: tabular-nums; }
.lines td.amount { padding-top: 12px; padding-right: 10px; text-align: right; font-weight: 600; font-size: 13px; }
.lines .empty { padding: 36px 12px; }
.lines.is-teknik .col-pro, .lines.is-teknik col[data-col="origin"],
.lines.is-proforma .col-tech,
.lines.is-proforma col[data-col="dn"], .lines.is-proforma col[data-col="norm"],
.lines.is-proforma col[data-col="od"], .lines.is-proforma col[data-col="thk"],
.lines.is-proforma col[data-col="len"], .lines.is-proforma col[data-col="ton"] { display: none; }
.lines th:first-child, .lines td:first-child {
    position: sticky; left: 0; z-index: 3; background: var(--surface);
    box-shadow: inset -1px 0 0 var(--line);
}
.lines th:first-child { background: var(--surface-2); }
.lines tbody tr:hover td:first-child { background: var(--surface-2); }
.sku-name { display: block; padding: 2px 8px 0; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: normal; }
.col-resize { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; touch-action: none; z-index: 2; }
.col-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 2px; border-radius: 2px; background: var(--line-strong); opacity: 0; }
.lines th:hover .col-resize::after { opacity: 1; }
.col-resize:hover::after { background: var(--brand); opacity: 1; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
.fx, .fx-note { display: block; padding: 2px 8px 0; font-size: 11px; white-space: normal; }
.fx { color: var(--warn); }
.fx-note { color: var(--muted); }
.line-acts { display: inline-flex; gap: 2px; align-items: center; padding-top: 2px; }
.icon-btn {
    width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 6px; background: transparent; color: var(--muted);
    font-size: 14px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.act-note.has-note { color: var(--warn); background: var(--warn-soft); }
.icon-btn.act-remove:hover { background: var(--bad-soft); color: var(--bad); }
.tip-balloon {
    position: fixed; z-index: 80; transform: translate(-50%, -100%);
    padding: 4px 8px; border-radius: 6px; background: var(--navy); color: #fff;
    font-size: 12px; font-weight: 550; white-space: nowrap; pointer-events: none;
}
.tip-balloon::after {
    content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--navy);
}
.sku-suggest {
    position: fixed; z-index: 40; max-height: 300px; overflow: auto; padding: 4px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.sku-suggest button { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
.sku-suggest button.active, .sku-suggest button:hover { background: var(--brand-soft); }
.sku-suggest b { display: block; font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.sku-suggest small { color: var(--muted); font-size: 12px; }

/* Katalog çekmecesi */
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(14, 19, 27, .4); }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(500px, 100%);
    display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg);
}
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 16px; }
.drawer-search { padding: 14px 20px 0; }
.chips { display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-list { flex: 1; overflow: auto; padding: 8px 12px 24px; }
.pick { display: block; width: 100%; padding: 10px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; }
.pick + .pick { border-top: 1px solid var(--line); }
.pick:hover { background: var(--brand-soft); }
.pick b { display: block; font-weight: 600; font-size: 13.5px; }
.pick small { color: var(--muted); font-size: 12px; }

/* ---------- Giriş ---------- */
.auth-body { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); background: var(--surface); }
.auth-aside {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    padding: 48px 56px; color: #e8eef8;
    background: linear-gradient(155deg, #13203a 0%, #1b2f57 55%, #1d4ea3 130%);
}
.auth-aside::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-logo { display: inline-block; height: 44px; width: auto; background: #fff; border-radius: 10px; padding: 6px 10px; }
.auth-aside h2 { max-width: 520px; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; color: #fff; }
.auth-aside p { max-width: 460px; margin-top: 14px; color: #b9c7de; font-size: 15px; }
.auth-points { display: grid; gap: 10px; margin-top: 28px; padding: 0; list-style: none; color: #d4def0; }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7ea6ec; }
.auth-foot { font-size: 12.5px; color: #8fa1c0; }
.auth-panel { position: relative; display: grid; place-items: center; padding: 40px; background: var(--surface); }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-card .muted { margin-top: -8px; }
.auth-card .flash { margin: 0; }
.auth-card .btn { height: 42px; margin-top: 4px; }
.auth-card .field input { height: 42px; }

/* ---------- Duyarlı ---------- */
@media (min-width: 861px) {
    .rail-toggle { display: inline-flex; }
    html.nav-collapsed { --sidebar-w: 72px; }
    html.nav-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
    html.nav-collapsed .nav a span,
    html.nav-collapsed .btn-label,
    html.nav-collapsed .who,
    html.nav-collapsed .nav-label { display: none; }
    html.nav-collapsed .side-head { flex-direction: column; gap: 10px; padding: 0; }
    html.nav-collapsed .sidebar .brand-logo { display: none; }
    html.nav-collapsed .sidebar .brand-mark { display: block; }
    html.nav-collapsed .nav a { justify-content: center; padding: 0; }
    html.nav-collapsed .btn-new.btn-block { padding: 0; }
    html.nav-collapsed .side-user { flex-direction: column; padding: 8px 0; }
    html.nav-collapsed .side-id { justify-content: center; }
}
@media (max-width: 1200px) {
    .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split, .dash-grid { grid-template-columns: 1fr; }
    .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pipeline a:nth-child(4) { border-left: 0; }
    .pipeline a:nth-child(n+4) { border-top: 1px solid var(--line); }
    .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fx-rates { display: none; }
}
@media (max-width: 1100px) {
    .editor-top { grid-template-columns: 1fr; }
    .docbar-sums > div:first-child { display: none; }
}
@media (max-width: 860px) {
    .docbar { top: 60px; margin: -16px -16px 16px; padding: 10px 16px; gap: 10px; }
    .docbar-sums { order: 3; width: 100%; margin: 0; }
    .docbar-sums > div { padding: 0 12px; }
    .docbar-sums > div:nth-child(2) { padding-left: 0; border-left: 0; }
    .docbar .actions { margin-left: auto; }
}
@media (max-width: 860px) {
    .menu-btn { display: inline-flex; }
    .sidebar {
        position: fixed; z-index: 40; inset: 0 auto 0 0; width: 260px;
        transform: translateX(-105%); box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }
    .topbar { padding: 0 16px; }
    .content { padding: 16px 16px 40px; }
    .search { width: auto; flex: 1; }
    .search kbd { display: none; }
    .cards-2, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .auth-body { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .meta-list { grid-template-columns: 120px 1fr; }
    .lines-wrap { margin: 0 -20px; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat strong { font-size: 22px; }
    .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pipeline a:nth-child(odd) { border-left: 0; }
    .pipeline a:nth-child(4) { border-left: 1px solid var(--line); }
    .pipeline a:nth-child(n+3) { border-top: 1px solid var(--line); }
    .topbar h1 { display: none; }
    .card { padding: 16px; }
    .card > .table-wrap { margin: 0 -16px -16px; }
    .lines-wrap { margin: 0 -16px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- PDF ön izleme sayfası vb. eski sınıflar ---------- */
.mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; }
.lines th.right { text-align: right; padding-right: 10px; }
table.data td.right { white-space: nowrap; }
table.data .ref { white-space: nowrap; }
@media (max-width: 560px) {
    .docbar .eyebrow, .docbar .actions .btn:not(.btn-primary) { display: none; }
    .docbar-ref .ref { font-size: 15px; }
}
.auth-logo { align-self: flex-start; }

/* ---------- Detay ekranları ---------- */
.back-link { display: inline-block; margin-bottom: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--brand); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ref-title { font-family: var(--mono); font-size: 22px !important; font-weight: 600 !important; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.detail-side { position: sticky; top: 76px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts > div.wide { grid-column: span 2; }
.facts span { font-size: 12px; color: var(--muted); }
.facts strong { font-weight: 500; overflow-wrap: anywhere; }
.cell-title { font-weight: 550; }
.total-card { display: flex; flex-direction: column; gap: 4px; }
.big-amount { font-size: 28px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.opt-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: var(--neutral-soft); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.opt-chip .icon { width: 14px; height: 14px; }
.opt-chip.near { background: var(--warn-soft); color: var(--warn); }
.opt-chip.late { background: var(--bad-soft); color: var(--bad); }
.stack.tight { gap: 12px; }
.note-card p { white-space: normal; color: var(--ink-2); }
.note-card { background: var(--warn-soft); border-color: var(--warn-line); }
.rev-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; }
.rev-row:hover .ref { color: var(--brand); }
.mt { margin-top: 12px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-color: var(--bad-line); }
.danger-zone form { margin: 0; }
.change-card .timeline { margin-top: 0; }
@media (max-width: 1100px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .facts { grid-template-columns: 1fr; }
    .facts > div.wide { grid-column: auto; }
}

/* ---------- Listeler ---------- */
tr[data-href] { cursor: pointer; }
tr.is-passive td { opacity: .6; }
.toolbar {
    padding: 10px 12px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
}
.toolbar input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.toolbar .check { margin-left: 4px; }
.sum-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sum-chips span {
    padding: 3px 10px; border-radius: 6px; background: var(--surface-3);
    font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.entity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entity > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.entity .avatar { width: 32px; height: 32px; font-size: 12.5px; }
.entity-mark {
    width: 32px; height: 32px; flex: none; display: grid; place-items: center;
    border-radius: 8px; background: var(--brand-soft); color: var(--brand-soft-ink);
    font-size: 13px; font-weight: 650;
}
.entity .ref { font-size: 11.5px; }
.role { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--neutral-soft); color: var(--ink-2); }
.role-admin { background: var(--brand-soft); color: var(--brand-soft-ink); }
.role-sales { background: var(--ok-soft); color: var(--ok); }
.role-accounting { background: var(--warn-soft); color: var(--warn); }
.tabs { margin-bottom: 14px; }

/* ---------- Bölümlü formlar ---------- */
.form-card { max-width: 1040px; padding-top: 4px; padding-bottom: 0; }
.form-card.wide { max-width: 1180px; }
.form-card + .form-card, .form-card + .card { margin-top: 16px; }
.related-card { padding-top: 18px; padding-bottom: 18px; }
.form-sec {
    display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px;
    padding: 24px 0;
}
.form-sec + .form-sec { border-top: 1px solid var(--line); }
.form-sec-head h3 { font-size: 14px; font-weight: 650; }
.form-sec-head p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.check-field .check { height: 36px; }
input.mono { font-family: var(--mono); font-size: 13px; }
.sticky-actions {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 -20px; padding: 14px 20px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-radius: 0 0 var(--radius) var(--radius);
}
.form-card > .change-card { margin: 0; }
@media (max-width: 860px) {
    .form-sec { grid-template-columns: 1fr; gap: 14px; padding: 18px 0; }
    .sticky-actions { margin: 0 -16px; padding: 12px 16px; }
}

/* ---------- Bildirimler / bilgilendirme ---------- */
.count-pill { display: inline-flex; align-items: center; height: 20px; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11.5px; font-weight: 600; vertical-align: 2px; }
.notice { position: relative; }
.unread-dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--brand); }
.card > .notices { margin: 0 -8px; }
.compact-notices .notice { padding: 10px 0; border-radius: 0; }
.compact-notices .notice:hover { background: transparent; }
.brief-row .brief { margin-bottom: 10px; }
.brief-row form { flex: none; margin-top: 4px; }
.card .brief:last-child { margin-bottom: 0; }
.field > .seg { margin-top: 0; }
h2 .muted { font-weight: 500; margin-left: 4px; }
.main:has(.page-head) .topbar h1 { display: none; }
.entity-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Segment seçici */
.seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 3px; border-radius: var(--radius-sm); background: var(--surface-3);
}
.seg label { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
    display: flex; align-items: center; justify-content: center; height: 30px; padding: 0 8px;
    border-radius: 6px; font-size: 13px; font-weight: 550; color: var(--muted); white-space: nowrap;
}
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
@media (max-width: 1100px) {
    .detail-grid, .split, .dash-grid, .editor-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .cards-2, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Akışkan genişlik ---------- */
.form-card { margin-inline: auto; }
.form-card + .form-card, .form-card + .card { margin-inline: auto; }
.content > .errors:has(+ .form-card), .content > .flash:has(+ .form-card) { max-width: 1040px; margin-inline: auto; }
@media (min-width: 1600px) {
    .stat-grid, .pipeline { gap: 20px; }
    .dash-grid { grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1fr); }
    .detail-grid { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* ---------- Çubuk grafik (HTML) ---------- */
.bars { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; height: clamp(180px, 22vw, 260px); padding-bottom: 26px; }
.bars-axis { position: relative; }
.bars-axis span {
    position: absolute; right: 0; transform: translateY(50%);
    font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1;
}
.bars-plot { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; }
.bars-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--line); }
.bars-group { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bars-pair { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: min(56px, 70%); }
.bar { position: relative; flex: 1; min-height: 0; border-radius: 4px 4px 0 0; transition: filter .12s; }
.bar-all { background: var(--chart-a); }
.bar-won { background: var(--chart-b); }
.bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.bars-group:hover .bar { filter: brightness(.94); }
.bars-label { position: absolute; top: 100%; margin-top: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.main { --pad-x: clamp(16px, 2.2vw, 40px); }
.content { padding-left: var(--pad-x); padding-right: var(--pad-x); }
.topbar { padding-left: var(--pad-x); padding-right: var(--pad-x); }
.docbar { margin-left: calc(-1 * var(--pad-x)); margin-right: calc(-1 * var(--pad-x)); padding-left: var(--pad-x); padding-right: var(--pad-x); }
@media (max-width: 860px) {
    .docbar { margin-top: -16px; }
}

/* ==========================================================================
   KURUMSAL RENK KATMANI
   Lacivert menü, marka mavisi vurgu, amber/yeşil/teal/mor yardımcı tonlar.
   ========================================================================== */
:root {
    --canvas: #edf1f8;
    --surface-2: #f6f8fc;
    --surface-3: #e9eef7;
    --line: #dfe5ef;
    --line-strong: #cbd4e2;
    --brand: #1d4ea3;
    --brand-2: #2f6fe0;
    --brand-hover: #173f86;
    --brand-soft: #e6eefb;
    --navy-1: #0c1a33;
    --navy-2: #12284f;
    --navy-3: #1a3b73;
    --amber: #d98a04;  --amber-soft: #fdf1dc;
    --green: #12855a;  --green-soft: #e1f5ec;
    --teal: #0b8193;   --teal-soft: #dff3f6;
    --violet: #6d4bd8; --violet-soft: #eeeafd;
    --blue: #1d4ea3;   --blue-soft: #e6eefb;
    --rose: #c43c4b;   --rose-soft: #fde8ea;
    --th-bg: #f1f5fc;
    --th-ink: #4a5f80;
    --shadow-sm: 0 1px 2px rgba(16, 35, 70, .06);
    --shadow: 0 2px 4px rgba(16, 35, 70, .04), 0 8px 24px rgba(16, 35, 70, .07);
    --shadow-hover: 0 4px 10px rgba(16, 35, 70, .08), 0 14px 32px rgba(16, 35, 70, .12);
}
html[data-theme="dark"] {
    --canvas: #0b111b;
    --surface-2: #172030;
    --surface-3: #1e2a3d;
    --brand-2: #79a4ee;
    --navy-1: #070c15;
    --navy-2: #0c1628;
    --navy-3: #13264a;
    --amber: #f0b54d;  --amber-soft: #2e2413;
    --green: #4cc993;  --green-soft: #12291f;
    --teal: #4fc6d6;   --teal-soft: #0f2a2f;
    --violet: #a993f5; --violet-soft: #221b3d;
    --blue: #79a4ee;   --blue-soft: #1a2a46;
    --rose: #f08a95;   --rose-soft: #321a1e;
    --th-bg: #18233a;
    --th-ink: #9fb3d4;
    --shadow-hover: 0 14px 32px rgba(0, 0, 0, .45);
}

body {
    background:
        radial-gradient(1200px 500px at 100% -10%, rgba(47, 111, 224, .09), transparent 60%),
        radial-gradient(900px 400px at 20% 0%, rgba(29, 78, 163, .06), transparent 55%),
        var(--canvas);
    background-attachment: fixed;
}

/* ---------- Lacivert kenar menü ---------- */
.sidebar {
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(47, 111, 224, .35), transparent 70%),
        linear-gradient(180deg, var(--navy-2) 0%, var(--navy-1) 100%);
    border-right: 0;
    color: #c8d5ec;
    box-shadow: 4px 0 24px rgba(8, 20, 45, .18);
}
.sidebar .brand {
    background: #fff; border-radius: 10px; padding: 6px 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.sidebar .brand-logo { height: 32px; }
.sidebar .brand-mark { height: 30px; }
html[data-theme="dark"] .sidebar .brand-logo,
html[data-theme="dark"] .sidebar .brand-mark { background: transparent; padding: 0; }
.rail-toggle { color: #9fb3d6; }
.rail-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-label { color: rgba(200, 213, 236, .45); }
.nav a { color: #c8d5ec; position: relative; transition: background .15s, color .15s, padding .15s; }
.nav a .icon { color: #8aa2cc; transition: color .15s, transform .15s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a:hover .icon { color: #fff; transform: translateX(1px); }
.nav a.active {
    background: linear-gradient(90deg, rgba(79, 140, 245, .38), rgba(79, 140, 245, .1));
    color: #fff;
    box-shadow: inset 3px 0 0 #6ea2ff;
}
.nav a.active .icon { color: #9cc0ff; }
.sidebar .btn-new {
    background: linear-gradient(135deg, #3b7cf0, #1d4ea3);
    border: 0; color: #fff; height: 40px;
    box-shadow: 0 6px 18px rgba(47, 111, 224, .45);
}
.sidebar .btn-new:hover { background: linear-gradient(135deg, #4a88f5, #2457b3); transform: translateY(-1px); }
.side-user { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.side-user .who strong { color: #fff; }
.side-user .who small { color: #93a7cb; }
.avatar { background: linear-gradient(135deg, #3b7cf0, #6d4bd8); }
.side-logout button { color: #93a7cb; }
.side-logout button:hover { background: rgba(240, 90, 100, .18); color: #ffb3ba; }

/* ---------- Üst çubuk ---------- */
.topbar {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(16, 35, 70, .04);
    border-bottom: 0;
}
.fx-rates b { color: var(--brand); font-weight: 650; }
.search { background: var(--surface-2); }
.search:focus-within { background: var(--surface); }

/* ---------- Panel karşılama bandı ---------- */
.page-head.hero {
    position: relative; overflow: hidden; isolation: isolate;
    align-items: center; padding: 26px 30px; border-radius: 16px;
    color: #e9f0ff;
    background:
        radial-gradient(600px 240px at 90% -20%, rgba(110, 162, 255, .55), transparent 65%),
        radial-gradient(500px 220px at 10% 120%, rgba(109, 75, 216, .35), transparent 70%),
        linear-gradient(120deg, #10244a 0%, #1a3b78 55%, #1d4ea3 100%);
    box-shadow: 0 14px 34px rgba(18, 40, 80, .22);
}
.page-head.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(90deg, transparent, #000 60%);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.page-head.hero h2 { color: #fff; font-size: 26px; }
.page-head.hero p { color: #b9cbec; }
.page-head.hero .eyebrow { color: #8fb4ff; }
.btn-light { background: #fff; color: var(--navy-3); border-color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.btn-light:hover { background: #eef4ff; }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .28); box-shadow: none; }
.btn-glass:hover { background: rgba(255, 255, 255, .22); }

/* Diğer sayfa başlıkları: marka çizgisi */
.page-head:not(.hero) h2 { position: relative; padding-left: 14px; }
.page-head:not(.hero) h2::before {
    content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px;
    background: linear-gradient(180deg, var(--brand-2), var(--violet));
}
.page-head:not(.hero) p { padding-left: 14px; }
.page-head:not(.hero) .back-link { margin-left: 14px; }
.page-head:not(.hero) .tag-row { padding-left: 14px; }

/* ---------- Kartlar ---------- */
.card, .stat { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--line) 80%, transparent); }
.head-with-ico { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-ico {
    width: 36px; height: 36px; flex: none; display: grid; place-items: center;
    border-radius: 10px; background: var(--tone-soft); color: var(--tone);
}
.card-ico .icon { width: 18px; height: 18px; }
.tone-blue { --tone: var(--blue); --tone-soft: var(--blue-soft); }
.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.tone-teal { --tone: var(--teal); --tone-soft: var(--teal-soft); }
.tone-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.tone-rose { --tone: var(--rose); --tone-soft: var(--rose-soft); }

/* KPI kartları */
.stat {
    --k: var(--blue); --k-soft: var(--blue-soft);
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, color-mix(in srgb, var(--k) 9%, var(--surface)) 0%, var(--surface) 55%);
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--k), color-mix(in srgb, var(--k) 40%, transparent)); }
.stat::after {
    content: ""; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--k) 14%, transparent), transparent 70%);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat .stat-ico { background: var(--k); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--k) 35%, transparent); }
.stat strong { color: var(--ink); }
.stat-won { --k: var(--green); }
.stat-month { --k: var(--teal); }
.stat-openamt { --k: var(--amber); }

/* Durum şeridi */
.pipeline { box-shadow: var(--shadow); border-color: transparent; }
.pipeline a { transition: background .15s; }
.pipeline a:hover { background: color-mix(in srgb, var(--pipe) 8%, var(--surface)); }
.pipeline a strong { color: var(--pipe); }
.pipeline a.pipe-taslak strong { color: var(--ink-2); }
.pipeline a::before { height: 4px; }

/* ---------- Butonlar ---------- */
.btn { transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary, .btn-new {
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    border-color: var(--brand);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 32%, transparent);
}
.btn-primary:hover, .btn-new:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-2) 88%, #fff), var(--brand-hover));
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 38%, transparent);
}
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn-new { color: #0b1220; }
.btn-pdf { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); background: var(--green-soft); }
.btn-pdf:hover { background: color-mix(in srgb, var(--green) 16%, var(--surface)); border-color: var(--green); }
.btn-danger { color: var(--rose); }

/* ---------- Rozetler daha canlı ---------- */
.badge-gonderildi { background: var(--blue-soft); color: var(--blue); }
.badge-revize { background: var(--amber-soft); color: var(--amber); }
.badge-onaylandi { background: var(--green-soft); color: var(--green); }
.badge-siparis { background: var(--teal-soft); color: var(--teal); }
.badge-reddedildi, .badge-iptal { background: var(--rose-soft); color: var(--rose); }
.badge[class*="badge-"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }
.badge-domestic, .badge-export, .badge-tr, .badge-en { box-shadow: none; }
.badge-export, .badge-en { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 30%, var(--line)); background: var(--violet-soft); }
.badge-domestic, .badge-tr { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 30%, var(--line)); background: var(--teal-soft); }

/* ---------- Tablolar ---------- */
table.data th, .lines th { background: var(--th-bg); color: var(--th-ink); }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
tr[data-href]:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand-2); }
.tabs a.active, .chip.active { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent); }
.pager a.current { background: var(--brand); border-color: var(--brand); }

/* ---------- Teklif düzenleyici ---------- */
/* Yapışkan toplam çubuğu: içerik içinde yüzen lacivert kart (uyarı şeridiyle çakışmaz) */
.docbar {
    top: 70px; margin: 0 0 18px !important; padding: 14px 20px !important;
    border-radius: 14px; border: 0; color: #dfe8fb;
    background:
        radial-gradient(500px 180px at 85% -40%, rgba(110, 162, 255, .45), transparent 65%),
        linear-gradient(120deg, #10244a 0%, #1a3b78 60%, #1d4ea3 100%);
    box-shadow: 0 12px 28px rgba(18, 40, 80, .25);
}
.docbar .eyebrow { color: #8fb4ff; }
.docbar-ref .ref { color: #fff; }
.docbar .badge { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.docbar-sums > div { border-left-color: rgba(255, 255, 255, .16); }
.docbar-sums dt { color: #9fb6df; }
.docbar-sums dd { color: #fff; }
.docbar-sums .grand dd { color: #ffd27a; font-size: 20px; }
.docbar .btn { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.docbar .btn:hover { background: rgba(255, 255, 255, .2); }
.docbar .btn-primary { background: #fff; color: var(--navy-3); border-color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.docbar .btn-primary:hover { background: #eef4ff; color: var(--navy-3); }
@media (max-width: 860px) { .docbar { top: 66px; padding: 12px 14px !important; } }

/* Kalem tablosu: alanlar görünür, düzenlenebilir olduğu belli */
.lines input, .lines select {
    border-color: var(--line); background: var(--surface-2);
}
.lines tbody tr:hover input, .lines tbody tr:hover select { border-color: var(--line-strong); background: var(--surface); }
.lines input:focus, .lines select:focus { background: var(--surface); border-color: var(--brand); }
.lines td.amount { color: var(--brand); }
.lines .sku-name { padding-left: 9px; }
.lines-foot .btn { color: var(--brand); }
details.card > summary:hover { background: var(--surface-2); }
details.card > summary { border-radius: var(--radius); }
details.card[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }

/* Form bölüm başlıklarında renkli çizgi */
.form-sec-head h3 { display: flex; align-items: center; gap: 8px; }
.form-sec-head h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--brand-2); transform: rotate(45deg); }
.form-sec:nth-of-type(4n+2) .form-sec-head h3::before { background: var(--amber); }
.form-sec:nth-of-type(4n+3) .form-sec-head h3::before { background: var(--green); }
.form-sec:nth-of-type(4n+4) .form-sec-head h3::before { background: var(--violet); }

/* Detay toplam kartı */
.total-card {
    color: #dfe8fb; border: 0;
    background:
        radial-gradient(300px 140px at 100% 0%, rgba(110, 162, 255, .5), transparent 70%),
        linear-gradient(135deg, #12284f, #1d4ea3);
    box-shadow: 0 12px 28px rgba(18, 40, 80, .22);
}
.total-card .muted { color: #a9bde3; }
.total-card .big-amount { color: #fff; }
.total-card .opt-chip { background: rgba(255, 255, 255, .14); color: #fff; }
.total-card .opt-chip.near { background: rgba(240, 181, 77, .25); color: #ffe0a3; }
.total-card .opt-chip.late { background: rgba(240, 90, 100, .25); color: #ffc2c8; }

/* Grafik renkleri */
.bar-all { background: linear-gradient(180deg, #b8cdf3, #93b2ea); }
.bar-won { background: linear-gradient(180deg, #3b7cf0, #1d4ea3); }
html[data-theme="dark"] .bar-all { background: linear-gradient(180deg, #34507f, #273e66); }
html[data-theme="dark"] .bar-won { background: linear-gradient(180deg, #79a4ee, #4f7fd6); }
.swatch.all { background: #a6c0ef; }
.swatch.won { background: #2a63c9; }

/* Bildirim ikon tonları */
.notice-ico { background: var(--blue-soft); color: var(--blue); }
.notice-ico-quote_status { background: var(--amber-soft); color: var(--amber); }
.notice-ico-customer_new { background: var(--green-soft); color: var(--green); }
.notice-ico-quote_new { background: var(--violet-soft); color: var(--violet); }
.notice.unread { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }

/* Giriş ekranı birincil buton */
.auth-card .btn-primary { height: 44px; font-size: 14.5px; }

/* ---------- Hareket ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.content > *, .stat-grid > *, .dash-grid > .stack > *, .editor-top > *, .detail-grid > .stack > * {
    animation: rise .42s cubic-bezier(.2, .7, .2, 1) both;
}
.stat-grid > :nth-child(2) { animation-delay: .05s; }
.stat-grid > :nth-child(3) { animation-delay: .1s; }
.stat-grid > :nth-child(4) { animation-delay: .15s; }
.dash-grid > .stack > :nth-child(2), .detail-grid > .stack > :nth-child(2) { animation-delay: .08s; }
.dash-grid > .stack > :nth-child(3), .detail-grid > .stack > :nth-child(3) { animation-delay: .14s; }
.bar { transform-origin: bottom; animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; }
.bars-group:nth-child(n) .bar { animation-delay: calc(var(--i, 0) * 60ms + 150ms); }
.card.flush, .card { transition: box-shadow .18s ease; }
.due a, .rev-row { transition: padding .15s; }
.due a:hover { padding-left: 6px; }
@media (prefers-reduced-motion: reduce) {
    .content > *, .stat-grid > *, .bar { animation: none !important; }
}

/* ---------- Kur kutusu ---------- */
.fx-box {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 10px;
    background: linear-gradient(135deg, var(--blue-soft), color-mix(in srgb, var(--teal-soft) 70%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
}
.fx-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--brand); color: #fff; }
.fx-ico .icon { width: 17px; height: 17px; }
.fx-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-label { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--brand-soft-ink); }
.fx-copy strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.fx-copy small { font-size: 12px; color: var(--muted); }
.fx-copy small.warn { color: var(--amber); font-weight: 600; }

/* ---------- Marj ve sınırlar ---------- */
.lines.no-margin .col-margin, .lines.no-margin col[data-col="margin"] { display: none; }
.lines td.col-margin { padding-top: 10px; padding-right: 10px; }
.margin-chip {
    display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px;
    font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.margin-chip.ok { background: var(--green-soft); color: var(--green); }
.margin-chip.warn { background: var(--amber-soft); color: var(--amber); }
.margin-chip.bad { background: var(--rose-soft); color: var(--rose); }
.margin-chip.none { color: var(--faint); }
.lines tbody tr.row-flag td { background: color-mix(in srgb, var(--rose) 5%, var(--surface)); }
.lines tbody tr.row-flag td:first-child { box-shadow: inset 3px 0 0 var(--rose); }
.lines td.col-disc.over input { border-color: var(--rose); background: var(--rose-soft); color: var(--rose); font-weight: 650; }
.docbar-sums dd.bad { color: #ffb3ba !important; }
.approval-flag {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
    background: rgba(255, 196, 92, .2); color: #ffd27a; font-size: 12px; font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 210, 122, .35);
    animation: pulse-soft 1.8s ease-in-out infinite;
}
.approval-flag .icon { width: 14px; height: 14px; }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
.approval-note {
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px 16px;
    border-radius: var(--radius); border: 1px solid var(--amber); background: var(--amber-soft); color: var(--ink);
}
.approval-note > .icon { color: var(--amber); width: 20px; height: 20px; margin-top: 1px; }
.approval-note.approval-rejected { border-color: var(--rose); background: var(--rose-soft); }
.approval-note.approval-rejected > .icon { color: var(--rose); }
.approval-note ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.approval-note p { margin-top: 2px; color: var(--ink-2); }
.badge-approval-pending { background: var(--amber-soft); color: var(--amber); }
.badge-approval-rejected { background: var(--rose-soft); color: var(--rose); }
.badge-approval-approved { background: var(--violet-soft); color: var(--violet); }
.approval-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.approval-actions input { flex: 1 1 220px; height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.total-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 13px; }
.total-row span { color: #a9bde3; }
.total-row strong { color: #fff; font-variant-numeric: tabular-nums; }
.total-card .opt-chip { white-space: normal; line-height: 1.35; padding: 6px 10px; border-radius: 10px; }
.facts small { font-size: 11.5px; }
.approval-card { margin-bottom: 16px; border-left: 4px solid var(--amber); }
.approval-list a {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 16px; align-items: center;
    padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none;
}
.approval-list a:hover .ref { color: var(--brand); }
.approval-reason { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .approval-list a { grid-template-columns: 1fr auto; } .approval-reason { display: none; } }
.margin-hint { margin: 0; font-size: 13px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--rose); }
.delta.down { color: var(--green); }

/* ---------- Toplu fiyat ---------- */
.bulk-form { display: flex; flex-direction: column; gap: 16px; }
.bulk-formula {
    display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.2fr) auto minmax(0, .8fr) minmax(0, .8fr);
    gap: 12px; align-items: end; padding: 16px; border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-soft), var(--violet-soft));
}
.bulk-eq { align-self: center; margin-top: 18px; font-size: 20px; font-weight: 700; color: var(--brand); }
.bulk-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.bulk-filter .field { flex: 1 1 200px; }
.bulk-filter .check { height: 36px; }
.preview-card { margin-top: 16px; border-top: 4px solid var(--brand-2); }
.upload-form { display: flex; flex-direction: column; gap: 14px; }
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 170px; padding: 24px; border-radius: 14px; text-align: center; cursor: pointer;
    border: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--surface-2);
    transition: border-color .15s, background .15s;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand-2); background: var(--blue-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.dropzone-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: #fff; transform: rotate(180deg); }
.dropzone small { color: var(--muted); }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); }
.import-warn { margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--ink-2); font-size: 13px; }
.import-warn p + p { margin-top: 4px; }
@media (max-width: 1100px) { .bulk-formula { grid-template-columns: 1fr 1fr; } .bulk-eq { display: none; } }
@media (max-width: 860px) {
    .docbar-sums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
    .docbar-sums > div { padding: 0 !important; border-left: 0 !important; min-width: 0; }
    .docbar-sums dd { white-space: normal; overflow-wrap: anywhere; }
    .docbar-sums .grand { grid-column: 1 / -1; }
    .docbar-id { min-width: 0; flex: 1; }
    .docbar-ref { flex-wrap: wrap; }
}

/* ---------- Maliyet / KDV sütunları ---------- */
.lines.no-margin .col-cost, .lines.no-margin col[data-col="buy"], .lines.no-margin col[data-col="cost"] { display: none; }
.lines.no-vat .col-vat, .lines.no-vat col[data-col="vat"] { display: none; }
.lines th.col-cost, .lines th.col-margin { background: color-mix(in srgb, var(--amber) 10%, var(--th-bg)); color: color-mix(in srgb, var(--amber) 60%, var(--th-ink)); }
.lines td.col-cost, .lines td.col-margin { background: color-mix(in srgb, var(--amber) 4%, var(--surface)); }
.lines th.col-buy, .lines td.col-buy { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--amber) 35%, var(--line)); }
.lines td.col-buy input { text-align: right; font-variant-numeric: tabular-nums; }
.lines td.amount-cost { padding-top: 12px; padding-right: 10px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lines td.col-vat select { padding-right: 18px; }
.cost-preview { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line)); }
.cost-preview:empty { display: none; }
.cp-line b { font-variant-numeric: tabular-nums; }
.cp-steps { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-2); }
.cp-step { display: inline-flex; align-items: center; gap: 6px; }
.vat-chip { display: inline-flex; height: 22px; align-items: center; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 650; background: var(--neutral-soft); color: var(--ink-2); }
.vat-chip.vat-10 { background: var(--teal-soft); color: var(--teal); }
.vat-chip.vat-20 { background: var(--violet-soft); color: var(--violet); }

/* ---------- Renkli işlem butonları ---------- */
.btn-edit, .btn-preview, .btn-delete, .btn-pdf { box-shadow: none; }
.btn-edit { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); }
.btn-edit:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-preview { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 28%, var(--line)); }
.btn-preview:hover { background: var(--violet); color: #fff; border-color: var(--violet); }
.btn-pdf:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn-delete { background: var(--rose-soft); color: var(--rose); border-color: color-mix(in srgb, var(--rose) 28%, var(--line)); }
.btn-delete:hover { background: var(--rose); color: #fff; border-color: var(--rose); }
html[data-theme="dark"] .btn-edit:hover, html[data-theme="dark"] .btn-preview:hover,
html[data-theme="dark"] .btn-pdf:hover, html[data-theme="dark"] .btn-delete:hover { color: #0b1220; }
.btn-edit .icon, .btn-preview .icon, .btn-delete .icon, .btn-pdf .icon { width: 14px; height: 14px; }

/* ---------- Müşteri içe aktarma ---------- */
.template-card { background: linear-gradient(160deg, var(--blue-soft), var(--surface) 55%); }
.template-card > .muted { margin-bottom: 12px; }
.template-btn { height: 42px; margin-bottom: 14px; }
.col-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.col-pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); cursor: help; }
.col-pill.req { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.sum-chips.left { justify-content: flex-start; margin-top: 6px; }
.sum-chips .chip-new { background: var(--green-soft); color: var(--green); }
.sum-chips .chip-update { background: var(--blue-soft); color: var(--blue); }
.sum-chips .chip-error { background: var(--rose-soft); color: var(--rose); }
tr.imp-error td { background: color-mix(in srgb, var(--rose) 5%, var(--surface)); }
tr.imp-same td, tr.imp-skip td { opacity: .65; }
.imp-detail { font-size: 13px; }
.imp-detail s { text-decoration-color: var(--faint); }

/* ---------- Yetki seçimi ---------- */
.perm-count { margin-top: 10px !important; font-weight: 600; color: var(--brand) !important; }
.perm-wrap { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.perm-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.perm-preset { position: relative; cursor: pointer; }
.perm-preset input { position: absolute; opacity: 0; pointer-events: none; }
.perm-preset span {
    display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px;
    border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s, background .15s;
}
.perm-preset b { font-size: 13.5px; }
.perm-preset small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.perm-preset:hover span { border-color: var(--line-strong); }
.perm-preset input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--focus); }
.perm-preset input:checked + span b { color: var(--brand-soft-ink); }
.perm-preset input:focus-visible + span { outline: 2px solid var(--brand); }
.perm-admin-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--violet-soft); color: var(--violet); font-size: 13px; font-weight: 550; }
.perm-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.perm-groups.locked { opacity: .6; }
.perm-group { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.perm-group legend { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 650; float: left; }
.perm-group legend + * { clear: both; }
.perm-group legend .card-ico { width: 26px; height: 26px; border-radius: 7px; }
.perm-group legend .card-ico .icon { width: 14px; height: 14px; }
.perm-all { margin-left: auto; border: 0; background: none; color: var(--brand); font-size: 12px; font-weight: 600; padding: 2px 4px; border-radius: 4px; }
.perm-all:hover { background: var(--brand-soft); }
.perm-item { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.perm-item:hover { background: var(--surface); }
.perm-item input { position: absolute; opacity: 0; pointer-events: none; }
.perm-box {
    width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 5px; border: 1.5px solid var(--line-strong); background: var(--surface);
    display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.perm-item input:checked + .perm-box { background: var(--brand); border-color: var(--brand); }
.perm-item input:checked + .perm-box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.perm-item input:focus-visible + .perm-box { outline: 2px solid var(--brand); outline-offset: 2px; }
.perm-item input:disabled ~ * { cursor: not-allowed; }
.perm-text { display: flex; flex-direction: column; min-width: 0; }
.perm-text b { font-size: 13px; font-weight: 600; }
.perm-text small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
@media (max-width: 1100px) { .perm-groups { grid-template-columns: minmax(0, 1fr); } }
.role-custom { background: var(--teal-soft); color: var(--teal); }
.role-viewer { background: var(--neutral-soft); color: var(--muted); }
.perm-mini { font-size: 11.5px; margin-top: 3px; }
.page-pills { max-width: 420px; }
.page-pills span:not(.muted) { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--blue-soft); color: var(--blue); }

/* ---------- Sistem kontrolü ---------- */
.sys-link { display: flex; align-items: center; gap: 10px; max-width: 1180px; margin: 0 auto 14px; }
.sys-list { display: flex; flex-direction: column; }
.sys-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sys-row:first-child { border-top: 0; padding-top: 0; }
.sys-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; }
.sys-ico .icon { width: 16px; height: 16px; }
.sys-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sys-copy span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.sys-state { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; }
.sys-ok .sys-ico, .sys-ok .sys-state { background: var(--green-soft); color: var(--green); }
.sys-warn .sys-ico, .sys-warn .sys-state { background: var(--amber-soft); color: var(--amber); }
.sys-bad .sys-ico, .sys-bad .sys-state { background: var(--rose-soft); color: var(--rose); }
.sys-info .sys-ico, .sys-info .sys-state { background: var(--blue-soft); color: var(--blue); }
.sys-bad .sys-copy span { color: var(--rose); }
.sum-chips .chip-warn { background: var(--amber-soft); color: var(--amber); }
