/* Twilight Admin - Material 3 Expressive surface layer */

:root {
  --font: "Noto Sans SC", "Microsoft YaHei UI", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --shape-extra-small: 8px;
  --shape-small: 12px;
  --shape-medium: 16px;
  --shape-large: 20px;
  --shape-extra-large: 28px;
  --shape-full: 999px;
  --motion-fast: 150ms cubic-bezier(.2, 0, 0, 1);
  --motion-standard: 220ms cubic-bezier(.2, 0, 0, 1);
  --motion-emphasized: 320ms cubic-bezier(.2, .8, 0, 1);
  --z-app-bar: 10;
  --z-menu: 20;
  --z-fab: 30;
  --z-modal: 40;
  --z-confirm: 50;
  --z-toast: 60;
  --radius: var(--shape-medium);
  --radius-sm: var(--shape-small);
  --radius-xs: var(--shape-extra-small);
  --radius-full: var(--shape-full);
  --transition-fast: var(--motion-fast);
  --transition-base: var(--motion-standard);
  --primary: var(--md-sys-color-primary);
  --primary-hover: var(--md-sys-color-primary);
  --primary-bg: var(--md-sys-color-primary-container);
  --primary-gradient: var(--md-sys-color-primary);
  --accent: var(--md-sys-color-tertiary);
  --accent-bg: var(--md-sys-color-tertiary-container);
  --warn: var(--md-sys-color-secondary);
  --warn-bg: var(--md-sys-color-secondary-container);
  --error: var(--md-sys-color-error);
  --error-bg: var(--md-sys-color-error-container);
  --bg: var(--md-sys-color-background);
  --bg-secondary: var(--md-sys-color-surface-container-low);
  --surface: var(--md-sys-color-surface-container);
  --surface2: var(--md-sys-color-surface-container-high);
  --surface3: var(--md-sys-color-surface-container-highest);
  --border: var(--md-sys-color-outline-variant);
  --border-light: var(--md-sys-color-outline);
  --on-bg: var(--md-sys-color-on-background);
  --on-surface: var(--md-sys-color-on-surface);
  --on-dim: var(--md-sys-color-on-surface-variant);
  --on-muted: var(--md-sys-color-outline);
  --text: var(--md-sys-color-on-surface);
  --text-secondary: var(--md-sys-color-on-surface-variant);
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 12px 28px rgb(0 0 0 / 18%);
  --glass-bg: var(--md-sys-color-surface-container-low);
  --gradient-hero: none;
}

:root,
[data-theme="twilight"] {
  color-scheme: dark;
  --md-sys-color-primary: #a8f6c6;
  --md-sys-color-on-primary: #00391f;
  --md-sys-color-primary-container: #00522f;
  --md-sys-color-on-primary-container: #c4ffda;
  --md-sys-color-secondary: #b9cfbc;
  --md-sys-color-on-secondary: #243426;
  --md-sys-color-secondary-container: #3a4c3b;
  --md-sys-color-on-secondary-container: #d5ebd5;
  --md-sys-color-tertiary: #e4b9f5;
  --md-sys-color-on-tertiary: #47205c;
  --md-sys-color-tertiary-container: #603879;
  --md-sys-color-on-tertiary-container: #f9d8ff;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-background: #111814;
  --md-sys-color-on-background: #dbe7dd;
  --md-sys-color-surface: #111814;
  --md-sys-color-on-surface: #dbe7dd;
  --md-sys-color-surface-variant: #414b43;
  --md-sys-color-on-surface-variant: #c0ccc1;
  --md-sys-color-surface-container-lowest: #0b120d;
  --md-sys-color-surface-container-low: #171f1a;
  --md-sys-color-surface-container: #1b241e;
  --md-sys-color-surface-container-high: #263029;
  --md-sys-color-surface-container-highest: #303a33;
  --md-sys-color-outline: #89968a;
  --md-sys-color-outline-variant: #404b42;
}

