/* ===========================================================
   إشعار - مدارس  |  Design system (built on the Ishaar identity)
   Brand: indigo #3D3F9E  +  gold accent #F5C24A
   Themeable via --primary* (overridden per school on login)
   =========================================================== */
:root {
  --brand: #38428E;
  --brand-2: #4E5BC4;
  --brand-3: #6E7AD9;
  --accent: #EFCB69;
  --accent-2: #F7DE92;

  /* themeable tokens — schools override these */
  --primary: var(--brand);
  --primary-2: var(--brand-2);
  --primary-3: var(--brand-3);
  --primary-accent: var(--accent);

  --bg: #f5f6fb;
  --bg-2: #eef0f9;
  --surface: #ffffff;
  --surface-2: #f8f9ff;
  --text: #1c2138;
  --text-soft: #5b6178;
  --muted: #939ab4;
  --line: #e7e9f4;
  --line-2: #eceefa;

  --ok: #16a34a;
  --ok-bg: #e8f7ee;
  --warn: #d97706;
  --warn-bg: #fdf3e3;
  --danger: #dc2626;
  --danger-bg: #fdeaea;
  --info: #2563eb;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 8px rgba(40, 44, 95, .06);
  --shadow: 0 12px 30px -12px rgba(40, 44, 95, .18);
  --shadow-lg: 0 26px 60px -22px rgba(40, 44, 95, .32);
  --ring: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);

  --sidebar-w: 270px;
  font-family: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
/* Baseline icon size — prevents 0×0 inline SVGs; more specific rules override this */
svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-icon svg { width: 19px; height: 19px; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d8ec; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2c7e3; }

