/* HifzTrack — Premium Islamic SaaS theme */

:root {
  --green-900: #0B3D2E;
  --green-800: #0F4A38;
  --green-700: #155B44;
  --green-600: #1B6E52;
  --green-500: #2A8465;
  --green-100: #E5EFE9;
  --gold-600: #B5863A;
  --gold-500: #C9A24A;
  --gold-400: #D4AE5C;
  --gold-300: #E3C37E;
  --gold-100: #F5E7C2;
  --cream: #FAF6EE;
  --cream-2: #F3EEE0;
  --ink: #14201A;
  --ink-2: #2D3A33;
  --ink-3: #5B6B62;
  --line: #E4DDCB;
  --line-2: #D9D0B8;
  --danger: #A63B2A;
  --warning: #B8872A;
  --shadow-sm: 0 1px 2px rgba(11, 61, 46, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(11, 61, 46, 0.18);
  --shadow-lg: 0 20px 50px -12px rgba(11, 61, 46, 0.28);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

/* When the app shell is mounted, paint the left sidebar strip into the body so a
 * dark green column reaches the bottom even when content is shorter than viewport. */
body:has(.app-shell) {
  background:
    linear-gradient(180deg, var(--green-900) 0%, #092e22 100%) left top / 260px 100% no-repeat,
    var(--cream);
}
@media (max-width: 960px) {
  body:has(.app-shell) { background: var(--cream); }
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Amiri', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--green-900);
  margin: 0;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--gold-600); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 0.95rem; }

::selection { background: var(--gold-300); color: var(--green-900); }

/* ============ AUTH LAYOUT ============ */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--cream);
}
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
.auth-hero {
  background:
    radial-gradient(1200px 600px at 0% 0%, rgba(212,174,92,0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(42,132,101,0.35), transparent 55%),
    linear-gradient(135deg, var(--green-900) 0%, #0a2f24 100%);
  color: var(--cream);
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(212,174,92,0.04) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(212,174,92,0.04) 0 1px, transparent 1px 14px);
  pointer-events: none;
}
.auth-hero .brand {
  display: flex; align-items: center; gap: 14px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-300);
  position: relative;
}
.auth-hero .brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  display: grid; place-items: center;
  color: var(--green-900); font-weight: 700;
  box-shadow: 0 8px 22px -8px rgba(212,174,92,0.6);
}
.auth-hero h1 {
  color: var(--cream);
  font-size: 3rem;
  line-height: 1.1;
  margin-top: 40px;
  max-width: 520px;
}
.auth-hero h1 em { color: var(--gold-300); font-style: normal; }
.auth-hero p {
  color: rgba(250, 246, 238, 0.78);
  max-width: 480px;
  margin-top: 18px;
  font-size: 1.05rem;
}
.auth-hero .highlights {
  display: grid; gap: 14px; margin-top: 36px;
  position: relative;
}
.auth-hero .highlight {
  display: flex; gap: 14px; align-items: flex-start;
  color: rgba(250, 246, 238, 0.92);
}
.auth-hero .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold-400);
  margin-top: 8px; flex: 0 0 10px;
  box-shadow: 0 0 0 4px rgba(212,174,92,0.15);
}
.auth-hero .ayah {
  font-family: 'Amiri', serif;
  font-size: 1.35rem;
  color: var(--gold-100);
  border-left: 2px solid var(--gold-500);
  padding-left: 18px;
  position: relative;
  margin-top: 28px;
}
.auth-hero .ayah small { display: block; color: rgba(250,246,238,0.55); font-family: 'Cairo', sans-serif; font-size: 0.85rem; margin-top: 8px; }

