/* ============================================
   TakoMind - Ana CSS Dosyası
   Açık Tema, Mobil-First, Premium
   ============================================ */

/* ---- Google Font ---- */
/* Google Font loaded via <link> in root.html for faster rendering */

/* ---- CSS Variables ---- */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.2);

    /* Accent */
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.2);

    /* Success / Warning / Danger */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #3b82f6;

    /* Light Theme */
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-glass: rgba(255, 255, 255, 0.85);

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #475569;
    --text-inverse: #ffffff;

    /* Borders */
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --border-focus: var(--primary);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-fast: all 0.1s ease;

    /* Sidebar */
    --sidebar-width: 220px;
    --sidebar-collapsed: 56px;
    --header-height: 44px;
    --bottom-nav-height: 52px;
}

/* ---- Base Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Global Mobile Overflow Guard ---- */
html,
body {
    max-width: 100vw;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Mobilde tablo sığmıyorsa yatay scroll */
@media (max-width: 768px) {
    .app-content {
        overflow-x: hidden;
        max-width: 100vw;
        padding-bottom: 70px;
        /* alt nav bar için */
    }

    /* Mobil sidebar scroll */
    .app-sidebar {
        height: 100dvh;
        height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: 20px;
    }

    .sidebar-nav {
        overflow-y: visible;
        padding-bottom: 40px;
    }

    /* Tabloları sarmalayan div yoksa bile taşmayı önle */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Kart, form vs taşmasın */
    .app-content>* {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Tablo sarmalayıcı */
    .table-responsive,
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Uzun text kırılsın */
    td,
    th {
        word-break: break-word;
        max-width: 200px;
    }

    /* Grid taşması */
    .compact-stats,
    .mini-grid,
    .driver-grid {
        max-width: 100%;
        overflow: hidden;
    }
}

/* Global: Tum select dropdown'lari acik temada okunabilir */
select {
    color-scheme: light;
    background: var(--bg-input);
    color: var(--text-primary);
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

select option:checked {
    background: var(--primary);
    color: #fff;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-light);
}

img {
    max-width: 100%;
    display: block;
}

/* ---- Layout ---- */
.app-layout {
    display: flex;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.app-content {
    flex: 1;
    padding: 12px 16px;
}

/* ---- Sidebar ---- */
.sidebar-brand {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    min-height: var(--header-height);
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-text h1 {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 6px 8px;
}

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    padding: 6px 8px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-align: left;
}

.sidebar-section-title .sec-ico {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
    text-transform: none;
    letter-spacing: 0;
}

.sidebar-section-title .section-arrow {
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: var(--transition);
}

.sidebar-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--primary-light);
}

.sidebar-link.active::before {
    transform: scaleY(1);
}

.sidebar-link-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    color: var(--primary-light);
    opacity: 1;
    transition: var(--transition);
}

.sidebar-link:hover .sidebar-link-icon {
    opacity: .85;
}

.sidebar-link.active .sidebar-link-icon {
    opacity: 1;
    filter: drop-shadow(0 0 4px currentColor);
}

/* ===== İKON RENK SİSTEMİ ===== */
/* Yönetim / Admin */
[class*="material-symbols"]:not([style*="color"]) {
    /* varsayılan — override edilecek */
}

/* Kırmızı — Admin & Acil */
.sidebar-link-icon.material-symbols-rounded[class*="admin_panel"],
.sidebar-link .material-symbols-rounded:is([class*="admin"]) {
    color: #ef4444;
}

/* Mor — Firma / Organizasyon */
.sidebar-link:has(.material-symbols-rounded) .material-symbols-rounded {
    color: var(--primary-light);
}

/* Renk override'ları — icon içeriği bazlı */
/* Admin */
.sidebar-link-icon {
    color: var(--primary-light);
}

/* Her ikon grubu için renk — JavaScript ile değil, CSS sibling ile */
/* Araçlar / Filo */
.sidebar-link [class~="material-symbols-rounded"] {
    transition: color .2s;
}

.sidebar-link-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.sidebar-user {
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Top Header ---- */
.app-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.header-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    position: relative;
}

.header-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--danger);
    font-size: 9px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

