:root {
    color-scheme: light dark;

    /* Renk tokenları: Radix/Open Color yaklaşımıyla OKLCH, light-dark() ile tema */
    --nav: light-dark(oklch(20% 0.03 285), oklch(13% 0.02 285));
    --nav-text: oklch(93% 0.008 285);
    --nav-muted: oklch(69% 0.015 285);
    --nav-border: oklch(100% 0 0 / 0.14);
    --nav-active: oklch(100% 0 0 / 0.08);
    --nav-key: oklch(0% 0 0 / 0.28);
    --nav-danger: oklch(80% 0.1 25);
    --nav-glow: oklch(60% 0.15 285 / 0.22);

    --page: light-dark(oklch(97.5% 0.004 285), oklch(17% 0.012 285));
    --surface: light-dark(oklch(100% 0 0), oklch(21% 0.015 285));
    --surface-2: light-dark(oklch(96.4% 0.006 285), oklch(24% 0.018 285));
    --surface-3: light-dark(oklch(94.2% 0.01 285), oklch(27% 0.02 285));
    --text: light-dark(oklch(25% 0.02 285), oklch(94% 0.01 285));
    --muted: light-dark(oklch(48% 0.02 285), oklch(71% 0.015 285));
    --muted-2: light-dark(oklch(62% 0.02 285), oklch(60% 0.015 285));
    --line: light-dark(oklch(91% 0.006 285), oklch(31% 0.02 285));
    --line-strong: light-dark(oklch(64% 0.012 285), oklch(52% 0.02 285));
    --action: light-dark(oklch(58% 0.18 285), oklch(74% 0.15 285));
    --action-hover: light-dark(oklch(52% 0.19 285), oklch(80% 0.13 285));
    --action-2: light-dark(oklch(66% 0.16 300), oklch(80% 0.12 300));
    --on-action: light-dark(oklch(99% 0 0), oklch(19% 0.04 285));
    --selected: light-dark(oklch(96% 0.025 285), oklch(29% 0.05 285));
    --selection: light-dark(oklch(87% 0.06 285 / 0.55), oklch(45% 0.09 285 / 0.55));
    --danger: light-dark(oklch(45% 0.14 25), oklch(74% 0.13 25));
    --danger-soft: light-dark(oklch(96% 0.03 25), oklch(28% 0.06 25));
    --danger-line: light-dark(oklch(84% 0.07 25), oklch(45% 0.1 25));
    --warning: light-dark(oklch(52% 0.12 75), oklch(82% 0.11 80));
    --warning-soft: light-dark(oklch(96% 0.04 80), oklch(30% 0.06 75));
    --success: light-dark(oklch(45% 0.09 170), oklch(78% 0.09 170));
    --success-soft: light-dark(oklch(95% 0.03 170), oklch(28% 0.05 170));
    --info: light-dark(oklch(48% 0.13 250), oklch(80% 0.09 250));
    --info-soft: light-dark(oklch(95% 0.025 250), oklch(29% 0.05 250));
    --focus: var(--action);
    --overlay: light-dark(oklch(18% 0.02 250 / 0.42), oklch(0% 0 0 / 0.62));
    --status-neutral: light-dark(oklch(48% 0.015 250), oklch(70% 0.015 250));
    --status-neutral-soft: light-dark(oklch(95% 0.006 250), oklch(27% 0.012 250));

    --status-yeni: var(--info);
    --status-yeni-soft: var(--info-soft);
    --status-inceleniyor: var(--warning);
    --status-inceleniyor-soft: var(--warning-soft);
    --status-iletisim: var(--success);
    --status-iletisim-soft: var(--success-soft);
    --status-kapali: var(--status-neutral);
    --status-kapali-soft: var(--status-neutral-soft);
    --status-color: var(--action);
    --status-soft: var(--selected);

    /* Tipografi: Modern Font Stacks fallback + Utopia esintili akışkan ölçek */
    --font-sans: "DM Sans", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: clamp(0.9375rem, 0.9125rem + 0.12vw, 1rem);
    --text-md: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
    --text-xl: clamp(1.35rem, 1.18rem + 0.65vw, 1.7rem);

    /* Boşluk */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 2rem;
    --page-pad: clamp(1rem, 0.72rem + 1vw, 1.75rem);
    --gap: clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
    --nav-w: clamp(220px, 18vw, 260px);

    /* Şekil, gölge, hareket */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;
    --shadow-1: 0 1px 2px light-dark(rgb(15 23 42 / 0.05), rgb(0 0 0 / 0.3)),
        0 1px 3px light-dark(rgb(15 23 42 / 0.06), rgb(0 0 0 / 0.35));
    --shadow-2: 0 6px 18px light-dark(rgb(15 23 42 / 0.08), rgb(0 0 0 / 0.42));
    --shadow-3: 0 24px 60px light-dark(rgb(15 23 42 / 0.2), rgb(0 0 0 / 0.58));
    --shadow-focus: 0 0 0 3px color-mix(in oklab, var(--focus) 24%, transparent);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-1: 120ms;
    --dur-2: 200ms;
    --dur-3: 320ms;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
}