.auth-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
}
.auth-card h2 {
  font-size: 2rem;
  margin-bottom: 6px;
}
.auth-card .sub { color: var(--ink-3); margin-bottom: 28px; font-size: 0.95rem; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.input, .select, textarea.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--gold-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(201,162,74,0.15);
}
.input[disabled] { background: var(--cream-2); color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  background: var(--green-900); color: var(--cream);
}
.btn:hover { background: var(--green-800); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn.gold { background: linear-gradient(180deg, var(--gold-500), var(--gold-600)); color: var(--green-900); }
.btn.gold:hover { background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); color: var(--green-900); }
.btn.ghost { background: transparent; color: var(--green-800); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--cream-2); color: var(--green-900); }
.btn.danger { background: transparent; color: var(--danger); border-color: #E9C7C0; }
.btn.danger:hover { background: #FBEDEA; }
.btn.sm { padding: 7px 14px; font-size: 0.82rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.link-muted { color: var(--ink-3); font-size: 0.9rem; }
.link-muted a { color: var(--green-800); font-weight: 600; }

/* ============ APP LAYOUT ============ */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform 0.25s; width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .mobile-topbar { display: flex !important; }
}

.sidebar {
  background: linear-gradient(180deg, var(--green-900) 0%, #092e22 100%);
  color: var(--cream);
  padding: 26px 20px;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(212,174,92,0.18);
  position: sticky; top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem; font-weight: 600;
  color: var(--gold-300);
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(212,174,92,0.15);
  margin-bottom: 22px;
}
.sidebar .brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  display: grid; place-items: center;
  color: var(--green-900); font-weight: 700;
}
.sidebar .section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(212,174,92,0.65);
  margin: 16px 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(250,246,238,0.78);
  font-weight: 500;
  font-size: 0.93rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, padding 0.18s;
  border: 1px solid transparent;
}
.nav-item:hover { background: rgba(212,174,92,0.08); color: var(--cream); }
.nav-item.active {
  background: rgba(212,174,92,0.14);
  color: var(--gold-300);
  border-color: rgba(212,174,92,0.22);
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.9; }

.sidebar .user-card {
  margin-top: auto;
  padding: 14px;
  background: rgba(212,174,92,0.08);
  border: 1px solid rgba(212,174,92,0.18);
  border-radius: 12px;
  display: flex; align-items: center; gap: 12px;
}
.sidebar .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  color: var(--green-900);
  display: grid; place-items: center; font-weight: 700;
}
.sidebar .user-name { color: var(--cream); font-weight: 600; font-size: 0.9rem; }
.sidebar .user-role { color: rgba(250,246,238,0.55); font-size: 0.75rem; text-transform: capitalize; }

.main {
  padding: 36px 48px;
  max-width: 1400px;
  width: 100%;
  margin-inline: auto;
  min-height: 100vh;
  box-sizing: border-box;
}
@media (max-width: 720px) { .main { padding: 20px; } }

/* Mobile fix — eliminate trailing whitespace + grid column residue */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  .app-shell { display: block; min-height: 100vh; }
  .main { padding: 16px 14px 96px; min-height: calc(100vh - 56px); margin-inline: 0; }
  .page-header { margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
  .page-header h1 { font-size: 1.55rem; line-height: 1.15; }
  .page-header .desc { font-size: 0.85rem; }
  .page-header > div:last-child { flex-wrap: wrap; }
  .page-header .btn { font-size: 0.82rem; padding: 8px 12px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal { max-width: calc(100vw - 24px); }
}

.mobile-topbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: var(--green-900); color: var(--cream);
  padding: 12px 16px; align-items: center; justify-content: space-between;
}
.mobile-topbar .brand { font-family: 'Cormorant Garamond', serif; color: var(--gold-300); font-size: 1.1rem; }

/* ============ PAGE HEADER ============ */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.page-header .crumbs { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-600); margin-bottom: 6px; }
.page-header h1 { margin-bottom: 4px; }
.page-header .desc { color: var(--ink-3); font-size: 0.95rem; }

/* ============ CARDS & GRIDS ============ */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { font-family: 'Cairo', sans-serif; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 10px; }
.card-value { font-family: 'Cormorant Garamond', serif; font-size: 2rem; color: var(--green-900); line-height: 1.1; }
.card-sub { color: var(--ink-3); font-size: 0.85rem; margin-top: 6px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Feature/highlight card */
.hero-card {
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(212,174,92,0.18), transparent 60%),
    linear-gradient(135deg, var(--green-900), var(--green-700));
  color: var(--cream);
  border: 1px solid rgba(212,174,92,0.25);
  border-radius: var(--radius-lg);
  padding: 30px;
  position: relative; overflow: hidden;
}
.hero-card .eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-300); }
.hero-card h2 { color: var(--cream); font-size: 3rem; margin: 8px 0 6px; }
.hero-card h2 .gold { color: var(--gold-300); }
.hero-card .hero-meta { color: rgba(250,246,238,0.75); }
.hero-card .juz-visual {
  display: flex; gap: 4px; margin-top: 20px; flex-wrap: wrap; max-width: 560px;
}
.hero-card .juz-pip {
  width: 18px; height: 24px; border-radius: 3px;
  background: rgba(250,246,238,0.12);
  border: 1px solid rgba(212,174,92,0.2);
}
.hero-card .juz-pip.filled { background: var(--gold-400); border-color: var(--gold-300); }

