/* ============================================
   ARAÇ TAKİP SİSTEMİ - Light Theme, Mobile-First
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables (Light) ---- */
:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fb;
    --bg-glass: rgba(0, 0, 0, 0.02);
    --bg-input: #f5f6f8;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-sidebar-active: rgba(99, 102, 241, 0.2);

    --text-primary: #1a1a2e;
    --text-secondary: #5a5f7a;
    --text-muted: #9196ab;
    --text-sidebar: #cbd5e1;
    --text-sidebar-muted: #64748b;

    --accent-blue: #4f6ef7;
    --accent-blue-light: #eef1ff;
    --accent-blue-glow: rgba(79, 110, 247, 0.2);
    --accent-green: #10b981;
    --accent-green-light: #ecfdf5;
    --accent-green-glow: rgba(16, 185, 129, 0.2);
    --accent-orange: #f59e0b;
    --accent-orange-light: #fffbeb;
    --accent-orange-glow: rgba(245, 158, 11, 0.2);
    --accent-red: #ef4444;
    --accent-red-light: #fef2f2;
    --accent-red-glow: rgba(239, 68, 68, 0.2);
    --accent-purple: #8b5cf6;
    --accent-purple-light: #f5f3ff;
    --accent-purple-glow: rgba(139, 92, 246, 0.2);

    --border-color: #e5e7eb;
    --border-active: rgba(79, 110, 247, 0.5);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);

    --sidebar-width: 260px;
    --topbar-height: 60px;
    --bottom-nav-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #3b5de7;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- LOGIN PAGE ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease-out;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-green));
    animation: gradientFlow 4s ease infinite;
    background-size: 200% 100%;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.3);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- LAYOUT ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---- SIDEBAR (Desktop) ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
}

.sidebar-brand .brand-text span {
    font-size: 0.73rem;
    color: var(--text-sidebar-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-sidebar-muted);
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: #f1f5f9;
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: #a5b4fc;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #818cf8;
    border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-details .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}

.user-details .user-role {
    font-size: 0.7rem;
    color: var(--text-sidebar-muted);
}

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
}

.page-content {
    padding: 24px 28px;
    max-width: 1400px;
}

/* ---- CARDS ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- STAT CARDS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.blue::after { background: var(--accent-blue); }
.stat-card.green::after { background: var(--accent-green); }
.stat-card.orange::after { background: var(--accent-orange); }
.stat-card.red::after { background: var(--accent-red); }
.stat-card.purple::after { background: var(--accent-purple); }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card.blue .stat-icon { background: var(--accent-blue-light); color: var(--accent-blue); }
.stat-card.green .stat-icon { background: var(--accent-green-light); color: var(--accent-green); }
.stat-card.orange .stat-icon { background: var(--accent-orange-light); color: var(--accent-orange); }
.stat-card.red .stat-icon { background: var(--accent-red-light); color: var(--accent-red); }
.stat-card.purple .stat-icon { background: var(--accent-purple-light); color: var(--accent-purple); }

.stat-info h3 {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- VEHICLE GRID ---- */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

.vehicle-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vehicle-plate {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.vehicle-info {
    margin-bottom: 10px;
}

.vehicle-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.vehicle-info span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.vehicle-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.vehicle-user {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.vehicle-user strong {
    color: var(--text-primary);
}

/* ---- STATUS BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-available {
    background: var(--accent-green-light);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-in_use, .badge-active {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border: 1px solid rgba(79, 110, 247, 0.25);
}

.badge-maintenance {
    background: var(--accent-orange-light);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-pending {
    background: var(--accent-orange-light);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-completed {
    background: #f3f4f6;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-cancelled {
    background: var(--accent-red-light);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.badge-available .badge-dot { background: var(--accent-green); }
.badge-in_use .badge-dot, .badge-active .badge-dot { background: var(--accent-blue); }
.badge-maintenance .badge-dot { background: var(--accent-orange); }
.badge-pending .badge-dot { background: var(--accent-orange); }
.badge-cancelled .badge-dot { background: var(--accent-red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---- TABLES ---- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-input);
    white-space: nowrap;
}

table tbody td {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

table tbody tr:hover td {
    background: var(--bg-input);
    color: var(--text-primary);
}

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

/* ---- FORMS ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
    background: #fff;
}

.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='%239196ab' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 8px var(--accent-blue-glow);
}

.btn-primary:hover {
    background: #3b5de7;
    box-shadow: 0 4px 16px var(--accent-blue-glow);
    color: white;
}

.btn-success {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 2px 8px var(--accent-green-glow);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 16px var(--accent-green-glow);
    color: white;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 2px 8px var(--accent-red-glow);
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-warning {
    background: var(--accent-orange);
    color: white;
    box-shadow: 0 2px 8px var(--accent-orange-glow);
}

.btn-warning:hover {
    background: #d97706;
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: #d1d5db;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- ALERTS / FLASH MESSAGES ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
    border: 1px solid;
}

.alert-success {
    background: var(--accent-green-light);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: var(--accent-red-light);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: var(--accent-blue-light);
    color: #1e40af;
    border-color: rgba(79, 110, 247, 0.3);
}

.alert-warning {
    background: var(--accent-orange-light);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.5;
    font-size: 1.2rem;
    padding: 0 4px;
    -webkit-tap-highlight-color: transparent;
}

.alert-close:hover {
    opacity: 1;
}

/* ---- QR SCANNER ---- */
.qr-scanner-container {
    max-width: 500px;
    margin: 0 auto;
}

.qr-video-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    aspect-ratio: 1;
    background: #000;
}

.qr-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    animation: scanPulse 2s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { border-color: var(--accent-blue); }
    50% { border-color: var(--accent-green); }
}

