/* =============================================================================
   TURQOZ YAZILIM — Merkezî Tema Sistemi
   -----------------------------------------------------------------------------
   Tek tasarım sistemi, iki görünüm. Bütün renkler CSS değişkenlerindedir;
   bileşenler yalnızca değişkenleri kullanır. Böylece aydınlık ve karanlık mod
   birbirinden bağımsız iki tasarım değil, aynı sistemin iki görünümü olur.

   Tema seçimi <html data-theme="light|dark"> ile yapılır.
   Varsayılan: light.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Marka */
    --tq-brand:            #D92D16;
    --tq-brand-hover:      #B92310;
    --tq-brand-ink:        #A51F12;
    --tq-brand-soft:       #FDE8E4;
    --tq-brand-soft-2:     #FFF4F1;
    --tq-accent:           #171717;
    --tq-accent-soft:      #EEEEEE;

    /* Yüzeyler */
    --tq-bg:               #FAFAF7;
    --tq-surface:          #FFFFFF;
    --tq-surface-2:        #FFFFFF;
    --tq-surface-3:        #F3F7F6;
    --tq-overlay:          rgba(18, 26, 28, .45);

    /* Metin */
    --tq-text:             #263238;
    --tq-text-muted:       #69777C;
    --tq-text-faint:       #8A979B;
    --tq-text-inverse:     #FFFFFF;

    /* Çizgiler */
    --tq-border:           #E5EAEA;
    --tq-border-strong:    #D2DCDC;
    --tq-input-bg:         #FFFFFF;
    --tq-input-border:     #D2DCDC;

    /* Kenar çubuğu */
    --tq-sidebar-bg:       #171717;
    --tq-sidebar-bg-2:     #252525;
    --tq-sidebar-text:     #FFFFFF;
    --tq-sidebar-muted:    rgba(255, 255, 255, .78);
    --tq-sidebar-active:   rgba(255, 255, 255, .18);
    --tq-sidebar-border:   rgba(255, 255, 255, .22);
    --tq-sidebar-hover:    rgba(255, 255, 255, .12);

    /* Durum renkleri */
    --tq-success:          #1E8449;
    --tq-success-soft:     #E4F5EA;
    --tq-warning:          #9A6700;
    --tq-warning-soft:     #FFF4D6;
    --tq-danger:           #C0392B;
    --tq-danger-soft:      #FDEAE8;
    --tq-info:             #A51F12;
    --tq-info-soft:        #FDE8E4;

    /* Gölge & geometri */
    --tq-shadow-xs:        0 1px 2px rgba(18, 32, 33, .06);
    --tq-shadow-sm:        0 2px 8px rgba(18, 32, 33, .06);
    --tq-shadow:           0 10px 30px rgba(18, 32, 33, .09);
    --tq-shadow-lg:        0 24px 60px rgba(18, 32, 33, .16);
    --tq-radius:           14px;
    --tq-radius-sm:        10px;
    --tq-radius-xs:        8px;
    --tq-radius-pill:      999px;

    --tq-sidebar-width:    248px;
    --tq-topbar-height:    64px;

    /* Marka yüzeyleri: Ankara Sofrası logosundaki siyah ve kırmızı */
    --tq-hero-from:        #171717;
    --tq-hero-to:          #303030;

    --tq-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --tq-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

    --tq-transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

[data-theme="dark"] {
    color-scheme: dark;

    --tq-brand:            #D92D16;
    --tq-brand-hover:      #B92310;
    --tq-brand-ink:        #FF7868;
    --tq-brand-soft:       #46201D;
    --tq-brand-soft-2:     #351B18;
    --tq-accent:           #F0F0F0;
    --tq-accent-soft:      #292929;

    --tq-bg:               #121A1C;
    --tq-surface:          #1B2729;
    --tq-surface-2:        #233235;
    --tq-surface-3:        #1F2C2E;
    --tq-overlay:          rgba(4, 9, 10, .62);

    --tq-text:             #F2F5F4;
    --tq-text-muted:       #A6B5B3;
    --tq-text-faint:       #849492;
    --tq-text-inverse:     #0B1618;

    --tq-border:           #334447;
    --tq-border-strong:    #3F5457;
    --tq-input-bg:         #202E30;
    --tq-input-border:     #3B4E51;

    --tq-sidebar-bg:       #101010;
    --tq-sidebar-bg-2:     #1B1B1B;
    --tq-sidebar-text:     #EAF4F2;
    --tq-sidebar-muted:    #9DB5B2;
    --tq-sidebar-active:   rgba(240, 68, 46, .2);
    --tq-sidebar-border:   rgba(255, 255, 255, .07);
    --tq-sidebar-hover:    rgba(255, 255, 255, .05);

    --tq-hero-from:        #1B1B1B;
    --tq-hero-to:          #080808;

    --tq-success:          #4ADE80;
    --tq-success-soft:     #17342A;
    --tq-warning:          #FBBF24;
    --tq-warning-soft:     #3A2E12;
    --tq-danger:           #F87171;
    --tq-danger-soft:      #3A1F1E;
    --tq-info:             #FF7868;
    --tq-info-soft:        #351B18;

    --tq-shadow-xs:        0 1px 2px rgba(0, 0, 0, .4);
    --tq-shadow-sm:        0 2px 10px rgba(0, 0, 0, .35);
    --tq-shadow:           0 12px 34px rgba(0, 0, 0, .45);
    --tq-shadow-lg:        0 28px 70px rgba(0, 0, 0, .55);
}

