/* ============================================================
   RAHMA PRMS — style.css
   Order: tokens → reset → base → layout → components → sections
   Font: Sora. Palette: institutional plum + status semantics.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* plum ramp */
  --plum-900: #2a0230;
  --plum-800: #180118;
  --plum-700: #4a0f42;
  --plum-600: #5a1150;
  --plum-500: #7a2e6e;
  --plum-400: #8f3d86;
  --plum-300: #d489cf;
  --plum-200: #e6c9e2;
  --plum-100: #f3e7f2;
  --plum-50:  #faf5f9;

  /* neutrals */
  --ink:      #1c1622;
  --body:     #2c2733;
  --muted:    #6d6675;
  --muted-2:  #8b8494;
  --line:     #ecdfec;
  --line-2:   #e4dfe7;
  --canvas:   #f5f1f6;
  --surface:  #ffffff;
  --field-bg: #fcfbfd;

  /* status */
  --success: #188e43;  --success-bg: #eaf6ee;  --success-fg: #157a3a;
  --danger:  #d62f28;  --danger-bg:  #fdecea;  --danger-fg:  #b3271f;
  --warning: #f5a623;  --warning-bg: #fdf3e3;  --warning-fg: #a86910;
  --info:    #2f80ed;  --info-bg:    #eaf1fd;  --info-fg:    #1f5fb3;

  /* gradients */
  --grad-primary: linear-gradient(135deg, #8f3d86, #4a0f42);
  --grad-sidebar: linear-gradient(180deg, #2a0230, #180118);
  --grad-brand-tile: linear-gradient(135deg, #d489cf, #7a2e6e);

  /* type */
  --font: 'Sora', system-ui, -apple-system, sans-serif;
  --fs-h1: 30px;
  --fs-h2: 25px;
  --fs-h3: 19px;
  --fs-lg: 17px;
  --fs-body: 16px;
  --fs-ui: 14px;
  --fs-label: 14px;
  --fs-cap: 12px;

  /* spacing — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* radius */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 26px;
  --radius-pill: 30px;

  /* elevation */
  --shadow-card:   0 2px 8px rgba(42, 2, 48, .04);
  --shadow-raised: 0 10px 28px rgba(42, 2, 48, .1);
  --shadow-modal:  0 44px 100px -30px rgba(42, 2, 48, .4);

  --header-w: 252px;
  --topbar-h: 72px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

/* ---------- BASE ---------- */
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: -.1px;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--plum-400); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--plum-200); }

/* ---------- LAYOUT PRIMITIVES ---------- */
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--space-6); }
.stack > * + * { margin-top: var(--space-4); }
.grid { display: grid; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }

/* ---------- HEADING GROUP ---------- */
.heading-group { margin-bottom: var(--space-6); }
.heading-group .heading { font-size: var(--fs-h2); font-weight: 700; color: var(--ink); letter-spacing: -.4px; }
.heading-group p { color: var(--muted); margin-top: var(--space-2); }
.heading-group.small .heading { font-size: var(--fs-h3); }
.heading-group.centered { text-align: center; }

/* section kicker */
.kicker { font-size: 11px; letter-spacing: 1.2px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font); font-size: var(--fs-ui); font-weight: 600;
  padding: 12px 20px; border-radius: var(--radius-md);
  transition: background .16s, box-shadow .16s, transform .06s, border-color .16s, color .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 14px 30px -8px rgba(74, 15, 66, .5); }