[data-theme="ocean"] {
  color-scheme: dark;
  --md-sys-color-primary: #8fd1ff;
  --md-sys-color-on-primary: #00344f;
  --md-sys-color-primary-container: #004d70;
  --md-sys-color-on-primary-container: #c6e7ff;
  --md-sys-color-secondary: #b8c9d6;
  --md-sys-color-on-secondary: #23323d;
  --md-sys-color-secondary-container: #394a57;
  --md-sys-color-on-secondary-container: #d4e5f3;
  --md-sys-color-tertiary: #d2c1ff;
  --md-sys-color-on-tertiary: #3b2870;
  --md-sys-color-tertiary-container: #523f88;
  --md-sys-color-on-tertiary-container: #e9ddff;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-background: #0d171e;
  --md-sys-color-on-background: #dce9f2;
  --md-sys-color-surface: #0d171e;
  --md-sys-color-on-surface: #dce9f2;
  --md-sys-color-surface-variant: #424b52;
  --md-sys-color-on-surface-variant: #c2cbd3;
  --md-sys-color-surface-container-lowest: #071118;
  --md-sys-color-surface-container-low: #131f27;
  --md-sys-color-surface-container: #17242c;
  --md-sys-color-surface-container-high: #223038;
  --md-sys-color-surface-container-highest: #2c3a43;
  --md-sys-color-outline: #8b959d;
  --md-sys-color-outline-variant: #424b52;
}

[data-theme="amethyst"] {
  color-scheme: dark;
  --md-sys-color-primary: #e6baff;
  --md-sys-color-on-primary: #4c1768;
  --md-sys-color-primary-container: #663580;
  --md-sys-color-on-primary-container: #f9d8ff;
  --md-sys-color-secondary: #d0c1d3;
  --md-sys-color-on-secondary: #382d3a;
  --md-sys-color-secondary-container: #504353;
  --md-sys-color-on-secondary-container: #edddf0;
  --md-sys-color-tertiary: #c3c5ff;
  --md-sys-color-on-tertiary: #2b2e6b;
  --md-sys-color-tertiary-container: #424681;
  --md-sys-color-on-tertiary-container: #dfe0ff;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-background: #17121f;
  --md-sys-color-on-background: #e9e0ec;
  --md-sys-color-surface: #17121f;
  --md-sys-color-on-surface: #e9e0ec;
  --md-sys-color-surface-variant: #4b444e;
  --md-sys-color-on-surface-variant: #cec5d0;
  --md-sys-color-surface-container-lowest: #100c17;
  --md-sys-color-surface-container-low: #1e1827;
  --md-sys-color-surface-container: #241d2e;
  --md-sys-color-surface-container-high: #2f2839;
  --md-sys-color-surface-container-highest: #3a323f;
  --md-sys-color-outline: #978e99;
  --md-sys-color-outline-variant: #4b444e;
}

[data-theme="ember"] {
  color-scheme: dark;
  --md-sys-color-primary: #ffb68b;
  --md-sys-color-on-primary: #542000;
  --md-sys-color-primary-container: #763600;
  --md-sys-color-on-primary-container: #ffdbca;
  --md-sys-color-secondary: #e4bdab;
  --md-sys-color-on-secondary: #422b20;
  --md-sys-color-secondary-container: #5a4034;
  --md-sys-color-on-secondary-container: #ffdbca;
  --md-sys-color-tertiary: #d7c2ff;
  --md-sys-color-on-tertiary: #3c2a70;
  --md-sys-color-tertiary-container: #544187;
  --md-sys-color-on-tertiary-container: #eadcff;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-background: #21140f;
  --md-sys-color-on-background: #f4dfd5;
  --md-sys-color-surface: #21140f;
  --md-sys-color-on-surface: #f4dfd5;
  --md-sys-color-surface-variant: #53433c;
  --md-sys-color-on-surface-variant: #d9c2b8;
  --md-sys-color-surface-container-lowest: #180d09;
  --md-sys-color-surface-container-low: #281a14;
  --md-sys-color-surface-container: #2f2019;
  --md-sys-color-surface-container-high: #3b2a22;
  --md-sys-color-surface-container-highest: #46332a;
  --md-sys-color-outline: #a08c82;
  --md-sys-color-outline-variant: #53433c;
}