/* -----------------------------------------------------------------------------
   Temel
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
/* "hidden" özniteliği her zaman gizler; .btn gibi display tanımlayan sınıflar onu ezemez. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--tq-bg);
    color: var(--tq-text);
    font-family: var(--tq-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: var(--tq-transition);
}

/* Tema değişimi sırasında geçişleri kapat: ekran parlaması / titreme olmaz. */
html.tq-theme-switching *,
html.tq-theme-switching *::before,
html.tq-theme-switching *::after {
    transition: none !important;
    animation-duration: .001s !important;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 700; line-height: 1.25; color: var(--tq-text); }
p { margin: 0 0 1em; }
a { color: var(--tq-brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

::selection { background: var(--tq-brand-soft); color: var(--tq-text); }

:focus-visible {
    outline: 3px solid var(--tq-brand);
    outline-offset: 2px;
    border-radius: 6px;
}

.tq-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tq-muted { color: var(--tq-text-muted); }
.tq-faint { color: var(--tq-text-faint); }
.tq-small { font-size: 13px; }
.tq-xs { font-size: 12px; }
.tq-bold { font-weight: 700; }
.tq-nowrap { white-space: nowrap; }
.tq-right { text-align: right; }
.tq-center { text-align: center; }
.tq-mono { font-family: var(--tq-mono); font-size: .92em; }

/* -----------------------------------------------------------------------------
   Marka kilidi (logo + YAZILIM)
   Orijinal logo görseli değiştirilmez; yalnızca yanına "YAZILIM" eklenir.
   -------------------------------------------------------------------------- */

.tq-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    line-height: 1;
}
.tq-brand:hover { text-decoration: none; }

.tq-brand__logo {
    display: block;
    height: 34px;
    width: auto;
    /* Orijinal oranlar korunur; saydam PNG her iki temada da okunur. */
    object-fit: contain;
}

.tq-brand__word {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--tq-text-muted);
    padding-left: 10px;
    border-left: 1px solid var(--tq-border);
    line-height: 1.1;
}

.tq-brand--stack { flex-direction: column; align-items: flex-start; gap: 8px; }

.tq-brand-mark { height: 30px; width: auto; display: block; }

/* Koyu zeminde logo için nefes payı */
[data-theme="dark"] .tq-brand__logo { filter: saturate(1.05) brightness(1.06); }

/* -----------------------------------------------------------------------------
   Butonlar
   -------------------------------------------------------------------------- */

.btn {
    --btn-bg: var(--tq-brand);
    --btn-fg: #FFFFFF;
    --btn-border: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 42px;
    border-radius: var(--tq-radius-sm);
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s;
    box-shadow: var(--tq-shadow-xs);
}
.btn:hover { background: var(--tq-brand-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.btn--secondary {
    --btn-bg: var(--tq-surface);
    --btn-fg: var(--tq-text);
    --btn-border: var(--tq-border-strong);
    box-shadow: none;
}
.btn--secondary:hover { background: var(--tq-surface-3); }

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--tq-text-muted);
    --btn-border: transparent;
    box-shadow: none;
}
.btn--ghost:hover { background: var(--tq-surface-3); color: var(--tq-text); }

