/* =====================================================================
   Herşeyci Yönetim Paneli — Tasarım sistemi
   Nötr (zinc) yüzeyler + tek vurgu rengi (marka turuncusu).
   Açık / koyu tema: data-theme veya işletim sistemi tercihi.
   ===================================================================== */

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

    --bg: #f6f6f7;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --surface-3: #f4f4f5;
    --hover: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #18181b;
    --text-2: #52525b;
    --text-3: #71717a;
    --text-4: #a1a1aa;

    --accent: #ea580c;
    --accent-hover: #c2410c;
    --accent-soft: #fff4ed;
    --accent-text: #c2410c;
    --ring: 0 0 0 3px rgb(234 88 12 / .18);

    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning-soft: #fffbeb;

    /* Ürün durumu — grafik paleti ile aynı (doğrulandı: CVD + normal görüş) */
    --st-satista: #1baf7a;
    --st-rezerve: #eda100;
    --st-satildi: #2a78d6;
    --st-satista-bg: #e8f8f1;
    --st-rezerve-bg: #fdf5e1;
    --st-satildi-bg: #e9f1fb;
    --st-satista-text: #0b7a52;
    --st-rezerve-text: #8a5d00;
    --st-satildi-text: #1d5aa6;

    --shadow-xs: 0 1px 2px rgb(16 16 20 / .05);
    --shadow-sm: 0 1px 3px rgb(16 16 20 / .07), 0 1px 2px rgb(16 16 20 / .04);
    --shadow-md: 0 4px 12px -2px rgb(16 16 20 / .08), 0 2px 4px -2px rgb(16 16 20 / .05);
    --shadow-lg: 0 16px 40px -8px rgb(16 16 20 / .18), 0 4px 10px -4px rgb(16 16 20 / .08);

    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;
    --sidebar: 248px;
    --sidebar-mini: 68px;
    --topbar: 60px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Koyu tema değerleri — iki kapsamda: OS tercihi ve kullanıcının seçimi */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #09090b; --surface: #131316; --surface-2: #18181b; --surface-3: #1f1f23; --hover: #1f1f23;
        --border: #27272a; --border-strong: #3f3f46;
        --text: #fafafa; --text-2: #c4c4cc; --text-3: #a1a1aa; --text-4: #71717a;
        --accent: #f97316; --accent-hover: #fb923c; --accent-soft: rgb(249 115 22 / .12); --accent-text: #fb923c;
        --ring: 0 0 0 3px rgb(249 115 22 / .28);
        --danger: #ef4444; --danger-hover: #f87171; --danger-soft: rgb(239 68 68 / .12);
        --success-soft: rgb(34 197 94 / .12); --warning-soft: rgb(234 179 8 / .12);
        --st-satista: #199e70; --st-rezerve: #c98500; --st-satildi: #3987e5;
        --st-satista-bg: rgb(25 158 112 / .16); --st-rezerve-bg: rgb(201 133 0 / .16); --st-satildi-bg: rgb(57 135 229 / .16);
        --st-satista-text: #4fd1a1; --st-rezerve-text: #f0bd4f; --st-satildi-text: #7fb2f0;
        --shadow-xs: 0 1px 2px rgb(0 0 0 / .4); --shadow-sm: 0 1px 3px rgb(0 0 0 / .5);
        --shadow-md: 0 4px 12px -2px rgb(0 0 0 / .5); --shadow-lg: 0 16px 40px -8px rgb(0 0 0 / .7);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #09090b; --surface: #131316; --surface-2: #18181b; --surface-3: #1f1f23; --hover: #1f1f23;
    --border: #27272a; --border-strong: #3f3f46;
    --text: #fafafa; --text-2: #c4c4cc; --text-3: #a1a1aa; --text-4: #71717a;
    --accent: #f97316; --accent-hover: #fb923c; --accent-soft: rgb(249 115 22 / .12); --accent-text: #fb923c;
    --ring: 0 0 0 3px rgb(249 115 22 / .28);
    --danger: #ef4444; --danger-hover: #f87171; --danger-soft: rgb(239 68 68 / .12);
    --success-soft: rgb(34 197 94 / .12); --warning-soft: rgb(234 179 8 / .12);
    --st-satista: #199e70; --st-rezerve: #c98500; --st-satildi: #3987e5;
    --st-satista-bg: rgb(25 158 112 / .16); --st-rezerve-bg: rgb(201 133 0 / .16); --st-satildi-bg: rgb(57 135 229 / .16);
    --st-satista-text: #4fd1a1; --st-rezerve-text: #f0bd4f; --st-satildi-text: #7fb2f0;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / .4); --shadow-sm: 0 1px 3px rgb(0 0 0 / .5);
    --shadow-md: 0 4px 12px -2px rgb(0 0 0 / .5); --shadow-lg: 0 16px 40px -8px rgb(0 0 0 / .7);
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
    background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.011em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip-link:focus { left: 8px; }
.text-muted { color: var(--text-3); }
.text-faint { color: var(--text-4); }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ml-auto { margin-left: auto; }
.show-sm { display: none; }

