﻿/* ==========================================================================
   HesapApp Zincir Paneli — Tasarım sistemi (HesapApp.Web.Admin/Content/admin.css ile aynı temel;
   panele özel eklemeler en altta, "19. Zincir paneli" bölümünde)
   Ana renk: #0e509b · Font: Plus Jakarta Sans (Türkçe karakter desteği: latin-ext)
   İkonlar: Material Symbols Rounded
   ========================================================================== */

/* ---------- 1. Renk paleti & tokenlar ---------- */
:root {
    /* Ana renk (#0e509b) tonları */
    --brand-50:  #eef4fb;
    --brand-100: #dbe7f6;
    --brand-200: #b8cfec;
    --brand-300: #88afdd;
    --brand-400: #4f86c8;
    --brand-500: #2667b2;
    --brand-600: #0e509b; /* ana renk */
    --brand-700: #0c4485;
    --brand-800: #0a376c;
    --brand-900: #082a52;
    --brand-950: #051b36;

    /* Nötrler (hafif mavi alt tonlu) */
    --white:       #ffffff;
    --surface:     #ffffff;
    --surface-alt: #f5f8fc;
    --page-bg:     #f3f6fa;
    --line:        #e3e9f1;
    --line-strong: #cfd9e6;
    --ink:         #0f1d33;
    --ink-2:       #3d4d63;
    --ink-muted:   #6a7a90;
    --ink-faint:   #9aa8ba;

    /* Durum renkleri (yumuşak) */
    --success: #1f8a5b; --success-bg: #e8f6ef;
    --warning: #a86200; --warning-bg: #fff4e0;
    --danger:  #c4314b; --danger-bg:  #fdecef;
    --info:    #1b6fa8; --info-bg:    #e6f2fb;

    --radius-sm: .5rem;
    --radius:    .75rem;
    --radius-lg: 1rem;
    --shadow-xs: 0 1px 2px rgba(15, 29, 51, .04);
    --shadow-sm: 0 1px 2px rgba(15, 29, 51, .04), 0 2px 8px rgba(15, 29, 51, .04);
    --shadow-md: 0 4px 12px rgba(15, 29, 51, .06), 0 12px 32px rgba(15, 29, 51, .06);
    --focus-ring: 0 0 0 .25rem rgba(14, 80, 155, .16);

    --sidebar-w: 264px;

    /* Bootstrap değişkenlerini palete bağla */
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 14, 80, 155;
    --bs-primary-bg-subtle: var(--brand-50);
    --bs-primary-border-subtle: var(--brand-200);
    --bs-primary-text-emphasis: var(--brand-800);
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--ink);
    --bs-body-color-rgb: 15, 29, 51;
    --bs-body-bg: var(--page-bg);
    --bs-secondary-color: var(--ink-muted);
    --bs-tertiary-bg: var(--surface-alt);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-sm: .375rem;
    --bs-border-radius-lg: var(--radius);
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 14, 80, 155;
    --bs-link-hover-color: var(--brand-800);
    --bs-link-hover-color-rgb: 10, 55, 108;
    --bs-heading-color: var(--ink);
    --bs-emphasis-color: var(--ink);
    --bs-focus-ring-color: rgba(14, 80, 155, .16);
}

/* ---------- 2. Temel ---------- */
html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--page-bg);
    color: var(--ink);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    letter-spacing: -.015em;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

.text-muted { color: var(--ink-muted) !important; }
.text-primary { color: var(--brand-600) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }
.text-secondary { color: var(--ink-faint) !important; }
.fw-semibold { font-weight: 600 !important; }

::selection { background: var(--brand-100); color: var(--brand-900); }

.tabular, td, .stat-value { font-variant-numeric: tabular-nums; }

/* ---------- 3. Material Symbols ---------- */
.mi {
    font-family: "Material Symbols Rounded";
    font-weight: normal;
    font-style: normal;
    font-size: 1.25em;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    vertical-align: -.25em;
    flex-shrink: 0;
    -webkit-font-feature-settings: "liga";
    font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    user-select: none;
}
.mi-fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.mi-sm { font-size: 1.05em; }
.mi-lg { font-size: 1.5em; }

