:root {
  --bg: #050a0f;
  --bg-elevated: #0a141f;
  --surface: rgba(11, 21, 33, 0.78);
  --surface-solid: #0c1724;
  --surface-muted: rgba(7, 14, 23, 0.85);
  --sidebar: rgba(6, 12, 20, 0.92);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.16);
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --primary: #06b6d4;
  --primary-2: #10b981;
  --text: #e6f6f4;
  --text-muted: #84a5b5;
  --border: rgba(56, 189, 248, 0.18);
  --border-strong: rgba(34, 211, 238, 0.34);
  --ok-bg: rgba(16, 185, 129, 0.15);
  --ok-text: #34d399;
  --ok-border: rgba(52, 211, 153, 0.4);
  --warn-bg: rgba(245, 158, 11, 0.15);
  --warn-text: #fbbf24;
  --warn-border: rgba(251, 191, 36, 0.42);
  --danger-bg: rgba(244, 63, 94, 0.16);
  --danger-text: #fb7185;
  --danger-border: rgba(251, 113, 133, 0.44);
  --info-bg: rgba(56, 189, 248, 0.15);
  --info-text: #38bdf8;
  --info-border: rgba(56, 189, 248, 0.4);
  --neutral-bg: rgba(148, 163, 184, 0.12);
  --neutral-text: #94a3b8;
  --neutral-border: rgba(148, 163, 184, 0.3);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.18);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --radius: 14px;
  --radius-sm: 8px;
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  display: flex;
  background: var(--bg);
  color: var(--text);
  position: relative;
}

[hidden] {
  display: none !important;
}

/* Futuristic HUD Ambient Background */
.hud-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hud-grid {
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.25) 75%, transparent);
}

.hud-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: hud-float 14s ease-in-out infinite alternate;
}

.hud-glow-a {
  width: 520px;
  height: 520px;
  top: -160px;
  left: 12%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35), transparent 70%);
}

.hud-glow-b {
  width: 480px;
  height: 480px;
  bottom: -140px;
  right: 6%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.28), transparent 70%);
  animation-delay: -7s;
}

@keyframes hud-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(28px, -22px) scale(1.08); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.75); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes radar-spin {
  to { transform: rotate(360deg); }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Sidebar */
.sidebar {
  width: 248px;
  background: var(--sidebar);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  color: var(--text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  padding: 6px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.brand:hover {
  background: rgba(34, 211, 238, 0.06);
}

.brand-logo-wrap {
  padding: 2px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.6), rgba(16, 185, 129, 0.5));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  background: #071019;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.3px;
  color: #fff;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--cyan);
  margin-top: 3px;
  font-weight: 600;
}

#nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#nav button {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: #9ec0cf;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

#nav button:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.2);
  color: #fff;
  transform: translateX(2px);
}

#nav button.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.22), rgba(16, 185, 129, 0.14));
  color: #fff;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.16);
  font-weight: 600;
}

.local {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.65;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald-bright);
  font-weight: 700;
  letter-spacing: 0.9px;
}

.status-dot-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-bright);
  animation: pulse-ring 2.2s infinite;
  flex-shrink: 0;
}

/* Main Content */
main {
  position: relative;
  z-index: 1;
  margin-left: 248px;
  width: calc(100% - 248px);
  max-width: 1500px;
  padding: 28px 36px 56px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0;
}

h1 {
  font-size: 27px;
  font-weight: 750;
  margin: 4px 0 0;
  line-height: 1.25;
  background: linear-gradient(90deg, #ffffff 0%, #a5f3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #f0fdfa;
}

h3 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 8px;
  color: #e0f2fe;
}

#identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

#identity span {
  background: rgba(12, 25, 38, 0.85);
  border: 1px solid var(--border-strong);
  padding: 7px 14px;
  border-radius: 999px;
  color: #cffafe;
  font-weight: 500;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.1);
}

/* Notice Banner */
#notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.12);
}

#notice:empty {
  display: none;
}

/* Glassmorphism Cards */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.32);
}

.table-card {
  padding: 16px 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-head h2 {
  margin: 0;
}

.subtle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 4px 0;
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

/* Forms & Inputs */
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #bae6fd;
  margin: 12px 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  margin-top: 6px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #5b7c8f;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18), 0 0 16px rgba(34, 211, 238, 0.14);
  background: rgba(9, 19, 31, 0.96);
}

/* Buttons & Neon Shimmer */
button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(15, 29, 44, 0.9);
  border-radius: var(--radius-sm);
  color: #e0f2fe;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

button:hover:not(:disabled) {
  background: rgba(23, 45, 68, 0.95);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.2);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

button.primary {
  background: linear-gradient(135deg, #0891b2 0%, #059669 100%);
  border-color: rgba(52, 211, 153, 0.55);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25);
}

button.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

button.primary:hover:not(:disabled)::after {
  left: 160%;
}

button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.42);
}

button.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

button.danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.26);
  border-color: #fb7185;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.28);
}

.wide {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
}