html, body { margin: 0; }

body {
    background: var(--page);
    color: var(--text);
    font-family: "DM Sans", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    overflow-x: clip;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.nav {
    background: var(--nav);
    color: #e7ecf1;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    overflow: auto;
}

.brand {
    font-weight: 600;
    margin: 0 12px 20px;
}

.nav-group + .nav-group { margin-top: 20px; }

.nav-label {
    margin: 0 12px 6px;
    font-size: 12px;
    line-height: 1.3;
    color: #93a0ad;
}

.nav-links { display: grid; gap: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    min-height: 36px;
}

.nav-link span:first-child { min-width: 0; overflow-wrap: anywhere; }

.nav-count {
    color: #93a0ad;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.nav-link.is-current { background: rgba(255, 255, 255, 0.08); }

.nav-command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: calc(100% - 24px);
    margin: 0 12px 18px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    text-align: start;
    min-height: 36px;
}

.nav-command kbd {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #b8c3ce;
    font: 11px ui-monospace, "Cascadia Mono", Consolas, monospace;
    white-space: nowrap;
}

.nav-count.is-overdue { color: #ffb4b4; font-weight: 600; }

.nav-link:focus-visible { outline-color: #ffffff; }

.main {
    min-width: 0;
    padding: 16px 20px 24px;
}

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

h1, h2, h3, p { margin: 0; }

h1 {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
}

h2 {
    font-size: 20px;
    line-height: 1.25;
    font-weight: 600;
    overflow-wrap: anywhere;
}

h3 {
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.count, .meta { color: var(--muted); font-size: 13px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0 8px;
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.toolbar .field {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.toolbar label { white-space: nowrap; }

.field-filter { flex: 0 1 240px; }

.toolbar .export { flex: 0 0 auto; white-space: nowrap; }

label { font-size: 13px; color: var(--muted); }

input, select, textarea, button { font: inherit; color: var(--text); }

input[type="search"], select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 6px;
    padding: 4px 10px;
    min-height: 32px;
}

textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.45;
}

button {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

button.primary {
    background: var(--action);
    color: #ffffff;
    border: 1px solid var(--action);
}

button.quiet {
    background: var(--surface);
    border: 1px solid var(--line);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.chip.is-current {
    background: var(--selected);
    border-color: var(--action);
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 20px;
    align-items: start;
}

.table-wrap { min-width: 0; position: relative; }

.table-wrapper {
    overflow: auto;
    max-inline-size: 100%;
    max-block-size: min(500px, 80vh);
    container-type: inline-size;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.clip {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

table.leads {
    border-collapse: separate;
    border-spacing: 0;
    min-inline-size: 660px;
    inline-size: 100%;
    --label-2: "Yer";
    --label-3: "Konu";
    --label-4: "Taranma";
    --label-5: "Durum";
}

table.leads th,
table.leads td {
    padding: 8px 10px;
    border-block-end: 1px solid var(--line);
    text-align: start;
    vertical-align: top;
}

table.leads thead {
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
    background: var(--surface);
}

table.leads tbody th {
    position: sticky;
    inset-inline-start: 0;
    z-index: 0;
    background: var(--surface);
}

table.leads tr.is-selected th,
table.leads tr.is-selected td { background: var(--selected); }

table.leads th:has(> button) { padding: 0; }

thead th button {
    font: inherit;
    font-size: 12px;
    color: var(--muted);
    background: transparent;
    border: 0;
    min-block-size: 32px;
    inline-size: 100%;
    text-align: start;
    padding: 6px 10px;
    cursor: pointer;
}

th[aria-sort="ascending"] button::after,
th[aria-sort="descending"] button::after {
    content: "";
    display: inline-block;
    margin-inline-start: 6px;
    border: 4px solid transparent;
    vertical-align: middle;
}

th[aria-sort="ascending"] button::after { border-bottom-color: currentColor; }
th[aria-sort="descending"] button::after { border-top-color: currentColor; }

table.leads tbody tr { cursor: pointer; }

.who a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

@container (width < 600px) {
    table.leads,
    table.leads thead,
    table.leads tbody,
    table.leads tr,
    table.leads th,
    table.leads td { display: block; }

    table.leads { min-inline-size: 0; }

    table.leads thead { display: none; }

    table.leads tr {
        margin: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    table.leads tbody th {
        position: sticky;
        inset-block-start: 0;
        inset-inline-start: auto;
        z-index: 2;
        background: var(--page);
    }

    table.leads tr.is-selected th { background: var(--selected); }

    table.leads td:nth-child(2)::before { content: var(--label-2) ": "; font-weight: 600; }
    table.leads td:nth-child(3)::before { content: var(--label-3) ": "; font-weight: 600; }
    table.leads td:nth-child(4)::before { content: var(--label-4) ": "; font-weight: 600; }
    table.leads td:nth-child(5)::before { content: var(--label-5) ": "; font-weight: 600; }
}

.list, .detail, .empty {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.empty { padding: 24px; color: var(--muted); }

.empty.inset { margin: 16px; }

.list-head, .list-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(104px, 0.8fr) minmax(128px, auto);
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
}

.list-head span,
.list-row > .cell {
    min-width: 0;
}

.list-head {
    color: var(--muted);
    font-size: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.list-row {
    border-top: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

.list-row.is-selected { background: var(--selected); }

.who strong, .who small, .issue, .place, .meta, code, .site, .evidence a {
    overflow-wrap: anywhere;
}

.who strong, .who small { display: block; }

.who small { color: var(--muted); font-size: 12px; }

.who small.note-mark { color: var(--action); }

.status {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    background: var(--surface);
}

.detail {
    padding: 20px;
    display: grid;
    gap: 16px;
    min-width: 0;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.detail-title { min-width: 0; }

.status-line { margin: 2px 0 0; }

.detail section { display: grid; gap: 8px; }

.facts { display: grid; gap: 8px; margin: 0; }

.facts div {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
}

.facts dt, .facts dd { margin: 0; }

.facts dt { color: var(--muted); font-size: 13px; }

.facts dd, .detail section p { overflow-wrap: anywhere; }

#draft-text { white-space: pre-wrap; }

.detail .site, .evidence a { color: var(--action); overflow-wrap: anywhere; }

.evidence {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.evidence time { display: block; color: var(--muted); font-size: 12px; }

code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.status-form, .note-form { display: grid; gap: 8px; }

.status-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-switch button[aria-pressed="true"] {
    background: var(--selected);
    border-color: var(--action);
    color: var(--action);
}

.note-form button { justify-self: start; }

.note-list, .note-index {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: grid;
    gap: 12px;
}

.note-list li, .note-card {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.note-list li { padding-top: 12px; border-top: 1px solid var(--line); }

.note-list p, .note-card p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note-list time, .note-card time { color: var(--muted); font-size: 12px; }

.note-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.note-card a {
    display: grid;
    gap: 2px;
    color: inherit;
    text-decoration: none;
}

.note-card a:hover strong { color: var(--action); }

.note-delete-form { justify-self: start; }

.note-empty[hidden] { display: none; }

.save-note { color: var(--muted); font-size: 13px; min-height: 0; }

.save-note:empty { display: none; }

.save-note.is-error { color: var(--danger); }

.form-error { color: var(--danger); font-size: 13px; }

@media (min-width: 1181px) {
    .detail { position: sticky; top: 16px; }
}

@media (max-width: 1180px) {
    .workspace { grid-template-columns: 1fr; }
    .list-head, .list-row {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(120px, auto);
    }
    .list-head span:nth-child(4),
    .when { display: none; }
}

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .nav {
        display: block;
        height: auto;
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
        z-index: 4;
    }
    .brand { margin: 0; }
    .nav-groups {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        margin: 10px -16px 0;
        padding: 0 16px 2px;
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }
    .nav-groups::-webkit-scrollbar { display: none; }
    .nav-group { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
    .nav-group + .nav-group { margin-top: 0; }
    .nav-label { margin: 0 6px 0 0; white-space: nowrap; }
    .nav-links { display: flex; gap: 4px; }
    .nav-link { min-height: 44px; width: auto; white-space: nowrap; }
    .main {
        padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .field { flex-direction: column; align-items: stretch; }
    .field-filter { flex: 1 1 auto; width: 100%; }
    .toolbar button { width: 100%; }
    .page-head { align-items: start; }
    h1 { font-size: 22px; }
    input[type="search"], select, textarea, button { font-size: 16px; }
    .chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px 4px;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: 0 0 auto; min-height: 44px; }
    .list { background: transparent; border: 0; }
    .list-head { display: none; }
    .when { display: grid; }
    .list-row {
        position: relative;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "who state"
            "place place"
            "issue issue"
            "when when";
        gap: 6px 12px;
        align-items: start;
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
    }
    .list-row.is-selected { border-color: var(--action); }
    .who { grid-area: who; }
    .place { grid-area: place; }
    .issue { grid-area: issue; }
    .when { grid-area: when; }
    .state { grid-area: state; align-self: start; }
    .list-row .cell:not(.who):not(.state) {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px;
        align-items: baseline;
    }
    .list-row .cell:not(.who):not(.state)::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
    }
    button, input[type="search"], select, textarea { min-height: 44px; }
    textarea { min-height: 96px; }
    .detail-head { align-items: flex-start; }
    .facts div { grid-template-columns: 1fr; gap: 2px; }
    .status-switch { display: grid; grid-template-columns: 1fr 1fr; }
    .status-switch button { width: 100%; min-height: 44px; }
    .note-form button { width: 100%; }
}

/* Smart views, bulk actions and pipeline board */
.smart-views {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 12px;
}

.smart-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.smart-chip.is-current {
    background: var(--selected);
    border-color: var(--action);
}

.chip-count {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.view-switch {
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-switch .chip { min-height: 32px; }

.bulk-bar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

body:has(.row-select:checked) .bulk-bar,
.bulk-bar.has-selection { display: flex; }

.bulk-summary { color: var(--muted); font-size: 13px; }

.bulk-bar select {
    width: auto;
    min-width: 190px;
}

.bulk-export[hidden] { display: none; }

.who .row-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    margin-inline-end: 4px;
    vertical-align: top;
    cursor: pointer;
}

.row-check input {
    accent-color: var(--action);
    inline-size: 1.1em;
    block-size: 1.1em;
    margin: 0;
    cursor: pointer;
}

.who .task-mark { color: var(--muted); }

.task-mark.is-overdue,
.stale-mark { color: var(--danger); }

.task-mark.is-today { color: #8a5300; }

.stale-mark { font-size: 12px; }

.board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(268px, 1fr);
    gap: 12px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 8px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.board-column {
    min-height: 150px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #eef2f5;
}

.board-column.is-over {
    border-color: var(--action);
    background: var(--selected);
}

.board-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px 10px;
}

.board-head h2 {
    font-size: 14px;
    font-weight: 600;
}

.board-count {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.board-cards {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 80px;
}

.deal-card {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 10px 10px 8px 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.deal-card h3 {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.deal-card h3 a {
    color: inherit;
    text-decoration: none;
}

.deal-card h3 a:hover { color: var(--action); }

.deal-card .meta { font-size: 12px; }

.card-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
}

.card-marks:empty { display: none; }

.drag-handle {
    position: absolute;
    inset-inline-start: 8px;
    inset-block-start: 9px;
    color: #98a4b1;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    font-size: 14px;
    line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

.deal-card.is-dragging { opacity: 0.55; }

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.card-actions { display: flex; gap: 4px; }

.card-actions button {
    min-height: 30px;
    padding: 3px 8px;
}

.board-empty {
    padding: 8px 4px;
    color: var(--muted);
    font-size: 12px;
}

/* Tasks */
.tasks { display: grid; gap: 10px; }

.task-form { display: grid; gap: 8px; }

.task-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.7fr) auto;
    gap: 8px;
    align-items: center;
}

.task-grid input,
.task-grid select { min-height: 36px; }

.task-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.task-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.task-item:first-child { border-top: 0; padding-top: 0; }

.task-body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.task-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.task-check {
    width: 30px;
    min-height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--action);
}

.task-item.is-done .task-title {
    color: var(--muted);
    text-decoration: line-through;
}

.due-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
}

.due-badge.is-overdue { color: var(--danger); border-color: currentColor; }
.due-badge.is-today { color: #8a5300; border-color: currentColor; }

.priority { margin-inline-start: 6px; color: var(--muted); font-size: 12px; }
.priority.is-high { color: var(--danger); font-weight: 600; }

.task-list-page { display: grid; gap: 12px; }

.task-list-page .task-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.callout {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13px;
}

.callout.danger {
    border-color: #e6b8b8;
    background: #fdf1f1;
    color: var(--danger);
}

/* Command palette */
.palette {
    width: min(560px, calc(100vw - 32px));
    max-height: min(72vh, 560px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.palette[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.palette:modal { overscroll-behavior: contain; }

.palette::backdrop {
    overflow: hidden;
    overscroll-behavior: contain;
    background: rgba(15, 23, 42, 0.38);
}

.palette-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
}

.palette-head input {
    flex: 1;
    min-height: 40px;
    padding: 4px 6px;
    border: 0;
    background: transparent;
    font-size: 16px;
    outline: 0;
}

.palette-head input:focus-visible { outline: none; }

.palette-close {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 12px;
}

.palette ul {
    min-height: 80px;
    margin: 0;
    padding: 6px;
    overflow: auto;
    list-style: none;
}

.palette-option {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.palette-option.is-active,
.palette-option:hover { background: var(--selected); }

.palette-option-hint {
    color: var(--muted);
    font-size: 12px;
    text-align: end;
    overflow-wrap: anywhere;
}

.palette-empty {
    padding: 16px;
    color: var(--muted);
    font-size: 13px;
}

.palette-hint {
    margin: 0;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 800px) {
    .nav-command {
        width: 100%;
        margin: 10px 0 0;
    }

    .smart-views {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        margin-inline: -16px;
        padding: 0 16px 4px;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }

    .smart-views::-webkit-scrollbar { display: none; }

    .smart-chip {
        flex: 0 0 auto;
        min-height: 44px;
    }

    .toolbar .view-switch {
        justify-content: stretch;
    }

    .view-switch .chip { flex: 1; justify-content: center; }

    .bulk-bar select { width: 100%; }

    .bulk-bar button,
    .bulk-bar .bulk-export { flex: 1 1 auto; justify-content: center; }

    .board {
        grid-auto-columns: minmax(84vw, 1fr);
        margin-inline: -16px;
        padding-inline: 16px;
    }

    .task-grid { grid-template-columns: 1fr; }

    .task-grid button { width: 100%; }

    .task-item { grid-template-columns: auto minmax(0, 1fr); }

    .task-item > form:last-child { grid-column: 2; justify-self: start; }

    .palette { width: calc(100vw - 24px); max-height: 80vh; }
}

.quick-link {
    margin-inline-start: 8px;
    color: var(--action);
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

/* ==========================================================================
   Design system polish
   Radix/Open Color yaklaşımıyla OKLCH token'lar, Utopia esintili akışkan
   tipografi, Modern Font Stacks fallback'i ve light-dark() tema desteği.
   ========================================================================== */

:root {
    --scroll-thumb: light-dark(oklch(72% 0.02 250), oklch(50% 0.02 250));
    --scroll-track: transparent;
}

html {
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    font-optical-sizing: auto;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    accent-color: var(--action);
}

::selection {
    background: var(--selection);
    color: var(--text);
}

::placeholder {
    color: var(--muted);
    opacity: 1;
}

a {
    color: var(--action);
    text-underline-offset: 0.18em;
}

code {
    font-family: var(--font-mono);
}

.shell {
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
}

.main {
    padding: var(--page-pad);
}

.page-head {
    align-items: end;
    gap: var(--space-4);
}

.page-head h1 {
    letter-spacing: -0.025em;
}

.page-head .count {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

h1 {
    font-size: var(--text-xl);
    line-height: 1.15;
    text-wrap: balance;
}

h2 {
    font-size: var(--text-lg);
    line-height: 1.25;
    text-wrap: balance;
}

h3 {
    font-size: var(--text-xs);
    line-height: 1.35;
}

.detail h3 {
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.count,
.meta {
    font-size: var(--text-sm);
}

.who small,
.who .task-mark,
.stale-mark,
.note-mark {
    font-size: var(--text-xs);
}

/* Navigasyon */
.nav {
    color: var(--nav-text);
    background:
        radial-gradient(120% 70% at 0% 0%, var(--nav-glow), transparent 62%),
        var(--nav);
    box-shadow: inset -1px 0 0 var(--nav-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 22px;
    color: var(--nav-text);
    text-decoration: none;
    min-width: 0;
}

.brand-logo {
    display: grid;
    place-items: center;
    inline-size: 36px;
    block-size: 36px;
    flex: none;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--action), var(--action-2));
    color: var(--on-action);
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 6px 16px color-mix(in oklab, var(--action) 28%, transparent);
    transition:
        transform var(--dur-2) var(--ease-out),
        box-shadow var(--dur-2) var(--ease-out);
}

.brand:hover .brand-logo {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px color-mix(in oklab, var(--action) 38%, transparent);
}

.brand-text {
    display: grid;
    gap: 1px;
    min-width: 0;
    line-height: 1.15;
}

.brand-text strong {
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand-text small {
    color: var(--nav-muted);
    font-size: var(--text-xs);
    font-weight: 400;
}

.nav-label {
    color: var(--nav-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link {
    color: var(--nav-text);
    border-radius: var(--radius-sm);
    transition:
        background-color var(--dur-1) var(--ease-out),
        box-shadow var(--dur-1) var(--ease-out);
}

.nav-link:hover {
    background: var(--nav-active);
}

.nav-link.is-current {
    background: var(--nav-active);
    box-shadow: inset 2px 0 0 var(--action);
}

.nav-link:focus-visible {
    outline-color: var(--nav-text);
}

.nav-count {
    color: var(--nav-muted);
    font-size: var(--text-xs);
}

.nav-count.is-overdue {
    color: var(--nav-danger);
}

.nav-command {
    border-color: oklch(100% 0 0 / 0.24);
    background: var(--nav-active);
    color: var(--nav-text);
    transition:
        background-color var(--dur-1) var(--ease-out),
        border-color var(--dur-1) var(--ease-out);
}

.nav-command:hover {
    background: oklch(100% 0 0 / 0.12);
    border-color: oklch(100% 0 0 / 0.24);
}

.nav-command span,
.nav-command kbd {
    white-space: nowrap;
}

.nav-command span {
    font-size: var(--text-sm);
}

.nav-command kbd {
    background: var(--nav-key);
    color: var(--nav-muted);
    font-family: var(--font-mono);
}

/* Durum renkleri: renk tek başına anlam taşımaz; etiket ve nokta birlikte kullanılır. */
:where([data-status="Yeni"]) {
    --status-color: var(--status-yeni);
    --status-soft: var(--status-yeni-soft);
}

:where([data-status="İnceleniyor"]) {
    --status-color: var(--status-inceleniyor);
    --status-soft: var(--status-inceleniyor-soft);
}

:where([data-status="İletişime geçildi"]) {
    --status-color: var(--status-iletisim);
    --status-soft: var(--status-iletisim-soft);
}

:where([data-status="Kapatıldı"]) {
    --status-color: var(--status-kapali);
    --status-soft: var(--status-kapali-soft);
}

.status {
    gap: 0.4em;
    color: var(--status-color);
    background: var(--status-soft);
    border-color: color-mix(in oklab, var(--status-color) 32%, transparent);
    font-weight: 500;
}

.status::before {
    content: "";
    inline-size: 0.45em;
    block-size: 0.45em;
    flex: none;
    border-radius: 50%;
    background: currentColor;
}

.nav-link[data-status] > span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link[data-status] > span:first-child::before {
    content: "";
    inline-size: 7px;
    block-size: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--status-color);
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--status-color) 20%, transparent);
}

/* Form kontrolleri ve butonlar */
label {
    font-size: var(--text-sm);
}

input[type="search"],
select,
textarea {
    border-color: var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition:
        border-color var(--dur-1) var(--ease-out),
        box-shadow var(--dur-1) var(--ease-out);
}

input[type="search"]:hover,
select:hover,
textarea:hover {
    border-color: var(--muted-2);
}

input[type="search"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--action);
    box-shadow: var(--shadow-focus);
}

button {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition:
        background-color var(--dur-1) var(--ease-out),
        border-color var(--dur-1) var(--ease-out),
        box-shadow var(--dur-1) var(--ease-out),
        transform var(--dur-1) var(--ease-out);
}

button.quiet {
    border-color: var(--line-strong);
}

button.quiet:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--muted-2);
}

button.primary {
    color: var(--on-action);
    background: var(--action);
    border-color: var(--action);
    box-shadow: 0 1px 2px light-dark(rgb(15 23 42 / 0.12), rgb(0 0 0 / 0.35));
}

button.primary:hover:not(:disabled) {
    background: var(--action-hover);
    border-color: var(--action-hover);
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Araç çubuğu, çipler ve toplu işlem çubuğu */
.toolbar {
    margin: var(--space-3) 0 var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.toolbar .field label {
    font-size: var(--text-sm);
}

.chip,
.smart-chip {
    border-color: var(--line-strong);
    background: var(--surface);
    transition:
        background-color var(--dur-1) var(--ease-out),
        border-color var(--dur-1) var(--ease-out),
        color var(--dur-1) var(--ease-out);
}

.chip:hover,
.smart-chip:hover {
    border-color: var(--action);
    background: var(--surface-2);
}

.chip.is-current,
.smart-chip.is-current {
    color: var(--action-hover);
    background: var(--selected);
    border-color: var(--action);
}

.chip.is-current .chip-count,
.smart-chip.is-current .chip-count {
    color: var(--action-hover);
}

.chip-count {
    font-variant-numeric: tabular-nums;
}

.bulk-bar {
    border-color: var(--line);
    border-radius: var(--radius-lg);
    box-shadow: inset 3px 0 0 var(--action), var(--shadow-2);
}

.bulk-summary strong {
    color: var(--text);
}

/* Pano ve kayıt kartları */
.board {
    gap: var(--gap);
}

.board-column {
    border-color: var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    box-shadow: inset 0 3px 0 var(--status-color), var(--shadow-1);
}

.board-column.is-over {
    border-color: var(--action);
    background: var(--selected);
}

.board-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--status-color);
}

.board-head h2::before {
    content: "";
    inline-size: 8px;
    block-size: 8px;
    flex: none;
    border-radius: 50%;
    background: currentColor;
}

.board-count {
    padding: 1px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--status-color);
    font-variant-numeric: tabular-nums;
}

.deal-card {
    border-color: var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    transition:
        border-color var(--dur-2) var(--ease-out),
        box-shadow var(--dur-2) var(--ease-out),
        transform var(--dur-2) var(--ease-out);
}

.deal-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}

.deal-card:focus-within {
    border-color: var(--action);
    box-shadow: var(--shadow-focus);
}

.drag-handle {
    color: var(--muted-2);
}

.board-empty {
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    text-align: center;
}

/* Durum ve görev rozetleri */
.who .task-mark,
.card-marks .task-mark,
.stale-mark,
.note-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    line-height: 1.5;
}

.who .task-mark.is-overdue {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: var(--danger-line);
}

.task-mark.is-today,
.stale-mark {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: color-mix(in oklab, var(--warning) 30%, transparent);
}

.note-mark {
    color: var(--action-hover);
    background: var(--selected);
    border-color: color-mix(in oklab, var(--action) 26%, transparent);
}

/* Tablo */
.table-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    max-block-size: min(560px, 78vh);
}

table.leads tbody tr {
    transition: background-color var(--dur-1) var(--ease-out);
}

table.leads tbody tr:not(.is-selected):hover th,
table.leads tbody tr:not(.is-selected):hover td {
    background: var(--surface-2);
}

table.leads tbody th,
table.leads td {
    border-block-end-color: var(--line);
}

thead th button:hover {
    color: var(--text);
    background: var(--surface-2);
}

.who a:hover {
    color: var(--action);
}

.who .row-check {
    border-radius: var(--radius-sm);
}

.who .row-check:hover {
    background: var(--selected);
}

table.leads tr.is-selected th:first-child {
    box-shadow: inset 3px 0 0 var(--status-color);
}

@container (width < 600px) {
    table.leads tr {
        border-color: var(--line);
        border-radius: var(--radius-lg);
        background: var(--surface);
        box-shadow: var(--shadow-1);
    }

    table.leads tbody th {
        background: var(--surface);
    }

    table.leads tr.is-selected {
        border-color: var(--action);
    }

    table.leads td:nth-child(2)::before,
    table.leads td:nth-child(3)::before,
    table.leads td:nth-child(4)::before,
    table.leads td:nth-child(5)::before {
        color: var(--muted);
        font-size: var(--text-xs);
    }
}

/* Detay */
.detail {
    border-radius: var(--radius-lg);
    box-shadow: inset 0 3px 0 var(--status-color), var(--shadow-1);
}

.detail-head {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}

.detail-title h2 {
    letter-spacing: -0.015em;
}

.detail .status-line .status {
    font-size: var(--text-sm);
}

.facts dt {
    font-size: var(--text-sm);
}

.detail section p,
.note-list p,
.note-card p {
    text-wrap: pretty;
}

#draft-text {
    max-width: 70ch;
}

.quick-link {
    font-size: var(--text-xs);
    font-weight: 500;
}

.note-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    transition:
        border-color var(--dur-2) var(--ease-out),
        box-shadow var(--dur-2) var(--ease-out);
}

.note-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
}

.empty {
    border-style: dashed;
    background: transparent;
}

.form-error {
    padding: 8px 10px;
    border: 1px solid var(--danger-line);
    border-inline-start: 3px solid var(--danger);
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
}

/* Görevler */
.task-item {
    transition:
        background-color var(--dur-1) var(--ease-out),
        box-shadow var(--dur-1) var(--ease-out);
}

.task-item.is-overdue {
    box-shadow: inset 3px 0 0 var(--danger);
}

.task-item.is-done {
    opacity: 0.82;
}

.task-check {
    border-color: var(--line-strong);
}

.task-check:hover:not(:disabled) {
    border-color: var(--action);
    background: var(--selected);
}

.due-badge {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.due-badge.is-overdue {
    color: var(--danger);
    background: var(--danger-soft);
}

.due-badge.is-today {
    color: var(--warning);
    background: var(--warning-soft);
}

.priority.is-high {
    color: var(--danger);
}

.task-list-page .task-item {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.task-list-page .task-item:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
}

.callout {
    border-radius: var(--radius-lg);
}

.callout.danger {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

/* Komut paleti */
.palette {
    border-color: var(--line-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3);
}

.palette::backdrop {
    background: var(--overlay);
    backdrop-filter: blur(2px);
}

.palette-head input {
    font-size: var(--text-md);
}

.palette-close {
    border-color: var(--line-strong);
}

.palette-option {
    border-radius: var(--radius-sm);
    transition: background-color var(--dur-1) var(--ease-out);
}

.palette-option:hover {
    background: var(--surface-2);
}

.palette-option.is-active {
    background: var(--selected);
    box-shadow: inset 2px 0 0 var(--action);
}

.palette-hint {
    font-size: var(--text-xs);
}

/* Kaydırma çubukları */
.table-wrapper,
.board,
.palette ul,
.nav {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

/* Erişilebilirlik ve tema tercihleri */
@media (min-width: 1181px) {
    .detail {
        position: sticky;
        top: var(--page-pad);
    }
}

@media (prefers-contrast: more) {
    :root {
        --muted: light-dark(oklch(32% 0.02 250), oklch(84% 0.01 250));
        --line: light-dark(oklch(70% 0.02 250), oklch(55% 0.02 250));
        --line-strong: light-dark(oklch(52% 0.02 250), oklch(68% 0.02 250));
    }

    .status,
    .chip,
    .smart-chip {
        border-width: 2px;
    }

    .deal-card,
    .note-card {
        border-width: 2px;
    }
}

@media (forced-colors: active) {
    .status,
    .chip,
    .smart-chip,
    .deal-card,
    .note-card,
    .toolbar,
    .bulk-bar,
    .task-list-page .task-item,
    .board-column {
        border: 1px solid ButtonText;
    }

    .deal-card,
    .note-card,
    .toolbar,
    .bulk-bar,
    .board-column {
        box-shadow: none;
    }

    .status::before,
    .board-head h2::before,
    .nav-link[data-status] > span:first-child::before {
        background: currentColor;
    }

    :focus-visible {
        outline: 2px solid Highlight;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .deal-card:hover,
    button:active:not(:disabled) {
        transform: none;
    }
}

@media (max-width: 800px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }

    .page-head {
        align-items: start;
    }

    .toolbar {
        padding: var(--space-3);
    }

    .detail {
        border-radius: var(--radius-lg);
    }

    .theme-control {
        margin: 10px 0 0;
    }
}

.status-switch button[data-status][aria-pressed="true"] {
    color: var(--status-color);
    background: var(--status-soft);
    border-color: var(--status-color);
    font-weight: 600;
}

/* Tema seçici: <meta> içeriğini color-scheme'e bağlar, böylece light-dark() takip eder. */
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
}

.theme-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 18px;
    color: var(--nav-muted);
    font-size: var(--text-xs);
}

.theme-control label {
    color: var(--nav-muted);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.theme-control select {
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 2px 8px;
    border-color: oklch(100% 0 0 / 0.24);
    background: var(--nav-active);
    color: var(--nav-text);
    color-scheme: dark;
}

.theme-control select:hover {
    border-color: oklch(100% 0 0 / 0.4);
    background: oklch(100% 0 0 / 0.12);
}

.theme-control select:focus-visible {
    border-color: var(--nav-text);
    box-shadow: 0 0 0 3px oklch(100% 0 0 / 0.18);
}

/* ==========================================================================
   Metronic / Vuexy esintili uygulama kabuğu:
   dikey menü + üst bar + breadcrumb + KPI kartları + yumuşak yüzeyler.
   ========================================================================== */

.content-shell {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(900px 360px at 88% -12%, color-mix(in oklab, var(--action) 7%, transparent), transparent 70%),
        transparent;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-block-size: 64px;
    padding: 10px var(--page-pad);
    border-bottom: 1px solid var(--line);
    background: color-mix(in oklab, var(--surface) 88%, transparent);
    backdrop-filter: blur(12px);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: var(--text-sm);
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.breadcrumb span[aria-hidden="true"] {
    color: var(--line-strong);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: none;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-inline-size: 260px;
    min-block-size: 38px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--muted);
    text-align: start;
}

.topbar-search:hover:not(:disabled) {
    border-color: var(--action);
    background: var(--surface-3);
}

.topbar-search svg {
    inline-size: 18px;
    block-size: 18px;
    flex: none;
}

.topbar-search span {
    flex: 1;
    min-width: 0;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search kbd {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
}

.topbar .theme-control {
    margin: 0;
    color: var(--muted);
}

.topbar .theme-control label {
    color: var(--muted);
}

.topbar .theme-control select {
    min-inline-size: 98px;
    min-block-size: 38px;
    padding: 4px 28px 4px 10px;
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--text);
    color-scheme: inherit;
}

.topbar .theme-control select:hover {
    border-color: var(--action);
    background: var(--surface-2);
}

.topbar .theme-control select:focus-visible {
    border-color: var(--action);
    box-shadow: var(--shadow-focus);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px 3px 3px;
}

.avatar {
    display: grid;
    place-items: center;
    inline-size: 34px;
    block-size: 34px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--action), var(--action-2));
    color: var(--on-action);
    font-size: var(--text-sm);
    font-weight: 600;
    box-shadow: 0 4px 12px color-mix(in oklab, var(--action) 26%, transparent);
}

.topbar-user-text {
    display: grid;
    gap: 1px;
    line-height: 1.15;
}

.topbar-user-text strong {
    font-size: var(--text-sm);
    font-weight: 600;
}

.topbar-user-text small {
    color: var(--muted);
    font-size: var(--text-xs);
}

/* Ana aksiyon rengi: Vuexy tarzı indigo -> violet geçişi */
button.primary {
    color: var(--on-action);
    background: linear-gradient(135deg, var(--action), var(--action-2));
    border-color: transparent;
    box-shadow: 0 8px 18px color-mix(in oklab, var(--action) 24%, transparent);
}

button.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--action-hover), var(--action-2));
    border-color: transparent;
}

.nav-link.is-current {
    background: linear-gradient(90deg, color-mix(in oklab, var(--action) 22%, transparent), transparent 82%);
    box-shadow: inset 2px 0 0 var(--action);
}

/* Dashboard KPI kartları */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap);
    margin: var(--space-3) 0 var(--space-4);
}

.stat-card {
    --stat-color: var(--action);
    --stat-soft: var(--selected);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-1);
    transition:
        border-color var(--dur-2) var(--ease-out),
        box-shadow var(--dur-2) var(--ease-out),
        transform var(--dur-2) var(--ease-out);
}

.stat-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.stat-card.is-info {
    --stat-color: var(--info);
    --stat-soft: var(--info-soft);
}

.stat-card.is-warning {
    --stat-color: var(--warning);
    --stat-soft: var(--warning-soft);
}

.stat-card.is-success {
    --stat-color: var(--success);
    --stat-soft: var(--success-soft);
}

.stat-icon {
    display: grid;
    place-items: center;
    inline-size: 42px;
    block-size: 42px;
    flex: none;
    border-radius: var(--radius-lg);
    background: var(--stat-soft);
    color: var(--stat-color);
}

.stat-icon svg {
    inline-size: 20px;
    block-size: 20px;
}

.stat-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.stat-label {
    color: var(--muted);
    font-size: var(--text-sm);
}

.stat-value {
    color: var(--text);
    font-size: clamp(1.4rem, 1.2rem + 0.5vw, 1.7rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-foot {
    color: var(--muted);
    font-size: var(--text-xs);
}

@media (max-width: 980px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .breadcrumb {
        display: none;
    }

    .topbar-search {
        min-inline-size: 200px;
    }
}

@media (max-width: 800px) {
    .topbar {
        position: static;
        min-block-size: 58px;
        padding: 10px 16px;
    }

    .breadcrumb {
        display: none;
    }

    .topbar-actions {
        margin-inline-start: auto;
    }

    .topbar-search {
        min-inline-size: 0;
        inline-size: 38px;
        padding: 0;
        justify-content: center;
    }

    .topbar-search span,
    .topbar-search kbd {
        display: none;
    }

    .topbar .theme-control label {
        display: none;
    }

    .topbar .theme-control select {
        min-inline-size: 92px;
    }

    .topbar-user-text {
        display: none;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stat-card:hover {
        transform: none;
    }
}
