/* ═══════════════════════════════════════════════════════════════════════
   BOOSMAN OTO SERVİS — Design System (Stitch Tabanlı)
   Tema: Profesyonel Kurumsal — Deep Navy + Beyaz + Turuncu
   Fonts: Plus Jakarta Sans | Inter | Outfit (numerals) | JetBrains Mono
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* ─── CSS Variables (Stitch Token Map) ─── */
:root {
    /* Primary Navy Palette */
    --primary: #022448;
    --primary-container: #1e3a5f;
    --on-primary: #ffffff;
    --on-primary-container: #8aa4cf;
    --on-primary-fixed-variant: #2d486d;

    /* Secondary Orange Palette */
    --secondary: #944a00;
    --secondary-container: #fc8f34;
    --on-secondary: #ffffff;
    --on-secondary-container: #663100;

    /* Tertiary Blue */
    --tertiary: #002252;
    --tertiary-container: #00377c;

    /* Surface & Background */
    --surface: #ffffff;
    --surface-container: #e7eeff;
    --surface-container-low: #f0f3ff;
    --surface-container-high: #dee8ff;
    --surface-container-highest: #d8e3fb;
    --surface-bright: #f9f9ff;
    --surface-dim: #cfdaf2;
    --surface-variant: #d8e3fb;
    --background: #f9f9ff;
    --on-surface: #111c2d;
    --on-surface-variant: #43474e;
    --on-background: #111c2d;
    --inverse-surface: #263143;
    --inverse-on-surface: #ecf1ff;

    /* Outline */
    --outline: #74777f;
    --outline-variant: #c4c6cf;

    /* Error */
    --error: #ba1a1a;
    --error-container: #ffdad6;
    --on-error: #ffffff;
    --on-error-container: #93000a;

    /* Semantic Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --danger: #ef4444;
    --danger-bg: #fef2f2;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 40px;
    --space-3xl: 48px;

    /* Border Radius */
    --radius-sm: 2px;
    --radius: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    /* Sidebar */
    --sidebar-width: 256px;
    --topbar-height: 64px;

    /* Transition */
    --transition: all 150ms ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 13px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--on-surface);
    line-height: 1.5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ─── Material Icons ─── */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
}

/* ─── Typography System ─── */
.font-headline { font-family: 'Plus Jakarta Sans', sans-serif; }
.font-body { font-family: 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-numeric { font-family: 'Outfit', sans-serif; font-variant-numeric: tabular-nums; }

h1, h2, h3, h4, h5, h6 { font-family: 'Plus Jakarta Sans', sans-serif; color: var(--on-surface); }
h1 { font-size: 24px; font-weight: 700; line-height: 32px; letter-spacing: -0.015em; }
h2 { font-size: 18px; font-weight: 600; line-height: 24px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; line-height: 20px; }

.text-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 14px;
    letter-spacing: 0.02em;
    color: var(--on-surface-variant);
}

.text-caption { font-size: 11px; color: var(--outline); letter-spacing: 0.02em; }
.text-muted { color: var(--on-surface-variant); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: 'Outfit', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Topbar + Content
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-container);
    color: var(--on-primary);
    display: flex;
    flex-direction: column;
    z-index: 40;
    border-right: 1px solid rgba(196,198,207,0.2);
    overflow-y: auto;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: var(--space-md);
}

/* Logo */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    margin-bottom: var(--space-lg);
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(196,198,207,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-container);
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-brand-text .accent { color: var(--secondary-container); }

.sidebar-brand-sub {
    font-size: 11px;
    color: var(--on-primary-container);
    letter-spacing: 0.02em;
}

/* Navigation */
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--on-primary-container);
    font-size: 13px;
    transition: var(--transition);
    border-left: 4px solid transparent;
    cursor: pointer;
}

.sidebar-nav a:hover {
    color: var(--on-primary);
    background: rgba(2,36,72,0.4);
}

.sidebar-nav a.active {
    color: var(--on-primary);
    background: rgba(2,36,72,0.6);
    font-weight: 600;
    border-left-color: var(--secondary-container);
}

.sidebar-nav a .material-symbols-outlined {
    font-size: 20px;
    color: inherit;
}

