:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #f7f7f7;
  --card: #fff;
  --text: #111;
  --muted: #666;
  --accent: #e1262f;
  --accent-2: #f26a21;
  --border: rgba(0, 0, 0, 0.12);
  --chrome-bg: rgba(255, 255, 255, 0.74);
  --chrome-text: #222;
  --button: linear-gradient(135deg, #e1262f 0%, #f26a21 100%);
  --code-bg: #f2f2f2;
  --ok-bg: #ecfdf5;
  --ok-text: #047857;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0d0d0d;
  --card: #111;
  --text: #f7f7f7;
  --muted: #a8a8a8;
  --border: rgba(255, 255, 255, 0.14);
  --chrome-bg: rgba(5, 5, 5, 0.66);
  --chrome-text: #f2f2f2;
  --code-bg: #050505;
  --ok-bg: rgba(4, 120, 87, 0.18);
  --ok-text: #34d399;
  --error-bg: rgba(185, 28, 28, 0.18);
  --error-text: #f87171;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.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;
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(225, 38, 47, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(225, 38, 47, 0.034) 1px, transparent 1px),
    radial-gradient(circle at 16% 18%, rgba(225, 38, 47, 0.05) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 24%, rgba(242, 106, 33, 0.045) 0 1px, transparent 2px),
    var(--bg);
  background-size: 44px 44px, 44px 44px, 220px 180px, 260px 220px, auto;
  color: var(--text);
  line-height: 1.5;
}
body.login-view {
  overflow: hidden;
}
body.app-booting main,
body.app-booting footer {
  visibility: hidden;
}
body:not(.login-view) {
  padding-bottom: 44px;
}
.container {
  width: min(1600px, calc(100% - 72px));
  margin: 0 auto;
  padding-inline: 0;
}
body.login-view .container {
  width: 100%;
  padding-inline: 0;
}
.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  width: min(1600px, calc(100% - 72px));
  margin: 14px auto 0;
  border: 0;
  border-radius: 999px;
  background: var(--chrome-bg);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(225, 38, 47, 0.08);
}
.site-header .container {
  width: 100%;
  padding-inline: 26px;
}
.header-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
}
.brand-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 136px; height: auto; display: block; }
.brand-logo-dark, :root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.header-title strong { display: block; color: var(--chrome-text); font-size: 16px; line-height: 1.2; }
.header-title span { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--button);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transform: translateY(0);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    opacity 120ms ease;
  user-select: none;
}
button:hover:not(:disabled) {
  filter: brightness(1.04) saturate(1.05);
  box-shadow: 0 10px 24px rgba(225, 38, 47, 0.18);
}
button:active:not(:disabled),
button.is-pressed:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  filter: brightness(0.94);
}
button:focus-visible {
  outline: 3px solid rgba(242, 106, 33, 0.35);
  outline-offset: 2px;
}
button:disabled,
button.is-busy {
  cursor: wait;
  opacity: 0.72;
}
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.ghost:hover:not(:disabled) {
  background: var(--surface);
  border-color: rgba(242, 106, 33, 0.45);
}
.theme-toggle,
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: rgba(247, 247, 247, 0.82);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  backdrop-filter: blur(14px) saturate(1.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.16);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}
.header-icon-link {
  text-decoration: none;
}
.header-icon-link svg {
  width: 18px;
  height: 18px;
}
.theme-toggle:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(242, 106, 33, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}
.theme-toggle:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.14);
}
.theme-toggle svg,
.action-button svg,
.login-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex: 0 0 auto;
}
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .icon-button {
  background: rgba(17, 17, 17, 0.82);
}
:root[data-theme="dark"] .theme-toggle:hover:not(:disabled),
:root[data-theme="dark"] .icon-button:hover:not(:disabled) {
  background: rgba(17, 17, 17, 0.94);
}
.theme-toggle .sun-icon,
:root[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}
.action-button,
.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.filter-toggle {
  display: none;
}
main { padding: 18px 0 40px; }
body:not(.login-view) main {
  padding-top: 34px;
}
body.login-view main {
  padding: 0;
}
body.login-view footer {
  display: none;
}
h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1; }
p { margin: 0; color: var(--muted); }
.login-main {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}
.login-shell-grid {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.72fr);
  gap: 0;
  align-items: stretch;
}
.login-art,
.login-panel-wrap {
  min-height: 100%;
  border-radius: 0;
}
.login-art {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 26px;
  padding: clamp(28px, 4vw, 56px);
  background:
    linear-gradient(rgba(225, 38, 47, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(225, 38, 47, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 12% 22%, rgba(225, 38, 47, 0.09) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 36%, rgba(242, 106, 33, 0.08) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(225, 38, 47, 0.09), rgba(242, 106, 33, 0.06)),
    var(--surface);
  background-size: 38px 38px, 38px 38px, 160px 120px, 180px 140px, auto, auto;
}
:root[data-theme="dark"] .site-header,
:root[data-theme="dark"] footer {
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(225, 38, 47, 0.08);
}
.login-art::before {
  content: "";
  position: absolute;
  inset: auto -20% -35% 34%;
  height: 58%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(242, 106, 33, 0.18), transparent 64%);
  pointer-events: none;
}
.login-logo {
  width: 210px;
  height: auto;
  display: block;
}
.login-logo-dark,
:root[data-theme="dark"] .login-logo-light {
  display: none;
}
:root[data-theme="dark"] .login-logo-dark {
  display: block;
}
.login-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-art h1 {
  max-width: 620px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
}
.login-art h1 span {
  display: block;
}
.login-art p {
  position: relative;
  z-index: 1;
  max-width: 620px;
  font-size: 17px;
}
.database-scene {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  height: min(320px, 34vh);
  min-height: 270px;
  perspective: 1000px;
}
.database-scene::before {
  content: "";
  position: absolute;
  inset: 2% 0 8%;
  border-radius: 28px;
  background:
    linear-gradient(rgba(225, 38, 47, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(225, 38, 47, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 52% 46%, rgba(242, 106, 33, 0.18), transparent 46%);
  background-size: 28px 28px, 28px 28px, auto;
  mask-image: radial-gradient(ellipse at center, #000 50%, transparent 76%);
}
.database-scene::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 14%;
  bottom: 6%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(225, 38, 47, 0.18), transparent 66%);
  filter: blur(10px);
}
.mcp-node {
  position: absolute;
  right: 9%;
  top: 10%;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.86), transparent 32%),
    linear-gradient(145deg, rgba(225, 38, 47, 0.96), rgba(242, 106, 33, 0.95));
  color: #fff;
  box-shadow:
    0 28px 60px rgba(225, 38, 47, 0.22),
    inset -12px -14px 26px rgba(102, 21, 5, 0.18);
  transform: rotate(-8deg) translateZ(40px);
}
.mcp-node::before,
.mcp-node::after,
.mcp-node span {
  content: "";
  position: absolute;
  border-radius: 999px;
}
.mcp-node::before {
  width: 14px;
  height: 14px;
  background: #fff;
  box-shadow:
    23px -10px 0 rgba(255, 255, 255, 0.86),
    25px 18px 0 rgba(255, 255, 255, 0.78),
    -15px 15px 0 rgba(255, 255, 255, 0.72);
}
.mcp-node::after {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.52);
}
.mcp-node span {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.32);
}
.query-beam {
  position: absolute;
  left: 39%;
  top: 34%;
  width: 245px;
  height: 96px;
  border-top: 2px solid rgba(225, 38, 47, 0.26);
  border-right: 2px solid rgba(242, 106, 33, 0.22);
  border-radius: 0 34px 0 0;
  transform: skewY(-8deg);
}
.query-beam::before,
.query-beam::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(225, 38, 47, 0.08);
}
.query-beam::before {
  left: -2px;
  top: -5px;
}
.query-beam::after {
  right: -5px;
  bottom: -1px;
}
.db-stack {
  position: absolute;
  left: 33%;
  top: 24%;
  width: 218px;
  height: 166px;
  transform: rotateX(62deg) rotateZ(-19deg) translateZ(4px);
  transform-style: preserve-3d;
}

