:root {
  --bg: #00262c;
  --text: #f4fbfc;
  --muted: rgba(232, 247, 250, 0.68);
  --faint: rgba(0, 150, 255, 0.12);
  --line: rgba(0, 194, 212, 0.22);
  --amber: #0096ff;
  --gold: #5ec8ff;
  --blue: #00c2d4;
  --card: rgba(0, 48, 56, 0.78);
  --surface: rgba(0, 40, 48, 0.76);
  --ok: #2ec9a0;
  --danger: #ff6b7a;
  --ink: #003c46;
  --radius: 22px;
}

[data-theme="light"] {
  --bg: #f3fafb;
  --text: #003c46;
  --muted: rgba(0, 60, 70, 0.68);
  --faint: rgba(0, 60, 70, 0.06);
  --line: rgba(0, 60, 70, 0.14);
  --card: rgba(255, 255, 255, 0.9);
  --surface: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
button,
a,
input,
select,
label,
.admin-nav-item,
.admin-toggle,
.icon-btn,
.admin-provider {
  touch-action: manipulation;
}

button,
.btn,
.icon-btn,
.admin-nav-item,
.admin-toggle,
.admin-provider {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

button:active,
.btn:active,
.icon-btn:active,
.admin-nav-item:active,
.admin-topbar-controls .admin-provider:active,
.admin-topbar-controls .admin-toggle:active {
  transform: scale(0.96);
  opacity: 0.9;
  transition: transform 0.05s ease, opacity 0.05s ease;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 194, 212, 0.28) transparent;
}

body {
  font-family: Outfit, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 194, 212, 0.28);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 150, 255, 0.45);
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.glow {
  position: fixed;
  z-index: 0;
  width: 55vw;
  height: 55vw;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.28;
}

.glow-a {
  top: -10%;
  left: 20%;
  background: radial-gradient(circle, #0096ff 0%, transparent 70%);
}

.glow-b {
  bottom: -20%;
  right: -10%;
  background: radial-gradient(circle, #00c2d4 0%, transparent 70%);
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 72%);
}

.nav,
main,
.gate {
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 56px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  overflow: visible;
}

.nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 120px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 38, 44, 0.9) 0%,
    rgba(0, 38, 44, 0.55) 38%,
    rgba(0, 38, 44, 0.18) 68%,
    rgba(0, 38, 44, 0) 100%
  );
}

[data-theme="light"] .nav::before {
  background: linear-gradient(
    180deg,
    rgba(243, 250, 251, 0.94) 0%,
    rgba(243, 250, 251, 0.58) 38%,
    rgba(243, 250, 251, 0.18) 68%,
    rgba(243, 250, 251, 0) 100%
  );
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
}

.badge {
  background: linear-gradient(90deg, var(--amber), var(--gold));
  color: #003c46;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.nav-actions .btn {
  height: 40px;
  padding: 0 18px;
}

.btn-light {
  background: var(--amber);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.full {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--faint);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
}

.icon-btn svg {
  display: block;
  flex-shrink: 0;
  margin: auto;
}

.profile-menu {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.profile-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  min-width: 260px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 48, 56, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 4px;
  z-index: 100;
}

[data-theme="light"] .profile-dropdown {
  background: rgba(255, 255, 255, 0.98);
}

.profile-sub {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .profile-sub {
  background: rgba(0, 0, 0, 0.03);
}

.profile-sub-title {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-sub-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.profile-sub-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.profile-sub-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  line-height: 1.35;
}

.profile-sub-value.is-expired {
  color: #ffb4b4;
}

[data-theme="light"] .profile-sub-value.is-expired {
  color: #c62828;
}

.profile-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.profile-item:hover {
  background: rgba(0, 150, 255, 0.12);
}

.profile-menu.is-open .profile-toggle {
  border-color: rgba(0, 150, 255, 0.55);
  background: rgba(0, 150, 255, 0.12);
}

.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 24px;
  text-align: center;
}