.btn-primary:hover { box-shadow: 0 16px 34px -8px rgba(74, 15, 66, .62); }
.btn-outline { border: 1.5px solid var(--line); background: var(--surface); color: var(--plum-600); }
.btn-outline:hover { border-color: var(--plum-400); }
.btn-ghost { background: var(--plum-50); color: var(--muted); }
.btn-ghost:hover { background: var(--plum-100); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); color: var(--body); }
.btn-icon:hover { background: var(--plum-50); }
.btn:disabled { background: var(--plum-200); color: #fff; box-shadow: none; cursor: not-allowed; }

/* ---------- FORM FIELDS ---------- */
.field { display: block; }
.field .label { display: block; font-size: var(--fs-label); font-weight: 600; color: var(--body); margin-bottom: var(--space-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px; font-size: var(--fs-ui);
  background: var(--field-bg); border: 1.5px solid var(--line-2); border-radius: var(--radius-md);
  transition: border-color .16s, box-shadow .16s;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--plum-500); box-shadow: 0 0 0 3px rgba(122, 46, 110, .12);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field .error-text { display: none; margin-top: var(--space-2); font-size: var(--fs-cap); color: var(--danger); }
.field.has-error input { border-color: var(--danger); }
.field.has-error .error-text { display: block; }

/* input with a leading icon + optional trailing action */
.input-group {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--field-bg); border: 1.5px solid var(--line-2); border-radius: var(--radius-md); padding-inline: 13px;
  transition: border-color .16s, box-shadow .16s;
}
.input-group:focus-within { border-color: var(--plum-500); box-shadow: 0 0 0 3px rgba(122, 46, 110, .12); }
.input-group svg { width: 18px; height: 18px; color: var(--muted-2); flex-shrink: 0; }
.input-group input { flex: 1; border: none; background: none; padding: 12px 0; font-size: var(--fs-ui); }
.input-group input:focus { outline: none; }
.input-group .pw-toggle { color: var(--muted-2); display: flex; }
.input-group .pw-toggle:hover { color: var(--plum-500); }

/* checkbox (visual) */
.check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-ui); color: var(--body); }
.check .box { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #c9bdcc; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check.checked .box { background: var(--plum-600); border-color: var(--plum-600); color: #fff; }
.check .box svg { width: 12px; height: 12px; }

/* ---------- CARD ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.card-pad { padding: var(--space-6); }

/* ---------- STATUS PILL ---------- */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-cap); font-weight: 600; padding: 4px 11px; border-radius: var(--radius-pill); }
.status svg { width: 13px; height: 13px; }
.status.approved { background: var(--success-bg); color: var(--success-fg); }
.status.pending  { background: var(--warning-bg); color: var(--warning-fg); }
.status.rejected { background: var(--danger-bg);  color: var(--danger-fg); }
.status.info     { background: var(--info-bg);    color: var(--info-fg); }
.status.neutral  { background: var(--plum-100);   color: var(--plum-600); }