.btn--danger { --btn-bg: var(--tq-danger); --btn-fg: #FFFFFF; }
.btn--danger:hover { filter: brightness(.94); }

.btn--soft {
    --btn-bg: var(--tq-brand-soft);
    --btn-fg: var(--tq-brand-ink);
    --btn-border: transparent;
    box-shadow: none;
}
.btn--soft:hover { background: var(--tq-brand-soft-2); }

.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: var(--tq-radius-xs); }
.btn--xs { min-height: 28px; padding: 4px 9px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 38px; min-height: 38px; }
.btn--icon.btn--sm { width: 32px; min-height: 32px; }

.btn svg { flex-shrink: 0; }

/* -----------------------------------------------------------------------------
   Kartlar
   -------------------------------------------------------------------------- */

.card {
    background: var(--tq-surface);
    border: 1px solid var(--tq-border);
    border-radius: var(--tq-radius);
    box-shadow: var(--tq-shadow-xs);
    transition: var(--tq-transition);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--tq-border);
}
.card__title { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card__title svg { color: var(--tq-brand); }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--tq-border); display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

/* 6'lı KPI gruplarında dengeli 3×2 düzen */
.stat-grid--triple { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stat-grid--triple { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .stat-grid--triple { grid-template-columns: 1fr; } }

.stat {
    background: var(--tq-surface);
    border: 1px solid var(--tq-border);
    border-radius: var(--tq-radius);
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: var(--tq-transition);
}
.stat__icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--tq-brand-soft);
    color: var(--tq-brand-ink);
    flex-shrink: 0;
}
/* Tıklanabilir KPI kutusu (anasayfa → ilgili sayfa) */
.stat--link {
    position: relative;
    padding-right: 32px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.stat--link::after {
    content: '›';
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    font-size: 22px;
    line-height: 1;
    color: var(--tq-text-faint);
    transition: transform .15s, color .15s;
}
.stat--link:hover { border-color: var(--tq-brand); box-shadow: var(--tq-shadow-xs); }
.stat--link:hover::after { color: var(--tq-brand); transform: translate(3px, -50%); }
.stat--link:active { transform: scale(.985); }
.stat--link:focus-visible { outline: 2px solid var(--tq-brand); outline-offset: 2px; }
.stat__label { font-size: 12.5px; font-weight: 600; color: var(--tq-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; color: var(--tq-text); }
.stat__hint { font-size: 12.5px; color: var(--tq-text-faint); margin-top: 2px; }

/* -----------------------------------------------------------------------------
   Form öğeleri
   -------------------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tq-text);
    margin-bottom: 6px;
}
.label .req { color: var(--tq-danger); margin-left: 2px; }

.hint { display: block; font-size: 12.5px; color: var(--tq-text-faint); margin-top: 5px; }

.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    min-height: 42px;
    border-radius: var(--tq-radius-sm);
    border: 1px solid var(--tq-input-border);
    background: var(--tq-input-bg);
    color: var(--tq-text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .18s, box-shadow .18s, background-color .18s;
    appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--tq-text-faint); }
/* Şifre göster/gizle */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--tq-radius-sm); background: transparent; color: var(--tq-text-faint); cursor: pointer;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--tq-text); background: var(--tq-brand-soft); outline: none; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--tq-brand);
    box-shadow: 0 0 0 3px var(--tq-brand-soft);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
    border-color: var(--tq-danger);
    box-shadow: 0 0 0 3px var(--tq-danger-soft);
}
.textarea { min-height: 96px; resize: vertical; }

.select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2369777C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
    padding-right: 38px;
    cursor: pointer;
}
[data-theme="dark"] .select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A6B5B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
.select option { background: var(--tq-surface); color: var(--tq-text); }

.field-error { display: none; font-size: 12.5px; color: var(--tq-danger); margin-top: 5px; font-weight: 600; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--tq-danger); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .field--full { grid-column: 1 / -1; }

.checkbox, .radio {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    cursor: pointer;
    color: var(--tq-text);
}
.checkbox input, .radio input { width: 18px; height: 18px; accent-color: var(--tq-brand); cursor: pointer; }

/* Açma/kapama anahtarı */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    width: 44px; height: 24px; border-radius: 999px;
    background: var(--tq-border-strong);
    position: relative;
    transition: background-color .2s;
    flex-shrink: 0;
}
.switch__track::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--tq-brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--tq-brand); outline-offset: 2px; }

/* -----------------------------------------------------------------------------
   Tablolar
   -------------------------------------------------------------------------- */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--tq-text-muted);
    background: var(--tq-surface-3);
    padding: 11px 14px;
    border-bottom: 1px solid var(--tq-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--tq-border);
    vertical-align: middle;
    color: var(--tq-text);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--tq-surface-3); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table--compact td, .table--compact th { padding: 9px 12px; }