/* ---------------- utilities ---------------- */
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.grow { flex: 1; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.text-soft { color: var(--text-soft); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .ltr { direction: ltr; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: 14px;
  font-weight: 700; font-size: .95rem; background: var(--surface-2); color: var(--text);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, filter .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 19px; height: 19px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--primary) 75%, transparent);
}
.btn-primary:hover { box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--primary) 80%, transparent); filter: brightness(1.04); }
.btn-accent { background: linear-gradient(135deg, var(--primary-accent), var(--accent-2)); color: #4a3b00; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #fadddd; }
.btn-sm { padding: 7px 13px; font-size: .82rem; border-radius: 11px; }
.btn-icon { padding: 9px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px;
}
.card-pad-0 { padding: 0; overflow: hidden; }
.card-title { font-size: 1.05rem; font-weight: 800; margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------------- badges / chips ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: #e8effd; color: var(--info); }
.badge-soft { background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------------- inputs ---------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-weight: 700; font-size: .86rem; color: var(--text-soft); }
.field .hint { font-size: .76rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px;
  background: var(--surface-2); color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--ring);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }

/* ---------------- table ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: right; font-weight: 700; color: var(--text-soft); padding: 13px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }

/* ---------------- toast ---------------- */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9000; display: flex; flex-direction: column; gap: 10px; width: min(420px, 92vw); }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-right: 5px solid var(--primary);
  border-radius: 14px; padding: 13px 16px; box-shadow: var(--shadow); display: flex; gap: 11px; align-items: center;
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.3);
}
.toast.ok { border-right-color: var(--ok); }
.toast.err { border-right-color: var(--danger); }
.toast .ti { width: 22px; height: 22px; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------------- modal ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(22,26,55,.45); backdrop-filter: blur(4px); z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .2s ease; }
.modal { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 92vh; overflow: auto; animation: modalIn .3s cubic-bezier(.2,.9,.3,1.2); }
.modal.lg { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; position: sticky; bottom: 0; background: var(--surface); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===========================================================
   LOGIN
   =========================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-art {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, var(--brand-3) 0%, var(--brand-2) 38%, var(--brand) 100%);
  display: flex; flex-direction: column; justify-content: center; padding: 56px;
}
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.auth-art::before { width: 380px; height: 380px; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); top: -120px; left: -90px; animation: float1 9s ease-in-out infinite; }
.auth-art::after { width: 260px; height: 260px; background: radial-gradient(circle, var(--accent), transparent 70%); bottom: -70px; right: -40px; opacity: .4; animation: float2 11s ease-in-out infinite; }
.auth-art .art-brand { display: flex; align-items: center; gap: 16px; position: relative; }
.auth-art .art-badge { width: 78px; height: 78px; border-radius: 22px; background: #fff; display: grid; place-items: center; box-shadow: 0 16px 32px -12px rgba(0,0,0,.35); animation: floatLogo 5s ease-in-out infinite; flex-shrink: 0; }
.auth-art .art-badge img { width: 52px; height: 52px; object-fit: contain; }
.auth-art .art-name { font-size: 1.9rem; font-weight: 900; line-height: 1; }
.auth-art .art-sub { font-size: 1rem; font-weight: 700; opacity: .9; margin-top: 4px; letter-spacing: .12em; }
.auth-art h1 { font-size: 2.4rem; font-weight: 800; margin: 30px 0 10px; line-height: 1.25; position: relative; }
.auth-art p { font-size: 1.08rem; opacity: .92; max-width: 460px; position: relative; }
.auth-feats { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; position: relative; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-feat .fi { width: 42px; height: 42px; border-radius: 13px; background: rgba(255,255,255,.16); display: grid; place-items: center; backdrop-filter: blur(4px); }
.auth-feat svg { width: 22px; height: 22px; }

.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 24px 28px; background: var(--surface); overflow-y: auto; }
.auth-form { width: min(380px, 100%); animation: rise .6s ease both; }
.auth-form .form-logo { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 14px; }
.auth-form .form-logo img { width: 48px; height: 48px; object-fit: contain; animation: floatLogo 5s ease-in-out infinite; }
.auth-form .form-logo b { font-size: 1.15rem !important; }
.auth-form h2 { font-size: 1.4rem; margin: 0 0 4px; font-weight: 800; }
.auth-form .sub { color: var(--text-soft); margin-bottom: 16px; font-size: .9rem; }
.auth-form .field { margin-bottom: 12px; }
.demo-hint { margin-top: 22px; padding: 13px 15px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 13px; font-size: .82rem; color: var(--text-soft); }
.demo-hint b { color: var(--text); }

@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,26px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-26px,-20px)} }
@keyframes floatLogo { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-12px) rotate(-3deg)} }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===========================================================
   APP SHELL
   =========================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
/* scrim must always be out of grid flow (fixed), only visible when toggled */
.scrim { position: fixed; inset: 0; background: rgba(22,26,55,.4); z-index: 150; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }

