/* BMG Flow – yönetim paneli stilleri
   Harici font/CDN kullanılmaz; intranet ortamında çevrimdışı çalışır. */

:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e7ee;
    --border-strong: #cfd7e2;
    --text: #18212f;
    --text-2: #3c4a5d;
    --muted: #6b778a;

    --primary: #1d4f91;
    --primary-hover: #173f75;
    --primary-soft: #e8f0fb;
    --primary-ring: rgba(29, 79, 145, .22);

    --sidebar-bg: #0f2240;
    --sidebar-text: #b9c6da;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, .09);
    --sidebar-w: 248px;
    --sidebar-w-collapsed: 68px;

    --success: #157347;
    --success-soft: #e7f5ee;
    --warning: #9a5b07;
    --warning-soft: #fdf3e1;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --info: #1d4f91;
    --info-soft: #eaf1fb;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger) !important; }
.truncate { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-lg { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }

/* ---------- Uygulama iskeleti ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--sidebar-bg); color: var(--sidebar-text);
    transition: width .18s ease, transform .2s ease;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; white-space: nowrap; }
.brand-mark {
    width: 32px; height: 32px; flex: none; border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #2f6bc0, #1d4f91); color: #fff; font-weight: 700; font-size: 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-text { font-size: 16px; letter-spacing: .01em; }
.brand-text strong { font-weight: 700; }
.brand--dark { color: var(--text); margin-bottom: 18px; }
.sidebar-close { display: none; background: none; border: 0; color: var(--sidebar-text); cursor: pointer; padding: 6px; }

.sidebar-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(185,198,218,.6); padding: 6px 10px 8px; white-space: nowrap; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 11px; border-radius: 8px;
    color: var(--sidebar-text); text-decoration: none !important; white-space: nowrap;
    font-weight: 500; background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.is-active { background: var(--sidebar-active-bg); color: var(--sidebar-active); box-shadow: inset 3px 0 0 #5b9cf0; }
.nav-link .icon { width: 19px; height: 19px; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-meta { font-size: 11.5px; color: rgba(185,198,218,.55); padding: 8px 11px 2px; white-space: nowrap; }
.collapse-toggle .icon { transition: transform .18s ease; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); transition: margin-left .18s ease; display: flex; flex-direction: column; }

.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.sidebar-collapsed .nav-label, .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-section { display: none; }
.sidebar-collapsed .nav-link { justify-content: center; padding: 10px; }
.sidebar-collapsed .collapse-toggle .icon { transform: rotate(180deg); }
.sidebar-collapsed .sidebar-head { justify-content: center; padding: 0; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 28px;
    background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(6px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.topbar-title h1 { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-app { color: var(--muted); font-size: 13px; white-space: nowrap; }
.topbar-sep { color: var(--border-strong); }
.menu-btn { display: none; }

.content { padding: 24px 28px 48px; width: 100%; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 18px 20px; }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-2);
    font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); border-color: #b9c4d3; }
.btn:focus-visible, .icon-btn:focus-visible, .method-btn:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 1px; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #932015; border-color: #932015; }
.btn-danger-outline { color: var(--danger); border-color: #f0c2bd; }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: #e6a39b; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn[disabled] { opacity: .6; cursor: progress; }

.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px;
    border-radius: var(--radius-sm); border: 1px solid transparent; background: none;
    color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn-danger:hover { color: var(--danger); background: var(--danger-soft); border-color: #f3cdc8; }
.icon-btn .icon { width: 17px; height: 17px; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; }
@media (min-width: 1500px) { .form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Yeni kayıt: geniş ekranda yüklenen belge formun yanında */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.form-aside { display: none; }
@media (min-width: 1500px) {
    .form-layout.has-aside { grid-template-columns: minmax(0, 1fr) minmax(420px, 34%); }
    .form-layout.has-aside .form-aside { display: block; position: sticky; top: 76px; }
    .form-aside .preview-frame iframe { height: calc(100vh - 200px); min-height: 480px; }
    .form-aside .preview-frame img { width: 100%; }
    .form-aside .preview-frame { max-height: calc(100vh - 200px); overflow: auto; }
}
.ocr-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ocr-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ocr-status.is-on .dot { background: var(--success); }
.ocr-status.is-off .dot { background: var(--warning); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req { color: var(--danger); }
.input {
    width: 100%; height: 38px; padding: 0 11px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); font: 14px/1.4 var(--font);
}
textarea.input { height: auto; padding: 8px 11px; resize: vertical; }
select.input { padding-right: 28px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input.is-invalid { border-color: var(--danger); background: #fffafa; }
.input.is-missing { border-color: #e3a64a; background: #fffbf3; }
.input.is-guess { border-color: #9dbbe6; background: #f7faff; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input-sm { height: 30px; width: 64px; padding: 0 7px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 2px; }
.field-hint { color: var(--muted); font-size: 12px; }
.field-hint:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.check-danger { color: var(--danger); font-size: 12.5px; }
.check-danger input { accent-color: var(--danger); }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .input { padding-right: 40px; }
.affix { position: absolute; right: 9px; color: var(--muted); font-size: 12px; pointer-events: none; }

.field-status:empty { display: none; }
.status-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; line-height: 1.6; }
.status-found { background: var(--success-soft); color: var(--success); }
.status-guess { background: var(--info-soft); color: var(--info); }
.status-missing { background: var(--warning-soft); color: var(--warning); }

.form-actions {
    position: sticky; bottom: 0; z-index: 10;
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 20px; margin-top: -4px;
    background: rgba(255,255,255,.95); backdrop-filter: blur(4px);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 14px rgba(16,24,40,.06);
}
.doc-form { display: flex; flex-direction: column; gap: 20px; }

/* Giriş yöntemi */
.method-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method-btn {
    display: flex; align-items: center; gap: 12px; text-align: left;
    padding: 14px 16px; border-radius: var(--radius); cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit;
}
.method-btn .icon { width: 24px; height: 24px; color: var(--muted); }
.method-btn span { display: flex; flex-direction: column; gap: 2px; }
.method-btn small { color: var(--muted); font-size: 12.5px; }
.method-btn:hover { border-color: #a9b8cc; }
.method-btn.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.method-btn.is-active .icon, .method-btn.is-active strong { color: var(--primary); }
.method-panel { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 28px 16px; text-align: center; cursor: pointer;
    border: 1.5px dashed #b4c2d6; border-radius: var(--radius); background: var(--surface-2);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-icon .icon { width: 30px; height: 30px; color: var(--primary); }
.dropzone-text { font-size: 14.5px; }
.dropzone-hint { color: var(--muted); font-size: 12.5px; }
.dropzone.is-busy { pointer-events: none; opacity: .7; }

.attach-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.attachment {
    margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.attachment-name { font-weight: 600; flex: 1; min-width: 120px; word-break: break-all; }

/* Bildirimler */
.alert, .notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; }
.alert .icon, .notice .icon { margin-top: 1px; }
.alert-success { background: var(--success-soft); border-color: #bfe3cf; color: #0f5133; }
.alert-error { background: var(--danger-soft); border-color: #f3c5bf; color: #7a1a12; }
.alert-warning, .notice-warning { background: var(--warning-soft); border-color: #f1d7a8; color: #6b4005; }
.notice-info { background: var(--info-soft); border-color: #cddcf2; color: #1e3a62; }
.notice-success { background: var(--success-soft); border-color: #bfe3cf; color: #0f5133; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

.import-result { display: flex; flex-direction: column; gap: 10px; }
.import-progress { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #c7d4e6; border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.raw-text summary { cursor: pointer; color: var(--primary); font-size: 13px; }
.raw-text pre { max-height: 320px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; font: 12px/1.45 var(--mono); white-space: pre-wrap; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
    padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table-hover tbody tr:hover { background: #f9fbfd; }
tr[data-href] { cursor: pointer; }
.strong-link { font-weight: 600; color: var(--primary); }
.strong-link:hover { color: var(--primary-hover); }
.code-link { font-family: var(--mono); font-size: 13px; }
.col-actions { width: 1%; text-align: right; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.col-no { width: 40px; color: var(--muted); }
.file-dot { color: var(--muted); margin-left: 6px; vertical-align: -3px; }
.file-dot .icon { width: 14px; height: 14px; }

/* Ürün satırları formu */
/* Masaüstünde tablo taşmaz (sütunlar esnek); bu sayede başlık sayfa kaydırılırken üstte sabit kalır */
.items-wrap { overflow: visible; }
.items-table thead th { position: sticky; top: 60px; z-index: 5; box-shadow: 0 1px 0 var(--border); }
.items-table td { padding: 8px 8px; vertical-align: top; }
.items-table th { padding: 10px 8px; }
.items-table th:first-child, .items-table td:first-child { padding-left: 20px; }
.items-table .col-code { width: 140px; }
.items-table .col-name { min-width: 240px; }
.items-table .col-qty { width: 86px; }
.items-table .col-price { width: 160px; }
.items-table .col-total { width: 160px; padding-top: 17px; }
@media (max-width: 1279px) and (min-width: 721px) {
    .items-wrap { overflow-x: auto; }
    .items-table { min-width: 860px; }
    .items-table thead th { position: static; }
}
.items-table .col-act { width: 44px; padding-right: 14px; }
.items-table .row-no { display: inline-block; padding-top: 9px; font-variant-numeric: tabular-nums; }
.input-name { min-height: 38px; resize: vertical; line-height: 1.45; }
.doc-check { font-size: 11.5px; margin-top: 4px; white-space: nowrap; }
.doc-check.ok { color: var(--success); }
.doc-check.warn { color: var(--warning); font-weight: 600; }
.item-row.is-mismatch td, .item-row.is-suspect td { background: #fffaf0; }
.input.is-suspect { border-color: #e3a64a; background: #fffbf3; box-shadow: inset 3px 0 0 #e3a64a; }
.row-notes { margin-top: 4px; font-size: 11.5px; color: var(--warning); line-height: 1.4; }
.row-notes:empty { display: none; }
.code-suggest { margin-top: 4px; font-size: 11.5px; color: var(--text-2); }
.code-suggest button { font: inherit; font-weight: 600; color: var(--primary); background: var(--primary-soft); border: 1px solid #cddcf2; border-radius: 5px; padding: 1px 6px; cursor: pointer; }
.items-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 16px 20px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.totals { min-width: 320px; display: flex; flex-direction: column; gap: 4px; margin-left: auto; }
.totals-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals-vat { gap: 10px; }
.totals-vat .check { margin-right: auto; }
.vat-rate { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.totals-grand { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; font-size: 17px; font-weight: 700; }
.doc-totals { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.doc-totals h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.doc-totals .totals-row { padding: 2px 0; }
.diff-ok { color: var(--success); }
.diff-warn { color: var(--warning); font-weight: 600; }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge .icon { width: 13px; height: 13px; }
.badge-invoice { background: var(--success-soft); color: var(--success); border-color: #c9e8d7; }
.badge-draft { background: var(--warning-soft); color: var(--warning); border-color: #f2dcb2; }
.badge-muted { background: #eef1f5; color: var(--text-2); border-color: var(--border); }
.currency-chip { display: inline-block; font: 600 11.5px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: #eef2f8; color: #2b3e5a; border: 1px solid #dbe3ee; }

/* ---------- Genel Bakış ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon .icon { width: 21px; height: 21px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

.currency-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.currency-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--border); }
.currency-card:last-child { border-right: 0; }
.currency-card.is-empty .amount { color: var(--muted); }
.currency-head { display: flex; align-items: center; gap: 8px; }
.currency-code { font: 700 12px/1 var(--mono); background: var(--sidebar-bg); color: #fff; padding: 5px 7px; border-radius: 5px; }
.currency-name { color: var(--muted); font-size: 13px; }
.currency-main { display: flex; flex-direction: column; gap: 2px; }
.currency-main-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.currency-rows { margin: 0; display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--border); padding-top: 10px; }
.currency-rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.currency-rows dt { color: var(--text-2); }
.currency-rows dd { margin: 0; }

.empty-inline { padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-inline p { margin: 0; }
.empty-state { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 560px; margin: 40px auto; }
.empty-state p { margin: 0; color: var(--text-2); }
.empty-icon .icon { width: 36px; height: 36px; color: var(--warning); }
.debug-detail { max-width: 100%; overflow: auto; text-align: left; font: 12px var(--mono); background: var(--surface-2); padding: 10px; border-radius: 6px; border: 1px solid var(--border); }

/* ---------- Liste/filtre ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); align-items: flex-end; }
.filter-search { position: relative; flex: 1 1 280px; }
.filter-search .icon { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.filter-search .input { padding-left: 36px; }
.filters select.input { width: auto; min-width: 150px; }
.filter-date { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.filter-date .input { width: 150px; }
.filter-actions { display: flex; gap: 8px; }
.list-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px; color: var(--text-2); font-size: 13px; border-bottom: 1px solid var(--border); }

.pagination { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; padding: 14px; border-top: 1px solid var(--border); }
.page-link { min-width: 34px; height: 32px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; text-decoration: none !important; }
.page-link:hover { background: var(--surface-2); }
.page-link.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-gap { padding: 0 4px; color: var(--muted); align-self: center; }

/* ---------- Detay ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head-actions { display: flex; gap: 8px; }
.page-head-actions form { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.back-link .icon { width: 16px; height: 16px; }
.doc-header { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.doc-header-main { display: flex; flex-direction: column; gap: 6px; }
.doc-header-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-header-title h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.doc-supplier { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 15px; font-weight: 500; }
.doc-supplier .icon { color: var(--muted); }
.meta-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 20px; margin: 0; padding-top: 14px; border-top: 1px solid var(--border); }
.meta-grid dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.meta-grid dd { margin: 0; font-weight: 500; }
.doc-desc { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-2); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1280px) {
    .detail-layout.has-preview { grid-template-columns: minmax(0, 3fr) minmax(380px, 2fr); align-items: start; }
    .detail-layout.has-preview .preview-card { position: sticky; top: 76px; }
    .detail-layout.has-preview .preview-frame iframe { height: calc(100vh - 210px); min-height: 520px; }
}
.detail-items td.td-block { min-width: 280px; line-height: 1.45; }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-list .icon { color: var(--muted); }
.preview-frame { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #e9edf2; }
.preview-frame iframe { display: block; width: 100%; height: 720px; border: 0; }
.preview-frame img { display: block; max-width: 100%; margin: 0 auto; }

.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.mini-stats > div { padding: 14px 20px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); }
.mini-stats > div:last-child { border-right: 0; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.mini-stats strong { font-size: 16px; }

/* ---------- Onay penceresi ---------- */
.modal { border: 0; padding: 0; border-radius: 12px; box-shadow: 0 20px 50px rgba(15, 34, 64, .25); width: min(420px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(15, 34, 64, .45); }
.modal-box { padding: 24px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.modal-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.modal-title { font-size: 17px; }
.modal-text { margin: 0; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- Kurulum ---------- */
.install-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.install-card { width: min(520px, 100%); }
.install-card .page-title { font-size: 20px; margin-bottom: 12px; }
.install-log { padding-left: 18px; margin: 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.install-log .is-error { color: var(--danger); }
.install-log .is-warn { color: var(--warning); }

/* ---------- Duyarlı tasarım ---------- */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: 0 0 40px rgba(0,0,0,.25); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15,34,64,.4); display: none; }
    .sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-close { display: block; }
    .sidebar .nav-label, .sidebar .brand-text, .sidebar .nav-section { display: initial !important; }
    .sidebar .nav-link { justify-content: flex-start !important; padding: 10px 11px !important; }
    .sidebar .sidebar-head { justify-content: space-between !important; padding: 0 16px !important; }
    .collapse-toggle { display: none; }
    .main, .sidebar-collapsed .main { margin-left: 0; }
    .menu-btn { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .topbar-app, .topbar-sep { display: none; }
    .content { padding: 16px 16px 40px; gap: 16px; }
    .currency-grid { grid-template-columns: minmax(0, 1fr); }
    .currency-card { border-right: 0; border-bottom: 1px solid var(--border); }
    .currency-card:last-child { border-bottom: 0; }
    .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mini-stats > div:nth-child(2) { border-right: 0; }
    .mini-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 720px) {
    .hide-sm { display: none; }
    .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .stat { padding: 14px; gap: 10px; }
    .stat-icon { width: 36px; height: 36px; }
    .stat-value { font-size: 20px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .field.span-2 { grid-column: auto; }
    .method-switch { grid-template-columns: minmax(0, 1fr); }
    .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-header, .card-body { padding-left: 16px; padding-right: 16px; }
    .filters { padding: 14px 16px; }
    .filters select.input, .filter-date, .filter-date .input { width: 100%; flex: 1 1 140px; }
    .totals { min-width: 0; width: 100%; }
    .truncate { max-width: none; white-space: normal; }

    /* Tablolar mobilde kart görünümü */
    .table-responsive thead { display: none; }
    .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
    .table-responsive tr { padding: 10px 16px; border-bottom: 1px solid var(--border); }
    .table-responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .table-responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; }
    .table-responsive td.td-block { flex-direction: column; gap: 1px; text-align: left; }
    .table-responsive td.col-actions { justify-content: flex-end; padding-top: 6px; }
    .table-responsive td.col-actions::before { content: none; }

    /* Ürün giriş satırları: her satır bir kart */
    .items-table thead { display: none; }
    .items-table, .items-table tbody { display: block; }
    .items-table tr.item-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); position: relative; }
    .items-table td { display: flex; flex-direction: column; gap: 3px; padding: 0 !important; border: 0; width: auto !important; min-width: 0 !important; }
    .items-table td::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; }
    .items-table td.col-no { grid-column: 1 / -1; }
    .items-table td.col-no::before { content: none; }
    .items-table .row-no { padding-top: 0; font-weight: 700; color: var(--text-2); }
    .items-table .row-no::before { content: "Satır "; }
    .items-table td.col-name, .items-table td.col-code { grid-column: 1 / -1; }
    .items-table td.col-total { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: baseline; flex-wrap: wrap; padding-top: 4px !important; font-weight: 600; }
    .items-table td.col-act { position: absolute; top: 8px; right: 10px; }
    .items-table td.col-act::before { content: none; }
    .items-foot { padding: 14px 16px; }
    .form-actions { padding: 10px 12px; }
    .form-actions .btn { flex: 1; }
    .doc-header-title h2 { font-size: 19px; }
}

/* Faz 1.1 */
.form-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.form-aside .card-title .icon { color: var(--muted); }
.last-prices { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
@media (max-width: 720px) { .last-prices { align-items: flex-end; } }

/* ---------- Faz 1.2: Giriş ve hesap ---------- */
.auth-body { min-height: 100vh; background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) minmax(0, 1fr); }
.auth-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    padding: 40px 48px;
    background: radial-gradient(1200px 600px at -10% 110%, rgba(47, 107, 192, .45), transparent 60%),
                linear-gradient(160deg, #0f2240 0%, #13305a 60%, #1d4f91 130%);
    color: #dbe5f3;
}
.auth-brand::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 40px 40px;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand-text { font-size: 19px; }
.auth-brand-copy h1 { font-size: 30px; line-height: 1.25; color: #fff; font-weight: 650; letter-spacing: -.01em; max-width: 440px; }
.auth-brand-copy p { margin: 14px 0 0; font-size: 15px; color: #b9c6da; max-width: 420px; }
.auth-brand-foot { font-size: 12.5px; color: rgba(185,198,218,.7); }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); }
.auth-card-brand { display: none; margin-bottom: 24px; }
.auth-title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.auth-subtitle { margin: 6px 0 22px; color: var(--muted); }
.auth-card .alert { margin-bottom: 16px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .input { height: 44px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 13px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 40px; padding-right: 44px; }
.input-toggle { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; }
.input-toggle:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.auth-help { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.alert-info { background: var(--info-soft); border-color: #cddcf2; color: #1e3a62; }
.auth-main .empty-state { margin: 0; }

.user-box { display: flex; align-items: center; gap: 10px; padding: 8px 11px 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.07); }
.user-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(91,156,240,.22); color: #dbe7fb; font-weight: 700; font-size: 13px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta strong { color: #fff; font-weight: 600; }
.user-meta small { color: rgba(185,198,218,.7); font-size: 11.5px; }
.logout-form { margin: 0; }
.sidebar-collapsed .user-box { justify-content: center; padding: 8px 0 10px; }

.narrow-card { max-width: 560px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.form-row-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-brand { display: none; }
    .auth-card-brand { display: flex; }
    .auth-main { align-items: start; padding-top: 12vh; }
    .sidebar .user-box { justify-content: flex-start !important; padding: 8px 11px 10px !important; }
}