body[data-page="home"] .hero {
  box-sizing: border-box;
  min-height: calc(100dvh - 76px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 36px;
}

body[data-page="home"] .hero .scroll-hint {
  margin-top: 28px;
}

.orbiter {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 28px;
}

.ring {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(0, 150, 255, 0.45);
  border-radius: 50%;
  transform: rotateX(68deg);
}

.ring-2 {
  inset: -6px;
  border-color: rgba(0, 194, 212, 0.28);
  animation: spin 10s linear infinite;
}

.ring-1 {
  animation: spin 7s linear infinite reverse;
}

.paper-card {
  position: absolute;
  inset: 34px 48px;
  background: linear-gradient(180deg, #004451, #00262c);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.line {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: rgba(0, 194, 212, 0.55);
}

.line.amber {
  background: var(--amber);
}

.line.blue {
  background: var(--blue);
}

.w80 { width: 80%; }
.w60 { width: 60%; }
.w90 { width: 90%; }
.w45 { width: 45%; }
.w70 { width: 70%; }
.w55 { width: 55%; }

.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  font-size: 13px;
  color: var(--muted);
}

.on-demand {
  background: linear-gradient(90deg, var(--amber), var(--gold));
  color: #003c46;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}

h1 {
  font-size: clamp(44px, 8vw, 82px);
  line-height: 1.12;
  margin: 22px 0 16px;
  letter-spacing: -0.04em;
}

h1 .white {
  display: block;
}

.gradient {
  display: block;
  padding-bottom: 0.12em;
  overflow: visible;
  background: linear-gradient(90deg, #5ec8ff, #00c2d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 28px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 14px;
}

.checks li::before {
  content: "✓";
  color: var(--ok);
  margin-right: 8px;
}

.scroll-hint {
  display: inline-block;
  margin-top: 36px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview {
  padding: 40px 24px 10px;
}

.report-stage {
  max-width: 860px;
  margin: 0 auto;
  perspective: 1200px;
}

.report-window {
  background: #ffffff;
  color: #003c46;
  border-radius: 18px;
  transform: rotateX(14deg) rotateZ(-1deg);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.report-bar {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
}

.report-body {
  padding: 28px 32px 36px;
}

.report-body h3 {
  margin: 0 0 10px;
}

.serif,
.report-body p {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 20px;
  line-height: 1.5;
  margin: 0;
}

.score-chip {
  margin-top: 22px;
  display: inline-block;
  background: #003c46;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
}

.panel,
.how {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 24px;
}

.eyebrow {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
}

h2 {
  font-size: 40px;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
}

.section-copy {
  color: var(--muted);
  max-width: 560px;
}

.scan-card,
.progress-card {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
}

.scan-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.progress-inline {
  display: grid;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.progress-inline .progress-copy {
  margin: 0;
}

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.dropzone.locked {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

.drop-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--faint);
}

.drop-sub,
.form-note,
.optional,
.muted {
  color: var(--muted);
}

.file-chip {
  margin: 14px auto 0;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--faint);
}

.scan-options {
  margin: 12px 0 4px;
}

details.scan-options-collapsible {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

[data-theme="light"] details.scan-options-collapsible {
  background: rgba(0, 0, 0, 0.02);
}

details.scan-options-collapsible[open] {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(0, 194, 212, 0.35);
}

.scan-options-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.scan-options-summary::-webkit-details-marker {
  display: none;
}

.scan-options-summary-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-options-toggle-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

details.scan-options-collapsible[open] .scan-options-toggle-hint .chevron {
  transform: rotate(180deg);
}

.scan-options-toggle-hint .chevron {
  transition: transform 0.2s ease;
  display: inline-block;
  font-size: 11px;
}

.scan-options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.scan-options-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.scan-options-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 194, 212, 0.12);
  color: var(--blue);
  border: 1px solid rgba(0, 194, 212, 0.25);
}

.scan-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scan-options-grid.compact {
  padding: 4px 12px 12px;
  gap: 8px;
}

@media (max-width: 680px) {
  .scan-options-grid {
    grid-template-columns: 1fr;
  }
}

.scan-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.scan-option.compact {
  padding: 8px 12px;
  border-radius: 10px;
  align-items: center;
  gap: 8px;
}

.scan-option.compact.small-matches-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
}

.scan-option.compact.small-matches-option > span:not(.small-matches-threshold-wrap) {
  display: inline-flex;
  align-items: center;
}

.scan-option.compact.small-matches-option .small-matches-threshold-wrap {
  margin-left: auto;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
  cursor: pointer;
}

[data-theme="light"] .scan-option.compact.small-matches-option .small-matches-threshold-wrap {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

.scan-option.compact.small-matches-option .small-matches-threshold-wrap:hover:not(.disabled) {
  border-color: rgba(0, 194, 212, 0.5);
  background: rgba(0, 194, 212, 0.08);
}

.scan-option.compact.small-matches-option .small-matches-threshold-wrap:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
  background: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .scan-option.compact.small-matches-option .small-matches-threshold-wrap:focus-within {
  background: #ffffff;
}

.scan-option.compact.small-matches-option .small-matches-threshold-wrap.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.threshold-number-input {
  width: 48px !important;
  height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-align: center !important;
  color: var(--amber) !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: none !important;
  box-sizing: border-box !important;
  display: inline-block !important;
}

.threshold-number-input::-webkit-outer-spin-button,
.threshold-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  display: none !important;
  margin: 0 !important;
}

.threshold-unit {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  user-select: none;
  line-height: 1;
}

.scan-option.compact strong {
  font-size: 13px;
  font-weight: 500;
}

.scan-option.compact input {
  margin-top: 0;
  width: 15px;
  height: 15px;
}

.scan-option:hover {
  border-color: rgba(0, 194, 212, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .scan-option {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .scan-option:hover {
  border-color: rgba(0, 150, 255, 0.35);
  background: rgba(0, 0, 0, 0.05);
}

.scan-option input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--amber);
  flex-shrink: 0;
}

.scan-option span {
  display: grid;
  gap: 2px;
}

.scan-option strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.scan-option small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

#ai-report-option.is-maintenance .scan-option small {
  color: #ffaa33;
}

[data-theme="light"] #ai-report-option.is-maintenance .scan-option small {
  color: #a34e00;
}

.score-ai {
  margin: -4px 0 12px;
  font-size: 14px;
}

#ai-error-line {
  margin: 0 0 10px;
  font-size: 13px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

input,
select {
  font: inherit;
  color: var(--text);
  background: rgba(0, 60, 70, 0.35);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  outline: none;
}

input:focus,
input:focus-visible,
select:focus,
select:focus-visible {
  border-color: rgba(120, 210, 220, 0.65);
  box-shadow: 0 0 0 2px rgba(0, 150, 160, 0.28);
}

[data-theme="light"] input,
[data-theme="light"] select {
  background: #fff;
}

[data-theme="light"] input:focus,
[data-theme="light"] input:focus-visible,
[data-theme="light"] select:focus,
[data-theme="light"] select:focus-visible {
  border-color: rgba(0, 120, 140, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 140, 160, 0.18);
}

.form-note {
  text-align: center;
  font-size: 13px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.step {
  font-size: 11px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.step.active {
  color: #fff;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  border-color: transparent;
}

.step.done {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.4);
}

.progress-copy {
  text-align: center;
  color: var(--muted);
}

.result {
  display: grid;
  gap: 14px;
  justify-items: stretch;
  width: 100%;
}

.score {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.error {
  margin-top: 12px;
  color: var(--danger);
  text-align: center;
}

.success {
  margin-top: 12px;
  color: var(--ok);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.45;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 24px;
  align-items: stretch;
  width: 100%;
}

.result-rail {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-height: 100%;
  height: 100%;
}

.result-placeholder h3 {
  margin: 8px 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.result-placeholder .muted {
  margin: 0;
  line-height: 1.5;
}

.result-rail.is-ready .result-placeholder {
  display: none;
}

.result-rail.is-ready .result {
  display: grid;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.tiles article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.num {
  color: var(--amber);
  font-weight: 700;
}

[data-theme="light"] .glow-a,
[data-theme="light"] .glow-b {
  opacity: 0.16;
}

[data-theme="light"] .paper-card {
  background: linear-gradient(180deg, #ffffff, #e8f6f8);
}

[data-theme="light"] .engine-pill {
  background: rgba(255, 255, 255, 0.72);
}

.dashboard {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}

.dashboard .panel {
  padding-top: 28px;
}

body[data-page="dashboard"] {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-page="dashboard"] .nav {
  position: relative;
}

body[data-page="dashboard"] .dashboard {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px 20px;
  overflow: visible;
}

body[data-page="dashboard"] .dashboard .panel {
  width: 100%;
  padding: 0;
  margin: 0;
  max-width: none;
}

body[data-page="dashboard"] .scan-card {
  margin-top: 18px;
}

body[data-page="dashboard"] .dropzone {
  padding: 28px 16px;
}

body[data-page="dashboard"] h2 {
  font-size: clamp(28px, 4vw, 36px);
  margin: 6px 0 8px;
}

@media (max-height: 720px) {
  body[data-page="dashboard"] .dashboard {
    justify-content: flex-start;
  }

  body[data-page="dashboard"] .dropzone {
    padding: 20px 14px;
  }

  body[data-page="dashboard"] .scan-card {
    margin-top: 14px;
    padding: 16px;
  }
}

.hidden {
  display: none !important;
}

/* Avoid Sign in → Dashboard flash on home refresh: cookie sets html[data-auth] before paint. */
html:not([data-auth]) body[data-page="home"] #nav-sign-in,
html:not([data-auth]) body[data-page="home"] #nav-dashboard,
html:not([data-auth]) body[data-page="home"] #profile-menu,
html[data-auth="in"] body[data-page="home"] #nav-sign-in,
html[data-auth="out"] body[data-page="home"] #nav-dashboard,
html[data-auth="out"] body[data-page="home"] #profile-menu {
  display: none !important;
}

.gate {
  min-height: 100vh;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 24, 0.72);
  backdrop-filter: blur(8px);
}

.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 48px 24px 72px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
}

.auth-card h2 {
  margin: 0;
}

.auth-switch {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.auth-switch:hover {
  color: var(--text);
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.reset-page {
  min-height: calc(100vh - 88px);
  display: grid;
  place-items: center;
  padding: 32px 20px 64px;
}

.reset-card a.auth-switch {
  text-decoration: none;
}

@keyframes spin {
  from { transform: rotateX(68deg) rotate(0deg); }
  to { transform: rotateX(68deg) rotate(360deg); }
}

@media (max-width: 760px) {
  .fields,
  .tiles {
    grid-template-columns: 1fr;
  }

  .progress-inline .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .result-rail {
    min-height: 0;
    position: static;
  }
}

@media (max-width: 640px) {
  .ghost-link {
    display: none;
  }
  h1 {
    font-size: 48px;
  }
}

.admin-panel {
  max-width: 720px;
}

body[data-page="admin"] {
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 150, 255, 0.12), transparent 34%),
    radial-gradient(circle at 88% 90%, rgba(0, 194, 212, 0.1), transparent 36%),
    var(--bg);
}

body[data-page="admin"] .glow,
body[data-page="admin"] .grid-bg {
  display: none;
}

body[data-page="admin"] .admin-app {
  height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  overflow: hidden;
}

body[data-page="admin"] .admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

body[data-page="admin"] .admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
}

body[data-page="admin"] .admin-brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

body[data-page="admin"] .admin-brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

body[data-page="admin"] .admin-side-nav,
body[data-page="admin"] .admin-side-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body[data-page="admin"] .admin-side-nav {
  flex: 1 1 auto;
}

body[data-page="admin"] .admin-nav-label {
  margin: 0 0 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-page="admin"] .admin-nav-item {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

body[data-page="admin"] a.admin-nav-item {
  text-decoration: none;
}

body[data-page="admin"] .admin-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

body[data-page="admin"] .admin-nav-item.is-active {
  color: var(--text);
  background: rgba(0, 150, 255, 0.16);
}

body[data-page="admin"] .admin-nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: inherit;
}

body[data-page="admin"] .admin-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 24px 18px;
  overflow: hidden;
}

body[data-page="admin"] .admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

body[data-page="admin"] .admin-topbar-title-wrap {
  display: flex;
  flex-direction: column;
}

body[data-page="admin"] .admin-topbar .eyebrow {
  margin-bottom: 4px;
}

body[data-page="admin"] .admin-topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 36px);
  line-height: 1.1;
}

