/* ==========================================================================
   SEZ Exclusive Portal — Shababul-Eidiz-Zahabi, Kolkata
   Design tokens derived from the jamaat seal: burnished gold on ivory,
   deep olive-ink chrome, engraved hairlines.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Manrope:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  /* Palette */
  --ink:        #14160F;
  --ink-2:      #1D2017;
  --ink-3:      #2A2E21;
  --gold:       #C9A227;
  --gold-lite:  #F0D67C;
  --gold-deep:  #8A6A12;
  --gold-wash:  #FBF3DC;
  --paper:      #FAF7EF;
  --paper-2:    #FFFFFF;
  --text:       #23261C;
  --text-soft:  #6B6F60;
  --text-faint: #9A9D8E;
  --line:       #E3DDC9;
  --line-soft:  #EFEADB;

  --ok:         #2E7D5B;
  --ok-wash:    #E4F1EA;
  --warn:       #B07A16;
  --warn-wash:  #FBF0D6;
  --due:        #B4442E;
  --due-wash:   #F8E7E2;
  --info:       #3A5F7D;
  --info-wash:  #E5EDF3;

  /* Type */
  --display: 'Cormorant Garamond', Georgia, serif;
  --body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Geometry */
  --r:    6px;
  --r-lg: 10px;
  --sidebar: 256px;
  --topbar: 68px;
  --shadow: 0 1px 2px rgba(20,22,15,.05), 0 8px 24px -12px rgba(20,22,15,.14);
  --gold-grad: linear-gradient(135deg, var(--gold-deep) 0%, var(--gold) 38%, var(--gold-lite) 62%, var(--gold) 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------------------- Typography */
h1,h2,h3,h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.display{
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.eyebrow{
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num   { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Engraved rule — the hairline motif borrowed from the seal's border */
.rule{
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}
.rule-gold{
  height: 2px; border: 0; margin: 0;
  background: var(--gold-grad);
  opacity: .55;
}

/* ------------------------------------------------------------------- Shell */
.shell{ display: flex; min-height: 100vh; }

.sidebar{
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--ink);
  color: #D8D9CE;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #000;
}

.sidebar-brand{
  padding: 20px 18px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(201,162,39,.18);
}
.sidebar-brand img, .sidebar-brand svg{ width: 40px; height: 46px; flex: 0 0 auto; }
.sidebar-brand .bt{ line-height: 1.2; }
.sidebar-brand .bt strong{
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--gold-lite);
  letter-spacing: .01em;
}
.sidebar-brand .bt span{
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8A8D7E;
}

.nav{ padding: 14px 10px; overflow-y: auto; flex: 1; }
.nav-group{ margin-bottom: 18px; }
.nav-group > p{
  margin: 0 0 6px 12px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6D7062;
}
.nav a{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  color: #C3C5B8;
  transition: background .15s, color .15s;
  position: relative;
}
.nav a:hover{ background: rgba(255,255,255,.045); color: #EDEEE5; }
.nav a.active{
  background: rgba(201,162,39,.13);
  color: var(--gold-lite);
}
.nav a.active::before{
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-grad);
}
.nav a i{ width: 16px; height: 16px; flex: 0 0 auto; display: inline-flex; }
.nav a i svg{ width: 100%; height: 100%; stroke-width: 1.6; }
.nav .badge-mini{
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(201,162,39,.2);
  color: var(--gold-lite);
}

.sidebar-foot{
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar{
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #241C00;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.sidebar-foot .who{ line-height: 1.25; min-width: 0; }
.sidebar-foot .who b{ display: block; font-size: 12.5px; color: #E7E8DE; font-weight: 600; }
.sidebar-foot .who span{ font-size: 10.5px; color: #838677; }
.sidebar-foot a.out{ margin-left: auto; color: #838677; }
.sidebar-foot a.out:hover{ color: var(--gold-lite); }

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

.topbar{
  height: var(--topbar);
  flex: 0 0 var(--topbar);
  background: rgba(250,247,239,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1{ font-family: var(--display); font-size: 25px; font-weight: 600; }
.topbar .sub{ font-size: 12px; color: var(--text-soft); margin-top: -2px; }
.topbar .spacer{ flex: 1; }
.hijri{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  background: var(--gold-wash);
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.burger{ display: none; background: none; border: 0; padding: 6px; cursor: pointer; }

.content{ padding: 26px; max-width: 1360px; width: 100%; }
.content > * + *{ margin-top: 20px; }

/* ------------------------------------------------------------------ Layout */
.grid{ display: grid; gap: 16px; }
.g2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4{ grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2-1{ grid-template-columns: 2fr 1fr; }
.g-1-2{ grid-template-columns: 1fr 2fr; }
.row{ display: flex; align-items: center; gap: 10px; }
.row-wrap{ flex-wrap: wrap; }
.spacer{ flex: 1; }
.stack{ display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------- Cards */
.card{
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head{
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head h3{ font-size: 14.5px; font-weight: 600; }
.card-head .sub{ font-size: 11.5px; color: var(--text-soft); }
.card-body{ padding: 18px; }
.card-body.tight{ padding: 0; }
.card-foot{
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  background: #FCFBF6;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stat tiles */
.stat{
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px 15px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stat::after{
  content:'';
  position: absolute; inset: 0 0 auto 0;
  height: 2px;
  background: var(--gold-grad);
  opacity: .7;
}
.stat .k{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.stat .v{
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 6px;
  letter-spacing: -.02em;
}
.stat .v small{ font-size: 15px; color: var(--text-soft); font-family: var(--body); font-weight: 500; }
.stat .d{ margin-top: 6px; font-size: 11.5px; color: var(--text-soft); display: flex; gap: 6px; align-items: center; }
.stat .up{ color: var(--ok); font-weight: 600; }
.stat .down{ color: var(--due); font-weight: 600; }

/* ------------------------------------------------------------------ Chips */
.chip{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip::before{ content:''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.plain::before{ display: none; }
.chip-ok  { background: var(--ok-wash);   color: var(--ok);   border-color: #C9E3D6; }
.chip-due { background: var(--due-wash);  color: var(--due);  border-color: #EFCFC6; }
.chip-warn{ background: var(--warn-wash); color: var(--warn); border-color: #EBD9AC; }
.chip-info{ background: var(--info-wash); color: var(--info); border-color: #CBDAE5; }
.chip-mute{ background: #F1F0E8; color: var(--text-soft); border-color: var(--line); }

/* ---------------------------------------------------------------- Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}
.btn:hover{ background: #F7F4EA; border-color: #D6CFB6; }
.btn:active{ transform: translateY(1px); }
.btn svg{ width: 15px; height: 15px; }

.btn-primary{
  background: var(--ink);
  border-color: var(--ink);
  color: var(--gold-lite);
}
.btn-primary:hover{ background: #23271B; border-color: #23271B; }

.btn-gold{
  background: var(--gold-grad);
  border-color: var(--gold-deep);
  color: #2A2000;
  text-shadow: 0 1px 0 rgba(255,255,255,.3);
}
.btn-gold:hover{ filter: brightness(1.05); }

.btn-ghost{ background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover{ background: #F1EFE5; color: var(--text); }

.btn-danger{ color: var(--due); border-color: #EFCFC6; background: var(--due-wash); }
.btn-danger:hover{ background: #F4DBD4; }

.btn-sm{ height: 30px; padding: 0 11px; font-size: 12px; }
.btn-lg{ height: 44px; padding: 0 22px; font-size: 14px; }
.btn-block{ width: 100%; }
.btn:disabled{ opacity: .45; cursor: not-allowed; }

.icon-btn{
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}
.icon-btn:hover{ background: #F1EFE5; color: var(--text); }
.icon-btn svg{ width: 16px; height: 16px; }

/* ----------------------------------------------------------------- Forms */
.field{ display: block; }
.field + .field{ margin-top: 14px; }
.field > label, .lbl{
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--text-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.input, .select, .textarea{
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea{ height: auto; padding: 10px 12px; resize: vertical; min-height: 88px; line-height: 1.5; }
.select{
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236B6F60' stroke-width='1.8'><path d='M3 5.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
.input:focus, .select:focus, .textarea:focus{
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.15);
}
.input::placeholder, .textarea::placeholder{ color: var(--text-faint); }
.hint{ font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }

.search{ position: relative; flex: 1; max-width: 380px; }
.search .input{ padding-left: 34px; }
.search svg{
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

.check{ display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; }
.check input{ margin: 2px 0 0; accent-color: var(--gold-deep); width: 15px; height: 15px; }

.switch{ position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input{ opacity: 0; width: 0; height: 0; }
.switch span{
  position: absolute; inset: 0;
  background: #D9D5C4;
  border-radius: 20px;
  cursor: pointer;
  transition: background .18s;
}
.switch span::before{
  content:'';
  position: absolute;
  width: 15px; height: 15px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + span{ background: var(--gold-deep); }
.switch input:checked + span::before{ transform: translateX(17px); }
.switch input:focus-visible + span{ outline: 2px solid var(--gold); outline-offset: 2px; }

.seg{
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #F4F2E9;
  padding: 3px;
  gap: 3px;
}
.seg button{
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
}
.seg button.on{ background: var(--paper-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.07); }

/* ---------------------------------------------------------------- Tables */
.table-wrap{ width: 100%; overflow-x: auto; }
table.tbl{ width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th{
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  padding: 10px 14px;
  background: #FBF9F2;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl tbody td{
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.tbl tbody tr:last-child td{ border-bottom: 0; }
.tbl tbody tr:hover{ background: #FCFBF5; }
.tbl .r{ text-align: right; }
.tbl .nowrap{ white-space: nowrap; }
.tbl a.link{ color: var(--gold-deep); font-weight: 600; }
.tbl a.link:hover{ text-decoration: underline; }

.person{ display: flex; align-items: center; gap: 10px; }
.person .avatar{ width: 30px; height: 30px; flex: 0 0 30px; font-size: 11px; }
.person b{ display: block; font-size: 13px; font-weight: 600; }
.person span{ font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

.empty{
  padding: 44px 20px;
  text-align: center;
  color: var(--text-soft);
}
.empty h4{ font-family: var(--display); font-size: 19px; margin-bottom: 4px; }
.empty p{ margin: 0 0 14px; font-size: 13px; }

/* ------------------------------------------------------------- Progress */
.bar{ height: 7px; background: #EEEBDD; border-radius: 20px; overflow: hidden; }
.bar > i{ display: block; height: 100%; border-radius: 20px; background: var(--gold-grad); }
.bar > i.ok{ background: linear-gradient(90deg,#3E9271,#2E7D5B); }
.bar > i.over{ background: linear-gradient(90deg,#C9603F,#B4442E); }

/* Bar chart (collections) */
.chart{ display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.chart .col{ flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.chart .stack-b{ width: 100%; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.chart .b{
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--gold-grad);
  min-height: 3px;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
}
.chart .b.b2{ background: #E6E1CD; border-radius: 0 0 3px 3px; }
.chart .lb{ font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
@keyframes rise{ from{ transform: scaleY(0); transform-origin: bottom; } to{ transform: scaleY(1); } }

.legend{ display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-soft); }
.legend i{ width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* Donut */
.donut-wrap{ display: flex; align-items: center; gap: 22px; }
.donut{ position: relative; width: 132px; height: 132px; flex: 0 0 132px; }
.donut svg{ transform: rotate(-90deg); }
.donut .mid{
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.donut .mid b{ font-family: var(--display); font-size: 24px; font-weight: 600; display: block; line-height: 1; }
.donut .mid span{ font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }

/* ------------------------------------------------------------------ Modal */
.modal-bg{
  position: fixed; inset: 0;
  background: rgba(20,22,15,.5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  z-index: 200;
  overflow-y: auto;
}
.modal-bg.open{ display: flex; animation: fade .16s ease both; }
.modal{
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 3px solid transparent;
  border-image: var(--gold-grad) 1;
  border-radius: 2px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 30px 70px -20px rgba(20,22,15,.5);
  animation: pop .2s cubic-bezier(.2,.8,.3,1) both;
}
.modal.wide{ max-width: 860px; }
.modal-head{
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: flex-start; gap: 14px;
}
.modal-head h3{ font-family: var(--display); font-size: 22px; font-weight: 600; }
.modal-head .sub{ font-size: 12.5px; color: var(--text-soft); }
.modal-body{ padding: 22px; }
.modal-foot{
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  background: #FCFBF6;
  display: flex; gap: 10px; justify-content: flex-end;
}
@keyframes fade{ from{ opacity: 0 } to{ opacity: 1 } }
@keyframes pop{ from{ opacity: 0; transform: translateY(-8px) } to{ opacity: 1; transform: none } }

/* ------------------------------------------------------------------ Toast */
.toasts{ position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast{
  background: var(--ink);
  color: #EDEEE4;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  border-left: 3px solid var(--gold);
  max-width: 340px;
  animation: slide .22s cubic-bezier(.2,.8,.3,1) both;
}
.toast b{ color: var(--gold-lite); }
@keyframes slide{ from{ opacity: 0; transform: translateX(16px) } to{ opacity: 1; transform: none } }

/* ------------------------------------------------------ Cartouche (signature) */
/* The scalloped gold frame from the seal, abstracted into a container device.
   Used on the sign-in card and on public event portals. */
.cartouche{
  position: relative;
  background: var(--paper-2);
  padding: 3px;
  background-image: var(--gold-grad);
  border-radius: 22px 22px 22px 22px / 30px 30px 30px 30px;
}
.cartouche > .inner{
  background: var(--paper-2);
  border-radius: 20px / 28px;
  padding: 34px 34px 30px;
  position: relative;
}
.cartouche > .inner::before,
.cartouche > .inner::after{
  content: '';
  position: absolute;
  left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: .35;
}
.cartouche > .inner::before{ top: 12px; }
.cartouche > .inner::after{ bottom: 12px; }

/* ------------------------------------------------------------- Auth page */
.auth{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--paper);
}
.auth-art{
  background: var(--ink);
  color: #D9DACF;
  padding: 48px 54px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-art::before{
  content:'';
  position: absolute;
  width: 620px; height: 620px;
  right: -240px; top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,39,.16), transparent 62%);
}
.auth-art .seal-lg{ width: 168px; height: auto; margin-bottom: 30px; position: relative; }
.auth-art h2{
  font-family: var(--display);
  font-size: 44px;
  font-weight: 600;
  line-height: 1.08;
  color: #F4F3E9;
  max-width: 12ch;
  position: relative;
}
.auth-art p{ max-width: 46ch; color: #A2A497; font-size: 14px; position: relative; }
.auth-art .pts{ margin-top: auto; display: grid; gap: 12px; position: relative; }
.auth-art .pt{ display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: #B9BBAE; }
.auth-art .pt b{ color: var(--gold-lite); font-family: var(--mono); font-size: 11px; padding-top: 1px; }
.auth-form{
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-form .box{ width: 100%; max-width: 400px; }

/* ------------------------------------------------- Public event portal */
.pub{ background: var(--paper); }
.pub-nav{
  height: 74px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 30px;
  background: var(--paper-2);
  position: sticky; top: 0; z-index: 30;
}
.pub-nav img, .pub-nav svg.seal{ height: 48px; width: auto; }
.pub-hero{
  padding: 62px 30px 54px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(201,162,39,.14), transparent 60%),
    var(--paper);
}
.pub-hero .display{ font-size: clamp(34px, 5.4vw, 58px); max-width: 16ch; margin: 14px auto 0; }
.pub-hero p.lede{ max-width: 56ch; margin: 16px auto 0; color: var(--text-soft); font-size: 15px; }
.pub-meta{ display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.pub-meta div{ text-align: center; }
.pub-meta .k{ font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); }
.pub-meta .v{ font-size: 14.5px; font-weight: 600; margin-top: 3px; }
.pub-body{ max-width: 720px; margin: 0 auto; padding: 0 24px 70px; }
.pub-foot{
  border-top: 1px solid var(--line);
  padding: 26px 30px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  background: var(--paper-2);
}

/* ----------------------------------------------------------- Form builder */
.fb-field{
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--paper-2);
  display: flex; align-items: center; gap: 12px;
}
.fb-field + .fb-field{ margin-top: 8px; }
.fb-field .grip{ color: var(--text-faint); cursor: grab; }
.fb-field .meta{ min-width: 0; flex: 1; }
.fb-field .meta b{ display: block; font-size: 13px; }
.fb-field .meta span{ font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

/* -------------------------------------------------------- WhatsApp phone */
.phone{
  width: 300px;
  border: 9px solid #14160F;
  border-radius: 32px;
  background: #ECE4DA;
  padding: 12px 10px 18px;
  box-shadow: var(--shadow);
  margin: 0 auto;
}
.phone .wa-top{
  background: #075E54; color: #fff;
  margin: -12px -10px 12px;
  padding: 10px 12px;
  border-radius: 22px 22px 0 0;
  font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.bubble{
  background: #fff;
  border-radius: 8px 8px 8px 2px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble .var{ background: var(--gold-wash); border-radius: 3px; padding: 0 3px; color: var(--gold-deep); font-weight: 600; }
.bubble .time{ display: block; text-align: right; font-size: 9.5px; color: #98A0A0; margin-top: 4px; }
.bubble-btn{
  margin-top: 6px; background: #fff; border-radius: 8px;
  text-align: center; color: #128C7E; font-size: 12.5px; font-weight: 600;
  padding: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.1);
}

/* ----------------------------------------------------------- Flow / steps */
.flow{ display: grid; gap: 0; }
.flow-step{ display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.flow-step .gut{ display: flex; flex-direction: column; align-items: center; }
.flow-step .dot{
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--gold-deep);
  background: var(--gold-wash);
  color: var(--gold-deep);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  flex: 0 0 26px;
}
.flow-step .ln{ width: 1px; flex: 1; background: var(--line); margin: 4px 0; }
.flow-step:last-child .ln{ display: none; }
.flow-step .bd{ padding-bottom: 20px; }
.flow-step .bd b{ font-size: 13.5px; }
.flow-step .bd p{ margin: 3px 0 0; font-size: 12.5px; color: var(--text-soft); }

/* --------------------------------------------------------- Permission grid */
.perm{ width: 100%; border-collapse: collapse; font-size: 13px; }
.perm th{
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-soft); font-weight: 500;
  padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center;
}
.perm th:first-child{ text-align: left; width: 40%; }
.perm td{ padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.perm td:first-child{ text-align: left; font-weight: 500; }
.perm td:first-child span{ display: block; font-size: 11px; color: var(--text-faint); font-weight: 400; }

/* ------------------------------------------------------------- Utilities */
.mt0{ margin-top: 0 !important; }
.mt8{ margin-top: 8px; } .mt12{ margin-top: 12px; } .mt16{ margin-top: 16px; } .mt24{ margin-top: 24px; }
.mb0{ margin-bottom: 0; } .mb8{ margin-bottom: 8px; } .mb16{ margin-bottom: 16px; }
.tr{ text-align: right; } .tc{ text-align: center; }
.fs12{ font-size: 12px; } .fs13{ font-size: 13px; } .fs15{ font-size: 15px; }
.fw6{ font-weight: 600; } .fw7{ font-weight: 700; }
.hide{ display: none !important; }

/* ---------------------------------------------------------- Responsive */
@media (max-width: 1100px){
  .g4{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-2-1, .g-1-2{ grid-template-columns: 1fr; }
  .auth{ grid-template-columns: 1fr; }
  .auth-art{ display: none; }
}
@media (max-width: 860px){
  .sidebar{
    position: fixed; left: 0; top: 0; z-index: 120;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2,.8,.3,1);
  }
  body.nav-open .sidebar{ transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  body.nav-open::after{
    content:''; position: fixed; inset: 0; background: rgba(20,22,15,.45); z-index: 110;
  }
  .burger{ display: inline-grid; place-items: center; }
  .content{ padding: 18px; }
  .topbar{ padding: 0 16px; }
  .topbar h1{ font-size: 20px; }
  .hijri{ display: none; }
}
@media (max-width: 640px){
  .g2, .g3, .g4{ grid-template-columns: 1fr; }
  .donut-wrap{ flex-direction: column; align-items: flex-start; }
  .modal-foot{ flex-direction: column-reverse; }
  .modal-foot .btn{ width: 100%; }
}

/* ============================================================
   Finance — account cards, balance figures, receipt slip
   ============================================================ */
.acct{
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.acct::before{
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold-grad);
}
.acct.is-cash::before{ background: linear-gradient(90deg, #8A9A5B, #B7C48A); }
.acct .top{ display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.acct .top i{ width: 17px; height: 17px; color: var(--gold-deep); display: block; }
.acct .top i svg{ width: 100%; height: 100%; }
.acct .nm{ font-weight: 650; font-size: 13.5px; letter-spacing: -.01em; }
.acct .bal{
  font-family: var(--display); font-size: 31px; line-height: 1.05;
  letter-spacing: -.015em; color: var(--ink);
}
.acct .sub2{ font-size: 11.5px; color: var(--text-soft); margin-top: 4px; font-family: var(--mono); }
.acct .split{
  display: flex; gap: 18px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft);
}
.acct .split div{ min-width: 0; }
.acct .split .k{ font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }
.acct .split .v{ font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.acct .earmark{
  margin-top: 12px; font-size: 11.5px; color: var(--text-soft);
  background: var(--gold-wash); border: 1px solid #EBDFB8; border-radius: 5px; padding: 6px 9px;
}

.fig{ font-family: var(--display); font-size: 34px; line-height: 1.05; letter-spacing: -.015em; }
.fig.in{ color: #2E7D5B; }
.fig.out{ color: var(--due); }

.flowbar{ display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-soft); }
.flowbar i{ display: block; height: 100%; }
.flowbar .a{ background: var(--gold); }
.flowbar .b{ background: #8A9A5B; }
.legend{ display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-soft); }
.legend span{ display: inline-flex; align-items: center; gap: 6px; }
.legend b{ width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* printable receipt slip */
.slip{
  border: 1px solid var(--line); border-radius: 8px; padding: 26px 28px;
  background: var(--paper); position: relative;
}
.slip .slip-head{ display: flex; align-items: flex-start; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.slip .slip-head img{ height: 58px; }
.slip .amt-box{
  margin: 20px 0; padding: 16px 18px; border: 1px solid #EBDFB8; background: var(--gold-wash);
  border-radius: 6px; display: flex; align-items: baseline; gap: 12px;
}
.slip .words{ font-size: 12.5px; color: var(--text-soft); font-style: italic; }
.slip .sign{
  margin-top: 30px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-faint);
}
.slip .stamp{
  position: absolute; right: 26px; bottom: 58px; transform: rotate(-11deg);
  border: 2px solid var(--gold-deep); color: var(--gold-deep); border-radius: 5px;
  padding: 5px 12px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; opacity: .72;
}

@media print{
  .slip{ border: none; padding: 0; }
  .modal-bg.open{ position: static; background: none; display: block; padding: 0; }
  .modal-bg:not(.open){ display: none !important; }
  .modal{ box-shadow: none; max-height: none; width: 100%; }
  .modal-head, .modal-foot{ display: none !important; }
}

@media print{
  .sidebar, .topbar, .btn, .icon-btn{ display: none !important; }
  .card{ box-shadow: none; break-inside: avoid; }
  body{ background: #fff; }
}