.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 14px; height: 14px; }
.icon-warn { color: var(--st-rezerve-text); width: 14px; height: 14px; }

/* ---------- Uygulama iskeleti ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; transition: width .2s var(--ease), transform .25s var(--ease);
}
.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s var(--ease); }
.sidebar-head { height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
    background: linear-gradient(145deg, #f97316, #ea580c 60%, #c2410c); color: #fff; font-weight: 700; font-size: 16px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 1px 2px rgb(194 65 12 / .4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.brand-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-title { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); padding: 0 10px 6px; }
.nav-link {
    display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--r);
    color: var(--text-2); font-weight: 500; transition: background .12s, color .12s; position: relative; white-space: nowrap;
}
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }

.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }
.user-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: var(--r); cursor: pointer; text-align: left; }
.user-card:hover { background: var(--hover); }
.user-card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.user-card-text b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-text small { font-size: 12px; color: var(--text-3); }
.user-card-chev { color: var(--text-4); width: 16px; }

/* Daraltılmış menü (masaüstü) */
.sidebar-mini .sidebar { width: var(--sidebar-mini); }
.sidebar-mini .main { margin-left: var(--sidebar-mini); }
.sidebar-mini .brand-text, .sidebar-mini .nav-link span, .sidebar-mini .nav-group-title, .sidebar-mini .user-card-text, .sidebar-mini .user-card-chev { display: none; }
.sidebar-mini .sidebar-head { padding: 0; justify-content: center; flex-direction: column; gap: 0; }
.sidebar-mini .sidebar-head .brand { display: none; }
.sidebar-mini .sidebar-collapse .icon { transform: rotate(180deg); }
.sidebar-mini .nav-link { justify-content: center; padding: 0; }
.sidebar-mini .nav-group + .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sidebar-mini .user-card { justify-content: center; }

.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 12px;
    padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar .topbar-menu { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.content { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 28px 64px; }

:root:not([data-theme="dark"]) .theme-light-icon { display: none; }
:root[data-theme="dark"] .theme-dark-icon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-dark-icon { display: none; }
    :root:not([data-theme]) .theme-light-icon { display: inline-block; }
}

/* ---------- Hızlı arama ---------- */
.quick-search { position: relative; flex: 1; max-width: 440px; display: flex; align-items: center; }
.quick-search > .icon { position: absolute; left: 11px; color: var(--text-4); pointer-events: none; width: 16px; }
.quick-search input {
    width: 100%; height: 38px; padding: 0 64px 0 36px; border: 1px solid var(--border); border-radius: var(--r);
    background: var(--surface); font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.quick-search input::placeholder { color: var(--text-4); }
.quick-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.quick-search kbd { position: absolute; right: 9px; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.quick-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow-y: auto; animation: pop .14s var(--ease);
}
.quick-item { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: var(--r); }
.quick-item:hover, .quick-item.is-active { background: var(--hover); }
.quick-item img, .quick-item .quick-noimg { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); flex-shrink: 0; }
.quick-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.quick-item-text b { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.quick-item-text small { color: var(--text-3); font-size: 12px; }
.quick-item-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quick-empty { padding: 18px; text-align: center; color: var(--text-3); }
.quick-all { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; margin-top: 4px; border-top: 1px solid var(--border); color: var(--accent-text); font-weight: 600; font-size: 13px; border-radius: 0 0 var(--r) var(--r); }
.quick-all:hover { background: var(--hover); }

/* ---------- Sayfa başlığı ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -.022em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-subtitle { color: var(--text-3); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-actions form { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 15px; }
.title-code { font-size: 13px; font-weight: 500; color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }

/* ---------- Butonlar ---------- */
.btn {
    --h: 38px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--h); padding: 0 14px;
    border-radius: var(--r); border: 1px solid transparent; font-size: 14px; font-weight: 550; line-height: 1;
    cursor: pointer; white-space: nowrap; user-select: none; transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-text { color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.btn-sm { --h: 32px; padding: 0 11px; font-size: 13px; }
.btn-xs { --h: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
.btn-xs .icon { width: 14px; height: 14px; }
.btn-lg { --h: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }

/* ---------- Kart ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card + .card, .card + section, .dash-grid + .card, .kpi-grid + .dash-grid { margin-top: 16px; }
.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: 600; letter-spacing: -.01em; }
.card-subtitle { color: var(--text-3); font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.card-body { padding: 20px; }
.card-flush .card-header { border-bottom: 1px solid var(--border); }
.card-hint { display: flex; align-items: center; gap: 8px; padding: 11px 20px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: 13px; background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.card-hint .icon { width: 16px; color: var(--text-4); }
.card-tip { background: var(--surface-2); }
.card-tip h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-tip h3 .icon { color: var(--accent); width: 16px; }
.card-tip p { color: var(--text-2); font-size: 13px; }
.card-tip p + p { margin-top: 6px; }

/* ---------- Form ---------- */
.form-stack { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 550; color: var(--text); }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.req { color: var(--danger); }
.field-help { font-size: 12px; color: var(--text-3); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.field-reveal { margin-top: 4px; animation: pop .16s var(--ease); }

.input {
    width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
    box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-4); }
.input:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-4)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgb(220 38 38 / .15); }
.input-lg { height: 46px; font-size: 16px; font-weight: 500; }
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select {
    appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='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; background-size: 16px;
}
.select-sm { height: 36px; font-size: 13px; width: auto; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .icon { position: absolute; left: 12px; color: var(--text-4); pointer-events: none; width: 16px; }
.input-icon > .input { padding-left: 38px; }
.input-action { position: absolute; right: 4px; height: 32px; width: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; color: var(--text-4); cursor: pointer; }
.input-action:hover { color: var(--text); background: var(--hover); }
.input-group { display: flex; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: var(--r) 0 0 var(--r); }
.input-group .input:last-child { border-radius: 0 var(--r) var(--r) 0; }
.input-group .input:focus { position: relative; z-index: 1; }
.input-addon { display: grid; place-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-3); font-weight: 500; }
.input-addon:first-child { border-radius: var(--r) 0 0 var(--r); border-right: 0; }
.input-addon:last-child { border-radius: 0 var(--r) var(--r) 0; border-left: 0; }

/* Seçim kartları (durum, rol) */
.choice-list { display: grid; gap: 8px; }
.choice {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border);
    border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); flex-shrink: 0; transition: inherit; }
