/* =========================================================
   BSRJM · Refined Design System
   Deep emerald · Warm gold · Cream paper · Islamic geometry
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=Amiri:wght@400;700&display=swap');

:root {
  /* Brand */
  --emerald-950: #082a20;
  --emerald-900: #0b3a2c;
  --emerald-800: #0f4c3a;
  --emerald-700: #156d51;
  --emerald-600: #1f8a66;
  --emerald-500: #2fa17b;
  --emerald-300: #87c9b3;
  --emerald-100: #d6ece2;
  --emerald-50:  #ecf6f1;

  --gold-700: #a4843e;
  --gold-600: #b8943f;
  --gold-500: #c9a352;
  --gold-400: #d6b46f;
  --gold-300: #e3c995;
  --gold-100: #f7ecd3;
  --gold-50:  #fbf6e9;

  /* Surfaces */
  --cream:    #faf7f2;
  --paper:    #ffffff;
  --paper-2:  #fdfcf8;
  --line:     #e8e2d4;
  --line-2:   #efeadd;

  /* Ink */
  --ink-1: #1a2724;
  --ink-2: #36504a;
  --ink-3: #5f7670;
  --ink-4: #8c9d99;
  --ink-5: #b8c4c1;

  /* Status */
  --ok:    #2fa17b;
  --warn:  #c9a352;
  --danger:#b73a3a;
  --info:  #2c7aa8;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(10, 40, 30, .06), 0 1px 1px rgba(10, 40, 30, .04);
  --sh-2: 0 4px 12px rgba(10, 40, 30, .07), 0 2px 4px rgba(10, 40, 30, .04);
  --sh-3: 0 10px 30px rgba(10, 40, 30, .10), 0 4px 10px rgba(10, 40, 30, .06);
  --sh-glow: 0 0 0 4px rgba(31, 138, 102, .12);

  /* Radii */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 20px;
  --r-pill: 999px;

  /* Type */
  --font-sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-arabic: 'Amiri', 'Scheherazade', serif;
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.55;
  color: var(--ink-1);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(201, 163, 82, .08) 0%, transparent 35%),
    radial-gradient(circle at 92% 110%, rgba(15, 76, 58, .06) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.has-bottom-nav { padding-bottom: 92px; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  color: var(--ink-1);
}
h1 { font-size: 1.7rem; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
p { margin: 0 0 .8em; }

a { color: var(--emerald-700); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--emerald-600); }
::selection { background: var(--gold-300); color: var(--ink-1); }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px 28px;
}
@media (min-width: 900px) {
  .container { max-width: 960px; padding: 18px 20px 32px; }
}

/* TOPNAV */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--emerald-900) 0%, var(--emerald-800) 100%);
  color: #fff;
  padding: 10px 0;
  box-shadow: var(--sh-2);
}
.topnav .container { display: flex; align-items: center; gap: 10px; padding-top: 0; padding-bottom: 0; }
.topnav .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: 1; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem;
  color: var(--emerald-900);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.18);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-family: var(--font-serif); font-size: 1.02rem; letter-spacing: .08em; line-height: 1.1; }
.brand-text small { font-size: .68rem; color: var(--gold-300); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-actions a, .nav-actions button {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: .8rem; cursor: pointer; font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.nav-actions a:hover, .nav-actions button:hover { background: rgba(255,255,255,.16); color: #fff; }

.bell-btn {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff; cursor: pointer; text-decoration: none;
  transition: background .15s ease;
}
.bell-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.bell-btn .dot {
  position: absolute; top: 4px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--gold-500); color: var(--emerald-950);
  border-radius: var(--r-pill);
  font-size: .62rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--emerald-900);
}

.header-strip {
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--gold-500) 0 12px, var(--gold-700) 12px 24px, var(--gold-500) 24px 36px);
  position: relative;
}
.header-strip::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { background-position: -200% 0; } 50% { background-position: 200% 0; } }

/* PAGE HEAD */
.page-head { margin: 16px 4px 18px; }
.page-head h1 { margin: 0 0 4px; }
.greet { color: var(--ink-3); font-size: .9rem; margin: 0; }
.crumbs {
  font-size: .76rem;
  color: var(--ink-4);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--emerald-700); }

