﻿/* ==========================================================================
   HesapApp Şube Paneli — Tasarım sistemi (HesapApp.Web.Admin/Content/admin.css ile aynı temel;
   "19. Ortak panel eklemeleri" zincir paneliyle aynı, panele özel eklemeler "20. Şube 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. Ortak panel eklemeleri (zincir paneliyle aynı)
   ========================================================================== */

/* Sidebar: şube / 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); }

/* ==========================================================================
   20. Şube paneli
   ========================================================================== */

/* Sidebar: şube durumu (Açık / Manuel kapalı / Saat dışı) */
.branch-status {
    margin: -.5rem 0 1.25rem;
    padding: .7rem .75rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
}
.branch-status-head { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .85rem; }
.branch-status-sub { margin-top: .2rem; font-size: .74rem; color: var(--ink-muted); line-height: 1.4; }
.branch-status.is-open   { background: var(--success-bg); border-color: #c4e8d5; }
.branch-status.is-closed { background: var(--danger-bg);  border-color: #f6cdd5; }
.branch-status.is-off    { background: var(--warning-bg); border-color: #f5ddb0; }

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink-faint);
    flex-shrink: 0;
}
.is-open .status-dot   { background: var(--success); box-shadow: 0 0 0 4px rgba(31, 138, 91, .15); }
.is-closed .status-dot { background: var(--danger); }
.is-off .status-dot    { background: var(--warning); }

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    border-radius: 999px;
    background: var(--surface-alt);
}

.branch-status-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}
.branch-status-card .status-dot { margin-top: .35rem; }
.branch-status-card.is-open   { background: var(--success-bg); }
.branch-status-card.is-closed { background: var(--danger-bg); }
.branch-status-card.is-off    { background: var(--warning-bg); }

/* Menü sayacı (aktif sipariş) */
.side-nav-link .nav-count {
    margin-left: auto;
    min-width: 22px;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--brand-100);
    color: var(--brand-800);
    font-size: .72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.side-nav-link .nav-count.is-new { background: var(--danger); color: var(--white); }

/* Teslimat tipi çipi */
.delivery-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--brand-50);
    color: var(--brand-700);
}
.delivery-chip .mi { font-size: 15px; vertical-align: 0; }
.delivery-chip.is-pickup { background: #f1ecfb; color: #5b3a9b; }

/* Aktif sipariş panosu */
.order-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.order-column {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: .75rem;
    min-height: 140px;
}
.order-column-head {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    font-size: .875rem;
    padding: .1rem .25rem .7rem;
}
.order-column-head .mi { color: var(--brand-600); }
.order-column-head .count-badge { margin-left: auto; }
.order-column-empty { color: var(--ink-faint); font-size: .8rem; text-align: center; padding: 1.25rem 0; }

.order-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    margin-bottom: .65rem;
    overflow: hidden;
}
.order-card:last-child { margin-bottom: 0; }
.order-card.is-new {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-100);
    animation: order-pulse 2s ease-in-out infinite;
}
@keyframes order-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--brand-100); }
    50% { box-shadow: 0 0 0 6px var(--brand-50); }
}
@media (prefers-reduced-motion: reduce) {
    .order-card.is-new { animation: none; }
}
.order-card-head {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--line);
}
.order-no { font-weight: 700; text-decoration: none; }
.order-age { margin-left: auto; font-size: .74rem; color: var(--ink-muted); white-space: nowrap; }
.order-age.is-late { color: var(--danger); font-weight: 600; }
.order-card-body { padding: .6rem .75rem; font-size: .85rem; }
.order-items { margin-top: .35rem; color: var(--ink-2); font-size: .8rem; }
.order-note {
    display: flex;
    gap: .3rem;
    margin-top: .4rem;
    padding: .3rem .45rem;
    border-radius: var(--radius-sm);
    background: var(--warning-bg);
    color: var(--warning);
    font-size: .76rem;
    font-weight: 500;
}
.order-note .mi { font-size: 16px; }
.order-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: .45rem; }
.order-card-actions {
    display: flex;
    gap: .35rem;
    padding: .5rem .75rem .65rem;
}
.order-card-actions form { margin: 0; }