/* ---------- 4. Uygulama iskeleti ---------- */
.app {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 2.25rem 3rem;
}

/* Mobil üst çubuk */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 60px;
    padding: 0 1rem;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.app-topbar .avatar { margin-left: auto; }

/* Sidebar */
.app-sidebar {
    --bs-offcanvas-width: 280px;
    --bs-offcanvas-bg: var(--surface);
    --bs-offcanvas-border-color: var(--line);
}

.app-sidebar .offcanvas-header {
    padding: 1rem 1rem 0 1.25rem;
}

.app-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    padding: 1.25rem 1rem 1rem;
    overflow-y: auto;
}

@media (min-width: 992px) {
    .app-sidebar-wrap {
        position: sticky;
        top: 0;
        flex: 0 0 var(--sidebar-w);
        width: var(--sidebar-w);
        height: 100vh;
        background: var(--surface);
        border-right: 1px solid var(--line);
    }

    .app-sidebar,
    .app-sidebar .offcanvas-body {
        height: 100%;
    }

    .app-sidebar .offcanvas-body {
        display: flex;
        flex-grow: 1;
        padding: 1.5rem 1rem 1rem;
        overflow-y: auto;
    }
}

/* Marka */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--ink);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
    padding: 0 .5rem;
}
.brand:hover { color: var(--ink); }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(14, 80, 155, .28);
}
.brand-mark .mi { font-size: 22px; vertical-align: 0; }

.brand-text small {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    color: var(--ink-faint);
    letter-spacing: .04em;
    margin-top: 1px;
}

/* Navigasyon */
.nav-section-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink-faint);
    letter-spacing: .04em;
    padding: 0 .75rem;
    margin-bottom: .5rem;
}

.side-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-weight: 500;
    font-size: .9rem;
    transition: background-color .15s ease, color .15s ease;
}
.side-nav-link .mi { color: var(--ink-faint); transition: color .15s ease; }

.side-nav-link:hover {
    background: var(--surface-alt);
    color: var(--ink);
}
.side-nav-link:hover .mi { color: var(--ink-2); }

.side-nav-link.active {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 600;
}
.side-nav-link.active .mi {
    color: var(--brand-600);
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Sidebar alt — kullanıcı */
.side-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}
.side-user-info { min-width: 0; flex: 1; }
.side-user-name {
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-user-role { font-size: .75rem; color: var(--ink-muted); }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

/* ---------- 5. Sayfa başlığı & breadcrumb ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header h1 {
    font-size: 1.625rem;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.page-header h1 small {
    font-size: .875rem !important;
    font-weight: 500;
    color: var(--ink-muted) !important;
    letter-spacing: 0;
}

.page-subtitle {
    color: var(--ink-muted);
    font-size: .875rem;
    margin-top: .25rem;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.page-actions form { margin: 0; }

.breadcrumb {
    --bs-breadcrumb-divider: "›";
    --bs-breadcrumb-divider-color: var(--ink-faint);
    --bs-breadcrumb-item-active-color: var(--ink-2);
    --bs-breadcrumb-margin-bottom: .75rem;
    font-size: .8125rem;
    font-weight: 500;
}
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--brand-600); }

/* ---------- 6. Kartlar ---------- */
.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-inner-border-radius: calc(var(--radius-lg) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: 1rem;
    --bs-card-cap-padding-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .95rem;
    border-bottom: 1px solid var(--line);
}
.card-header > .mi,
.card-header > span > .mi { color: var(--brand-600); }

/* Buton içindeki ikonlar her zaman buton yazı rengini alır */
.btn .mi,
.card-header .btn .mi { color: inherit; }
.card-header > .btn,
.card-header > a.btn { margin-left: auto; }

.card-title-sub {
    color: var(--ink-muted);
    font-weight: 500;
    font-size: .8125rem;
}

/* İstatistik kartları */
.stat-card .card-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-50);
    color: var(--brand-600);
    flex-shrink: 0;
}
.stat-icon .mi { font-size: 24px; vertical-align: 0; }
.stat-icon.is-warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.is-danger  { background: var(--danger-bg);  color: var(--danger); }
.stat-icon.is-success { background: var(--success-bg); color: var(--success); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
}
.stat-card .stat-value small {
    font-size: .9rem !important;
    font-weight: 500;
    color: var(--ink-faint) !important;
}