.link {
  background: none;
  border: 0;
  color: var(--cyan);
  padding: 6px 0;
  margin-top: 12px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  box-shadow: none;
}

.link:hover:not(:disabled) {
  background: none;
  border: 0;
  box-shadow: none;
  color: #a5f3fc;
}

.row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.row > label {
  flex: 1 1 180px;
  margin: 0;
}

.row > input {
  flex: 1 1 140px;
  min-width: 0;
  margin-top: 0;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.password-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.password-entry input {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.captcha input {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.captcha button {
  padding: 0;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 140px;
  height: 40px;
  flex-shrink: 0;
}

.captcha img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Login & Radar Hero */
.login-announcements {
  border-left: 3px solid var(--cyan);
  max-height: 260px;
  overflow-y: auto;
}

.announcement-entry + .announcement-entry {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.announcement-entry h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #f0fdfa;
  overflow-wrap: anywhere;
}

.announcement-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  margin: 8px 0 0;
  font-size: 13px;
  color: #cbd5e1;
}

.auth {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 36px;
  align-items: start;
  margin: 18px auto 0;
  max-width: 1000px;
}

.intro {
  padding: 18px 8px;
  position: relative;
}

.hud-radar {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 18px;
}

.radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.radar-ring-2 {
  inset: 14px;
  border-style: dashed;
  border-color: rgba(52, 211, 153, 0.45);
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(34, 211, 238, 0.48), transparent 65deg);
  animation: radar-spin 3.6s linear infinite;
}

.radar-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.pill {
  display: inline-block;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--cyan);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.intro h2 {
  font-size: 36px;
  line-height: 1.3;
  margin: 18px 0 14px;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #ffffff 10%, #67e8f9 65%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro p {
  line-height: 1.8;
  color: var(--text-muted);
  font-size: 14px;
}

.note {
  border-left: 3px solid var(--emerald-bright);
  background: rgba(16, 185, 129, 0.08);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #a7f3d0;
  font-size: 13px;
}

.note strong {
  color: var(--emerald-bright);
  font-size: 14px;
}

.auth-card {
  padding: 26px;
  border-top: 2px solid var(--cyan);
}

/* KPI Stats Grid */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stats-compact {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.stats article {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stats article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--emerald-bright));
  opacity: 0.7;
}

.stats article:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--glow-cyan);
}

.stats span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.stats strong {
  font-size: 27px;
  font-weight: 750;
  line-height: 1.2;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stats em {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
}

.stats small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.stat-action {
  margin-top: 4px;
}

/* Section Bars */
.sectionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 26px 0 12px;
  flex-wrap: wrap;
}

.sectionbar h2 {
  margin: 0;
}

#statsAccount {
  width: 220px;
  max-width: 100%;
  margin-top: 0;
}

.bottomgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* Badges & Neon Tags */
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}

.tag.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.tag.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.tag.muted-tag,
.badge {
  background: var(--neutral-bg);
  color: var(--neutral-text);
  border-color: var(--neutral-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: var(--info-border);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--cyan);
  text-align: left;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-strong);
  padding: 11px 12px;
  white-space: nowrap;
  background: rgba(8, 18, 29, 0.9);
}

td {
  padding: 12px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  vertical-align: top;
  white-space: nowrap;
  color: var(--text);
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(34, 211, 238, 0.05);
}

tr:last-child td {
  border-bottom: 0;
}

td button {
  font-size: 12px;
  padding: 6px 10px;
  margin-right: 6px;
}

.device-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-ops button {
  margin-right: 0;
}

.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

.empty strong {
  display: block;
  font-size: 15px;
  color: #e0f2fe;
  margin-bottom: 6px;
}

/* Queue & Pause Status */
.queue-status {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  white-space: normal;
  min-width: 210px;
  max-width: 300px;
}

.queue-status p {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warn-text);
}

.account-error {
  color: var(--danger-text);
  white-space: normal;
  min-width: 180px;
  max-width: 300px;
  line-height: 1.55;
  margin: 8px 0 0;
  font-size: 12px;
}

.pause-summary {
  white-space: normal;
  min-width: 190px;
  max-width: 310px;
  line-height: 1.55;
}

.pause-summary small {
  display: block;
  margin: 6px 0;
}

.pause-summary button {
  margin-top: 4px;
}

#pauseReportList td {
  white-space: normal;
  min-width: 110px;
  max-width: 340px;
  overflow-wrap: anywhere;
}

/* Admin Tabs & Filters */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(5, 10, 15, 0.88);
  backdrop-filter: blur(12px);
  padding: 10px 0 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.admin-tabs button {
  background: rgba(12, 24, 37, 0.85);
  color: #bae6fd;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.admin-tabs button.active {
  background: linear-gradient(135deg, #0891b2, #059669);
  color: #fff;
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.28);
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.status-filters button {
  background: rgba(12, 24, 37, 0.85);
  color: #bae6fd;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
}

.status-filters button.active {
  background: linear-gradient(135deg, #0891b2, #059669);
  color: #fff;
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.24);
}

.fleet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fleet-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.check-label input,
.device-select {
  width: 16px;
  height: 16px;
  margin: 0;
  min-width: 0;
  accent-color: var(--cyan);
}

.fleet-actions p {
  flex-basis: 100%;
  margin: 0;
}

.table-pager {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 0 12px;
}

.table-pager span {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-muted);
}