/* Progress bar */
.progress {
  height: 10px; border-radius: 999px; background: var(--cream-2);
  overflow: hidden; border: 1px solid var(--line);
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--green-700), var(--gold-500));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2,0.8,0.2,1);
}
.progress-lg { height: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data {
  width: 100%; border-collapse: collapse;
}
table.data th, table.data td {
  padding: 14px 18px; text-align: left; font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}
table.data th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-3); background: var(--cream); font-weight: 600;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--cream); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.badge.gold { background: var(--gold-100); color: var(--gold-600); border-color: var(--gold-300); }
.badge.green { background: var(--green-100); color: var(--green-800); border-color: #BBD4C4; }
.badge.danger { background: #FBEDEA; color: var(--danger); border-color: #E9C7C0; }
.badge.neutral { background: var(--cream-2); color: var(--ink-3); border-color: var(--line); }

/* Lists */
.plan-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan-list li {
  display: flex; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--cream);
}
.plan-list .day { font-family: 'Cormorant Garamond', serif; font-weight: 600; color: var(--green-800); min-width: 96px; }
.plan-list .task { color: var(--ink-2); flex: 1; }

/* Empty states */
.empty {
  text-align: center; padding: 48px 24px; border: 1px dashed var(--line-2);
  border-radius: var(--radius); color: var(--ink-3); background: #fff;
}
.empty h3 { color: var(--green-800); margin-bottom: 6px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,32,26,0.55);
  display: grid; place-items: center; z-index: 50;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px; max-width: 520px; width: calc(100% - 32px);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: popIn 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
.modal h3 { font-size: 1.5rem; margin-bottom: 4px; }
.modal .desc { color: var(--ink-3); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Toast */
#toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 18px; border-radius: 10px;
  background: var(--green-900); color: var(--cream);
  border: 1px solid rgba(212,174,92,0.3);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s;
  max-width: 360px; font-size: 0.9rem;
}
.toast.error { background: var(--danger); border-color: #D08070; }
.toast.success { background: var(--green-800); border-color: var(--gold-400); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Charts */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 10px 0; }
.bar {
  flex: 1; background: linear-gradient(180deg, var(--gold-400), var(--green-700));
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 0.5s ease;
}
.bar-label { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 0.72rem; color: var(--ink-3); }
.bar-value { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 0.72rem; color: var(--green-800); font-weight: 600; }

/* Utilities */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap-10 { display: flex; gap: 10px; align-items: center; }
.flex-gap-16 { display: flex; gap: 16px; align-items: center; }
.text-center { text-align: center; }
.muted { color: var(--ink-3); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.fw-600 { font-weight: 600; }
.spin { animation: spin 0.9s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Loader */
.loader {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--cream);
}
.loader .dot-wrap { display: flex; gap: 8px; }
.loader .d {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold-500);
  animation: bounce 1.2s infinite;
}
.loader .d:nth-child(2) { animation-delay: 0.15s; }
.loader .d:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-10px); opacity: 1; }
}

/* Section heading */
.section-heading {
  display: flex; align-items: baseline; gap: 12px; margin: 8px 0 16px;
}
.section-heading h3 { margin: 0; }
.section-heading .accent { flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-400), transparent); }

/* Setup page */
.setup-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.setup-card { max-width: 640px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-md); }
.setup-card textarea { min-height: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }
.setup-card .step { display: flex; gap: 10px; margin-bottom: 6px; color: var(--ink-3); font-size: 0.9rem; }
.setup-card .step b { color: var(--green-800); }

/* ============================================================
   Public landing page — premium dark green + gold marketing UI
   ============================================================ */
.btn.lg { padding: 14px 28px; font-size: 1rem; border-radius: 999px; }

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top left, rgba(212,174,92,0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(11,61,46,0.08), transparent 60%),
    var(--cream);
  color: var(--ink);
}

.landing-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,246,238,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.landing-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.landing-nav-inner .brand { color: var(--green-900); font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.landing-nav-inner .brand-mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--green-700), var(--green-900)); color: var(--gold-300); display: grid; place-items: center; font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.1rem; }
.landing-nav-links { display: flex; align-items: center; gap: 24px; }
.landing-nav-links a:not(.btn) { color: var(--ink-2); text-decoration: none; font-size: 0.92rem; transition: color 0.2s; }
.landing-nav-links a:not(.btn):hover { color: var(--green-900); }
@media (max-width: 720px) {
  .landing-nav-links a:not(.btn) { display: none; }
  .landing-nav-inner { padding: 12px 20px; }
}

