:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e3a8a;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --subtext: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.07), 0 10px 15px -3px rgba(0,0,0,0.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.header { background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%); color: #fff; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 20px rgba(37,99,235,0.25); }
.header h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.lang-dropdown { position: relative; }
.lang-toggle { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600; outline: none; }
.lang-menu { display: none; position: absolute; top: 40px; right: 0; background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); overflow: hidden; min-width: 120px; z-index: 999; }
.lang-menu.open { display: block; }
.lang-option { padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; text-align: center; transition: background 0.15s; }
.lang-option:hover { background: var(--primary-light); color: var(--primary); }
.screen { display: none; padding: 20px; max-width: 480px; margin: 0 auto; }
.screen.active { display: block; }
.login-logo { text-align: center; margin: 24px 0 20px; }
.login-logo .icon { font-size: 56px; }
.login-logo h2 { font-size: 22px; font-weight: 800; margin-top: 10px; color: var(--text); letter-spacing: -0.5px; }
.login-logo p { color: var(--subtext); font-size: 14px; margin-top: 6px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05); }
.card-title { font-size: 11px; font-weight: 700; color: var(--subtext); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.balance-card { background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 60%, #1e1b4b 100%); color: #fff; border-radius: var(--radius); padding: 22px 20px; margin-bottom: 14px; box-shadow: 0 8px 32px rgba(37,99,235,0.3); position: relative; overflow: hidden; }
.balance-card .driver-name { font-size: 15px; font-weight: 600; opacity: 0.9; margin-bottom: 6px; position: relative; }
.balance-card .balance-label { font-size: 12px; opacity: 0.7; margin-bottom: 4px; position: relative; }
.balance-card .balance-amount { font-size: 30px; font-weight: 800; letter-spacing: -1px; position: relative; }
.balance-card .balance-amount.positive { color: #6ee7b7; }
.balance-card .balance-amount.negative { color: #fca5a5; }
.balance-card .location-row { margin-top: 12px; font-size: 13px; opacity: 0.8; display: flex; align-items: center; gap: 6px; position: relative; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.status-badge.available { background: rgba(16,185,129,0.15); color: #059669; }
.status-badge.on-trip { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.status-badge.arrived { background: rgba(245,158,11,0.15); color: #d97706; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--subtext); margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 13px 15px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 15px; color: var(--text); background: #fff; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-row { margin-bottom: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.btn { width: 100%; padding: 15px; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s; letter-spacing: -0.3px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.btn-primary:active { box-shadow: none; }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,0.3); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,0.3); }
.btn-warning { background: var(--warning); color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,0.3); }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary-light); }
.btn-sm { padding: 10px 14px; font-size: 14px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.action-btn { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 10px; text-align: center; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.action-btn:active { background: var(--primary-light); border-color: var(--primary); transform: scale(0.97); }
.action-btn .icon { font-size: 26px; margin-bottom: 8px; }
.action-btn .label { font-size: 13px; font-weight: 700; color: var(--text); }
.trip-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.trip-item:last-child { border-bottom: none; }
.trip-row { display: flex; justify-content: space-between; align-items: center; }
.trip-cities { font-size: 14px; font-weight: 600; }
.trip-date { font-size: 12px; color: var(--subtext); }
.trip-amount { font-size: 15px; font-weight: 700; color: var(--success); }
.trip-detail { font-size: 12px; color: var(--subtext); margin-top: 4px; }
.upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--bg); }
.upload-area:active { background: var(--primary-light); border-color: var(--primary); }
.upload-area .icon { font-size: 34px; margin-bottom: 8px; }
.upload-area p { font-size: 14px; color: var(--subtext); }
.upload-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.upload-preview img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; }
input[type="file"] { display: none; }
.owner-tab { background:var(--card); border:1px solid var(--border); color:var(--subtext); padding:8px 14px; border-radius:20px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; font-family:inherit; }
.owner-tab.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.filter-bar { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); background: var(--bg); color: var(--subtext); transition: all 0.15s; white-space: nowrap; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.filter-custom-row { display: none; margin-top: 10px; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-custom-row.open { display: flex; }
.filter-custom-row input[type="date"] { display: block; flex: 1; min-width: 130px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; color: var(--text); background: #fff; }
.filter-result { font-size: 12px; color: var(--subtext); margin-top: 8px; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid rgba(0,0,0,0.07); display: flex; z-index: 100; max-width: 480px; width: 100%; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 0 8px; cursor: pointer; color: var(--subtext); border: none; background: none; transition: color 0.2s; }
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 22px; height: 22px; margin-bottom: 3px; }
.nav-item .nav-icon { font-size: 22px; }
.nav-item .nav-label { font-size: 11px; font-weight: 600; }
.nav-spacer { height: 70px; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 200; display: none; align-items: flex-end; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 24px 24px 0 0; padding: 24px 20px 32px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 -8px 40px rgba(0,0,0,0.12); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; color: var(--subtext); background: var(--bg); border: none; line-height: 1; }
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 14px; font-weight: 600; z-index: 300; opacity: 0; transition: opacity 0.3s; white-space: nowrap; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.toast.show { opacity: 1; }
.divider { text-align: center; color: var(--subtext); font-size: 13px; margin: 16px 0; position: relative; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--border); }
.divider::before { left: 0; }
.divider::after { right: 0; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.summary-row:last-child { border-bottom: none; font-weight: 700; }
.summary-label { font-size: 14px; color: var(--subtext); }
.summary-value { font-size: 14px; font-weight: 600; }
.admin-tab { flex:1; padding:9px 6px; border:none; background:none; border-radius:10px; font-size:12px; font-weight:700; color:var(--subtext); cursor:pointer; white-space:nowrap; transition: all 0.2s; }
.admin-tab.active { background: var(--primary); color:#fff; box-shadow: 0 2px 8px rgba(37,99,235,0.35); }
.admin-panel { display:none; }
.admin-panel.active { display:block; }
html[dir="rtl"] .trip-amount { text-align: left; }

.city-dropdown {
    position: absolute;
    top: 100%;
    right: 0; left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
.city-dropdown .city-option {
    padding: 11px 14px;
    cursor: pointer;
    font-size: 15px;
    border-bottom: 1px solid #f3f4f6;
}
.city-dropdown .city-option:last-child { border-bottom: none; }
.city-dropdown .city-option:hover, .city-dropdown .city-option:active { background: #eff6ff; color: #1a56db; }
@keyframes spin { to { transform: rotate(360deg); } }
