/* ---------------------------------------------------------------------------
   Central Document Service - admin panel
   Tema: varsayilan ACIK. data-theme="dark" / "light" ile degistirilir,
   deger yoksa isletim sistemi tercihi (prefers-color-scheme) uygulanir.
   --------------------------------------------------------------------------- */

:root {
    --bg: #eef2f7;
    --panel: #ffffff;
    --panel-2: #f5f8fc;
    --border: #dde5ef;
    --border-strong: #c3cfdf;
    --text: #101a2b;
    --muted: #5b6b85;
    --faint: #8798b1;
    --input-bg: #ffffff;
    --code-bg: #f2f6fb;
    --sidebar-bg: #ffffff;

    --accent: #2563eb;
    --accent-2: #2563eb;
    --accent-hover: #1d4ed8;
    --on-accent: #ffffff;
    --accent-soft: rgba(37, 99, 235, .10);
    --accent-line: rgba(37, 99, 235, .30);

    --ok: #047857;
    --ok-soft: rgba(4, 120, 87, .10);
    --ok-line: rgba(4, 120, 87, .28);
    --warn: #b45309;
    --warn-soft: rgba(180, 83, 9, .10);
    --warn-line: rgba(180, 83, 9, .28);
    --err: #dc2626;
    --err-soft: rgba(220, 38, 38, .09);
    --err-line: rgba(220, 38, 38, .28);
    /* Durum metni (rozet, bildirim): yumusak (-soft) zemin uzerinde de en az 4.5:1 okunur */
    --ok-text: #065f46;
    --warn-text: #92400e;
    --err-text: #b91c1c;
    --info-text: #1d4ed8;
    --link-on-tint: #1d4ed8;

    --shadow: 0 1px 2px rgba(16, 26, 43, .06);
    --shadow-lg: 0 10px 30px rgba(16, 26, 43, .10);
    --radius: 10px;
    --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1220;
        --panel: #111a2e;
        --panel-2: #16223c;
        --border: #22304d;
        --border-strong: #2f4066;
        --text: #e6edf7;
        --muted: #93a4c1;
        --faint: #6f81a3;
        --input-bg: #0d1526;
        --code-bg: #0d1526;
        --sidebar-bg: #111a2e;

        --accent: #4f8cff;
        --accent-2: #2563eb;
        --accent-hover: #1d4ed8;
        --on-accent: #ffffff;
        --accent-soft: rgba(79, 140, 255, .12);
        --accent-line: rgba(79, 140, 255, .35);

        --ok: #34d399;
        --ok-soft: rgba(52, 211, 153, .10);
        --ok-line: rgba(52, 211, 153, .35);
        --warn: #fbbf24;
        --warn-soft: rgba(251, 191, 36, .10);
        --warn-line: rgba(251, 191, 36, .35);
        --err: #f87171;
        --err-soft: rgba(248, 113, 113, .10);
        --err-line: rgba(248, 113, 113, .35);
        --ok-text: #34d399;
        --warn-text: #fbbf24;
        --err-text: #f87171;
        --info-text: #4f8cff;
        --link-on-tint: #4f8cff;

        --shadow: none;
        --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
    }
}