.landing-hero {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 32px 60px;
}
.landing-hero-inner {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 80px; align-items: center;
}
@media (max-width: 920px) {
  .landing-hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .landing-hero { padding: 48px 24px 40px; }
}
.landing-eyebrow {
  display: inline-block;
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-600); font-weight: 700;
  padding: 6px 14px; border: 1px solid rgba(201,162,74,0.35); border-radius: 999px;
  background: rgba(201,162,74,0.06);
  margin-bottom: 20px;
}
.landing-h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05; color: var(--green-900); margin: 0 0 20px;
  letter-spacing: -0.02em;
}
.landing-h1 em {
  font-style: italic; color: var(--gold-600); font-weight: 500;
}
.landing-lead {
  font-size: 1.125rem; line-height: 1.6; color: var(--ink-2);
  max-width: 540px; margin: 0 0 32px;
}
.landing-cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.landing-trust-row {
  display: flex; gap: 32px; flex-wrap: wrap;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.landing-trust-item { color: var(--ink-3); font-size: 0.88rem; }
.landing-trust-item b { color: var(--green-900); font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; display: block; line-height: 1; margin-bottom: 4px; }

.landing-hero-side {
  position: relative;
}
.landing-ayah-card {
  position: relative;
  background: linear-gradient(135deg, var(--green-900) 0%, #0a2f24 100%);
  color: var(--cream); border-radius: 20px;
  padding: 48px 40px; box-shadow: 0 30px 60px -20px rgba(11,61,46,0.4);
  border: 1px solid rgba(212,174,92,0.25);
  transform: rotate(-1.5deg);
  transition: transform 0.4s ease;
}
.landing-ayah-card:hover { transform: rotate(0deg); }
.landing-ayah-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  background: radial-gradient(ellipse at top right, rgba(212,174,92,0.15), transparent 50%);
  pointer-events: none;
}
.landing-ayah-arabic {
  font-family: 'Amiri', serif; font-size: 2rem; line-height: 1.8;
  color: var(--gold-300); text-align: center; margin-bottom: 20px;
  direction: rtl;
}
.landing-ayah-trans { color: rgba(250,246,238,0.85); font-style: italic; line-height: 1.6; text-align: center; font-size: 0.95rem; }
.landing-ayah-cite { color: var(--gold-300); font-size: 0.82rem; text-align: center; margin-top: 12px; letter-spacing: 0.04em; }

.landing-section {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 32px;
}
.landing-section-alt {
  background: linear-gradient(180deg, transparent, rgba(243,238,224,0.5));
  max-width: none;
  padding-left: 0; padding-right: 0;
}
.landing-section-alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 32px; padding-right: 32px; }
.landing-section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.landing-section-head .landing-eyebrow { margin-bottom: 16px; }
.landing-h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.15; color: var(--green-900); margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.landing-section-lead { font-size: 1.05rem; line-height: 1.6; color: var(--ink-2); margin: 0; }

.landing-features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.landing-feature-card {
  padding: 28px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.landing-feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-300);
  box-shadow: 0 16px 40px -12px rgba(11,61,46,0.12);
}
.landing-feature-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1.4rem;
  color: var(--green-900); margin-bottom: 10px; font-weight: 600;
}
.landing-feature-body { color: var(--ink-2); line-height: 1.6; font-size: 0.95rem; }

.landing-pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px;
  align-items: stretch;
}
.landing-plan-card {
  position: relative;
  padding: 32px 24px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  display: flex; flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.landing-plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-300);
  box-shadow: 0 16px 40px -12px rgba(11,61,46,0.12);
}
.landing-plan-card.highlighted {
  border: 2px solid var(--gold-500);
  box-shadow: 0 20px 50px -15px rgba(201,162,74,0.3);
  background: linear-gradient(180deg, #fff, var(--cream));
}
.landing-plan-popular {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; padding: 6px 14px;
}
.landing-plan-name {
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-600); font-weight: 700; margin-bottom: 8px;
}
.landing-plan-price {
  font-family: 'Cormorant Garamond', serif; font-size: 2.2rem;
  color: var(--green-900); line-height: 1; margin-bottom: 6px; font-weight: 600;
}
.landing-plan-sub { color: var(--ink-3); font-size: 0.82rem; margin-bottom: 20px; }
.landing-plan-features {
  list-style: none; padding: 0; margin: 0 0 24px;
  flex: 1;
}
.landing-plan-features li {
  position: relative; padding: 8px 0 8px 22px;
  color: var(--ink-2); font-size: 0.88rem; line-height: 1.5;
  border-bottom: 1px solid var(--line);
}
.landing-plan-features li:last-child { border-bottom: none; }
.landing-plan-features li::before {
  content: ''; position: absolute; left: 0; top: 14px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500);
}
.landing-pricing-note {
  text-align: center; margin-top: 32px; color: var(--ink-3); font-size: 0.88rem;
  font-style: italic;
}

