/* ============================================================================
   DUAH Hifz — Premium Light Arabic Touch-Up Theme (Desktop + Mobile PWA + RTL)
   Fonts:
     • English & Digits -> Inter (Variable 100..900 + Italic)
     • Malayalam        -> Manjari (Thin 100, Regular 400, Bold 700)
     • Arabic           -> Amiri Quran
   ============================================================================ */

/* 1. Inter — English & Numbers */
@font-face {
  font-family: 'DuahInter';
  src: url('../fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DuahInter';
  src: url('../fonts/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Manjari — Malayalam */
@font-face {
  font-family: 'DuahManjari';
  src: url('../fonts/Manjari-Thin.ttf') format('truetype');
  font-weight: 100 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0D00-0D7F;
}
@font-face {
  font-family: 'DuahManjari';
  src: url('../fonts/Manjari-Regular.ttf') format('truetype');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0D00-0D7F;
}
@font-face {
  font-family: 'DuahManjari';
  src: url('../fonts/Manjari-Bold.ttf') format('truetype');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0D00-0D7F;
}

/* 3. Amiri Quran — Arabic */
@font-face {
  font-family: 'DuahAmiri';
  src: url('../fonts/ArbFONTS-Amiri Quran.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --font-master: 'DuahManjari', 'DuahAmiri', 'DuahInter', 'Manjari', 'Amiri Quran', 'Inter', system-ui, -apple-system, sans-serif;
  --font-en: 'DuahInter', 'Inter', system-ui, -apple-system, sans-serif;
  --font-ar: 'DuahAmiri', 'Amiri Quran', 'Traditional Arabic', serif;

  --bg-parchment: #FAF7F0;
  --bg-card: #FFFFFF;
  --bg-subtle: #F3EDE0;
  --bg-emerald-soft: #E9F3EF;
  --bg-gold-soft: #FBF4E2;
  --emerald: #0E4D3B;
  --emerald-dark: #093629;
  --emerald-light: #1A6E56;
  --gold: #C59B43;
  --gold-dark: #9A7426;
  --text-main: #1A2421;
  --text-muted: #586862;
  --border: #E5DEC9;
  --danger: #C0392B;
  --danger-soft: #FDECEB;
  --amber: #B9770E;
  --amber-soft: #FEF5E7;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(14, 77, 59, 0.05);
  --shadow-md: 0 10px 28px rgba(14, 77, 59, 0.09);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  min-height: 100dvh;
}

body {
  font-family: var(--font-master);
  background-color: var(--bg-parchment);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.arabic-font {
  font-family: var(--font-ar);
  line-height: 1.9;
}

.en-font, .stat-value, input[type="date"], input[type="month"], input[type="time"], input[type="number"] {
  font-family: var(--font-en);
}

/* Subtle Islamic Geometric Pattern */
.arabesque-bg {
  background-color: var(--emerald);
  background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23C59B43' stroke-width='0.75' opacity='0.18'%3E%3Cpath d='M32 0 L64 32 L32 64 L0 32 Z'/%3E%3Ccircle cx='32' cy='32' r='13'/%3E%3Cpath d='M32 13 L51 32 L32 51 L13 32 Z'/%3E%3C/g%3E%3C/svg%3E");
}

.arabesque-light {
  background-color: var(--bg-parchment);
  background-image: url("data:image/svg+xml,%3Csvg width='84' height='84' viewBox='0 0 84 84' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23C59B43' stroke-width='0.6' opacity='0.12'%3E%3Cpath d='M42 0 L84 42 L42 84 L0 42 Z'/%3E%3Ccircle cx='42' cy='42' r='15'/%3E%3C/g%3E%3C/svg%3E");
}

/* 3-Language Switcher Pill */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 7px;
  font-family: var(--font-master);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--emerald);
  color: #fff;
  box-shadow: 0 2px 6px rgba(14, 77, 59, 0.22);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-master);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.52; cursor: not-allowed; }
.btn-primary { background: var(--emerald); color: #fff; box-shadow: 0 2px 8px rgba(14, 77, 59, 0.22); }
.btn-primary:hover:not(:disabled) { background: var(--emerald-dark); }
.btn-gold { background: linear-gradient(135deg, #D6AC54, #B1842B); color: #fff; box-shadow: 0 2px 8px rgba(177, 132, 43, 0.24); }
.btn-gold:hover:not(:disabled) { filter: brightness(0.96); }
.btn-outline { background: #fff; color: var(--emerald); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--bg-emerald-soft); border-color: var(--emerald); }
.btn-soft { background: var(--bg-emerald-soft); color: var(--emerald); }
.btn-soft:hover:not(:disabled) { background: #d6ebe2; }
.btn-amber { background: var(--amber-soft); color: var(--amber); border-color: #f3d7a5; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f5c6c2; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.badge-emerald { background: var(--bg-emerald-soft); color: var(--emerald); }
.badge-gold { background: var(--bg-gold-soft); color: var(--gold-dark); border: 1px solid #ead4a1; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); }

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

.card-gold-top {
  border-top: 3px solid var(--gold);
}

/* Inputs */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-master);
  font-size: 0.94rem;
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(14, 77, 59, 0.11);
}

/* Auth / Landing View */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.auth-header {
  padding: 26px 22px 22px;
  color: #fff;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}

.auth-header .brand-ar { font-size: 1.55rem; color: #F2D794; margin-bottom: 4px; }
.auth-header h1 { font-family: var(--font-en); font-size: 1.45rem; font-weight: 800; letter-spacing: 0.3px; }
.auth-header p { font-size: 0.88rem; opacity: 0.9; margin-top: 4px; }
.auth-body { padding: 22px; }

.pill-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.pill-tab {
  flex: 1;
  min-height: 38px;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 9px;
  font-family: var(--font-master);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.pill-tab.active {
  background: #fff;
  color: var(--emerald);
  box-shadow: var(--shadow-sm);
}

.edition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.edition-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  background: #fff;
  text-align: start;
  transition: all 0.15s;
}
.edition-box.selected { border-color: var(--emerald); background: var(--bg-emerald-soft); }
.edition-box strong { display: block; font-size: 0.9rem; color: var(--emerald); }
.edition-box span { font-size: 0.78rem; color: var(--text-muted); }

/* Desktop & Mobile App Layout */
.app-layout {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

.sidebar {
  width: 272px;
  flex-shrink: 0;
  background: #fff;
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 40;
}

.sidebar-brand {
  padding: 20px 18px 18px;
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.sidebar-brand .brand-row { display: flex; align-items: center; gap: 12px; }
.sidebar-brand img { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; }
.sidebar-brand .brand-title { font-family: var(--font-en); font-size: 1.12rem; font-weight: 800; line-height: 1.2; }
.sidebar-brand .brand-sub { font-size: 0.85rem; color: #F2D794; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-family: var(--font-master);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: start;
  width: 100%;
  transition: all 0.15s;
}

.nav-item:hover { background: var(--bg-subtle); color: var(--emerald); }
.nav-item.active {
  background: var(--bg-emerald-soft);
  color: var(--emerald);
  border-inline-start: 3.5px solid var(--gold);
}

.sidebar-footer {
  padding: 15px;
  border-top: 1px solid var(--border);
  background: var(--bg-parchment);
  font-size: 0.82rem;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.15rem;
  color: var(--emerald);
}

.content-wrap {
  padding: 24px 26px 40px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Hero Banner */
.hero-banner {
  border-radius: var(--radius-md);
  color: #fff;
  padding: 22px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--gold);
  box-shadow: var(--shadow-sm);
}

.hero-banner h2 { font-size: 1.32rem; font-weight: 800; line-height: 1.35; }
.hero-banner p { font-size: 0.88rem; opacity: 0.9; margin-top: 3px; }

/* Stats & Grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border-inline-start: 4px solid var(--emerald);
  box-shadow: var(--shadow-sm);
}

.stat-card.gold { border-inline-start-color: var(--gold); }
.stat-label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--emerald); margin: 4px 0 2px; line-height: 1.2; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Progress Bars */
.progress-track {
  width: 100%;
  height: 9px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--emerald), #258A6C); border-radius: 999px; transition: width 0.25s ease; }
.progress-fill.gold { background: linear-gradient(90deg, #D4AA52, #B3862D); }

/* Quick Page Buttons */
.quick-page-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.quick-chip {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: var(--font-master);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--emerald);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip.active, .quick-chip:hover { background: var(--emerald); color: #fff; border-color: var(--emerald); }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--bg-subtle); }
th { background: var(--bg-parchment); color: var(--emerald); font-weight: 700; font-size: 0.8rem; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 32, 24, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-parchment);
}
.modal-body { padding: 20px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: var(--emerald);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  border-inline-start: 4px solid var(--gold);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 200;
  animation: slideUp 0.2s ease;
}

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

/* Parent Mobile View */
.parent-shell { max-width: 540px; margin: 0 auto; padding: 20px 14px 44px; }
.pin-display {
  font-family: var(--font-en);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--emerald);
  background: var(--bg-gold-soft);
  border: 1.5px dashed var(--gold);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  margin: 10px 0;
}

/* A4 Report Sheet */
.a4-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}

.a4-letterhead {
  border-bottom: 2.5px solid var(--emerald);
  padding-bottom: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Mobile Bottom App Navigation Bar (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

/* Tablet & Mobile Responsive Precision */
@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: -290px;
    transition: inset-inline-start 0.24s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { inset-inline-start: 0; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 32, 24, 0.42);
    z-index: 35;
  }

  .topbar {
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .topbar .trial-pill-desktop { display: none; }

  .content-wrap {
    padding: 14px 14px calc(86px + env(safe-area-inset-bottom));
  }

  .card { padding: 15px; }
  .hero-banner { padding: 16px; }
  .hero-banner h2 { font-size: 1.15rem; }
  .stat-value { font-size: 1.32rem; }
  .a4-sheet { padding: 16px; }

  .toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
    inset-inline-end: 14px;
    inset-inline-start: 14px;
    text-align: center;
  }

  /* Native Mobile App Bottom Navigation */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 32;
    box-shadow: 0 -4px 16px rgba(14, 77, 59, 0.08);
  }

  .mob-nav-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px;
    font-family: var(--font-master);
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
  }

  .mob-nav-btn .mob-ico { font-size: 1.15rem; line-height: 1; }
  .mob-nav-btn.active {
    color: var(--emerald);
    background: var(--bg-emerald-soft);
  }
}

@media (max-width: 480px) {
  .edition-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 12px 13px; }
}

/* A4 Print / PDF Styling */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff !important; color: #000 !important; }
  .sidebar, .topbar, .mobile-bottom-nav, .no-print, .toast, .modal-backdrop { display: none !important; }
  .main-area, .content-wrap { padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  .a4-sheet { border: none !important; box-shadow: none !important; padding: 0 !important; }
  table { font-size: 11px !important; }
}

/* Desktop 1-Click Mobile App Frame Preview */
.phone-preview-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.phone-bezel {
  width: 390px;
  max-width: 92vw;
  height: min(780px, 82dvh);
  background: #121816;
  border-radius: 42px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 2px #C59B43;
  display: flex;
  flex-direction: column;
}
.phone-notch {
  width: 110px;
  height: 18px;
  background: #121816;
  border-radius: 999px;
  margin: 0 auto 6px;
}
.phone-screen {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 30px;
  background: #FAF7F0;
}
@media (max-width: 900px) {
  .desktop-only-preview { display: none !important; }
}


/* ============================================================================
   Enhanced Arabic Bold Highlight & Strict Zero-Overflow Alignment Fixes
   ============================================================================ */
.arabic-bold-title {
  font-family: var(--font-ar);
  font-weight: 700;
  color: #F6DF9E !important;
  -webkit-text-stroke: 0.48px rgba(246, 223, 158, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  line-height: 1.75;
  letter-spacing: 0;
}

.auth-header .brand-ar.arabic-bold-title {
  font-size: 1.95rem;
  margin-bottom: 4px;
}

.hero-banner .hero-ar-title {
  font-size: 1.48rem;
  -webkit-text-stroke: 0.38px rgba(246, 223, 158, 0.82);
  margin-bottom: 2px;
}

/* Fix Quick Actions & Long Buttons staying strictly inside card bounds */
.quick-action-btn {
  width: 100%;
  max-width: 100%;
  white-space: normal !important;
  text-align: start !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  line-height: 1.45;
  height: auto;
  min-height: 44px;
  padding: 10px 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Strict zero horizontal overflow across Desktop & Mobile */
html, body, .app-layout, .main-area, .content-wrap {
  max-width: 100% !important;
  overflow-x: clip !important;
}

.grid-2 > *, .stats-grid > *, .card, .hero-banner, .hero-banner > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }
  .pill-tabs {
    flex-wrap: wrap;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .pill-tab {
    flex: 1 1 auto;
    min-width: 92px;
    font-size: 0.8rem;
    padding: 7px 8px;
  }
  .topbar {
    gap: 8px;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .hero-banner .hero-ar-title {
    font-size: 1.24rem;
  }
  .auth-header .brand-ar.arabic-bold-title {
    font-size: 1.65rem;
  }
  .stat-card {
    overflow: hidden;
  }
  .stat-value {
    font-size: 1.22rem;
    overflow-wrap: anywhere;
  }
  .a4-letterhead {
    flex-direction: column;
    align-items: flex-start;
  }
  table {
    font-size: 0.8rem;
  }
  th, td {
    padding: 8px 9px;
  }
}