/* ---------- BRAND MARK ---------- */
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand-tile { width: 40px; height: 40px; border-radius: 13px; background: var(--grad-brand-tile); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(122, 46, 110, .45); flex-shrink: 0; }
.brand-tile svg { width: 21px; height: 21px; fill: #fff; }
.brand-name { display: block; font-weight: 700; font-size: var(--fs-lg); letter-spacing: .4px; line-height: 1; }
.brand-sub { display: block; font-size: 9.5px; letter-spacing: 2.5px; margin-top: 3px; opacity: .8; }

/* ============================================================
   AUTH SHELL (login / register / verify)
   ============================================================ */
.auth-shell {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  padding: var(--space-8) var(--space-5);
  background:
    radial-gradient(at 15% 20%, #efd9ec 0, transparent 55%),
    radial-gradient(at 85% 25%, #e4dcf3 0, transparent 52%),
    radial-gradient(at 50% 95%, #f4e5f0 0, transparent 55%),
    #f8f4f9;
}

/* split login */
.auth-card { width: 100%; max-width: 960px; background: var(--surface); border-radius: var(--radius-2xl); overflow: hidden; box-shadow: var(--shadow-modal); }
.auth-split { display: grid; grid-template-columns: 1fr 460px; }
.auth-hero { position: relative; min-height: 560px; background: var(--plum-900); color: #fff; }
.auth-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.auth-hero .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42,2,48,.55) 0%, rgba(42,2,48,.15) 40%, rgba(74,15,66,.82) 100%); }
.auth-hero .hero-body { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 40px; }
.auth-hero h2 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.2; letter-spacing: -.6px; margin-bottom: var(--space-3); }
.auth-hero p { font-size: var(--fs-ui); color: #f0dcee; line-height: 1.65; max-width: 340px; }
.auth-hero .brand-name { color: #fff; }
.auth-hero .brand-sub { color: #e3bfe0; }

.auth-form { padding: var(--space-12) 42px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: var(--fs-h2); font-weight: 700; margin-bottom: var(--space-2); }
.auth-form .lede { font-size: var(--fs-ui); color: var(--muted); margin-bottom: var(--space-8); }
.auth-form .field, .auth-form .input-group { margin-bottom: var(--space-4); }
.auth-form .form-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); font-size: var(--fs-ui); }
.auth-form .form-meta a { color: var(--plum-500); font-weight: 600; }
.auth-form .alt { text-align: center; font-size: var(--fs-ui); color: var(--muted); margin-top: var(--space-5); }
.auth-form .alt a { color: var(--plum-500); font-weight: 600; }

/* real logo lockup in a white card (its dark text needs a light backing) */
.brand-logo-box { background: #fff; border-radius: 12px; padding: 9px 13px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 12px rgba(24,10,22,.14); flex-shrink: 0; }
.brand-logo-box img { display: block; width: 128px; height: auto; }
.brand-logo-box.mobile-logo { padding: 5px 8px; border-radius: 9px; }
.brand-logo-box.mobile-logo img { width: auto; height: 30px; }
.auth-hero .brand-logo-box, .auth-topband .brand-logo-box { background: #fff; padding: 16px 22px; border-radius: 16px; box-shadow: 0 10px 30px rgba(24,10,22,.3); align-self: flex-start; }
.auth-hero .brand-logo-box img, .auth-topband .brand-logo-box img { width: auto; height: 84px; max-width: 100%; }
.msg-card .brand-logo-box { padding: 12px 18px; }
.msg-card .brand-logo-box img { width: 180px; }
.doc .brand-logo-box { box-shadow: none; padding: 0; }
.doc .brand-logo-box img { width: 150px; }

/* login role picker */
.login-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted-2); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.role-buttons { display: flex; flex-direction: column; gap: 10px; }
.role-btn { display: flex; align-items: center; gap: 13px; border: 1.5px solid var(--line-2); border-radius: var(--radius-md); padding: 12px 14px; transition: border-color .15s, box-shadow .15s, transform .06s; }
.role-btn:hover { border-color: var(--plum-400); box-shadow: 0 8px 20px -10px rgba(74,15,66,.4); }
.role-btn:active { transform: translateY(1px); }
.role-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--plum-50); color: var(--plum-500); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-ic svg { width: 20px; height: 20px; }
.role-tx { flex: 1; display: flex; flex-direction: column; }
.role-tx .role-t { font-weight: 600; font-size: var(--fs-ui); color: var(--ink); }
.role-tx .role-s { font-size: 12px; color: var(--muted); }
.role-ar { color: var(--muted-2); }
.role-ar svg { width: 18px; height: 18px; }

/* register (single column card) */
.auth-card.narrow { max-width: 580px; }
.auth-topband { background: radial-gradient(130% 170% at 88% -20%, #a13b95, #4a0f42 74%); color: #fff; padding: 28px 34px; }
.auth-topband .brand { margin-bottom: var(--space-5); }
.auth-topband .brand-name { color: #fff; }
.auth-topband .brand-sub { color: #e3bfe0; }
.auth-topband h1 { font-size: var(--fs-h2); font-weight: 700; margin-bottom: var(--space-1); }
.auth-topband p { font-size: 13px; color: #eed7ec; }
.progress-track { display: flex; gap: var(--space-2); margin-top: var(--space-5); }
.progress-track span { flex: 1; height: 5px; border-radius: 4px; background: rgba(255,255,255,.26); }
.progress-track span.on { background: #fff; }
.auth-body { padding: 30px 34px 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-5); }
.consent { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-cap); color: var(--body); margin: var(--space-5) 0; line-height: 1.5; cursor: pointer; }
.consent .box { flex-shrink: 0; }
.consent a { color: var(--plum-500); font-weight: 600; }
.auth-body .alt { text-align: center; font-size: var(--fs-ui); color: var(--muted); margin-top: var(--space-5); }
.auth-body .alt a { color: var(--plum-500); font-weight: 600; }

/* verify / otp */
.auth-card.otp { max-width: 440px; padding: 38px 36px; text-align: center; }
.otp-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #f3e7f2, #e6c9e2); color: var(--plum-500); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-5); }
.otp-icon svg { width: 26px; height: 26px; }
.auth-card.otp h1 { font-size: var(--fs-h2); font-weight: 700; margin-bottom: var(--space-2); }
.auth-card.otp .lede { font-size: var(--fs-ui); color: var(--muted); margin-bottom: var(--space-6); line-height: 1.55; }
.auth-card.otp .lede strong { color: var(--body); }
.otp-inputs { display: flex; gap: var(--space-3); justify-content: center; margin-bottom: var(--space-6); }
.otp-inputs input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; border: 1.6px solid var(--line-2); border-radius: 13px; background: var(--field-bg); }
.otp-inputs input:focus { outline: none; border-color: var(--plum-500); box-shadow: 0 0 0 3px rgba(122, 46, 110, .1); }
.resend { font-size: var(--fs-cap); color: var(--muted-2); margin-top: var(--space-5); display: flex; align-items: center; justify-content: center; gap: 6px; }
.resend svg { width: 14px; height: 14px; }

/* ============================================================
   APP SHELL (dashboard)
   ============================================================ */
.app { display: flex; min-height: 100svh; background: var(--canvas); }

/* sidebar */
.site-sidebar {
  width: var(--header-w); flex-shrink: 0; background: var(--grad-sidebar); color: #e9dced;
  padding: 22px 15px; display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 40;
}
.site-sidebar .brand { padding: 0 6px var(--space-2); }
.site-sidebar .brand-logo-box { width: 100%; padding: 12px; }
.site-sidebar .brand-logo-box img { width: auto; height: 62px; margin: 0 auto; }
.site-sidebar .brand-name { color: #fff; }
.site-sidebar .brand-sub { color: #a988ad; }
.nav-label { font-size: 9.5px; letter-spacing: 1.5px; color: #8a6a8e; margin: var(--space-6) 8px var(--space-2); }
.main-nav ul { display: flex; flex-direction: column; gap: 3px; }
.main-nav a { display: flex; align-items: center; gap: var(--space-3); padding: 11px 13px; font-size: var(--fs-ui); border-radius: 11px; color: #b394b6; transition: background .15s, color .15s; }
.main-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.main-nav a .nav-text { flex: 1; }
.main-nav a .nav-badge { background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.main-nav a:hover { background: rgba(255,255,255,.06); color: #e9dced; }
.main-nav .menu-item.current-menu-item a,
.main-nav a[aria-current="page"] { color: #fff; font-weight: 600; background: linear-gradient(135deg, rgba(212,137,207,.3), rgba(122,46,110,.16)); box-shadow: inset 3px 0 0 var(--plum-300); }
.sidebar-fund { margin-top: auto; background: linear-gradient(135deg, rgba(212,137,207,.18), rgba(122,46,110,.1)); border: 1px solid rgba(212,137,207,.18); border-radius: 15px; padding: 15px; }
.sidebar-fund .t { font-size: 12.5px; font-weight: 600; color: #fff; }
.sidebar-fund .s { font-size: 11px; color: #c9a5c6; margin: 3px 0 10px; }
.sidebar-fund .bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.14); overflow: hidden; }
.sidebar-fund .bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #d489cf, #f5a623); }

/* main column */
.app-main { flex: 1; min-width: 0; margin-left: var(--header-w); display: flex; flex-direction: column; }

/* topbar */
.topbar {
  height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; gap: var(--space-4);
  padding: 0 30px; background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .mobile-logo { display: none; }
.topbar .hamburger { display: none; }
.topbar .page-title { font-size: var(--fs-h3); font-weight: 700; color: var(--ink); }
.topbar .page-sub { font-size: var(--fs-cap); color: var(--muted-2); }
.topbar .spacer { flex: 1; }
.topbar-search { display: flex; align-items: center; gap: var(--space-2); background: var(--canvas); border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px; width: 260px; }
.topbar-search svg { width: 17px; height: 17px; color: var(--muted-2); }
.topbar-search input { flex: 1; border: none; background: none; font-size: 13px; }
.topbar-search input:focus { outline: none; }
.topbar .divider { width: 1px; height: 28px; background: var(--line); }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); color: var(--body); display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; background: var(--danger); color: #fff; border-radius: 9px; font-size: 10px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); padding: 0 4px; box-sizing: border-box; }

.profile-chip { display: flex; align-items: center; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px 6px 6px; }
.profile-chip img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.profile-chip { cursor: pointer; }
.profile-chip .who { line-height: 1.25; display: flex; flex-direction: column; flex-shrink: 0; }
.profile-chip .who .nm { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; }
.profile-chip .who .rl { display: block; font-size: 11px; color: var(--muted-2); white-space: nowrap; }

/* delta pill — GLOBAL (used by KPI cards and analytics panels) */
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); line-height: 1.4; }
.delta svg { width: 12px !important; height: 12px !important; flex-shrink: 0; }
.delta.up { color: var(--success-fg); background: var(--success-bg); }
.delta.down { color: var(--danger-fg); background: var(--danger-bg); }

/* ============================================================
   POPOVER SYSTEM (global) — powers notifications, profile menu, filter
   Trigger: [data-popover-target="id"]  ·  Panel: .popover#id
   ============================================================ */
.pop-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  min-width: 260px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-raised);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.popover.open { opacity: 1; visibility: visible; transform: translateY(0); }
.popover::before { content: ""; position: absolute; top: -6px; right: 20px; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop-head .pop-title { font-weight: 600; font-size: var(--fs-ui); }
.pop-head .pop-action { font-size: 12px; color: var(--plum-500); font-weight: 600; }
.pop-foot { padding: 12px 16px; border-top: 1px solid var(--line); text-align: center; }
.pop-foot a { color: var(--plum-500); font-weight: 600; font-size: 13px; }

/* notification menu */
.notif-menu { width: 340px; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #f4eef3; }
.notif-item:hover { background: var(--plum-50); }
.notif-item .n-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item .n-ico svg { width: 17px; height: 17px; }
.notif-item .n-ico.ok { background: var(--success-bg); color: var(--success-fg); }
.notif-item .n-ico.warn { background: var(--warning-bg); color: var(--warning-fg); }
.notif-item .n-ico.info { background: var(--info-bg); color: var(--info-fg); }
.notif-item .n-ico.bad { background: var(--danger-bg); color: var(--danger-fg); }
.notif-item .n-body .n-txt { font-size: 13px; color: var(--body); line-height: 1.4; }
.notif-item .n-body .n-txt strong { color: var(--ink); font-weight: 600; }
.notif-item .n-body .n-time { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.notif-item.unread { position: relative; }
.notif-item.unread::after { content: ""; position: absolute; right: 16px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--plum-400); }

/* menu list (profile dropdown) */
.menu-list { padding: 8px; }
.menu-list .menu-user { display: flex; align-items: center; gap: 11px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-list .menu-user img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; }
.menu-list .menu-user .nm { font-weight: 600; font-size: 13.5px; }
.menu-list .menu-user .em { font-size: 11.5px; color: var(--muted-2); }
.menu-list a { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--body); }
.menu-list a svg { width: 17px; height: 17px; color: var(--muted); }
.menu-list a:hover { background: var(--plum-50); color: var(--plum-600); }
.menu-list a:hover svg { color: var(--plum-500); }
.menu-list a.danger { color: var(--danger-fg); }
.menu-list a.danger svg { color: var(--danger); }
.menu-list .sep { height: 1px; background: var(--line); margin: 6px 0; }

/* filter panel */
.filter-panel { width: 280px; left: auto; right: 0; }
.filter-body { padding: 16px; }
.filter-group + .filter-group { margin-top: 16px; }
.filter-group .fg-label { font-size: 11px; letter-spacing: 1px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; margin-bottom: 10px; }
.filter-opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--body); cursor: pointer; }
.filter-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.filter-foot .btn { flex: 1; }
.profile-chip .chev { color: var(--muted-2); }
.profile-chip .chev svg { width: 16px; height: 16px; }

/* content pad */
.app-content { padding: var(--space-6) 30px var(--space-10); }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-4); }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: 20px 22px; }
.kpi-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-card .top .kicker { font-size: 10.5px; }
.kpi-card .ico { width: 38px; height: 38px; border-radius: var(--radius-md); background: linear-gradient(135deg, #f7ecf6, #efdcee); color: var(--plum-500); display: flex; align-items: center; justify-content: center; }
.kpi-card .ico svg { width: 19px; height: 19px; }
.kpi-card .figure { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.kpi-card .figure .val { font-size: 23px; font-weight: 700; color: var(--ink); }
.kpi-card .delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); }
.kpi-card .delta svg { width: 12px; height: 12px; }
.kpi-card .delta.up { color: var(--success-fg); background: var(--success-bg); }
.kpi-card .delta.down { color: var(--danger-fg); background: var(--danger-bg); }
.kpi-card .sub { font-size: 11.5px; color: var(--muted-2); margin-top: var(--space-2); }

/* analytics row */
.analytics-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-4); margin-bottom: var(--space-4); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: var(--space-6); }
.panel .panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-4); }
.panel .panel-figure { font-size: var(--fs-h2); font-weight: 700; color: var(--ink); margin-top: 6px; display: flex; align-items: center; gap: var(--space-3); }
.legend { display: flex; gap: var(--space-4); align-items: center; font-size: var(--fs-cap); color: var(--body); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chart-box { height: 250px; }
.chart-box.sm { height: 170px; margin: var(--space-4) 0 var(--space-2); }

.analysis-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px 0; border-top: 1px solid #f4eef3; }
.analysis-row .dot { width: 9px; height: 9px; border-radius: 50%; }
.analysis-row .nm { flex: 1; font-size: 13px; color: var(--body); }
.analysis-row .ct { font-weight: 600; font-size: 13px; }
.analysis-row .pct { font-size: 12px; color: var(--muted-2); width: 42px; text-align: right; }

/* data table */
.table-head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-5) var(--space-6); gap: var(--space-4); flex-wrap: wrap; }
.table-head .t { font-size: var(--fs-h3); font-weight: 600; }
.table-tools { display: flex; gap: var(--space-3); align-items: center; }
.table-tools .input-group { height: 40px; padding: 0 13px; }
.table-tools .input-group input { padding: 0; height: 100%; }
.table-tools .btn { height: 40px; padding-block: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th { background: var(--plum-50); text-align: left; font-weight: 600; color: var(--muted); padding: 13px var(--space-6); white-space: nowrap; }
.data-table tbody tr { border-top: 1px solid #f4eef3; }
.data-table tbody tr:hover { background: var(--plum-50); }
.data-table td { padding: 13px var(--space-6); color: var(--body); white-space: nowrap; }
.data-table .patient { display: flex; align-items: center; gap: var(--space-3); }
.data-table .patient img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.data-table .patient .nm { font-weight: 600; color: var(--ink); }
.data-table .patient .id { font-size: 11.5px; color: var(--muted-2); }
.data-table .amt { font-weight: 600; color: var(--ink); }

/* mobile bottom nav (hidden on desktop) */
.mobile-nav { display: none; }

/* backdrop for mobile drawer */
.scrim { display: none; }

/* style-guide helpers */
.sg-body { padding: var(--space-10) 0; }
.sg-block { margin-bottom: var(--space-12); }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.sg-swatch .chip { height: 60px; }
.sg-swatch .meta { padding: 10px 12px; }
.sg-swatch .meta .n { font-weight: 600; font-size: 12.5px; }
.sg-swatch .meta .h { font-size: 11px; color: var(--muted-2); }
.sg-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.sg-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }

/* back to top */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-raised); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; z-index: 45; }
.to-top.show { opacity: 1; visibility: visible; }
.to-top svg { width: 20px; height: 20px; }