.landing-cta-section {
  background: linear-gradient(135deg, var(--green-900) 0%, #0a2f24 100%);
  color: var(--cream); margin-top: 0;
  max-width: none; padding-left: 0; padding-right: 0;
}
.landing-cta-section > .landing-cta-inner { max-width: 800px; margin: 0 auto; padding: 80px 32px; text-align: center; }
.landing-cta-section .landing-h2 { color: var(--gold-300); }
.landing-cta-section .landing-section-lead { color: rgba(250,246,238,0.8); margin-bottom: 32px; }
.landing-cta-section .landing-cta-row { justify-content: center; }

.landing-footer {
  background: var(--green-900); color: rgba(250,246,238,0.7);
  padding: 48px 32px 32px;
}
.landing-footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; align-items: start;
}
@media (max-width: 720px) {
  .landing-footer-inner { grid-template-columns: 1fr; gap: 20px; }
}
.landing-footer .brand { color: var(--cream); font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.landing-footer .brand-mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: var(--green-900); display: grid; place-items: center; font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.1rem; }
.landing-footer-tag { margin-top: 10px; font-size: 0.88rem; line-height: 1.5; }
.landing-footer-links { display: flex; flex-direction: column; gap: 8px; }
.landing-footer-links a { color: rgba(250,246,238,0.7); text-decoration: none; font-size: 0.88rem; }
.landing-footer-links a:hover { color: var(--gold-300); }
.landing-footer-meta { font-size: 0.8rem; color: rgba(250,246,238,0.5); align-self: end; text-align: right; }
@media (max-width: 720px) { .landing-footer-meta { text-align: left; } }

/* ============================================================
   Landing — animated product preview
   ============================================================ */
.landing-preview-section {
  background:
    radial-gradient(ellipse at top right, rgba(212,174,92,0.08), transparent 60%),
    transparent;
}
.landing-preview-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: center;
}
@media (max-width: 980px) {
  .landing-preview-grid { grid-template-columns: 1fr; gap: 40px; }
}
.landing-preview-copy .landing-eyebrow { margin-bottom: 16px; }
.landing-preview-copy .landing-h2 { text-align: left; }
.landing-preview-copy .landing-section-lead { text-align: left; max-width: none; margin-bottom: 28px; }
.landing-preview-list { list-style: none; padding: 0; margin: 0 0 32px; }
.landing-preview-list li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 0; color: var(--ink-2); line-height: 1.5; font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
}
.landing-preview-list li:last-child { border-bottom: none; }
.landing-preview-list li b { color: var(--green-900); font-weight: 600; }
.landing-preview-bullet {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--green-900);
  display: grid; place-items: center;
  font-family: 'Cormorant Garamond', serif; font-weight: 700;
  font-size: 1.05rem;
}

/* Mock window */
.landing-preview-mock {
  position: relative;
  perspective: 1600px;
}
.lpm-window {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow:
    0 30px 80px -20px rgba(11,61,46,0.25),
    0 8px 24px -8px rgba(11,61,46,0.12);
  overflow: hidden;
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform 0.5s ease;
}
.landing-preview-mock:hover .lpm-window { transform: rotateY(0deg) rotateX(0deg); }
.lpm-titlebar {
  background: var(--green-900);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 8px;
}
.lpm-dot { width: 11px; height: 11px; border-radius: 50%; }
.lpm-dot-r { background: #ff5f57; }
.lpm-dot-y { background: #febc2e; }
.lpm-dot-g { background: #28c840; }
.lpm-titlebar-text {
  margin-left: 16px; color: rgba(250,246,238,0.6);
  font-size: 0.8rem; letter-spacing: 0.04em;
}
.lpm-body {
  padding: 24px;
  background: var(--cream);
  display: flex; flex-direction: column; gap: 18px;
}

.lpm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.lpm-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 12px;
  animation: lpmFadeIn 0.6s ease forwards;
  opacity: 0;
}
.lpm-stat:nth-child(1) { animation-delay: 0.0s; }
.lpm-stat:nth-child(2) { animation-delay: 0.1s; }
.lpm-stat:nth-child(3) { animation-delay: 0.2s; }
.lpm-stat:nth-child(4) { animation-delay: 0.3s; }
.lpm-stat-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.lpm-stat-value { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; color: var(--green-900); line-height: 1; font-weight: 600; }
.lpm-stat-gold { color: var(--gold-600); }
.lpm-stat-red { color: var(--danger); }

.lpm-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px;
  animation: lpmFadeIn 0.6s ease 0.4s forwards; opacity: 0;
}
.lpm-card-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.lpm-card-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; color: var(--green-900); font-weight: 600; }