/* CARDS */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--sh-2); }
.card h3 { margin: 0 0 12px; }
.card .divider { border-top: 1px solid var(--line-2); margin: 12px -18px; padding-top: 12px; }

/* STATS */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.card-stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 14px 16px;
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
}
.card-stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-500), var(--emerald-700));
}
.card-stat .label {
  font-size: .72rem;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}
.card-stat .value {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--emerald-800);
  margin-top: 4px;
  line-height: 1.1;
}
.card-stat .sub { font-size: .7rem; color: var(--ink-4); margin-top: 4px; }
.card-stat.accent-gold .value    { color: var(--gold-700); }
.card-stat.accent-emerald .value { color: var(--emerald-700); }
.card-stat.accent-danger .value  { color: var(--danger); }

/* FEATURE TILES */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}
.feature-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px 10px 14px;
  text-align: center;
  color: var(--ink-1);
  text-decoration: none;
  box-shadow: var(--sh-1);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
  overflow: hidden;
}
.feature-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: var(--gold-300);
  color: var(--ink-1);
}
.feature-tile .icon {
  font-size: 1.7rem;
  margin-bottom: 6px;
  line-height: 1;
}
.feature-tile .label {
  font-weight: 600;
  font-size: .88rem;
  color: var(--emerald-800);
}
.feature-tile .sub {
  font-size: .7rem;
  color: var(--ink-4);
  margin-top: 2px;
}
.feature-tile.highlight {
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  border-color: var(--emerald-900);
  color: #fff;
}
.feature-tile.highlight .label { color: #fff; }
.feature-tile.highlight .sub   { color: var(--gold-300); }
.feature-tile.gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border-color: var(--gold-700);
}
.feature-tile.gold .label, .feature-tile.gold .sub { color: var(--emerald-950); }
.feature-tile .badge-dot {
  position: absolute; top: 8px; right: 8px;
  background: var(--danger); color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  font-size: .62rem; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(183, 58, 58, .35);
}

/* PROFILE CARD */
.profile-card {
  background: linear-gradient(135deg, var(--emerald-800) 0%, var(--emerald-700) 60%, var(--emerald-600) 100%);
  color: #fff;
  border-radius: var(--r-4);
  padding: 24px 20px;
  text-align: center;
  margin: 4px 0 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-3);
}
.profile-card::before, .profile-card::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.profile-card::before {
  width: 220px; height: 220px;
  top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(201,163,82,.35) 0%, transparent 60%);
}
.profile-card::after {
  width: 180px; height: 180px;
  bottom: -100px; left: -60px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 60%);
}
.profile-card > * { position: relative; z-index: 1; }
.profile-card h2 {
  color: #fff; font-size: 1.5rem; margin: 6px 0 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.profile-card .meta {
  color: var(--gold-300);
  font-size: .82rem;
  letter-spacing: .03em;
}
.profile-card .avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--emerald-900);
  font-family: var(--font-serif);
  font-weight: 700; font-size: 2.3rem;
  display: grid; place-items: center;
  margin: 0 auto 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25), inset 0 -2px 4px rgba(0,0,0,.15);
  border: 3px solid rgba(255,255,255,.18);
}
.avatar-img {
  width: 86px; height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-300);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  margin: 0 auto 8px; display: block;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .9rem; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--sh-glow); }
.btn-sm { padding: 7px 13px; font-size: .8rem; }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, var(--emerald-700) 0%, var(--emerald-800) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 76, 58, .25), inset 0 -1px 0 rgba(0,0,0,.15);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--emerald-600) 0%, var(--emerald-700) 100%); color: #fff; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-500) 0%, var(--gold-600) 100%);
  color: var(--emerald-950);
  box-shadow: 0 2px 6px rgba(201, 163, 82, .35), inset 0 -1px 0 rgba(0,0,0,.12);
}
.btn-gold:hover { background: linear-gradient(180deg, var(--gold-400) 0%, var(--gold-500) 100%); color: var(--emerald-950); }
.btn-outline {
  background: var(--paper);
  border-color: var(--line);
  color: var(--emerald-800);
}
.btn-outline:hover { border-color: var(--emerald-700); color: var(--emerald-700); background: var(--emerald-50); }
.btn-ghost { background: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink-1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a23232; color: #fff; }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1faa53; color: #fff; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: .8rem; font-weight: 500; color: var(--ink-2);
}
.form-group input, .form-group select, .form-group textarea,
input.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: .95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--ink-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 0;
  border-color: var(--emerald-600);
  box-shadow: var(--sh-glow);
}
.form-group input[readonly] { background: var(--cream); color: var(--ink-3); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .form-row.cols-3 { grid-template-columns: 1fr 1fr; } }