/* -----------------------------------------------------------------------------
   Rozetler / etiketler
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--tq-radius-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    background: var(--tq-surface-3);
    color: var(--tq-text-muted);
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.badge--plain::before { display: none; }

.badge--new        { background: var(--tq-brand); color: #fff; border-color: var(--tq-brand); animation: tq-new-order-pulse 1.5s ease-in-out infinite; }
.badge--new::before { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.22); }
.badge--confirmed  { background: var(--tq-brand-soft);   color: var(--tq-brand-ink); }
.badge--preparing  { background: var(--tq-warning-soft); color: var(--tq-warning); }
.badge--on_the_way { background: var(--tq-success-soft); color: var(--tq-success); }
.badge--delivered  { background: var(--tq-success-soft); color: var(--tq-success); }
.badge--cancelled  { background: var(--tq-danger-soft);  color: var(--tq-danger); }
.badge--cancelled::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}
.badge--cancelled { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: currentColor; }
.badge--refunded   { background: var(--tq-danger-soft);  color: var(--tq-danger); }
.badge--active     { background: var(--tq-success-soft); color: var(--tq-success); }
.badge--pending    { background: var(--tq-warning-soft); color: var(--tq-warning); }
.badge--suspended  { background: var(--tq-danger-soft);  color: var(--tq-danger); }
.badge--muted      { background: var(--tq-surface-3);    color: var(--tq-text-muted); }
.badge--brand      { background: var(--tq-brand-soft);   color: var(--tq-brand-ink); }
.badge--demo       { background: var(--tq-accent-soft);  color: var(--tq-accent); }

@keyframes tq-new-order-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 45, 22, .18); }
    50% { box-shadow: 0 0 0 5px rgba(217, 45, 22, .12); }
}

@media (prefers-reduced-motion: reduce) {
    .badge--new { animation: none; }
}

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: var(--tq-radius-pill);
    background: var(--tq-surface-3); color: var(--tq-text-muted);
    font-size: 13px; font-weight: 600;
}

/* -----------------------------------------------------------------------------
   Sekmeler / segment
   -------------------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--tq-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--tq-text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .18s, border-color .18s;
}
.tab:hover { color: var(--tq-text); }
.tab.is-active { color: var(--tq-brand-ink); border-bottom-color: var(--tq-brand); }

/* Tema seçici (güneş / ay / sistem) */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--tq-radius-pill);
    background: var(--tq-surface-3);
    border: 1px solid var(--tq-border);
}
.theme-switch__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--tq-text-muted);
    width: 34px; height: 30px;
    border-radius: var(--tq-radius-pill);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background-color .18s, color .18s, box-shadow .18s;
}
.theme-switch__btn:hover { color: var(--tq-text); background: var(--tq-surface); }
.theme-switch__btn[aria-pressed="true"] {
    background: var(--tq-surface);
    color: var(--tq-brand-ink);
    box-shadow: var(--tq-shadow-xs);
}
[data-theme="dark"] .theme-switch__btn[aria-pressed="true"] { color: var(--tq-brand-ink); }

.theme-switch--labeled .theme-switch__btn { width: auto; padding: 0 12px; gap: 6px; font-size: 12.5px; font-weight: 700; }

/* -----------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.is-open { display: flex; }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--tq-overlay);
    backdrop-filter: blur(2px);
    animation: tq-fade .16s ease;
}
.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: var(--tq-surface);
    border: 1px solid var(--tq-border);
    border-radius: var(--tq-radius);
    box-shadow: var(--tq-shadow-lg);
    animation: tq-pop .18s ease;
}
.modal__dialog--wide { max-width: 780px; }
.modal__head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 20px; border-bottom: 1px solid var(--tq-border);
}
.modal__title { margin: 0; font-size: 17px; font-weight: 700; }
.modal__body { padding: 20px; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--tq-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal__close {
    appearance: none; border: 0; background: var(--tq-surface-3);
    color: var(--tq-text-muted); width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
    transition: background-color .18s, color .18s;
}
.modal__close:hover { background: var(--tq-border); color: var(--tq-text); }

@keyframes tq-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tq-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* -----------------------------------------------------------------------------
   Bildirimler (toast)
   -------------------------------------------------------------------------- */