.qr-result {
    margin-top: 20px;
    text-align: center;
}

/* ---- CHECKIN/CHECKOUT FORM ---- */
.checkin-card {
    max-width: 600px;
    margin: 0 auto;
}

.checkin-vehicle-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.checkin-vehicle-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    color: white;
}

/* ---- REPORTS ---- */
.report-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}

.report-filters .form-group {
    margin-bottom: 0;
    min-width: 140px;
    flex: 1;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 340px;
    margin: 0 auto 16px;
}

/* ---- FILTER BAR ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.filter-bar .form-control {
    max-width: 200px;
}

.filter-bar label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- ACTIONS ---- */
.actions {
    display: flex;
    gap: 4px;
}

/* ---- ANIMATIONS ---- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-in {
    animation: slideUp 0.35s ease-out;
}

.animate-in-delay-1 { animation-delay: 0.04s; animation-fill-mode: both; }
.animate-in-delay-2 { animation-delay: 0.08s; animation-fill-mode: both; }
.animate-in-delay-3 { animation-delay: 0.12s; animation-fill-mode: both; }
.animate-in-delay-4 { animation-delay: 0.16s; animation-fill-mode: both; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ---- TOOLTIP ---- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: var(--bg-sidebar);
    color: #e2e8f0;
    border-radius: 4px;
    font-size: 0.72rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 999;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

/* ---- SIDEBAR OVERLAY (mobile) ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

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

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 480px;
    width: 100%;
    animation: slideUp 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}


/* ================================================================
   MOBILE RESPONSIVE - Full Touch-Friendly, Bottom Navigation
   ================================================================ */

/* ---- Tablet (768px) ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + 16px);
    }

    .hamburger {
        display: flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-left h1 {
        font-size: 1rem;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-info h3 {
        font-size: 1.2rem;
    }

    .stat-info p {
        font-size: 0.72rem;
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .card {
        padding: 16px;
        border-radius: var(--radius-sm);
    }

    .card-header {
        margin-bottom: 14px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        max-width: 100%;
    }

    .report-filters {
        flex-direction: column;
    }

    .report-filters .form-group {
        min-width: 100%;
    }

    table {
        min-width: 500px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .checkin-card {
        max-width: 100%;
    }

    .login-card {
        padding: 32px 24px;
    }

    .qr-scanner-container {
        max-width: 100%;
    }

    /* Tablo içindeki aksiyonlar */
    .actions {
        flex-wrap: wrap;
    }
}

/* ---- Phone (480px) ---- */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .stat-info h3 {
        font-size: 1.3rem;
    }

    .page-content {
        padding: 12px;
    }

    .topbar {
        padding: 0 12px;
        height: 52px;
    }

    .vehicle-card {
        padding: 14px;
    }

    .checkin-vehicle-info {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .login-logo .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .login-logo h1 {
        font-size: 1.3rem;
    }

    .empty-state {
        padding: 32px 16px;
    }

    .empty-state .empty-icon {
        font-size: 2.5rem;
    }
}

/* ---- Small Phone (360px) ---- */
@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        align-items: center;
    }
}

/* ---- Touch Improvements ---- */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 8px 14px;
    }

    .nav-item {
        padding: 12px 14px;
        min-height: 44px;
    }

    .form-control {
        min-height: 44px;
        font-size: 16px; /* iOS zoom önleme */
    }

    table tbody td {
        padding: 14px 12px;
    }

    .vehicle-card {
        -webkit-tap-highlight-color: transparent;
    }

    .stat-card:hover {
        transform: none;
    }

    .vehicle-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .btn:hover {
        transform: none;
    }

    /* QR tarayıcı mobilde tam genişlik */
    #qr-reader {
        border-radius: var(--radius-sm) !important;
    }

    #qr-reader video {
        border-radius: var(--radius-sm);
    }
}

/* ---- Safe Area (iPhone notch) ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .login-page {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .hamburger, .btn, .filter-bar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}

/* ---- RESPONSIVE HELPERS ---- */
.desktop-only {
    display: block;
}
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
}

/* ---- RESERVATION CARD (Mobile) ---- */
.reservation-card {
    position: relative;
}

.reservation-card .actions {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 4px;
}

.reservation-card .actions .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
}