/* ============================================================
   EXTENDED COMPONENTS — page head, forms, wizard, timeline,
   verification, tabs, alerts, toasts, empty & message pages
   ============================================================ */

/* page head + breadcrumb */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-2); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--plum-500); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .cur { color: var(--plum-500); font-weight: 600; }
.page-head .title { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.5px; }
.page-head .head-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* generic form section */
.section-title { font-size: var(--fs-h3); font-weight: 600; margin-bottom: var(--space-4); }
.form-section { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5) var(--space-5); }
.form-section.two { grid-template-columns: repeat(2, 1fr); }
.form-section .full { grid-column: 1 / -1; }
.divider-line { height: 1px; background: var(--line); margin: var(--space-6) 0; }

/* shared multi-column app layouts (collapse in responsive.css) */
.split-3 { display: grid; grid-template-columns: 280px 1fr 300px; gap: var(--space-4); align-items: start; }
.split-2 { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-4); align-items: start; }
.split-2.rev { grid-template-columns: 280px 1fr; }

/* tabs */
.tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--line); margin-bottom: var(--space-6); overflow-x: auto; }
.tabs a { padding: 13px 2px; font-weight: 600; font-size: var(--fs-ui); color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--plum-500); }
.tabs a.active { color: var(--plum-600); border-color: var(--plum-600); }