.sidebar {
  background: var(--surface); border-left: 1px solid var(--line);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand .bt { font-weight: 800; font-size: 1.05rem; line-height: 1.15; }
.brand .bs { font-size: .72rem; color: var(--muted); font-weight: 600; }
.nav-label { font-size: .7rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 13px;
  color: var(--text-soft); font-weight: 700; font-size: .92rem; transition: background .15s, color .15s; position: relative;
}
.nav-item svg { width: 21px; height: 21px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, #fff), color-mix(in srgb, var(--primary) 6%, #fff)); color: var(--primary); }
.nav-item.active::before { content: ''; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); width: 4px; height: 60%; background: var(--primary); border-radius: 4px; }
.nav-badge { margin-inline-start: auto; background: var(--primary); color: #fff; font-size: .68rem; padding: 1px 8px; border-radius: 999px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 12px 22px;
}
.topbar h1 { font-size: 1.18rem; font-weight: 800; margin: 0; }
.hamburger { display: none; }
.wallet-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, #fff), color-mix(in srgb, var(--primary-accent) 14%, #fff));
  border: 1px solid var(--line); font-weight: 800;
}
.wallet-pill .wv { color: var(--primary); }
.wallet-pill svg { width: 19px; height: 19px; color: var(--primary); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); flex-shrink: 0; }
.usermenu { position: relative; }
.menu-pop { position: absolute; top: 52px; left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); padding: 8px; min-width: 200px; z-index: 60; animation: rise .2s ease; }
.menu-pop .mi { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.menu-pop .mi:hover { background: var(--surface-2); }
.menu-pop .mi svg { width: 18px; height: 18px; }

.content { padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; animation: pageIn .4s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* page header */
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.page-head p { color: var(--text-soft); margin: 0; }

/* ---------------- stat cards ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .si { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; }
.stat .si svg { width: 24px; height: 24px; }
.stat .sv { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat .sl { color: var(--text-soft); font-size: .88rem; margin-top: 6px; }
.si.i1 { background: color-mix(in srgb, var(--primary) 14%, #fff); color: var(--primary); }
.si.i2 { background: var(--accent-2); color: #7a5a00; }
.si.i3 { background: var(--ok-bg); color: var(--ok); }
.si.i4 { background: #e8effd; color: var(--info); }

/* wallet hero */
.wallet-hero {
  background: radial-gradient(120% 140% at 100% 0%, var(--primary-3) 0%, var(--primary-2) 45%, var(--primary) 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 26px; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.wallet-hero::after { content:''; position:absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--primary-accent), transparent 70%); opacity: .3; top: -60px; left: -30px; }
.wallet-hero .wl { opacity: .9; font-weight: 600; }
.wallet-hero .wb { font-size: 2.7rem; font-weight: 800; margin: 6px 0; }
.wallet-hero .wmeta { display: flex; gap: 22px; flex-wrap: wrap; opacity: .92; font-size: .9rem; position: relative; }
.wallet-hero .wmeta span { display: inline-flex; align-items: center; gap: 7px; }
.wallet-hero .wmeta svg { width: 18px; height: 18px; flex-shrink: 0; }

/* grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* list item card (templates/groups) */
.lcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s; display: flex; flex-direction: column; gap: 10px; }
.lcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lcard h4 { margin: 0; font-size: 1.02rem; font-weight: 800; }
.lcard .body { color: var(--text-soft); font-size: .88rem; flex: 1; }
.lcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* alert banner (wallet usage) */
.alert-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.alert-banner .ab-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.alert-banner .ab-ic svg { width: 22px; height: 22px; }
.alert-banner.danger { background: linear-gradient(135deg, #fdeaea, #fff); border: 1.5px solid #f6c2c2; color: var(--danger); animation: pulseDanger 2s ease-in-out infinite; }
.alert-banner.danger .ab-ic { background: var(--danger); color: #fff; }
.alert-banner.warn { background: linear-gradient(135deg, var(--warn-bg), #fff); border: 1.5px solid #f3d9a8; color: var(--warn); }
.alert-banner.warn .ab-ic { background: var(--warn); color: #fff; }
.alert-banner b { color: inherit; }
@keyframes pulseDanger { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.18); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }

/* empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; opacity: .35; margin-bottom: 12px; }
.empty h3 { color: var(--text-soft); margin: 0 0 6px; }

/* chart */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-radius: 8px 8px 4px 4px; min-height: 6px; position: relative; transition: height .6s cubic-bezier(.2,.9,.3,1); }
.bars .bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.bars .bar b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--text-soft); font-weight: 700; }

/* wizard / stepper */
.steps { display: flex; gap: 8px; margin-bottom: 24px; }
.step { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.step .sline { height: 5px; border-radius: 4px; background: var(--line); transition: background .3s; }
.step.active .sline, .step.done .sline { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.step .stext { font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.step.active .stext, .step.done .stext { color: var(--primary); }
.step .snum { width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--muted); display: grid; place-items: center; font-size: .72rem; }
.step.active .snum, .step.done .snum { background: var(--primary); color: #fff; }

/* selectable option tiles */
.opt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.opt-tile { border: 1.5px solid var(--line); border-radius: 15px; padding: 16px; cursor: pointer; transition: all .15s; background: var(--surface); display: flex; gap: 12px; align-items: center; }
.opt-tile:hover { border-color: var(--primary-3); background: var(--surface-2); }
.opt-tile.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); box-shadow: var(--ring); }
.opt-tile .oi { width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.opt-tile .ot { font-weight: 800; font-size: .92rem; }
.opt-tile .od { font-size: .76rem; color: var(--muted); }

/* checkbox list (recipients) */
.pick-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: var(--surface-2); }
.pick-row.sel { background: color-mix(in srgb, var(--primary) 7%, #fff); }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex-shrink: 0; transition: all .15s; }
.pick-row.sel .chk { background: var(--primary); border-color: var(--primary); }
.chk svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: opacity .15s; }
.pick-row.sel .chk svg { opacity: 1; }

/* message preview bubble */
.wa-preview { background: #e6ddd1; border-radius: 16px; padding: 18px; background-image: linear-gradient(rgba(229,221,209,.6),rgba(229,221,209,.6)); }
.wa-bubble { background: #fff; border-radius: 4px 14px 14px 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.12); max-width: 85%; position: relative; white-space: pre-wrap; font-size: .92rem; }
.wa-bubble .wa-head { font-weight: 800; margin-bottom: 5px; }
.wa-bubble .wa-foot { color: #667781; font-size: .76rem; margin-top: 6px; }
.wa-bubble .wa-btns { margin-top: 10px; border-top: 1px solid #eef; padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.wa-bubble .wa-btn { color: #1da3e8; text-align: center; font-weight: 700; font-size: .86rem; padding: 6px; }
.wa-time { color: #667781; font-size: .66rem; text-align: left; margin-top: 4px; }
.var-pill { background: color-mix(in srgb, var(--primary) 14%, #fff); color: var(--primary); padding: 0 6px; border-radius: 6px; font-weight: 700; }

/* segmented */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; padding: 8px 16px; border-radius: 10px; font-weight: 700; color: var(--text-soft); font-size: .86rem; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--bg-2) 25%, #f0f1fa 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* footer */
.app-footer { text-align: center; padding: 22px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); margin-top: auto; }
.app-footer a { color: var(--primary); font-weight: 700; }
.app-footer .ej { display: inline-flex; align-items: center; gap: 6px; }

/* color swatch input */
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 46px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: none; padding: 3px; cursor: pointer; }

/* mobile bottom nav */
.botnav { display: none; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1024px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form .form-logo { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 14px; }
  .auth-form .form-logo img { width: 52px; animation: floatLogo 5s ease-in-out infinite; }
  .auth-form { text-align: center; }
  .auth-form .field { text-align: right; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; right: 0; top: 0; z-index: 200; width: 280px; height: 100vh;
    transform: translateX(100%); transition: transform .3s cubic-bezier(.3,.8,.3,1); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(22,26,55,.4); z-index: 150; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .hamburger { display: inline-grid; }
  .content { padding: 16px 14px 90px; }
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 1.05rem; }
  .wallet-pill .wlbl { display: none; }

  /* bottom nav for the most-used actions */
  .botnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .botnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: .64rem; font-weight: 700; padding: 4px 10px; border-radius: 12px; flex: 1; }
  .botnav a svg { width: 23px; height: 23px; }
  .botnav a.active { color: var(--primary); }
  .botnav a.fab { transform: translateY(-14px); }
  .botnav a.fab .fb { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 22px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
  .botnav a.fab .fb svg { width: 27px; height: 27px; }

  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .stat .sv { font-size: 1.6rem; }
  .wallet-hero .wb { font-size: 2.1rem; }
  .page-head h2 { font-size: 1.3rem; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 15px; }
  .stat .si { width: 38px; height: 38px; margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .05s !important; }
}
