/* ============================================================================
   MA'HAD AL-ADZKIYA' — RELEASE 1.1 UI THEME
   Purple frame (WEFHA) × Orange accents (Finexy) · Icon rail sidebar
   Minimalist modern · Light & Dark · PC / Tablet / HP · macOS spring motion
   Loaded AFTER style.css so every rule here takes precedence.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&display=swap');

:root {
  --primary: #5b3fa6;
  --primary-light: #7a62bd;
  --primary-lighter: #f0ecfa;
  --brand-deep: #4a3290;
  --brand-deep-2: #3b2775;
  --orange: #f7a35c;
  --orange-strong: #f26b3a;
  --orange-soft: #fff1e4;
  --orange-grad: linear-gradient(135deg, #ff8a4c 0%, #f26b3a 100%);
  --frame-bg: var(--primary);
  --panel-radius: 30px;
  --rail-w: 88px;
  --bg: #f7f6fb;
  --bg-card: #ffffff;
  --bg-subtle: #f6f4fb;
  --bg-input: #f3f1f9;
  --text: #1f1a2e;
  --text-secondary: #6b6580;
  --text-light: #a39fb5;
  --border: #ebe7f4;
  --border-light: #f2eff8;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(54, 34, 110, .06);
  --shadow-md: 0 12px 32px rgba(54, 34, 110, .10);
  --shadow-lg: 0 24px 56px rgba(30, 18, 70, .22);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --spring-soft: cubic-bezier(.22, 1.2, .36, 1);
}

body[data-gender="banat"] {
  --primary: #7e3fa6;
  --primary-light: #9a63bf;
  --primary-lighter: #f5ecfa;
  --brand-deep: #6a3190;
  --brand-deep-2: #552776;
}

html[data-theme="dark"] {
  --bg: #1b1729;
  --bg-card: #241f36;
  --bg-subtle: #211c31;
  --bg-input: #2d2743;
  --text: #f3f0fa;
  --text-secondary: #b3abc9;
  --text-light: #7d7596;
  --border: #352e4f;
  --border-light: #2c2642;
  --orange-soft: rgba(247, 163, 92, .16);
  --frame-bg: #130f20;
  --shadow: 0 6px 24px rgba(0, 0, 0, .28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .36);
}

body {
  font-family: 'DM Sans', 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -.005em;
}

.ui-ico { display: block; flex-shrink: 0; }

/* ============================================================================
   1. APP FRAME (PURPLE) + ROUNDED WHITE PANEL
   ============================================================================ */
.app-layout.active {
  background: var(--frame-bg);
  position: relative;
  isolation: isolate;
}
.app-layout.active::before,
.app-layout.active::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
.app-layout.active::before {
  width: 220px; height: 220px;
  right: -70px; top: -80px;
  background: radial-gradient(circle, rgba(247, 163, 92, .55) 0%, rgba(247, 163, 92, 0) 70%);
}
.app-layout.active::after {
  width: 260px; height: 260px;
  left: -110px; bottom: -120px;
  background: radial-gradient(circle, rgba(247, 163, 92, .35) 0%, rgba(247, 163, 92, 0) 70%);
}

.main-content {
  margin-left: var(--rail-w);
  padding: 14px 14px 14px 0;
  background: transparent;
}
body.sidebar-collapsed .main-content { margin-left: var(--rail-w); }

.main-panel-shell,
.main-content > .page-header,
.main-content > .canvas-scroll { background: var(--bg); }

.main-content > .page-header {
  border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  border-bottom: 1px solid var(--border-light);
}
.main-content > .canvas-scroll {
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
}

/* ============================================================================
   2. ICON RAIL SIDEBAR
   ============================================================================ */
.sidebar {
  width: var(--rail-w);
  background: transparent;
  border-right: none;
  color: #fff;
  align-items: center;
  overflow: visible;
}
body.sidebar-collapsed .sidebar { transform: none; }

.sidebar-header {
  height: auto;
  padding: 22px 0 14px;
  border-bottom: none;
  justify-content: center;
  width: 100%;
}
.sidebar-brand-row { justify-content: center; }
.sidebar-brand-left { justify-content: center; }
.sidebar-brand-left > div { display: none; }
.sidebar-logo-img {
  width: 46px; height: 46px;
  border-radius: 14px;
  border: none;
  padding: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}
.sidebar-asrama-tabs { display: none; }

.sidebar-nav {
  width: 100%;
  padding: 6px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 0;
  border-bottom: none;
  position: relative;
}
.nav-section + .nav-section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 26px; height: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .18);
}
.nav-section-title { display: none; }