.stat-card .stat-label {
    color: var(--ink-muted);
    font-size: .8125rem;
    margin-top: .3rem;
    line-height: 1.35;
}

/* Bilgi listesi */
.detail-list dt {
    color: var(--ink-muted);
    font-weight: 500;
    font-size: .8125rem;
    padding-top: .15rem;
}
.detail-list dd { margin-bottom: .9rem; font-weight: 500; }
.detail-list dd:last-of-type { margin-bottom: 0; }

.meta-label {
    color: var(--ink-muted);
    font-size: .75rem;
    font-weight: 500;
    margin-bottom: .25rem;
}
.meta-value { font-weight: 600; }

/* ---------- 7. Butonlar ---------- */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: .875rem;
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .55rem;
    --bs-btn-border-radius: var(--radius-sm);
    --bs-btn-focus-box-shadow: var(--focus-ring);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn-sm {
    --bs-btn-padding-x: .7rem;
    --bs-btn-padding-y: .35rem;
    --bs-btn-font-size: .8125rem;
    --bs-btn-border-radius: .45rem;
    gap: .3rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-800);
    --bs-btn-active-border-color: var(--brand-800);
    --bs-btn-disabled-bg: var(--brand-300);
    --bs-btn-disabled-border-color: var(--brand-300);
    box-shadow: 0 1px 2px rgba(14, 80, 155, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-bg: var(--white);
    --bs-btn-border-color: var(--brand-200);
    --bs-btn-hover-color: var(--brand-700);
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-border-color: var(--brand-300);
    --bs-btn-active-color: var(--brand-800);
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-border-color: var(--brand-300);
}

.btn-outline-secondary,
.btn-light {
    --bs-btn-color: var(--ink-2);
    --bs-btn-bg: var(--white);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface-alt);
    --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--line);
    --bs-btn-active-border-color: var(--line-strong);
}

.btn-outline-danger {
    --bs-btn-color: var(--danger);
    --bs-btn-bg: var(--white);
    --bs-btn-border-color: #f2c4cd;
    --bs-btn-hover-color: var(--white);
    --bs-btn-hover-bg: var(--danger);
    --bs-btn-hover-border-color: var(--danger);
    --bs-btn-active-bg: #a8283f;
    --bs-btn-active-border-color: #a8283f;
}

.btn-outline-warning {
    --bs-btn-color: var(--warning);
    --bs-btn-bg: var(--white);
    --bs-btn-border-color: #f1d6a6;
    --bs-btn-hover-color: var(--warning);
    --bs-btn-hover-bg: var(--warning-bg);
    --bs-btn-hover-border-color: #e8c27f;
    --bs-btn-active-color: var(--warning);
    --bs-btn-active-bg: #ffe9c2;
    --bs-btn-active-border-color: #e8c27f;
}

.btn-outline-success {
    --bs-btn-color: var(--success);
    --bs-btn-bg: var(--white);
    --bs-btn-border-color: #b9e2cd;
    --bs-btn-hover-color: var(--success);
    --bs-btn-hover-bg: var(--success-bg);
    --bs-btn-hover-border-color: #94d2b3;
    --bs-btn-active-color: var(--success);
    --bs-btn-active-bg: #d3efe1;
    --bs-btn-active-border-color: #94d2b3;
}

/* Sadece ikon içeren butonlar */
.btn-icon {
    --bs-btn-padding-x: 0;
    --bs-btn-padding-y: 0;
    width: 40px;
    height: 40px;
}
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon .mi { font-size: 20px; vertical-align: 0; }
.btn-icon.btn-sm .mi { font-size: 18px; }