[data-theme="light"] {
  color-scheme: light;
  --md-sys-color-primary: #0e6c45;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #a4f6c4;
  --md-sys-color-on-primary-container: #002111;
  --md-sys-color-secondary: #4f6353;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d2e8d4;
  --md-sys-color-on-secondary-container: #0d2012;
  --md-sys-color-tertiary: #6a3f80;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #f1d8ff;
  --md-sys-color-on-tertiary-container: #29003d;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-background: #f7fbf5;
  --md-sys-color-on-background: #181d19;
  --md-sys-color-surface: #f7fbf5;
  --md-sys-color-on-surface: #181d19;
  --md-sys-color-surface-variant: #dce6dc;
  --md-sys-color-on-surface-variant: #404942;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f1f6ef;
  --md-sys-color-surface-container: #ebf0e9;
  --md-sys-color-surface-container-high: #e5ebe3;
  --md-sys-color-surface-container-highest: #dfe5dd;
  --md-sys-color-outline: #707971;
  --md-sys-color-outline-variant: #c0c9c0;
  --shadow-lg: 0 12px 28px rgb(28 39 29 / 14%);
}

html {
  background: var(--md-sys-color-background);
  font-size: 16px;
}

body {
  min-width: 320px;
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  font-family: var(--font);
  line-height: 1.5;
  letter-spacing: .01em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.filter-chip:focus-visible,
.stat-card:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Connection */
.setup-screen {
  min-height: 100dvh;
  padding: 24px;
  background: var(--md-sys-color-background);
}

.setup-screen::before {
  content: '';
  position: fixed;
  width: min(72vw, 760px);
  aspect-ratio: 1;
  border-radius: 46% 54% 58% 42% / 48% 42% 58% 52%;
  background: var(--md-sys-color-primary-container);
  opacity: .28;
  filter: blur(80px);
  transform: translate(-20%, -28%);
  pointer-events: none;
}

.setup-card {
  position: relative;
  z-index: 1;
  max-width: 470px;
  padding: clamp(28px, 6vw, 44px);
  text-align: left;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-extra-large);
  box-shadow: none;
  animation: setup-arrive var(--motion-emphasized) both;
}

@keyframes setup-arrive {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.setup-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.setup-logo,
.header-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  font-weight: 800;
}

.setup-logo {
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 21px 21px 14px 21px;
  font-size: 25px;
  box-shadow: none;
}

.brand-overline,
.app-bar-title p,
.section-overline,
.panel-heading p,
.list-panel-heading p,
.modal-heading p,
.settings-section-heading p {
  margin: 0;
  color: var(--md-sys-color-primary);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.setup-card h1 {
  margin: 3px 0 0;
  color: var(--md-sys-color-on-surface);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.setup-description {
  max-width: 34ch;
  margin: 0 0 30px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 15px;
  line-height: 1.7;
}

.setup-card .form-group,
.modal .form-group {
  margin-bottom: 18px;
}

.form-group label {
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.form-group input,
.modal input,
.modal select,
.modal textarea {
  min-height: 48px;
  padding: 12px 14px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--shape-small);
  box-shadow: none;
}

.form-group input:hover,
.modal input:hover,
.modal select:hover,
.modal textarea:hover {
  border-color: var(--md-sys-color-on-surface);
}

.form-group input:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.form-group input::placeholder,
.modal input::placeholder,
.modal textarea::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: .78;
}

.setup-card .error-msg {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--md-sys-color-on-error-container);
  background: var(--md-sys-color-error-container);
  border: 0;
  border-radius: var(--shape-small);
}

.setup-submit,
.settings-submit {
  width: 100%;
  justify-content: center;
}

/* App bar and shell */
.top-app-bar {
  height: 72px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--md-sys-color-surface-container-low) 92%, transparent);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: none;
  z-index: var(--z-app-bar);
}

.app-bar-content {
  display: flex;
  width: min(1280px, 100%);
  height: 100%;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  min-width: 0;
  gap: 12px;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 15px 15px 10px 15px;
  font-size: 18px;
}

.app-bar-title {
  min-width: 0;
}

.app-bar-title p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 10px;
}

.app-bar-title h1 {
  margin: 2px 0 0;
  color: var(--md-sys-color-on-surface);
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.header-actions {
  gap: 6px;
}

.header-status {
  min-height: 36px;
  margin-right: 4px;
  padding: 0 12px;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  border-radius: var(--shape-full);
  font-size: 12px;
  font-weight: 650;
}

.header-dot {
  width: 8px;
  height: 8px;
  background: var(--md-sys-color-primary);
  animation: none;
}

.dashboard-shell {
  min-height: calc(100dvh - 72px);
}

.container {
  width: min(1280px, 100%);
  max-width: none;
  padding: 28px 24px 64px;
}

.dashboard-intro {
  display: flex;
  align-items: end;
  min-height: 120px;
  margin-bottom: 22px;
}

.dashboard-intro h2 {
  margin: 5px 0 7px;
  color: var(--md-sys-color-on-background);
  font-size: 32px;
  font-weight: 760;
  letter-spacing: -.03em;
  line-height: 1.18;
  text-wrap: balance;
}

.dashboard-intro > div > p:last-child {
  max-width: 58ch;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 15px;
  line-height: 1.65;
}

/* Buttons */
.btn {
  min-height: 40px;
  padding: 0 18px;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--shape-full);
  font-size: 14px;
  font-weight: 680;
  letter-spacing: .005em;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .38; }