:root[data-theme="dark"] {
    --bg: #0b1220;
    --panel: #111a2e;
    --panel-2: #16223c;
    --border: #22304d;
    --border-strong: #2f4066;
    --text: #e6edf7;
    --muted: #93a4c1;
    --faint: #6f81a3;
    --input-bg: #0d1526;
    --code-bg: #0d1526;
    --sidebar-bg: #111a2e;

    --accent: #4f8cff;
    --accent-2: #2563eb;
    --accent-hover: #1d4ed8;
    --on-accent: #ffffff;
    --accent-soft: rgba(79, 140, 255, .12);
    --accent-line: rgba(79, 140, 255, .35);

    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, .10);
    --ok-line: rgba(52, 211, 153, .35);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .10);
    --warn-line: rgba(251, 191, 36, .35);
    --err: #f87171;
    --err-soft: rgba(248, 113, 113, .10);
    --err-line: rgba(248, 113, 113, .35);
    --ok-text: #34d399;
    --warn-text: #fbbf24;
    --err-text: #f87171;
    --info-text: #4f8cff;
    --link-on-tint: #4f8cff;

    --shadow: none;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- "Icerige gec": klavyede ilk Tab ile gorunur, menuyu atlayip ana icerige (#icerik) gider --- */
.skip-link {
    position: absolute; top: 10px; left: 10px; z-index: 100;
    padding: 10px 16px; border-radius: 8px; background: var(--accent-2); color: var(--on-accent);
    font-weight: 600; box-shadow: var(--shadow-lg);
}
.skip-link:not(:focus) {
    width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; box-shadow: none;
}
.skip-link:focus { text-decoration: none; outline: 2px solid var(--text); outline-offset: 2px; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px; flex: 0 0 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand { padding: 0 20px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .3px; }
.brand span { font-size: 12px; color: var(--muted); }

.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: var(--muted); font-size: 14px;
    border-left: 3px solid transparent;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 550; }
.nav .group { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 14px 26px; border-bottom: 1px solid var(--border); background: var(--panel);
    flex-wrap: wrap;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .who { font-size: 13px; color: var(--muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topbar .logout { margin: 0; }

/* --- Tema secici --- */
.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.theme-switch button {
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
    font: inherit; font-size: 12px; padding: 6px 11px; line-height: 1.4;
}
.theme-switch button + button { border-left: 1px solid var(--border); }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--accent-2); color: var(--on-accent); font-weight: 600; }

.content { padding: 24px 26px 60px; max-width: 1280px; width: 100%; }

.card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.card h3 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
    background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.ok { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-soft); }
.badge.warn { color: var(--warn-text); border-color: var(--warn-line); background: var(--warn-soft); }
.badge.err { color: var(--err-text); border-color: var(--err-line); background: var(--err-soft); }
.badge.info { color: var(--info-text); border-color: var(--accent-line); background: var(--accent-soft); }

label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=search], input[type=file], select, textarea {
    width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text);
    font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 86px; resize: vertical; }