/* Tablo işlemleri: hayalet ikon butonlar */
.table-actions {
    white-space: nowrap;
    text-align: end;
}
.table-actions > * + * { margin-left: .125rem; }
.table-actions form { display: inline; }

.table-actions .btn {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-color: var(--ink-muted);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
}
.table-actions .btn-outline-primary   { --bs-btn-hover-bg: var(--brand-50);   --bs-btn-hover-color: var(--brand-600); --bs-btn-active-bg: var(--brand-100); }
.table-actions .btn-outline-secondary { --bs-btn-hover-bg: var(--surface-alt); --bs-btn-hover-color: var(--ink); }
.table-actions .btn-outline-danger    { --bs-btn-hover-bg: var(--danger-bg);  --bs-btn-hover-color: var(--danger);  --bs-btn-active-bg: #fad6dd; --bs-btn-active-color: var(--danger); }
.table-actions .btn-outline-warning   { --bs-btn-hover-bg: var(--warning-bg); --bs-btn-hover-color: var(--warning); }
.table-actions .btn-outline-success   { --bs-btn-hover-bg: var(--success-bg); --bs-btn-hover-color: var(--success); }

/* ---------- 8. Formlar ---------- */
.form-label {
    font-weight: 600;
    font-size: .8125rem;
    color: var(--ink-2);
    margin-bottom: .4rem;
}

.form-control,
.form-select {
    border-color: var(--line-strong);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    font-size: .9rem;
    color: var(--ink);
    background-color: var(--white);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-select { padding-right: 2.25rem; }

.form-control::placeholder { color: var(--ink-faint); }

.form-control:hover,
.form-select:hover { border-color: var(--brand-300); }

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-500);
    box-shadow: var(--focus-ring);
}

.form-control[type="file"] { padding: .45rem .6rem; }
.form-control::file-selector-button {
    border-radius: .4rem;
    margin-right: .75rem;
    padding: .35rem .8rem;
    border: 0;
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 600;
}
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
    background: var(--brand-100);
}

.form-text {
    color: var(--ink-muted);
    font-size: .78rem;
    margin-top: .35rem;
}

.form-check-input {
    border-color: var(--line-strong);
    width: 1.1em;
    height: 1.1em;
    margin-top: .2em;
}
.form-check-input:checked {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}
.form-check-input:focus {
    border-color: var(--brand-400);
    box-shadow: var(--focus-ring);
}
.form-switch .form-check-input {
    width: 2.4em;
    height: 1.3em;
    margin-top: .1em;
}
.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%234f86c8'/%3e%3c/svg%3e");
}
.form-check-label { font-weight: 500; }
.form-check-label + .form-text,
.form-check .form-text { margin-top: .15rem; }
.form-switch { padding-left: 3em; }
.form-switch .form-check-input { margin-left: -3em; }

/* Ayar satırı (switch listeleri) */
.setting-row {
    padding-top: .9rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--line);
    margin-top: 0;
    margin-bottom: 0;
}
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }

.input-group > .btn { border-color: var(--line-strong); }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.input-validation-error,
.input-validation-error:focus { border-color: var(--danger) !important; }
.input-validation-error:focus { box-shadow: 0 0 0 .25rem rgba(196, 49, 75, .15) !important; }
.field-validation-error { display: block; margin-top: .35rem; font-size: .78rem; }

/* Arama/filtre çubuğu */
.filter-bar .form-control,
.filter-bar .form-select { background-color: var(--white); }

.search-input { position: relative; }
.search-input .mi {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    pointer-events: none;
    vertical-align: 0;
}
.search-input .form-control { padding-left: 2.6rem; }