.btn-primary {
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.btn-primary:hover {
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
  filter: brightness(1.05);
}

.btn-outline {
  color: var(--md-sys-color-primary);
  background: transparent;
  border-color: var(--md-sys-color-outline);
}

.btn-outline:hover {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
}

.btn-ghost {
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-high);
}

.btn-danger {
  color: var(--md-sys-color-on-error-container);
  background: var(--md-sys-color-error-container);
  border-color: var(--md-sys-color-error-container);
}

.btn-danger:hover {
  color: var(--md-sys-color-on-error-container);
  background: var(--md-sys-color-error-container);
  filter: brightness(1.08);
}

.btn-xs {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--shape-full);
  font-size: 12px;
}

.btn-icon {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
}

.add-user-button {
  padding-inline: 18px;
}

/* Surfaces, cards, and panels */
.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  width: 100%;
  min-height: 110px;
  padding: 18px;
  color: var(--md-sys-color-on-surface);
  text-align: left;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-medium);
  box-shadow: none;
  cursor: pointer;
  transition: background var(--motion-standard), border-color var(--motion-fast), transform var(--motion-fast);
}

.stat-card::before { display: none; }
.stat-card:hover { background: var(--md-sys-color-surface-container-high); border-color: var(--md-sys-color-outline); box-shadow: none; transform: translateY(-1px); }
.stat-card:active { transform: scale(.985); }
.stat-card.active { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); border-color: var(--md-sys-color-primary-container); box-shadow: none; }

.stat-symbol {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-bottom: 14px;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  border-radius: 12px 12px 8px 12px;
  font-size: 18px;
  line-height: 1;
}

.stat-card.active .stat-symbol { color: var(--md-sys-color-primary); background: var(--md-sys-color-on-primary-container); }
.stat-free .stat-symbol { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-highest); }
.stat-premium .stat-symbol { color: var(--md-sys-color-secondary); background: var(--md-sys-color-secondary-container); }
.stat-pro .stat-symbol { color: var(--md-sys-color-tertiary); background: var(--md-sys-color-tertiary-container); }

.stat-value {
  color: inherit;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1;
}

.stat-label {
  margin-top: 6px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 600;
}

.stat-card.active .stat-label { color: var(--md-sys-color-on-primary-container); }

.table-wrap {
  overflow: hidden;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-extra-large);
  box-shadow: none;
}

.version-panel {
  margin-bottom: 18px;
}

.panel-toolbar,
.list-panel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  background: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.panel-heading,
.list-panel-heading > div {
  min-width: 0;
}

.panel-heading h2,
.list-panel-heading h2 {
  margin: 3px 0 0;
  color: var(--md-sys-color-on-surface);
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.version-status {
  min-height: 28px;
  margin-left: auto;
  padding: 5px 10px;
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
  border-radius: var(--shape-full);
  font-size: 11px;
  font-weight: 700;
}

.version-status:empty { display: none; }
.version-status.force-update {
  color: var(--md-sys-color-on-error-container);
  background: var(--md-sys-color-error-container);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.version-summary {
  min-height: 84px;
  padding: 18px 22px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  line-height: 1.65;
}

.list-panel-heading {
  align-items: end;
}

.result-count {
  margin-left: auto;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px 18px;
  padding: 18px 22px;
  background: var(--md-sys-color-surface-container-low);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.search-box {
  display: block;
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.search-box svg {
  z-index: 1;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--md-sys-color-on-surface-variant);
}

.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px 0 48px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid transparent;
  border-radius: var(--shape-extra-large);
  font-size: 14px;
  outline: none;
  transition: background var(--motion-fast), box-shadow var(--motion-fast);
}

.search-box input:hover { background: var(--md-sys-color-surface-container-highest); }
.search-box:focus-within input { box-shadow: 0 0 0 2px var(--md-sys-color-primary); }
.search-box input::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: .78; }

.filter-group,
.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.filter-chip,
.sort-btn {
  min-height: 40px;
  padding: 0 14px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid transparent;
  border-radius: var(--shape-full);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}

.filter-chip:hover,
.sort-btn:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-outline-variant);
}