body[data-page="admin"] .admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

body[data-page="admin"] .admin-topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-page="admin"] .admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-page="admin"] .admin-provider {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

body[data-page="admin"] .admin-provider select {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

body[data-page="admin"] .admin-actions {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="admin"] .admin-refresh-btn.is-busy svg {
  animation: admin-refresh-spin 0.8s linear infinite;
}

@keyframes admin-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

body[data-page="admin"] .admin-page {
  margin-top: 16px;
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

body[data-page="admin"] .admin-page.is-active {
  display: flex;
}

body[data-page="admin"] .admin-page-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100%;
  color: var(--text);
  position: relative;
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body[data-page="admin"] .admin-toggle-ui {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}

body[data-page="admin"] .admin-toggle-ui::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s ease;
}

body[data-page="admin"] .admin-toggle input:checked + .admin-toggle-ui {
  background: rgba(0, 150, 255, 0.35);
  border-color: rgba(0, 150, 255, 0.55);
}

body[data-page="admin"] .admin-toggle input:checked + .admin-toggle-ui::after {
  transform: translateX(16px);
}

body[data-page="admin"] .admin-toggle input:focus-visible + .admin-toggle-ui {
  outline: 2px solid rgba(0, 150, 255, 0.55);
  outline-offset: 2px;
}

body[data-page="admin"] .admin-toggle-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.usage-card {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 40, 50, 0.35);
}

.usage-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.usage-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.usage-card-count {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.usage-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2aa8c0, #4fd0e0);
  transition: width 0.25s ease;
}

.usage-card-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.usage-card.is-limited {
  border-color: rgba(240, 90, 90, 0.35);
  background: rgba(90, 20, 30, 0.28);
}

.usage-card.is-limited .usage-card-count,
.usage-card.is-limited .usage-card-meta {
  color: #ffb4b4;
}

.usage-card.is-limited .usage-bar-fill {
  background: linear-gradient(90deg, #d45353, #f07a7a);
}

[data-theme="light"] .usage-card {
  background: rgba(0, 90, 110, 0.06);
}

[data-theme="light"] .usage-card.is-limited {
  background: rgba(220, 60, 60, 0.08);
  border-color: rgba(200, 60, 60, 0.28);
}

[data-theme="light"] .usage-card.is-limited .usage-card-count,
[data-theme="light"] .usage-card.is-limited .usage-card-meta {
  color: #b42318;
}

[data-theme="light"] .usage-bar {
  background: rgba(0, 0, 0, 0.08);
}

body[data-page="admin"] .admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-users-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 240px;
  flex-shrink: 0;
}

body[data-page="admin"] .admin-users-search-icon {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}

body[data-page="admin"] .admin-users-search-input {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 32px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

body[data-page="admin"] .admin-users-search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

body[data-page="admin"] .admin-users-search-input:focus {
  border-color: rgba(0, 150, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 150, 255, 0.15);
  background: rgba(0, 48, 56, 0.95);
}

[data-theme="light"] body[data-page="admin"] .admin-users-search-input:focus {
  background: #ffffff;
}

body[data-page="admin"] .admin-users-search-clear {
  position: absolute;
  right: 8px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-size: 10px;
  font-family: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

body[data-page="admin"] .admin-users-search-clear:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

[data-theme="light"] body[data-page="admin"] .admin-users-search-clear {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body[data-page="admin"] .admin-users-search-clear:hover {
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
}

body[data-page="admin"] .admin-users-filter-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

body[data-page="admin"] .admin-users-filter-select {
  height: 34px;
  padding: 0 32px 0 14px;
  border-radius: 999px;
  background-color: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa3a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

body[data-page="admin"] .admin-users-filter-select:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

body[data-page="admin"] .admin-users-filter-select:focus {
  border-color: rgba(0, 150, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 150, 255, 0.15);
  background-color: rgba(0, 48, 56, 0.95);
}

body[data-page="admin"] .admin-users-filter-select option {
  background: #0d2830;
  color: #e5f2f2;
}

[data-theme="light"] body[data-page="admin"] .admin-users-filter-select {
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5d61' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] body[data-page="admin"] .admin-users-filter-select:focus {
  background-color: #ffffff;
}

[data-theme="light"] body[data-page="admin"] .admin-users-filter-select option {
  background: #ffffff;
  color: #1a2a2e;
}

body[data-page="admin"] .admin-limit-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-limit-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

body[data-page="admin"] .admin-limit-field input {
  width: 64px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 10px;
  appearance: textfield;
  -moz-appearance: textfield;
}

body[data-page="admin"] .admin-limit-field input::-webkit-outer-spin-button,
body[data-page="admin"] .admin-limit-field input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

body[data-page="admin"] .admin-limit-field .icon-btn,
body[data-page="admin"] #daily-limit-save {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-limit-field .icon-btn svg,
body[data-page="admin"] #daily-limit-save svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
  flex-shrink: 0;
}

body[data-page="admin"] .admin-limit-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

body[data-page="admin"] .admin-page-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

body[data-page="admin"] .admin-section {
  margin-top: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-page="admin"] .admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="admin"] .admin-section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

body[data-page="admin"] .admin-section-classes {
  flex: 0 0 auto;
}

body[data-page="admin"] .admin-section-assignments,
body[data-page="admin"] .admin-users-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

body[data-page="admin"] .admin-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
}

body[data-page="admin"] .admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

body[data-page="admin"] .admin-data-table th,
body[data-page="admin"] .admin-data-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

body[data-page="admin"] .admin-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(0, 38, 44, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-page="admin"] .admin-data-table th.admin-sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

body[data-page="admin"] .admin-data-table th.admin-sortable-th:hover {
  color: var(--text);
}

body[data-page="admin"] .admin-data-table th.admin-sortable-th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

body[data-page="admin"] .admin-data-table th.admin-sortable-th:hover .sort-icon {
  opacity: 1;
}

[data-theme="light"] body[data-page="admin"] .admin-data-table th {
  background: rgba(255, 255, 255, 0.96);
}

[data-theme="light"] body[data-page="admin"] .admin-sidebar,
[data-theme="light"] body[data-page="admin"] .admin-table-wrap {
  background: rgba(255, 255, 255, 0.72);
}

body[data-page="admin"] .admin-data-table tr:last-child td {
  border-bottom: none;
}

body[data-page="admin"] .admin-data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

body[data-page="admin"] .admin-data-table tr.has-issue td {
  background: rgba(255, 176, 72, 0.08);
}

body[data-page="admin"] .admin-data-table tr.is-in-use td {
  background: rgba(64, 170, 210, 0.12);
}

body[data-page="admin"] .admin-active-scan {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(64, 170, 210, 0.35);
  background: rgba(20, 70, 90, 0.45);
}

body[data-page="admin"] .admin-active-scan.hidden {
  display: none;
}

body[data-page="admin"] .admin-active-scan-label {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(80, 190, 220, 0.22);
  color: #9fe4f3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-page="admin"] .admin-active-scan-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

body[data-page="admin"] .admin-status-badge.is-busy {
  color: #9fe4f3;
  background: rgba(80, 190, 220, 0.18);
}

body[data-page="admin"] .admin-delete-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

[data-theme="light"] body[data-page="admin"] .admin-active-scan {
  background: rgba(0, 120, 150, 0.08);
  border-color: rgba(0, 120, 150, 0.28);
}

[data-theme="light"] body[data-page="admin"] .admin-active-scan-label {
  color: #0b6b7c;
  background: rgba(0, 130, 150, 0.12);
}

[data-theme="light"] body[data-page="admin"] .admin-data-table tr.is-in-use td {
  background: rgba(0, 140, 170, 0.08);
}

body[data-page="admin"] .admin-cell-title {
  display: block;
  font-weight: 600;
  color: var(--text);
}

body[data-page="admin"] .admin-cell-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

body[data-page="admin"] .admin-empty,
body[data-page="admin"] .admin-empty-cell {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

body[data-page="admin"] .admin-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
}

body[data-page="admin"] .admin-count {
  color: var(--muted);
  font-weight: 500;
}

body[data-page="admin"] .admin-access-cell {
  min-width: 0;
}

body[data-page="admin"] .admin-access-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body[data-page="admin"] .admin-access-status {
  display: inline-flex;
  align-items: center;
  max-width: 110px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="admin"] .admin-access-status.is-expired {
  color: #ffb4b4;
  border-color: rgba(240, 90, 90, 0.35);
  background: rgba(240, 90, 90, 0.08);
}

body[data-page="admin"] .admin-expiry-cell.is-expired {
  color: #ffb4b4;
}

body[data-page="admin"] .admin-access-menu-toggle {
  width: 28px;
  height: 28px;
}

body[data-page="admin"] .admin-access-unlimited {
  color: var(--muted);
  font-size: 13px;
}

body[data-page="admin"] .admin-user-actions {
  white-space: nowrap;
  vertical-align: middle;
  width: 64px;
}

body[data-page="admin"] .admin-user-menu {
  position: relative;
  display: inline-flex;
}

body[data-page="admin"] .admin-user-menu-toggle {
  width: 34px;
  height: 34px;
}

body[data-page="admin"] .admin-user-menu.is-open .admin-user-menu-toggle {
  border-color: rgba(120, 210, 220, 0.55);
  background: rgba(0, 90, 105, 0.35);
}

body[data-page="admin"] .admin-user-menu-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 188px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 48, 56, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 4px;
  z-index: 80;
}

body[data-page="admin"] .admin-user-menu-dropdown.hidden {
  display: none;
}

body[data-page="admin"] .admin-user-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

body[data-page="admin"] .admin-user-menu-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

body[data-page="admin"] .admin-user-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

body[data-page="admin"] .admin-user-menu-item.has-submenu svg {
  flex: 0 0 auto;
  opacity: 0.7;
}

body[data-page="admin"] .admin-user-menu-submenu-wrap {
  position: relative;
}

body[data-page="admin"] .admin-user-menu-submenu-wrap.is-open > .admin-user-menu-item {
  background: rgba(255, 255, 255, 0.06);
}

body[data-page="admin"] .admin-user-menu-submenu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 178px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 48, 56, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 4px;
  z-index: 90;
}

body[data-page="admin"] .admin-user-menu-submenu.hidden {
  display: none;
}

body[data-page="admin"] .admin-user-menu-divider {
  height: 1px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
}

body[data-page="admin"] .admin-user-menu-item.is-danger {
  color: #ffb4b4;
}

body[data-page="admin"] .admin-user-menu-item.is-danger:hover {
  background: rgba(240, 90, 90, 0.12);
}

[data-theme="light"] body[data-page="admin"] .admin-user-menu-dropdown {
  background: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] body[data-page="admin"] .admin-user-menu-item:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] body[data-page="admin"] .admin-user-menu-submenu-wrap.is-open > .admin-user-menu-item {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] body[data-page="admin"] .admin-user-menu-submenu {
  background: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] body[data-page="admin"] .admin-user-menu-divider {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body[data-page="admin"] .admin-user-menu-item.is-danger {
  color: #b42318;
}

body[data-page="admin"] .admin-data-table tr.is-disabled td:not(.admin-user-actions) {
  opacity: 0.72;
}

body[data-page="admin"] .admin-role-badge.is-disabled {
  color: #ffb4b4;
  border-color: rgba(240, 90, 90, 0.4);
  background: rgba(240, 90, 90, 0.12);
}

body[data-page="admin"] .admin-access-unlimited {
  color: var(--muted);
  font-size: 13px;
}

body[data-page="admin"] .admin-role-badge,
body[data-page="admin"] .admin-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

body[data-page="admin"] .admin-role-badge.is-admin,
body[data-page="admin"] .admin-status-badge.is-ok {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(0, 150, 255, 0.12);
}

body[data-page="admin"] .admin-status-badge.is-warn {
  color: #ffd089;
  border-color: rgba(255, 176, 72, 0.4);
  background: rgba(255, 176, 72, 0.12);
}

body[data-page="admin"] .admin-delete-btn {
  min-width: 78px;
}

body[data-page="admin"] #admin-error,
body[data-page="admin"] #admin-users-error {
  margin-top: 12px;
  flex: 0 0 auto;
}