.choice-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.choice-text b { font-weight: 600; font-size: 14px; }
.choice-text small { color: var(--text-3); font-size: 12px; }
.choice-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.choice-check .icon { width: 12px; height: 12px; stroke-width: 3; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice:has(input:checked) .choice-icon { background: var(--accent); color: #fff; }
.choice:has(input:checked) .choice-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice-satista:has(input:checked) { border-color: var(--st-satista); background: var(--st-satista-bg); box-shadow: 0 0 0 1px var(--st-satista) inset; }
.choice-satista:has(input:checked) .choice-icon, .choice-satista:has(input:checked) .choice-check { background: var(--st-satista); border-color: var(--st-satista); }
.choice-rezerve:has(input:checked) { border-color: var(--st-rezerve); background: var(--st-rezerve-bg); box-shadow: 0 0 0 1px var(--st-rezerve) inset; }
.choice-rezerve:has(input:checked) .choice-icon, .choice-rezerve:has(input:checked) .choice-check { background: var(--st-rezerve); border-color: var(--st-rezerve); }
.choice-satildi:has(input:checked) { border-color: var(--st-satildi); background: var(--st-satildi-bg); box-shadow: 0 0 0 1px var(--st-satildi) inset; }
.choice-satildi:has(input:checked) .choice-icon, .choice-satildi:has(input:checked) .choice-check { background: var(--st-satildi); border-color: var(--st-satildi); }

/* Görsel alanı (kategori görseli) */
.image-field { display: flex; align-items: center; gap: 16px; }
.image-preview { position: relative; width: 88px; height: 88px; flex-shrink: 0; border-radius: var(--r-lg); overflow: hidden; cursor: pointer; background: var(--surface-3); border: 1.5px dashed var(--border-strong); display: grid; place-items: center; transition: border-color .15s, background .15s; }
.image-preview:hover { border-color: var(--accent); background: var(--accent-soft); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview:has(img:not([hidden])) { border-style: solid; border-color: var(--border); }
.image-empty { color: var(--text-4); display: grid; place-items: center; }
.image-empty .icon { width: 26px; height: 26px; stroke-width: 1.5; }
.image-preview:hover .image-empty { color: var(--accent-text); }
.image-field-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.image-field-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Anahtar (switch) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; }
.switch { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .18s; flex-shrink: 0; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .18s var(--ease); }
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(18px); }

/* Şifre gücü */
.meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .2s, background .2s; }

/* Form düzeni + yapışkan kaydet çubuğu */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.form-main, .form-side { display: grid; gap: 16px; min-width: 0; }
.form-side { position: sticky; top: calc(var(--topbar) + 16px); }
.form-main > .card + .card, .form-side > .card + .card { margin-top: 0; }
.form-bar { position: sticky; bottom: 0; z-index: 20; margin: 20px -28px -64px; padding: 12px 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
.form-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-bar-actions { display: flex; gap: 8px; }
.form-bar-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 13px; }
.form-bar-status .icon { width: 16px; color: var(--success); }
.form-bar-status.is-dirty .icon { color: var(--st-rezerve); }
.meta-list { margin: 0; display: grid; gap: 12px; }
.meta-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.meta-list dt { color: var(--text-3); }
.meta-list dd { margin: 0; font-weight: 500; text-align: right; }

