/* assets/css/app.css */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --border: #e0dbd0;
  --text: #1a1a1a;
  --text-muted: #6b6560;
  --accent: #1a472a;
  --accent-light: #e8f0ea;
  --accent-hover: #153821;
  --danger: #c0392b;
  --danger-light: #fdf0ef;
  --warning: #e67e22;
  --success: #27ae60;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── NAV ─────────────────────────────────────────────────────── */
.navbar {
  background: var(--accent);
  color: white;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-brand {
  font-size: 16px; font-weight: 700; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 10px; color: white;
  text-decoration: none; margin-right: auto;
}
.nav-brand small { opacity: .6; font-weight: 400; font-size: 12px; }
.nav-links { display: flex; gap: 2px; }
.nav-link {
  padding: 7px 16px; border-radius: 6px; color: rgba(255,255,255,.7);
  text-decoration: none; font-size: 13px; font-weight: 500;
  transition: all .15s; border: none; background: none; cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { background: rgba(255,255,255,.1); color: white; }
.nav-link.active { background: rgba(255,255,255,.18); color: white; }
.nav-user {
  display: flex; align-items: center; gap: 10px;
  margin-left: 12px; padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.2);
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
}
.nav-user-name { font-size: 13px; font-weight: 500; }
.nav-logout {
  padding: 5px 12px; border-radius: 6px; background: rgba(255,255,255,.1);
  color: white; border: none; cursor: pointer; font-size: 12px;
  font-family: inherit; transition: background .15s;
}
.nav-logout:hover { background: rgba(255,255,255,.2); }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 32px 24px; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.card-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted);
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px; border-radius: var(--radius); border: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; display: inline-flex;
  align-items: center; gap: 7px; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: white; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1.5px solid #f5c6c2; }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.form-label .req { color: var(--danger); }
.form-control {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 14px; color: var(--text); background: white;
  transition: border-color .15s; width: 100%;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: #bbb; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  padding: 3px 10px; border-radius: 20px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.badge-paid     { background: #e8f5e9; color: #2e7d32; }
.badge-pending  { background: #fff8e1; color: #f57f17; }
.badge-cancelled{ background: #fce4ec; color: #c62828; }
.badge-standard { background: var(--accent-light); color: var(--accent); }
.badge-simplified { background: #f3e5f5; color: #6a1b9a; }

/* ── INVOICE LIST ────────────────────────────────────────────── */
.invoice-list { display: flex; flex-direction: column; gap: 8px; }
.invoice-item {
  background: white; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 14px 18px; display: flex; align-items: center; gap: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.invoice-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.invoice-num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; color: var(--accent); min-width: 120px; }
.invoice-customer { flex: 1; }
.invoice-customer-name { font-weight: 600; font-size: 14px; }
.invoice-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.invoice-amount { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 15px; text-align: right; min-width: 110px; }
.invoice-actions { display: flex; gap: 5px; }

/* ── STATS CARDS ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -1px; font-family: 'IBM Plex Mono', monospace; }
.stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-card.accent { background: var(--accent); border-color: var(--accent); }
.stat-card.accent .stat-label { color: rgba(255,255,255,.7); }
.stat-card.accent .stat-value { color: white; }
.stat-card.accent .stat-sub { color: rgba(255,255,255,.6); }

/* ── ITEMS TABLE ─────────────────────────────────────────────── */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}
.items-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.items-table td input, .items-table td select {
  width: 100%; border: 1.5px solid transparent; border-radius: 4px; padding: 6px 8px;
  font-family: inherit; font-size: 13px; background: transparent; transition: all .15s;
}
.items-table td input:focus, .items-table td select:focus {
  outline: none; border-color: var(--accent); background: white;
}
.remove-row {
  background: none; border: none; cursor: pointer; color: #ccc;
  font-size: 18px; transition: color .15s; padding: 2px 6px; border-radius: 4px;
}
.remove-row:hover { color: var(--danger); background: var(--danger-light); }

/* ── TOTALS ──────────────────────────────────────────────────── */
.totals-box {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 16px 20px; min-width: 280px;
}
.totals-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.totals-row.grand { font-weight: 700; font-size: 16px; border-top: 2px solid var(--border); margin-top: 8px; padding-top: 10px; }
.totals-row .label { color: var(--text-muted); }
.totals-row .amount { font-family: 'IBM Plex Mono', monospace; }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius-lg); width: 100%;
  max-width: 860px; box-shadow: var(--shadow-lg); margin: auto;
  overflow: hidden;
}
.modal-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
}
.modal-body { padding: 0; overflow-y: auto; max-height: 85vh; }