/* ---- Content ---- */
.app-content {
    flex: 1;
    padding: 12px 14px;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
}

.card-body {
    padding: 12px 14px;
}

.card-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.stat-card:hover::after {
    opacity: 0.1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.stat-card.purple::after {
    background: var(--primary);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-light);
}

.stat-card.cyan::after {
    background: var(--accent);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-light);
}

.stat-card.green::after {
    background: var(--success);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-light);
}

.stat-card.orange::after {
    background: var(--warning);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 20px var(--primary-glow);
    color: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 8px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.form-control {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ---- Styled File Input ---- */
.file-upload-wrap {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.file-upload-wrap:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-wrap.has-file {
    border-color: var(--success);
    border-style: solid;
    background: rgba(34, 197, 94, 0.05);
}

.file-upload-wrap input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-icon {
    font-size: 28px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.file-upload-wrap:hover .file-upload-icon {
    color: var(--primary);
}

.file-upload-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.file-upload-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-upload-name {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
    margin-top: 4px;
    display: none;
}

.file-upload-wrap.has-file .file-upload-name {
    display: block;
}

.file-upload-wrap.has-file .file-upload-text {
    display: none;
}

.file-upload-wrap.has-file .file-upload-icon {
    color: var(--success);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ---- Table ---- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    max-width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

.table th {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ---- Alerts / Messages ---- */
.alert {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-light);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-light);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning-light);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    font-size: 18px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 30px 16px;
}

.empty-state-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.empty-state-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-light);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-light);
}

/* ---- Avatar ---- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ---- Mobile Bottom Nav ---- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary-light);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

.bottom-nav-icon {
    font-size: 20px;
}

/* ---- Sidebar Overlay (Mobile) ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* ---- Login Page (Premium Two-Panel) ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1e1b4b 70%, #0f172a 100%);
    background-size: 400% 400%;
    animation: loginGradientShift 12s ease infinite;
    overflow: hidden;
    position: relative;
    padding: 16px;
}

@keyframes loginGradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    animation: bgPulse 15s ease infinite;
}

/* Floating particles */
.login-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.login-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    animation: loginFloatUp linear infinite;
}

@keyframes loginFloatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-10vh) rotate(720deg);
        opacity: 0;
    }
}

/* Main container */
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 980px;
    min-height: 560px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Left panel - Branding */
.login-brand-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 27, 75, 0.9) 100%);
    backdrop-filter: blur(20px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    animation: loginPulseGlow 8s ease-in-out infinite;
}

@keyframes loginPulseGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.login-brand-content {
    position: relative;
    z-index: 1;
}

.login-brand-logo {
    max-height: 180px;
    width: auto;
    margin: 0 auto 12px;
    display: block;
    filter: drop-shadow(0 10px 30px rgba(99, 102, 241, 0.3));
    animation: loginLogoFloat 6s ease-in-out infinite;
    border-radius: 22px;
    mix-blend-mode: lighten;
}

@keyframes loginLogoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.login-brand-slogan {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818cf8, #22d3ee, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    line-height: 1.3;
}

.login-brand-sub {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.login-brand-features {
    list-style: none;
    text-align: left;
    max-width: 280px;
    padding: 0;
    margin: 0;
}

.login-brand-features li {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    padding: 7px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.login-brand-features li:last-child {
    border-bottom: none;
}

.login-brand-features li i,
.login-brand-features li .material-symbols-rounded {
    color: var(--primary-light);
    font-size: 16px;
    width: 18px;
    text-align: center;
}

/* Right panel - Form */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 44px;
    background: var(--bg-card, rgba(30, 41, 59, 0.97));
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.login-form-header {
    margin-bottom: 28px;
    text-align: center;
}

.login-form-header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 6px;
}

.login-form-header p {
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    font-weight: 400;
}

/* Input styling (override) */
.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted, #64748b);
    font-size: 18px;
    transition: color 0.3s ease;
    z-index: 2;
}