/* Revision cycle */
.lpm-cycle {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center; gap: 0;
  padding: 6px 4px 0;
}
.lpm-cycle-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lpm-step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line);
  background: #fff;
  transition: all 0.3s;
}
.lpm-step-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.lpm-step-done .lpm-step-circle {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
  animation: lpmDone 0.4s ease forwards;
}
.lpm-step-active .lpm-step-circle {
  border-color: var(--gold-500);
  background: var(--gold-100);
  position: relative;
}
.lpm-step-active .lpm-step-circle::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--gold-500);
  opacity: 0;
  animation: lpmPulse 1.6s ease-in-out infinite;
}
.lpm-step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-500);
}
.lpm-cycle-line {
  height: 2px; background: var(--line); position: relative;
  overflow: hidden;
}
.lpm-cycle-line::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--green-700), var(--gold-500));
  transform: scaleX(0); transform-origin: left;
}
.lpm-line-1::after { animation: lpmLine 0.6s ease 0.3s forwards; }
.lpm-line-2::after { animation: lpmLine 0.6s ease 0.7s forwards; }
.lpm-line-3 { /* still pending — stays grey */ }

.lpm-step-done[data-day="1"] { animation: lpmStepIn 0.4s ease 0.2s both; }
.lpm-step-done[data-day="3"] { animation: lpmStepIn 0.4s ease 0.6s both; }
.lpm-step-active[data-day="7"] { animation: lpmStepIn 0.4s ease 1.0s both; }
.lpm-step-pending[data-day="14"] { animation: lpmStepIn 0.4s ease 1.2s both; }

.lpm-rows { display: flex; flex-direction: column; gap: 8px; }
.lpm-row {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  animation: lpmFadeIn 0.5s ease forwards; opacity: 0;
}
.lpm-rows .lpm-row:nth-child(1) { animation-delay: 0.6s; }
.lpm-rows .lpm-row:nth-child(2) { animation-delay: 0.75s; }
.lpm-rows .lpm-row:nth-child(3) { animation-delay: 0.9s; }
.lpm-rows .lpm-row:nth-child(4) { animation-delay: 1.05s; }
.lpm-row-name { font-weight: 600; color: var(--green-900); font-size: 0.92rem; }
.lpm-row-meta { color: var(--ink-3); font-weight: 400; font-size: 0.78rem; margin-left: 6px; }

.lpm-badge {
  font-size: 0.7rem; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px;
  font-weight: 600; flex-shrink: 0;
}
.lpm-badge-gold { background: var(--gold-100); color: var(--gold-600); }
.lpm-badge-green { background: rgba(34,139,34,0.1); color: var(--green-700); }
.lpm-badge-red { background: rgba(192,57,43,0.1); color: var(--danger); }
.lpm-badge-neutral { background: var(--cream); color: var(--ink-3); border: 1px solid var(--line); }

@keyframes lpmFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes lpmLine {
  to { transform: scaleX(1); }
}
@keyframes lpmDone {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes lpmPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes lpmStepIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@media (max-width: 600px) {
  .lpm-stats { grid-template-columns: repeat(2, 1fr); }
  .lpm-cycle { gap: 0; }
  .lpm-step-label { font-size: 0.62rem; }
}

/* Phase 3 P1 — pulse animation for sidebar alert dot */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.18); }
}
.weak-surah-item summary::-webkit-details-marker { display: none; }
.weak-surah-item[open] summary { color: var(--green-900); }

/* Password show/hide toggle */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.pwd-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: transparent; border: none; padding: 8px;
  color: var(--ink-3); cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}
.pwd-toggle:hover { background: rgba(192,144,47,0.08); color: var(--gold-600); }
.pwd-toggle:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }


/* ============ SCHOOL WELCOME CARD (Phase 6A) ============ */
.school-welcome {
  background:
    radial-gradient(circle at 95% 0%, rgba(212,174,92,0.18), transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(43,131,99,0.25), transparent 55%),
    linear-gradient(135deg, var(--green-900) 0%, #061f17 100%);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin-bottom: 22px;
  border: 1px solid rgba(212,174,92,0.28);
  box-shadow: 0 18px 38px -22px rgba(11,61,46,0.45);
  position: relative;
  overflow: hidden;
}
.school-welcome::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(212,174,92,0.06) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 65%, rgba(212,174,92,0.05) 0 1px, transparent 1.5px);
  background-size: 22px 22px, 33px 33px;
  pointer-events: none; opacity: 0.7;
}
.school-welcome__inner {
  display: flex; gap: 18px; align-items: flex-start;
  position: relative; z-index: 1;
}
@media (max-width: 720px) {
  .school-welcome { padding: 20px 18px; border-radius: var(--radius); margin-bottom: 16px; }
  .school-welcome__inner { gap: 14px; }
  .school-welcome h2 { font-size: 1.35rem !important; }
}