body.admin-modal-open {
  overflow: hidden;
}

body[data-page="admin"] .admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

body[data-page="admin"] .admin-modal-overlay.hidden {
  display: none;
}

body[data-page="admin"] .admin-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 16, 20, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

body[data-page="admin"] .admin-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

body[data-page="admin"] .admin-modal-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  word-break: break-word;
}

body[data-page="admin"] .admin-modal-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

body[data-page="admin"] .admin-modal-message.hidden,
body[data-page="admin"] .admin-modal-field.hidden,
body[data-page="admin"] .admin-modal-actions .btn.hidden {
  display: none;
}

body[data-page="admin"] .admin-modal-field {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

body[data-page="admin"] .admin-modal-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

body[data-page="admin"] .admin-modal-field input {
  margin: 0;
  padding: 12px 12px;
  border-radius: 12px;
  font-size: 14px;
  appearance: textfield;
  -moz-appearance: textfield;
}

body[data-page="admin"] .admin-modal-field input::-webkit-outer-spin-button,
body[data-page="admin"] .admin-modal-field input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

body[data-page="admin"] .admin-modal-field input.is-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

body[data-page="admin"] .admin-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

body[data-page="admin"] .admin-modal-actions .btn {
  flex: 1 1 0;
}

body[data-page="admin"] .admin-modal-actions .btn.is-danger {
  background: #d45353;
  border-color: #d45353;
  color: #fff;
}

body[data-page="admin"] .admin-modal-actions .btn.is-danger:hover {
  background: #e06464;
  border-color: #e06464;
  color: #fff;
}

[data-theme="light"] body[data-page="admin"] .admin-modal-backdrop {
  background: rgba(10, 30, 36, 0.45);
}

[data-theme="light"] body[data-page="admin"] .admin-modal-actions .btn.is-danger {
  background: #c9372c;
  border-color: #c9372c;
  color: #fff;
}

[data-theme="light"] body[data-page="admin"] .admin-modal-actions .btn.is-danger:hover {
  background: #b42318;
  border-color: #b42318;
}

body[data-page="admin"] .admin-users-scroll-hint {
  display: none;
}

.admin-actions {
  margin-top: 20px;
}

.admin-status {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.16);
}

