/* ══════════════════════════════════════════════════════════════
   Global Hırdavat — Tasarım sistemi (koyu tema, grafit + Global kırmızısı)
   ══════════════════════════════════════════════════════════════ */
/* Inter (yerel — internet gerekmez) */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(../assets/fonts/inter-latin-wght-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(../assets/fonts/inter-latin-ext-wght-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
    color-scheme: dark;

    /* Yüzeyler */
    --bg: #0e1012;
    --surface-1: #15171a;
    --surface-2: #1b1e22;
    --surface-3: #23272c;
    --surface-4: #2c3137;
    --border: #262a30;
    --border-strong: #353a42;

    /* Metin */
    --text: #f2f3f5;
    --text-2: #b3b8bf;
    --text-3: #7c838c;

    /* Marka */
    --brand: #e02634;
    --brand-hover: #c81f2c;
    --brand-soft: rgba(224, 38, 52, 0.14);
    --brand-line: rgba(224, 38, 52, 0.45);
    --graphite: #45484c;

    /* Durum */
    --good: #3dbb7d;
    --good-soft: rgba(61, 187, 125, 0.14);
    --warn: #e5a93b;
    --warn-soft: rgba(229, 169, 59, 0.14);
    --bad: #ef5d5d;
    --bad-soft: rgba(239, 93, 93, 0.14);
    --info: #3987e5;
    --info-soft: rgba(57, 135, 229, 0.14);

    /* Grafik serileri (doğrulandı: koyu yüzey, CVD ΔE 19.2) */
    --series-1: #3987e5;
    --series-2: #e66767;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 24px 64px rgba(0,0,0,0.55);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'cv11', 'calt' 0;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ─── Butonlar ─────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text);
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .08s, opacity .15s;
    text-decoration: none; user-select: none;
}
.btn:hover { background: var(--surface-4); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--border-strong); color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* ─── Form ─────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
    width: 100%; height: 40px; padding: 0 12px;
    background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius);
    color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.select { appearance: none; padding-right: 32px; 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='%23b3b8bf' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-left: 36px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 22px; background: var(--surface-4); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ─── Kart ─────────────────────────────────── */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-title { font-size: 14px; font-weight: 650; margin: 0; }
.card-sub { font-size: 12px; color: var(--text-3); margin: 2px 0 0; }
.card-body { padding: 16px 18px 18px; }

/* ─── Rozet ────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 22px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: #6aa6ee; }
.badge-brand { background: var(--brand-soft); color: #ff6b76; }

/* ─── Tablo ────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-1); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table td.r, .table td.num { font-variant-numeric: tabular-nums; }
.table .empty { text-align: center; color: var(--text-3); padding: 40px 14px; }
.table .truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Modal / çekmece ──────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(5,6,8,.66); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.modal-lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer { width: min(760px, 100%); height: 100%; background: var(--surface-1); border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
.drawer .modal-body { flex: 1; overflow: auto; }

/* ─── Bildirim ─────────────────────────────── */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; font-size: 13px; animation: pop .2s var(--ease); }
.toast .ti { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok .ti { color: var(--good); }
.toast.err .ti { color: var(--bad); }
.toast.info .ti { color: var(--info); }
@media (max-width: 600px) { .toasts { left: 12px; right: 12px; bottom: 12px; } .toast { min-width: 0; max-width: none; } }

/* ─── Diğer ────────────────────────────────── */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--surface-4); border-top-color: var(--brand); animation: spin .7s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