/* ── LOGO UPLOAD ─────────────────────────────────────────────── */
.logo-upload-area {
  border: 2px dashed var(--border); border-radius: 8px; padding: 24px;
  text-align: center; cursor: pointer; transition: all .15s; position: relative;
}
.logo-upload-area:hover { border-color: var(--accent); background: var(--accent-light); }
.logo-preview { max-height: 80px; max-width: 240px; object-fit: contain; margin: 0 auto; display: block; }
.logo-upload-text { color: var(--text-muted); font-size: 13px; }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2); transform: translateY(80px);
  opacity: 0; transition: all .3s; background: var(--accent); color: white;
  max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 16px; opacity: .3; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

/* ── AUTH PAGES ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(135deg, #1a472a 0%, #2d6a4f 50%, #1a472a 100%);
}
.auth-card {
  background: white; border-radius: 16px; padding: 40px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-text { font-size: 28px; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.auth-logo-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
.auth-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6c2; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-info { background: var(--accent-light); color: var(--accent); border: 1px solid #b2dfdb; }

/* ── INVOICE PRINT TEMPLATE ──────────────────────────────────── */
#invoice-print-container {
  padding: 36px 40px; font-size: 13px; color: #1a1a1a; font-family: 'IBM Plex Sans', sans-serif;
}
.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.inv-logo { max-height: 70px; max-width: 200px; object-fit: contain; }
.inv-logo-placeholder { width:120px;height:60px;background:#e8f0ea;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1a472a;font-weight:700;font-size:12px; }
.inv-company-name { font-size: 18px; font-weight: 800; color: #1a472a; margin-top: 8px; }
.inv-company-details { font-size: 11px; color: #666; line-height: 1.8; margin-top: 4px; }
.inv-title-block { text-align: right; }
.inv-title { font-size: 26px; font-weight: 800; color: #1a472a; text-transform: uppercase; letter-spacing: -1px; }
.inv-arabic { direction: rtl; text-align: right; font-size: 12px; color: #666; margin-top: 2px; }
.inv-num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #555; margin-top: 8px; }
.inv-date-label { font-size: 12px; color: #888; }
.inv-divider { border: none; border-top: 2px solid #1a472a; margin: 18px 0; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.inv-party-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #999; margin-bottom: 5px; }
.inv-party-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.inv-party-detail { font-size: 11px; color: #555; line-height: 1.8; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.inv-table thead tr { background: #1a472a; color: white; }
.inv-table th { padding: 9px 10px; text-align: left; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.inv-table td { padding: 9px 10px; border-bottom: 1px solid #eee; font-size: 12px; }
.inv-table tbody tr:nth-child(even) { background: #f9f9f7; }
.inv-table .num { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.inv-footer-wrap { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8px; }
.inv-totals { min-width: 250px; }
.inv-total-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.inv-total-row .lbl { color: #666; }
.inv-total-row .val { font-family: 'IBM Plex Mono', monospace; }
.inv-total-row.grand { border-top: 2px solid #1a472a; margin-top: 7px; padding-top: 9px; font-size: 16px; font-weight: 800; color: #1a472a; }
.inv-qr-block { text-align: center; }
.inv-qr-label { font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .8px; margin-top: 5px; }
.inv-notes { margin-top: 12px; max-width: 300px; font-size: 11px; color: #555; line-height: 1.6; }
.inv-zatca-note { margin-top: 22px; padding: 8px 14px; background: #e8f0ea; border-left: 3px solid #1a472a; border-radius: 4px; font-size: 10px; color: #555; line-height: 1.6; }
.inv-zatca-ar { direction: rtl; text-align: right; font-size: 10px; color: #666; margin-top: 4px; }

/* ── FILTERS ─────────────────────────────────────────────────── */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-search { flex: 1; min-width: 200px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination .page-btn {
  padding: 6px 12px; border-radius: 6px; border: 1.5px solid var(--border);
  background: white; cursor: pointer; font-size: 13px; font-family: inherit;
  transition: all .15s;
}
.pagination .page-btn:hover, .pagination .page-btn.active {
  background: var(--accent); color: white; border-color: var(--accent);
}

/* ── ONBOARDING ──────────────────────────────────────────────── */
.onboard-steps { display: flex; gap: 8px; margin-bottom: 28px; }
.onboard-step {
  flex: 1; padding: 10px; text-align: center; border-radius: 8px;
  font-size: 12px; font-weight: 600; background: var(--bg); color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.onboard-step.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.onboard-step.done { background: var(--accent); color: white; border-color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .invoice-item { flex-wrap: wrap; }
  .inv-parties { grid-template-columns: 1fr; }
  .inv-footer-wrap { flex-direction: column; gap: 20px; }
  .navbar { padding: 0 14px; }
  .container { padding: 20px 14px; }
  .nav-links .nav-link span { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}

/* ── RTL / Arabic Support ─────────────────────────────────── */
[dir="rtl"] body,
body.lang-ar {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
}

[dir="rtl"] .navbar { flex-direction: row-reverse; }
[dir="rtl"] .nav-brand { margin-right: 0; margin-left: auto; }
[dir="rtl"] .nav-user  { margin-left: 0; margin-right: 12px; padding-left: 0; padding-right: 12px;
                          border-left: none; border-right: 1px solid rgba(255,255,255,.2); }
[dir="rtl"] .page-header { flex-direction: row-reverse; }
[dir="rtl"] .card-title { text-align: right; }
[dir="rtl"] .form-label { text-align: right; }
[dir="rtl"] .form-control { text-align: right; direction: rtl; }
[dir="rtl"] select.form-control { text-align: right; direction: rtl; }
[dir="rtl"] .invoice-item { flex-direction: row-reverse; }
[dir="rtl"] .invoice-num  { text-align: right; }
[dir="rtl"] .invoice-amount { text-align: left; }
[dir="rtl"] .stat-card    { text-align: right; }
[dir="rtl"] .totals-row   { flex-direction: row-reverse; }
[dir="rtl"] .totals-box   { text-align: right; }
[dir="rtl"] .btn          { flex-direction: row-reverse; }
[dir="rtl"] .page-header .btn { flex-direction: row; }
[dir="rtl"] .filters      { flex-direction: row-reverse; }
[dir="rtl"] .form-grid-2,
[dir="rtl"] .form-grid-3  { direction: rtl; }
[dir="rtl"] .items-table th,
[dir="rtl"] .items-table td { text-align: right; }
[dir="rtl"] .invoice-actions { flex-direction: row-reverse; }
[dir="rtl"] .auth-footer  { direction: rtl; }
[dir="rtl"] .auth-card    { direction: rtl; text-align: right; }
[dir="rtl"] .form-hint    { text-align: right; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }
[dir="rtl"] .nav-links    { flex-direction: row-reverse; }

/* Language toggle button */
.lang-toggle {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: white; border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .2s; white-space: nowrap;
}
.lang-toggle:hover { background: rgba(255,255,255,.22); }
.lang-toggle-auth {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); border: 1.5px solid var(--accent);
  color: var(--accent); border-radius: 20px; padding: 6px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  margin-bottom: 20px; transition: all .2s;
}
.lang-toggle-auth:hover { background: var(--accent); color: white; }


/* ══════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER — Polished Pill Design
   ══════════════════════════════════════════════════════════════ */

/* Navbar pill switcher — sits in the top nav bar */
.lang-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 24px;
  padding: 3px;
  gap: 0;
}
.lang-pill-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .4px;
  transition: all .2s ease;
  white-space: nowrap;
}
.lang-pill-btn:hover {
  color: rgba(255,255,255,.9);
}
.lang-pill-btn.active {
  background: rgba(255,255,255,.22);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* Auth page switcher — login / register */
.lang-card-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 3px;
  gap: 0;
}
.lang-card-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .3px;
  transition: all .2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.lang-card-btn:hover {
  color: var(--accent);
}
.lang-card-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,71,42,.3);
}
.lang-card-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Settings page language cards */
.lang-option-cards {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.lang-option-card {
  flex: 1;
  max-width: 160px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .2s;
  background: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.lang-option-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.lang-option-card.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.lang-option-card .lang-flag {
  font-size: 20px;
  line-height: 1;
}

/* ── RTL / Arabic complete overrides ─────────────────────────── */
[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', Tahoma, 'Segoe UI', Arial, sans-serif;
}
[dir="rtl"] .navbar              { flex-direction: row-reverse; }
[dir="rtl"] .nav-brand           { margin-right: 0; margin-left: auto; }
[dir="rtl"] .nav-links           { flex-direction: row-reverse; }
[dir="rtl"] .nav-user            { flex-direction: row-reverse; padding-left: 0; padding-right: 12px; border-left: none; border-right: 1px solid rgba(255,255,255,.15); }
[dir="rtl"] .page-header         { flex-direction: row-reverse; }
[dir="rtl"] .page-title          { text-align: right; }
[dir="rtl"] .page-subtitle       { text-align: right; }
[dir="rtl"] .card-title          { text-align: right; }
[dir="rtl"] .form-label          { text-align: right; }
[dir="rtl"] .form-hint           { text-align: right; direction: rtl; }
[dir="rtl"] .form-control        { text-align: right; direction: rtl; }
[dir="rtl"] select.form-control  { text-align: right; direction: rtl; }
[dir="rtl"] .alert               { text-align: right; direction: rtl; }
[dir="rtl"] .stat-card           { text-align: right; }
[dir="rtl"] .stat-sub            { text-align: right; }
[dir="rtl"] .invoice-item        { flex-direction: row-reverse; }
[dir="rtl"] .invoice-num         { text-align: right; }
[dir="rtl"] .invoice-amount      { text-align: left; }
[dir="rtl"] .invoice-customer    { text-align: right; }
[dir="rtl"] .invoice-meta        { text-align: right; }
[dir="rtl"] .invoice-actions     { flex-direction: row-reverse; }
[dir="rtl"] .totals-row          { flex-direction: row-reverse; }
[dir="rtl"] .totals-box          { text-align: right; }
[dir="rtl"] .totals-box .amount  { font-family: 'IBM Plex Mono', monospace; }
[dir="rtl"] .items-table th,
[dir="rtl"] .items-table td      { text-align: right; }
[dir="rtl"] .items-table td:last-child,
[dir="rtl"] .items-table th:last-child { text-align: center; }
[dir="rtl"] .filters             { flex-direction: row-reverse; }
[dir="rtl"] .form-grid-2,
[dir="rtl"] .form-grid-3         { direction: rtl; }
[dir="rtl"] .badge               { direction: rtl; }
[dir="rtl"] .empty-state         { direction: rtl; }
[dir="rtl"] .auth-card           { direction: rtl; }
[dir="rtl"] .auth-title          { text-align: right; }
[dir="rtl"] .auth-subtitle       { text-align: right; }
[dir="rtl"] .auth-footer         { direction: rtl; text-align: right; }
[dir="rtl"] .modal-header        { flex-direction: row-reverse; }
[dir="rtl"] .vat-row             { flex-direction: row-reverse; }
[dir="rtl"] .vat-period-bar      { flex-direction: row-reverse; }
[dir="rtl"] .vat-section-header  { flex-direction: row-reverse; }
[dir="rtl"] .pagination          { direction: rtl; }
[dir="rtl"] .page-header .btn    { flex-direction: row; }
[dir="rtl"] .req                 { margin-right: 0; margin-left: 2px; }

/* Superadmin table alignment fix */
.user-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th { background: #0f2d17; color: white; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; position: sticky; top: 52px; z-index: 10; overflow: hidden; }
.user-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-table tr:hover td { background: var(--accent-light); }
.user-table colgroup col:nth-child(1) { width: 22%; }
.user-table colgroup col:nth-child(2) { width: 18%; }
.user-table colgroup col:nth-child(3) { width: 11%; }
.user-table colgroup col:nth-child(4) { width: 13%; }
.user-table colgroup col:nth-child(5) { width: 8%; }
.user-table colgroup col:nth-child(6) { width: 10%; }
.user-table colgroup col:nth-child(7) { width: 18%; }

/* Arabic font */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');