.filter-chip:active,
.sort-btn:active { transform: scale(.98); }

.filter-chip.active,
.sort-btn.active {
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
  border-color: var(--md-sys-color-secondary-container);
}

.sort-section {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-top: 2px;
}

.sort-label {
  flex: 0 0 auto;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 650;
}

.sort-controls {
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.sort-controls::-webkit-scrollbar { display: none; }
.sort-btn { flex: 0 0 auto; min-height: 36px; padding: 0 12px; }

/* User list */
.table-scroll {
  overflow: auto;
  background: var(--md-sys-color-surface-container-low);
}

.user-table {
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
}

.user-table thead th {
  padding: 13px 16px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .04em;
  text-align: left;
  text-transform: none;
}

.selection-header { width: 48px; text-align: center !important; }
.id-header { width: 76px; }
.points-header { width: 88px; }
.actions-header { width: 286px; text-align: right !important; }

.user-table tbody td {
  padding: 13px 16px;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 13px;
  vertical-align: middle;
  transition: background var(--motion-fast);
}

.user-table tbody tr:hover td { background: var(--md-sys-color-surface-container); }
.user-table tbody tr:has(.row-checkbox:checked) td { background: var(--md-sys-color-primary-container); }
.user-table tbody tr:last-child td { border-bottom: 0; }

.selection-cell { text-align: center; }
.user-id,
.created-cell { color: var(--md-sys-color-on-surface-variant) !important; font-size: 12px !important; font-variant-numeric: tabular-nums; }
.points-cell { color: var(--md-sys-color-primary) !important; font-family: var(--font-mono); font-size: 12px !important; font-weight: 750; font-variant-numeric: tabular-nums; }

.row-checkbox,
#selectAllCheckbox {
  width: 18px;
  height: 18px;
  accent-color: var(--md-sys-color-primary);
  cursor: pointer;
}

.user-cell { gap: 12px; }
.user-avatar {
  width: 38px;
  height: 38px;
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
  border-radius: 14px 14px 10px 14px;
  font-size: 14px;
}

.avatar-free { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-highest); }
.avatar-premium { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.avatar-pro { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); }

.user-name { color: var(--md-sys-color-on-surface); font-weight: 700; line-height: 1.35; }
.user-email { max-width: 230px; overflow: hidden; color: var(--md-sys-color-on-surface-variant); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  color: var(--md-sys-color-on-tertiary-container);
  background: var(--md-sys-color-tertiary-container);
  border-radius: var(--shape-full);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: middle;
}

.badge {
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--shape-full);
  font-size: 11px;
  font-weight: 720;
}

.badge::before { width: 6px; height: 6px; }
.badge-free { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-highest); }
.badge-free::before { background: var(--md-sys-color-on-surface-variant); }
.badge-premium { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.badge-premium::before { background: var(--md-sys-color-secondary); }
.badge-pro { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); }
.badge-pro::before { background: var(--md-sys-color-tertiary); }

.expiry-warn { color: var(--md-sys-color-secondary) !important; }
.expiry-over { color: var(--md-sys-color-error) !important; }

.actions-cell {
  justify-content: flex-end;
  gap: 6px;
}

.membership-select {
  min-height: 36px;
  max-width: 84px;
  padding: 0 26px 0 10px;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  border: 0;
  border-radius: var(--shape-full);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}

.membership-select:hover { filter: brightness(1.08); }
.membership-select option { color: CanvasText; background: Canvas; }
.reset-password-button { padding-inline: 12px; }

.user-cards {
  padding: 0 14px 14px;
}

.user-card {
  padding: 18px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-large);
  box-shadow: none;
  animation: card-arrive var(--motion-emphasized) both;
}

@keyframes card-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-card + .user-card { margin-top: 10px; }
.user-card-body { gap: 14px 10px; }
.user-card-body .meta-label { color: var(--md-sys-color-on-surface-variant); font-size: 10px; font-weight: 650; letter-spacing: .04em; text-transform: none; }
.user-card-actions { gap: 8px; padding-top: 16px; border-top-color: var(--md-sys-color-outline-variant); }
.user-card-actions .btn,
.user-card-actions .membership-select { flex: 1; min-width: 0; justify-content: center; }
.user-card-actions .membership-select { max-width: none; }