.field { margin-bottom: 15px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--err); margin-top: 5px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--panel); color: var(--text); font: inherit; font-weight: 500;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.btn.danger:hover { border-color: var(--err); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Bildirim: bosluksuz uzun metin (adres, dosya adi) kutuyu ve sayfayi tasirmaz, satira bolunur */
.flash { padding: 12px 15px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; border: 1px solid; overflow-wrap: anywhere; }
.flash.success { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-text); }
.flash.error { background: var(--err-soft); border-color: var(--err-line); color: var(--err-text); }
.flash.warning { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
/* Bildirimdeki metin baglantisi zeminde okunur ve alti cizili; dugme gorunumlu baglanti (.btn) kendi renginde kalir */
.flash a:not(.btn) { color: var(--link-on-tint); text-decoration: underline; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt { margin-top: 16px; }
.nowrap { white-space: nowrap; }

.secret {
    display: flex; gap: 8px; align-items: center;
    background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
}
.secret code { flex: 1; overflow-x: auto; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }

.codeblock {
    background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px; overflow: auto; font-family: var(--mono); font-size: 12.5px; margin: 0;
}

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

/* --- Giris ekrani --- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 28px; box-shadow: var(--shadow-lg); }
.login-box h1 { font-size: 19px; margin: 0 0 4px; }
.login-box p.sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-theme { display: flex; justify-content: center; margin-top: 18px; }

/* --- Sirket arama (belge yukleme) --- */
.search-results { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; max-height: 260px; overflow-y: auto; background: var(--panel); }
.search-results .item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.search-results .item:last-child { border-bottom: none; }
.search-results .item:hover { background: var(--panel-2); }
.search-results .item.selected { background: var(--accent-soft); }
.search-results .name { font-weight: 550; }
.search-results .meta { font-size: 12px; color: var(--muted); }
.search-status { font-size: 13px; color: var(--muted); padding: 8px 2px; }

.chosen { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--ok-soft); border: 1px solid var(--ok-line); border-radius: 8px; padding: 11px 14px; }

/* --- Adim gostergesi --- */
.steps { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.steps .step { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.steps .step b { width: 22px; height: 22px; border-radius: 50%; background: var(--panel);
    border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; }
.steps .step.done b { background: var(--ok); color: var(--panel); border-color: var(--ok); }
.steps .step.active b { background: var(--accent-2); color: var(--on-accent); border-color: var(--accent-2); }
.steps .step.active { color: var(--text); }

/* --- R2 test adimlari --- */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.check-list li:last-child { border-bottom: none; }
.check-list .icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12px; font-weight: 700; flex: 0 0 20px; margin-top: 2px; }
.check-list .icon.ok { background: var(--ok-soft); color: var(--ok); }
.check-list .icon.no { background: var(--err-soft); color: var(--err); }
.check-list .body { flex: 1; min-width: 0; }
.check-list .body .detail { font-size: 12.5px; color: var(--muted); word-break: break-all; font-family: var(--mono); }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.pager { display: flex; gap: 6px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border); font-size: 13px; }
.pager span.current { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 170px; }

/* --- Tehlikeli bolge: kalici silme --- */
.danger-zone { border-color: var(--err-line); background: var(--err-soft); }
.danger-zone h2 { color: var(--err); display: flex; align-items: center; gap: 8px; }
.danger-zone .warn-list { margin: 0 0 16px; padding-left: 20px; font-size: 13.5px; color: var(--text); }
.danger-zone .warn-list li { margin-bottom: 5px; }
.danger-zone .confirm-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.danger-zone input[type=text], .danger-zone input[type=password] { border-color: var(--err-line); }
.danger-zone .gate {
    display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px;
    color: var(--text); margin-bottom: 14px; line-height: 1.5;
}
.danger-zone .gate input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.danger-zone .locked { font-size: 13.5px; color: var(--muted); }
.type-word { font-family: var(--mono); font-weight: 700; letter-spacing: .12em;
    background: var(--panel); border: 1px solid var(--err-line); border-radius: 6px; padding: 1px 8px; color: var(--err); }

/* Dar ekran (telefon, tablet): kenar menusu sayfanin ustunde yatay kaydirilan ince bir serit olur (~46px),
   ust cubuk sikisir; sayfa icerigi ve islem sonrasi bildirim ilk ekranda gorunur. Genis ekran degismez. */
@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%; flex: none; height: auto; position: static; padding: 0; overflow: visible;
        border-right: 0; border-bottom: 1px solid var(--border);
    }
    .brand, .nav .group { display: none; }
    /* Serit tasiyorsa kenarda hafif golge kalan baglantilari belli eder (yalnizca CSS kaydirma golgesi). */
    .nav {
        display: flex; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
        background:
            linear-gradient(to right, var(--sidebar-bg) 40%, transparent) left / 32px 100% no-repeat local,
            linear-gradient(to left, var(--sidebar-bg) 40%, transparent) right / 32px 100% no-repeat local,
            radial-gradient(farthest-side at 0 50%, var(--border-strong), transparent) left / 12px 100% no-repeat scroll,
            radial-gradient(farthest-side at 100% 50%, var(--border-strong), transparent) right / 12px 100% no-repeat scroll;
    }
    .nav a {
        flex: 0 0 auto; min-height: 44px; padding: 10px 14px; white-space: nowrap;
        border-left: 0; border-bottom: 3px solid transparent;
    }
    /* Etkin baglanti acilista seridin ortasina kaydirilir (destekleyen tarayicida; digerlerinde serit bastan baslar). */
    .nav a.active { border-bottom-color: var(--accent); scroll-initial-target: nearest; scroll-snap-align: center; }
    .nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
    .topbar { padding: 10px 16px; gap: 6px 12px; }
    .topbar h1 { font-size: 16px; }
    /* Tema secici, ad ve Cikis tek satirda kalir; yalnizca sigmayan ad "..." ile kisalir. */
    .topbar .who { gap: 8px 12px; flex-wrap: nowrap; min-width: 0; }
    .topbar .who > * { flex: none; }
    .topbar .who > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .content { padding: 16px 16px 48px; }
    /* 320px genislikte (WCAG yeniden akis) iki sutunlu izgaranin karti kabini tasmaz; 352px ve ustunde degisiklik yok. */
    .grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
    .kv { grid-template-columns: 1fr; }
}

/* ===========================================================================
   E-posta ice aktarma (email import) - BASLANGIC
   Yalnizca .ei kapsaminda yeni siniflar; mevcut bilesenler degistirilmez.
   Satir ici style="" CSP tarafindan engellendigi icin bosluk/sarma yardimcilari burada.
   =========================================================================== */
.ei [hidden] { display: none !important; }
.ei .page-head { margin-bottom: 16px; }
.ei .page-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.ei .page-head p { margin: 4px 0 0; max-width: 820px; }
.ei .card-head { margin-bottom: 12px; }
.ei .card-head h2 { margin: 0; }
.ei .m0 { margin: 0; }
.ei .break-all { word-break: break-all; }
.ei .num { text-align: right; font-variant-numeric: tabular-nums; }
.ei .badge { white-space: nowrap; }
.ei table.compact th, .ei table.compact td { padding: 8px 9px; }
.ei .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* Tablo icindeki .sr-only ogeleri kaydirma kutusunun disina tasip sayfayi genisletmesin. */
.ei .table-wrap { position: relative; }
/* Is sayfasi: belge satirinin altindaki islem satiri (onay, "PDF'i elle yukle", tanilama) dar ekranda tablonun
   GORUNEN genisligine sigar ve yatay kaydirmada yerinde kalir (kaydirma kutusu kap olarak olculur, 100cqw).
   Kap sorgusu desteklenmeyen tarayicida eski davranis (tablo genisligi) surer. */