.sidebar-nav a.active .material-symbols-outlined {
    color: var(--secondary-container);
}

/* Sidebar Footer / User Card */
.sidebar-footer {
    padding-top: var(--space-md);
    border-top: 1px solid rgba(196,198,207,0.2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: var(--radius-md);
    background: rgba(2,36,72,0.4);
    border: 1px solid rgba(196,198,207,0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: rgba(252,143,52,0.2);
    border: 1px solid rgba(252,143,52,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-container);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 13px;
}

.sidebar-user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--on-primary);
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--on-primary-container);
    letter-spacing: 0.02em;
}

.sidebar-logout {
    background: none;
    border: none;
    color: var(--on-primary-container);
    padding: 4px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-logout:hover { color: var(--error-container); }

/* ─── Top Bar ─── */
.topbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--topbar-height);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-lg);
    border-bottom: 1px solid rgba(196,198,207,0.3);
    box-shadow: var(--shadow-sm);
    z-index: 30;
    flex-shrink: 0;
}

.topbar-title h1 { margin: 0; }
.topbar-title .text-caption { display: block; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search .material-symbols-outlined {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--outline);
    font-size: 18px;
}

.topbar-search input {
    width: 100%;
    height: 36px;
    padding-left: 36px;
    padding-right: 16px;
    font-size: 12px;
    background: var(--surface-container-low);
    border: 1px solid rgba(196,198,207,0.6);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    color: var(--on-surface);
}

.topbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(2,36,72,0.15);
}

.topbar-search input::placeholder { color: rgba(116,119,127,0.7); }

.topbar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--surface-container-low);
    border: 1px solid rgba(196,198,207,0.3);
    font-size: 12px;
    font-weight: 500;
}

.topbar-date .material-symbols-outlined {
    color: var(--primary);
    font-size: 18px;
}

.topbar-notify {
    position: relative;
    padding: 8px;
    border-radius: var(--radius);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--on-surface);
    transition: var(--transition);
}

.topbar-notify:hover { background: var(--surface-container-high); }

.topbar-notify .badge-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 10px; height: 10px;
    background: var(--error);
    border-radius: var(--radius-full);
    border: 2px solid var(--surface);
}

/* ─── Main Content Wrapper ─── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--background);
}

.main-content-inner {
    max-width: 1600px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Page Header ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
}

/* ─── Metric Cards ─── */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.metric-card {
    background: var(--surface);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(196,198,207,0.3);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 4px solid transparent;
}

.metric-card.green { border-left-color: var(--success); }
.metric-card.blue { border-left-color: var(--info); }
.metric-card.orange { border-left-color: var(--secondary-container); }
.metric-card.navy { border-left-color: var(--primary-container); }
.metric-card.red { border-left-color: var(--danger); }

.metric-card .metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-card .metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--on-surface-variant);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.metric-card .metric-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-card .metric-icon.green { background: var(--success-bg); color: var(--success); }
.metric-card .metric-icon.blue { background: var(--info-bg); color: var(--info); }
.metric-card .metric-icon.orange { background: #fff7ed; color: var(--secondary-container); }
.metric-card .metric-icon.navy { background: #eff6ff; color: var(--primary-container); }

.metric-card .metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--on-surface);
    margin-top: 12px;
    line-height: 34px;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.metric-card .metric-sub {
    font-size: 11px;
    color: var(--on-surface-variant);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.metric-card .metric-sub.positive { color: var(--success); font-weight: 700; }
.metric-card .metric-sub.negative { color: var(--danger); font-weight: 700; }

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(196,198,207,0.3);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(196,198,207,0.3);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: var(--space-lg); }
.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(196,198,207,0.3);
    background: var(--surface-container-low);
}

/* ─── Tables ─── */
.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    padding: 10px var(--space-md);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--on-surface-variant);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: var(--surface-container-low);
    border-bottom: 1px solid rgba(196,198,207,0.3);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px var(--space-md);
    border-bottom: 1px solid rgba(196,198,207,0.15);
    color: var(--on-surface);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--surface-container-low);
}