.db-tower {
  position: absolute;
  left: 8%;
  top: 17%;
  width: 132px;
  display: grid;
  gap: 8px;
  transform: rotate(-4deg);
  filter: drop-shadow(0 24px 38px rgba(15, 23, 42, 0.12));
}

.db-tower span {
  height: 36px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
    linear-gradient(135deg, rgba(17, 17, 17, 0.9), rgba(17, 17, 17, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.db-layer {
  position: absolute;
  left: 0;
  width: 218px;
  height: 80px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.08) 34%, transparent 44%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid var(--border);
  box-shadow: 0 26px 54px rgba(225, 38, 47, 0.2);
}
.db-layer::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 18px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.34);
}
.db-layer-top {
  top: 0;
  z-index: 3;
}
.db-layer-mid {
  top: 38px;
  z-index: 2;
  filter: saturate(0.96) brightness(0.96);
}
.db-layer-bottom {
  top: 76px;
  z-index: 1;
  filter: saturate(0.9) brightness(0.9);
}
.data-cube {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.36));
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 28px 62px rgba(15, 23, 42, 0.13);
}
:root[data-theme="dark"] .data-cube {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(145deg, rgba(31, 31, 31, 0.78), rgba(17, 17, 17, 0.42));
}
.data-cube::before,
.data-cube::after,
.data-cube span {
  content: "";
  position: absolute;
  border-radius: 999px;
}
.data-cube::before {
  width: 46%;
  height: 46%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px rgba(225, 38, 47, 0.22);
}
.data-cube::after {
  width: 72%;
  height: 72%;
  border: 1px solid rgba(225, 38, 47, 0.2);
}
.data-cube span {
  width: 92%;
  height: 92%;
  border: 1px solid rgba(242, 106, 33, 0.16);
}
.data-cube-one {
  left: 7%;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: rotate(-8deg);
}
.data-cube-two {
  right: 10%;
  bottom: 5%;
  width: 150px;
  height: 150px;
  transform: rotate(7deg);
}
.login-art-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.login-art-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  padding: 7px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
:root[data-theme="dark"] .login-art-list span {
  border-color: rgba(242, 106, 33, 0.24);
  background: rgba(17, 17, 17, 0.58);
  color: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.14);
}
.login-panel-wrap {
  position: relative;
  display: grid;
  align-content: center;
  padding: clamp(28px, 4vw, 56px);
  background:
    radial-gradient(circle at 70% 18%, rgba(225, 38, 47, 0.04), transparent 32%),
    rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  border-left: 1px solid rgba(225, 38, 47, 0.08);
}
:root[data-theme="dark"] .login-panel-wrap {
  background:
    radial-gradient(circle at 70% 18%, rgba(225, 38, 47, 0.09), transparent 34%),
    rgba(5, 5, 5, 0.78);
}
.login-screen-actions {
  position: absolute;
  top: 32px;
  left: 32px;
  right: 32px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.login-screen-actions > * {
  pointer-events: auto;
}
.login-panel-brand {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
}
.login-panel-brand .login-logo {
  width: min(250px, 72%);
  filter: drop-shadow(0 12px 24px rgba(225, 38, 47, 0.08));
}
.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.admin-sidebar,
.section-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(247, 247, 247, 0.74);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.04);
}
:root[data-theme="dark"] .admin-sidebar,
:root[data-theme="dark"] .section-card {
  background: rgba(17, 17, 17, 0.74);
}
.admin-sidebar {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 8px;
  padding: 10px;
}
.admin-content {
  min-width: 0;
}
.admin-nav-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.admin-nav-item:hover:not(:disabled) {
  background: var(--card);
  border-color: rgba(242, 106, 33, 0.28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  filter: none;
}
.admin-nav-item.is-active {
  border-color: rgba(225, 38, 47, 0.24);
  background: linear-gradient(135deg, rgba(225, 38, 47, 0.13), rgba(242, 106, 33, 0.1));
  color: var(--text);
}
.admin-nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 9px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.86), transparent 30%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  position: relative;
}
.admin-nav-icon::before,
.admin-nav-icon::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
}
.admin-nav-dashboard::before {
  left: 7px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  box-shadow: 9px 0 0 rgba(255, 255, 255, 0.9), 0 9px 0 rgba(255, 255, 255, 0.9), 9px 9px 0 rgba(255, 255, 255, 0.9);
}
.admin-nav-users::before {
  left: 10px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.admin-nav-users::after {
  left: 7px;
  top: 17px;
  width: 14px;
  height: 6px;
  border-radius: 999px 999px 4px 4px;
}
.section-card {
  padding: 16px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.section-heading h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.section-heading strong {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch > span {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}
.switch > span::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--muted);
  transition:
    transform 140ms ease,
    background-color 140ms ease;
}
.switch input:checked + span {
  border-color: rgba(225, 38, 47, 0.28);
  background: linear-gradient(135deg, rgba(225, 38, 47, 0.9), rgba(242, 106, 33, 0.9));
  box-shadow: 0 8px 20px rgba(225, 38, 47, 0.18);
}
.switch input:checked + span::before {
  transform: translateX(20px);
  background: #fff;
}
.switch input:focus-visible + span {
  outline: 3px solid rgba(242, 106, 33, 0.3);
  outline-offset: 2px;
}
.switch input:disabled {
  cursor: wait;
}
.table-switch {
  margin: 0;
}
.table-switch input:disabled + span {
  opacity: 0.62;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.add-user-form {
  display: grid;
  gap: 12px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.danger-button {
  background: linear-gradient(135deg, #b91c1c 0%, #f26a21 100%);
}
.toolbar {
  position: relative;
  z-index: 30;
  margin: 16px 0 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(247, 247, 247, 0.74);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.95fr 0.95fr auto;
  gap: 8px;
  align-items: end;
}
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.filter-actions button {
  min-width: 96px;
}
:root[data-theme="dark"] .toolbar {
  background: rgba(17, 17, 17, 0.74);
}
.summary-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.summary-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(247, 247, 247, 0.74);
  padding: 14px 16px;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.04);
}
:root[data-theme="dark"] .summary-card {
  background: rgba(17, 17, 17, 0.74);
}
.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.summary-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}
.summary-card small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--text);
}
select {
  cursor: pointer;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  scrollbar-color: var(--border) var(--surface);
}
:root[data-theme="dark"] .panel {
  background: rgba(17, 17, 17, 0.78);
}
.panel::-webkit-scrollbar {
  height: 12px;
}
.panel::-webkit-scrollbar-track {
  background: var(--surface);
}
.panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 3px solid var(--surface);
  border-radius: 999px;
}
table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed; }
.users-panel table {
  min-width: 640px;
}
th, td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  line-height: 1.25;
}
th { font-size: 12px; color: var(--muted); background: var(--surface); }
.sort-button {
  width: 100%;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.sort-button:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
  color: var(--text);
  filter: none;
}
.sort-button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  opacity: 0.45;
  flex: 0 0 auto;
}
.sort-button.is-active {
  color: var(--text);
}
.sort-button.is-active svg {
  opacity: 1;
}
.sort-button[data-direction="desc"] svg {
  transform: rotate(180deg);
}
td { font-size: 13px; overflow-wrap: anywhere; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
.success { color: var(--ok-text); background: var(--ok-bg); }
.error { color: var(--error-text); background: var(--error-bg); }
.detail-button {
  min-height: 0;
  padding: 5px 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: 12px;
}
.empty { padding: 28px; color: var(--muted); text-align: center; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
}
.modal {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}
.confirm-modal {
  width: min(460px, 100%);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.modal-header strong { font-size: 15px; }
.modal-header .icon-button {
  width: 30px;
  height: 30px;
}
.modal-body {
  padding: 14px;
  overflow: auto;
  max-height: calc(min(720px, 100vh - 48px) - 47px);
}
.modal-body pre {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.table-controls {
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.table-controls-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-size-control {
  width: 72px;
  min-width: 72px;
}
.page-size-control select {
  padding: 6px 8px;
  min-height: 32px;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-search-control {
  width: min(280px, 24vw);
  min-width: 200px;
  margin-left: auto;
}
.table-search-control input {
  min-height: 32px;
  padding: 6px 10px;
}
.user-combobox {
  position: relative;
}
.user-filter-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}
.user-filter-options button {
  width: 100%;
  min-height: 0;
  display: block;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.user-filter-options button:hover,
.user-filter-options button.is-selected {
  background: var(--surface);
  box-shadow: none;
  filter: none;
}
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination-actions button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.login {
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(247, 247, 247, 0.76);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.08);
}
:root[data-theme="dark"] .login {
  background: rgba(17, 17, 17, 0.76);
}
.login strong { display: block; font-size: 18px; line-height: 1.2; }
.login .hint { margin-top: 6px; font-size: 14px; }
.login-grid { display: grid; gap: 12px; margin-top: 16px; }
.login-button {
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}
.login-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(225, 38, 47, 0.24);
}
.login-button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}
.message {
  margin-top: 12px;
  min-height: 20px;
  color: var(--error-text);
  font-size: 13px;
}
.toast-region {
  position: fixed;
  right: 18px;
  bottom: 58px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 36px));
}
.toast {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.64)),
    var(--card);
  color: var(--text);
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(18px) saturate(1.24);
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
  font-size: 13px;
  font-weight: 700;
}
.toast.error {
  border-color: rgba(185, 28, 28, 0.24);
  color: var(--error-text);
}
.toast.success {
  border-color: rgba(4, 120, 87, 0.24);
  color: var(--ok-text);
}
:root[data-theme="dark"] .toast {
  background:
    linear-gradient(135deg, rgba(22, 22, 22, 0.86), rgba(5, 5, 5, 0.62)),
    var(--card);
}
.skeleton-row td {
  padding: 12px;
}
.skeleton-line {
  display: block;
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(225, 38, 47, 0.08), rgba(242, 106, 33, 0.18), rgba(225, 38, 47, 0.08));
  background-size: 200% 100%;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.login-footnote {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 8px 0;
  border-top: 1px solid rgba(225, 38, 47, 0.08);
  background: var(--chrome-bg);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  box-shadow: 0 -18px 46px rgba(15, 23, 42, 0.08);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
}
@media (max-width: 1100px) {
  .container {
    width: 100%;
    padding-inline: 16px;
  }
  body.login-view {
    overflow: auto;
  }
  body.login-view .container {
    width: 100%;
    padding-inline: 0;
  }
  .login-main {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }
  .login-shell-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
  }
  .login-art {
    display: none;
  }
  .login-panel-wrap {
    min-height: auto;
    border-left: 0;
    border-radius: 18px;
    margin: 18px;
    padding: 28px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.08);
  }
  .login-screen-actions {
    top: 12px;
    left: 18px;
    right: 18px;
  }
  .login-panel-brand {
    margin-bottom: 24px;
  }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  table { min-width: 1080px; }
}
@media (max-width: 640px) {
  .container {
    width: 100%;
    padding-inline: 10px;
  }
  .site-header {
    top: 8px;
    width: calc(100% - 20px);
    margin-top: 8px;
    border-radius: 24px;
  }
  .site-header .container {
    padding-inline: 12px;
  }
  .summary-grid,
  .toolbar { grid-template-columns: 1fr; }
  .admin-sidebar {
    grid-template-columns: 1fr 1fr;
    padding: 8px;
  }
  .section-heading {
    display: flex;
    align-items: center;
  }
  .section-heading strong {
    display: block;
    margin-top: 8px;
  }
  .section-actions {
    justify-content: space-between;
    margin-top: 10px;
  }
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    padding: 7px 12px 8px;
  }
  .brand-block {
    display: contents;
  }
  .brand-logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    width: 116px;
  }
  .header-title {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    padding-top: 5px;
    border-top: 1px solid rgba(225, 38, 47, 0.12);
    text-align: center;
  }
  .header-title strong,
  .header-title span {
    display: inline;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
  }
  .header-title strong::after {
    content: " ";
  }
  .actions {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-content: flex-end;
    align-self: center;
    gap: 8px;
  }
  .filter-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
  }
  .filter-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 160ms ease;
  }
  .filter-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
  .toolbar.is-collapsed {
    display: none;
  }
  .filter-actions {
    width: 100%;
  }
  .filter-actions button {
    flex: 1 1 0;
    min-width: 0;
  }
  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .brand-logo { width: 128px; }
  #topUser {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .login-shell-grid {
    gap: 0;
  }
  .login-panel-wrap { padding: 72px 18px 18px; }
  .login-screen-actions {
    top: 18px;
    left: 18px;
    right: 18px;
  }
  .login-logo { width: 170px; }
  .login {
    padding: 18px;
  }
  table { min-width: 1180px; }
  .table-controls {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .table-controls-left {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  #pageInfo {
    align-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pagination {
    flex: 0 0 auto;
  }
  .table-search-control {
    order: 3;
    width: 100%;
    min-width: 0;
    flex: 1 0 100%;
    margin-left: 0;
  }
  .pagination-actions {
    justify-content: flex-end;
    gap: 6px;
  }
  .pagination-actions button {
    padding: 6px 8px;
  }
}
