:root {
  --primary: #0f6e6b;
  --primary-strong: #0b5553;
  --accent: #e8a838;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --text: #17211e;
  --muted: #5d6b66;
  --border: #e3e8e5;
  --sidebar: #10231f;
  --sidebar-text: #d5e4df;
  --sidebar-active: rgba(232, 168, 56, .16);
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --info: #175cd3;
  --shadow: 0 10px 30px rgba(16, 35, 31, .08);
  --radius: 16px;
  --nav-h: 64px;
  --sidebar-w: 268px;
}
html[data-theme="dark"] {
  --primary: #7dcec6; --primary-strong: #9ee0d8; --accent: #e8a838;
  --bg: #0d1412; --surface: #17211e; --text: #edf4f1; --muted: #a8b8b2; --border: #2a3a35;
  --sidebar: #0a100e; --sidebar-text: #d5e4df; --shadow: 0 10px 30px rgba(0,0,0,.35);
}
html[data-theme="blue"] {
  --primary: #1d4ed8; --primary-strong: #1e3a8a; --accent: #38bdf8;
  --bg: #f3f6fb; --surface: #fff; --sidebar: #0b1f44; --sidebar-text: #d6e2f5;
}
html[data-theme="green"] {
  --primary: #15803d; --primary-strong: #14532d; --accent: #84cc16;
  --bg: #f3f8f4; --surface: #fff; --sidebar: #052e16; --sidebar-text: #d8f3df;
}
html[data-theme="neutral"] {
  --primary: #3f3f46; --primary-strong: #18181b; --accent: #a1a1aa;
  --bg: #f4f4f5; --surface: #fff; --text: #18181b; --muted: #52525b; --border: #e4e4e7;
  --sidebar: #18181b; --sidebar-text: #e4e4e7;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
button, .btn { font-weight: 650; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-soft { background: transparent; border: 1px solid var(--border); color: var(--text); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar); color: var(--sidebar-text);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #f3d48a); color: #1b1404; font-weight: 800;
}
.brand small { display: block; color: #93aaa3; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.side-nav { padding: 8px 12px 20px; overflow: auto; flex: 1; }
.nav-link, button.nav-link {
  display: flex; align-items: center; gap: 10px; color: var(--sidebar-text);
  border-radius: 12px; padding: 11px 12px; margin-bottom: 4px;
  width: 100%; background: transparent; border: 0; text-align: left; font: inherit;
}
.nav-link:hover, .nav-link.active { background: var(--sidebar-active); color: #fff; }
.nav-link.active { box-shadow: inset 3px 0 0 var(--accent); }
.side-user { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 10px; align-items: center; }
.avatar, .avatar-lg {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #d7e4e1;
}
.avatar-lg { width: 112px; height: 112px; }
.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px);
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); position: relative;
}
.badge-dot {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; border-radius: 99px;
  background: var(--accent); color: #1b1404; font-size: 11px; display: grid; place-items: center;
}
.app-content { padding: 8px 22px 96px; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.page-head h1 { font-size: 1.7rem; margin: 0; letter-spacing: -.03em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.stat-grid, .card-grid { display: grid; gap: 14px; }
.stat-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.card-grid.two { grid-template-columns: 1.4fr .8fr; }
.surface {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat { padding: 18px; }
.stat span { color: var(--muted); font-size: .92rem; }
.stat strong { display: block; font-size: 1.8rem; margin-top: 6px; }
.stat i { float: right; font-size: 1.3rem; color: var(--primary); }
.panel { padding: 18px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 12px; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-hero { background: var(--sidebar); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 3rem; letter-spacing: -.04em; max-width: 12ch; }
.auth-card { display: grid; place-items: center; padding: 28px; }
.auth-panel { width: min(440px, 100%); }
.form-control, .form-select { border-radius: 12px; border-color: var(--border); background: var(--surface); color: var(--text); min-height: 46px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.strength { margin-top: 8px; }
.strength-bar { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.strength-bar span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s ease, background .25s; }
.strength.s1 span { width: 20%; } .strength.s2 span { width: 40%; background: #d97706; }
.strength.s3 span { width: 60%; background: #ca8a04; } .strength.s4 span { width: 80%; background: #16a34a; }
.strength.s5 span { width: 100%; background: #067647; }
.rules { list-style: none; padding: 0; margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.rules li.ok { color: var(--success); }
.table-wrap { overflow: auto; }
table.dataTable { color: var(--text) !important; }
.notif-menu { width: min(360px, 92vw); padding: 8px; }
button.notif-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; cursor: pointer; }
.notif-item { padding: 10px; border-radius: 12px; }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
button.notif-item:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.picture-live { display: block; border: 3px solid var(--border); }
.picture-hint { display: flex; align-items: center; gap: 6px; margin: 8px 0; color: var(--primary); font-weight: 600; }
.picture-hint[hidden] { display: none; }
.pw-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0 8px 0 12px; min-height: 46px; }
.pw-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.pw-field > i { color: var(--muted); }
.pw-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); min-height: 44px; }
.pw-field button { border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; }
.session-count { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; }
.mobile-nav, .menu-toggle { display: none; }
.sidebar-backdrop { display: none; }
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.theme-card { border: 2px solid var(--border); border-radius: 16px; padding: 12px; background: var(--surface); text-align: left; }
.theme-card.active { border-color: var(--primary); }
.swatch { height: 64px; border-radius: 12px; margin-bottom: 8px; }
.picture-edit { position: relative; width: 112px; }
.picture-edit button { position: absolute; right: 0; bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--border), #fff, var(--border)); background-size: 200% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position: -200% 0; } }
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .card-grid.two, .theme-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .mobile-nav { display: grid; }
  .sidebar { transform: translateX(-105%); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .app-main { margin-left: 0; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(76px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch; gap: 2px;
    padding: 6px 6px env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .app-content { padding-bottom: 112px; }
  .mobile-nav a, .mobile-nav button {
    box-sizing: border-box; min-width: 0; width: 100%; margin: 0; padding: 4px 2px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); text-align: center; font-size: 10px; line-height: 1.15;
    background: transparent; border: 0; border-radius: 12px; overflow: hidden;
  }
  .mobile-nav a.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
  .mobile-nav a:hover, .mobile-nav button:hover { color: var(--primary); }
  .mobile-nav i { display: block; font-size: 1.15rem; line-height: 1; flex: 0 0 auto; }
  .mobile-nav span {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; max-width: 100%; overflow-wrap: anywhere;
  }
  .stat-grid, .card-grid.two, .theme-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  table.cards thead { display: none; }
  table.cards tbody tr { display: block; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; padding: 6px 0; background: var(--surface); }
  table.cards td { display: block; border: 0 !important; padding: 6px 12px !important; }
  table.cards td .cell-label { display: block; color: var(--muted); font-size: 12px; }
}
.cell-label { display: none; }
.denied { text-align: center; padding: 12px 0 8px; }
.denied-mark {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px;
  display: grid; place-items: center; font-size: 1.8rem; color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
}
.denied-code { margin: 0 0 6px; letter-spacing: .18em; font-size: .78rem; font-weight: 700; color: var(--muted); }
.denied h2 { margin: 0 0 8px; letter-spacing: -.03em; }
.denied p { margin: 0 0 22px; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select, html[data-theme="dark"] .dropdown-menu { background: var(--surface); color: var(--text); }

.auth-body { min-height: 100dvh; }
.auth-stage {
  min-height: 100dvh;
  background:
    radial-gradient(820px 420px at -8% -10%, color-mix(in srgb, var(--primary) 26%, transparent), transparent 62%),
    radial-gradient(640px 360px at 110% -8%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 58%),
    var(--bg);
}
.auth-legacy {
  width: min(460px, calc(100% - 32px));
  margin: 96px auto 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  animation: gate-rise .5s ease both;
}
.gate-toolbar {
  position: fixed; top: 16px; right: 16px; z-index: 30;
  display: flex; align-items: center; gap: 4px;
  padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.gate-toolbar-split { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--border); }
.gate-icon-btn, .gate-chip {
  border: 0; background: transparent; color: var(--text);
  min-width: 36px; height: 36px; border-radius: 999px;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.gate-icon-btn:hover, .gate-chip:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); transform: translateY(-1px); }
.gate-icon-btn.active, .gate-chip.is-on { background: var(--primary); color: #fff; }
html[data-theme="dark"] .gate-icon-btn.active,
html[data-theme="dark"] .gate-chip.is-on { color: #10231f; }
.gate {
  min-height: 100dvh;
  animation: gate-fade .45s ease both;
}
.gate-login { display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(320px, .95fr); }
.gate-visual {
  position: relative; overflow: hidden; color: #f4fbf9;
  background: linear-gradient(165deg, #0c1c19 0%, #0f6e6b 58%, #14857a 100%);
  padding: 48px 56px;
  display: flex; align-items: flex-end;
}
.gate-visual::before, .gate-visual::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.gate-visual::before {
  width: 340px; height: 340px; right: -80px; top: -90px;
  background: radial-gradient(circle, rgba(232,168,56,.55), transparent 68%);
  animation: gate-float 9s ease-in-out infinite;
}
.gate-visual::after {
  width: 220px; height: 220px; left: -60px; bottom: 12%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%);
  animation: gate-float 11s ease-in-out infinite reverse;
}
.gate-visual-inner { position: relative; z-index: 1; max-width: 460px; animation: gate-rise .7s ease both; }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.gate-brand strong { display: block; font-size: 1.05rem; }
.gate-brand small { color: rgba(255,255,255,.72); }
.gate-visual h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); letter-spacing: -.045em; line-height: 1.05; max-width: 12ch; margin: 0 0 14px; }
.gate-visual p { color: rgba(244,251,249,.82); font-size: 1.05rem; max-width: 36ch; }
.gate-features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.gate-features li {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(8px);
  animation: gate-rise .55s ease both;
}
.gate-features li:nth-child(2) { animation-delay: .08s; }
.gate-features li:nth-child(3) { animation-delay: .16s; }
.gate-features i {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(232,168,56,.2); color: #f3d48a; flex: 0 0 36px;
}
.gate-main, .gate-forgot, .gate-force { display: grid; place-items: center; padding: 96px 28px 36px; }
.gate-card {
  width: min(440px, 100%);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 28px 26px;
  animation: gate-rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.gate-card-narrow { width: min(460px, 100%); }
.gate-card-wide { width: min(920px, 100%); padding: 8px; }
.gate-force-copy, .gate-side { padding: 24px; }
.gate-card-wide { display: grid; grid-template-columns: 1.15fr .85fr; gap: 0; }
.gate-kicker, .gate-orb {
  width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center;
  margin-bottom: 16px; font-size: 1.45rem; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
}
.gate-orb { margin-inline: auto; animation: gate-pop .55s ease both; }
.gate-card h2 { margin: 0 0 6px; letter-spacing: -.03em; font-size: 1.7rem; }
.gate-lead { color: var(--muted); margin: 0 0 18px; }
.gate-forgot .gate-card { text-align: center; }
.gate-forgot .gate-field, .gate-forgot .gate-btn, .gate-forgot .gate-alert { text-align: left; }
.gate-back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
  color: var(--muted); font-weight: 650;
}
.gate-back:hover { color: var(--primary); transform: translateX(-2px); }
.gate-field { display: block; margin-bottom: 14px; font-weight: 650; }
.gate-field > span:first-child { display: block; margin-bottom: 6px; font-size: .92rem; }
.gate-input {
  display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.gate-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.gate-input i { color: var(--muted); font-size: 1.05rem; }
.gate-input input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 16px; min-height: 48px;
}
.gate-eye {
  border: 0; background: transparent; color: var(--muted);
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
}
.gate-eye:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.gate-links { display: flex; justify-content: flex-end; margin: -4px 0 16px; }
.gate-links a, .gate-back { transition: color .2s ease, transform .2s ease; }
.gate-btn {
  width: 100%; min-height: 52px; border: 0; border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 82%, white), var(--primary-strong));
  color: #fff; font-weight: 700; letter-spacing: -.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 28%, transparent);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
html[data-theme="dark"] .gate-btn { color: #10231f; }
.gate-btn:hover:not(:disabled) { transform: translateY(-2px); filter: saturate(1.05); }
.gate-btn:disabled { cursor: progress; filter: grayscale(.15); }
.gate-btn .gate-spin { display: none; }
.gate-btn.is-busy .gate-spin { display: inline-block; }
.gate-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .88rem; margin: 14px 0 0; }
.gate-alert {
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600;
}
.gate-alert.is-error {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  animation: gate-shake .35s ease;
}
.gate-alert.is-ok {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: var(--success);
  animation: gate-rise .35s ease;
}
.gate-side {
  border-left: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border-radius: 0 24px 24px 0;
}
.gate-side-label { margin: 0 0 10px; color: var(--muted); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 750; }
.strength { height: 10px; margin: 0 0 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.strength span {
  display: block; height: 100%; width: 0; border-radius: inherit; background: var(--danger);
  transition: width .45s cubic-bezier(.2,.8,.2,1), background .35s ease;
}
.strength.s1 span { width: 18%; }
.strength.s2 span { width: 38%; background: #d97706; }
.strength.s3 span { width: 58%; background: #ca8a04; }
.strength.s4 span { width: 78%; background: #16a34a; }
.strength.s5 span { width: 100%; background: #067647; }
.gate-side [data-strength-label] { display: block; margin-bottom: 14px; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rules li {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 9px 10px;
  transition: color .25s ease, border-color .25s ease, transform .25s ease, background .25s ease;
}
.rules li::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px;
  display: inline-grid; place-items: center;
  border: 1.5px solid var(--border);
}
.rules li.ok { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, var(--border)); transform: translateX(3px); }
.rules li.ok::before { content: "✓"; display: grid; place-items: center; font-size: 11px; color: #fff; background: var(--success); border-color: var(--success); }
.rules li > i { width: 1.15rem; flex: 0 0 1.15rem; color: var(--muted); font-size: 1.05rem; text-align: center; }
.rules li.ok > i { color: var(--success); }
.rules li:has(> i)::before { content: none; width: 0; height: 0; border: 0; }
.gate-side-label i { margin-right: 6px; }
.gate-btn.is-busy > i { display: none; }
.gate-reset .gate-card { align-self: center; }
@keyframes gate-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes gate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-pop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes gate-float { 50% { transform: translateY(14px); } }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}
@media (max-width: 980px) {
  .gate-card-wide { grid-template-columns: 1fr; padding: 8px; }
  .gate-side { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 22px 22px; }
}
@media (max-width: 860px) {
  .auth-stage { position: relative; }
  .gate-toolbar { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; }
  .gate-login { display: flex; flex-direction: column; }
  .gate-visual { padding: calc(64px + env(safe-area-inset-top)) 20px 18px; align-items: flex-start; }
  .gate-visual h1 { font-size: 1.7rem; margin-bottom: 0; }
  .gate-visual p, .gate-features { display: none; }
  .gate-brand { margin-bottom: 10px; }
  .gate-main, .gate-forgot, .gate-force { padding: 0; place-items: stretch; }
  .gate-login .gate-card {
    border-radius: 28px 28px 0 0; min-height: calc(100dvh - 250px);
    box-shadow: 0 -18px 40px rgba(16, 35, 31, .12);
    padding: 26px 18px calc(22px + env(safe-area-inset-bottom));
  }
  .gate-forgot, .gate-force { padding: 84px 14px calc(18px + env(safe-area-inset-bottom)); }
  .gate-forgot .gate-card, .gate-force .gate-card { border-radius: 28px; }
  .auth-legacy { margin-top: 84px; }
}
.nav-group { margin-bottom: 4px; }
.nav-parent {
  width: 100%; display: flex; align-items: center; gap: 10px; color: var(--sidebar-text);
  background: transparent; border: 0; border-radius: 12px; padding: 11px 12px; text-align: left;
  transition: background .2s ease, color .2s ease;
}
.nav-parent span, .nav-child span { flex: 1; min-width: 0; }
.nav-count {
  min-width: 1.35rem; height: 1.35rem; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  background: var(--accent); color: #1b1404; font-size: .72rem; font-weight: 800; line-height: 1;
}
.nav-count[hidden] { display: none !important; }
.page-count { margin-left: 8px; vertical-align: middle; }
a.balance-card { color: inherit; text-decoration: none; }
.remain-days { font-variant-numeric: tabular-nums; }
.remain-none { color: var(--muted); }
table.dataTable tbody tr.leave-new > td,
table.cards tbody tr.leave-new { background: color-mix(in srgb, var(--accent) 18%, var(--surface)) !important; }
.nav-parent:hover, .nav-group.is-current > .nav-parent { background: var(--sidebar-active); color: #fff; }
.nav-caret { transition: transform .22s ease; }
.nav-group.is-open .nav-caret { transform: rotate(180deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s ease; }
.nav-group.is-open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner { overflow: hidden; }
.nav-child {
  display: flex; align-items: center; gap: 10px; color: var(--sidebar-text);
  border-radius: 12px; padding: 9px 12px 9px 34px; margin: 2px 0;
  transition: background .2s ease, color .2s ease;
}
.nav-child:hover { background: color-mix(in srgb, var(--sidebar-active) 70%, transparent); color: #fff; }
.nav-child.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-user { display: inline-flex; align-items: center; gap: 8px; }
.top-user .avatar { width: 28px; height: 28px; }
.dropdown-menu .dropdown-item { display: flex; align-items: center; gap: 8px; }
.btn .btn-spin { display: none; margin-right: 6px; vertical-align: -2px; }
.btn.is-busy .btn-spin { display: inline-block; }
.apply-state { display: flex; gap: 8px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.apply-state.is-on { background: color-mix(in srgb, #b45309 16%, var(--surface)); }
.apply-clash { color: #b45309; margin: 0 0 12px; }
.reject-lead { margin: 0 0 12px; color: var(--muted); }
.modal-title .bi { margin-right: 8px; }
.profile-hero { display: flex; gap: 18px; align-items: center; padding: 22px; margin-bottom: 14px; }
.profile-hero h1 { margin: 0; font-size: 1.6rem; }
.profile-hero p { margin: 4px 0 8px; color: var(--muted); }
.profile-tabs { display: flex; gap: 8px; overflow: auto; margin-bottom: 14px; padding-bottom: 4px; }
.profile-tabs button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 14px; white-space: nowrap;
  display: inline-flex; gap: 6px; align-items: center; transition: background .2s ease, color .2s ease;
}
.profile-tabs button.is-on, .profile-tabs button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.session-list { display: grid; gap: 10px; }
.session-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.session-card small { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-wide { grid-column: 1 / -1; }
.settings-card h2 { display: flex; align-items: center; gap: 8px; }
.settings-sub { font-size: 1rem; margin: 8px 0 12px; }
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-size: 1.15rem; margin: 0; }
.page-head .btn { white-space: nowrap; }
@media (max-width: 860px) {
  .top-user span { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .btn-soft { font-size: 0; padding: 8px 10px; }
  .top-actions .btn-soft i, .top-actions .btn-soft::after { font-size: 1rem; }
  .profile-hero { align-items: flex-start; }
  .session-card { flex-direction: column; align-items: stretch; }
  .settings-grid, .settings-wide { grid-template-columns: 1fr; grid-column: auto; }
  .modal-dialog { margin: 0; max-width: 100%; height: 100%; }
  .modal-content { min-height: 100dvh; border-radius: 0; border: 0; }
  .page-head { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .gate, .gate-card, .gate-visual-inner, .gate-features li, .gate-orb, .auth-legacy,
  .gate-visual::before, .gate-visual::after, .strength span, .rules li, .gate-alert,
  .nav-caret, .nav-sub, .nav-parent, .nav-child, .profile-tabs button,
  .emp-dash .dash-hero, .emp-dash .dash-stat, .emp-dash .dash-panel,
  .emp-dash .balance-card, .emp-dash .request-card, .emp-dash .stat.is-hot .dash-ico,
  .emp-dash .balance-track > span { animation: none !important; transition: none !important; }
  .emp-dash .balance-track > span { width: var(--p, 0%); }
  .emp-dash .dash-stat:hover, .emp-dash .balance-card:hover, .emp-dash .request-card:hover { transform: none; }
}

.emp-dash .dash-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 24px; margin-bottom: 16px; border-radius: 22px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  background:
    radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 70%),
    radial-gradient(360px 180px at 0% 120%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 72%),
    var(--surface);
  box-shadow: var(--shadow);
  animation: dash-rise .5s ease both;
}
.emp-dash .dash-kicker { margin: 0 0 4px; color: var(--muted); font-size: .88rem; }
.emp-dash .dash-hero h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; }
.emp-dash .dash-ribbon {
  display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 6px 12px;
  border-radius: 999px; font-weight: 650; font-size: .88rem; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}
.emp-dash .dash-ribbon[hidden] { display: none; }
.emp-dash .dash-apply { display: inline-flex; align-items: center; gap: 8px; border-radius: 14px; min-height: 46px; padding-inline: 16px; }
.emp-dash .dash-stat {
  display: grid; grid-template-columns: 46px 1fr; column-gap: 12px; align-items: center;
  animation: dash-rise .55s ease both; animation-delay: calc(var(--i, 0) * 70ms);
  transition: transform .2s ease, box-shadow .2s ease;
}
.emp-dash .dash-stat:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(16, 35, 31, .1); }
.emp-dash .dash-ico {
  grid-row: 1 / span 2; width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center; font-size: 1.25rem;
}
.emp-dash .stat i { float: none; font-size: 1.25rem; color: inherit; }
.emp-dash .dash-stat strong { margin-top: 0; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.emp-dash .tone-warn .dash-ico, .emp-dash .tone-warn.request-ico, .emp-dash .request-ico.tone-warn { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.emp-dash .tone-live .dash-ico, .emp-dash .request-ico.tone-live { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); }
.emp-dash .tone-info .dash-ico, .emp-dash .request-ico.tone-info { background: color-mix(in srgb, var(--info) 14%, var(--surface)); color: var(--info); }
.emp-dash .tone-ok .dash-ico, .emp-dash .request-ico.tone-ok { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.emp-dash .stat.is-hot .dash-ico { animation: dash-pulse 1.8s ease-in-out infinite; }
.emp-dash .dash-panel { animation: dash-rise .55s ease both; animation-delay: calc(var(--i, 0) * 60ms); }
.emp-dash .dash-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.emp-dash .dash-panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.emp-dash .dash-panel-head h2 i { color: var(--primary); }
.emp-dash .dash-year { font-size: .78rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.emp-dash .dash-more { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 650; white-space: nowrap; }
.balance-list, .request-list { display: grid; gap: 10px; }
.balance-card, .request-card {
  display: grid; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 16px;
  padding: 12px; background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  animation: dash-rise .45s ease both; animation-delay: calc(var(--i, 0) * 50ms + 120ms);
  transition: transform .2s ease, border-color .2s ease;
}
.balance-card { grid-template-columns: 42px 1fr auto; }
.balance-card:hover, .request-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.balance-ico, .request-ico {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem;
}
.balance-card.tone-gold .balance-ico { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: color-mix(in srgb, var(--accent) 72%, var(--text)); }
.balance-card.tone-amber .balance-ico { background: color-mix(in srgb, var(--warning) 16%, var(--surface)); color: var(--warning); }
.balance-card.tone-rose .balance-ico { background: color-mix(in srgb, #e11d48 14%, var(--surface)); color: #be123c; }
.balance-card.tone-teal .balance-ico { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); }
.balance-card.tone-slate .balance-ico { background: color-mix(in srgb, var(--muted) 16%, var(--surface)); color: var(--muted); }
.balance-copy strong, .request-copy strong { display: block; }
.balance-meta, .request-copy small { color: var(--muted); font-size: .82rem; }
.balance-track { height: 8px; margin-top: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.balance-track > span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--accent) 75%, var(--primary)));
  animation: dash-fill .9s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 60ms + 220ms);
}
.balance-card.is-low .balance-track > span { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.balance-left { display: grid; justify-items: end; align-content: center; min-width: 4.8rem; text-align: right; }
.balance-left b { font-size: 1.55rem; line-height: 1; font-variant-numeric: tabular-nums; }
.balance-left small { color: var(--primary); font-size: .68rem; font-weight: 750; line-height: 1.2; max-width: 5.4rem; }
.request-card { grid-template-columns: 42px 1fr auto; color: inherit; text-decoration: none; }
.request-copy { min-width: 0; }
.request-copy strong, .request-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-status {
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 4px 8px; white-space: nowrap;
  background: color-mix(in srgb, var(--muted) 12%, var(--surface)); color: var(--muted);
}
.request-status.tone-warn { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.request-status.tone-ok, .request-status.tone-done { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.request-status.tone-bad { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.request-status.tone-live { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); }
.request-status.tone-info { background: color-mix(in srgb, var(--info) 14%, var(--surface)); color: var(--info); }
.request-ico.tone-bad { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.request-ico.tone-done { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.request-ico.tone-muted { background: color-mix(in srgb, var(--muted) 12%, var(--surface)); color: var(--muted); }
.dash-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 12px; color: var(--muted); text-align: center; }
.dash-empty i { font-size: 1.6rem; }
@keyframes dash-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes dash-fill { to { width: var(--p, 0%); } }
@keyframes dash-pulse { 50% { transform: scale(1.08); } }
@media (max-width: 860px) {
  .emp-dash .dash-hero { flex-direction: column; align-items: stretch; }
  .emp-dash .stat-grid { grid-template-columns: 1fr 1fr; }
  .emp-dash .dash-more { font-size: 0; }
  .emp-dash .dash-more i { font-size: 1rem; }
  .request-card { grid-template-columns: 42px 1fr; }
  .request-status { grid-column: 2; justify-self: start; }
}