/* Empty state and pagination */
.empty-state {
  padding: 64px 20px;
}

.empty-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  background: var(--md-sys-color-primary-container);
  border-radius: 26px 26px 14px 26px;
}

.empty-icon span {
  width: 27px;
  height: 22px;
  border: 2px solid var(--md-sys-color-on-primary-container);
  border-radius: 5px;
  position: relative;
}

.empty-icon span::before,
.empty-icon span::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  height: 2px;
  background: var(--md-sys-color-on-primary-container);
}

.empty-icon span::before { top: 5px; }
.empty-icon span::after { bottom: 5px; }
.empty-state h3 { color: var(--md-sys-color-on-surface); font-size: 18px; font-weight: 720; }
.empty-state p { color: var(--md-sys-color-on-surface-variant); font-size: 14px; }

.pagination {
  gap: 8px;
  padding: 18px 20px;
  background: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.pagination-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 13px;
  color: var(--md-sys-color-primary);
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--shape-full);
  font: 680 12px var(--font);
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}

.pagination-button:hover:not(:disabled) { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); border-color: var(--md-sys-color-primary-container); }
.pagination-button:active:not(:disabled) { transform: scale(.97); }
.pagination-button.active { color: var(--md-sys-color-on-primary); background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.pagination-button:disabled { color: var(--md-sys-color-on-surface-variant); background: transparent; border-color: var(--md-sys-color-outline-variant); opacity: .55; }
.pagination-ellipsis { color: var(--md-sys-color-on-surface-variant); }

/* Dialogs and forms */
.modal-overlay,
.confirm-overlay {
  background: rgb(0 0 0 / 40%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}

.modal-overlay { z-index: var(--z-modal); }
.confirm-overlay { z-index: var(--z-confirm); }

.modal,
.confirm-box {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--shadow-lg);
}

.modal {
  max-width: 520px;
  padding: 26px;
  border-radius: var(--shape-extra-large);
  animation: dialog-arrive var(--motion-emphasized) both;
}

@keyframes dialog-arrive {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-heading { margin-bottom: 20px; }
.modal-heading h2 { margin: 4px 0 0; color: var(--md-sys-color-on-surface); font-size: 22px; font-weight: 740; letter-spacing: -.025em; }
.modal-description { margin: -8px 0 18px; color: var(--md-sys-color-on-surface-variant); font-size: 13px; line-height: 1.6; }
.modal h2 { color: var(--md-sys-color-on-surface); }

.modal textarea {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  line-height: 1.6;
}

.modal-btn-row {
  gap: 10px;
  margin-top: 24px;
}

.role-toggle,
.membership-toggle {
  gap: 8px;
}

.role-toggle button,
.membership-toggle button {
  min-height: 44px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid transparent;
  border-radius: var(--shape-small);
  font-weight: 680;
}

.role-toggle button:hover,
.membership-toggle button:hover { border-color: var(--md-sys-color-outline); }
.role-toggle button.selected { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); border-color: var(--md-sys-color-tertiary-container); }
.membership-toggle button.selected { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); border-color: var(--md-sys-color-primary-container); }
.membership-toggle button.selected[data-value="premium"] { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); border-color: var(--md-sys-color-secondary-container); }
.membership-toggle button.selected[data-value="pro"] { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); border-color: var(--md-sys-color-tertiary-container); }

.expiry-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.check-row label { display: flex; align-items: center; gap: 10px; min-height: 28px; cursor: pointer; }
.check-row input { width: 18px; min-height: 18px; padding: 0; accent-color: var(--md-sys-color-primary); }
.check-row span { color: var(--md-sys-color-on-surface); font-size: 13px; }

.confirm-box {
  max-width: 400px;
  padding: 28px;
  border-radius: var(--shape-extra-large);
  animation: dialog-arrive var(--motion-emphasized) both;
}

.confirm-box .confirm-icon {
  color: var(--md-sys-color-on-error-container);
  background: var(--md-sys-color-error-container);
  border-radius: 18px 18px 12px 18px;
}

.confirm-box h3 { color: var(--md-sys-color-on-surface); font-size: 20px; font-weight: 720; }
.confirm-box p { color: var(--md-sys-color-on-surface-variant); font-size: 14px; }