/* Sipariş detay: durum adımları */
.order-steps {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: .5rem;
    overflow-x: auto;
}
.order-steps li {
    flex: 1 0 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    position: relative;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink-faint);
    text-align: center;
}
.order-steps li::before {
    content: "";
    position: absolute;
    top: 7px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--line);
    z-index: 0;
}
.order-steps li:first-child::before { display: none; }
.order-step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--line-strong);
    position: relative;
    z-index: 1;
}
.order-steps li.is-done { color: var(--ink-2); }
.order-steps li.is-done::before,
.order-steps li.is-current::before { background: var(--brand-500); }
.order-steps li.is-done .order-step-dot { background: var(--brand-500); border-color: var(--brand-500); }
.order-steps li.is-current { color: var(--brand-700); }
.order-steps li.is-current .order-step-dot { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }

/* Menü: satışa kapalı ürün */
.branch-menu-table tr.is-unavailable td:first-child,
.branch-menu-table tr.is-unavailable td.price { opacity: .5; }

/* Çalışma saatleri tablosu */
.hours-table td { vertical-align: middle; }
.hours-table input[type="time"] { max-width: 140px; }
.hours-table tr.is-closed td:nth-child(3),
.hours-table tr.is-closed td:nth-child(4) { opacity: .4; }
.hours-table tr.is-today td { background: var(--brand-50); }

/* Ödeme yöntemi seçimi */
.payment-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.payment-option:hover { border-color: var(--brand-300); }
.payment-option .form-check-input { margin: 0; flex-shrink: 0; }
.payment-option.is-selected { border-color: var(--brand-500); background: var(--brand-50); }
.payment-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--brand-600);
}

/* Teslimat bölgeleri */
.zone-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.zone-side { position: sticky; top: 1rem; }
.zone-map-wrap { position: relative; overflow: hidden; }
.zone-map { height: calc(100vh - 210px); min-height: 480px; border-radius: var(--radius-lg); }
.zone-map-hint {
    position: absolute;
    top: .75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    padding: .4rem .8rem;
    border-radius: 999px;
    background: rgba(15, 29, 51, .85);
    color: var(--white);
    font-size: .78rem;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 2rem);
    overflow: hidden;
    text-overflow: ellipsis;
}
#zoneApp.is-editing .zone-map,
#zoneApp.is-testing .zone-map { cursor: crosshair; }
#zoneApp.is-panning .zone-map { cursor: grab; }