.ei .docs-wrap { container-type: inline-size; }
.ei .docs-wrap td.row-actions > * { position: sticky; left: 12px; max-width: calc(100cqw - 24px); box-sizing: border-box; }
.ei .docs-wrap td.row-actions .btn.small { min-height: 40px; }
.ei .list { margin: 6px 0 0; padding-left: 20px; }
.ei .list li { margin-bottom: 4px; }
/* Izgaralar dar kapta (kart icinde, 360px telefon) tasmaz: en kucuk sutun kabin genisligini gecmez. */
.ei .grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.ei .grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.ei .grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
/* Bildirimlerdeki bosluksuz uzun hata metni (adres, dosya adi) sayfayi yatay kaydirmaz. */
.ei .flash { overflow-wrap: anywhere; }

.ei input[type=number] {
    width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text);
    font: inherit; outline: none;
}
.ei input[readonly] { background: var(--panel-2); color: var(--muted); }
.ei .pair { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ei .check-inline { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--text); margin: 4px 0 0; }
.ei .check-inline input { width: auto; margin-top: 4px; flex: 0 0 auto; }
.ei .inline-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0; }
.ei .inline-form select, .ei .inline-form input[type=file] { width: auto; max-width: 100%; }

/* Sirket secici: sonuclar klavyeyle secilebilen dugmelerdir */
.ei fieldset.picker { border: 0; margin: 0 0 15px; padding: 0; min-width: 0; }
.ei fieldset.picker legend { padding: 0; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.ei .search-results .item {
    width: 100%; min-height: 44px; text-align: left; border: 0; border-bottom: 1px solid var(--border);
    border-radius: 0; background: transparent; color: var(--text); font: inherit;
}
.ei .search-results .item:last-child { border-bottom: 0; }
.ei .search-results .item .name, .ei .search-results .item .meta { display: block; }
.ei .search-results .item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.ei .search-status[data-tone="error"] { color: var(--err); }
.ei .chosen .name { font-weight: 600; }

/* Islemler karti ve musteriye gorunen metin vurgusu */
.ei .action-block { padding: 14px 0; border-top: 1px solid var(--border); }
.ei .action-block:first-of-type { padding-top: 0; border-top: 0; }
.ei .action-block h3 { margin: 0 0 6px; }
.ei .action-block p { margin: 0 0 10px; }
.ei td.customer { background: var(--ok-soft); }

/* Tanilama JSON'u, cron komutu, acilir bolumler, klavye odagi */
.ei .codeblock.diag { white-space: pre-wrap; word-break: break-word; max-height: 480px; margin-top: 8px; }
.ei .codeblock.cmd { white-space: pre-wrap; word-break: break-all; user-select: all; }
.ei details > summary { cursor: pointer; }
.ei details.diag summary { font-size: 13px; color: var(--muted); }
.ei a:focus-visible, .ei .btn:focus-visible, .ei summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ei #form-errors:focus { outline: 2px solid var(--err); outline-offset: 2px; }

/* Uretim acikken kilitli alanlar, bayat tarih uyarisi, uzun konu basliklari */
.ei select:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.ei .stale-note { font-size: 13px; font-weight: 600; color: var(--err); }
.ei .stale-note:not(:empty) { margin: 0 0 10px; }
.ei .page-head h2, .ei .card-head h2 { overflow-wrap: anywhere; }

/* Durum paneli (Belgeler): ikincil menu, ozet kartlari, belge listeleri. Durum her yerde metinle de yazilir. */
.ei .seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ei .seg a {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--panel); color: var(--muted); font-size: 14px; font-weight: 500;
}
.ei .seg a:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.ei .seg a[aria-current="page"] { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); font-weight: 600; }
.ei .health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 16px; }
.ei .cards { margin-bottom: 18px; }
/* Ozet kartlari her genislikte tek satirda uc esit sutun (tablette 2+1 kirilmaz); .grid.cols-3 kuralindan sonra gelir. */
.ei .grid.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ei a.stat { display: block; color: var(--text); border-left-width: 5px; transition: border-color .15s ease, box-shadow .15s ease; }
.ei a.stat:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.ei a.stat > span { display: block; }
.ei .stat.ok { border-left-color: var(--ok); }
.ei .stat.warn { border-left-color: var(--warn); }
.ei .stat.err { border-left-color: var(--err); }
.ei .stat .label { font-size: 14px; font-weight: 600; color: var(--text); }
.ei .stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ei .badge.dot::before {
    content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
    background: currentColor; vertical-align: 1px;
}
.ei .items { list-style: none; margin: 0; padding: 0; }
.ei .items > li {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 20px;
    padding: 16px 0; border-top: 1px solid var(--border);
}
.ei .items > li:first-child { border-top: 0; }
.ei .item-main { flex: 1 1 340px; min-width: 0; overflow-wrap: anywhere; }
.ei .card h3.item-title {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 4px;
    font-size: 15px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: normal;
}
.ei .item-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ei .item-meta strong { color: var(--text); font-weight: 600; }
.ei .item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ei .item-actions form { margin: 0; }
.ei .item-actions .btn, .ei .decision .btn { min-height: 44px; }
.ei .item-actions .btn.small { min-height: 40px; }
.ei .card-head .btn.small, .ei.pdf-error .btn.small { min-height: 40px; }
.ei .item-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.ei .reason {
    margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; color: var(--text);
    border: 1px solid var(--warn-line); background: var(--warn-soft); overflow-wrap: anywhere;
}
.ei .reason.err { border-color: var(--err-line); background: var(--err-soft); }
.ei .reason .why { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.ei .reason .tip { display: block; margin-top: 4px; color: var(--muted); }
.ei .wrap-any { overflow-wrap: anywhere; }
.ei .empty-state { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.ei .empty-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 15px; }
.ei details.diag p { margin-top: 6px; }

/* Belge inceleme: genis ekranda PDF solda, karar sagda; <= 1160px karar ustte (DOM sirasi), PDF altta. Gecis
   sarmaya (flex-wrap) degil ayni medya sorgusuna baglidir: kaydirma cubugu genisligi "PDF'i yeni sekmede ac"
   baglantisinin gorundugu genislikle yerlesimi birbirinden ayirmaz. */
.ei .back { margin: 0 0 10px; }
.ei .back a { display: inline-flex; align-items: center; min-height: 40px; }
.ei .review { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 18px; }
.ei .review-side { flex: 1 1 320px; min-width: 0; }
.ei .review-pdf { flex: 999 1 520px; min-width: 0; }
.ei .review-side .kv { grid-template-columns: minmax(70px, max-content) 1fr; }
.ei .decision form { margin: 12px 0 0; }
.ei .decision .btn { width: 100%; justify-content: center; }
.ei .decision .reason { margin-bottom: 4px; }
.ei .pdf-frame { position: relative; min-height: 420px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); overflow: hidden; }
.ei .pdf-frame .loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; color: var(--muted); }
/* Tarayici PDF'i sayfa icinde gosteremiyor (email-import.js): bos cerceve yer kaplamaz, kutu yalnizca notu tasir. */
.ei .pdf-frame.no-viewer { min-height: 0; }
.ei .pdf-frame.no-viewer .loading { position: static; }
.ei .pdf-frame iframe { position: relative; display: block; width: 100%; height: 75vh; min-height: 420px; border: 0; background: transparent; }
/* Karar kartindaki PDF baglantisi: yalnizca PDF karar kartinin altina dustugunde (<= 1160px) gorunur. */
.ei .decision .pdf-jump { display: none; }
@media (max-width: 1160px) {
    .ei .review { display: grid; grid-template-columns: minmax(0, 1fr); }
    .ei .decision .pdf-jump { display: flex; width: 100%; justify-content: center; min-height: 44px; margin-top: 12px; }
}

/* PDF gosterilemedi sayfasi (cerceve icinde, admin iskeleti yok) */
.ei.pdf-error { max-width: 640px; margin: 0 auto; padding: 28px 22px; }
.ei.pdf-error h1 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.ei.pdf-error p { margin: 0 0 10px; }
@media (max-width: 600px) {
    .ei .cards { gap: 8px; }
    .ei .review-pdf .card-head .btn, .ei .item-actions .btn.small { min-height: 44px; }
    .ei .card-head .btn.small, .ei .seg a { min-height: 44px; }
    .ei a.stat { padding: 10px 10px 12px; border-left-width: 4px; }
    .ei .stat .value { font-size: 22px; }
    .ei .stat .label { font-size: 12.5px; line-height: 1.3; }
    .ei .stat .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ei a.stat { transition: none; }
}
/* E-posta ice aktarma - BITIS ================================================= */