.password-display {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  border: 0;
  border-radius: var(--shape-medium);
}

.password-display code {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
  border-radius: var(--shape-small);
}

/* Settings */
.settings-modal { max-width: 540px; }
.settings-section {
  margin-bottom: 14px;
  padding: 18px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-medium);
}

.settings-section-heading { margin-bottom: 16px; }
.settings-section-heading h3 { margin: 3px 0 0; color: var(--md-sys-color-on-surface); font-size: 16px; font-weight: 700; letter-spacing: -.01em; text-transform: none; }

.settings-theme-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.settings-theme-swatch,
.theme-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 10px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid transparent;
  border-radius: var(--shape-full);
  font: 650 12px var(--font);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}

.settings-theme-swatch:hover,
.theme-swatch:hover { color: var(--md-sys-color-on-surface); border-color: var(--md-sys-color-outline); }
.settings-theme-swatch.selected,
.theme-swatch.active { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); border-color: var(--md-sys-color-primary-container); }

.settings-theme-dot,
.theme-swatch-dot {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
}

.settings-theme-dot.twilight,
.theme-swatch-dot.twilight { background: #a8f6c6; }
.settings-theme-dot.ocean,
.theme-swatch-dot.ocean { background: #8fd1ff; }
.settings-theme-dot.amethyst,
.theme-swatch-dot.amethyst { background: #e6baff; }
.settings-theme-dot.ember,
.theme-swatch-dot.ember { background: #ffb68b; }
.settings-theme-dot.light,
.theme-swatch-dot.light { background: #0e6c45; }

.settings-row {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  color: var(--md-sys-color-on-surface);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 0;
  cursor: pointer;
}

.settings-row:last-child { border-bottom: 0; }
.settings-row:hover { opacity: 1; }
.settings-row > span { display: grid; gap: 3px; min-width: 0; }
.settings-row strong { color: var(--md-sys-color-on-surface); font-size: 13px; font-weight: 680; }
.settings-row small { color: var(--md-sys-color-on-surface-variant); font-size: 11px; line-height: 1.4; }
.settings-row b { color: var(--md-sys-color-primary); font-size: 12px; font-weight: 720; }
.settings-row.danger b,
.settings-row.danger strong { color: var(--md-sys-color-error); }
.settings-row-toggle { cursor: default; }

.toggle { width: 52px; height: 32px; }
.toggle-slider { background: var(--md-sys-color-surface-container-highest); border: 2px solid var(--md-sys-color-outline); border-radius: var(--shape-full); }
.toggle-slider::before { width: 16px; height: 16px; left: 6px; bottom: 6px; background: var(--md-sys-color-outline); }
.toggle input:checked + .toggle-slider { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.toggle input:checked + .toggle-slider::before { width: 24px; height: 24px; background: var(--md-sys-color-on-primary); transform: translateX(14px); }

/* Feedback */
.loading-bar {
  height: 3px;
  background: var(--md-sys-color-primary);
  z-index: var(--z-confirm);
}

.skeleton-bar {
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--shape-extra-small);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: .42; }
  50% { opacity: .72; }
}

.toasts { z-index: var(--z-toast); }
.toast {
  min-width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-medium);
  box-shadow: var(--shadow-lg);
}

.toast-success { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); border-color: var(--md-sys-color-primary-container); }
.toast-error { color: var(--md-sys-color-on-error-container); background: var(--md-sys-color-error-container); border-color: var(--md-sys-color-error-container); }

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px;
  padding: 12px 14px;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  border: 0;
  border-radius: var(--shape-large);
  box-shadow: none;
  position: sticky;
  bottom: 14px;
  z-index: var(--z-fab);
}

.bulk-summary { font-size: 13px; font-weight: 650; }
.bulk-summary strong { font-family: var(--font-mono); font-size: 14px; }
.bulk-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bulk-bar .btn-outline { color: var(--md-sys-color-on-primary-container); border-color: var(--md-sys-color-on-primary-container); }
.bulk-bar .btn-outline:hover { color: var(--md-sys-color-on-primary); background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.bulk-bar .btn-ghost { color: var(--md-sys-color-on-primary-container); }
.bulk-bar .btn-ghost:hover { background: rgb(255 255 255 / 12%); }
.bulk-bar .btn-danger { color: var(--md-sys-color-on-error-container); }

.fab {
  width: auto;
  min-width: 112px;
  height: 56px;
  gap: 7px;
  padding: 0 20px;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  border: 0;
  border-radius: 18px 18px 8px 18px;
  box-shadow: 0 6px 14px rgb(0 0 0 / 20%);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 720;
}

.fab span:first-child { font-size: 22px; font-weight: 400; line-height: 1; }
.fab:hover { background: var(--md-sys-color-primary-container); box-shadow: 0 8px 18px rgb(0 0 0 / 24%); }

/* Theme picker */
.theme-picker-popup {
  top: calc(100% + 10px);
  min-width: 224px;
  padding: 12px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-large);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-menu);
}