.nav-item {
  width: 48px; height: 48px;
  padding: 0;
  margin: 0;
  gap: 0;
  justify-content: center;
  border-radius: 16px;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  box-shadow: none;
  transition: background .22s ease, color .22s ease, transform .35s var(--spring);
}
.nav-item .nav-label { display: none; }
.nav-item .nav-ico { display: inline-flex; align-items: center; justify-content: center; }
.nav-item:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transform: translateY(-1px) scale(1.06);
}
.nav-item.active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 22px rgba(247, 163, 92, .45);
}
.nav-item.active::before {
  left: -20px;
  top: 12px; bottom: 12px;
  width: 4px;
  background: var(--orange);
}
.nav-item:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 2px; }

.rail-footer {
  margin-top: auto;
  padding: 10px 0 calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
}
.rail-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .85);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .35s var(--spring);
}
.rail-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; transform: scale(1.08); }
.rail-btn.danger:hover { background: #f93c65; }

/* Floating tooltip for icon rail */
.rail-tooltip {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  padding: 7px 12px;
  border-radius: 10px;
  background: #1f1a2e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translate(-6px, -50%) scale(.92);
  transform-origin: left center;
  transition: opacity .14s ease, transform .3s var(--spring);
}
.rail-tooltip.show { opacity: 1; transform: translate(0, -50%) scale(1); }
.rail-tooltip::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%;
  width: 8px; height: 8px;
  background: #1f1a2e;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
}

/* ============================================================================
   3. TOP TOOLBAR
   ============================================================================ */
.page-header {
  min-height: 74px;
  background: var(--bg);
  padding: 12px 26px;
}
.header-left { gap: 14px; }
.header-right { gap: 10px; }

.hamburger-btn { display: none; }

.welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 14px;
  background: var(--primary-lighter);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
html[data-theme="dark"] .welcome-pill { color: #d7cbff; }
.welcome-pill strong { font-weight: 800; }

.topbar-search-wrap { max-width: 300px; }
.topbar-search-input {
  height: 40px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.topbar-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-lighter);
}