.login-form .input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 2px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary, #f1f5f9);
    background: var(--bg-secondary, rgba(15, 23, 42, 0.5));
    transition: all 0.3s ease;
    outline: none;
}

.login-form .input-wrapper input:focus {
    border-color: var(--primary, #6366f1);
    background: var(--bg-primary, rgba(15, 23, 42, 0.8));
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.login-form .input-wrapper input:focus~.input-icon,
.login-form .input-wrapper:focus-within .input-icon {
    color: var(--primary-light, #818cf8);
}

.login-form .input-wrapper input::placeholder {
    color: var(--text-muted, #475569);
    font-weight: 400;
}

/* Password toggle */
.login-password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    z-index: 2;
    transition: color 0.3s;
}

.login-password-toggle:hover {
    color: var(--primary-light, #818cf8);
}

/* Remember me */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    accent-color: var(--primary, #6366f1);
    cursor: pointer;
}

.login-remember span {
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    font-weight: 500;
}

/* Login button */
.btn-login-premium {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--accent, #06b6d4) 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-login-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-login-premium:hover::before {
    left: 100%;
}

.btn-login-premium:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Loading state */
.btn-login-premium.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-login-premium.loading .btn-text {
    visibility: hidden;
}

.btn-login-premium.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.6s linear infinite;
}

@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.login-form-footer {
    text-align: center;
    margin-top: 20px;
}

.login-form-footer p {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}

/* ---- Login Responsive ---- */
@media (max-width: 900px) {
    .login-container {
        max-width: 460px;
        flex-direction: column;
        min-height: auto;
    }

    .login-brand-panel {
        padding: 28px 24px 20px;
    }

    .login-brand-logo {
        max-height: 80px;
        margin-bottom: 12px;
    }

    .login-brand-slogan {
        font-size: 1.15rem;
        margin-bottom: 6px;
    }

    .login-brand-sub {
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    .login-brand-features {
        display: none;
    }

    .login-form-panel {
        padding: 24px 28px 28px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .login-form-header {
        margin-bottom: 18px;
    }

    .login-form-header h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 8px;
        align-items: flex-start;
        padding-top: 12px;
    }

    .login-container {
        width: 100%;
        border-radius: 18px;
    }

    .login-brand-panel {
        padding: 18px 18px 14px;
    }

    .login-brand-logo {
        max-height: 64px;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    .login-brand-slogan {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .login-brand-sub {
        display: none;
    }

    .login-form-panel {
        padding: 18px 20px 20px;
    }

    .login-form-header {
        margin-bottom: 14px;
    }

    .login-form-header h1 {
        font-size: 1.15rem;
    }

    .login-form .form-group {
        margin-bottom: 14px;
    }

    .login-form .input-wrapper input {
        padding: 11px 14px 11px 40px;
        font-size: 0.84rem;
    }

    .btn-login-premium {
        padding: 12px;
        font-size: 0.88rem;
    }
}

@media (max-height: 680px) and (max-width: 480px) {
    .login-brand-panel {
        padding: 12px 14px 8px;
    }

    .login-brand-logo {
        max-height: 50px;
        margin-bottom: 4px;
    }

    .login-brand-slogan {
        font-size: 0.9rem;
    }

    .login-form-panel {
        padding: 12px 16px 14px;
    }

    .login-form-header {
        margin-bottom: 8px;
    }

    .login-form .form-group {
        margin-bottom: 10px;
    }

    .login-form .form-group .form-label {
        margin-bottom: 2px;
        font-size: 10px;
    }

    .login-form .input-wrapper input {
        padding: 9px 14px 9px 38px;
    }

    .btn-login-premium {
        padding: 10px;
    }
}

/* Legacy login classes - kept for backward compatibility, hidden */
.login-card {
    display: none;
}

.login-logo-icon {
    display: none;
}

/* ---- Quick Actions Grid ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-secondary);
}

.quick-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.quick-action-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.quick-action-label {
    font-size: 13px;
    font-weight: 600;
}

/* ---- Plate Badge ---- */
.plate-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

/* ---- Utilities ---- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-light);
}

.text-danger {
    color: var(--danger-light);
}

.text-warning {
    color: var(--warning-light);
}

.text-sm {
    font-size: 13px;
}

.text-xs {
    font-size: 11px;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        height: 100dvh;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: 80px;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }


    .sidebar-overlay.active {
        display: block;
    }

    .app-main {
        margin-left: 0;
        padding-bottom: var(--bottom-nav-height);
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bottom-nav {
        display: block;
    }
}

@media (max-width: 480px) {
    /* handled by comprehensive mobile CSS */
}

/* ═══════════════════════════════════════
   Sidebar Collapse / Mini Mode
   ═══════════════════════════════════════ */

/* Daralt butonu */
.sidebar-collapse-btn {
    position: absolute;
    top: 10px;
    right: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: all 0.2s;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
}

.app-sidebar:hover .sidebar-collapse-btn,
.sidebar-collapse-btn:focus {
    opacity: 1;
}

.sidebar-collapse-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.1);
}

/* Collapsed state icon flip */
.sidebar-collapsed .sidebar-collapse-btn {
    opacity: 1;
    right: -14px;
}

.sidebar-collapsed .sidebar-collapse-btn .material-symbols-rounded {
    transform: rotate(180deg);
}

/* ---- Collapsed Sidebar (Mini Mode — sadece ikonlar) ---- */
@media (min-width: 769px) {
    .sidebar-collapsed .app-sidebar {
        width: 60px;
        overflow-x: visible !important;
        overflow-y: visible !important;
        overflow: visible !important;
    }

    .sidebar-collapsed .app-main {
        margin-left: 60px;
    }

    /* Brand: sadece ikon göster */
    .sidebar-collapsed .sidebar-brand {
        justify-content: center;
        padding: 8px 4px;
    }

    .sidebar-collapsed .sidebar-brand-text {
        display: none;
    }

    .sidebar-collapsed .sidebar-brand-icon {
        width: 36px;
        height: 36px;
    }

    .sidebar-collapsed .sidebar-brand-icon img {
        width: 36px !important;
        height: 36px !important;
    }

    /* Firma bilgisi gizle */
    .sidebar-collapsed .sidebar-agency {
        display: none !important;
    }

    /* Ayırıcılar gizle */
    .sidebar-collapsed .sidebar-nav>div[style*="border-top"] {
        display: none !important;
    }

    /* Section titles gizle */
    .sidebar-collapsed .sidebar-section-title {
        display: none;
    }

    /* Section links her zaman açık */
    .sidebar-collapsed .sidebar-section.collapsed .sidebar-section-links {
        max-height: 500px;
    }

    /* Linkler: sadece ikon */
    .sidebar-collapsed .sidebar-link {
        justify-content: center;
        padding: 8px 0;
        position: relative;
    }

    .sidebar-collapsed .sidebar-link-icon {
        font-size: 20px;
        width: auto;
    }

    /* Link yazılarını gizle (ikon hariç her şey) */
    .sidebar-collapsed .sidebar-link {
        font-size: 0;
        gap: 0;
        overflow: visible;
    }

    .sidebar-collapsed .sidebar-link-icon {
        font-size: 20px;
    }

    .sidebar-collapsed .sidebar-link-badge {
        position: absolute;
        top: 2px;
        right: 6px;
        margin-left: 0;
        font-size: 8px;
        padding: 1px 4px;
        min-width: 14px;
    }

    /* Aktif gösterge */
    .sidebar-collapsed .sidebar-link.active::before {
        width: 3px;
    }

    /* Hover tooltip */
    .sidebar-collapsed .sidebar-link[data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 4px);
        top: 50%;
        transform: translateY(-50%) translateX(4px);
        background: #1e293b;
        color: #f1f5f9;
        padding: 8px 14px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.2px;
        white-space: nowrap;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.3);
        border: 1px solid rgba(99, 102, 241, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 9999;
    }

    /* Tooltip'in sol ok işareti */
    .sidebar-collapsed .sidebar-link[data-tooltip]::before {
        content: '';
        position: absolute;
        left: calc(100% + 1px);
        top: 50%;
        transform: translateY(-50%) scaleX(0);
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-right: 6px solid rgba(99, 102, 241, 0.4);
        opacity: 0;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 9999;
    }

    .sidebar-collapsed .sidebar-link[data-tooltip]:hover::after {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    .sidebar-collapsed .sidebar-link[data-tooltip]:hover::before {
        opacity: 1;
        transform: translateY(-50%) scaleX(1);
    }

    /* Aktif gösterge: collapsed modda sol çizgi yerine alt glow */
    .sidebar-collapsed .sidebar-link.active {
        background: rgba(99, 102, 241, 0.2);
        border-radius: 8px;
    }

    /* Sidebar nav padding */
    .sidebar-collapsed .sidebar-nav {
        padding: 6px 4px;
        overflow: visible !important;
    }

    .sidebar-collapsed .sidebar-section {
        margin-bottom: 0;
    }
}

/* ---- Hidden Sidebar (Eğitim odak modu) ---- */
@media (min-width: 769px) {
    .sidebar-hidden .app-sidebar {
        transform: translateX(-100%);
        width: 0;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-hidden .app-main {
        margin-left: 0;
    }

    /* Geri dön butonu */
    .sidebar-show-btn {
        position: fixed;
        top: 8px;
        left: 8px;
        z-index: 102;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        color: var(--text-muted);
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: all 0.2s;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar-show-btn:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

    .sidebar-hidden .sidebar-show-btn {
        display: flex;
    }
}

/* Mobilde collapse sistemi devre dışı */
@media (max-width: 768px) {
    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-show-btn {
        display: none !important;
    }
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* animate-in: anında görünsün */
.animate-in {
    opacity: 1;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ---- PWA Install Prompt ---- */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-xl);
    z-index: 200;
    display: none;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 32px);
}

.pwa-install-banner.show {
    display: flex;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ---- Welcome Banner ---- */
.welcome-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-text h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ---- Stat Card Red ---- */
.stat-card.red::after {
    background: var(--danger);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
}

/* ---- Driver Action Buttons (Büyük Butonlar - Sürücü Paneli) ---- */
.driver-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.driver-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.driver-action-btn .material-symbols-rounded {
    font-size: 32px;
    margin-bottom: 4px;
}

.driver-action-btn small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.driver-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Glow variants */
.driver-action-btn.green-glow {
    border-color: rgba(16, 185, 129, 0.3);
}

.driver-action-btn.green-glow:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
    color: var(--success-light);
}

.driver-action-btn.green-glow .material-symbols-rounded {
    color: var(--success-light);
}

.driver-action-btn.cyan-glow {
    border-color: rgba(6, 182, 212, 0.3);
}

.driver-action-btn.cyan-glow:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
    color: var(--accent-light);
}

.driver-action-btn.cyan-glow .material-symbols-rounded {
    color: var(--accent-light);
}

.driver-action-btn.purple-glow {
    border-color: rgba(99, 102, 241, 0.3);
}

.driver-action-btn.purple-glow:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.driver-action-btn.purple-glow .material-symbols-rounded {
    color: var(--primary-light);
}

.driver-action-btn.orange-glow {
    border-color: rgba(245, 158, 11, 0.3);
}

.driver-action-btn.orange-glow:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
    color: var(--warning-light);
}

.driver-action-btn.orange-glow .material-symbols-rounded {
    color: var(--warning-light);
}

.driver-action-btn.blue-glow {
    border-color: rgba(59, 130, 246, 0.3);
}

.driver-action-btn.blue-glow:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.driver-action-btn.blue-glow .material-symbols-rounded {
    color: var(--info);
}

.driver-action-btn.red-glow {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.driver-action-btn.red-glow:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    color: var(--danger-light);
}

.driver-action-btn.red-glow .material-symbols-rounded {
    color: var(--danger-light);
}

.driver-action-btn.red-glow span:not(.material-symbols-rounded) {
    color: var(--danger-light);
    font-weight: 700;
}

/* ---- Document Cards ---- */
.doc-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}

.doc-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.doc-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-card-icon .material-symbols-rounded {
    font-size: 24px;
}

.doc-card-info {
    flex: 1;
    min-width: 0;
}

.doc-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.doc-card-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.doc-card-uploader {
    margin-top: 2px;
}

.doc-card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: var(--transition);
}