.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-bireysel { background: #f1f5f9; color: #475569; }
.badge-kurumsal { background: var(--info-bg); color: #1d4ed8; }
.badge-sigorta { background: #f3e8ff; color: #7c3aed; }
.badge-toptanci { background: #fff7ed; color: #c2410c; }

.badge-acik { background: #fef9c3; color: #a16207; }
.badge-kapandi { background: var(--success-bg); color: #059669; }
.badge-sigorta-islem { background: #ede9fe; color: #6d28d9; }
.badge-normal { background: #f0f9ff; color: #0369a1; }
.badge-tahsil { background: var(--success-bg); color: var(--success); }
.badge-karsilissiz { background: var(--danger-bg); color: var(--danger); }

.badge-kasada { background: var(--info-bg); color: var(--info); }
.badge-tahsil_edildi { background: var(--success-bg); color: var(--success); }
.badge-ciro_edildi { background: #fff7ed; color: #ea580c; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active { transform: scale(0.98); }

.btn-action {
    background: var(--secondary-container);
    color: #fff;
}
.btn-action:hover { background: #e07b2e; box-shadow: 0 0 16px rgba(252,143,52,0.3); }

.btn-primary {
    background: var(--primary-container);
    color: var(--on-primary);
}
.btn-primary:hover { background: #16304f; }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #059669; }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(196,198,207,0.6);
    color: var(--on-surface);
}
.btn-outline:hover { background: var(--surface-container-low); }

.btn-ghost {
    background: transparent;
    color: var(--on-surface-variant);
    padding: 4px 8px;
}
.btn-ghost:hover { background: var(--surface-container-low); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ─── Form Elements ─── */
.form-group { margin-bottom: var(--space-md); position: relative; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--on-surface-variant);
    margin-bottom: 6px;
}

.form-label .required { color: var(--error); }

.form-control {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid rgba(196,198,207,0.6);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--on-surface);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(2,36,72,0.12);
}

.form-control::placeholder { color: rgba(116,119,127,0.5); }

textarea.form-control { height: auto; resize: vertical; min-height: 64px; }
select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
}

.form-helper {
    font-size: 11px;
    color: var(--outline);
    margin-top: 4px;
}

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(196,198,207,0.3);
    margin-bottom: var(--space-lg);
}

.tabs a {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface-variant);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tabs a:hover { color: var(--on-surface); }

.tabs a.active {
    color: var(--primary-container);
    border-bottom-color: var(--primary-container);
    font-weight: 600;
}

/* ─── Filter Chips ─── */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    background: var(--surface-container-low);
    border: 1px solid rgba(196,198,207,0.4);
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover { background: var(--surface-container); border-color: var(--outline-variant); }

.chip.active {
    background: var(--primary-container);
    color: var(--on-primary);
    border-color: var(--primary-container);
}

/* ─── Plaka Badge ─── */
.plaka {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    background: var(--primary-container);
    color: var(--on-primary);
    border-radius: var(--radius);
    text-transform: uppercase;
}

/* ─── Amount Display ─── */
.amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
}
.amount.credit { color: var(--success); }
.amount.debit { color: var(--danger); }

/* ─── Modal ─── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}
.modal-backdrop.show { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(196,198,207,0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(196,198,207,0.3);
}

.modal-header h3 { font-size: 16px; }

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--outline);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.modal-close:hover { background: var(--surface-container-low); color: var(--error); }

.modal-body { padding: var(--space-lg); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(196,198,207,0.3);
    background: var(--surface-container-low);
}

/* ─── Alerts ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--info-bg); color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }

/* ─── Flash Messages ─── */
.flash-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 300ms ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Divider ─── */
.divider {
    border: none;
    border-top: 1px solid rgba(196,198,207,0.3);
    margin: var(--space-md) 0;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--outline);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: var(--space-md); }

/* ─── Quick Actions Grid ─── */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    color: #fff;
}

.quick-action-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.quick-action-btn.orange { background: var(--secondary-container); }
.quick-action-btn.navy { background: var(--primary-container); }
.quick-action-btn.green { background: var(--success); }

/* ─── Bottom Navigation (Mobile) ─── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid rgba(196,198,207,0.3);
    z-index: 50;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--outline);
    text-decoration: none;
    padding: 4px;
}

.bottom-nav a.active { color: var(--secondary-container); }
.bottom-nav a .material-symbols-outlined { font-size: 24px; }

/* ─── Mobile Hamburger ─── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--on-surface);
    cursor: pointer;
    padding: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Tablet (≤ 1100px) ─── */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    /* Dashboard 2-kolon grid → stacked */
    .dash-two-col {
        grid-template-columns: 1fr !important;
    }
}

/* ─── Mobile (≤ 768px) ─── */
@media (max-width: 768px) {
    /* Layout */
    .sidebar { transform: translateX(-100%); transition: transform 250ms ease; }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .hamburger-btn { display: block; }
    .bottom-nav { display: flex; }
    .main-content { padding: var(--space-sm); padding-bottom: 80px; }

    /* Topbar */
    .topbar { padding: 0 var(--space-md); height: 56px; }
    .topbar-search { display: none; }
    .topbar-date { display: none; }
    .topbar-title h1 { font-size: 16px; }
    .topbar-notify { padding: 6px; }

    /* Grid → tek kolon */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* Metrik kartları küçült */
    .metric-card .metric-value {
        font-size: 22px;
        line-height: 28px;
    }
    .metric-card .metric-label {
        font-size: 10px;
    }
    .metric-card {
        padding: 12px;
    }

    /* Metrik kartları 2x2 grid (4'lü olanlar) */
    .grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }

    /* Page Header */
    .page-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .page-header .btn { width: 100%; justify-content: center; }
    .page-header > div:last-child {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Buton grup (kasa sayfası gibi) */
    .page-header [style*="display:flex"][style*="gap:8px"] {
        flex-direction: column !important;
        width: 100%;
    }
    .page-header [style*="display:flex"][style*="gap:8px"] .btn {
        width: 100%;
        justify-content: center;
    }

    /* Dashboard iki kolonlu alan */
    .dash-two-col {
        grid-template-columns: 1fr !important;
    }

    /* Inline 3-kolon grid override (kasa metrikler) */
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Tabs — yatay scroll */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs a {
        padding: 8px 14px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Arama bar */
    .card-body[style*="display:flex"][style*="gap:var(--space-md)"] {
        flex-wrap: wrap !important;
    }
    .card-body form[style*="display:flex"] {
        flex-wrap: wrap !important;
    }
    .card-body form[style*="display:flex"] input[type="text"] {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* Form */
    .form-row { grid-template-columns: 1fr; }

    /* Card header — mobilde sarma */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: var(--space-sm) var(--space-md);
    }
    .card-header h3 { font-size: 13px; }
    .card-header form {
        width: 100%;
    }
    .card-header form[style*="display:flex"] {
        width: 100% !important;
    }

    /* Card footer — mobilde stack */
    .card-footer {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: flex-start !important;
        padding: 10px var(--space-md) !important;
    }
    .card-footer > div {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Table mobile → scroll */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
    }

    /* Tablo → Kart Dönüşümü (mobile-cards class) */
    .mobile-cards thead { display: none; }
    .mobile-cards tbody tr {
        display: block;
        margin-bottom: 8px;
        padding: 12px;
        border: 1px solid rgba(196,198,207,0.3);
        border-radius: var(--radius-md);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }
    .mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        border: none;
        font-size: 12px;
    }
    .mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: var(--outline);
        text-transform: uppercase;
        flex-shrink: 0;
        margin-right: 8px;
    }
    .mobile-cards tbody td:empty,
    .mobile-cards tbody td:last-child:empty { display: none; }
    .mobile-cards tbody td .text-right { text-align: right; }

    /* Modal — tam genişlik */
    .modal { width: 95%; max-width: none; margin: 16px; }
    .modal-body { padding: var(--space-md); }
    .modal-header { padding: var(--space-sm) var(--space-md); }
    .modal-footer { padding: var(--space-sm) var(--space-md); }

    /* Kasa kart grid — scroll + min-width */
    .kasa-kartlari-grid {
        gap: 8px !important;
    }
    .kasa-kart {
        min-width: 140px !important;
        flex-shrink: 0;
    }

    /* Quick actions */
    .quick-action-btn {
        padding: 10px 14px;
        font-size: 12px;
    }

    /* Alert & Flash */
    .flash-message {
        left: 12px;
        right: 12px;
        top: 10px;
        font-size: 12px;
    }

    /* Auth (login) page */
    .auth-card {
        padding: var(--space-lg);
        margin: var(--space-md);
        max-width: none;
    }
    .auth-logo-text { font-size: 24px; }
    .auth-footer { font-size: 10px; }

    /* Genel mobil utility */
    .hide-mobile { display: none !important; }
}

/* ─── Small Mobile (≤ 480px) ─── */
@media (max-width: 480px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr !important; }
    h1 { font-size: 16px; }
    h2 { font-size: 15px; }

    /* Metrik değerler daha küçük */
    .metric-card .metric-value {
        font-size: 18px;
        line-height: 24px;
    }

    .topbar { height: 50px; }
    .topbar-title h1 { font-size: 14px; }

    /* Bottom nav küçült */
    .bottom-nav { height: 56px; }
    .bottom-nav a { font-size: 9px; }
    .bottom-nav a .material-symbols-outlined { font-size: 20px; }

    /* Tablo font küçült */
    .data-table { font-size: 11px; }
    .data-table thead th { font-size: 10px; padding: 8px 10px; }
    .data-table tbody td { padding: 8px 10px; }

    .badge { font-size: 10px; padding: 1px 8px; }
    .plaka { font-size: 11px; padding: 1px 6px; }

    /* Amount */
    .amount { font-size: 12px; }

    /* Card body */
    .card-body { padding: var(--space-md); }
}

/* ─── Print ─── */
@media print {
    .sidebar, .topbar, .bottom-nav, .btn, .modal-backdrop { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    .main-content { padding: 0 !important; }
    body { background: #fff !important; }
}

/* ─── Auth Layout (Login Page) ─── */
.auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-container) 0%, #0d1321 100%);
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg, transparent, transparent 79px, rgba(255,255,255,0.03) 80px
    ), repeating-linear-gradient(
        90deg, transparent, transparent 79px, rgba(255,255,255,0.03) 80px
    );
}