.admin-status-line {
  margin: 0 0 10px;
  font-weight: 600;
}

.admin-section {
  margin-top: 16px;
}

.admin-section:first-child {
  margin-top: 0;
}

.admin-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.admin-list,
.admin-class-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.admin-list-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 150, 255, 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.admin-list-btn:hover,
.admin-list-btn.is-active {
  border-color: rgba(0, 150, 255, 0.55);
  background: rgba(0, 150, 255, 0.12);
}

.admin-list-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.admin-list-item.has-issue {
  border-color: rgba(255, 176, 32, 0.55);
  background: rgba(255, 176, 32, 0.08);
}

.admin-issue-badge {
  display: inline-flex;
  margin-top: 4px;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 32, 0.45);
  color: #ffc857;
  font-size: 12px;
  font-weight: 600;
}

.admin-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-item-title {
  font-weight: 600;
}

.admin-item-meta {
  color: var(--muted);
  font-size: 13px;
}

.admin-delete-btn {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 8px 12px;
  border-color: rgba(255, 107, 122, 0.35);
  color: #ff8b96;
}

.admin-delete-btn:hover {
  border-color: rgba(255, 107, 122, 0.7);
  background: rgba(255, 107, 122, 0.12);
}

.admin-delete-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 900px) {
  body[data-page="admin"] .admin-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-page="admin"] {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-page="admin"] .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body[data-page="admin"] .admin-main {
    overflow: visible;
  }

  body[data-page="admin"] .admin-page,
  body[data-page="admin"] .admin-page-body,
  body[data-page="admin"] .admin-dashboard-content {
    overflow: visible;
    height: auto;
  }
}