.segmented {
  display: inline-flex;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
}
.segmented input[type=radio] { display: none; }
.segmented label, .segmented button {
  border: 0; background: transparent;
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: .82rem; font-family: inherit;
  color: var(--ink-3); cursor: pointer; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.segmented input[type=radio]:checked + label,
.segmented button.active {
  background: var(--paper); color: var(--emerald-800);
  box-shadow: var(--sh-1);
}

.pill-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pill {
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-3);
  transition: all .12s ease;
  user-select: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.pill:hover { border-color: var(--ink-4); }
.pill.active { background: var(--emerald-700); color: #fff; border-color: var(--emerald-700); }
.pill.active.danger { background: var(--danger); border-color: var(--danger); }
.pill.active.warn { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.pill.active.info { background: var(--info); border-color: var(--info); }

/* TABLES */
.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--sh-1);
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%; border-collapse: collapse;
  font-size: .9rem; min-width: 480px;
}
table.data th {
  background: var(--paper-2);
  text-align: left;
  padding: 11px 14px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--cream); }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 600;
  letter-spacing: .02em;
  background: var(--cream); color: var(--ink-3);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-active   { background: var(--emerald-100); color: var(--emerald-800); border-color: var(--emerald-300); }
.badge-pending  { background: #fce9e9; color: #8a2a2a; border-color: #f0c8c8; }
.badge-inactive { background: #f0f0f0; color: #6a6a6a; border-color: #d8d8d8; }
.badge-rejected { background: #f0d8d8; color: #8a2a2a; border-color: #e0b8b8; }
.badge-suspended{ background: #ffe6c6; color: #8a5a1f; border-color: #f0c98a; }
.badge-normal   { background: var(--cream); color: var(--ink-3); }
.badge-important{ background: var(--gold-100); color: var(--gold-700); border-color: var(--gold-300); }
.badge-urgent   { background: #fce0e0; color: #a02828; border-color: #f0bcbc; }
.badge-superadmin { background: var(--emerald-100); color: var(--emerald-800); }
.badge-admin    { background: var(--gold-100); color: var(--gold-700); }
.badge-staff    { background: #e1edf6; color: #2c5d80; border-color: #b6d4eb; }
.badge-student  { background: var(--cream); color: var(--ink-3); }
.badge-present  { background: var(--emerald-100); color: var(--emerald-800); }
.badge-absent   { background: #fce9e9; color: #8a2a2a; }
.badge-late     { background: var(--gold-100); color: var(--gold-700); }
.badge-excused  { background: #e1edf6; color: #2c5d80; }

/* ALERTS */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-3);
  margin-bottom: 14px;
  font-size: .9rem;
  border: 1px solid;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideDown .3s ease;
}
.alert::before { font-family: serif; font-size: 1.1rem; line-height: 1; }
.alert-success { background: var(--emerald-50); color: var(--emerald-800); border-color: var(--emerald-300); }
.alert-success::before { content: '✓'; color: var(--emerald-600); }
.alert-error   { background: #fce9e9; color: #8a2a2a; border-color: #f0bcbc; }
.alert-error::before { content: '!'; color: var(--danger); font-weight: bold; }
.alert-info    { background: #e1edf6; color: #2c5d80; border-color: #b6d4eb; }
.alert-info::before { content: 'i'; color: var(--info); font-weight: bold; font-style: italic; }
@keyframes slideDown {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* LIST ITEMS */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.card .list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.card .list-item:first-child { padding-top: 0; }
.list-item.card { display: flex; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-3); margin-bottom: 10px; }
.li-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--emerald-50);
  color: var(--emerald-800);
  display: grid; place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  font-weight: 600;
}
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 500; color: var(--ink-1); font-size: .94rem; margin-bottom: 1px; }
.li-meta  { font-size: .76rem; color: var(--ink-4); letter-spacing: .01em; }

.info-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 9px 0;
  gap: 14px;
  font-size: .92rem;
  border-bottom: 1px dashed var(--line);
}
.info-row:last-child { border-bottom: 0; }
.info-row b { color: var(--ink-2); font-weight: 600; }
.info-row > span:last-child { text-align: right; color: var(--ink-1); }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 40;
  box-shadow: 0 -2px 14px rgba(10, 40, 30, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px 10px;
  color: var(--ink-4);
  font-size: .66rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color .15s ease;
}
.bottom-nav a .ic {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 2px;
  filter: grayscale(.3);
  transition: filter .15s ease, transform .15s ease;
}
.bottom-nav a.active { color: var(--emerald-800); }
.bottom-nav a.active .ic { filter: none; transform: translateY(-1px); }
.bottom-nav a.active::before {
  content: ''; position: absolute; top: 0;
  width: 28px; height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--emerald-700));
  border-radius: 0 0 4px 4px;
}
.bottom-nav .nav-badge {
  position: absolute; top: 4px; left: 50%; margin-left: 4px;
  min-width: 14px; height: 14px; padding: 0 4px;
  background: var(--danger); color: #fff;
  border-radius: var(--r-pill);
  font-size: .58rem; font-weight: 700;
  display: grid; place-items: center;
}

/* EMPTY */
.empty {
  text-align: center;
  padding: 36px 18px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--r-3);
  margin: 14px 0;
}
.empty .ic { font-size: 2.4rem; margin-bottom: 8px; opacity: .55; }
.empty h3 { color: var(--ink-3); font-weight: 500; }
.empty p  { color: var(--ink-4); font-size: .88rem; max-width: 340px; margin: 4px auto 0; }

/* PRAYER ROW */
.prayer-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.prayer-row select { font-size: .82rem; padding: 8px 6px; border-radius: var(--r-2); }
@media (max-width: 560px) {
  .prayer-row { gap: 5px; }
  .prayer-row select { font-size: .74rem; padding: 7px 4px; }
}

/* PROGRESS BAR */
.progress {
  height: 8px;
  background: var(--line-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin: 6px 0;
}
.progress > .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-700), var(--gold-500));
  border-radius: inherit;
  transition: width .6s ease;
}