/* ---------- Fotoğraf yükleyici ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.photo-item { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); cursor: grab; touch-action: none; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-item:active { cursor: grabbing; }
.photo-cover { display: none; position: absolute; left: 6px; top: 6px; background: rgb(9 9 11 / .78); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 5px; backdrop-filter: blur(4px); }
.photo-grid .photo-item:first-child .photo-cover { display: block; }
.photo-grid .photo-item:first-child { box-shadow: 0 0 0 2px var(--accent); border-color: transparent; }
.photo-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(9 9 11 / .7); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.photo-remove .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.photo-remove:hover { background: var(--danger); }
.photo-item:hover .photo-remove, .photo-item:focus-within .photo-remove { opacity: 1; }
@media (hover: none) { .photo-remove { opacity: 1; } }
.photo-progress { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(9 9 11 / .45); color: #fff; font-size: 12px; font-weight: 600; }
.photo-progress::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / .3); }
.photo-progress i { position: absolute; left: 8px; bottom: 8px; height: 4px; border-radius: 4px; background: #fff; width: 0; max-width: calc(100% - 16px); transition: width .15s; z-index: 1; }
.photo-item.is-error { border-color: var(--danger); }
.photo-item.is-error .photo-progress { background: rgb(220 38 38 / .75); }
.photo-ghost { opacity: .35; }
.photo-chosen { box-shadow: var(--shadow-lg) !important; }
.photo-add {
    aspect-ratio: 1; border: 1.5px dashed var(--border-strong); border-radius: var(--r); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; text-align: center; cursor: pointer; padding: 8px; color: var(--text-3);
    transition: border-color .15s, background .15s, color .15s;
}
.photo-add:hover, .photo-add.is-dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.photo-add input { display: none; }
.photo-add-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); margin-bottom: 4px; }
.photo-add:hover .photo-add-icon { background: var(--surface); }
.photo-add strong { font-size: 13px; font-weight: 600; color: var(--text); }
.photo-add small { font-size: 11.5px; line-height: 1.3; }
.uploader.is-dragover .photo-add { border-color: var(--accent); background: var(--accent-soft); }
.uploader-hint { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.uploader-hint .icon { width: 14px; }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-3); color: var(--text-2); border: 0; }
.badge .icon { width: 12px; height: 12px; margin-right: -3px; opacity: .7; }
.badge-xs { height: 18px; padding: 0 6px; font-size: 11px; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-satista { background: var(--st-satista-bg); color: var(--st-satista-text); }
.badge-rezerve { background: var(--st-rezerve-bg); color: var(--st-rezerve-text); }
.badge-satildi { background: var(--st-satildi-bg); color: var(--st-satildi-text); }
.badge-button { cursor: pointer; transition: filter .12s, box-shadow .12s; }
.badge-button:hover { filter: brightness(.96); box-shadow: 0 0 0 1px currentColor inset; }
.badge-role-yonetici { background: var(--accent-soft); color: var(--accent-text); }
.badge-role-personel { background: var(--st-satildi-bg); color: var(--st-satildi-text); }
.badge-role-izleyici { background: var(--surface-3); color: var(--text-2); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); flex-shrink: 0; }
.dot-satista { background: var(--st-satista); }
.dot-rezerve { background: var(--st-rezerve); }
.dot-satildi { background: var(--st-satildi); }
.dot-on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-text { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.status-text.is-on { color: var(--text); }

/* ---------- Avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; letter-spacing: .02em; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-0 { background: #fde8d7; color: #9a3412; }
.avatar-1 { background: #dbeafe; color: #1e40af; }
.avatar-2 { background: #dcfce7; color: #166534; }
.avatar-3 { background: #f3e8ff; color: #6b21a8; }
.avatar-4 { background: #fef3c7; color: #92400e; }
.avatar-5 { background: #fce7f3; color: #9d174d; }
:root[data-theme="dark"] .avatar { filter: saturate(.8) brightness(.9); }

/* ---------- Açılır menü ---------- */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 196px; padding: 5px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    display: none; transform-origin: top left;
}
.dropdown.is-open > .dropdown-menu, .dropdown-menu.is-shown { display: block; animation: pop .13s var(--ease); }
.dropdown-menu.is-shown { z-index: 95; }
.dropdown-right { left: auto; right: 0; transform-origin: top right; }
.dropdown-up > .dropdown-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; transform-origin: bottom center; }
.dropdown-menu.is-flip { top: auto; bottom: calc(100% + 6px); }
.dropdown-menu form { margin: 0; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none;
    border-radius: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; white-space: nowrap;
}
.dropdown-item .icon { width: 16px; color: var(--text-3); }
.dropdown-item:hover { background: var(--hover); }
.dropdown-item.is-current { font-weight: 600; }
.dropdown-item.is-danger { color: var(--danger); }
.dropdown-item.is-danger .icon { color: var(--danger); }
.dropdown-item.is-danger:hover { background: var(--danger-soft); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px -5px; }
.dropdown-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); }