.realtime-clock-pill,
.net-status-pill {
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.net-status-pill.online { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.net-status-pill.offline { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
html[data-theme="dark"] .net-status-pill.online { background: var(--bg-card); border-color: var(--border); color: var(--text); }

/* ID / EN language switch */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.lang-switch button {
  border: none;
  background: transparent;
  min-width: 38px;
  padding: 6px 9px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .3s var(--spring);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 12px rgba(247, 163, 92, .4);
}
.login-card .lang-switch { position: absolute; top: 16px; right: 16px; }

.gender-switcher {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.gs-btn { border-radius: 9px; font-weight: 800; }
.gs-btn.active { background: var(--primary); box-shadow: 0 4px 12px rgba(91, 63, 166, .3); }

.topbar-user-box { border-left: none; padding-left: 0; }
.topbar-profile-trigger {
  border-radius: 14px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  gap: 10px;
}
.topbar-profile-trigger:hover { border-color: var(--primary); background: var(--bg-card); }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--orange-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar-user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.topbar-user-name { font-size: 12.5px; font-weight: 800; color: var(--text); max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user-sub { font-size: 10.5px; font-weight: 600; color: var(--text-secondary); max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-caret { border: none; width: auto; height: auto; font-size: 11px; color: var(--text-secondary); }

.profile-dropdown {
  width: 248px;
  border-radius: 18px;
  padding: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
}
.profile-dropdown.open { animation: macPopIn .38s var(--spring) both; }
.pd-user-header { padding: 10px 12px 12px; }
.pd-item {
  display: flex; align-items: center; gap: 10px;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
}
.pd-item .ui-ico { color: var(--text-secondary); }
.pd-item:hover { background: var(--primary-lighter); color: var(--primary); }
.pd-item:hover .ui-ico { color: var(--primary); }
.pd-item.danger .ui-ico { color: var(--danger); }

/* Hide old appearance button if it ever re-appears */
#appearanceBtn { display: none !important; }

/* ============================================================================
   4. CANVAS, HEADINGS, CARDS
   ============================================================================ */
.canvas-scroll { padding: 22px 26px 34px; }
.page-heading-bar { margin-bottom: 18px; }
.page-heading-bar h1 { font-size: 28px; font-weight: 800; letter-spacing: -.6px; color: var(--text); }
.page-heading-bar .subtitle { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

body[data-page="dashboard"] #pageTitle,
body[data-page="dashboard"] #pageSubtitle { display: none; }
body[data-page="dashboard"] .page-heading-bar { margin-bottom: 0; justify-content: flex-end; }
body[data-page="dashboard"] #headerActions:empty { display: none; }

.card,
.ds-kpi-card,
.ds-chart-card,
.stat-card,
.quick-action-btn {
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  background: var(--bg-card);
}
.card-header { background: transparent; border-bottom: 1px solid var(--border-light); padding: 16px 20px; }
.card-header h3 { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }

/* KPI cards (Finexy style) — first card is the orange highlight */
.ds-kpi-grid { gap: 16px; }
.ds-kpi-card {
  background: var(--bg-card);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.ds-kpi-title { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.ds-kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.ds-kpi-squircle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-subtle) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border);
}
.ds-kpi-grid > .ds-kpi-card:first-child {
  background: var(--orange-grad);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(242, 107, 58, .32);
  color: #fff;
}
.ds-kpi-grid > .ds-kpi-card:first-child .ds-kpi-title,
.ds-kpi-grid > .ds-kpi-card:first-child .ds-kpi-value,
.ds-kpi-grid > .ds-kpi-card:first-child .ds-kpi-trend,
.ds-kpi-grid > .ds-kpi-card:first-child .ds-kpi-trend span { color: #fff !important; }
.ds-kpi-grid > .ds-kpi-card:first-child .ds-kpi-squircle {
  background: rgba(255, 255, 255, .22) !important;
  border-color: rgba(255, 255, 255, .35);
  color: #fff !important;
}
.ds-kpi-grid > .ds-kpi-card:first-child::after {
  content: '';
  position: absolute;
  right: -40px; bottom: -60px;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, .12);
  pointer-events: none;
}
.ds-trend-up { color: #12a26b; }
.ds-trend-down { color: #e5484d; }

/* Chart recolor: purple line + orange callout */
.ds-svg-chart polyline { stroke: var(--primary); }
.ds-svg-chart linearGradient stop { stop-color: var(--primary); }
.ds-svg-chart circle { fill: var(--primary); }
.ds-svg-chart rect[rx="6"],
.ds-svg-chart polygon { fill: var(--orange-strong); }
.ds-svg-chart line[stroke-dasharray="3 3"] { stroke: var(--orange-strong); }
.ds-chart-head h3 { font-size: 18px; letter-spacing: -.3px; }
.ds-chart-controls select,
.ds-chart-controls input[type="date"] { border-radius: 10px; background: var(--bg-card); }

/* Tabs → pill segmented control */
.tabs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.tab { border-radius: 10px; font-weight: 700; transition: background .2s ease, color .2s ease, transform .35s var(--spring); }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(91, 63, 166, .28); }

/* Buttons */
.btn { border-radius: 12px; font-weight: 700; transition: transform .3s var(--spring), box-shadow .2s ease, background .2s ease; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--brand-deep); box-shadow: 0 8px 20px rgba(91, 63, 166, .3); }

/* Tables */
.table thead th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.table-wrapper { border-radius: 14px; }

/* Inputs */
input[type="text"], input[type="password"], input[type="date"], input[type="month"], input[type="number"], input[type="time"], input[type="search"], select, textarea {
  border-radius: 10px;
}

/* Floating customize FAB + watermark */
.dash-customize-fab { background: var(--orange-grad) !important; color: #fff !important; border: none !important; box-shadow: 0 12px 26px rgba(242, 107, 58, .38) !important; }

/* ============================================================================
   5. WELCOME HOME HERO (DASHBOARD)
   ============================================================================ */
.welcome-home {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 22px;
  padding: 26px 28px;
  margin-bottom: 20px;
  border-radius: 24px;
  background: linear-gradient(120deg, var(--primary) 0%, var(--brand-deep) 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(76, 52, 150, .28);
}
.welcome-home .wh-left { position: relative; z-index: 1; min-width: 0; }
.wh-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(247, 163, 92, .22);
  color: #ffd2ad;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.welcome-home h2 {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.15;
  color: #fff;
}
.welcome-home p {
  margin-top: 6px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .78);
  max-width: 520px;
  line-height: 1.5;
}
.wh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wh-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.welcome-home .wh-right {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  min-width: 260px; max-width: 320px;
}
.wh-duty-card {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  padding: 13px 15px;
  backdrop-filter: blur(6px);
}
.wh-duty-title { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #ffd2ad; margin-bottom: 8px; }
.wh-duty-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #fff; padding: 3px 0; }
.wh-duty-row .ui-ico { opacity: .8; }
.wh-duty-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wh-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .35s var(--spring), box-shadow .2s ease, background .2s ease;
}
.wh-btn:hover { transform: translateY(-2px) scale(1.02); }
.wh-btn:active { transform: scale(.96); }
.wh-btn.orange { background: var(--orange); color: #fff; box-shadow: 0 10px 22px rgba(247, 163, 92, .45); }
.wh-btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.wh-circle { position: absolute; border-radius: 50%; pointer-events: none; }
.wh-circle.c1 { width: 210px; height: 210px; right: -60px; top: -90px; border: 26px solid rgba(255, 255, 255, .06); }
.wh-circle.c2 { width: 120px; height: 120px; right: 200px; bottom: -70px; background: rgba(247, 163, 92, .28); filter: blur(2px); }

/* ============================================================================
   6. LANDING POPUP / PORTAL ICON TILES
   ============================================================================ */
.lpc-ico, .p916-ico {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-lighter);
  color: var(--primary);
  margin-bottom: 10px;
  transition: transform .4s var(--spring), background .2s ease, color .2s ease;
}
.landing-popup-card:hover .lpc-ico,
.portal-916-item:hover .p916-ico { background: var(--orange); color: #fff; transform: translateY(-2px) rotate(-4deg) scale(1.06); }
.portal-916-item .p916-code { background: transparent !important; padding: 0 !important; }
.landing-popup-card, .portal-916-item { border-radius: 16px; }

/* Permission group icon placeholders removed */
.perm-group-ico:empty { display: none; }

/* ============================================================================
   7. LOGIN PAGE
   ============================================================================ */
.login-page,
body[data-gender="banat"] .login-page {
  background:
    radial-gradient(circle at 86% 12%, rgba(247, 163, 92, .55) 0%, rgba(247, 163, 92, 0) 26%),
    radial-gradient(circle at 10% 92%, rgba(247, 163, 92, .4) 0%, rgba(247, 163, 92, 0) 24%),
    linear-gradient(140deg, var(--brand-deep) 0%, var(--primary) 60%, var(--primary-light) 100%);
}
.login-card { border-radius: 28px; animation: macSpringIn .7s var(--spring-soft) both; }
.login-card h1 { letter-spacing: -.6px; }
.portal-tab.active { background: var(--primary); color: #fff; }
.login-card .btn-primary { background: var(--orange-grad); border: none; box-shadow: 0 12px 26px rgba(242, 107, 58, .34); }

/* ============================================================================
   8. macOS-STYLE SPRING / JIGGLE MOTION
   ============================================================================ */
@keyframes macSpringIn {
  0%   { opacity: 0; transform: translateY(14px) scale(.965); }
  55%  { opacity: 1; transform: translateY(-3px) scale(1.012); }
  75%  { transform: translateY(1px) scale(.996); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes macSpringSoft {
  0%   { opacity: 0; transform: translateY(8px) scale(.98); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.006); }
  100% { opacity: 1; transform: none; }
}
@keyframes macPopIn {
  0%   { opacity: 0; transform: scale(.86) translateY(-6px); }
  60%  { opacity: 1; transform: scale(1.025) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes macGenieIn {
  0%   { opacity: 0; transform: translateY(40px) scale(.82, .7); filter: blur(3px); }
  50%  { opacity: 1; transform: translateY(-6px) scale(1.02, 1.03); filter: blur(0); }
  72%  { transform: translateY(2px) scale(.995, .99); }
  100% { opacity: 1; transform: none; }
}
@keyframes dockBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-10px) scale(1.06, .96); }
  45% { transform: translateY(0) scale(.96, 1.04); }
  62% { transform: translateY(-4px); }
  80% { transform: translateY(0) scale(1.01, .99); }
}
@keyframes macJiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-2.4deg) scale(1.04); }
  40% { transform: rotate(2deg) scale(1.02); }
  60% { transform: rotate(-1.2deg); }
  80% { transform: rotate(.6deg); }
}

.mac-spring-in { animation: macSpringIn .62s var(--spring-soft) both; transform-origin: 50% 0; }
.mac-spring-soft { animation: macSpringSoft .48s var(--spring-soft) both; }
.mac-jiggle { animation: macJiggle .5s ease both; }
.nav-ico.dock-bounce { animation: dockBounce .7s ease both; }

.modal-overlay.active .modal { animation: macGenieIn .5s var(--spring-soft) both; transform-origin: 50% 100%; }
.modal { border-radius: 24px; }
.toast { border-radius: 14px; animation: macPopIn .45s var(--spring) both; }
.gs-btn:active, .tab:active, .lang-switch button:active, .rail-btn:active { transform: scale(.92); }

@media (prefers-reduced-motion: reduce) {
  .mac-spring-in, .mac-spring-soft, .mac-jiggle, .nav-ico.dock-bounce,
  .modal-overlay.active .modal, .toast, .profile-dropdown.open, .login-card { animation: none !important; }
}

/* ============================================================================
   9. RESPONSIVE (TABLET RAIL STAYS · HP → DRAWER WITH LABELS)
   ============================================================================ */
@media (max-width: 1360px) {
  .realtime-clock-pill { display: none; }
}
@media (max-width: 1200px) {
  .welcome-pill { display: none; }
}
@media (max-width: 1024px) {
  .sidebar { transform: none; width: var(--rail-w); box-shadow: none; }
  .main-content { margin-left: var(--rail-w); }
  .sidebar-close-btn { display: none; }
  .page-header { padding: 10px 16px; }
  .canvas-scroll { padding: 18px 16px 28px; }
  .topbar-search-wrap { max-width: 200px; }
  .welcome-home { flex-direction: column; }
  .welcome-home .wh-right { max-width: none; min-width: 0; }
}
@media (max-width: 900px) {
  .topbar-user-meta { display: none; }
  .net-status-pill .net-label { display: none; }
}
@media (max-width: 640px) {
  :root { --panel-radius: 22px; }
  .app-layout.active { background: var(--frame-bg); }
  .main-content { margin-left: 0; padding: 0; }
  .main-content > .page-header { border-radius: 0; }
  .main-content > .canvas-scroll { border-radius: 0; }
  .hamburger-btn { display: inline-flex; }

  .sidebar {
    transform: translateX(-105%);
    width: 268px;
    background: var(--frame-bg);
    align-items: stretch;
    box-shadow: var(--shadow-lg);
    border-radius: 0 26px 26px 0;
    overflow: hidden;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-header { padding: 18px 18px 10px; justify-content: flex-start; }
  .sidebar-brand-row { justify-content: space-between; }
  .sidebar-brand-left { justify-content: flex-start; }
  .sidebar-brand-left > div { display: block; }
  .sidebar-brand-left .brand-wordmark, .sidebar-brand-left .brand-accent { color: #fff; font-size: 17px; }
  .sidebar-header p { color: rgba(255, 255, 255, .7); }
  .sidebar-close-btn { display: inline-flex; background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
  .sidebar-logo-img { width: 40px; height: 40px; }
  .sidebar-asrama-tabs { display: block; border-bottom: none; padding: 4px 16px 6px; }
  .sidebar-asrama-tabs .asrama-tab-grid { background: rgba(255, 255, 255, .1); }
  .sidebar-asrama-tabs .asrama-tab-btn { color: rgba(255, 255, 255, .8); }
  .sidebar-asrama-tabs .asrama-tab-btn.active { background: #fff; color: var(--primary); }
  .sidebar-nav { align-items: stretch; padding: 4px 14px 10px; }
  .nav-section { align-items: stretch; gap: 3px; padding: 6px 0; }
  .nav-section + .nav-section::before { left: 12px; transform: none; width: calc(100% - 24px); }
  .nav-section-title { display: block; color: rgba(255, 255, 255, .55); padding: 8px 12px 4px; }
  .nav-item { width: 100%; height: 44px; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 13px; }
  .nav-item .nav-label { display: inline; font-size: 13.5px; font-weight: 700; }
  .nav-item:hover { transform: none; }
  .nav-item.active::before { display: none; }
  .rail-footer { flex-direction: row; justify-content: center; padding-left: 14px; padding-right: 14px; }
  .rail-tooltip { display: none; }

  .page-header { padding: 8px 10px; min-height: 60px; }
  .header-right { gap: 6px; }
  .topbar-search-wrap { display: none; }
  .realtime-clock-pill { display: none; }
  .net-status-pill { padding: 7px 9px; }
  .lang-switch button { min-width: 32px; padding: 5px 7px; font-size: 11px; }
  .gs-btn { padding: 4px 7px; font-size: 11px; }
  .topbar-profile-trigger { padding: 3px; }
  .profile-caret { display: none; }
  .canvas-scroll { padding: 14px 12px 24px; }
  .welcome-home { padding: 20px; border-radius: 20px; }
  .welcome-home h2 { font-size: 23px; }
  .wh-circle.c2 { display: none; }
}
@media (max-width: 400px) {
  .net-status-pill { display: none; }
}