/* ---------- 9. Tablolar ---------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: var(--surface-alt);
    --bs-table-hover-color: var(--ink);
    margin-bottom: 0;
    font-size: .875rem;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: .85rem 1rem;
}
.table > :not(caption) > * > *:first-child { padding-left: 1.25rem; }
.table > :not(caption) > * > *:last-child  { padding-right: 1.25rem; }

.table-sm > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }

.table > thead > tr > th,
.table-light > tr > th,
.table .table-light th {
    --bs-table-bg: var(--surface-alt);
    --bs-table-color: var(--ink-muted);
    background-color: var(--surface-alt);
    color: var(--ink-muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.table > tbody > tr:last-child > * { border-bottom: 0; }

.table a.fw-semibold { color: var(--ink); }
.table a.fw-semibold:hover { color: var(--brand-600); }

.card > .table-responsive:last-child,
.card > .table-responsive:last-child .table {
    border-bottom-left-radius: var(--bs-card-inner-border-radius);
    border-bottom-right-radius: var(--bs-card-inner-border-radius);
}
.card > .table-responsive:first-child {
    border-top-left-radius: var(--bs-card-inner-border-radius);
    border-top-right-radius: var(--bs-card-inner-border-radius);
}

/* Boş durum */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem !important;
    color: var(--ink-muted);
}
.empty-state .mi {
    display: block;
    margin: 0 auto .5rem;
    font-size: 32px;
    color: var(--ink-faint);
}

/* ---------- 10. Rozetler (UiHelpers çıktısını da kapsar) ---------- */
.badge {
    --bs-badge-font-weight: 600;
    --bs-badge-font-size: .72rem;
    --bs-badge-padding-x: .6em;
    --bs-badge-padding-y: .38em;
    --bs-badge-border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: .35em;
    letter-spacing: .01em;
    vertical-align: middle;
}
.badge::before {
    content: "";
    width: .45em;
    height: .45em;
    border-radius: 50%;
    background: currentColor;
    opacity: .85;
}
.badge.badge-plain::before,
.badge.bg-secondary-count::before { display: none; }