details.card summary {
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
  color: #e0f2fe;
}

details.card[open] summary {
  margin-bottom: 12px;
}

#checkinSettingsForm input {
  max-width: 260px;
}

#roomSummary {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.7;
  border-left: 3px solid var(--cyan);
}

/* Dialogs */
dialog {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 24px;
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72), 0 0 32px rgba(34, 211, 238, 0.16);
}

dialog[open] {
  animation: dialog-enter 0.18s ease-out;
}

dialog::backdrop {
  background: rgba(2, 6, 12, 0.76);
  backdrop-filter: blur(6px);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

#adminActionDescription {
  white-space: pre-line;
  line-height: 1.7;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--text-muted);
}

.pause-report-dialog {
  width: min(720px, calc(100vw - 24px));
}

.pause-report-dialog textarea {
  max-height: 60vh;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Preferences Checkbox Cards */
.pref-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.pref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 29, 44, 0.75);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pref-item:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}

.pref-item input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--cyan);
}

/* Announcement Modal */
html:has(#announcementDialog[open]),
html:has(#loadoutDialog[open]),
html:has(#accountSetupDialog[open]) {
  overflow: hidden;
}

#announcementDialog {
  width: min(920px, calc(100vw - 24px));
  height: min(86dvh, 760px);
  padding: 0;
  overflow: hidden;
}

#announcementDialog .announcement-shell {
  height: 100%;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
}

#announcementDialog header {
  flex: none;
  margin-bottom: 16px;
}

#announcementHeading {
  font-size: 24px;
  margin: 4px 0;
}

.announcement-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: rgba(7, 14, 23, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

#announcementDialog footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  flex: none;
  flex-wrap: wrap;
}

#announcementError {
  color: var(--danger-text);
  margin: 0 auto 0 0;
  font-size: 13px;
}

/* Loadout & Setup Stepper Dialogs */
#loadoutDialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}

#accountSetupDialog {
  width: min(820px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}

.loadout-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 26px);
}

.loadout-header {
  padding: 22px 24px 14px;
  flex: none;
}

.loadout-header h2 {
  font-size: 22px;
  margin: 6px 0 8px;
}

.loadout-header p:last-child {
  margin: 0;
  line-height: 1.7;
}

.loadout-header strong {
  color: var(--cyan);
}

.loadout-scroll {
  overflow-y: auto;
  min-height: 0;
  padding: 0 24px 18px;
}

.loadout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.loadout-grid figure {
  margin: 0;
  background: rgba(15, 29, 44, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.loadout-grid figcaption {
  line-height: 1.6;
  min-height: 76px;
  margin-bottom: 8px;
}

.loadout-grid figcaption strong {
  display: block;
  font-size: 13px;
  color: #e0f2fe;
}

.loadout-grid figcaption span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.loadout-grid a {
  display: block;
}

.loadout-grid img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 6px;
}

.loadout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-solid);
  flex: none;
  flex-wrap: wrap;
}

.account-setup-note {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-left: 3px solid var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.7;
  font-size: 13px;
  color: #cffafe;
}

.account-setup-note p {
  margin: 0;
}

.account-setup-note p + p {
  margin-top: 6px;
}

.account-setup-image {
  margin: 0;
}

.account-setup-image img {
  display: block;
  width: 100%;
  max-width: 728px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.account-setup-image figcaption {
  margin-top: 10px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .sidebar {
    width: 204px;
    padding: 22px 14px;
  }

  main {
    margin-left: 204px;
    width: calc(100% - 204px);
    padding: 22px 24px 48px;
  }

  .auth {
    gap: 20px;
  }

  .loadout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .local {
    display: none;
  }

  #nav {
    margin-top: 12px;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
  }

  #nav button {
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
  }

  main {
    margin-left: 0;
    width: 100%;
    padding: 18px 14px 42px;
  }

  .auth {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .intro {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stats-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottomgrid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 16px;
  }

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }

  .loadout-grid {
    grid-template-columns: 1fr;
  }

  .loadout-grid figcaption {
    min-height: 0;
  }

  .loadout-header,
  .loadout-scroll,
  .loadout-actions,
  #announcementDialog .announcement-shell {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud-glow,
  .radar-sweep,
  .status-dot-live,
  dialog[open] {
    animation: none !important;
  }
  button.primary::after {
    display: none;
  }
  * {
    transition: none !important;
  }
}

#balance { font-size: 20px; line-height: 1.5; }
 .maintenance-banner{position:sticky;top:0;z-index:1000;padding:12px 20px;text-align:center;background:#8b2635;color:#fff;border-bottom:1px solid #e87985;} .maintenance-banner[hidden]{display:none;}