.zone-list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 290px); overflow-y: auto; }
.zone-list-empty { padding: 1.5rem 1.25rem; color: var(--ink-muted); font-size: .85rem; text-align: center; }
.zone-list-empty .mi { display: block; font-size: 32px; color: var(--ink-faint); margin-bottom: .35rem; }
.zone-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem 1rem;
    border-top: 1px solid var(--line);
}
.zone-item:first-child { border-top: 0; }
.zone-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.zone-item-body { flex: 1; min-width: 0; }
.zone-item-name { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-item-meta { font-size: .74rem; color: var(--ink-muted); }
.zone-item-actions { display: flex; gap: .25rem; }
.zone-check { min-width: 180px; }

@media (max-width: 1399.98px) {
    .order-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .zone-layout { grid-template-columns: 1fr; }
    .zone-side { position: static; }
    .zone-map { height: 60vh; min-height: 360px; }
    .zone-list { max-height: none; }
}
@media (max-width: 575.98px) {
    .order-board { grid-template-columns: 1fr; }
}

/* Yazdırma: sipariş detayı */
@media print {
    .app-sidebar-wrap, .app-topbar, .page-actions, .breadcrumb, .alert-dismissible { display: none !important; }
    .app-main { margin: 0 !important; }
    .card { box-shadow: none !important; }
}

/* ---------- Yeni sipariş bildirimi (tüm sayfalar) ---------- */
.order-alert {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1090;
    display: flex;
    align-items: center;
    gap: .85rem;
    width: min(760px, calc(100vw - 2rem));
    padding: .85rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--brand-700);
    color: var(--white);
    box-shadow: 0 12px 32px rgba(10, 55, 108, .35), 0 0 0 4px rgba(14, 80, 155, .18);
}
@media (min-width: 992px) {
    .order-alert { left: calc(50% + var(--sidebar-w) / 2); }
}
.order-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    flex-shrink: 0;
}
.order-alert-icon .mi { font-size: 26px; vertical-align: 0; }
.order-alert-body { flex: 1; min-width: 0; }
.order-alert-title { font-weight: 700; font-size: .95rem; }
.order-alert-text { font-size: .82rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-alert-hints { display: flex; flex-wrap: wrap; gap: .75rem; }
.order-alert-hints .btn-link { color: #ffe7a3; font-size: .78rem; font-weight: 600; text-decoration: none; }
.order-alert-hints .btn-link:hover { color: var(--white); }
.order-alert-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.order-alert-actions .btn-light { color: var(--brand-800); font-weight: 600; }
.order-alert-close { color: var(--white); opacity: .8; }
.order-alert-close:hover { color: var(--white); opacity: 1; background: rgba(255, 255, 255, .12); }
.order-alert.is-ringing { animation: order-alert-ring 1.2s ease-in-out 2; }
.order-alert.is-ringing .order-alert-icon .mi { animation: order-bell 0.6s ease-in-out 4; }
@keyframes order-alert-ring {
    0%, 100% { box-shadow: 0 12px 32px rgba(10, 55, 108, .35), 0 0 0 4px rgba(14, 80, 155, .18); }
    50% { box-shadow: 0 12px 32px rgba(10, 55, 108, .35), 0 0 0 10px rgba(79, 134, 200, .45); }
}
@keyframes order-bell {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-18deg); }
    75% { transform: rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
    .order-alert.is-ringing, .order-alert.is-ringing .order-alert-icon .mi { animation: none; }
}
body.has-order-alert .app-content { padding-top: calc(var(--order-alert-space, 96px)); }
@media (max-width: 575.98px) {
    .order-alert { flex-wrap: wrap; top: .5rem; }
    .order-alert-actions { width: 100%; justify-content: flex-end; }
    body.has-order-alert .app-content { --order-alert-space: 150px; }
}

/* Buton yüksekliği form alanıyla aynı (filtre çubukları) */
.btn.btn-input-height {
    height: calc(.9rem * 1.5 + 1.2rem + 2px);
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fiş yazdırma ayarı */
.paper-option {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    position: relative;
    transition: border-color .15s ease, background-color .15s ease;
}
.paper-option:hover { border-color: var(--brand-300); }
.paper-option.is-selected { border-color: var(--brand-500); background: var(--brand-50); }
.paper-option .form-check-input { position: absolute; top: 1rem; right: 1rem; margin: 0; }
.paper-preview { display: flex; align-items: flex-end; height: 92px; margin-bottom: .25rem; }
.paper-sheet {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 88px;
    padding: 10px 7px;
    background: var(--white);
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    box-shadow: var(--shadow-sm);
}
.paper-sheet i { display: block; height: 4px; border-radius: 2px; background: var(--ink-faint); }
.paper-sheet i:nth-child(1) { width: 70%; margin: 0 auto; background: var(--ink-2); }
.paper-sheet i:nth-child(3) { width: 85%; }
.paper-sheet i:nth-child(4) { width: 55%; margin-left: auto; background: var(--ink-2); }

/* Fiş yazdırma için gizli çerçeve */
.receipt-print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

/* Bildirim kontrolü başarısızsa (sunucu / bağlantı hatası) */
.order-notify-error {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1090;
    max-width: 420px;
    padding: .6rem .85rem;
    border-radius: var(--radius);
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f6cdd5;
    font-size: .8rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* Ses aç / kapat düğmesi */
[data-sound-toggle].is-muted .mi { color: var(--ink-faint); }

/* Sipariş detayı: teslimat konumu haritası */
.order-map {
    height: 240px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
    z-index: 0;
}
.map-pin { background: none; border: 0; }
.map-pin .mi { display: block; text-align: center; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.map-pin.is-customer .mi { font-size: 34px; line-height: 34px; color: var(--danger); }
.map-pin.is-branch .mi {
    font-size: 18px;
    line-height: 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-600);
    color: var(--white);
    border: 2px solid var(--white);
}

@media print {
    .order-alert { display: none !important; }
    body.has-order-alert .app-content { padding-top: 0; }
}

/* ---------- Müşteri notları (takip ekranından, sipariş verildikten sonra) ---------- */
.customer-notes {
    margin-bottom: 1rem;
    border: 1px solid #f3dcae;
    border-left: 5px solid var(--warning);
    border-radius: var(--radius-lg);
    background: var(--warning-bg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.customer-notes.has-unseen {
    border-color: #f0b44c;
    border-left-color: #e08a00;
    box-shadow: 0 0 0 4px rgba(224, 138, 0, .14), var(--shadow-sm);
    animation: customer-notes-pulse 1.6s ease-in-out 3;
}
@keyframes customer-notes-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(224, 138, 0, .14), var(--shadow-sm); }
    50% { box-shadow: 0 0 0 8px rgba(224, 138, 0, .24), var(--shadow-sm); }
}
.customer-notes-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; }
.customer-notes-icon {
    width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ffe2b3; color: #a85c00;
}
.customer-notes-icon .mi { font-size: 24px; vertical-align: 0; }
.customer-notes-title { font-weight: 700; font-size: 1rem; color: #6b3f00; }
.customer-notes-list { list-style: none; margin: 0; padding: 0 1rem .9rem; display: grid; gap: .5rem; }
.customer-notes-list li {
    padding: .65rem .85rem;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid #f3dcae;
}
.customer-notes-list li.is-new { border-color: #e08a00; box-shadow: inset 3px 0 0 #e08a00; }
.customer-note-text { font-size: 1rem; font-weight: 600; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.customer-note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .25rem; font-size: .76rem; color: var(--ink-muted); }
.customer-note-meta .mi { font-size: 15px; vertical-align: -3px; }
.customer-notes .btn-warning { --bs-btn-bg: #e08a00; --bs-btn-border-color: #e08a00; --bs-btn-color: var(--white); --bs-btn-hover-bg: #c27600; --bs-btn-hover-border-color: #c27600; --bs-btn-hover-color: var(--white); font-weight: 700; }

/* Pano kartında görülmemiş müşteri notu */
.order-card.has-customer-note { border-color: #f0b44c; box-shadow: 0 0 0 3px rgba(224, 138, 0, .16); }
.order-note.is-customer-new { background: #e08a00; color: var(--white); font-weight: 700; text-decoration: none; }
.order-note.is-customer-new:hover { background: #c27600; color: var(--white); }

/* İptal bilgisi (detay) */
.order-cancel-alert { align-items: center; }
.order-cancel-alert.is-unseen { box-shadow: 0 0 0 4px rgba(196, 49, 75, .14); }
.actor-customer { color: #a85c00; font-weight: 600; }
.actor-customer .mi { font-size: 15px; vertical-align: -3px; }

/* ---------- Müşteri bildirimi (tüm sayfalar, sol alt) ---------- */
.customer-alert {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1089;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: min(460px, calc(100vw - 2rem));
    padding: .8rem .9rem;
    border-radius: var(--radius-lg);
    background: #ffb020;
    color: #3d2400;
    box-shadow: 0 12px 32px rgba(120, 70, 0, .3), 0 0 0 4px rgba(255, 176, 32, .25);
}
@media (min-width: 992px) {
    .customer-alert { left: calc(var(--sidebar-w) + 1rem); }
}
.customer-alert.is-cancel { background: var(--danger); color: var(--white); box-shadow: 0 12px 32px rgba(120, 20, 40, .3), 0 0 0 4px rgba(196, 49, 75, .22); }
.customer-alert-icon .mi { font-size: 26px; vertical-align: 0; }
.customer-alert-body { flex: 1; min-width: 0; }
.customer-alert-title { font-weight: 700; font-size: .9rem; }
.customer-alert-text { font-size: .8rem; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.customer-alert-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.customer-alert-close { color: inherit; opacity: .8; }
.customer-alert-close:hover { color: inherit; opacity: 1; background: rgba(0, 0, 0, .08); }
.customer-alert.is-cancel .btn-dark { --bs-btn-bg: var(--white); --bs-btn-color: var(--danger); --bs-btn-border-color: var(--white); --bs-btn-hover-bg: #ffe9ed; --bs-btn-hover-color: var(--danger); --bs-btn-hover-border-color: #ffe9ed; }
.customer-alert.is-ringing { animation: customer-alert-ring .6s ease-in-out 3; }
@keyframes customer-alert-ring {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.customer-alert.is-ringing .customer-alert-icon .mi { animation: order-bell 0.6s ease-in-out 4; }
@media (prefers-reduced-motion: reduce) {
    .customer-alert.is-ringing, .customer-alert.is-ringing .customer-alert-icon .mi, .customer-notes.has-unseen { animation: none; }
}
@media print {
    .customer-alert { display: none !important; }
}

/* Kullanıcılar: yetki özetleri ve gruplar */
.perm-chips { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 340px; }
.perm-chip {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-800);
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}
.perm-chip.is-more { background: var(--surface-alt); color: var(--ink-muted); }
.perm-group {
    height: 100%;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}
.perm-group-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: .65rem;
}
.perm-group-title .mi { color: var(--brand-600); }
.perm-group .form-check-input:disabled + .form-check-label { opacity: .7; }