.toast-stack {
    position: fixed;
    z-index: 100;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 40px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--tq-radius-sm);
    background: var(--tq-surface);
    border: 1px solid var(--tq-border);
    border-left: 4px solid var(--tq-brand);
    box-shadow: var(--tq-shadow);
    color: var(--tq-text);
    font-size: 14px;
    animation: tq-slide-in .22s ease;
}
.toast--success { border-left-color: var(--tq-success); }
.toast--error   { border-left-color: var(--tq-danger); }
.toast--warning { border-left-color: var(--tq-warning); }
.toast--info    { border-left-color: var(--tq-info); }
.toast__title { font-weight: 700; margin-bottom: 2px; }
.toast__msg { color: var(--tq-text-muted); font-size: 13.5px; }
.toast__close { margin-left: auto; background: none; border: 0; color: var(--tq-text-faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.toast.is-out { animation: tq-slide-out .18s ease forwards; }

@keyframes tq-slide-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tq-slide-out { to { opacity: 0; transform: translateX(20px); } }

/* -----------------------------------------------------------------------------
   Uyarı kutuları
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px 15px;
    border-radius: var(--tq-radius-sm);
    border: 1px solid var(--tq-border);
    background: var(--tq-surface-3);
    color: var(--tq-text);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert--info    { background: var(--tq-info-soft);    border-color: transparent; color: var(--tq-text); }
.alert--success { background: var(--tq-success-soft); border-color: transparent; }
.alert--warning { background: var(--tq-warning-soft); border-color: transparent; }
.alert--danger  { background: var(--tq-danger-soft);  border-color: transparent; }
.alert__icon { flex-shrink: 0; margin-top: 1px; }
.alert strong { font-weight: 700; }

/* -----------------------------------------------------------------------------
   Boş durum / yükleniyor
   -------------------------------------------------------------------------- */

.empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--tq-text-muted);
}
.empty__icon {
    width: 56px; height: 56px; margin: 0 auto 14px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--tq-surface-3);
    color: var(--tq-text-faint);
}
.empty__title { font-weight: 700; color: var(--tq-text); margin-bottom: 4px; }

.spinner {
    width: 22px; height: 22px;
    border: 2.5px solid var(--tq-border);
    border-top-color: var(--tq-brand);
    border-radius: 50%;
    animation: tq-spin .8s linear infinite;
    display: inline-block;
}
.spinner--lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes tq-spin { to { transform: rotate(360deg); } }

.loading-block { display: grid; place-items: center; gap: 12px; padding: 60px 20px; color: var(--tq-text-muted); }

.skeleton {
    background: linear-gradient(90deg, var(--tq-surface-3) 25%, var(--tq-border) 37%, var(--tq-surface-3) 63%);
    background-size: 400% 100%;
    animation: tq-shimmer 1.4s ease infinite;
    border-radius: 6px;
    height: 14px;
}
@keyframes tq-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* -----------------------------------------------------------------------------
   Sayfalama
   -------------------------------------------------------------------------- */

.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination__info { font-size: 13px; color: var(--tq-text-muted); margin-right: auto; }
.page-btn {
    appearance: none;
    min-width: 34px; height: 34px;
    padding: 0 8px;
    border-radius: var(--tq-radius-xs);
    border: 1px solid var(--tq-border);
    background: var(--tq-surface);
    color: var(--tq-text);
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) { background: var(--tq-surface-3); }
.page-btn[aria-current="page"] { background: var(--tq-brand); border-color: var(--tq-brand); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* -----------------------------------------------------------------------------
   Grafikler (bağımlılıksız)
   -------------------------------------------------------------------------- */

.chart { width: 100%; }
.chart__bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 10px; }
.chart__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.chart__bar {
    width: 100%;
    max-width: 44px;
    min-height: 3px;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, var(--tq-brand) 0%, var(--tq-brand-ink) 100%);
    transition: opacity .18s, transform .18s;
    position: relative;
}
.chart__col:hover .chart__bar { opacity: .85; }
.chart__label { font-size: 11px; color: var(--tq-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart__value { font-size: 11.5px; font-weight: 700; color: var(--tq-text-muted); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--tq-text-muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; background: var(--tq-brand); }

.progress { height: 8px; border-radius: 999px; background: var(--tq-surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 999px; background: var(--tq-brand); transition: width .3s ease; }

/* -----------------------------------------------------------------------------
   Yardımcı yerleşim
   -------------------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hr { height: 1px; background: var(--tq-border); border: 0; margin: 20px 0; }

/* Kaydırma çubuğu */
* { scrollbar-width: thin; scrollbar-color: var(--tq-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--tq-border-strong); border-radius: 999px; border: 2px solid var(--tq-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--tq-text-faint); }

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