.badge.bg-success  { background-color: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-warning  { background-color: var(--warning-bg) !important; color: var(--warning) !important; }
.badge.bg-danger   { background-color: var(--danger-bg)  !important; color: var(--danger)  !important; }
.badge.bg-info     { background-color: var(--info-bg)    !important; color: var(--info)    !important; }
.badge.bg-primary  { background-color: var(--brand-50)   !important; color: var(--brand-700) !important; }
.badge.bg-secondary { background-color: #eef1f5 !important; color: var(--ink-muted) !important; }
.badge.bg-light    { background-color: var(--white) !important; color: var(--ink-muted) !important; border: 1px solid var(--line-strong) !important; }
.badge.bg-success-subtle   { background-color: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-secondary-subtle { background-color: #eef1f5 !important; color: var(--ink-muted) !important; }

/* Sayaç rozeti (sekme/başlık yanındaki sayılar) */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.25rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--ink-muted);
    font-size: .72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- 11. Sekmeler (alt çizgili, minimal) ---------- */
.nav-tabs {
    --bs-nav-tabs-border-width: 0;
    gap: 1.5rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 1.5rem !important;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
    padding: .75rem 0;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: .875rem;
}
.nav-tabs .nav-link:hover {
    color: var(--ink);
    border-bottom-color: var(--line-strong);
}
.nav-tabs .nav-link.active {
    color: var(--brand-600);
    background: transparent;
    border-bottom-color: var(--brand-600);
}
.nav-tabs .nav-link.active .count-badge { background: var(--brand-50); color: var(--brand-700); }

/* ---------- 12. Uyarılar ---------- */
.alert {
    --bs-alert-border-radius: var(--radius);
    --bs-alert-padding-x: 1rem;
    --bs-alert-padding-y: .85rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    font-size: .875rem;
    font-weight: 500;
    border-width: 1px;
}
.alert > .mi { margin-top: .05em; vertical-align: 0; }
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close { padding: 1.05rem 1rem; }

.alert-success { --bs-alert-bg: var(--success-bg); --bs-alert-color: #146343; --bs-alert-border-color: #bfe6d2; }
.alert-danger  { --bs-alert-bg: var(--danger-bg);  --bs-alert-color: #9a2238; --bs-alert-border-color: #f5c6cf; }
.alert-warning { --bs-alert-bg: var(--warning-bg); --bs-alert-color: #7d4900; --bs-alert-border-color: #f3dcae; }
.alert-info    { --bs-alert-bg: var(--brand-50);   --bs-alert-color: var(--brand-800); --bs-alert-border-color: var(--brand-100); }
.alert code { color: inherit; font-weight: 600; }

/* Bilgi notu (yan panel) */
.note-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.note-list li { display: flex; gap: .6rem; font-size: .8125rem; color: var(--ink-2); line-height: 1.5; }
.note-list .mi { color: var(--brand-500); font-size: 18px; vertical-align: 0; margin-top: .1em; }

/* ---------- 13. Liste grubu ---------- */
.list-group {
    --bs-list-group-border-color: var(--line);
    --bs-list-group-item-padding-x: 1.25rem;
    --bs-list-group-item-padding-y: .9rem;
}
.list-group-item { font-size: .875rem; font-weight: 500; align-items: center; gap: 1rem; }

/* ---------- 14. Giriş ekranı ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--white);
}

@media (min-width: 992px) {
    .auth { grid-template-columns: minmax(420px, 46%) 1fr; }
}

.auth-aside {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 3rem;
    color: var(--white);
    background:
        radial-gradient(1200px 600px at -10% -20%, rgba(255, 255, 255, .12), transparent 60%),
        radial-gradient(800px 500px at 120% 120%, rgba(79, 134, 200, .45), transparent 60%),
        linear-gradient(160deg, var(--brand-600) 0%, var(--brand-800) 60%, var(--brand-950) 100%);
}
@media (min-width: 992px) {
    .auth-aside { display: flex; flex-direction: column; justify-content: space-between; }
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
    pointer-events: none;
}

.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand { color: var(--white); padding: 0; }
.auth-aside .brand-mark { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.auth-aside .brand-text small { color: rgba(255, 255, 255, .6); }

.auth-headline {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.025em;
    max-width: 440px;
    margin-bottom: 1rem;
}
.auth-lead { color: rgba(255, 255, 255, .72); max-width: 420px; font-size: .95rem; line-height: 1.6; }
.auth-foot { color: rgba(255, 255, 255, .5); font-size: .8rem; }

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(600px 300px at 50% 0%, var(--brand-50), transparent 70%),
        var(--white);
}
@media (min-width: 992px) {
    .auth-main { background: var(--white); }
}

.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.auth-card .auth-sub { color: var(--ink-muted); font-size: .9rem; margin-bottom: 2rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-card .btn-primary { --bs-btn-padding-y: .75rem; width: 100%; }

.auth-mobile-brand { margin-bottom: 2.5rem; }
@media (min-width: 992px) { .auth-mobile-brand { display: none !important; } }

/* Şifre göster/gizle */
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.75rem; }
.password-toggle {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    width: 36px;
    height: 36px;
    border-radius: .4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover { color: var(--ink-2); background: var(--surface-alt); }
.password-toggle .mi { vertical-align: 0; font-size: 20px; }

/* ---------- 15. Zincir logosu ---------- */
.chain-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: contain;
    background-color: var(--white);
    border: 1px solid var(--line);
}

.chain-logo-empty {
    color: var(--white);
    font-weight: 700;
    border: 0;
    letter-spacing: 0;
}

.logo-preview-box {
    width: 140px;
    height: 140px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt) repeating-conic-gradient(#eaeff5 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-preview-box.is-removed img { opacity: .25; }

.logo-placeholder {
    color: var(--ink-faint);
    text-align: center;
    font-size: .8rem;
}
.logo-placeholder .mi { font-size: 32px; display: block; margin: 0 auto .25rem; }

/* ---------- 16. Şube haritası ---------- */
.branch-map {
    height: 380px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
    background: var(--surface-alt);
}

.branch-map-sm { height: 220px; }

/* ---------- 17. Hata sayfası ---------- */
.error-state {
    max-width: 440px;
    margin: 4rem auto;
    text-align: center;
}
.error-state .stat-icon { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 1.25rem; }
.error-state .stat-icon .mi { font-size: 32px; }

/* ---------- 18. Responsive ayarlar ---------- */
@media (max-width: 991.98px) {
    .app-content { padding: 1.5rem 1.25rem 2.5rem; }
}

@media (max-width: 575.98px) {
    .app-content { padding: 1.25rem 1rem 2rem; }
    .page-header { margin-bottom: 1.25rem; }
    .page-header h1 { font-size: 1.375rem; }
    .page-header > .btn,
    .page-header > a.btn { width: 100%; }
    .page-actions { width: 100%; }
    .page-actions > .btn,
    .page-actions > form { flex: 1 1 auto; }
    .page-actions > form > .btn { width: 100%; }
    .card { --bs-card-spacer-x: 1rem; --bs-card-spacer-y: 1rem; --bs-card-cap-padding-x: 1rem; }
    .table > :not(caption) > * > *:first-child { padding-left: 1rem; }
    .table > :not(caption) > * > *:last-child  { padding-right: 1rem; }
    .stat-card .card-body { flex-direction: column; gap: .75rem; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .form-actions > .btn { flex: 1 1 0; }
    .detail-list dt { padding-top: 0; }
    .detail-list dd { margin-bottom: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Mobilde tablolar: satırlar kırılmasın, yatay kaydırılsın */
@media (max-width: 767.98px) {
    .table > tbody > tr > td,
    .table > thead > tr > th { white-space: nowrap; }
}


/* ==========================================================================
   19. Zincir paneli eklemeleri
   ========================================================================== */

/* Sidebar: zincir kimliği */
.side-chain {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0 0 1.25rem;
    padding: .7rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    min-width: 0;
}
.side-chain-info { min-width: 0; }
.side-chain-name {
    font-weight: 700;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-chain-sub { font-size: .72rem; color: var(--ink-muted); }

.nav-section-label + .side-nav { margin-bottom: 1rem; }

/* Ürün resmi */
.product-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}
.product-thumb-empty { color: var(--ink-faint); }
.product-thumb-empty .mi { font-size: 20px; vertical-align: 0; }

.photo-preview-box { width: 180px; height: 180px; }
.photo-preview-box img { width: 100%; height: 100%; object-fit: cover; }

/* Fiyat */
.price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-old { color: var(--ink-faint); text-decoration: line-through; font-weight: 500; font-size: .8rem; }

/* Menü önizleme */
.menu-category + .menu-category { margin-top: 1rem; }
.menu-product {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem 1.25rem;
    border-top: 1px solid var(--line);
}
.menu-product:first-child { border-top: 0; }
.menu-product-body { flex: 1; min-width: 0; }
.menu-product-name { font-weight: 600; }
.menu-product-desc {
    font-size: .8rem;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-product.is-passive { opacity: .55; }

/* Kategori kısa yol listesi */
.chip-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--white);
    color: var(--ink-2);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); }
.chip.active { background: var(--brand-600); border-color: var(--brand-600); color: var(--white); }
.chip .count-badge { margin-left: .1rem; }
.chip.active .count-badge { background: rgba(255,255,255,.2); color: var(--white); }

/* Şube menüsü düzenleme tablosu */
.branch-menu-table td { vertical-align: middle; }
.branch-menu-table .form-check { margin: 0; min-height: 0; display: flex; justify-content: center; }
.branch-menu-table .form-switch { padding-left: 0; }
.branch-menu-table .form-switch .form-check-input { margin-left: 0; float: none; }
.branch-menu-table .price-input { width: 120px; }
.branch-menu-table tr.is-hidden td:not(.keep-opacity) { opacity: .45; }
.category-row td {
    background: var(--surface-alt) !important;
    font-weight: 700;
}
.category-row.is-hidden td { opacity: 1; }
.category-row .category-hidden-label { font-weight: 500; color: var(--warning); font-size: .78rem; }

/* Sayfa altında yapışkan kaydet çubuğu */
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .85rem 1.25rem;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.sticky-actions .sticky-note { color: var(--ink-muted); font-size: .8rem; margin-right: auto; }

/* İstatistik: tarih aralığı seçici */
.range-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }

/* İstatistik: yatay çubuk (şube payı) */
.bar-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--brand-50);
    overflow: hidden;
    min-width: 80px;
}
.bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    background: var(--brand-500);
}

/* İstatistik: günlük sipariş grafiği (CSS sütun grafik) */
.day-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 1.25rem 1.25rem .5rem;
    overflow-x: auto;
}
.day-col {
    flex: 1 0 18px;
    max-width: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    position: relative;
}
.day-bar {
    border-radius: 6px 6px 2px 2px;
    background: var(--brand-500);
    min-height: 2px;
    transition: background-color .15s ease;
}
.day-bar.is-zero { background: var(--line); }
.day-col:hover .day-bar { background: var(--brand-700); }
.day-cancel {
    background: var(--danger);
    opacity: .75;
    border-radius: 2px;
    margin-top: 1px;
}
.day-labels {
    display: flex;
    gap: 4px;
    padding: 0 1.25rem 1rem;
    overflow: hidden;
}
.day-labels span {
    flex: 1 0 18px;
    max-width: 48px;
    text-align: center;
    font-size: .66rem;
    color: var(--ink-muted);
    white-space: nowrap;
}
.chart-legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--ink-muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* Durum dağılımı */
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem 1.25rem;
    border-top: 1px solid var(--line);
    font-size: .875rem;
}
.status-list li:first-child { border-top: 0; }

/* Değişim oku */
.trend-up { color: var(--success); font-weight: 600; font-size: .78rem; }
.trend-down { color: var(--danger); font-weight: 600; font-size: .78rem; }

/* Gizli bilgi (token) */
.secret-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    word-break: break-all;
}

