:root {
  --ink: #14233a;
  --muted: #697a90;
  --subtle: #8c9bad;
  --paper: #edf3f6;
  --surface: rgba(255, 255, 255, .76);
  --surface-strong: rgba(255, 255, 255, .9);
  --line: rgba(189, 210, 225, .78);
  --line-strong: #b9d0e1;
  --blue: #235a8d;
  --blue-deep: #142f4d;
  --blue-soft: #e5f0f8;
  --teal: #2f7c72;
  --teal-soft: #e5f4f0;
  --red: #a34f5f;
  --red-soft: #f9ecef;
  --shadow: 0 18px 38px rgba(28, 55, 78, .08);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(132deg, #eaf1f5 0%, #f6f9fa 45%, #e7f0f5 100%);
  color: var(--ink);
  font: 13px/1.55 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    repeating-linear-gradient(90deg, rgba(37, 92, 137, .025) 0 1px, transparent 1px 78px),
    repeating-linear-gradient(0deg, rgba(37, 92, 137, .018) 0 1px, transparent 1px 78px);
}
body::after {
  opacity: .7;
  background: linear-gradient(118deg, transparent 0 36%, rgba(205, 227, 240, .48) 48%, transparent 62%);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
h1, h2, p { margin-top: 0; }

.btn {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  transition: transform .22s ease, color .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.primary { background: #215989; box-shadow: 0 10px 18px rgba(29, 80, 126, .18); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #184a76; box-shadow: 0 13px 22px rgba(29, 80, 126, .25); }
.btn.secondary { border-color: var(--line-strong); background: rgba(255, 255, 255, .6); }
.btn.secondary:hover:not(:disabled) { border-color: #8faec4; background: var(--blue-soft); color: var(--blue); }
.btn.ghost { border-color: rgba(185, 208, 225, .72); background: rgba(236, 246, 251, .5); color: #376681; }
.btn.ghost:hover:not(:disabled) { border-color: #9abace; background: #edf6fa; color: #184a76; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-outline { border-color: #e1bcc4; background: rgba(255, 255, 255, .48); color: var(--red); }
.btn.danger-outline:hover:not(:disabled) { border-color: #d397a2; background: var(--red-soft); }
.btn.small { min-height: 30px; padding: 0 9px; font-size: 10px; }
.btn.full { width: 100%; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card {
  width: min(412px, 100%);
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(204, 222, 233, .96);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 26px 64px rgba(29, 53, 75, .12), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(24px) saturate(128%);
  -webkit-backdrop-filter: blur(24px) saturate(128%);
  animation: surface-in .48s cubic-bezier(.2, .8, .2, 1) both;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2f7c72, #3976a6, #a3c4d9);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 21px; }
.login-brand > div > b, .login-brand > div > small { display: block; }
.login-brand b { font-size: 16px; }
.login-brand small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.brand-mark {
  width: 33px;
  height: 33px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(191, 215, 231, .96);
  border-radius: 9px;
  background: rgba(235, 246, 252, .88);
  box-shadow: inset 0 1px 0 #fff, 0 7px 16px rgba(34, 78, 115, .08);
  color: var(--blue-deep);
  font-weight: 850;
}
.login-rule { width: 52px; height: 2px; margin-bottom: 19px; background: linear-gradient(90deg, var(--teal), #9ac2d4); }
.kicker, .panel-label, .modal-head > div > span {
  display: block;
  color: #637e9b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}
.login-card h1 { margin: 7px 0 4px; font-size: 25px; line-height: 1.25; }
.login-card > p { margin-bottom: 23px; color: var(--muted); font-size: 12px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; color: #31465e; font-size: 11px; font-weight: 750; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: rgba(255, 255, 255, .64);
  color: var(--ink);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.field input { height: 39px; padding: 0 10px; }
.field textarea { min-height: 94px; padding: 9px 10px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: #6e99bf; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 3px rgba(39, 94, 139, .1); transform: translateY(-1px); }
.form-error { margin-bottom: 12px; padding: 8px 10px; border: 1px solid rgba(221, 176, 185, .54); border-radius: 7px; background: var(--red-soft); color: var(--red); font-size: 11px; }

.admin-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 236px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: 18px 13px;
  overflow: hidden;
  border-right: 1px solid rgba(184, 214, 234, .16);
  background: rgba(18, 43, 71, .91);
  box-shadow: 18px 0 42px rgba(16, 38, 59, .12);
  color: #eaf3fa;
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .58;
  background:
    linear-gradient(145deg, rgba(115, 164, 196, .14), transparent 39%),
    repeating-linear-gradient(0deg, rgba(222, 244, 255, .035) 0 1px, transparent 1px 65px);
}
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 2px 10px 23px; color: #fff; }
.brand b, .brand small { display: block; }
.brand b { font-size: 15px; }
.brand small { margin-top: 1px; color: #adc5dd; font-size: 10px; }
.sidebar nav { position: relative; z-index: 1; display: grid; gap: 17px; }
.nav-group > span { display: block; padding: 0 10px 5px; color: #8faac6; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.nav-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 2px 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b7cce0;
  text-align: left;
  transition: color .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease;
}
.nav-item i { width: 16px; color: #a9c4dc; font-style: normal; text-align: center; }
.nav-item span { font-size: 12px; }
.nav-item:hover { background: rgba(255, 255, 255, .075); color: #fff; transform: translateX(2px); }
.nav-item.active { background: rgba(213, 235, 249, .15); box-shadow: inset 2px 0 0 #ccecff, 0 6px 14px rgba(7, 22, 38, .12); color: #fff; }
.nav-item.active i { color: #d7efff; }
.sidebar-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 10px 2px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-foot small, .sidebar-foot b { display: block; }
.sidebar-foot small { color: #91abc5; font-size: 9px; }
.sidebar-foot b { margin-top: 2px; color: #dcebf7; font-size: 10px; }
.signal-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #75c1a6; box-shadow: 0 0 0 4px rgba(117, 193, 166, .12); }

.main { width: calc(100% - 236px); min-width: 0; margin-left: 236px; }
.appbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid rgba(199, 217, 229, .7);
  background: rgba(246, 250, 252, .72);
  box-shadow: 0 9px 23px rgba(32, 62, 87, .035);
  backdrop-filter: blur(22px) saturate(138%);
  -webkit-backdrop-filter: blur(22px) saturate(138%);
}
.appbar-title > span, .appbar-title > b { display: block; }
.appbar-title > span { color: #8395a8; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.appbar-title > b { margin-top: 1px; font-size: 14px; }
.appbar-actions { display: flex; align-items: center; gap: 9px; }
.session-dot { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(202, 223, 235, .92); border-radius: 999px; background: rgba(255, 255, 255, .54); color: var(--muted); font-size: 10px; }
.session-dot i { width: 6px; height: 6px; border-radius: 50%; background: #559574; box-shadow: 0 0 0 3px rgba(85, 149, 116, .1); }
.page { max-width: 1200px; margin: 0 auto; padding: 21px 30px 42px; }
.page-head { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-head h1 { margin: 0 0 2px; font-size: 21px; line-height: 1.25; }
.page-head p { margin: 0; color: var(--muted); font-size: 11px; }

.panel {
  overflow: hidden;
  border: 1px solid rgba(204, 221, 231, .88);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px) saturate(126%);
  -webkit-backdrop-filter: blur(18px) saturate(126%);
}
.panel-head { min-height: 59px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 15px; border-bottom: 1px solid rgba(214, 227, 235, .92); background: rgba(250, 253, 255, .48); }
.panel-head h2 { margin: 2px 0 0; font-size: 14px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.loading, .empty { padding: 28px 15px; color: var(--muted); font-size: 11px; text-align: center; }

.overview-hero {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 11px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid rgba(58, 107, 148, .72);
  border-radius: 8px;
  background: rgba(18, 51, 80, .9);
  box-shadow: 0 17px 32px rgba(14, 41, 66, .15), inset 0 1px 0 rgba(238, 249, 255, .13);
  color: #f2f8fc;
  backdrop-filter: blur(22px) saturate(128%);
  -webkit-backdrop-filter: blur(22px) saturate(128%);
}
.overview-hero::after { content: ""; position: absolute; width: 45%; height: 180%; right: -17%; top: -36%; opacity: .45; transform: rotate(17deg); border-left: 1px solid rgba(215, 240, 254, .28); border-right: 1px solid rgba(215, 240, 254, .1); }
.overview-hero > div:first-child { position: relative; z-index: 1; }
.overview-hero .panel-label { color: #a9c9df; }
.overview-hero h2 { margin: 4px 0 3px; font-size: 19px; }
.overview-hero p { margin: 0; color: #c8dae8; font-size: 11px; }
.hero-state { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(112px, 1fr)); gap: 7px; }
.hero-state > div { min-width: 0; padding: 9px 10px; border: 1px solid rgba(217, 238, 251, .15); border-radius: 7px; background: rgba(255, 255, 255, .06); }
.hero-state span, .hero-state b { display: block; }
.hero-state span { color: #afc6d9; font-size: 9px; }
.hero-state b { margin-top: 2px; color: #fff; font-size: 12px; }
.hero-state b.positive { color: #b7ead7; }
.hero-state b.muted { color: #d6dde3; }
.overview-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.stat-card, .stat-skeleton { min-height: 101px; border: 1px solid rgba(204, 221, 231, .88); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .88); backdrop-filter: blur(18px) saturate(126%); -webkit-backdrop-filter: blur(18px) saturate(126%); }
.stat-card { position: relative; overflow: hidden; padding: 13px 14px; }
.stat-card::after { content: ""; position: absolute; right: 0; bottom: 0; width: 44px; height: 3px; background: #8fb7d2; }
.stat-card:nth-child(2)::after { background: #7eafa7; }
.stat-card:nth-child(3)::after { background: #9eb8ca; }
.stat-card:nth-child(4)::after { background: #b6a7bd; }
.stat-card span, .stat-card b, .stat-card small { display: block; }
.stat-card span { color: var(--muted); font-size: 10px; }
.stat-card b { margin: 4px 0 1px; color: var(--ink); font-size: 26px; line-height: 1.1; }
.stat-card small { color: #8796a7; font-size: 9px; }
.stat-skeleton { opacity: .64; background: linear-gradient(110deg, rgba(255, 255, 255, .4), rgba(236, 245, 250, .86), rgba(255, 255, 255, .4)); background-size: 200% 100%; animation: sheen 1.6s linear infinite; }
.overview-workbench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.overview-list { padding: 3px 15px 8px; }
.overview-list > div { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(218, 229, 237, .86); }
.overview-list > div:last-child { border-bottom: 0; }
.overview-list span { color: var(--muted); font-size: 11px; }
.overview-list b { color: var(--blue); font-size: 12px; }

.registration-control { min-height: 91px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; padding: 15px 17px; }
.registration-copy h2 { margin: 2px 0 1px; font-size: 15px; }
.registration-copy p { margin: 0; color: var(--muted); font-size: 10px; }
.switch-control { --switch-travel: 80px; min-width: 118px; height: 35px; position: relative; display: inline-flex; align-items: center; justify-content: flex-start; padding: 4px 8px 4px 36px; border: 1px solid #d6c4c8; border-radius: 999px; background: rgba(251, 242, 244, .76); color: #945965; transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease; }
.switch-control:hover { transform: translateY(-1px); }
.switch-control > span { width: 25px; height: 25px; position: absolute; left: 5px; border-radius: 50%; background: #b16b76; box-shadow: 0 3px 8px rgba(105, 53, 63, .18); transition: transform .25s ease, background .25s ease; }
.switch-control > b { font-size: 10px; }
.switch-control.on { border-color: #a6d1c5; background: rgba(232, 247, 242, .8); color: #2f7667; box-shadow: 0 7px 14px rgba(47, 124, 114, .08); }
.switch-control.on > span { transform: translateX(var(--switch-travel)); background: #3e9880; }
.user-panel { min-height: 0; }
.user-list { padding: 2px 15px 8px; }
.user-row { display: grid; grid-template-columns: 34px minmax(210px, 1fr) auto auto; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid rgba(216, 228, 236, .9); }
.user-row:last-child { border-bottom: 0; }
.user-row.is-admin { background: linear-gradient(90deg, rgba(234, 245, 251, .42), transparent 50%); }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #c5d9e7; border-radius: 9px; background: #edf6fb; color: var(--blue); font-size: 12px; font-weight: 850; }
.user-main { min-width: 0; }
.user-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.user-title b { color: var(--ink); font-size: 12px; }
.user-main p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-main small { display: block; margin-top: 1px; color: #8c9baa; font-size: 9px; }
.tag { display: inline-flex; align-items: center; min-height: 17px; padding: 1px 5px; border-radius: 4px; background: #e6f2f9; color: #285d88; font-size: 9px; font-weight: 800; }
.tag.muted { background: #edf0f3; color: #768391; }
.tag.system { background: #e8f3ef; color: #317667; }
.user-metrics { display: flex; gap: 10px; }
.user-metrics span { display: grid; gap: 1px; color: var(--muted); font-size: 9px; text-align: right; }
.user-metrics b { color: #3a526a; font-size: 10px; }
.row-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-note { padding: 5px 0; color: #8796a7; font-size: 10px; }

.content-panel { min-height: 0; }
.management-list { padding: 2px 15px 8px; }
.management-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(216, 228, 236, .9); }
.management-row:last-child { border-bottom: 0; }
.management-row.inactive { opacity: .58; }
.management-row-main { min-width: 0; }
.management-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.management-title b { color: var(--ink); font-size: 12px; }
.management-row p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.management-row small { display: block; margin-top: 3px; color: #8b99a9; font-size: 10px; }

.modal-layer { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(11, 28, 46, .37); opacity: 0; transition: opacity .18s ease; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-layer.show { opacity: 1; }
.modal { width: min(500px, 100%); max-height: min(760px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(204, 221, 231, .94); border-radius: 10px; background: rgba(255, 255, 255, .9); box-shadow: 0 28px 60px rgba(14, 35, 55, .24), inset 0 1px 0 #fff; transform: translateY(9px) scale(.986); transition: transform .22s ease; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.modal-layer.show .modal { transform: translateY(0) scale(1); }
.modal-wide { width: min(620px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 2px 0 0; font-size: 15px; }
.icon-button { width: 29px; height: 29px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .58); color: var(--muted); font-size: 18px; line-height: 1; }
.modal-body { overflow: auto; padding: 17px; }
.modal-copy { margin: 0; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.editor-form .check + .check { margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; color: #405873; font-size: 11px; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sort-field { max-width: 180px; margin-top: 14px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: min(400px, calc(100vw - 28px)); padding: 10px 13px; border: 1px solid rgba(202, 221, 235, .62); border-radius: 7px; background: rgba(25, 66, 103, .94); box-shadow: 0 16px 34px rgba(17, 39, 61, .18); color: #fff; font-size: 11px; opacity: 0; transform: translateY(9px); transition: opacity .2s ease, transform .2s ease; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.toast.show { opacity: 1; transform: none; }
.toast.success { background: rgba(43, 115, 84, .94); }
.toast.error { background: rgba(161, 77, 91, .96); }

@keyframes surface-in { from { opacity: 0; transform: translateY(10px) scale(.988); } to { opacity: 1; transform: none; } }
@keyframes sheen { from { background-position: 200% 0; } to { background-position: -10% 0; } }
.page > * { animation: surface-in .36s ease both; }
.page > *:nth-child(2) { animation-delay: .035s; }
.page > *:nth-child(3) { animation-delay: .07s; }

@media (max-width: 980px) {
  .sidebar { width: 76px; padding-right: 10px; padding-left: 10px; }
  .brand { justify-content: center; padding-right: 0; padding-left: 0; }
  .brand > span:last-child, .nav-group > span, .nav-item span, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 8px; }
  .main { width: calc(100% - 76px); margin-left: 76px; }
  .overview-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row { grid-template-columns: 34px minmax(160px, 1fr) auto; }
  .user-metrics { grid-column: 2 / -1; justify-content: flex-start; }
  .user-metrics span { text-align: left; }
}

@media (max-width: 680px) {
  .sidebar { width: 100%; height: auto; position: static; display: block; padding: 10px 12px; }
  .sidebar::before { display: none; }
  .brand { justify-content: flex-start; padding: 0 2px 9px; }
  .brand > span:last-child { display: block; }
  .sidebar nav { display: flex; gap: 5px; overflow-x: auto; }
  .nav-group { display: flex; gap: 5px; }
  .nav-group > span { display: none; }
  .nav-item { width: auto; min-width: 88px; justify-content: center; margin: 0; padding: 8px 9px; }
  .nav-item span { display: block; }
  .main { width: 100%; margin-left: 0; }
  .appbar { height: 58px; padding: 0 13px; }
  .appbar-title > span { font-size: 8px; }
  .session-dot { display: none; }
  .page { padding: 16px 12px 30px; }
  .page-head { align-items: flex-start; margin-bottom: 11px; }
  .page-head h1 { font-size: 19px; }
  .page-head p { font-size: 10px; }
  .overview-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 14px; }
  .overview-hero h2 { font-size: 17px; }
  .hero-state { width: 100%; }
  .overview-stat-grid { gap: 7px; }
  .stat-card { min-height: 86px; padding: 10px; }
  .stat-card b { font-size: 21px; }
  .overview-workbench { grid-template-columns: 1fr; }
  .registration-control { align-items: flex-start; padding: 13px; }
  .switch-control { --switch-travel: 68px; min-width: 106px; }
  .panel-head { min-height: 55px; padding: 11px 12px; }
  .panel-head p { max-width: 220px; }
  .user-list, .management-list { padding-right: 12px; padding-left: 12px; }
  .user-row { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; align-items: start; }
  .user-metrics, .user-row .row-actions { grid-column: 2; justify-content: flex-start; }
  .user-metrics { margin-top: -4px; }
  .management-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .row-actions { justify-content: flex-start; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .sort-field { max-width: none; }
  .modal-layer { padding: 10px; }
  .modal-body { padding: 14px; }
  .modal-actions .btn { flex: 1; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Final responsive pass: predictable widths and cheaper paints on small devices. */
html,
body {
  width: 100%;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

@supports (overflow: clip) {
  html,
  body { overflow-x: clip; }
}

#app,
.admin-shell,
.main,
.page,
.page > *,
.panel-head > *,
.user-main,
.management-row-main,
.row-actions { min-width: 0; }

button,
input,
textarea { max-width: 100%; }

.panel,
.stat-card,
.stat-skeleton,
.login-card,
.modal {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  contain: layout style;
}

.appbar,
.sidebar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

.btn,
.nav-item,
.switch-control,
.user-row,
.management-row {
  transition-property: transform, opacity, color, background-color, border-color;
  transition-duration: .16s;
  transition-timing-function: ease-out;
}

@media (max-width: 680px) {
  html,
  body { min-width: 0; scrollbar-gutter: auto; }

  .admin-shell { display: block; width: 100%; min-width: 0; }
  .main { display: block; width: 100%; min-width: 0; margin-left: 0; }
  .sidebar { width: 100%; flex: none; position: static; padding: 9px 10px; }
  .brand { padding: 0 2px 8px; }
  .sidebar nav { gap: 4px; }
  .nav-group { min-width: 0; }
  .nav-item { min-width: 82px; min-height: 36px; padding: 7px 8px; }
  .appbar { height: 56px; min-height: 56px; padding: 0 11px; }
  .appbar-actions { min-width: 0; gap: 5px; }
  .session-dot { display: none; }
  .page { width: 100%; max-width: none; padding: 14px 10px 26px; }
  .page-head { gap: 10px; margin-bottom: 10px; }
  .page-head h1 { font-size: 19px; overflow-wrap: anywhere; }
  .page-head p { max-width: 100%; overflow-wrap: anywhere; }
  .page-head > .btn { width: 100%; margin-top: 8px; }

  .overview-hero { min-height: 0; align-items: flex-start; flex-direction: column; gap: 12px; padding: 13px; }
  .overview-hero h2 { font-size: 17px; overflow-wrap: anywhere; }
  .hero-state { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat-card { min-height: 84px; padding: 10px; }
  .stat-card b { font-size: 21px; }
  .overview-workbench { grid-template-columns: minmax(0, 1fr); }
  .registration-control { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; }
  .switch-control { align-self: flex-start; }

  .user-list,
  .management-list { padding-right: 11px; padding-left: 11px; }
  .user-row { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: start; }
  .user-metrics,
  .user-row .row-actions { grid-column: 2; justify-content: flex-start; }
  .user-metrics { margin-top: -3px; flex-wrap: wrap; }
  .management-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .row-actions { justify-content: flex-start; }

  .two-col { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .modal-layer { padding: 10px; }
  .modal { width: 100%; max-height: calc(100dvh - 20px); }
  .modal-body { padding: 13px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 120px; }
  .toast { right: 10px; bottom: 10px; left: 10px; max-width: none; }
}

@media (max-width: 390px) {
  .page { padding-right: 8px; padding-left: 8px; }
  .hero-state { grid-template-columns: minmax(0, 1fr); }
  .overview-stat-grid { gap: 6px; }
  .stat-card { padding: 9px; }
  .stat-card b { font-size: 19px; }
  .nav-item { min-width: 76px; padding-right: 6px; padding-left: 6px; }
  .nav-item span { font-size: 11px; }
}