/* ORNAMENTS */
.ornament {
  text-align: center;
  color: var(--gold-500);
  letter-spacing: 1.2em;
  font-size: .9rem;
  margin: 18px 0 12px;
  opacity: .8;
}
.ornament::before, .ornament::after { content: '⋆'; margin: 0 8px; }

/* HERO */
.hero {
  text-align: center;
  padding: 32px 16px 20px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--cream) 100%);
  border-radius: var(--r-4);
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold-500), var(--emerald-700), var(--gold-500));
}
.hero .pre {
  display: inline-block;
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--emerald-700);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: 2rem;
  color: var(--emerald-900);
  margin: 6px 0;
}
.hero .lede {
  color: var(--ink-3);
  font-size: 1rem;
  max-width: 500px;
  margin: 6px auto 14px;
}

/* AUTH */
.auth-card {
  max-width: 440px;
  margin: 18px auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  padding: 24px;
  box-shadow: var(--sh-3);
}
.auth-card .auth-logo { text-align: center; margin-bottom: 14px; }
.auth-card .auth-logo .mark {
  width: 56px; height: 56px;
  margin: 0 auto 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  color: var(--gold-300);
  border-radius: 14px;
  font-family: var(--font-serif);
  font-size: 1.8rem; font-weight: 700;
  box-shadow: var(--sh-2);
}
.role-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--cream);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 18px;
}
.role-tabs input[type=radio] { display: none; }
.role-tabs label {
  text-align: center;
  padding: 9px 4px;
  border-radius: var(--r-pill);
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s ease;
}
.role-tabs input[type=radio]:checked + label {
  background: var(--paper);
  color: var(--emerald-800);
  box-shadow: var(--sh-1);
}