/* Lisans kullanım çubuğu */
.usage-bar { height: 10px; border-radius: 999px; background: var(--brand-50); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--brand-600); border-radius: 999px; }
.usage-bar.is-full > span { background: var(--warning); }

@media (max-width: 575.98px) {
    .sticky-actions { padding: .75rem 1rem; }
    .sticky-actions .btn { flex: 1 1 auto; }
    .photo-preview-box { width: 140px; height: 140px; }
}

/* Kısa bildirimler (panelToast) */
.panel-toast {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: var(--white);
}
.panel-toast .toast-body { display: flex; align-items: flex-start; gap: .6rem; font-size: .875rem; font-weight: 500; }
.panel-toast .toast-body > .mi { font-size: 20px; vertical-align: 0; }
.panel-toast.is-success .toast-body > .mi { color: var(--success); }
.panel-toast.is-danger  .toast-body > .mi { color: var(--danger); }
.panel-toast.is-warning .toast-body > .mi { color: var(--warning); }
.panel-toast.is-info    .toast-body > .mi { color: var(--brand-600); }

/* Şube yetkileri tablosu */
.feature-matrix th { vertical-align: top; white-space: nowrap; }
.feature-matrix td { vertical-align: middle; }
.feature-matrix .feature-col { width: 110px; text-align: center; }
.feature-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
}
.feature-head .mi { font-size: 20px; color: var(--brand-600); vertical-align: 0; }
.feature-head .feature-all {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.25rem;
}
.feature-head .feature-all .form-check-input { margin: 0; float: none; }
.feature-head .feature-all .mi { font-size: 16px; color: var(--ink-faint); }
.feature-matrix .feature-switch {
    display: flex;
    justify-content: center;
    min-height: 0;
    margin: 0;
    padding-left: 0;
}
.feature-matrix .feature-switch .form-check-input { margin-left: 0; float: none; }
