/* =====================================================================
   School Management System - MS Cloud Solutions
   Design system: themes, light/dark, animations, responsive layout
   ===================================================================== */
:root {
  --primary: var(--theme-p, #4f46e5);
  --primary-2: var(--theme-p2, #7c3aed);
  --primary-soft: color-mix(in srgb, var(--primary) 12%, transparent);
  --primary-softer: color-mix(in srgb, var(--primary) 6%, transparent);
  --on-primary: #fff;
  --bg: #f4f6fb;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--primary-2) 7%, transparent), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #8a93a6;
  --border: #e5e8f0;
  --border-2: #d6dbe6;
  --success: #12a150;
  --success-soft: #e3f7ec;
  --danger: #dc3545;
  --danger-soft: #fde8ea;
  --warning: #d98a00;
  --warning-soft: #fff4dc;
  --info: #0e86c9;
  --info-soft: #e1f2fb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #6250d6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px -4px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 50px -12px rgba(16, 24, 40, .25);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-ur: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Urdu Typesetting", "Segoe UI", Tahoma, serif;
  --fs: 14px;
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: 22px;
  color-scheme: light;
}
html[data-mode="dark"] {
  --primary: color-mix(in srgb, var(--theme-p, #4f46e5) 78%, #fff);
  --primary-2: color-mix(in srgb, var(--theme-p2, #7c3aed) 78%, #fff);
  --bg: #0d111a;
  --surface: #151b27;
  --surface-2: #1a2130;
  --surface-3: #222a3b;
  --text: #e8ecf4;
  --text-2: #b4bdcd;
  --muted: #7d889c;
  --border: #262f42;
  --border-2: #333d53;
  --primary-soft: color-mix(in srgb, var(--primary) 20%, transparent);
  --primary-softer: color-mix(in srgb, var(--primary) 10%, transparent);
  --success: #34c77b; --success-soft: rgba(52, 199, 123, .14);
  --danger: #f2626f; --danger-soft: rgba(242, 98, 111, .14);
  --warning: #f2b23a; --warning-soft: rgba(242, 178, 58, .14);
  --info: #47b4ec; --info-soft: rgba(71, 180, 236, .14);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #9085e9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
html[data-fs="sm"] { --fs: 13px; }
html[data-fs="lg"] { --fs: 15.5px; }
html[data-radius="sharp"] { --radius: 4px; --radius-sm: 3px; }
html[data-radius="round"] { --radius: 22px; --radius-sm: 14px; }
html[data-density="compact"] { --pad: 14px; }
html[data-sidebar="compact"] { --sidebar-w: 78px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs); color: var(--text); background: var(--bg);
  background-image: var(--bg-grad); background-attachment: fixed; line-height: 1.5;
  -webkit-font-smoothing: antialiased; transition: background-color .3s, color .3s;
}
html[dir="rtl"] body, .ur, [lang="ur"] { font-family: var(--font-ur); }
.ur { line-height: 1.9; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
::selection { background: var(--primary-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: .86em; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: end; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .gap { gap: 10px; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 18px; }
.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)); }
.span2 { grid-column: span 2; }
.bi-sub { display: block; font-family: var(--font-ur); font-size: .82em; color: var(--muted); line-height: 1.6; font-weight: 400; }
.bi-inline .bi-sub { display: inline; margin-inline-start: 6px; }
svg.ic { width: 1.25em; height: 1.25em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.25em; }

/* ---------------------------------------------------------------- animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-18px) rotate(6deg); } }
@keyframes gradientMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.anim-in { animation: fadeUp .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.page-enter { animation: fadeUp .45s var(--ease) both; }
html[data-anim="off"] *, html[data-anim="off"] *::before, html[data-anim="off"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--primary), var(--primary-2), color-mix(in srgb, var(--primary) 60%, #000));
  background-size: 300% 300%; animation: gradientMove 14s ease infinite;
}
.login-art .bubble { position: absolute; border-radius: 30%; background: rgba(255, 255, 255, .1); animation: float 9s ease-in-out infinite; backdrop-filter: blur(2px); }
.login-art h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
.login-art .ur-title { font-family: var(--font-ur); font-size: 28px; opacity: .95; margin-top: 8px; }
.login-art .feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 520px; position: relative; z-index: 1; }
.login-art .feat div { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-weight: 500; backdrop-filter: blur(6px); }
.login-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 410px; animation: scaleIn .6s var(--ease) both; }
.login-card .logo-big { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 12px 30px -8px var(--primary); margin-bottom: 18px; overflow: hidden; }
.login-card .logo-big img { width: 100%; height: 100%; object-fit: cover; }
.login-card h2 { font-size: 26px; font-weight: 750; }
.login-card .field { margin-top: 16px; }
.login-foot { margin-top: 26px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column;
  transition: width .3s var(--ease), transform .3s var(--ease);
}
.brand { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; overflow: hidden; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 16px -6px var(--primary); overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.nav-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 16px 12px 6px; white-space: nowrap; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 550; position: relative; transition: background .2s, color .2s, transform .2s; white-space: nowrap; overflow: hidden;
}
.nav a .ic { width: 20px; height: 20px; }
.nav a .lbl { min-width: 0; line-height: 1.25; }
.nav a .lbl .bi-sub { font-size: 11.5px; }
.nav a:hover { background: var(--surface-3); color: var(--text); transform: translateX(2px); }
html[dir="rtl"] .nav a:hover { transform: translateX(-2px); }
.nav a.active { background: linear-gradient(90deg, var(--primary-soft), var(--primary-softer)); color: var(--primary); }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--primary); }
.side-foot { padding: 12px; border-top: 1px solid var(--border); }
.side-foot .ver { font-size: 11px; color: var(--muted); text-align: center; }
.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; transition: margin .3s var(--ease); display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .title { font-size: 18px; font-weight: 700; min-width: 0; }
.topbar .title .bi-sub { display: inline; margin-inline-start: 8px; font-size: 14px; }
.topbar .crumb { font-size: 12px; color: var(--muted); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, transform .15s; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); transition: box-shadow .2s; }
.user-chip:hover { box-shadow: var(--shadow); }
.user-chip .u-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.content { padding: var(--pad); flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; }
.overlay { position: fixed; inset: 0; background: rgba(5, 10, 20, .45); z-index: 35; animation: fadeIn .2s; backdrop-filter: blur(2px); }
.dropdown { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 60; animation: scaleIn .2s var(--ease); }
.dropdown button, .dropdown a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; color: var(--text); font: inherit; cursor: pointer; text-align: start; }
.dropdown button:hover, .dropdown a:hover { background: var(--surface-3); }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* ---------------------------------------------------------------- page header & cards */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; font-weight: 780; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s, border-color .25s; }
.card.pad, .card .pad { padding: var(--pad); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px var(--pad); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h3 .ic { color: var(--primary); }
.card-body { padding: var(--pad); }
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat {
  position: relative; overflow: hidden; padding: 18px 20px; display: flex; gap: 16px; align-items: center; cursor: default;
}
.stat::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--tone-soft, var(--primary-soft)); opacity: .7; transition: transform .5s var(--ease); }
.stat:hover::after { transform: scale(1.35); }
.stat .s-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: var(--tone, linear-gradient(135deg, var(--primary), var(--primary-2))); box-shadow: 0 10px 20px -10px var(--tone-shadow, var(--primary)); position: relative; z-index: 1; }
.stat .s-ic .ic { width: 26px; height: 26px; }
.stat .s-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat .s-lbl { color: var(--text-2); font-weight: 600; font-size: 13px; position: relative; z-index: 1; }
.stat .s-lbl .bi-sub { display: inline; margin-inline-start: 4px; }
.stat .s-foot { font-size: 12px; color: var(--muted); margin-top: 2px; position: relative; z-index: 1; }
.tone-blue { --tone: linear-gradient(135deg, #3b82f6, #2563eb); --tone-soft: rgba(59, 130, 246, .1); --tone-shadow: #2563eb; }
.tone-pink { --tone: linear-gradient(135deg, #ec4899, #db2777); --tone-soft: rgba(236, 72, 153, .1); --tone-shadow: #db2777; }
.tone-green { --tone: linear-gradient(135deg, #22c55e, #15803d); --tone-soft: rgba(34, 197, 94, .1); --tone-shadow: #16a34a; }
.tone-orange { --tone: linear-gradient(135deg, #fb923c, #ea580c); --tone-soft: rgba(251, 146, 60, .12); --tone-shadow: #ea580c; }
.tone-red { --tone: linear-gradient(135deg, #f87171, #dc2626); --tone-soft: rgba(248, 113, 113, .12); --tone-shadow: #dc2626; }
.tone-cyan { --tone: linear-gradient(135deg, #22d3ee, #0891b2); --tone-soft: rgba(34, 211, 238, .12); --tone-shadow: #0891b2; }
.tone-violet { --tone: linear-gradient(135deg, #a78bfa, #7c3aed); --tone-soft: rgba(167, 139, 250, .12); --tone-shadow: #7c3aed; }
.tone-amber { --tone: linear-gradient(135deg, #fbbf24, #d97706); --tone-soft: rgba(251, 191, 36, .14); --tone-shadow: #d97706; }

.hero {
  border-radius: calc(var(--radius) + 4px); padding: 24px 26px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--primary), var(--primary-2)); background-size: 200% 200%; animation: gradientMove 12s ease infinite;
  box-shadow: 0 18px 40px -18px var(--primary);
}
.hero h2 { font-size: 24px; font-weight: 780; }
.hero p { margin: 6px 0 0; opacity: .9; }
.hero .shape { position: absolute; border-radius: 40%; background: rgba(255, 255, 255, .1); animation: float 10s ease-in-out infinite; }
.hero .btn { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero .btn:hover { background: rgba(255, 255, 255, .3); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s, background .2s, filter .2s; user-select: none; text-decoration: none;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ripple { position: absolute; border-radius: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; background: currentColor; opacity: .25; transform: scale(0); animation: ripple .6s ease-out; pointer-events: none; }
.btn-primary { --b-bg: linear-gradient(135deg, var(--primary), var(--primary-2)); --b-fg: #fff; --b-bd: transparent; box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 10px 22px -8px var(--primary); }
.btn-success { --b-bg: var(--success); --b-fg: #fff; --b-bd: transparent; }
.btn-danger { --b-bg: var(--danger); --b-fg: #fff; --b-bd: transparent; }
.btn-soft { --b-bg: var(--primary-soft); --b-fg: var(--primary); --b-bd: transparent; }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
.btn-ghost:hover { --b-bg: var(--surface-3); box-shadow: none; }
.btn-sm { height: 32px; padding: 0 11px; font-size: .92em; border-radius: 8px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: .86em; border-radius: 7px; gap: 5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 1.05em; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field > label .req { color: var(--danger); }
.field > label .bi-sub { display: inline; margin-inline-start: 4px; font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text); font: inherit; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input::placeholder { color: var(--muted); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
html[dir="rtl"] select.input { background-position: 18px 18px, 13px 18px; }
.input-sm { height: 34px; font-size: .95em; padding: 0 10px; }
select.input.input-sm { background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-inline-start: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .c3 { grid-column: span 3; } .form-grid .c4 { grid-column: span 4; } .form-grid .c6 { grid-column: span 6; }
.form-grid .c8 { grid-column: span 8; } .form-grid .c12 { grid-column: span 12; } .form-grid .c2 { grid-column: span 2; }
.form-section { grid-column: span 12; font-weight: 700; font-size: 13px; color: var(--primary); display: flex; align-items: center; gap: 8px; padding-top: 6px; border-bottom: 1px dashed var(--border-2); padding-bottom: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius: 30px; transition: .25s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(20px); }
.photo-pick { display: flex; align-items: center; gap: 14px; }
.photo-pick .ph { width: 96px; height: 112px; border-radius: 14px; border: 2px dashed var(--border-2); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color .2s; flex-shrink: 0; }
.photo-pick .ph:hover { border-color: var(--primary); }
.photo-pick .ph img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- toolbar, tabs, chips */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius-sm) + 5px); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow-sm); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { background: var(--surface-3); color: var(--text); }
.tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 14px -8px var(--primary); }
.tab .bi-sub { display: inline; color: inherit; opacity: .8; margin-inline-start: 4px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.b-success { background: var(--success-soft); color: var(--success); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-warning { background: var(--warning-soft); color: var(--warning); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-primary { background: var(--primary-soft); color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); transition: .2s; }
.chip.active, .chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-softer); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border-radius: var(--radius); max-height: 70vh; }
.card > .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .97em; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th .bi-sub { display: block; text-transform: none; letter-spacing: 0; font-size: 11px; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--primary-softer); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 750; background: var(--surface-2); padding: 12px 14px; position: sticky; bottom: 0; }
.tbl .actions { white-space: nowrap; text-align: end; }
.tbl .actions .btn { margin-inline-start: 4px; }
.tbl tr.anim-row { animation: fadeUp .4s var(--ease) both; animation-delay: calc(min(var(--i, 0), 20) * 22ms); }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .p-name { font-weight: 650; white-space: nowrap; }
.person .p-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.avatar { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; overflow: hidden; background: linear-gradient(135deg, var(--av1, #6366f1), var(--av2, #8b5cf6)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 110px; border-radius: 18px; font-size: 34px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty .e-ic { width: 70px; height: 70px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--primary-soft); color: var(--primary); }
.empty .e-ic .ic { width: 32px; height: 32px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 800px 100%; animation: shimmer 1.3s infinite linear; border-radius: 10px; }
.loader { display: grid; place-items: center; padding: 60px; }
.loader div { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }

/* attendance segmented */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); min-width: 40px; transition: background .2s, color .2s, transform .15s; }
.seg button:hover { color: var(--text); }
.seg button.on-P { background: var(--success); color: #fff; animation: pop .3s; }
.seg button.on-A { background: var(--danger); color: #fff; animation: pop .3s; }
.seg button.on-L { background: var(--warning); color: #fff; animation: pop .3s; }
.att-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.att-sum .pill { padding: 8px 14px; border-radius: 12px; font-weight: 700; display: flex; gap: 8px; align-items: center; }

/* marks grid */
.marks-input { width: 72px; height: 34px; text-align: center; padding: 0 6px; }
.marks-input.bad { border-color: var(--danger); background: var(--danger-soft); }

/* ---------------------------------------------------------------- modal, toast, drawer */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(6, 10, 22, .5); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fadeIn .2s; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-lg); animation: scaleIn .3s var(--ease); border: 1px solid var(--border); margin: auto 0; }
.modal.lg { max-width: 860px; } .modal.xl { max-width: 1140px; } .modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; font-weight: 750; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px); flex-wrap: wrap; }
.modal.closing, .modal-back.closing { animation: fadeIn .18s reverse forwards; }
.toasts { position: fixed; top: 18px; inset-inline-end: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 36px); }
.toast { min-width: 280px; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--t, var(--primary)); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 13px 16px; display: flex; gap: 10px; align-items: flex-start; animation: slideInRight .35s var(--ease); font-weight: 550; }
.toast .ic { color: var(--t, var(--primary)); margin-top: 2px; }
.toast.ok { --t: var(--success); } .toast.err { --t: var(--danger); } .toast.warn { --t: var(--warning); }
.toast.out { animation: slideInRight .3s reverse forwards; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 380px; max-width: 100vw; background: var(--surface); z-index: 110; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideInRight .35s var(--ease); border-inline-start: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 10px; }
.drawer h4:first-child { margin-top: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { aspect-ratio: 1; border-radius: 14px; cursor: pointer; border: 3px solid transparent; position: relative; transition: transform .2s; box-shadow: var(--shadow-sm); }
.swatch:hover { transform: translateY(-3px) scale(1.04); }
.swatch.active { border-color: var(--text); }
.swatch.active::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.swatch-name { font-size: 10.5px; text-align: center; color: var(--muted); margin-top: 4px; }
.opt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.opt-row .chip { flex: 1; justify-content: center; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .grid line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: growY .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); transition: opacity .2s; cursor: pointer; }
.chart .bar:hover { opacity: .8; }
.chart .hbar { transform-box: fill-box; transform-origin: left; animation: growX .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.chart .val { fill: var(--text-2); font-size: 11px; font-weight: 700; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle.seg-arc { transition: stroke-dasharray 1s var(--ease); cursor: pointer; }
.donut .d-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .d-center b { font-size: 24px; font-weight: 800; display: block; line-height: 1.1; }
.donut .d-center span { font-size: 11px; color: var(--muted); }
.d-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 140px; }
.d-legend div { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.d-legend i { width: 12px; height: 12px; border-radius: 4px; }
.d-legend .v { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.tip { position: fixed; z-index: 300; pointer-events: none; background: var(--text); color: var(--surface); padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; animation: fadeIn .15s; }
.progress { height: 8px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transform-origin: left; animation: growX 1s var(--ease) both; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px var(--pad); border-bottom: 1px solid var(--border); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--primary-softer); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 110px; }
.mini-stats b { display: block; font-size: 18px; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.perm-table td, .perm-table th { padding: 8px 10px; }
.perm-table .seg button { padding: 4px 10px; font-size: 12px; min-width: 0; }
.perm-table .seg button.on { background: var(--primary); color: #fff; }
.search-results { position: absolute; top: calc(100% + 4px); inset-inline: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 320px; overflow-y: auto; animation: scaleIn .15s; }
.search-results .list-item { cursor: pointer; padding: 9px 12px; }
.pos-badge { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.pos-1 { background: linear-gradient(135deg, #fde047, #f59e0b); color: #5a3a00; }
.pos-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.pos-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); width: 280px !important; box-shadow: var(--shadow-lg); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none !important; }
  .main { margin-inline-start: 0 !important; }
  .menu-btn { display: grid; }
  .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .form-grid .c3, .form-grid .c4, .form-grid .c2 { grid-column: span 6; }
  .form-grid .c6, .form-grid .c8 { grid-column: span 12; }
  .topbar .title .bi-sub, .user-chip .u-txt { display: none; }
}
@media (max-width: 640px) {
  :root { --pad: 14px; --topbar-h: 58px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat .s-ic { width: 42px; height: 42px; border-radius: 12px; }
  .stat .s-val { font-size: 21px; }
  .page-head h1 { font-size: 20px; }
  .form-grid .c3, .form-grid .c4, .form-grid .c2 { grid-column: span 12; }
  .toolbar .field { min-width: calc(50% - 5px); flex: 1; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 94vh; overflow-y: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  /* tables become cards */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { border-bottom: 1px solid var(--border); padding: 10px 6px; }
  .tbl.stack td { border: 0; padding: 4px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
  .tbl.stack td::before { content: attr(data-label); font-weight: 650; color: var(--muted); font-size: 12px; text-align: start; }
  .tbl.stack td.actions { justify-content: flex-end; }
  .tbl.stack td.actions::before { display: none; }
  .tbl.stack td.first { justify-content: flex-start; }
  .tbl.stack td.first::before { display: none; }
  .tbl.stack tfoot { display: block; }
  .tbl.stack tfoot tr { display: flex; flex-wrap: wrap; }
  .table-wrap { max-height: none; }
  .tabs { margin-inline: calc(var(--pad) * -1); border-radius: 0; border-inline: 0; }
  .user-chip { padding: 3px; }
  .hide-sm { display: none !important; }
}

/* ---------------------------------------------------------------- PRINT */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff !important; background-image: none !important; color: #000; font-size: 12px; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; animation: none !important; transition: none !important; }
}
.pdoc { font-family: "Segoe UI", Arial, sans-serif; color: #111; background: #fff; font-size: 12.5px; line-height: 1.45; --pc: var(--theme-p, #4f46e5); }
.pdoc .page { page-break-after: always; break-after: page; position: relative; }
.pdoc .page:last-child { page-break-after: auto; break-after: auto; }
.pdoc .ur { font-family: var(--font-ur); }
.pdoc .hdr { display: flex; align-items: center; gap: 14px; border-bottom: 3px double var(--pc); padding-bottom: 10px; margin-bottom: 12px; }
.pdoc .hdr .lg { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; background: var(--pc); color: #fff; font-weight: 800; font-size: 24px; overflow: hidden; flex-shrink: 0; }
.pdoc .hdr .lg img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pdoc .hdr .nm { flex: 1; text-align: center; }
.pdoc .hdr .nm h1 { font-size: 22px; margin: 0; color: var(--pc); letter-spacing: .5px; text-transform: uppercase; }
.pdoc .hdr .nm .ur { font-size: 18px; line-height: 1.6; }
.pdoc .hdr .nm p { margin: 1px 0 0; font-size: 11.5px; color: #444; }
.pdoc .doc-title { text-align: center; margin: 4px 0 12px; }
.pdoc .doc-title span { display: inline-block; background: var(--pc); color: #fff; padding: 5px 22px; border-radius: 30px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.pdoc table.pt { width: 100%; border-collapse: collapse; }
.pdoc table.pt th, .pdoc table.pt td { border: 1px solid #555; padding: 5px 7px; text-align: start; }
.pdoc table.pt th { background: color-mix(in srgb, var(--pc) 14%, #fff); font-weight: 700; }
.pdoc table.pt.c td, .pdoc table.pt.c th { text-align: center; }
.pdoc table.pt.tight td, .pdoc table.pt.tight th { padding: 2px 3px; font-size: 10px; }
.pdoc .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.pdoc .info-grid div { display: flex; gap: 6px; border-bottom: 1px dotted #999; padding: 3px 0; }
.pdoc .info-grid b { min-width: 120px; }
.pdoc .sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 46px; }
.pdoc .sign div { flex: 1; text-align: center; border-top: 1px solid #333; padding-top: 4px; font-weight: 600; }
.pdoc .muted { color: #555; }
.pdoc .slips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.pdoc .slip { border: 1px dashed #777; padding: 10px; font-size: 11px; }
.pdoc .slip + .slip { border-left: 0; }
.pdoc .slip .copy { text-align: center; font-weight: 800; background: #111; color: #fff; padding: 2px; margin-bottom: 6px; font-size: 10.5px; letter-spacing: 1px; }
.pdoc .slip .hdr { padding-bottom: 6px; margin-bottom: 6px; gap: 8px; }
.pdoc .slip .hdr .lg { width: 38px; height: 38px; font-size: 15px; border-radius: 8px; }
.pdoc .slip .hdr .nm h1 { font-size: 13.5px; }
.pdoc .slip .hdr .nm .ur { font-size: 12px; }
.pdoc .slip .hdr .nm p { font-size: 9.5px; }
.pdoc .slip table.pt td, .pdoc .slip table.pt th { padding: 3px 5px; }
.pdoc .slip .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; margin-bottom: 6px; }
.pdoc .stamp { display: inline-block; border: 3px solid; padding: 2px 12px; font-weight: 900; font-size: 18px; transform: rotate(-12deg); border-radius: 8px; letter-spacing: 2px; }
.pdoc .stamp.paid { color: #16a34a; } .pdoc .stamp.unpaid { color: #dc2626; }
.pdoc .cert { display: flex; flex-direction: column; border: 10px solid var(--pc); outline: 2px solid var(--pc); outline-offset: -18px; padding: 38px 46px; min-height: 255mm; position: relative; background:
  radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--pc) 6%, #fff), #fff 70%); }
.pdoc .cert .wm { position: absolute; inset: 0; display: grid; place-items: center; opacity: .06; font-size: 120px; font-weight: 900; color: var(--pc); pointer-events: none; transform: rotate(-25deg); }
.pdoc .cert h2 { text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 34px; color: var(--pc); margin: 18px 0 4px; letter-spacing: 1px; }
.pdoc .cert .sign { margin-top: auto; padding-top: 70px; }
.pdoc .cert .body { font-family: Georgia, "Times New Roman", serif; font-size: 16.5px; line-height: 2.25; text-align: justify; margin-top: 18px; }
.pdoc .cert .body u { text-decoration: none; border-bottom: 1px solid #333; padding: 0 6px; font-weight: 700; font-style: italic; }
.pdoc .rc-photo { width: 90px; height: 105px; border: 1px solid #555; object-fit: cover; display: grid; place-items: center; font-size: 10px; color: #777; }
.pdoc .idc { width: 85.6mm; height: 54mm; border-radius: 3mm; overflow: hidden; border: 1px solid #999; display: inline-flex; flex-direction: column; margin: 2mm; vertical-align: top; page-break-inside: avoid; break-inside: avoid; background: #fff; }
.pdoc .idc .top { background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 60%, #000)); color: #fff; padding: 4px 8px; display: flex; gap: 6px; align-items: center; }
.pdoc .idc .top b { font-size: 11px; display: block; line-height: 1.1; }
.pdoc .idc .top span { font-size: 8px; }
.pdoc .idc .bd { display: flex; gap: 8px; padding: 6px 8px; flex: 1; font-size: 9.5px; }
.pdoc .idc .bd img, .pdoc .idc .bd .ph { width: 20mm; height: 24mm; object-fit: cover; border: 1px solid #ccc; border-radius: 2mm; display: grid; place-items: center; font-size: 22px; color: #999; }
.pdoc .idc .ft { background: color-mix(in srgb, var(--pc) 15%, #fff); text-align: center; font-size: 8px; padding: 2px; }

/* =====================================================================
   v1.1 — professional shell: sidebar sub-menus, top search, KPI cards
   ===================================================================== */
.brand { gap: 11px; padding: 0 12px 0 16px; }
.brand-logo span { font-weight: 800; font-size: 15px; letter-spacing: .5px; }
.brand-text { flex: 1; }
.sb-collapse { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 10px; flex-shrink: 0; }
.sb-new { padding: 14px 12px 4px; position: relative; }
.new-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 650; cursor: pointer; transition: box-shadow .2s, transform .15s, border-color .2s; box-shadow: var(--shadow-sm); }
.new-btn:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.new-btn:active { transform: scale(.98); }
.new-btn .new-ic { width: 26px; height: 26px; padding: 4px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); stroke: #fff; }
.new-btn .lbl { flex: 1; text-align: start; }
kbd { font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.new-menu { inset-inline: 12px auto; top: calc(100% + 4px); min-width: 240px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; }
.new-menu a { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 13px; }
.new-menu a:hover { background: var(--surface-3); }
.new-menu .n-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--tone, var(--primary)); }

.nav { padding-top: 6px; }
.nav-item { margin: 1px 0; }
.nav .nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--text-2); font-weight: 600; position: relative; transition: background .2s, color .2s; }
.nav .nav-link:hover { background: var(--surface-3); color: var(--text); transform: none; }
.nav-item.active > .nav-link { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 18px -10px var(--primary); }
.nav-item.active > .nav-link::before { display: none; }
.nav-item.active > .nav-link .nav-badge { background: rgba(255,255,255,.25); color: #fff; border-color: transparent; }
.nav .nav-link .lbl { flex: 1; }
.chev { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; transition: transform .3s var(--ease), background .2s; opacity: .7; }
.chev .ic { width: 15px; height: 15px; }
.chev:hover { background: rgba(127,127,127,.15); opacity: 1; }
.nav-item.open > .nav-link .chev { transform: rotate(90deg); }
html[dir="rtl"] .chev { transform: scaleX(-1); }
html[dir="rtl"] .nav-item.open > .nav-link .chev { transform: rotate(90deg); }
.nav-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 20px; font-size: 11px; font-weight: 750; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease); }
.nav-item.open > .sub { grid-template-rows: 1fr; }
.sub-inner { overflow: hidden; padding-inline-start: 22px; position: relative; }
.sub-inner::before { content: ""; position: absolute; inset-inline-start: 22px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--border); }
.nav .sub a { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 16px; margin: 2px 0 2px 6px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .95em; position: relative; transition: background .2s, color .2s, padding .2s; }
html[dir="rtl"] .nav .sub a { padding: 7px 16px 7px 10px; margin: 2px 6px 2px 0; }
.nav .sub a .ic { width: 16px; height: 16px; opacity: .75; }
.nav .sub a:hover { background: var(--surface-3); color: var(--text); padding-inline-start: 20px; transform: none; }
.nav .sub a.active { color: var(--primary); background: var(--primary-softer); font-weight: 700; }
.nav .sub a.active .ic { opacity: 1; }
.nav .sub a.active::before { content: ""; position: absolute; inset-inline-start: -8px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--surface); }
.nav-item.open > .sub a { animation: fadeUp .35s var(--ease) both; }
.nav-item.open > .sub a:nth-child(2) { animation-delay: 30ms; } .nav-item.open > .sub a:nth-child(3) { animation-delay: 60ms; }
.nav-item.open > .sub a:nth-child(4) { animation-delay: 90ms; } .nav-item.open > .sub a:nth-child(5) { animation-delay: 120ms; }
.nav-item.open > .sub a:nth-child(n+6) { animation-delay: 150ms; }
.today-widget { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 8px; min-height: 64px; }
.today-widget .lbl { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.today-widget b { font-size: 16px; }
.ring { width: 46px; height: 46px; flex-shrink: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dasharray 1s var(--ease); }
.ring text { transform: rotate(90deg); transform-origin: 20px 20px; font-size: 9.5px; font-weight: 800; fill: var(--text); }

/* top bar */
.topbar { gap: 10px; }
.gsearch { position: relative; flex: 1; max-width: 460px; display: flex; align-items: center; height: 42px; border-radius: 13px; border: 1px solid var(--border-2); background: var(--surface); transition: box-shadow .2s, border-color .2s, max-width .35s var(--ease); }
.gsearch.focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); max-width: 560px; }
.gsearch .gs-ic { margin-inline-start: 13px; color: var(--muted); }
.gs-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: 0 10px; }
.gs-input::placeholder { color: var(--muted); }
.gs-kbd { margin-inline-end: 10px; }
.gs-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; min-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 80; max-height: 70vh; overflow-y: auto; padding: 6px; animation: scaleIn .18s var(--ease); }
.gs-sec { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.gs-item.sel { background: var(--primary-softer); box-shadow: inset 0 0 0 1px var(--primary-soft); }
.gs-name { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gs-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-results mark { background: color-mix(in srgb, var(--warning) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px; color: var(--muted); }
.gs-empty .spin { width: 24px; height: 24px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.gs-foot { display: flex; gap: 16px; justify-content: flex-end; padding: 8px 10px 4px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 6px; }
.gs-foot kbd { margin-inline-end: 3px; }
.gsearch.in-modal { max-width: none; }
.gsearch.in-modal .gs-results { position: static; min-width: 0; box-shadow: none; border: 0; margin-top: 8px; max-height: 60vh; }
.search-sm { display: none; }
.icon-btn.bordered { border: 1px solid var(--border); background: var(--surface); }
.top-chip { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 220px; }
.top-chip .ic { color: var(--primary); }
.top-chip div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.top-chip b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-chip span { font-size: 11px; color: var(--muted); }
.date-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 550; font-size: 13px; white-space: nowrap; }
.date-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulseRing 2s infinite; box-shadow: 0 0 0 0 var(--success); }
.lang-seg { display: inline-flex; padding: 3px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); height: 40px; align-items: center; }
.lang-seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 750; font-size: 13px; padding: 0 12px; height: 32px; border-radius: 9px; cursor: pointer; transition: background .25s, color .25s; }
.lang-seg button[data-l="ur"] { font-family: var(--font-ur); }
.lang-seg button.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 4px 10px -6px var(--primary); }
.bell-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); animation: pop .4s; }
.dropdown.notif { width: 360px; padding: 6px; }
.dd-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 550; font-size: 13.5px; }
.notif-item:hover { background: var(--surface-3); }
.notif-item > .ic:last-child { color: var(--muted); width: 16px; }
.n-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.n-ic.tone-danger { background: var(--danger-soft); color: var(--danger); } .n-ic.tone-warning { background: var(--warning-soft); color: var(--warning); }
.n-ic.tone-info { background: var(--info-soft); color: var(--info); } .n-ic.tone-primary { background: var(--primary-soft); color: var(--primary); }
.user-chip { height: 42px; border-radius: 13px; padding: 4px 12px 4px 5px; }

/* dashboard v2 */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head .greet { color: var(--text-2); font-size: 13.5px; }
.dash-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; margin: 2px 0 4px; }
.dash-head .sub { color: var(--muted); font-size: 13px; }
.kpi { position: relative; overflow: hidden; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-height: 156px; }
.kpi .k-lbl { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.kpi .k-lbl .ic { width: 18px; height: 18px; }
.kpi .k-val { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.kpi .k-chip { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; white-space: nowrap; }
.kpi .spark { width: 120px; height: 46px; flex-shrink: 0; overflow: visible; }
.kpi.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: 0 18px 36px -18px var(--primary); }
.kpi.primary .k-lbl { color: rgba(255,255,255,.88); }
.kpi.primary::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.kpi.primary .k-chip { background: rgba(0,0,0,.18); color: #fff; }
.kpi .bar { height: 7px; border-radius: 8px; background: rgba(255,255,255,.25); overflow: hidden; }
.kpi .bar i { display: block; height: 100%; border-radius: 8px; background: #fff; transform-origin: left; animation: growX 1.1s var(--ease) both; }
a.k-chip:hover { filter: brightness(.95); }
.spark .sp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) .2s forwards; }
.spark .sp-area { opacity: .16; animation: fadeIn 1s .5s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
html[data-anim="off"] .spark .sp-line { stroke-dashoffset: 0; }
.tc-stats { display: flex; gap: 34px; flex-wrap: wrap; margin-bottom: 8px; }
.tc-stats div span { display: block; font-size: 12.5px; color: var(--muted); }
.tc-stats div b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.seg-sm { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.seg-sm button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.seg-sm button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.lolli .stem { stroke-width: 2.5; stroke-linecap: round; transform-box: fill-box; transform-origin: bottom; animation: growY .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.lolli .dot { transform-box: fill-box; transform-origin: center; animation: pop .5s var(--ease) both; animation-delay: calc(300ms + var(--i, 0) * 25ms); cursor: pointer; }
.lolli .target { stroke: var(--warning); stroke-dasharray: 5 5; stroke-width: 1.5; }
.lolli .tlabel { fill: var(--warning); font-size: 10.5px; font-weight: 700; }
.net-val { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

@media (max-width: 1280px) { .hide-md { display: none !important; } }
@media (max-width: 760px) {
  .gsearch { display: none; }
  .search-sm { display: grid; }
  .top-actions { gap: 4px; }
  .lang-seg button { padding: 0 9px; }
  .dash-head h1 { font-size: 23px; }
  .kpi .k-val { font-size: 25px; }
  .kpi .spark { width: 84px; }
  .kpi { min-height: 0; }
  .dropdown.notif { width: calc(100vw - 24px); position: fixed; top: 64px; inset-inline: 12px; }
  .tc-stats { gap: 18px; }
}


/* compact sidebar (desktop only) */
@media (min-width: 981px) {
  html[data-sidebar="compact"] .sidebar:not(:hover) .lbl, html[data-sidebar="compact"] .sidebar:not(:hover) .nav-group span,
  html[data-sidebar="compact"] .sidebar:not(:hover) .brand-text, html[data-sidebar="compact"] .sidebar:not(:hover) .side-foot .lbl { display: none; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .nav a { justify-content: center; }
  html[data-sidebar="compact"] .sidebar:hover { width: 264px; box-shadow: var(--shadow-lg); }
  html[data-sidebar="compact"] .sidebar:not(:hover) .nav-group { padding: 10px 0 4px; text-align: center; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .nav-group::after { content: "•••"; letter-spacing: 2px; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .chev, html[data-sidebar="compact"] .sidebar:not(:hover) .sub,
  html[data-sidebar="compact"] .sidebar:not(:hover) .nav-badge, html[data-sidebar="compact"] .sidebar:not(:hover) kbd,
  html[data-sidebar="compact"] .sidebar:not(:hover) .sb-collapse { display: none; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .nav-link { justify-content: center; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .new-btn { justify-content: center; padding: 8px; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .today-widget { justify-content: center; padding: 8px; }
  html[data-sidebar="compact"] .sidebar:not(:hover) .brand { justify-content: center; padding: 0; }
}

.new-btn kbd.lbl { flex: 0 0 auto; }
@media (max-width: 760px) {
  .kpi .k-val { font-size: 22px; word-break: break-word; }
  .kpi .k-foot { flex-wrap: wrap; }
  .kpi .spark { width: 100%; height: 34px; }
  .kpi .k-lbl { font-size: 12.5px; }
}
.gsearch.in-modal { display: flex !important; }
.gsearch.in-modal { flex-wrap: wrap; height: auto; border: 0; box-shadow: none !important; }
.gsearch.in-modal .gs-ic { position: absolute; top: 13px; }
.gsearch.in-modal .gs-input { height: 46px; border: 1px solid var(--primary); border-radius: 12px; padding-inline-start: 40px; box-shadow: 0 0 0 4px var(--primary-soft); }
.gsearch.in-modal .gs-kbd { display: none; }
.gsearch.in-modal .gs-results { flex: 0 0 100%; padding: 0; }
@media (max-width: 760px) {
  .profile-head { flex-direction: column; align-items: flex-start; }
  .mini-stats > div { flex: 1 1 40%; }
}

/* =====================================================================
   v1.2 — theme gallery, on-primary contrast, messaging, charts
   ===================================================================== */
.drawer.wide { width: 440px; }
.th-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px; }
.th-card { display: block; text-align: start; padding: 0; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; overflow: hidden; font: inherit; color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.th-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.th-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.th-prev { height: 78px; display: flex; background: var(--tbg); border-bottom: 1px solid var(--border); position: relative; }
.th-side { width: 30%; background: var(--tsd); border-inline-end: 1px solid var(--tln); padding: 8px 7px; display: flex; flex-direction: column; gap: 5px; }
.th-side i { display: block; height: 4px; border-radius: 3px; background: var(--tln); }
.th-side i:first-child { width: 70%; }
.th-main { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.th-hero { height: 26px; border-radius: 7px; background: linear-gradient(110deg, var(--tp), var(--tp2)); }
.th-boxes { display: flex; gap: 5px; }
.th-boxes i { flex: 1; height: 15px; border-radius: 5px; background: var(--tsf); border: 1px solid var(--tln); }
.th-custom { background: conic-gradient(from 0deg, #ef4444, #f59e0b, #84cc16, #10b981, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444); align-items: center; justify-content: center; }
.th-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.th-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 11px; }
.th-foot b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-mode { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--border-2); color: var(--text-2); white-space: nowrap; }
.th-act { font-size: 11px; font-weight: 750; padding: 2px 9px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }

/* text on top of the theme colour adapts (dark text on lime / gold) */
.btn-primary { --b-fg: var(--on-primary, #fff); }
.tab.active, .nav-item.active > .nav-link, .lang-seg button.on, .kpi.primary, .hero, .brand-logo, .login-card .logo-big, .login-art,
.bell-count, .perm-table .seg button.on, .new-menu .tone-primary .n-ic { color: var(--on-primary, #fff); }
.kpi.primary .k-lbl, .kpi.primary .k-chip, .hero .btn { color: inherit; }
.kpi.primary .bar i { background: currentColor; }
.new-btn .new-ic { stroke: var(--on-primary, #fff); }
.stat:not([class*="tone-"]) .s-ic { color: var(--on-primary, #fff); }
.nav-item.active > .nav-link .nav-badge { color: inherit; }

/* messaging */
.channel-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13px; }
.info-strip { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--primary-softer); color: var(--text-2); font-size: 13px; border: 1px dashed var(--primary-soft); margin-bottom: 6px; }
.info-strip .ic { color: var(--primary); }
.channel-card { cursor: pointer; border-width: 1.5px; }
.channel-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.wa-bubble { background: #dcf8c6; color: #111; border-radius: 12px 12px 4px 12px; padding: 12px 14px; white-space: pre-line; max-width: 420px; box-shadow: 0 1px 1px rgba(0,0,0,.1); font-size: 14px; position: relative; }
html[data-mode="dark"] .wa-bubble { background: #005c4b; color: #e9edef; }
.sq-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.sq-body { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.sq-done { opacity: .55; }
.sq-done b::after { content: " ✓"; color: var(--success); }
@media (min-width: 761px) { .hide-md-up { display: none !important; } }

/* charts v2 */
.chart .bar { transition: opacity .2s, filter .2s; }
.chart .bar:hover { opacity: 1; filter: brightness(1.12) saturate(1.1); }
.cbar { transform-box: fill-box; transform-origin: bottom; animation: growY .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); cursor: pointer; transition: filter .2s; }
.cbar:hover { filter: brightness(1.12); }
.chart .val-lbl { fill: var(--text-2); font-size: 10.5px; font-weight: 700; }
.spark { overflow: visible; }
.spark .sp-line { stroke-width: 2.2; }
.spark .sp-area { opacity: 1; animation: fadeIn 1s .4s both; }
.spark .sp-dot { animation: pop .5s 1s both; transform-box: fill-box; transform-origin: center; }
.kpi .spark { width: 132px; height: 50px; }
.target-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.target-chip i { width: 18px; height: 0; border-top: 2px dashed var(--warning); }
.legend-sq { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.legend-sq i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------- premium print templates ---------------- */
.pdoc { --gold: #c39a2b; --pc-soft: color-mix(in srgb, var(--pc) 10%, #fff); }
.pdoc .lg-ini { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 65%, #000)); font-family: Georgia, serif; }
/* branded header for all documents */
.pdoc .phead { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; position: relative;
  background: linear-gradient(100deg, var(--pc-soft), #fff 70%); border: 1px solid color-mix(in srgb, var(--pc) 25%, #fff); }
.pdoc .phead::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -6px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--pc), var(--gold), var(--pc)); }
.pdoc .ph-logo { width: 62px; height: 62px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--pc); background: #fff; }
.pdoc .ph-logo img { width: 100%; height: 100%; object-fit: contain; }
.pdoc .ph-name { flex: 1; min-width: 0; }
.pdoc .ph-name h1 { margin: 0; font-size: 22px; letter-spacing: .6px; text-transform: uppercase; color: var(--pc); font-family: Georgia, "Times New Roman", serif; }
.pdoc .ph-name .ur { font-size: 16px; line-height: 1.6; color: #333; }
.pdoc .ph-tag { margin: 1px 0 0; font-size: 10.5px; color: var(--gold); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.pdoc .ph-contact { text-align: end; font-size: 10.5px; color: #444; line-height: 1.55; max-width: 38%; }
.pdoc .phead.compact { padding: 6px 12px; }
.pdoc .phead.compact .ph-logo { width: 44px; height: 44px; }
.pdoc .phead.compact .ph-name h1 { font-size: 17px; }
.pdoc .phead.compact .ph-name .ur { font-size: 13px; }
.pdoc .doc-title { margin: 14px 0 12px; }
.pdoc .doc-title > span { background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 70%, #000)); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--gold); }
.pdoc .doc-title > span span { background: none; padding: 0; box-shadow: none; display: inline; }
.pdoc .bc rect, .pdoc .qr { shape-rendering: crispEdges; }

/* fee voucher cards */
.pdoc .fv-page { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7mm; align-items: start; }
.pdoc .fv { border: 1px solid #cfd6dd; border-radius: 10px; overflow: hidden; position: relative; font-size: 10.5px; background: #fff; }
.pdoc .fv-head { display: flex; gap: 9px; align-items: center; padding: 9px 11px; color: #fff; background: linear-gradient(120deg, var(--pc), color-mix(in srgb, var(--pc) 70%, #000)); }
.pdoc .fv-logo { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.95); flex-shrink: 0; border: 2px solid rgba(255,255,255,.6); }
.pdoc .fv-logo img { width: 100%; height: 100%; object-fit: contain; }
.pdoc .fv-sch b { display: block; font-size: 13px; line-height: 1.2; }
.pdoc .fv-sch span { font-size: 8.8px; opacity: .92; }
.pdoc .fv-title { display: flex; justify-content: space-between; align-items: center; padding: 7px 11px; background: #f2f5f7; border-bottom: 1px solid #e1e6ea; font-size: 9.6px; }
.pdoc .fv-title b { letter-spacing: .4px; }
.pdoc .fv-title span { color: #555; font-family: Consolas, monospace; }
.pdoc .fv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 8px 11px; }
.pdoc .fv-grid label { display: block; font-size: 7.8px; text-transform: uppercase; color: #777; letter-spacing: .5px; }
.pdoc .fv-grid b { font-size: 10.6px; }
.pdoc .fv-rows { margin: 2px 11px; border-top: 1px solid #e1e6ea; }
.pdoc .fv-rows div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed #e4e8ec; }
.pdoc .fv-rows .disc { color: #0a7a3b; }
.pdoc .fv-total { display: flex; justify-content: space-between; margin: 0 11px; padding: 7px 0; border-top: 2px solid #111; font-size: 12.5px; font-weight: 800; }
.pdoc .fv-words { margin: 0 11px; padding: 5px 8px; background: #f2f5f7; border-radius: 5px; font-style: italic; font-size: 9.2px; }
.pdoc .fv-due { display: flex; justify-content: space-between; padding: 7px 11px 2px; font-size: 9.6px; }
.pdoc .fv-due b { color: #c0262d; }
.pdoc .fv-codes { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 11px; }
.pdoc .fv-bc { width: 58%; }
.pdoc .fv-qr { width: 64px; }
.pdoc .fv-note { padding: 0 11px; font-size: 8.4px; color: #666; }
.pdoc .fv-sign { display: flex; justify-content: space-between; padding: 22px 11px 9px; font-size: 9.2px; }
.pdoc .fv-sign span { border-top: 1px solid #333; padding-top: 2px; min-width: 70px; text-align: center; }
.pdoc .fv-stamp { position: absolute; top: 112px; right: 12px; transform: rotate(-14deg); border: 3px double; padding: 2px 14px; border-radius: 8px; font-weight: 900; font-size: 20px; letter-spacing: 3px; opacity: .85; }
.pdoc .fv-stamp.paid { color: #15803d; } .pdoc .fv-stamp.part { color: #d97706; }

/* ID cards */
.pdoc .idc-sheet { display: grid; grid-template-columns: repeat(2, auto); gap: 8mm 12mm; justify-content: center; align-content: start; }
.pdoc .idc-pair { display: flex; gap: 3mm; }
.pdoc .idc2 { width: 54mm; height: 85.6mm; border-radius: 3.2mm; overflow: hidden; background: #fff; border: .3mm solid #cfd6dd; position: relative; display: flex; flex-direction: column; font-size: 7.4px; break-inside: avoid; }
.pdoc .idc-top { height: 25mm; padding: 2.4mm 3mm 0; color: #fff; text-align: center; background: linear-gradient(140deg, var(--pc), color-mix(in srgb, var(--pc) 65%, #000)); border-radius: 0 0 50% 50% / 0 0 18% 18%; }
.pdoc .idc-brand { display: flex; align-items: center; justify-content: center; gap: 1.6mm; }
.pdoc .idc-brand b { font-size: 9.6px; line-height: 1.1; }
.pdoc .idc-logo { width: 6mm; height: 6mm; border-radius: 1.4mm; overflow: hidden; background: #fff; flex-shrink: 0; }
.pdoc .idc-logo img { width: 100%; height: 100%; object-fit: contain; }
.pdoc .idc-logo .lg-ini { font-size: 7px; }
.pdoc .idc-kind { font-size: 5.6px; letter-spacing: 1.2px; opacity: .9; margin-top: 1mm; font-weight: 700; }
.pdoc .idc-photo { width: 21mm; height: 21mm; border-radius: 50%; margin: -12mm auto 0; border: 1mm solid #fff; box-shadow: 0 0 0 .5mm var(--pc); overflow: hidden; background: #e8edf2; display: grid; place-items: center; position: relative; }
.pdoc .idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.pdoc .idc-photo span { font-size: 26px; color: #6b7785; font-weight: 300; }
.pdoc .idc-name { text-align: center; font-weight: 800; font-size: 10px; margin-top: 1.4mm; padding: 0 2mm; line-height: 1.15; }
.pdoc .idc-id { margin: 1mm auto 0; padding: .4mm 3mm; border-radius: 3mm; background: var(--pc); color: #fff; font-weight: 800; font-size: 7.4px; letter-spacing: .5px; }
.pdoc .idc-rows { padding: 1.6mm 3mm 0; flex: 1; }
.pdoc .idc-rows div { display: flex; justify-content: space-between; gap: 2mm; padding: .55mm 0; border-bottom: .2mm solid #edf0f3; }
.pdoc .idc-rows span { color: #7a8591; }
.pdoc .idc-rows b { text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30mm; }
.pdoc .idc-codes { display: flex; align-items: center; justify-content: space-between; gap: 2mm; padding: 1mm 3mm; }
.pdoc .idc-bc { width: 30mm; }
.pdoc .idc-qr { width: 11mm; }
.pdoc .idc-foot { background: #0f172a; color: #fff; text-align: center; font-size: 6.4px; padding: 1.1mm; letter-spacing: .5px; font-weight: 700; }
.pdoc .idc-bhead { background: linear-gradient(140deg, var(--pc), color-mix(in srgb, var(--pc) 65%, #000)); color: #fff; text-align: center; font-weight: 800; font-size: 9.4px; padding: 2.6mm 2mm; }
.pdoc .idc-bbody { padding: 2mm 3mm 0; flex: 1; }
.pdoc .idc-bbody h5 { margin: 1.4mm 0 .6mm; font-size: 7.6px; color: var(--pc); }
.pdoc .idc-bbody ol { margin: 0; padding-left: 3.6mm; line-height: 1.45; }
.pdoc .idc-bbody p { margin: 0; line-height: 1.4; }
.pdoc .idc-bbc { padding: 0 5mm; }
.pdoc .idc-bsign { display: flex; justify-content: space-between; padding: 3mm 3mm 2.4mm; font-size: 6.4px; }
.pdoc .idc-bsign span { border-top: .2mm solid #333; padding-top: .6mm; }

/* premium certificate */
.pdoc .pcert { position: relative; width: 190mm; height: 275mm; margin: 0 auto; background: #fffdf7; overflow: hidden; }
.pdoc .pc-bg, .pdoc .pc-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdoc .pc-wm { position: absolute; left: 50%; top: 54%; width: 110mm; height: 110mm; transform: translate(-50%, -50%); display: grid; place-items: center; opacity: .06;
  font: 900 150px Georgia, serif; color: var(--pc); }
.pdoc .pc-wm img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(.2); }
.pdoc .pc-content { position: absolute; inset: 15mm 20mm 21mm; display: flex; flex-direction: column; }
.pdoc .pc-head { text-align: center; }
.pdoc .pc-logo { width: 22mm; height: 22mm; margin: 0 auto 2mm; border-radius: 50%; overflow: hidden; border: 1mm solid #fff; box-shadow: 0 0 0 .6mm var(--gold), 0 0 0 1.4mm var(--pc); background: #fff; }
.pdoc .pc-logo img { width: 100%; height: 100%; object-fit: contain; }
.pdoc .pc-logo .lg-ini { font-size: 26px; }
.pdoc .pc-head h1 { margin: 0; font: 700 25px Georgia, "Times New Roman", serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--pc); }
.pdoc .pc-ur { font-size: 18px; color: #333; }
.pdoc .pc-head p { margin: 1mm 0 0; font-size: 10.5px; color: #555; }
.pdoc .pc-meta { display: flex; justify-content: space-between; margin-top: 5mm; font-size: 11px; color: #333; border-top: .3mm solid var(--gold); border-bottom: .3mm solid var(--gold); padding: 1.5mm 2mm; }
.pdoc .pc-ribbon { margin: 7mm auto 0; position: relative; display: inline-block; align-self: center; }
.pdoc .pc-ribbon span { display: inline-block; padding: 1.6mm 12mm; color: #fff; font: 700 12px Georgia, serif; letter-spacing: 6px; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 70%, #000));
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); }
.pdoc .pc-title { text-align: center; margin: 3mm 0 0; font: italic 700 34px Georgia, "Times New Roman", serif; color: #1f2937; letter-spacing: .5px; }
.pdoc .pc-title::after { content: ""; display: block; width: 60mm; height: .8mm; margin: 2mm auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.pdoc .pc-title-ur { text-align: center; font-size: 19px; color: var(--pc); margin-top: 1mm; }
.pdoc .pc-body { margin-top: 8mm; font: 16px/2.2 Georgia, "Times New Roman", serif; text-align: justify; color: #222; }
.pdoc .pc-body p { margin: 0 0 2mm; text-indent: 10mm; }
.pdoc .pc-body u { text-decoration: none; border-bottom: .3mm dotted #555; padding: 0 1.5mm; font-weight: 700; font-style: italic; color: #111; }
.pdoc .pc-wish { text-align: center; text-indent: 0 !important; font-style: italic; color: var(--pc); margin-top: 3mm !important; }
.pdoc .pc-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 6mm; }
.pdoc .pc-seal { width: 30mm; height: 30mm; filter: drop-shadow(0 .6mm .8mm rgba(0,0,0,.25)); }
.pdoc .pc-signs { flex: 1; display: flex; justify-content: space-around; gap: 6mm; }
.pdoc .pc-signs div { text-align: center; min-width: 34mm; }
.pdoc .pc-signs i { display: block; border-top: .35mm solid #222; margin-bottom: 1mm; }
.pdoc .pc-signs b { display: block; font-size: 11px; }
.pdoc .pc-signs span { font-size: 9.5px; color: #555; }
.pdoc .pc-verify { width: 20mm; text-align: center; font-size: 7px; margin-inline-end: 2mm; color: #555; }
.pdoc .pc-verify .qr { width: 20mm; height: 20mm; display: block; border: .3mm solid #ddd; }

/* ---------------------------------------------------------------- v2.0 PRINT PREVIEW */
body.pv-open { overflow: hidden; }
.pv { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg) 70%, #475569); animation: pvIn .18s ease; }
.pv.closing { animation: pvOut .16s ease forwards; }
@keyframes pvIn { from { opacity: 0; transform: scale(.985); } }
@keyframes pvOut { to { opacity: 0; } }
.pv-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.pv-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.pv-title > .ic { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.pv-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-title span { display: block; font-size: 12px; color: var(--muted); }
.pv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--text); padding: 7px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button + button { border-inline-start: 1px solid var(--border); }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--primary); color: var(--on-primary, #fff); }
.seg button .ic { width: 15px; height: 15px; }
.seg .pv-zl { min-width: 58px; justify-content: center; font-variant-numeric: tabular-nums; }
.seg [data-o="l"] .ic { transform: rotate(90deg); }
.pv-stage { flex: 1; overflow: auto; padding: 20px; cursor: grab; overscroll-behavior: contain; }
.pv-stage.grab { cursor: grabbing; user-select: none; }
.pv-size { margin: 0 auto; position: relative; }
.pv-canvas { transform-origin: 0 0; position: absolute; left: 0; top: 0; width: max-content; }
.pv-canvas .pdoc { background: transparent; }
.pv-sheet { background: #fff; box-shadow: 0 6px 26px rgba(15, 23, 42, .28); margin: 0 0 18px; box-sizing: border-box; overflow: hidden; border-radius: 2px; }
.pv-sheet .page { page-break-after: auto; }
@media (max-width: 700px) {
  .pv-bar { padding: 8px 10px; gap: 8px; }
  .pv-tools { width: 100%; justify-content: space-between; }
  .seg button { padding: 6px 8px; font-size: 12px; }
  .seg button .ic + * { display: none; }
  .pv-stage { padding: 10px; }
  #pv-print { order: 9; flex: 1; justify-content: center; }
}
@media print { .pv { display: none !important; } }

/* ---------------------------------------------------------------- v2.0 FINANCE */
.pos { color: var(--success); } .neg { color: var(--danger); }
.fin-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.fin-tabs .tab { white-space: nowrap; text-decoration: none; }
.fin-acc-list { display: flex; flex-direction: column; gap: 6px; }
.fin-acc { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: inherit; text-decoration: none; border: 1px solid var(--border); transition: background .2s, transform .2s; }
.fin-acc:hover { background: var(--surface-2); transform: translateX(2px); }
.fin-acc .flex-1 { min-width: 0; } .fin-acc .flex-1 b { display: block; } .fin-acc .muted { display: block; }
.s-ic.sm { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.s-ic.sm .ic { width: 18px; height: 18px; }
.fin-lines { display: flex; flex-direction: column; gap: 2px; }
.fin-line { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; gap: 12px; align-items: center; padding: 8px 2px; border-bottom: 1px dashed var(--border); }
.fin-line a { color: inherit; } .fin-line > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-bar { height: 7px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.fin-bar i { display: block; height: 100%; border-radius: 9px; background: var(--success); animation: finBar .9s var(--ease) both; }
.fin-bar i.neg { background: var(--danger); }
@keyframes finBar { from { width: 0 !important; } }
.fin-sub { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; }
.fin-net { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 22px; border-left: 5px solid var(--success); }
.fin-net.bad { border-left-color: var(--danger); }
.fin-net > div:first-child { display: flex; align-items: center; gap: 14px; }
.fin-net > div:first-child > .ic { width: 34px; height: 34px; color: var(--success); }
.fin-net.bad > div:first-child > .ic { color: var(--danger); }
.fin-net span { display: block; font-weight: 700; color: var(--text-2); }
.fin-net b { font-size: 26px; font-weight: 800; }
.coa-group { font-weight: 700; }
.coa-group .ic, td .ic { vertical-align: -3px; }
.vf-tbl td { padding: 6px !important; } .vf-tbl .input { min-width: 0; }
.modal.xl { max-width: 1040px; }
.branch-menu { min-width: 290px; max-height: 70vh; overflow: auto; }
.branch-menu button.on { background: var(--primary-soft); }
.branch-menu .dd-head { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.top-chip { border: 0; cursor: pointer; font: inherit; text-align: start; }
.top-chip .chev-d { width: 14px; height: 14px; transform: rotate(90deg); opacity: .6; }
.co-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.co-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.co-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.co-meta > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.co-meta b { display: block; font-size: 17px; } .co-meta span { font-size: 11.5px; color: var(--muted); }
.info-strip { display: flex; gap: 8px; align-items: flex-start; background: var(--info-soft); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.info-strip .ic { color: var(--info); flex-shrink: 0; }
@media (max-width: 700px) { .fin-line { grid-template-columns: minmax(0, 1fr) auto; } .fin-line .fin-bar, .fin-line > span:nth-child(2) { display: none; } .co-meta { grid-template-columns: repeat(2, 1fr); } }
.branch-menu { inset-inline-start: 0; inset-inline-end: auto; }
.chip-check { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; background: var(--surface-2); cursor: pointer; }
.form-section .fs-hint { margin-inline-start: auto; font-weight: 600; font-size: 11.5px; color: var(--muted); background: var(--surface-2); padding: 2px 10px; border-radius: 99px; }
.pdoc .af .info-grid.af-grid { gap: 1px 18px; font-size: 11.8px; }
.pdoc .af .info-grid.af-grid div { padding: 2px 0; }
.pdoc .af .info-grid.af-grid b { min-width: 128px; }
.pdoc .af table.pt td { padding: 3px 6px; font-size: 12px; }
.pdoc .af .sign { margin-top: 34px; }
.mk-na { text-align: center; color: var(--muted); background: var(--surface-2); }
.lic-card.warn { border-left-color: var(--warning); } .lic-card.warn > div:first-child > .ic { color: var(--warning); }
.lic-card .mid-box { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.lic-card code { font-size: 20px; font-weight: 800; letter-spacing: 1px; flex: 1; }
.lic-strip { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; background: var(--warning-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.lic-strip.bad { background: var(--danger-soft); }
.lic-strip a { margin-inline-start: auto; }
.powered { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 14px; }
/* v2.2 editable (school's own) certificate */
.pdoc .blank-no { display: inline-block; min-width: 110px; border-bottom: 1px solid #333; height: 12px; vertical-align: bottom; }
.pdoc .ccert { border: 2.5px solid var(--pc); outline: 1px solid var(--pc); outline-offset: -7px; padding: 14mm 14mm 12mm; min-height: 268mm; display: flex; flex-direction: column; background: #fff; }
.pdoc .ccert .cc-meta { display: flex; justify-content: space-between; font-size: 12.5px; margin: 6px 0 10px; }
.pdoc .ccert .cc-title { text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 30px; color: var(--pc); margin: 14px 0 2px; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.pdoc .ccert .cc-title-ur { text-align: center; font-size: 20px; color: #333; }
.pdoc .ccert .cc-body { font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 2.15; text-align: justify; margin-top: 18px; }
.pdoc .ccert .cc-body u { text-decoration: none; border-bottom: 1px solid #333; padding: 0 5px; font-weight: 700; font-style: italic; }
.pdoc .ccert .cc-signs { margin-top: auto; padding-top: 60px; display: flex; justify-content: space-between; gap: 24px; }
.pdoc .ccert .cc-signs div { flex: 1; text-align: center; }
.pdoc .ccert .cc-signs i { display: block; border-top: 1px solid #333; margin-bottom: 4px; }
.pdoc .ccert .cc-signs span { display: block; font-size: 11.5px; color: #555; }
.ct-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ct-style { border: 2px solid var(--border); border-radius: 14px; padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); }
.ct-style.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ct-style .ic { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.ct-vars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ct-vars button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 2px 7px; font-size: 11.5px; cursor: pointer; font-family: monospace; color: var(--text); }
/* v2.3 signatures, stamps, QR verification, vendor credit */
.pdoc .sign div, .pdoc .sgw, .pdoc .idc-sg { position: relative; }
.pdoc .sig-img { position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%); max-width: 120px; max-height: 44px; object-fit: contain; }
.pdoc .stamp-img { position: absolute; left: 50%; bottom: calc(100% - 6px); transform: translateX(-80%) rotate(-8deg); max-width: 78px; max-height: 64px; object-fit: contain; opacity: .82; }
.pdoc .idc-sg .sig-img { max-width: 22mm; max-height: 7mm; }
.pdoc .idc-sg .stamp-img { max-width: 12mm; max-height: 12mm; }
.pdoc .idc-foot small { display: block; font-size: 4.6px; font-weight: 500; opacity: .7; letter-spacing: .2px; margin-top: .3mm; }
.pdoc .idc-soft { text-align: center; font-size: 4.8px; color: #888; padding: 0 0 .8mm; margin-top: -1.4mm; }
.pdoc .soft-by { text-align: center; font-size: 7.5px; color: #888; padding: 0 0 4px; }
.pdoc .rc-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pdoc .rc-qr .qr, .pdoc .rc-qr svg { width: 22mm; height: 22mm; display: block; }
.pdoc .ccert .cc-signs .cc-qr { flex: 0 0 20mm; text-align: center; font-size: 7px; color: #555; align-self: flex-end; }
.pdoc .ccert .cc-qr svg { width: 20mm; height: 20mm; display: block; margin-bottom: 1mm; }
.pdoc .ccert .cc-signs { align-items: flex-end; }
.pdoc .sign { margin-top: 62px; }
.pdoc .idc-bsign { padding-top: 9mm; align-items: flex-end; }
.pdoc .idc-bbc { padding-top: 1mm; }
.pdoc .idc-sg .sig-img { left: auto; right: 0; transform: none; max-width: 18mm; max-height: 6mm; bottom: calc(100% + .3mm); }
.pdoc .idc-sg .stamp-img { left: auto; right: 12mm; transform: rotate(-8deg); max-width: 9mm; max-height: 9mm; bottom: 0; }
/* v2.3 text-fit fixes: long names never run into neighbours */
.person .p-name, .person .p-sub { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.person > div { min-width: 0; }
.list-item > .person, .list-item > a.person, .list-item > a > .person { flex: 1 1 auto; min-width: 0; }
.list-item > :not(.person):last-child, .list-item > [style*="margin-inline-start:auto"] { flex-shrink: 0; }
.th-foot b { min-width: 0; flex: 1; }
.th-foot .th-mode, .th-foot .th-act { flex-shrink: 0; }
.coa-name { min-width: 0; }
td .badge { white-space: nowrap; }
@media (max-width: 700px) {
  .tbl.stack td::before { flex-shrink: 0; max-width: 45%; }
  .tbl.stack td > * { min-width: 0; overflow-wrap: anywhere; }
  .tbl.stack td > div[style*="padding-inline-start"] { padding-inline-start: 0 !important; }
  .tbl.stack td .person { justify-content: flex-end; }
}
@media (max-width: 700px) { .th-grid { grid-template-columns: repeat(min(var(--cols, 2), 2), minmax(0, 1fr)); } }
@media (min-width: 701px) and (max-width: 1100px) { .th-grid { grid-template-columns: repeat(min(var(--cols, 2), 3), minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .chart-wide .chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .chart-wide .chart-scroll svg { min-width: 620px; }
}

/* ===================================================================== v3.0 */
.mt-s { margin-top: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; display: block; }
.wrap-text { white-space: normal; overflow-wrap: anywhere; max-width: 420px; }
.quote { border-inline-start: 3px solid var(--primary); background: var(--surface-2); padding: 8px 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip-row .chip { flex-shrink: 0; }
.chip-n { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; } .filters .input { width: auto; min-width: 170px; flex: 1 1 170px; }
/* stars */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; line-height: 1; }
.stars .st { font-style: normal; color: var(--border-2); font-size: 15px; }
.stars .st.on { color: #f59e0b; } .stars .st.half { background: linear-gradient(90deg, #f59e0b 50%, var(--border-2) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.star-in { display: inline-flex; gap: 2px; }
.star-in button { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--border-2); cursor: pointer; padding: 2px; transition: transform .15s, color .15s; min-width: 32px; min-height: 36px; }
.star-in button.on { color: #f59e0b; } .star-in button:hover { transform: scale(1.15); }
.big-rating { display: inline-flex; align-items: center; gap: 6px; } .big-rating .st { font-size: 20px; }
/* approvals */
.ap-list { display: grid; gap: 10px; }
.ap-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ap-item .ap-cb { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--primary); }
.ap-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.ap-main { flex: 1; min-width: 0; } .ap-title { font-weight: 700; overflow-wrap: anywhere; }
.ap-meta { margin-top: 4px; color: var(--text-2); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ap-act { flex-shrink: 0; }
.ap-bar { position: sticky; top: calc(var(--topbar-h, 64px) + 6px); z-index: 5; padding: 10px 14px; }
/* copy checking */
.photo-drop { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.pd-item { position: relative; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.pd-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pd-item .icon-btn { position: absolute; top: 4px; inset-inline-end: 4px; background: rgba(0,0,0,.55); color: #fff; width: 28px; height: 28px; }
.pd-item span, .cg-item span { position: absolute; bottom: 4px; inset-inline-start: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 6px; }
.pd-empty { grid-column: 1 / -1; border: 2px dashed var(--border-2); border-radius: 14px; padding: 34px 10px; display: grid; place-items: center; gap: 6px; color: var(--muted); }
.copy-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.copy-card { display: flex; flex-direction: column; overflow: hidden; cursor: pointer; padding: 0; }
.cc-thumb { position: relative; height: 150px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.cc-thumb { overflow: hidden; } .cc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cc-n { position: absolute; top: 8px; inset-inline-end: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 999px; padding: 2px 8px; display: inline-flex; gap: 4px; align-items: center; }
.cc-n .ic { width: 12px; height: 12px; }
.cc-body { padding: 10px 12px 12px; display: grid; gap: 2px; min-width: 0; }
.copy-review { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.copy-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 64vh; overflow: auto; }
.cg-item { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 3/4; background: var(--surface-2); }
.cg-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; } .cg-item:hover img { transform: scale(1.04); }
.crit-grid { display: grid; gap: 6px; }
.crit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--surface-2); border-radius: 10px; flex-wrap: wrap; }
.copy-review .field { margin-top: 10px; }
/* student 360 */
.tiles360 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.t360 { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; gap: 2px; min-width: 0; }
.t360 b { font-size: 22px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t360 .t-ic { color: var(--primary); } .t360 .t-ic .ic { width: 18px; height: 18px; }
.sw-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 10px; font-size: 13px; flex: 1 1 260px; }
.sw.good { background: var(--success-soft); color: var(--success); } .sw.weak { background: var(--danger-soft); color: var(--danger); }
.meters { display: grid; gap: 12px; }
.meter .m-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.meter .m-lbl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.meter .m-bar { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.meter .m-bar i { display: block; height: 100%; border-radius: 99px; transition: width .8s var(--ease); }
.timeline { display: grid; gap: 14px; position: relative; padding-inline-start: 18px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; } .tl-dot { position: absolute; inset-inline-start: -18px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--surface); }
.tl-item.resolved .tl-dot { background: var(--success); }
.sub-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; } .sub-chips span { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.hs-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
/* batches */
.day-pills { display: flex; gap: 3px; flex-wrap: wrap; } .day-pills i { font-style: normal; font-size: 10px; font-weight: 700; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.day-pills i.on { background: var(--primary); color: #fff; }
.day-check { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check-list { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.check-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.check-item:last-child { border-bottom: 0; } .check-item:hover { background: var(--surface-2); } .check-item input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.tt-wrap { overflow-x: auto; } .timetable { min-width: 640px; } .timetable td { vertical-align: top; min-width: 120px; }
.tt-time { white-space: nowrap; width: 90px; }
.tt-cell { background: hsl(var(--h) 80% 95%); border-inline-start: 3px solid hsl(var(--h) 65% 48%); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; display: grid; font-size: 12px; }
.tt-cell b { font-size: 13px; } .tt-cell span { color: var(--text-2); }
[data-mode="dark"] .tt-cell { background: hsl(var(--h) 40% 20%); }
/* institution type chooser */
.inst-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.inst-card { border: 2px solid var(--border); border-radius: 16px; padding: 14px; cursor: pointer; display: grid; gap: 6px; transition: .2s; background: var(--surface); text-align: start; color: inherit; font: inherit; }
.inst-card:hover { border-color: var(--primary); }
.inst-card.on { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--primary-softer); }
.inst-card .ic-wrap { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.inst-card ul { margin: 0; padding-inline-start: 18px; font-size: 12px; color: var(--text-2); }
.inst-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }
.subj-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.subj-pick label { display: flex; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.subj-pick label.on { border-color: var(--primary); background: var(--primary-softer); }
.subj-pick label span { display: flex; gap: 8px; align-items: center; min-width: 0; } .subj-pick input { accent-color: var(--primary); width: 17px; height: 17px; }
.dash-approve { display: flex; align-items: center; gap: 12px; border-color: var(--warning); background: var(--warning-soft); }
.pending-pill { background: var(--warning-soft); color: var(--warning); }

@media (max-width: 1200px) { .tiles360 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .copy-review { grid-template-columns: 1fr; } .copy-gallery { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); } .inst-cards { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .tiles360 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-item { flex-wrap: wrap; } .ap-act { width: 100%; justify-content: flex-end; }
  .ap-ic { width: 36px; height: 36px; }
  .copy-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } .cc-thumb { height: 120px; }
  .hs-row { grid-template-columns: minmax(0, 1fr) 70px 70px 32px; }
  .filters .input { min-width: 0; }
  .star-in button { font-size: 30px; min-width: 38px; }
}
/* mobile app tab bar */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -16px rgba(0,0,0,.35); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 12px; min-width: 0; cursor: pointer; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .on { color: var(--primary); background: var(--primary-softer); }
  .tb-badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); background: var(--danger); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  .pv-open .tabbar, .modal-back ~ .tabbar { display: none; }
}
@media print { .tabbar { display: none !important; } }
/* topbar: never wider than the screen */
.topbar { min-width: 0; }
.gsearch { min-width: 150px; flex: 1 1 150px; }
.top-actions { min-width: 0; }
@media (min-width: 761px) { .top-actions { flex-shrink: 0; } }
.user-chip .u-txt { max-width: 130px; min-width: 0; } .user-chip .u-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1440px) { .date-pill { display: none !important; } .top-chip { max-width: 190px; } }
/* star inputs fit any column */
.star-in { max-width: 100%; flex-wrap: nowrap; }
.star-in button { font-size: 24px; min-width: 0; padding: 2px 1px; flex: 0 1 auto; }
.an-grid { align-items: start; }
.scroll-body { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.stat .s-val { white-space: nowrap; font-size: clamp(18px, 1.7vw, 26px); }
@media (max-width: 760px) {
  .top-actions { flex: 1 1 auto; justify-content: flex-end; gap: 5px; }
  .top-chip { min-width: 0; max-width: 160px; flex: 0 1 auto; padding: 5px 8px; }
  .top-chip > div { min-width: 0; overflow: hidden; }
}
@media (max-width: 520px) {
  .top-chip > div, .top-chip .chev-d { display: none; }
  .top-chip { padding: 0; width: 40px; height: 40px; justify-content: center; border: 1px solid var(--border); }
  .lang-seg button { padding: 0 7px; }
}
.subj-pick label b { white-space: nowrap; flex-shrink: 0; } .subj-pick label span { overflow-wrap: anywhere; }
/* password show / hide eye */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > .input { padding-inline-end: 44px; width: 100%; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; border-radius: 9px; display: grid; place-items: center; color: var(--muted); cursor: pointer; z-index: 2; }
.pw-eye:hover { color: var(--primary); background: var(--primary-softer); }
.pw-eye.on { color: var(--primary); }
.input-icon .pw-eye .ic, .pw-eye .ic { position: static; transform: none; inset: auto; width: 19px; height: 19px; color: inherit; }
input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }
.input-icon > .ic { z-index: 3; }
/* old admissions: session-wise record table */
.oh-tbl td { padding: 6px 5px; vertical-align: middle; }
.oh-tbl [data-k=session] { min-width: 118px; } .oh-tbl [data-k=class_name] { min-width: 130px; } .oh-tbl [data-k=exam] { min-width: 120px; }
.oh-tbl [data-k=total], .oh-tbl [data-k=obtained] { width: 84px; } .oh-tbl [data-k=result] { min-width: 110px; }
.oh-tbl .oh-pct { min-width: 54px; white-space: nowrap; }
@media (max-width: 640px) {
  .oh-tbl thead { display: none; }
  .oh-tbl, .oh-tbl tbody { display: block; }
  .oh-tbl tr.oh-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; position: relative; background: var(--surface); }
  .oh-tbl td { display: block; padding: 0; border: 0 !important; min-width: 0; }
  .oh-tbl td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .oh-tbl td .input { width: 100% !important; min-width: 0 !important; }
  .oh-tbl td:last-child { position: absolute; top: 6px; inset-inline-end: 6px; }
  .oh-tbl td.oh-pct { align-self: end; font-size: 15px; font-weight: 700; padding-bottom: 8px; }
  .oh-tbl td[data-label]:first-child { padding-inline-end: 34px; }
}
/* ===================================================================== v3.1 campus */
.m-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.m-bar i { display: block; height: 100%; border-radius: 99px; }
.route-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.route-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rc-stats div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; min-width: 0; }
.rc-stats b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-stats span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-stops { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.rc-stops .stop { font-size: 12px; background: var(--primary-softer); color: var(--text-2); border-radius: 999px; padding: 2px 9px; }
.rc-stops .stop small { color: var(--muted); }
.stop-row { display: grid; grid-template-columns: minmax(0, 2fr) 110px 110px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.book-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.book-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.book-row > div:first-child { flex: 1; }
.book-row.late { border-color: var(--danger); background: var(--danger-soft); }
.lib-desk .card-head .seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
@media (max-width: 640px) {
  .stop-row { grid-template-columns: minmax(0, 1fr) 86px 34px; } .stop-row [data-k=fare] { grid-column: 1 / 3; }
  .book-row { flex-wrap: wrap; } .book-row > div:first-child { flex-basis: 100%; }
  .route-cards { grid-template-columns: 1fr; }
  .lib-desk .card-head { flex-wrap: wrap; gap: 8px; }
}
/* demo package */
.pdoc.demo-wm .page::before { content: "DEMO · MS Cloud Solutions"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-28deg);
  font: 800 54px/1 var(--font); color: rgba(220, 38, 38, .13); white-space: nowrap; pointer-events: none; z-index: 50; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lic-strip.demo { background: linear-gradient(90deg, rgba(124, 58, 237, .12), rgba(14, 165, 233, .12)); color: var(--text); }
.demo-box { width: 100%; max-width: 440px; margin: 16px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.demo-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .demo-head .muted { margin-inline-start: auto; }
.demo-head code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.demo-groups { display: grid; gap: 10px; max-height: 340px; overflow: auto; }
.dg-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.dg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.demo-acc { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 6px 9px; text-align: start; cursor: pointer; font: inherit; color: inherit; display: grid; min-width: 0; }
.demo-acc:hover { border-color: var(--primary); background: var(--primary-softer); }
.demo-acc b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .demo-acc span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-form-side { justify-content: flex-start; overflow-y: auto; max-height: 100vh; max-height: 100dvh; }
.login-form-side > :first-child { margin-top: auto; } .login-form-side > :last-child { margin-bottom: auto; }
.tbl td.num, .tbl th.num { white-space: nowrap; }
@media (max-width: 640px) {
  /* stacked tables: label on one side, the whole value (even several lines) on the other */
  .tbl.stack td:not(.actions) { display: block; text-align: end; overflow: hidden; }
  .tbl.stack td:not(.first):not(.actions)::before { float: left; margin-inline-end: 12px; max-width: 45%; }
  html[dir="rtl"] .tbl.stack td:not(.first):not(.actions)::before { float: right; }
  .tbl.stack td.first { text-align: start; }
  .tbl.stack td.first .muted { display: block; }
}
@media (max-width: 640px) { .tbl.stack td.first .person { justify-content: flex-start; } }

/* ---------------------------------------------------------------- v3.2 cloud sync */
.cloud-hero { display: flex; gap: 18px; align-items: center; padding: 20px 22px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cloud-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, var(--ch-soft, var(--primary-softer)), transparent 70%); pointer-events: none; }
.cloud-hero > * { position: relative; }
.cloud-hero h2 { margin: 0 0 4px; font-size: 19px; }
.cloud-hero p { margin: 0; max-width: 760px; }
.cloud-hero .ch-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--ch, var(--primary)); color: #fff; flex-shrink: 0; box-shadow: 0 8px 20px -8px var(--ch, var(--primary)); }
.cloud-hero .ch-ic .ic { width: 30px; height: 30px; }
.cloud-hero.tone-success { --ch: var(--success); --ch-soft: var(--success-soft); }
.cloud-hero.tone-warning { --ch: var(--warning); --ch-soft: var(--warning-soft); }
.cloud-hero.tone-danger { --ch: var(--danger); --ch-soft: var(--danger-soft); }
.cloud-hero.tone-muted { --ch: var(--muted, #64748b); --ch-soft: var(--surface-2, rgba(100, 116, 139, .08)); }
.cloud-hero.tone-primary .ch-ic .ic { }
.ch-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.ch-meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.ch-meta .ic { width: 15px; height: 15px; opacity: .7; }
.ch-err { margin-top: 10px; font-size: 13px; display: flex; gap: 6px; align-items: flex-start; color: var(--text); background: rgba(255, 255, 255, .5); border-radius: 10px; padding: 8px 10px; }
[data-mode="dark"] .ch-err { background: rgba(0, 0, 0, .2); }
.ch-err .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.cloud-hero.tone-primary .ch-ic .ic, .cloud-hero .st-syncing .ic { }
.cl-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.cl-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; font-size: 13px; }
.cl-steps li::before { content: counter(s); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; }
.cl-steps li span { color: var(--text-2); line-height: 1.45; }
.info-strip.warn { background: var(--warning-soft); border-color: transparent; }
.info-strip.warn .ic { color: var(--warning); }
.info-strip.ok { background: var(--success-soft); border-color: transparent; }
.info-strip.ok .ic { color: var(--success); }
.key-box { background: var(--surface-2, var(--primary-softer)); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; }
.key-box code { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; margin-top: 2px; user-select: all; }
.cloud-btn { position: relative; }
.cloud-btn.st-ok .ic, .cloud-btn.st-warn .ic { color: var(--success); }
.cloud-btn.st-pending .ic, .cloud-btn.st-syncing .ic, .cloud-btn.st-waiting .ic { color: var(--primary); }
.cloud-btn.st-offline .ic, .cloud-btn.st-off .ic { color: var(--warning); }
.cloud-btn.st-auth .ic, .cloud-btn.st-error .ic { color: var(--danger); }
.cloud-btn.st-warn .ic { color: var(--warning); }
.cloud-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 2px var(--surface); }
.cloud-btn.st-syncing .ic { animation: cloudPulse 1.2s ease-in-out infinite; }
@keyframes cloudPulse { 50% { opacity: .35; } }
.lic-strip.mirror { background: var(--info-soft); }
.btn-soft-ok { color: var(--success); }
@media (max-width: 760px) {
  .cloud-hero { padding: 16px; gap: 12px; }
  .cloud-hero .ch-ic { width: 46px; height: 46px; }
  .cloud-hero .ch-act { width: 100%; }
  .cloud-hero .ch-act .btn { width: 100%; justify-content: center; }
  .cloud-btn { display: none; }
}

/* ---------------------------------------------------------------- v3.3 portals */
.portal-app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.portal-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 2px 10px -6px rgba(15, 23, 42, .12); }
.pt-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pt-brand .brand-logo { width: 42px; height: 42px; flex-shrink: 0; }
.pt-name { min-width: 0; display: flex; flex-direction: column; }
.pt-name b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-name span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.portal-content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 22px 40px; }
.portal-tabbar { display: none; }
.kid-switch { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.kid-chip { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: start; flex-shrink: 0; }
.kid-chip span { display: flex; flex-direction: column; } .kid-chip small { color: var(--muted); font-size: 11px; }
.kid-chip.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.kid-hero { display: flex; align-items: center; gap: 18px; padding: 18px 20px; flex-wrap: wrap; position: relative; overflow: hidden; }
.kid-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, var(--primary-softer), transparent 65%); pointer-events: none; }
.kid-hero > * { position: relative; }
.kid-hero h2 { margin: 0; font-size: 21px; }
.avatar.xl { width: 74px; height: 74px; border-radius: 20px; font-size: 26px; flex-shrink: 0; }
.kid-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kid-tags span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.kid-tags .ic { width: 13px; height: 13px; }
.today-badge { font-size: 13px; padding: 6px 12px; }
.portal-tabs { overflow-x: auto; flex-wrap: nowrap; }
.portal-tabs .tab { flex-shrink: 0; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head span { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.cal-cell { min-height: 58px; border-radius: 12px; border: 1px solid var(--border); padding: 6px 8px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); }
.cal-cell b { font-size: 13px; } .cal-cell span { font-weight: 800; font-size: 13px; align-self: flex-end; }
.cal-cell.empty { border: 0; background: transparent; }
.cal-cell.st-P { background: var(--success-soft); border-color: transparent; } .cal-cell.st-P span { color: var(--success); }
.cal-cell.st-A { background: var(--danger-soft); border-color: transparent; } .cal-cell.st-A span { color: var(--danger); }
.cal-cell.st-L { background: var(--warning-soft); border-color: transparent; } .cal-cell.st-L span { color: var(--warning); }
.cal-cell.today { box-shadow: 0 0 0 2px var(--primary); }
.result-card .rc-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 16px; }
.result-card .rc-top div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.result-card .rc-top b { font-size: 19px; } .result-card .rc-top small { font-size: 12px; color: var(--muted); font-weight: 600; }
.result-card .rc-top span { font-size: 11px; color: var(--muted); }
.result-card .tbl td { padding: 7px 16px; }
.m-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 99px; }
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item { display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.notice-item .ni-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.notice-item.kind-homework .ni-ic { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.notice-item.kind-holiday .ni-ic { background: var(--warning-soft); color: var(--warning); }
.notice-item.kind-event .ni-ic { background: var(--success-soft); color: var(--success); }
.ni-body { margin-top: 6px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ni-photo { margin-top: 8px; max-width: 220px; max-height: 160px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.pc-item { padding: 10px 0; border-bottom: 1px dashed var(--border); display: grid; gap: 4px; }
.desk-classes { display: grid; gap: 8px; }
.desk-class { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.desk-class .btn-group { margin-inline-start: auto; }
.menu-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-checks .chip-check .ic { width: 15px; height: 15px; }
.chip-check.disabled { opacity: .45; }
.danger-opt { color: var(--danger); }
.portal-guide .s-ic.sm { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.login-slips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lslip { border: 1.5px dashed #666; border-radius: 10px; padding: 10px 12px; break-inside: avoid; font-size: 12px; }
.lslip .ls-head { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid #ccc; padding-bottom: 6px; margin-bottom: 6px; }
.lslip .ls-head img, .lslip .ls-head .lg-ini { width: 34px; height: 34px; object-fit: contain; }
.lslip .ls-head b { display: block; font-size: 13px; } .lslip .ls-head span { font-size: 11px; color: #555; }
.lslip .ls-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; } .lslip .ls-row span { color: #555; }
.lslip .ls-row.big b { font-size: 15px; font-family: Consolas, monospace; letter-spacing: .5px; }
.lslip .ls-foot { margin-top: 6px; font-size: 10px; color: #555; }
@media (max-width: 760px) {
  .portal-top { padding: 8px 12px; }
  .pt-actions .lang-seg button { padding: 4px 8px; }
  .pt-actions #pt-mode { display: none; }
  .portal-content { padding: 14px 12px 90px; }
  .portal-tabbar { display: grid; }
  .portal-tabs { display: none; }
  .kid-hero { padding: 14px; gap: 12px; }
  .avatar.xl { width: 58px; height: 58px; }
  .result-card .rc-top { grid-template-columns: repeat(2, 1fr); }
  .cal-cell { min-height: 44px; padding: 4px 5px; }
  .cal-head, .cal-grid { gap: 4px; }
  .login-slips { grid-template-columns: 1fr; }
}
.more-links { display: none; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .more-links { display: flex; }
  .more-links .btn { flex: 1; justify-content: center; }
  .kid-hero .today-badge { width: 100%; justify-content: center; text-align: center; }
  .kid-hero h2 { font-size: 18px; }
}

/* ---------------------------------------------------------------- v3.4 academy: scan, catalog */
.scan-box { margin-bottom: 14px; }
.scan-in { font-size: 18px; padding: 14px 16px; height: auto; border-width: 2px; }
.scan-in:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.scan-cam { position: relative; margin-bottom: 14px; border-radius: 16px; overflow: hidden; background: #000; max-width: 460px; }
.scan-cam video { width: 100%; display: block; }
.scan-cam .scan-frame { position: absolute; inset: 18% 18%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.scan-cam .btn { position: absolute; top: 10px; right: 10px; }
.scan-result { min-height: 90px; }
.scan-card { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 16px; border: 2px solid var(--border); }
.scan-card b { font-size: 18px; }
.scan-card.ok { border-color: var(--success); background: var(--success-soft); }
.scan-card.late { border-color: var(--warning); background: var(--warning-soft); }
.scan-card.bad { border-color: var(--danger); background: var(--danger-soft); }
.scan-card .avatar.lg { width: 70px; height: 80px; font-size: 26px; }
.scan-time { font-size: 22px; font-weight: 800; margin-top: 4px; }
.scan-log { display: grid; gap: 8px; max-height: 460px; overflow: auto; }
.scan-log > div { display: flex; align-items: center; gap: 10px; }
.scan-log small { display: block; }
.scan-log .s-ic.sm { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); }
.dev-url { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); overflow-wrap: anywhere; font-size: 13px; }
.cat-group { margin-bottom: 8px; }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.cat-item small { display: block; font-size: 11.5px; }
.cat-item.have { opacity: .55; cursor: default; }
.cat-item .cat-fee { text-align: end; white-space: nowrap; }
.cat-item .cat-fee small { color: var(--muted); }
.cat-item:has(input:checked:not(:disabled)) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
@media (max-width: 760px) { .cat-list { grid-template-columns: 1fr; } .scan-in { font-size: 16px; } }
.cat-item > .flex-1 { min-width: 0; }
.cat-item > .flex-1 small { overflow-wrap: anywhere; }
.cat-item .cat-fee { flex-shrink: 0; }

/* ---------------------------------------------------------------- v3.5 academy screens (Academy software layout) */
.acad-adm { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 18px; align-items: start; }
.acad-adm .card { margin: 0; }
.acad-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750; margin: 4px 0 14px; }
.acad-h:not(:first-child) { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.acad-photo-card { position: sticky; top: 84px; }
.acad-photo { width: 150px; height: 175px; margin: 0 auto; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface-3);
  display: grid; place-items: center; overflow: hidden; cursor: pointer; transition: border-color .2s; }
.acad-photo:hover { border-color: var(--primary); }
.acad-photo img { width: 100%; height: 100%; object-fit: cover; }
.acad-photo span { font-size: 54px; font-weight: 300; color: var(--text-3); }
.acad-fee { margin: 2px 0 4px; padding: 11px 14px; border-radius: 12px; background: var(--info-soft, var(--primary-soft)); color: var(--text); font-size: 13.5px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acad-fee svg { width: 17px; height: 17px; color: var(--primary); flex-shrink: 0; }
.tbl tr.group-row td { background: var(--surface-2); font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); padding-top: 10px; padding-bottom: 8px; }
.day-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick label { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; cursor: pointer; }
.day-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.fee-split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.fee-split i { display: block; min-width: 2px; }
@media (max-width: 900px) {
  .acad-adm { grid-template-columns: 1fr; }
  .acad-photo-card { position: static; order: -1; }
  .tbl.stack tr.group-row td { display: block; }
}
/* academies work with courses and timing batches - no class sections */
[data-inst="academy"] .field:has(> select[name="section"]), [data-inst="academy"] .field:has(> select[name="fsec"]) { display: none; }
[data-inst="academy"] .field:has(> [name="sections"]), [data-inst="academy"] .field:has(> [name="board_name"]) { display: none; }
/* v3.6 enquiries */
.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.seg-tabs a { padding: 6px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.seg-tabs a b { margin-inline-start: 4px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); font-size: 11.5px; }
.seg-tabs a.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.seg-tabs a.on b { background: rgba(255,255,255,.25); }
.enq-log { display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.enq-log > div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.clear-box { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); }
.clear-box .cl-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.clear-box .cl-row:last-child { border-bottom: 0; }
.clear-ok { color: var(--success); font-weight: 700; } .clear-bad { color: var(--danger); font-weight: 700; }
/* v3.6 diploma / course completion (landscape) */
.pdoc .pdip { position: relative; width: 277mm; height: 190mm; margin: 0 auto; background: #fffdf7; overflow: hidden; }
.pdoc .pdip.is-dip { background: radial-gradient(circle at 50% 40%, #fffef9, #fbf5e4); }
.pdoc .pd-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdoc .pd-wm { position: absolute; left: 50%; top: 55%; width: 95mm; height: 95mm; transform: translate(-50%, -50%); display: grid; place-items: center; opacity: .06; font: 900 120px Georgia, serif; color: var(--pc); }
.pdoc .pd-wm img { width: 100%; height: 100%; object-fit: contain; }
.pdoc .pd-content { position: absolute; inset: 13mm 18mm 12mm; display: flex; flex-direction: column; }
.pdoc .pd-head { display: flex; align-items: center; justify-content: center; gap: 5mm; text-align: center; }
.pdoc .pd-head .pc-logo { margin: 0; width: 19mm; height: 19mm; flex-shrink: 0; }
.pdoc .pd-head h1 { margin: 0; font: 700 24px Georgia, "Times New Roman", serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--pc); }
.pdoc .pd-head p { margin: .6mm 0 0; font-size: 10px; color: #555; }
.pdoc .pd-no { display: flex; justify-content: space-between; margin-top: 3mm; font-size: 10.5px; color: #333; border-top: .3mm solid var(--gold); border-bottom: .3mm solid var(--gold); padding: 1.2mm 2mm; }
.pdoc .pd-kind { margin: 4mm auto 0; padding: 1.3mm 10mm; color: #fff; font: 700 11.5px Georgia, serif; letter-spacing: 5px; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 70%, #000));
  clip-path: polygon(0 0, 100% 0, 95% 50%, 100% 100%, 0 100%, 5% 50%); }
.pdoc .pd-title { text-align: center; margin: 2.5mm 0 0; font: italic 700 31px Georgia, "Times New Roman", serif; color: #1f2937; }
.pdoc .pd-title::after { content: ""; display: block; width: 70mm; height: .7mm; margin: 1.5mm auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.pdoc .pd-body { margin-top: 4mm; text-align: center; font: 15px/1.9 Georgia, "Times New Roman", serif; color: #222; padding: 0 8mm; }
.pdoc .pd-name { font-size: 22px; font-style: italic; color: var(--pc); border-bottom: .3mm dotted #555; padding: 0 3mm; }
.pdoc .pd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm; margin: 4mm 6mm 0; }
.pdoc .pd-grid div { border: .3mm solid color-mix(in srgb, var(--gold) 70%, #fff); border-radius: 2mm; padding: 1.4mm 2mm; text-align: center; background: rgba(255,255,255,.7); }
.pdoc .pd-grid span { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .8px; color: #777; }
.pdoc .pd-grid b { font: 700 13px Georgia, serif; color: #111; }
.pdoc .pd-foot { margin-top: auto; display: flex; align-items: flex-end; gap: 6mm; }
.pdoc .pd-verify { width: 19mm; text-align: center; font-size: 7px; color: #555; }
.pdoc .pd-verify .qr { width: 19mm; height: 19mm; display: block; border: .3mm solid #ddd; }
.pdoc .pc-table { width: 100%; border-collapse: collapse; margin: 1mm 0 4mm; font-size: 13.5px; }
.pdoc .pc-table td { border: .3mm solid #c9b98a; padding: 1.6mm 3mm; } .pdoc .pc-table td:nth-child(odd) { color: #555; width: 22%; }
.pdoc .pd-body { margin-top: 8mm; font-size: 17px; line-height: 2.1; }
.pdoc .pd-name { font-size: 25px; }
.pdoc .pd-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 3mm; margin: 8mm 4mm 0; }
.pdoc .pd-grid div { flex: 0 0 56mm; padding: 2.4mm 2mm; }
.pdoc .pd-grid span { font-size: 9px; margin-bottom: .6mm; }
.pdoc .pd-grid b { font-size: 15px; }
.pdoc .pd-head h1 { font-size: 27px; }