.auth-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(252,143,52,0.08);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.auth-logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-container);
}

.auth-logo-text .accent { color: var(--secondary-container); }

.auth-logo-sub {
    font-size: 12px;
    color: var(--outline);
    margin-top: 4px;
}

.auth-footer {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}

/* ─── Sidebar Overlay (Mobile) ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 35;
}

.sidebar-overlay.show { display: block; }

/* ─── Utility ─── */
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-md { margin-top: var(--space-md); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.hidden { display: none; }

/* ─── Animations ─── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   EK BİLEŞENLER — Modal, Badge, Icon Button, Stat Card
   ═══════════════════════════════════════════════════════════════ */

/* ─── Modal Dialog (HTML <dialog>) ─── */
.modal-dialog {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}
.modal-dialog::backdrop {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.modal-content { background: var(--surface); }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--outline-variant);
}
.modal-header h3 {
    font-size: 16px;
    color: var(--on-surface);
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--outline-variant);
    background: var(--surface-container-low);
}

/* ─── Status Badge ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Icon Button ─── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--on-surface-variant);
    transition: var(--transition);
}
.btn-icon:hover {
    background: var(--surface-container);
    color: var(--on-surface);
}
.btn-icon .material-symbols-outlined { font-size: 18px; }

/* ─── Stat Card ─── */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--outline-variant);
}

/* ─── Table Responsive ─── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── Data Table ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    background: var(--surface-container-low);
    color: var(--on-surface-variant);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--outline-variant);
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--surface-container);
    font-size: 13px;
    vertical-align: middle;
}
.data-table tbody tr:hover {
    background: var(--surface-container-low);
}

/* ─── Button Secondary ─── */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface-container);
    color: var(--on-surface);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}
.btn-secondary:hover {
    background: var(--surface-container-high);
}

/* ─── Stats Grid (Dashboard/Rapor) ─── */
.stats-grid .stat-card {
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.stats-grid .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ─── Form Group ─── */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--on-surface-variant);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--on-surface);
    transition: border-color 150ms ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2,36,72,0.1);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ─── Card ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--outline-variant);
    overflow: hidden;
}
.card-body { padding: 20px; }