@media (max-width: 768px) {
  body[data-page="admin"] .admin-sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "brand foot"
      "nav nav";
    align-content: start;
    align-items: center;
    height: auto;
    min-height: 0;
    gap: 10px 14px;
    padding: 12px 14px 10px;
    background: rgba(0, 24, 28, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  [data-theme="light"] body[data-page="admin"] .admin-sidebar {
    background: rgba(243, 250, 251, 0.95);
  }

  body[data-page="admin"] .admin-brand {
    grid-area: brand;
    display: flex;
    align-items: center;
    padding: 0;
  }

  body[data-page="admin"] .admin-brand strong {
    font-size: 15px;
  }

  body[data-page="admin"] .admin-brand small {
    font-size: 11px;
  }

  body[data-page="admin"] .admin-side-foot {
    grid-area: foot;
    display: flex;
    align-items: center;
    margin: 0;
  }

  body[data-page="admin"] .admin-side-foot .admin-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12.5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--faint);
    color: var(--text);
    width: auto;
  }

  body[data-page="admin"] .admin-nav-label {
    display: none;
  }

  body[data-page="admin"] .admin-side-nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    height: 44px;
    flex: none;
    box-sizing: border-box;
    gap: 4px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0;
  }

  [data-theme="light"] body[data-page="admin"] .admin-side-nav {
    background: rgba(0, 0, 0, 0.05);
  }

  body[data-page="admin"] .admin-side-nav .admin-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    box-sizing: border-box;
    padding: 0 6px;
    font-size: 12.5px;
    line-height: 1;
    font-weight: 500;
    border-radius: 9px;
    width: 100%;
    margin: 0;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease, color 0.15s ease;
  }

  body[data-page="admin"] .admin-side-nav .admin-nav-item .admin-nav-icon {
    flex-shrink: 0;
  }

  @media (max-width: 380px) {
    body[data-page="admin"] .admin-side-nav .admin-nav-item {
      font-size: 11.5px;
      padding: 7px 4px;
      gap: 4px;
    }

    body[data-page="admin"] .admin-side-nav .admin-nav-item .admin-nav-icon svg {
      width: 15px;
      height: 15px;
    }
  }

  body[data-page="admin"] .admin-side-nav .admin-nav-item.is-active {
    background: var(--amber);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 150, 255, 0.35);
  }

  body[data-page="admin"] .admin-main {
    padding: 14px 12px 32px;
  }

  body[data-page="admin"] .admin-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "title user"
      "controls controls";
    align-items: center;
    gap: 12px 10px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  body[data-page="admin"] .admin-topbar-title-wrap {
    grid-area: title;
    min-width: 0;
  }

  body[data-page="admin"] .admin-topbar .eyebrow {
    display: none;
  }

  body[data-page="admin"] .admin-topbar h1 {
    font-size: 22px;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
  }

  body[data-page="admin"] .admin-topbar-actions {
    display: contents;
  }

  body[data-page="admin"] .admin-topbar-user {
    grid-area: user;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
  }

  body[data-page="admin"] .admin-topbar-user .icon-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  body[data-page="admin"] .admin-topbar-controls {
    grid-area: controls;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    background: rgba(0, 36, 44, 0.45);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-sizing: border-box;
  }

  [data-theme="light"] body[data-page="admin"] .admin-topbar-controls {
    background: rgba(0, 60, 70, 0.04);
  }

  body[data-page="admin"] .admin-topbar-controls .admin-provider,
  body[data-page="admin"] .admin-topbar-controls .admin-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(0, 194, 212, 0.16);
    border-radius: 10px;
    margin: 0;
    min-height: 44px;
    height: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  [data-theme="light"] body[data-page="admin"] .admin-topbar-controls .admin-provider,
  [data-theme="light"] body[data-page="admin"] .admin-topbar-controls .admin-toggle {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--line);
  }

  body[data-page="admin"] .admin-topbar-controls .admin-provider:hover,
  body[data-page="admin"] .admin-topbar-controls .admin-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 194, 212, 0.32);
  }

  [data-theme="light"] body[data-page="admin"] .admin-topbar-controls .admin-provider:hover,
  [data-theme="light"] body[data-page="admin"] .admin-topbar-controls .admin-toggle:hover {
    background: #ffffff;
    border-color: rgba(0, 60, 70, 0.28);
  }

  body[data-page="admin"] .admin-topbar-controls .admin-provider {
    justify-content: space-between;
  }

  body[data-page="admin"] .admin-topbar-controls .admin-provider select {
    height: 28px;
    font-size: 12px;
    padding: 0 6px;
    border-radius: 7px;
    min-width: 0;
    max-width: 90px;
    flex-shrink: 0;
  }

  body[data-page="admin"] .admin-topbar-controls .admin-toggle-ui {
    width: 32px;
    height: 18px;
    flex-shrink: 0;
  }

  body[data-page="admin"] .admin-topbar-controls .admin-toggle-ui::after {
    width: 14px;
    height: 14px;
    top: 1px;
    left: 1px;
  }

  body[data-page="admin"] .admin-topbar-controls .admin-toggle input:checked + .admin-toggle-ui::after {
    transform: translateX(14px);
  }

  body[data-page="admin"] .admin-topbar-controls .admin-toggle-label {
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="admin"] .admin-topbar-controls .admin-maintenance-badge {
    padding: 2px 6px;
    font-size: 9.5px;
    flex-shrink: 0;
    margin-left: auto;
  }

  body[data-page="admin"] .admin-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 12px;
  }

  body[data-page="admin"] .admin-page-copy {
    font-size: 13px;
    line-height: 1.4;
    flex: 1 1 auto;
  }

  body[data-page="admin"] .admin-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1 1 100%;
    width: 100%;
  }

  body[data-page="admin"] .admin-users-search-wrap {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  body[data-page="admin"] .admin-users-search-input {
    height: 38px;
    font-size: 13.5px;
    padding-left: 36px;
    border-radius: 12px;
  }

  body[data-page="admin"] .admin-limit-field {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 10px;
    background: rgba(0, 0, 0, 0.16);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
  }

  [data-theme="light"] body[data-page="admin"] .admin-limit-field {
    background: rgba(0, 0, 0, 0.04);
  }

  body[data-page="admin"] .admin-limit-label {
    font-size: 12px;
  }

  body[data-page="admin"] .admin-limit-field input {
    width: 52px;
    height: 32px;
    padding: 4px 6px;
    font-size: 13px;
  }

  body[data-page="admin"] .admin-limit-field .icon-btn,
  body[data-page="admin"] #daily-limit-save {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
  }

  body[data-page="admin"] .admin-limit-field .icon-btn svg,
  body[data-page="admin"] #daily-limit-save svg {
    width: 15px;
    height: 15px;
  }

  body[data-page="admin"] .admin-limit-meta {
    font-size: 12px;
    width: 100%;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  body[data-page="admin"] .admin-users-scroll-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11.5px;
    margin: 4px 0 6px auto;
    width: fit-content;
  }

  body[data-page="admin"] .admin-table-wrap {
    max-height: none !important;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-top: 4px;
  }

  body[data-page="admin"] .admin-table-wrap::-webkit-scrollbar {
    height: 5px;
  }

  body[data-page="admin"] .admin-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 255, 0.4);
    border-radius: 999px;
  }

  body[data-page="admin"] .admin-table-wrap::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08);
  }

  body[data-page="admin"] .admin-data-table {
    font-size: 12px;
  }

  body[data-page="admin"] .admin-data-table th,
  body[data-page="admin"] .admin-data-table td {
    padding: 10px 10px;
    white-space: nowrap;
  }

  body[data-page="admin"] .admin-data-table th {
    font-size: 10.5px;
    letter-spacing: 0.03em;
  }

  body[data-page="admin"] .admin-users-table {
    min-width: 820px;
  }

  body[data-page="admin"] #admin-assignment-section .admin-data-table {
    min-width: 540px;
  }

  body[data-page="admin"] .admin-list-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
  }

  body[data-page="admin"] .admin-list-btn .admin-item-meta,
  body[data-page="admin"] .admin-list-btn .admin-cell-sub {
    margin-top: 0;
    font-size: 11.5px;
    opacity: 0.85;
  }

  body[data-page="admin"] .admin-toggle {
    margin-top: 4px;
  }

  body[data-page="admin"] .admin-modal-card {
    width: min(380px, calc(100vw - 28px));
    padding: 20px;
  }
}

/* Dashboard Scan History */
body[data-page="dashboard"] .dashboard .dashboard-history-panel {
  margin-top: 36px;
}

.dashboard-history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-history-head h2 {
  margin: 4px 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dashboard-history-head .section-copy {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.history-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--faint);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.history-refresh-btn:hover {
  color: #00b4d8;
  border-color: rgba(0, 180, 216, 0.45);
  background: rgba(0, 180, 216, 0.1);
}

[data-theme="light"] .history-refresh-btn:hover {
  color: #007799;
  border-color: rgba(0, 140, 170, 0.45);
  background: rgba(0, 140, 170, 0.08);
}

.history-refresh-btn svg {
  display: block;
  flex-shrink: 0;
}

.history-refresh-btn.is-busy svg,
#history-refresh-btn.is-busy svg {
  animation: admin-refresh-spin 0.8s linear infinite;
}

.dashboard-history-wrap {
  max-height: 362px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 194, 212, 0.4) transparent;
}

.dashboard-history-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dashboard-history-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 194, 212, 0.35);
  border-radius: 999px;
}

.dashboard-history-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 194, 212, 0.6);
}

.dashboard-history-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.dashboard-history-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #002d35;
  box-shadow: 0 1px 0 var(--line);
  white-space: nowrap;
}

[data-theme="light"] .dashboard-history-table th {
  background: #ffffff;
}

.dashboard-history-table th.th-actions {
  text-align: right;
}

.dashboard-history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.dashboard-history-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .dashboard-history-table tbody tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.history-doc-cell {
  max-width: 320px;
}

.history-doc-title {
  display: block;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-doc-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-date-cell {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.history-muted-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.history-score-badge.similarity {
  background: rgba(0, 180, 216, 0.12);
  border: 1px solid rgba(0, 180, 216, 0.35);
  color: #00b4d8;
}

[data-theme="light"] .history-score-badge.similarity {
  background: rgba(0, 140, 170, 0.12);
  border-color: rgba(0, 140, 170, 0.35);
  color: #007799;
}

.history-score-badge.ai {
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(147, 51, 234, 0.35);
  color: #c084fc;
}

[data-theme="light"] .history-score-badge.ai {
  background: rgba(126, 34, 206, 0.1);
  border-color: rgba(126, 34, 206, 0.3);
  color: #7e22ce;
}

.history-score-badge.score-empty {
  background: var(--faint);
  border: 1px solid var(--line);
  color: var(--muted);
}

.history-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.history-actions-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  vertical-align: middle;
}

.history-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--faint);
  color: var(--text);
  transition: all 0.15s ease;
}