/* ---------- Pencere (modal) ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(9 9 11 / .5); backdrop-filter: blur(2px); animation: fade .15s; }
.modal-dialog { position: relative; width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise .2s var(--ease); }
.modal-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.confirm-body { display: flex; gap: 14px; padding: 22px 20px; }
.confirm-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); flex-shrink: 0; }
.confirm-body h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.confirm-body p { color: var(--text-2); }

/* ---------- Bildirimler (toast) ---------- */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    animation: toastIn .25s var(--ease); font-size: 13.5px; line-height: 1.45;
}
.toast > .icon { width: 18px; margin-top: 1px; }
.toast-success > .icon { color: var(--success); }
.toast-warning > .icon { color: var(--st-rezerve); }
.toast-error > .icon { color: var(--danger); }
.toast-text { flex: 1; }
.toast-close { border: 0; background: none; color: var(--text-4); cursor: pointer; padding: 2px; border-radius: 4px; }
.toast-close:hover { color: var(--text); }
.toast-close .icon { width: 15px; }
.toast.is-leaving { animation: toastOut .2s var(--ease) forwards; }

/* Sayfa içi uyarı (giriş) */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r); font-size: 13.5px; margin-bottom: 4px; border: 1px solid; }
.alert .icon { width: 17px; margin-top: 1px; }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--st-rezerve) 30%, transparent); color: var(--st-rezerve-text); }

/* Araç ipucu */
.tooltip { position: fixed; z-index: 120; pointer-events: none; background: #18181b; color: #fafafa; font-size: 12px; font-weight: 500; padding: 5px 8px; border-radius: 6px; box-shadow: var(--shadow-md); white-space: nowrap; animation: fade .1s; }
:root[data-theme="dark"] .tooltip { background: #3f3f46; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 550; color: var(--text-3); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr { transition: background .1s; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.table tr.is-muted td { color: var(--text-4); }
.table tr.is-muted .avatar { opacity: .5; }
.actions-col { width: 1%; text-align: right; white-space: nowrap; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: 20px; }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: 16px; }
.cell-product, .cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-product > div, .cell-user > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cell-product strong, .cell-user strong { font-weight: 600; color: var(--text); }
.cell-product .text-muted, .cell-user .text-muted { font-size: 12.5px; }
.cell-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); flex-shrink: 0; border: 1px solid var(--border); padding: 0; cursor: pointer; }
span.cell-thumb { cursor: default; }
.cell-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 56px 20px; }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.empty-icon .icon { width: 24px; height: 24px; }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { color: var(--text-3); margin: 4px auto 18px; max-width: 360px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sıralanabilir liste (kategori/konum) ---------- */
.sort-list { list-style: none; margin: 0; padding: 6px; }
.sort-item { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 4px; border-radius: var(--r); background: var(--surface); transition: background .12s; }
.sort-item:hover { background: var(--surface-2); }
.sort-item + .sort-item { margin-top: 2px; }
.sort-handle { width: 28px; height: 36px; display: grid; place-items: center; color: var(--text-4); cursor: grab; border-radius: 6px; touch-action: none; flex-shrink: 0; }
.sort-handle:hover { color: var(--text); background: var(--hover); }
.sort-handle:active { cursor: grabbing; }
.sort-index { width: 22px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-4); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.sort-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); flex-shrink: 0; border: 1px solid var(--border); }
.sort-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sort-thumb.is-icon { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.sort-body { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sort-body strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-body .text-muted { font-size: 12.5px; }
.sort-actions { display: flex; align-items: center; gap: 2px; }
.sort-actions form { margin: 0; }
.sort-ghost { opacity: .4; background: var(--accent-soft) !important; }
.sort-chosen { box-shadow: var(--shadow-lg); background: var(--surface) !important; }
.sort-drag { opacity: .95; }

/* ---------- Ürün kataloğu ---------- */
.catalog { margin-bottom: 16px; }
.cat-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.cat-chip {
    display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; cursor: pointer; flex-shrink: 0; scroll-snap-align: start; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s;
}
.cat-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.cat-chip.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.cat-chip-thumb { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); flex-shrink: 0; }
.cat-chip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-chip-thumb.is-all { background: var(--text); color: var(--surface); }
.cat-chip.is-active .cat-chip-thumb.is-all { background: var(--accent); color: #fff; }
.cat-chip-text { display: flex; flex-direction: column; line-height: 1.25; }
.cat-chip-text b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.cat-chip-text small { font-size: 11.5px; color: var(--text-3); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.toolbar-search { flex: 1 1 260px; }
.toolbar-search .input { height: 36px; box-shadow: none; }
.toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; border: 1px solid var(--border); overflow-x: auto; max-width: 100%; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.segment span:hover { color: var(--text); }
.segment em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--text-4); font-variant-numeric: tabular-nums; }
.segment input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segment input:checked + span em { color: var(--text-3); }
.segment input:focus-visible + span { box-shadow: var(--ring); }
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; border: 1px solid var(--border); }
.view-toggle .btn { --h: 28px; color: var(--text-3); }
.view-toggle .btn .icon { width: 15px; }