.theme-swatches { gap: 8px; }

/* Responsive */
@media (max-width: 900px) {
  .toolbar { grid-template-columns: 1fr; }
  .filter-group { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .top-app-bar { height: 64px; padding-inline: 14px; }
  .dashboard-shell { min-height: calc(100dvh - 64px); }
  .container { padding: 20px 14px 88px; }
  .dashboard-intro { min-height: 0; margin-bottom: 18px; }
  .dashboard-intro h2 { font-size: 27px; }
  .dashboard-intro > div > p:last-child { font-size: 14px; }
  .stats-grid { gap: 10px; margin-bottom: 18px; }
  .stat-card { min-height: 102px; padding: 15px; }
  .stat-value { font-size: 25px; }
  .panel-toolbar,
  .list-panel-heading,
  .toolbar { padding: 16px; }
  .panel-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .version-status { margin-left: 0; }
  .panel-actions { width: 100%; justify-content: flex-start; }
  .version-summary { padding: 16px; }
  .table-wrap { border-radius: 22px; }
  .filter-group { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .filter-group::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; }
  .sort-section { align-items: flex-start; flex-direction: column; gap: 8px; }
  .sort-controls { width: 100%; }
  .header-status { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  .header-status span { display: none; }
  .header-actions .btn { display: none; }
  .header-actions .theme-picker-btn { display: block; }
  .header-actions .theme-picker-btn .btn { display: inline-flex; }
  .header-actions .btn.add-user-button { display: inline-flex; }
  .add-user-button .label { display: none; }
  .add-user-button { width: 40px; min-width: 40px; padding: 0; border-radius: 50%; justify-content: center; }
  .header-actions .btn.add-user-button svg { margin: 0; }
  .app-bar-title p { display: none; }
  .app-bar-title h1 { font-size: 16px; }
}

@media (max-width: 640px) {
  .setup-screen { padding: 18px; }
  .setup-card { padding: 28px 22px; border-radius: 24px; }
  .user-table { display: none; }
  .user-cards { display: block; }
  .table-scroll { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-symbol { width: 28px; height: 28px; margin-bottom: 10px; font-size: 16px; }
  .stat-label { font-size: 11px; }
  .user-card-actions { flex-wrap: wrap; }
  .user-card-actions .btn,
  .user-card-actions .membership-select { min-height: 40px; }
  .pagination { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .pagination::-webkit-scrollbar { display: none; }
  .pagination-button { flex: 0 0 auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: 92dvh;
    padding: 24px 20px calc(24px + var(--safe-bottom));
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
  }
  .modal-btn-row { flex-direction: column-reverse; }
  .modal-btn-row .btn { width: 100%; justify-content: center; min-height: 44px; }
  .settings-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-bar {
    position: fixed;
    right: 12px;
    bottom: calc(12px + var(--safe-bottom));
    left: 12px;
    margin: 0;
    align-items: stretch;
    flex-direction: column;
    border-radius: 20px;
    box-shadow: 0 10px 22px rgb(0 0 0 / 24%);
  }
  .bulk-actions { justify-content: flex-start; }
  .bulk-actions .btn { flex: 1 1 auto; }
  .fab { display: flex; align-items: center; justify-content: center; }
  .toasts { right: 12px; bottom: calc(82px + var(--safe-bottom)); left: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 380px) {
  .header-logo { width: 36px; height: 36px; font-size: 16px; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 96px; padding: 13px; }
  .stat-value { font-size: 23px; }
  .list-panel-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .result-count { margin-left: 0; }
  .user-card-actions .btn,
  .user-card-actions .membership-select { flex-basis: calc(50% - 4px); }
}

@media (max-width: 640px) {
  .header-actions .btn.add-user-button { display: none; }
}

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