.history-action-btn:hover {
  border-color: rgba(0, 180, 216, 0.5);
  background: rgba(0, 180, 216, 0.12);
  color: #00b4d8;
}

.history-action-btn.ai-btn:hover {
  border-color: rgba(147, 51, 234, 0.5);
  background: rgba(147, 51, 234, 0.12);
  color: #c084fc;
}

.history-badge-expired {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--faint);
  border: 1px solid var(--line);
}

@media (max-width: 768px) {
  body[data-page="dashboard"] .dashboard .dashboard-history-panel {
    margin-top: 28px;
  }

  .dashboard-history-table {
    min-width: 580px;
  }
}

@media (max-width: 640px) {
  .dashboard-history-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ==========================================================================
   Maintenance Mode Styles
   ========================================================================== */

/* Admin Topbar Maintenance Toggle & Badge */
body[data-page="admin"] .admin-maintenance-toggle {
  margin-left: 4px;
}

body[data-page="admin"] .admin-maintenance-toggle input:checked + .admin-toggle-ui {
  background: rgba(255, 149, 0, 0.35);
  border-color: rgba(255, 149, 0, 0.7);
}

body[data-page="admin"] .admin-maintenance-toggle input:focus-visible + .admin-toggle-ui {
  outline: 2px solid rgba(255, 149, 0, 0.7);
}

body[data-page="admin"] .admin-maintenance-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(255, 149, 0, 0.2);
  border: 1px solid rgba(255, 149, 0, 0.5);
  color: #ffaa33;
  animation: admin-pulse-glow 2s infinite ease-in-out;
}

@keyframes admin-pulse-glow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

/* Scanner Page Maintenance Banner */
.maintenance-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(70, 35, 5, 0.5) 0%, rgba(35, 18, 5, 0.35) 100%);
  border: 1px solid rgba(255, 150, 0, 0.4);
  box-shadow: 0 4px 20px rgba(255, 150, 0, 0.08), inset 0 1px 0 rgba(255, 200, 100, 0.15);
  transition: opacity 0.2s ease;
}

.maintenance-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 150, 0, 0.15);
  border: 1px solid rgba(255, 150, 0, 0.3);
  color: #ffaa33;
  flex-shrink: 0;
}

.maintenance-banner-body {
  flex: 1 1 auto;
  min-width: 0;
}

.maintenance-banner-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.maintenance-banner-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #ffdd99;
  line-height: 1.25;
}

.maintenance-banner-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 150, 0, 0.22);
  border: 1px solid rgba(255, 150, 0, 0.45);
  color: #ffaa33;
}

.maintenance-banner-copy {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 235, 210, 0.85);
}

/* Admin preview state */
.maintenance-banner.is-admin-preview {
  background: linear-gradient(135deg, rgba(0, 60, 90, 0.45) 0%, rgba(0, 35, 55, 0.35) 100%);
  border-color: rgba(0, 180, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 180, 255, 0.08), inset 0 1px 0 rgba(100, 200, 255, 0.15);
}

.maintenance-banner.is-admin-preview .maintenance-banner-icon {
  background: rgba(0, 180, 255, 0.15);
  border-color: rgba(0, 180, 255, 0.3);
  color: #5ec8ff;
}

.maintenance-banner.is-admin-preview .maintenance-banner-title {
  color: #d0f0ff;
}

.maintenance-banner.is-admin-preview .maintenance-banner-pill {
  background: rgba(0, 180, 255, 0.2);
  border-color: rgba(0, 180, 255, 0.4);
  color: #5ec8ff;
}

.maintenance-banner.is-admin-preview .maintenance-banner-copy {
  color: rgba(220, 245, 255, 0.85);
}

/* Light Theme Adjustments */
[data-theme="light"] body[data-page="admin"] .admin-maintenance-badge {
  background: rgba(240, 130, 0, 0.12);
  border-color: rgba(240, 130, 0, 0.4);
  color: #c76500;
}

[data-theme="light"] .maintenance-banner {
  background: linear-gradient(135deg, rgba(255, 245, 230, 0.95) 0%, rgba(255, 235, 210, 0.9) 100%);
  border-color: rgba(240, 140, 0, 0.35);
  box-shadow: 0 4px 16px rgba(240, 140, 0, 0.08);
}

[data-theme="light"] .maintenance-banner-icon {
  background: rgba(255, 149, 0, 0.12);
  border-color: rgba(255, 149, 0, 0.3);
  color: #c76500;
}

[data-theme="light"] .maintenance-banner-title {
  color: #8c4200;
}

[data-theme="light"] .maintenance-banner-pill {
  background: rgba(255, 149, 0, 0.16);
  border-color: rgba(255, 149, 0, 0.4);
  color: #a34e00;
}

[data-theme="light"] .maintenance-banner-copy {
  color: #663300;
}

[data-theme="light"] .maintenance-banner.is-admin-preview {
  background: linear-gradient(135deg, rgba(235, 248, 255, 0.95) 0%, rgba(220, 240, 255, 0.9) 100%);
  border-color: rgba(0, 150, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 150, 255, 0.08);
}

[data-theme="light"] .maintenance-banner.is-admin-preview .maintenance-banner-icon {
  background: rgba(0, 150, 255, 0.1);
  border-color: rgba(0, 150, 255, 0.25);
  color: #0070cc;
}

[data-theme="light"] .maintenance-banner.is-admin-preview .maintenance-banner-title {
  color: #004c8c;
}

[data-theme="light"] .maintenance-banner.is-admin-preview .maintenance-banner-pill {
  background: rgba(0, 150, 255, 0.14);
  border-color: rgba(0, 150, 255, 0.3);
  color: #0060b0;
}

[data-theme="light"] .maintenance-banner.is-admin-preview .maintenance-banner-copy {
  color: #003a66;
}

/* ==========================================================================
   Admin Dashboard Overview Styles
   ========================================================================== */

.admin-dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  padding-bottom: 24px;
  transform: translateZ(0);
  will-change: scroll-position;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.admin-session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.admin-session-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.admin-session-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.session-badges-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.session-active-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 200, 180, 0.14);
  color: #00d2b4;
  border: 1px solid rgba(0, 200, 180, 0.35);
  line-height: 1.2;
}

.session-active-pill.hidden {
  display: none;
}

.admin-session-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}