/* ============ DAILY AYAH CARD ============ */
.daily-ayah-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(212,174,92,0.18), transparent 55%),
    linear-gradient(160deg, var(--green-900) 0%, #07241a 100%);
  color: var(--cream);
  border-color: rgba(212,174,92,0.3);
  position: relative;
  overflow: hidden;
}
.daily-ayah-card::after {
  content: ''; position: absolute; right: -20px; bottom: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,174,92,0.18), transparent 65%);
  pointer-events: none;
}
.daily-ayah__ar {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.8rem; line-height: 2.2;
  color: var(--gold-300);
  text-align: center;
  margin: 14px 0 12px;
  direction: rtl;
}
.daily-ayah__en {
  font-style: italic; color: rgba(250,246,238,0.85);
  font-size: 0.95rem; line-height: 1.7; text-align: center;
  max-width: 540px; margin: 0 auto;
}
.daily-ayah__ref {
  text-align: center; margin-top: 10px;
  color: var(--gold-300); font-size: 0.82rem; letter-spacing: 0.06em;
}
@media (max-width: 720px) {
  .daily-ayah__ar { font-size: 1.45rem; line-height: 2; }
  .daily-ayah__en { font-size: 0.88rem; }
}

/* ============ STREAK CARD ============ */
.streak-card { background: linear-gradient(135deg, var(--cream) 0%, #fff 100%); border-color: var(--gold-300); }

/* ============ SKELETONS (loading states) ============ */
.skeleton-card {
  background: linear-gradient(90deg, #f1ead6 0%, #faf6ee 50%, #f1ead6 100%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: skeleton-shimmer 1.4s infinite linear;
  border: 1px solid var(--line);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ MOBILE BOTTOM TAB NAV ============ */
.mobile-tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 35;
  background: var(--green-900);
  border-top: 1px solid rgba(212,174,92,0.22);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px -10px rgba(0,0,0,0.4);
}
.mobile-tabbar__list { display: flex; justify-content: space-around; align-items: stretch; }
.mobile-tabbar__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px; border-radius: 10px;
  color: rgba(250,246,238,0.62); font-size: 0.65rem;
  text-decoration: none; transition: color 0.18s, background 0.18s;
  letter-spacing: 0.04em;
}
.mobile-tabbar__item.active { color: var(--gold-300); background: rgba(212,174,92,0.1); }
.mobile-tabbar__item svg { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .mobile-tabbar { display: block; }
  /* Reserve space below content so the last card isn't hidden under the tabbar */
  .main { padding-bottom: 88px !important; }
  /* Reduce excessive top spacing on mobile pages */
  .page-header { margin-bottom: 14px; }
  .school-welcome { margin-top: 4px; }
}

/* ============ HEADER STAT STRIP (per-page) ============ */
.header-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 6px 0 0;
}
.header-strip__pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(212,174,92,0.12);
  border: 1px solid rgba(212,174,92,0.3);
  color: var(--gold-300);
  padding: 5px 11px; border-radius: 999px;
  font-size: 0.72rem; letter-spacing: 0.06em;
  font-weight: 500;
}
.header-strip__pill b { color: var(--cream); font-weight: 600; }
@media (max-width: 720px) {
  .header-strip__pill { font-size: 0.68rem; padding: 4px 9px; }
}


/* ============ DARK MODE (Phase 6E) ============
   Inverts the cream surfaces to deep ink while preserving the green/gold accent
   palette. School welcome card already uses dark-on-dark — looks great either way. */