.results { position: relative; min-height: 200px; transition: opacity .15s; }
.results.is-loading { opacity: .45; pointer-events: none; }
.loading-bar { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 200; width: 0; transition: width .3s ease, opacity .3s; box-shadow: 0 0 8px var(--accent); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.p-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: visible; display: flex; flex-direction: column; box-shadow: var(--shadow-xs); transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.p-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.p-media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--surface-3); cursor: zoom-in; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.p-card:hover .p-media img { transform: scale(1.04); }
.p-noimg { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-4); font-size: 12px; }
.p-noimg .icon { width: 28px; height: 28px; stroke-width: 1.4; }
.p-count { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; background: rgb(9 9 11 / .62); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); }
.p-count .icon { width: 13px; height: 13px; }
.p-zoom { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgb(255 255 255 / .92); color: #18181b; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s var(--ease); }
.p-zoom .icon { width: 15px; }
.p-card:hover .p-zoom { opacity: 1; transform: none; }
.p-body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.p-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-3); }
.p-meta span { display: inline-flex; align-items: center; gap: 5px; }
.p-meta .icon { width: 13px; height: 13px; color: var(--text-4); }
.p-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.p-price { font-size: 16px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.p-price .text-faint { font-size: 13px; font-weight: 500; letter-spacing: 0; }

/* Sayfalama */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.pagination-info { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.pagination-pages { display: flex; gap: 4px; }
.page-btn { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; transition: background .12s; }
.page-btn:hover { background: var(--hover); }
.page-btn .icon { width: 16px; }
.page-btn.is-current { background: var(--text); color: var(--surface); border-color: var(--text); }
.page-gap { align-self: center; color: var(--text-4); padding: 0 4px; }

/* ---------- Genel bakış ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.kpi-label .icon { width: 15px; }
.kpi-value { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.kpi-foot { font-size: 12.5px; color: var(--text-3); }
.kpi-foot b { color: var(--text); font-weight: 600; }
.kpi-foot .up { color: var(--success); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-grid > .card + .card { margin-top: 0; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 16px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.swatch-satista { background: var(--st-satista); }
.swatch-rezerve { background: var(--st-rezerve); }
.swatch-satildi { background: var(--st-satildi); }
.stack-chart { display: grid; gap: 6px; }
.stack-row { display: grid; grid-template-columns: 96px 1fr 40px; grid-template-areas: "name track total" ". detail ."; align-items: center; column-gap: 12px; row-gap: 4px; padding: 8px 8px; margin: 0 -8px; border-radius: var(--r); transition: background .12s; }
.stack-row:hover { background: var(--surface-2); }
.stack-name { grid-area: name; font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-track { grid-area: track; display: flex; gap: 2px; height: 14px; width: var(--w); min-width: 4px; }
.stack-track:empty { background: var(--surface-3); border-radius: 4px; width: 100%; }
.stack-seg { height: 100%; min-width: 4px; flex-basis: 0; }
.stack-seg:first-child { border-radius: 4px 0 0 4px; }
.stack-seg:last-child { border-radius: 0 4px 4px 0; }
.stack-seg:only-child { border-radius: 4px; }
.stack-seg:hover { filter: brightness(1.08); }
.seg-satista { background: var(--st-satista); }
.seg-rezerve { background: var(--st-rezerve); }
.seg-satildi { background: var(--st-satildi); }
.stack-total { grid-area: total; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.stack-detail { grid-area: detail; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bar-list a { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; padding: 8px; margin: 0 -8px; border-radius: var(--r); }
.bar-list a:hover { background: var(--surface-2); }
.bar-list-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list-value { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-list-track { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-list-track span { display: block; height: 100%; background: var(--accent); border-radius: 4px; opacity: .85; }

/* ---------- Kullanıcılar / profil ---------- */
.role-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 16px; font-size: 13px; }
.role-legend > div { display: flex; align-items: center; gap: 8px; }
.profile-hero { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 16px; flex-wrap: wrap; }
.profile-hero > div { flex: 1; min-width: 200px; }
.profile-hero .text-muted { margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.profile-stats { display: flex; gap: 28px; margin: 0; }
.profile-stats dt { font-size: 12px; color: var(--text-3); }
.profile-stats dd { margin: 2px 0 0; font-weight: 600; }

/* ---------- Giriş ekranı ---------- */
.auth {
    min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden;
    background: var(--bg);
}
.auth::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(700px 420px at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.auth-card {
    position: relative; width: 100%; max-width: 400px; padding: 32px 28px 28px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 24px; }
.auth-brand .logo-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 19px; }
.auth-brand .logo-text { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.auth-card h1 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; text-align: center; }
.auth-card .form-stack { margin-top: 22px; }
.auth-card .alert { margin-top: 18px; }
.auth-card .btn-lg { margin-top: 6px; }
.auth-foot { position: relative; margin-top: 20px; text-align: center; color: var(--text-4); font-size: 12.5px; }
body.guest { background: var(--bg); }
body.guest > .error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ---------- Hata sayfası ---------- */
.error-page { text-align: center; padding: 60px 20px; max-width: 560px; margin: 0 auto; }
.error-code { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); padding: 4px 10px; border-radius: 20px; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.error-page h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.error-page p { color: var(--text-3); margin: 8px 0 24px; }
.error-actions { display: flex; gap: 8px; justify-content: center; }
.trace { text-align: left; background: #0c0c0e; color: #e4e4e7; padding: 16px; border-radius: var(--r-lg); overflow: auto; font-size: 12px; margin-top: 28px; max-width: 90vw; }

/* ---------- Tam ekran galeri ---------- */
.viewer { position: fixed; inset: 0; z-index: 110; background: #050506; color: #fafafa; display: flex; flex-direction: column; animation: fade .18s; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; position: relative; z-index: 3; }
.viewer-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.viewer-title .mono { font-size: 12px; color: #a1a1aa; }
.viewer-title strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-tools { display: flex; align-items: center; gap: 8px; }
.viewer-counter { font-size: 13px; color: #a1a1aa; font-variant-numeric: tabular-nums; margin-right: 6px; }
.viewer-btn { height: 38px; min-width: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; border: 1px solid rgb(255 255 255 / .1); background: rgb(255 255 255 / .06); color: #fafafa; font-weight: 550; font-size: 13px; cursor: pointer; }
.viewer-btn:hover { background: rgb(255 255 255 / .14); }
.viewer-btn.is-small { height: 30px; min-width: 30px; padding: 0; border: 0; background: var(--surface-3); color: var(--text); }
.viewer-btn .icon { width: 18px; }
.viewer-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 64px; touch-action: pan-y; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; animation: fade .2s; }
.viewer-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #71717a; }
.viewer-empty .icon { width: 40px; height: 40px; stroke-width: 1.3; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .12); background: rgb(255 255 255 / .08); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); transition: background .15s; }
.viewer-nav:hover { background: rgb(255 255 255 / .18); }
.viewer-nav .icon { width: 22px; height: 22px; }
.viewer-nav.is-prev { left: 12px; }
.viewer-nav.is-next { right: 12px; }
.viewer-thumbs { display: flex; gap: 8px; justify-content: center; overflow-x: auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.viewer-thumbs button { width: 60px; height: 60px; flex-shrink: 0; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: #18181b; cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s; }
.viewer-thumbs button:hover { opacity: .9; }
.viewer-thumbs button.is-active { opacity: 1; border-color: #f97316; }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.viewer-panel { position: absolute; z-index: 4; top: 70px; right: 16px; width: min(380px, calc(100vw - 32px)); max-height: calc(100% - 170px); overflow-y: auto; background: var(--surface); color: var(--text); border-radius: 14px; padding: 18px 20px; box-shadow: 0 24px 60px rgb(0 0 0 / .5); animation: rise .2s var(--ease); }
.viewer-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.viewer-panel h2 { font-size: 18px; font-weight: 650; line-height: 1.3; }
.viewer-price { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 14px; }
.viewer-panel dl { margin: 0; display: grid; gap: 12px; border-top: 1px solid var(--border); padding-top: 14px; }
.viewer-panel dt { font-size: 12px; color: var(--text-3); font-weight: 500; }
.viewer-panel dd { margin: 2px 0 0; white-space: pre-line; }
body.viewer-open { overflow: hidden; }

/* ---------- Animasyonlar ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-2px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Duyarlı ---------- */
@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar) !important; box-shadow: var(--shadow-lg); }
    .main, .sidebar-mini .main { margin-left: 0; }
    .sidebar-collapse { display: none; }
    .sidebar-mini .brand-text, .sidebar-mini .nav-link span, .sidebar-mini .nav-group-title, .sidebar-mini .user-card-text, .sidebar-mini .user-card-chev { display: revert; }
    .sidebar-mini .sidebar-head { flex-direction: row; padding: 0 12px 0 16px; justify-content: space-between; }
    .sidebar-mini .sidebar-head .brand { display: flex; }
    .sidebar-mini .nav-link { justify-content: flex-start; padding: 0 10px; }
    body.sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgb(9 9 11 / .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .topbar .topbar-menu { display: inline-flex; }
    .dash-grid { grid-template-columns: 1fr; }
    .form-layout { grid-template-columns: 1fr; }
    .form-side { position: static; order: -1; }
    .product-form .form-side { order: 0; }
}
@media (max-width: 760px) {
    .topbar { padding: 0 12px; gap: 6px; }
    .content { padding: 20px 14px 48px; }
    .form-bar { margin: 20px -14px -48px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
    .form-bar-status { display: none; }
    .form-bar-inner { justify-content: flex-end; }
    .form-bar-actions { width: 100%; }
    .form-bar-actions .btn { flex: 1; }
    .form-bar-actions .btn-ghost { flex: 0 0 auto; }
    .page-title { font-size: 21px; }
    .page-header { align-items: flex-start; margin-bottom: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .card-header, .card-body { padding-left: 16px; padding-right: 16px; }
    .hide-sm { display: none !important; }
    .show-sm { display: inline; }
    .select-sm { padding-left: 10px; padding-right: 26px; background-position: right 7px center; }
    .hide-md { display: none; }
    .toolbar { padding: 8px; }
    .toolbar-search { flex-basis: 100%; }
    .toolbar-end { margin-left: 0; width: 100%; }
    .toolbar-end .select { flex: 1; min-width: 0; }
    .segmented { width: 100%; }
    .segment { flex: 1; }
    .segment span { justify-content: center; padding: 0 6px; }
    .segment .dot { display: none; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .p-body { padding: 10px; gap: 4px; }
    .p-title { font-size: 13.5px; }
    .p-meta span:last-child { display: none; }
    .p-price { font-size: 15px; }
    .p-top .badge { height: 20px; padding: 0 6px; font-size: 11px; }
    .p-top .badge .icon { display: none; }
    .kpi { padding: 14px 16px; }
    .kpi-value { font-size: 24px; }
    .kpi-grid { gap: 10px; }
    .stack-row { grid-template-columns: 74px 1fr 32px; column-gap: 8px; }
    .auth-card { padding: 26px 20px 22px; }
    .viewer-stage { padding: 0; }
    .viewer-nav { width: 40px; height: 40px; background: rgb(0 0 0 / .4); }
    .viewer-btn span { display: none; }
    .viewer-panel { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 70%; border-radius: 16px 16px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); animation: sheet .25s var(--ease); }
    .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
    .quick-search input { padding-right: 12px; }
    .sort-item { gap: 8px; }
    .sort-index { display: none; }
    .table td, .table th { padding-left: 12px; padding-right: 12px; }
    .profile-stats { gap: 20px; }
}
@media (min-width: 761px) { .hide-md { display: table-cell; } }
@keyframes sheet { from { transform: translateY(100%); } }

/* ---------- Kataloglar ---------- */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.catalog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); display: flex; flex-direction: column; transition: box-shadow .2s var(--ease), border-color .2s; }
.catalog-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.catalog-cover { position: relative; display: grid; gap: 3px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface-3); }
.catalog-cover img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.catalog-cover.count-2 { grid-template-columns: 1fr 1fr; }
.catalog-cover.count-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.catalog-cover.count-3 img:first-child { grid-row: span 2; }
.catalog-cover.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.catalog-cover-empty { display: grid; place-items: center; color: var(--text-4); }
.catalog-cover-empty .icon { width: 34px; height: 34px; stroke-width: 1.3; }
.catalog-state { position: absolute; left: 12px; top: 12px; height: 24px; padding: 0 9px; border-radius: 6px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; background: rgb(255 255 255 / .92); color: var(--success); }
.catalog-card.is-off .catalog-state { color: var(--text-3); }
.catalog-card.is-off .catalog-cover img { filter: grayscale(1); opacity: .6; }
.catalog-body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.catalog-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.catalog-title-row h3 { font-size: 16px; font-weight: 650; line-height: 1.35; }
.catalog-title-row h3 a:hover { color: var(--accent-text); }
.catalog-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-3); margin-top: -4px; }
.catalog-meta span { display: inline-flex; align-items: center; gap: 4px; }
.catalog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.catalog-buttons { display: flex; align-items: center; gap: 2px; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.switch-inline .switch { width: 34px; height: 20px; }
.switch-inline .switch::after { width: 16px; height: 16px; }
.switch-inline .switch:checked::after { transform: translateX(14px); }

.copy-field { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); color: var(--text-4); }
.copy-field input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--text-2); outline: 0; font-family: var(--mono); }
.copy-field.is-lg { height: 42px; padding-right: 10px; }
.copy-field.is-lg input { font-size: 13px; }
.share-actions { display: flex; gap: 8px; }
.share-actions .btn-primary { flex: 1; }
.share-reset { align-self: flex-start; margin-top: -6px; }
.settings-list { display: grid; gap: 18px; }
.settings-list .switch-row > span { gap: 1px; }
.settings-list .switch-row small { font-size: 12px; }

.picked-list { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }
.picked-item, .picker-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 4px; border-radius: var(--r); background: var(--surface); }
.picked-item:hover { background: var(--surface-2); }
.picked-item.is-new { animation: pop .25s var(--ease); }
.picked-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); flex-shrink: 0; border: 1px solid var(--border); }
.picked-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picked-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.picked-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-text small { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 70px; text-align: right; }
.picked-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px 32px; color: var(--text-3); font-size: 13.5px; }
.picked-empty .icon { color: var(--text-4); }
.picker-toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 8px; margin-bottom: 12px; }
.picker-results { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); padding: 4px; transition: opacity .15s; }
.picker-results.is-loading { opacity: .5; }
.picker-item { padding-left: 8px; }
.picker-item + .picker-item { border-top: 1px solid var(--border); border-radius: 0; }
.picker-item.is-picked { opacity: .6; }
.picker-item .btn { min-width: 92px; }
.picker-loading { padding: 24px; text-align: center; color: var(--text-3); }

@media (max-width: 760px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .picker-toolbar { grid-template-columns: 1fr; }
    .picked-item .badge, .picker-item .badge { display: none; }
    .picked-price { min-width: 0; font-size: 13px; }
    .picker-item .btn { min-width: 0; }
}