.admin-session-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.admin-session-email {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.admin-session-meta {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.session-health-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.session-health-badge.is-healthy {
  color: #00d2b4;
  background: rgba(0, 200, 180, 0.14);
  border-color: rgba(0, 200, 180, 0.35);
}

.session-health-badge.is-expired {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
}

.session-health-badge.is-missing,
.session-health-badge.is-unreachable,
.session-health-badge.is-checking,
.session-health-badge.is-unchecked {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.admin-session-card.is-healthy {
  border-color: rgba(0, 200, 180, 0.28);
}

.admin-session-card.is-expired {
  border-color: rgba(244, 63, 94, 0.35);
}

.admin-stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateZ(0);
  backface-visibility: hidden;
  cursor: default;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.12s ease-out, box-shadow 0.12s ease-out;
}

.admin-stat-card:hover {
  transform: translateY(-3px) translateZ(0);
  border-color: rgba(0, 194, 212, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrap.icon-teal {
  background: rgba(0, 200, 180, 0.12);
  color: #00d2b4;
  border: 1px solid rgba(0, 200, 180, 0.25);
}

.stat-icon-wrap.icon-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.stat-icon-wrap.icon-blue {
  background: rgba(0, 150, 255, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(0, 150, 255, 0.25);
}

.stat-icon-wrap.icon-gray {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--line);
}

.stat-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
}

.stat-badge.badge-active {
  background: rgba(0, 200, 180, 0.14);
  color: #00d2b4;
  border: 1px solid rgba(0, 200, 180, 0.3);
}

.stat-badge.badge-ai {
  background: rgba(168, 85, 247, 0.14);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.stat-badge.badge-sub {
  background: rgba(0, 150, 255, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(0, 150, 255, 0.3);
}

.stat-badge.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.stat-value {
  margin: 0 0 4px;
  font-size: clamp(30px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.stat-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Plan card highlights */
.admin-stat-card.stat-primary {
  border-color: rgba(0, 200, 180, 0.25);
  background: linear-gradient(145deg, rgba(0, 200, 180, 0.05) 0%, var(--surface) 100%);
}

.admin-stat-card.stat-primary:hover {
  border-color: rgba(0, 200, 180, 0.55);
  box-shadow: 0 6px 20px rgba(0, 200, 180, 0.16);
}

.admin-stat-card.stat-ai {
  border-color: rgba(168, 85, 247, 0.25);
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.05) 0%, var(--surface) 100%);
}

.admin-stat-card.stat-ai:hover {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.16);
}

/* Detail Breakdown Grid */
.admin-dashboard-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.admin-detail-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.admin-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-detail-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.admin-detail-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

/* Plan Progress Bars */
.admin-plan-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-plan-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-plan-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text);
}

.plan-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.plan-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.plan-dot.dot-similarity {
  background: #00d2b4;
  box-shadow: 0 0 8px rgba(0, 210, 180, 0.6);
}

.plan-dot.dot-ai {
  background: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}

.plan-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.admin-progress-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-progress-fill.fill-similarity {
  background: linear-gradient(90deg, #00bfa5, #00e5c0);
}

.admin-progress-fill.fill-ai {
  background: linear-gradient(90deg, #9333ea, #c084fc);
}

/* Usage Box */
.dashboard-usage-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-metric-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.usage-metric-num {
  font-size: clamp(34px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.usage-metric-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.usage-metric-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ==========================================================================
   7-Day Weekly Usage Graph Styles
   ========================================================================== */

.admin-weekly-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weekly-head-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weekly-head-total {
  font-size: 12px;
  font-weight: 500;
  color: #38bdf8;
}

.weekly-graph-wrap {
  margin: 14px 0 16px;
  padding: 12px 14px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .weekly-graph-wrap {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.weekly-bars-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 95px;
  padding-top: 18px;
}

.weekly-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  position: relative;
  cursor: default;
}

.weekly-bar-tooltip {
  position: absolute;
  top: -16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  transition: color 0.2s ease, transform 0.2s ease;
}

.weekly-bar-col:hover .weekly-bar-tooltip {
  color: #38bdf8;
  transform: translateY(-2px);
}

.weekly-bar-col.is-today .weekly-bar-tooltip {
  color: #00d2b4;
  font-weight: 800;
}

.weekly-bar-track {
  width: 100%;
  max-width: 24px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  overflow: hidden;
}

[data-theme="light"] .weekly-bar-track {
  background: rgba(0, 0, 0, 0.05);
}

.weekly-bar-fill {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.weekly-bar-col.is-today .weekly-bar-fill {
  background: linear-gradient(180deg, #00e5c0 0%, #00a890 100%);
  box-shadow: 0 0 10px rgba(0, 229, 192, 0.35);
}

.weekly-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.weekly-bar-col.is-today .weekly-bar-label {
  color: var(--text);
  font-weight: 700;
}

/* Light Mode Overrides */
[data-theme="light"] .admin-stat-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .admin-stat-card.stat-primary {
  background: linear-gradient(145deg, rgba(0, 180, 160, 0.08) 0%, #ffffff 100%);
  border-color: rgba(0, 180, 160, 0.3);
}

[data-theme="light"] .admin-stat-card.stat-ai {
  background: linear-gradient(145deg, rgba(147, 51, 234, 0.08) 0%, #ffffff 100%);
  border-color: rgba(147, 51, 234, 0.3);
}

[data-theme="light"] .admin-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .stat-badge.badge-neutral {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .session-health-badge.is-missing,
[data-theme="light"] .session-health-badge.is-unreachable,
[data-theme="light"] .session-health-badge.is-checking,
[data-theme="light"] .session-health-badge.is-unchecked {
  background: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Admin Live Queue & Submission Styles
   ========================================================================== */

.admin-queue-box {
  margin-top: 4px;
}

.queue-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.queue-status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-processing {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 150, 255, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(0, 150, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-queued {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.queue-rest-status {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.queue-rest-status.is-off,
.queue-rest-status.is-idle {
  color: var(--muted);
}

.queue-rest-status.is-resting {
  color: #facc15;
}

.queue-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-live 1.8s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

.queue-user-cell {
  max-width: 180px;
}

.queue-user-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.queue-file-cell {
  max-width: 220px;
}

.queue-file-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
}

.queue-file-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.queue-assignment-text {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.queue-date-cell {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.admin-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.admin-type-badge.type-sim {
  background: rgba(0, 200, 180, 0.12);
  color: #00d2b4;
  border: 1px solid rgba(0, 200, 180, 0.25);
}

.admin-type-badge.type-ai {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.admin-status-badge.badge-status-processing {
  background: rgba(0, 150, 255, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(0, 150, 255, 0.3);
}

.admin-status-badge.badge-status-processing .badge-pulse-dot {
  background: #38bdf8;
  animation: pulse-live 1.2s infinite ease-in-out;
}

.admin-status-badge.badge-status-scanning {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.admin-status-badge.badge-status-scanning .badge-pulse-dot {
  background: #10b981;
  animation: pulse-live 0.8s infinite ease-in-out;
}

.admin-status-badge.badge-status-ai {
  background: rgba(168, 85, 247, 0.14);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.admin-status-badge.badge-status-ai .badge-pulse-dot {
  background: #c084fc;
  animation: pulse-live 0.8s infinite ease-in-out;
}

.admin-status-badge.badge-status-queued {
  background: rgba(234, 179, 8, 0.14);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.admin-status-badge.badge-status-queued .badge-pulse-dot {
  background: #facc15;
}

.is-row-processing {
  background: rgba(0, 150, 255, 0.04);
}

.is-row-queued {
  opacity: 0.9;
}