:root[data-theme="dark"] {
  --cream: #0E1714;
  --cream-2: #14211C;
  --ink: #EDEAE0;
  --ink-2: #C9C7BD;
  --ink-3: #8C9089;
  --line: #243029;
  --line-2: #2E3D34;
  --green-100: #102B22;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.55);
  --shadow-lg: 0 20px 50px -12px rgba(0,0,0,0.7);
}
:root[data-theme="dark"] body { background: var(--cream); color: var(--ink); }
:root[data-theme="dark"] body:has(.app-shell) { background: var(--cream); }
:root[data-theme="dark"] .card { background: #182823; border-color: var(--line); color: var(--ink); }
:root[data-theme="dark"] .card-title { color: var(--ink-3); }
:root[data-theme="dark"] .card-value, :root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3, :root[data-theme="dark"] h4 { color: var(--gold-300); }
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select, :root[data-theme="dark"] textarea.input {
  background: #1B2A24; color: var(--ink); border-color: var(--line);
}
:root[data-theme="dark"] .input:focus { border-color: var(--gold-500); }
:root[data-theme="dark"] .btn.ghost { background: transparent; color: var(--gold-300); border-color: var(--line-2); }
:root[data-theme="dark"] .btn.ghost:hover { background: rgba(212,174,92,0.08); }
:root[data-theme="dark"] table.data thead { background: #14211C; color: var(--gold-300); }
:root[data-theme="dark"] table.data tbody tr { border-color: var(--line); }
:root[data-theme="dark"] table.data tbody tr:hover { background: rgba(212,174,92,0.05); }
:root[data-theme="dark"] .progress { background: #20302A; }
:root[data-theme="dark"] .badge.neutral { background: #20302A; color: var(--ink-2); border-color: var(--line); }
:root[data-theme="dark"] .skeleton-card { background: linear-gradient(90deg, #14211C 0%, #1A2C25 50%, #14211C 100%); background-size: 200% 100%; }
:root[data-theme="dark"] .modal { background: #182823; color: var(--ink); }
:root[data-theme="dark"] .streak-card { background: #182823 !important; border-color: var(--gold-600) !important; }
:root[data-theme="dark"] .daily-ayah-card { background: linear-gradient(160deg, #06231A 0%, #050F0B 100%); }
:root[data-theme="dark"] .table-wrap { background: #182823; border-color: var(--line); }
:root[data-theme="dark"] .muted { color: var(--ink-3) !important; }
:root[data-theme="dark"] code { background: #20302A; color: var(--gold-300); }

/* ============ ANNOUNCEMENTS BANNER (Phase 6E) ============ */
.announcement-banner {
  background: linear-gradient(135deg, var(--gold-100) 0%, #fff7e0 100%);
  border: 1px solid var(--gold-300);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex; gap: 14px; align-items: flex-start;
  position: relative;
}
:root[data-theme="dark"] .announcement-banner { background: linear-gradient(135deg, #2A2415 0%, #1F1B0F 100%); border-color: var(--gold-600); color: var(--gold-300); }
.announcement-banner__icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  display: grid; place-items: center;
  color: var(--green-900); font-weight: 700;
}
.announcement-banner__title { font-family: 'Cormorant Garamond', serif; color: var(--green-900); font-size: 1.1rem; margin: 0 0 2px; }
:root[data-theme="dark"] .announcement-banner__title { color: var(--gold-300); }
.announcement-banner__body { font-size: 0.88rem; line-height: 1.55; color: var(--ink-2); }
:root[data-theme="dark"] .announcement-banner__body { color: var(--ink-2); }
.announcement-banner__close {
  background: transparent; border: none; padding: 4px 8px; cursor: pointer;
  color: var(--ink-3); font-size: 1.2rem; line-height: 1; border-radius: 6px;
}
.announcement-banner__close:hover { background: rgba(0,0,0,0.06); color: var(--ink); }

/* ============ HALAQAH BADGES (Phase 6E) ============ */
.halaqah-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-100));
  color: var(--green-900); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--gold-500);
}
.halaqah-badge--green { background: linear-gradient(135deg, #B8E5CC, #DAF2E2); border-color: var(--green-500); color: var(--green-900); }
.halaqah-badge--purple { background: linear-gradient(135deg, #DDC8E8, #EDE3F2); border-color: #6B4A85; color: #3D2956; }

/* ============ THEME TOGGLE (in user-card) ============ */
.theme-toggle-btn {
  background: transparent; border: 1px solid rgba(212,174,92,0.3);
  color: var(--gold-300); border-radius: 8px; padding: 6px;
  cursor: pointer; transition: background 0.18s, color 0.18s;
  display: grid; place-items: center;
}
.theme-toggle-btn:hover { background: rgba(212,174,92,0.1); }

/* ============ PAGE-HEADER mobile: tighten top whitespace ============ */
@media (max-width: 720px) {
  .main { padding-top: 14px; }
  .page-header { gap: 8px; }
  .page-header h1 { font-size: 1.4rem !important; line-height: 1.2; margin-top: 2px; }
  .page-header .crumbs { margin-bottom: 2px; font-size: 0.7rem; }
  .page-header .desc { font-size: 0.82rem; line-height: 1.45; }
  .grid.grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid.grid-3 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid.grid-2 { gap: 12px; }
  .card { padding: 16px; }
  .card-value { font-size: 1.6rem; }
  .mt-24 { margin-top: 16px !important; }
}
