@font-face {
    font-family: 'Speda';
    src: local('Speda'), local('Kurdish Speda'), url('https://fonts.cdnfonts.com/s/73111/Speda.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #00c6ff;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-color: #cbd5e1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   🎨 THEME VARIABLES
   ========================================== */

/* 1. Classic Light */
body.theme-classic {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --border-color: #cbd5e1;
}

/* 2. Modern Dark */
body.theme-dark {
    --bg-color: #0b1120;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --border-color: #334155;
}

/* 3. Royal Navy */
body.theme-navy {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --border-color: #0284c7;
}

/* 4. Luxury Emerald */
body.theme-emerald {
    --bg-color: #022c22;
    --card-bg: #064e3b;
    --text-color: #ecfdf5;
    --border-color: #059669;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Speda', 'Tahoma', sans-serif;
}

/* پاراستنی ئایکۆنەکانی FontAwesome */
.fa, .fas, .far, .fab, .btn-icon {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", sans-serif !important;
}

body {
    display: flex;
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    direction: rtl;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.15);
    z-index: 10;
    flex-shrink: 0;
    overflow-y: auto;
}

.top-track {
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 2px 8px;
    margin-bottom: 8px;
}

.mini-car { font-size: 11.5px; }

.brand {
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.brand .logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 4px;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.brand h2 { font-size: 18px; font-weight: bold; color: #ffffff; }
.brand p { font-size: 11px; color: #00c6ff; }

.dev-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #e8d5d7;
    font-size: 13px;
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: bold;
    border: 1px solid rgba(0, 198, 255, 0.2);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 9px 12px;
    text-align: right;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn:hover, .menu-btn.active {
    background: rgba(0, 198, 255, 0.25);
    border-color: var(--accent-color);
}

.menu-btn.danger {
    background: linear-gradient(135deg, #9f1239, #881337) !important;
    color: #ffffff !important;
    border: 1px solid #f43f5e !important;
    font-weight: bold !important;
    box-shadow: 0 3px 8px rgba(159, 18, 57, 0.4) !important;
}

.menu-btn.danger:hover {
    background: linear-gradient(135deg, #881337, #4c0519) !important;
    transform: translateY(-1px);
}

.menu-btn.warning { background: rgba(245, 158, 11, 0.2); }
.menu-btn.warning:hover { background: var(--warning-color); color: #000; }

#pause-btn {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #ffffff !important;
    border: 1px solid #ef4444 !important;
    font-weight: bold;
}

#pause-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
}

.print-btn-menu {
    background: linear-gradient(135deg, #059669, #047857) !important;
    color: #ffffff !important;
    border: 1px solid #34d399 !important;
    font-weight: bold !important;
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.4) !important;
}

.print-btn-menu:hover {
    background: linear-gradient(135deg, #047857, #065f46) !important;
    transform: translateY(-1px);
}

.menu-btn.btn-home {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    font-weight: bold !important;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.4) !important;
}

.menu-btn.btn-home:hover {
    background: linear-gradient(135deg, #0369a1, #075985) !important;
    transform: translateY(-1px);
}

.menu-divider {
    border: 0;
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 4px 0;
}

/* دووگمەکانی RESTORE & BACKUP */
.backup-restore-group {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-restore, .btn-backup {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-restore { background: #83004d; }
.btn-restore:hover { opacity: 0.9; }

.btn-backup { background: #004d40; }
.btn-backup:hover { opacity: 0.9; }

/* Main Area */
.main-content {
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Header & Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color) !important;
    text-align: center;
    box-shadow: var(--shadow);
    transition: background-color 0.3s, border-color 0.3s;
}

.stat-card.company { border-top: 4px solid #3b82f6 !important; }
.stat-card.resident { border-top: 4px solid #10b981 !important; }
.stat-card.special { border-top: 4px solid #f59e0b !important; }
.stat-card.blocked { border-top: 4px solid #ef4444 !important; }
.stat-card.expired { border-top: 4px solid #d97706 !important; }

.stat-card.total {
    background: linear-gradient(135deg, #1e3c72, #2a5298) !important;
    color: white !important;
}

.stat-title { display: block; font-size: 12px; opacity: 0.9; }
.stat-value { font-size: 19px; font-weight: bold; }

/* Search Bar */
.search-section {
    background: var(--card-bg) !important;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow);
    transition: background-color 0.3s;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon { font-size: 16px; }

.search-box input, .search-box select {
    padding: 8px 14px;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
}

.search-box input { flex: 1; font-size: 14px; }
.search-box select { width: 240px; }

/* Form Styles */
.tab-content { display: none; }
.tab-content.active { display: block; }

.section-title h2 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 10px;
    border-right: 4px solid var(--accent-color);
    padding-right: 8px;
}

body.theme-dark .section-title h2,
body.theme-navy .section-title h2,
body.theme-emerald .section-title h2 {
    color: #38bdf8 !important;
}

.form-compact-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    border: 1px solid var(--border-color) !important;
    padding: 12px 15px;
    border-radius: 10px;
    background: var(--card-bg) !important;
    box-shadow: var(--shadow);
    transition: background-color 0.3s;
}

.form-group legend {
    padding: 0 8px;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 14px;
}

body.theme-dark .form-group legend,
body.theme-navy .form-group legend,
body.theme-emerald .form-group legend {
    color: #38bdf8 !important;
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: bold;
    color: var(--text-color) !important;
}

input, select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    outline: none;
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    font-size: 13px;
}

.disabled-input { background-color: rgba(0, 0, 0, 0.05) !important; cursor: not-allowed; }

.plate-box {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px dashed var(--border-color) !important;
}

.radio-group { display: flex; gap: 20px; margin-top: 4px; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: normal; font-size: 13px; }

.form-actions {
    display: flex !important;
    gap: 18px !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 25px !important;
    padding-top: 15px !important;
    border-top: 1px solid var(--border-color) !important;
    width: 100% !important;
}

.btn-submit {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    border: 1px solid #34d399 !important;
    padding: 12px 28px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5) !important;
}

.btn-clear {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: #ffffff !important;
    border: 1px solid #fb923c !important;
    padding: 12px 28px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-clear:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.5) !important;
}

/* Tables */
.table-filter-bar { margin-bottom: 12px; }

.building-table-block {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px;
    margin-bottom: 15px;
    padding: 12px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s;
}

.building-table-block h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 4px;
    font-size: 16px;
}

body.theme-dark .building-table-block h3,
body.theme-navy .building-table-block h3,
body.theme-emerald .building-table-block h3 {
    color: #38bdf8 !important;
}

table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border-color) !important; padding: 8px 10px; text-align: center; font-size: 13px; color: var(--text-color) !important; }
th { background-color: rgba(0, 0, 0, 0.05); font-weight: bold; }

/* 🌟 جیاکەرەوەی نێوان شووقە جیاوازەکان */
tr.apt-divider td {
    border-top: 3px solid #1e3c72 !important;
    background-color: rgba(30, 60, 114, 0.03);
}

body.theme-dark tr.apt-divider td,
body.theme-navy tr.apt-divider td,
body.theme-emerald tr.apt-divider td {
    border-top: 3px solid #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.05);
}

.action-btn {
    padding: 4px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-size: 11px;
}

.btn-edit { background-color: var(--warning-color); color: #000; }
.btn-delete { background-color: var(--danger-color); }
.btn-block { background-color: #475569; }
.btn-activate { background-color: #10b981 !important; color: white !important; }

.hidden { display: none !important; }
.style-top-gap { margin-top: 10px; }

/* LTR Fixes */
.force-ltr-text, .plate-cell, .phone-cell, .date-cell {
    direction: ltr !important;
    text-align: center !important;
    unicode-bidi: isolate !important;
    display: inline-block;
}

td .plate-cell {
    font-weight: bold;
    color: var(--primary-color);
}

body.theme-dark td .plate-cell,
body.theme-navy td .plate-cell,
body.theme-emerald td .plate-cell {
    color: #38bdf8 !important;
}

/* Jacob & Co Watch */
.chiron-real-watch {
    background: radial-gradient(circle at top, #1a1e29 0%, #08090c 100%);
    border: 2px solid #2d3748;
    border-radius: 40px 40px 25px 25px;
    padding: 12px 8px;
    margin: 20px auto 10px auto;
    width: 92%;
    box-shadow: 0 12px 30px rgba(0,0,0,0.9), 0 0 15px rgba(37, 99, 235, 0.3), inset 0 0 8px rgba(255,255,255,0.08);
    position: relative;
    text-align: center;
}

.chiron-case-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.sub-dial {
    background: #0d1117;
    border: 1.5px solid #30363d;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.tourbillon-cage {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 8px #000;
}

.tourbillon-spinner {
    width: 18px;
    height: 18px;
    border: 2px dashed #00f0ff;
    border-radius: 50%;
    animation: spin 4s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.main-time-dial {
    flex: 1;
    border-radius: 40px;
    background: radial-gradient(circle, #0055ff 0%, #030814 100%);
    border: 2px solid #00f0ff;
    padding: 4px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.eb-logo {
    background: #e11d48;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 1px;
    display: inline-block;
    font-family: Arial, sans-serif !important;
}

.main-time-dial .time-display {
    font-family: 'Courier New', monospace !important;
    font-size: 14px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    text-shadow: 0 0 5px #00f0ff;
}

.fuel-gauge {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 8px #000;
}

.gauge-hand {
    width: 2px;
    height: 14px;
    background: #e11d48;
    transform: rotate(45deg);
    box-shadow: 0 0 4px #e11d48;
}

.chiron-w16-glass {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(2, 6, 23, 0.95) 100%);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 14px;
    padding: 8px 4px;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.9);
}

.w16-engine-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bank-left span, .bank-right span {
    display: block;
    width: 10px;
    height: 3px;
    background: #00f0ff;
    margin: 2px 0;
    border-radius: 1px;
    box-shadow: 0 0 4px #00f0ff;
}

.engine-center .date-display {
    font-size: 10px !important;
    color: #94a3b8 !important;
    font-weight: bold;
}

/* Sidebar Theme Picker */
.sidebar-theme-picker {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 10px;
    border-radius: 10px;
    margin-top: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-label {
    font-size: 12.5px;
    color: #e2e8f0;
    font-weight: bold;
}

.theme-buttons {
    display: flex;
    gap: 6px;
}

.theme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-dot:hover, .theme-dot.active {
    transform: scale(1.25);
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.dot-classic { background: #f0f2f5; }
.dot-dark { background: #0f172a; }
.dot-navy { background: #1e3c72; }
.dot-emerald { background: #064e3b; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    width: 90%;
    max-width: 480px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 16px; margin: 0; }

.close-modal {
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
}

.close-modal:hover { color: #f59e0b; }

.modal-body { padding: 18px; }

.modal-footer {
    background: rgba(0,0,0,0.03);
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}