/* wizard (horizontal step bar) */
.wizard { display: flex; align-items: flex-start; margin-bottom: var(--space-8); }
.wizard .step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
.wizard .step .bubble { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-weight: 600; background: var(--plum-100); color: #a892a6; }
.wizard .step .bubble svg { width: 19px; height: 19px; }
.wizard .step .lbl { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.wizard .step.done .bubble { background: var(--success); color: #fff; }
.wizard .step.current .bubble { background: var(--grad-primary); color: #fff; box-shadow: 0 8px 18px rgba(74,15,66,.3); }
.wizard .step.current .lbl { color: var(--plum-600); font-weight: 600; }
.wizard .bar { flex: 1; height: 2px; background: var(--line); margin: 20px 8px 0; }
.wizard .bar.done { background: var(--success); }

/* vertical status timeline */
.timeline { position: relative; }
.timeline .tl-item { display: flex; gap: 14px; padding-bottom: var(--space-6); position: relative; }
.timeline .tl-item::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.timeline .tl-item:last-child { padding-bottom: 0; }
.timeline .tl-item:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; background: var(--plum-100); color: #a892a6; }
.tl-dot svg { width: 16px; height: 16px; }
.tl-item.done .tl-dot { background: var(--success); color: #fff; }
.tl-item.done::before { background: var(--success); }
.tl-item.current .tl-dot { background: var(--grad-primary); color: #fff; }
.tl-body .tl-t { font-weight: 600; font-size: var(--fs-ui); }
.tl-body .tl-meta { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }

/* verification checklist */
.verify-list .v-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--line); gap: 16px; }
.verify-list .v-item:last-child { border-bottom: none; }
.v-left { display: flex; align-items: center; gap: 12px; }
.v-left .v-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--plum-50); color: var(--plum-500); display: flex; align-items: center; justify-content: center; }
.v-left .v-ico svg { width: 18px; height: 18px; }
.v-left .v-t { font-weight: 600; font-size: var(--fs-ui); }
.v-left .v-s { font-size: 12px; color: var(--muted-2); }

/* alerts (inline messages) */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert .a-t { font-weight: 600; font-size: var(--fs-ui); }
.alert .a-b { font-size: 13px; margin-top: 2px; opacity: .9; }
.alert.success { background: var(--success-bg); border-color: #bfe4c9; color: var(--success-fg); }
.alert.danger { background: var(--danger-bg); border-color: #f3c4c0; color: var(--danger-fg); }
.alert.warning { background: var(--warning-bg); border-color: #f5dca6; color: var(--warning-fg); }
.alert.info { background: var(--info-bg); border-color: #c2d5f5; color: var(--info-fg); }

/* toast */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-raised); min-width: 300px; max-width: 360px; animation: toast-in .28s ease; }
.toast svg { width: 19px; height: 19px; flex-shrink: 0; }
.toast .t-t { font-weight: 600; font-size: var(--fs-ui); }
.toast .t-b { font-size: 13px; color: var(--muted); margin-top: 2px; }
.toast .t-x { margin-left: auto; color: var(--muted-2); cursor: pointer; }
.toast.success { border-left-color: var(--success); } .toast.success > svg { color: var(--success); }
.toast.danger { border-left-color: var(--danger); } .toast.danger > svg { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); } .toast.warning > svg { color: var(--warning); }
.toast.info { border-left-color: var(--info); } .toast.info > svg { color: var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* stat mini row / definition list */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: var(--fs-ui); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }

/* cards grid + tile */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.mini-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); }

/* empty state */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state .es-ico { width: 74px; height: 74px; border-radius: 20px; background: var(--plum-50); color: var(--plum-400); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.empty-state .es-ico svg { width: 34px; height: 34px; }
.empty-state h2 { font-size: var(--fs-h3); font-weight: 700; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 8px auto 20px; }

/* full-page message (404 / 503 / success) */
.msg-page { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: radial-gradient(at 15% 20%, #efd9ec 0, transparent 55%), radial-gradient(at 85% 25%, #e4dcf3 0, transparent 52%), radial-gradient(at 50% 95%, #f4e5f0 0, transparent 55%), #f8f4f9; }
.msg-card { max-width: 520px; text-align: center; }
.msg-card .brand { justify-content: center; margin-bottom: 28px; }
.msg-code { font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -3px; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.msg-ico { width: 86px; height: 86px; border-radius: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 22px; }
.msg-ico svg { width: 40px; height: 40px; }
.msg-card h1 { font-size: var(--fs-h2); font-weight: 700; margin: 14px 0 10px; }
.msg-card p { color: var(--muted); line-height: 1.6; margin-bottom: 26px; }
.msg-card .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* document (LPO) */
.doc { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; background: var(--surface); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--plum-100); padding-bottom: 20px; margin-bottom: 20px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 16px 0; }
.doc-table th { text-align: left; background: var(--plum-50); padding: 10px 14px; font-weight: 600; color: var(--muted); }
.doc-table td { padding: 10px 14px; border-top: 1px solid var(--line); }
.doc-total { display: flex; justify-content: flex-end; gap: 40px; font-size: var(--fs-lg); font-weight: 700; padding-top: 14px; }

/* segmented control (yes/no/partial) */
.segmented { display: inline-flex; background: var(--plum-50); border-radius: var(--radius-md); padding: 3px; gap: 3px; }
.segmented button { padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button.active { background: var(--grad-primary); color: #fff; }

/* progress bar */
.progress { height: 8px; border-radius: 6px; background: var(--plum-100); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 6px; background: var(--grad-primary); }

/* ============================================================
   CRUD — modals, form actions, detail header, upload, documents, tabs
   ============================================================ */

/* modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(24,1,24,.5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 90; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.modal-scrim.open { opacity: 1; visibility: visible; }
.modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-modal); max-width: 440px; width: 100%; overflow: hidden; transform: translateY(10px); transition: transform .2s; max-height: 90vh; overflow-y: auto; }
.modal-scrim.open .modal { transform: none; }
.modal-body { padding: 26px 26px 8px; text-align: center; }
.modal-ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.modal-ico svg { width: 26px; height: 26px; }
.modal-body h3 { font-size: var(--fs-h3); font-weight: 700; }
.modal-body p { color: var(--muted); margin-top: 8px; font-size: 13.5px; line-height: 1.55; }
.modal-foot { display: flex; gap: 10px; padding: 16px 26px 24px; }
.modal-foot .btn { flex: 1; }
.modal.lg { max-width: 660px; }
.modal.lg .modal-body { text-align: left; padding: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: var(--fs-h3); font-weight: 700; }
.modal-x { color: var(--muted-2); cursor: pointer; display: flex; }
.modal-x svg { width: 20px; height: 20px; }
.modal-content { padding: 24px; }

/* form action bar */
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.form-actions .right { display: flex; gap: 10px; margin-left: auto; }

/* readonly value styling */
.field input[readonly], .field textarea[readonly] { background: var(--plum-50); color: var(--body); cursor: default; }

/* detail header block */
.detail-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.detail-head img { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.detail-head .dh-name { font-size: var(--fs-h3); font-weight: 700; }
.detail-head .dh-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* upload dropzone */
.dropzone { border: 1.5px dashed var(--plum-200); border-radius: var(--radius-lg); background: var(--plum-50); padding: 28px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--plum-400); background: #f7ecf6; }
.dropzone .dz-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface); color: var(--plum-500); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.dropzone .dz-ico svg { width: 24px; height: 24px; }
.dropzone .dz-t { font-weight: 600; font-size: var(--fs-ui); }
.dropzone .dz-t span { color: var(--plum-500); }
.dropzone .dz-s { font-size: 12.5px; color: var(--muted-2); margin-top: 4px; }
.dropzone input[type=file] { display: none; }

/* document list */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.doc-item .d-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--plum-50); color: var(--plum-500); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-item .d-ico svg { width: 19px; height: 19px; }
.doc-item .d-meta { flex: 1; min-width: 0; }
.doc-item .d-name { font-weight: 600; font-size: 13.5px; }
.doc-item .d-sub { font-size: 12px; color: var(--muted-2); }
.doc-item .d-actions { display: flex; gap: 6px; }
.doc-thumb { width: 100%; height: 130px; border-radius: 12px; object-fit: cover; background: var(--plum-50); border: 1px solid var(--line); }
.doc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.doc-gallery .g-item .g-cap { font-size: 12.5px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }

/* tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