/* EVENT CARD */
.event-card {
  display: flex; gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--sh-1);
  align-items: center;
}
.event-card .date-block {
  width: 56px; flex-shrink: 0; text-align: center;
  background: linear-gradient(180deg, var(--emerald-700), var(--emerald-800));
  color: #fff;
  border-radius: var(--r-2);
  padding: 8px 4px;
  box-shadow: var(--sh-1);
}
.event-card .date-block.holiday   { background: linear-gradient(180deg, #b73a3a, #8a2a2a); }
.event-card .date-block.exam      { background: linear-gradient(180deg, var(--gold-500), var(--gold-700)); color: var(--emerald-950); }
.event-card .date-block.exam .m   { color: var(--emerald-900); }
.event-card .date-block.celebration { background: linear-gradient(180deg, #d68e3c, #b07023); }
.event-card .date-block .d {
  font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 700; line-height: 1;
}
.event-card .date-block .m {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 2px;
  color: var(--gold-300);
}
.event-card .ev-body { flex: 1; min-width: 0; }
.event-card .ev-title { font-weight: 600; color: var(--ink-1); margin: 0 0 2px; font-size: .95rem; }
.event-card .ev-meta  { font-size: .76rem; color: var(--ink-4); }

/* NOTIFICATIONS */
.notif {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  text-decoration: none;
  color: var(--ink-1);
  transition: background .12s ease;
}
.notif:hover { background: var(--cream); color: var(--ink-1); }
.notif.unread { background: var(--emerald-50); }
.notif.unread:hover { background: var(--emerald-100); }
.notif .n-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-100); color: var(--gold-700);
  font-size: 1rem;
}
.notif.unread .n-icon { background: var(--emerald-700); color: var(--gold-300); }
.notif .n-body { flex: 1; min-width: 0; }
.notif .n-title { font-weight: 500; font-size: .92rem; }
.notif .n-text  { font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.notif .n-time  { font-size: .68rem; color: var(--ink-4); margin-top: 4px; }

/* CHARTS */
.chart-wrap {
  position: relative;
  height: 220px;
  margin-top: 6px;
}
.chart-wrap.tall { height: 280px; }

/* CALENDAR (mini) */
.cal-mini { width: 100%; border-collapse: collapse; }
.cal-mini th { font-size: .68rem; font-weight: 500; color: var(--ink-4); padding: 6px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-mini td { text-align: center; padding: 0; height: 36px; vertical-align: middle; }
.cal-mini td .day {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: .82rem;
  color: var(--ink-2);
  position: relative;
}
.cal-mini td .day.today { background: var(--emerald-700); color: #fff; font-weight: 600; }
.cal-mini td .day.has { color: var(--gold-700); font-weight: 600; }
.cal-mini td .day.has::after {
  content: ''; position: absolute; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-500);
}
.cal-mini td .day.off { color: var(--ink-5); }

/* HIJRI DATE STRIP */
.date-strip {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
}
.date-strip .greg { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; }
.date-strip .hijri { font-family: var(--font-arabic); color: var(--emerald-700); font-size: .95rem; }
.date-strip .day-of-week { color: var(--ink-4); font-size: .8rem; }

/* HELPERS */
.text-muted   { color: var(--ink-4); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-emerald { color: var(--emerald-700); }
.text-gold    { color: var(--gold-700); }
.text-danger  { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 20px; }
.row-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { border-top: 1px solid var(--line-2); margin: 12px 0; }
.small { font-size: .8rem; }
.tiny  { font-size: .72rem; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
@media (max-width: 700px) { .hide-mobile { display: none !important; } }
@media (min-width: 701px) { .show-mobile { display: none !important; } }

/* PRINT */
@media print {
  body { background: #fff; padding-bottom: 0 !important; }
  .topnav, .header-strip, .bottom-nav, .no-print { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .profile-card { background: #f4f1e9 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card, .feature-tile, .stat-grid > *, .empty, .event-card { animation: fadeIn .3s ease both; }

.skel {
  background: linear-gradient(90deg, var(--line-2) 0%, var(--paper-2) 50%, var(--line-2) 100%);
  background-size: 200% 100%;
  animation: skel 1.5s ease-in-out infinite;
  border-radius: var(--r-2);
  display: block;
}
@keyframes skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