.doc-card:hover .doc-card-arrow {
    color: var(--primary-light);
    transform: translateX(4px);
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    flex-shrink: 0;
}

/* ---- Date Input: White calendar icon & click-to-open ---- */
input[type="date"],
input[type="datetime-local"] {
    cursor: pointer;
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ---- GLOBAL OVERFLOW PREVENTION ---- */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

.app-layout,
.app-main,
.app-content {
    overflow-x: hidden;
    max-width: 100%;
}

.app-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

img,
video,
iframe,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

pre,
code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
}

/* ---- MOBILE: AGGRESSIVE COMPACT LAYOUT ---- */
@media (max-width: 768px) {

    /* Overflow sadece scroll container'lara - * 'ya deil */
    html,
    body {
        overflow-x: hidden;
    }


    /* Core layout - ultra tight */
    .app-content {
        padding: 4px !important;
    }

    /* Page header - minimal */
    .page-header {
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
        max-width: 100%;
    }

    .page-header h2 {
        font-size: 15px !important;
    }

    .page-header p {
        font-size: 11px !important;
        margin-top: 1px !important;
    }

    .page-header-icon {
        font-size: 24px !important;
    }

    /* Cards - tight */
    .card {
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
        border-radius: 6px !important;
        max-width: 100%;
    }

    .card-header {
        padding: 6px 8px !important;
    }

    .card-body {
        padding: 6px 8px !important;
    }

    .card-title {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }

    /* Stats grid - tight */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 4px !important;
        margin-bottom: 6px !important;
    }

    .stat-card {
        padding: 6px 8px !important;
    }

    .stat-value {
        font-size: 16px !important;
    }

    .stat-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }

    .stat-label {
        font-size: 10px !important;
    }

    /* Quick actions - tight */
    .quick-actions {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }

    .quick-action {
        padding: 8px 4px !important;
    }

    .quick-action-icon {
        font-size: 18px !important;
    }

    .quick-action-label {
        font-size: 9px !important;
    }

    /* Poli guide - minimal */
    .poli-guide {
        padding: 6px 8px !important;
        margin-bottom: 6px !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
    }

    /* Forms - tight */
    .form-group {
        margin-bottom: 6px !important;
        max-width: 100%;
    }

    .form-group label {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 6px 8px !important;
        font-size: 12px !important;
    }

    .form-grid,
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }

    /* Selection cards - tight */
    .option-grid,
    .cat-grid,
    .type-cards {
        gap: 4px !important;
        margin-bottom: 6px !important;
    }

    .option-card,
    .cat-card,
    .type-card {
        padding: 6px 4px !important;
        font-size: 10px !important;
    }

    .option-card .emoji,
    .cat-card .emoji,
    .type-card .emoji {
        font-size: 16px !important;
        margin-bottom: 1px !important;
    }

    /* Steps bar */
    .steps-bar {
        margin-bottom: 6px !important;
    }

    .nav-bar {
        margin-top: 6px !important;
    }

    /* Buttons */
    .btn-save,
    .btn-submit {
        padding: 8px !important;
        font-size: 13px !important;
        width: 100%;
        max-width: 100%;
    }

    /* Alerts */
    .warning-box,
    .info-box,
    .success-msg {
        padding: 6px 8px !important;
        margin-bottom: 6px !important;
        font-size: 11px !important;
    }

    .alert {
        padding: 6px 10px !important;
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    /* Header — company badge mobilde gizle */
    .app-header .header-company-badge {
        display: none !important;
    }

    /* Mobil: link göster, dropdown gizle */
    .mob-avatar-link {
        display: flex !important;
    }

    .desk-avatar-wrap {
        display: none !important;
    }

    .header-title {
        font-size: 13px !important;
        max-width: 140px;
    }

    .app-header {
        height: 44px !important;
        padding: 0 8px !important;
        overflow: hidden;
    }

    .header-right {
        gap: 6px !important;
        flex-shrink: 0;
    }



    /* Driver actions grid */
    .driver-actions {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .driver-action-btn {
        padding: 12px 8px !important;
        font-size: 12px !important;
    }

    .driver-action-btn .material-symbols-rounded {
        font-size: 22px !important;
    }

    .welcome-text h2 {
        font-size: 16px !important;
    }

    /* Scroll prevention */
    .card,
    .form-group,
    .stats-grid,
    .quick-actions,
    .page-header,
    .poli-guide,
    .record-row,
    .checklist-item {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Poli info bar compact */
    .poli-info-bar {
        padding: 4px 8px !important;
    }

    .poli-info-logo {
        width: 22px !important;
        height: 22px !important;
    }

    .poli-info-page {
        font-size: 10px !important;
    }

    .poli-info-message {
        font-size: 9px !important;
    }

    /* Remove excessive margins/whitespace everywhere */
    .mb-1 {
        margin-bottom: 4px !important;
    }

    .mb-2 {
        margin-bottom: 8px !important;
    }

    .mb-3 {
        margin-bottom: 12px !important;
    }

    .mt-1 {
        margin-top: 4px !important;
    }

    .mt-2 {
        margin-top: 8px !important;
    }

    .mt-3 {
        margin-top: 12px !important;
    }

    .gap-1 {
        gap: 4px !important;
    }

    .gap-2 {
        gap: 8px !important;
    }

    /* Table compact */
    .table th,
    .table td {
        padding: 4px 6px !important;
        font-size: 11px !important;
    }

    /* Login page handled by premium login CSS above */

    /* Bottom nav tight */
    .bottom-nav {
        height: 48px !important;
    }

    .bottom-nav-item {
        font-size: 9px !important;
    }

    .bottom-nav-icon {
        font-size: 18px !important;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .app-content {
        padding: 2px !important;
    }

    .card {
        padding: 6px 8px !important;
        margin-bottom: 4px !important;
    }

    .poli-info-bar {
        padding: 3px 6px !important;
    }
}

/* ============================================================
   GLOBAL: GRİ YAZI / ARKA PLAN OVERRIDE — tüm site siyah
   ============================================================ */

/* Tablo başlıkları — beyaz arka plan + siyah yazı */
table thead tr,
table thead th,
table th {
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #e2e8f0;
}

/* Tablo row hover */
table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Tüm küçük açıklama / subtitle yazıları */
.text-muted,
.text-secondary,
.subtitle,
.description,
small,
.hint,
.help-text,
.card-subtitle,
.page-subtitle,
.table-subtitle,
label.muted {
    color: #1e293b !important;
}

/* Form label'ları */
label {
    color: #0f172a;
    font-weight: 600;
}

/* Breadcrumb ve meta bilgiler */
.breadcrumb-item,
.meta-text,
.card-meta,
.small-text {
    color: #1e293b !important;
}