@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --color-primary: #0f172a;
  --color-on-primary: #ffffff;
  --color-secondary: #1e293b;
  --color-accent: #22c55e;
  --color-background: #020617;
  --color-foreground: #f8fafc;
  --color-muted: #1a1e2f;
  --color-border: #334155;
  --color-destructive: #ef4444;
  --color-ring: #22c55e;

  --bg: #020617;
  --bg-elevated: #07101f;
  --surface: #0b1220;
  --surface-2: #101827;
  --surface-3: #172033;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.34);
  --ink: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #22c55e;
  --accent-2: #38bdf8;
  --warning: #f59e0b;
  --danger: #ef4444;
  --violet: #a78bfa;
  --radius: 8px;
  --sidebar-width: 276px;
  --shadow-control: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

html {
  color-scheme: dark;
}

body {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0, var(--bg) 320px);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--ink);
  font-family: "Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-width: 320px;
}

body::before {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.018) 0,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 5px
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

a:hover {
  color: #bae6fd;
}

:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
}

::selection {
  background: rgba(34, 197, 94, 0.35);
  color: var(--ink);
}

.container-fluid {
  padding-left: 0;
  padding-right: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  align-self: stretch;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98)),
    var(--bg-elevated);
  border-right: 1px solid var(--line);
  min-height: 100dvh;
  overflow: hidden;
  position: sticky;
  top: 0;
}

.sidebar::after {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.42), rgba(56, 189, 248, 0.08), transparent);
  content: "";
  height: 260px;
  position: absolute;
  right: -1px;
  top: 0;
  width: 1px;
}

.sidebar-head {
  border-bottom: 1px solid var(--line);
  padding: 22px 18px 16px;
  position: relative;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: #071410;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: var(--radius);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.14);
  color: var(--accent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.brand-mark svg,
[data-lucide] {
  height: 18px;
  stroke-width: 1.8;
  width: 18px;
}

.sidebar-title {
  color: var(--ink);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.sidebar-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0 0;
}

.sidebar-status {
  align-items: center;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: var(--radius);
  color: #bbf7d0;
  display: flex;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 10px;
}

.status-dot {
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12), 0 0 18px rgba(34, 197, 94, 0.5);
  display: inline-block;
  flex: 0 0 auto;
  height: 8px;
  width: 8px;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 12px;
}

.sidebar-nav a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #cbd5e1;
  display: grid;
  gap: 10px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 9px 10px;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar-nav a:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--ink);
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(56, 189, 248, 0.08));
  border-color: rgba(34, 197, 94, 0.36);
  color: #ecfdf5;
  font-weight: 600;
}

.sidebar-nav a.active [data-lucide] {
  color: var(--accent);
}

.sidebar-nav span {
  color: var(--muted-2);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  bottom: 0;
  left: 0;
  padding: 14px 12px 18px;
  position: absolute;
  right: 0;
}

.content-shell {
  min-width: 0;
  padding: 18px clamp(16px, 2vw, 30px) 32px;
}

.topbar {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 18, 32, 0.76);
  box-shadow: var(--shadow-control);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 48px;
  padding: 10px 12px;
}

.topbar-meta,
.topbar-actions,
.terminal-chip {
  align-items: center;
  display: flex;
  gap: 8px;
}

.topbar-meta {
  color: var(--muted);
  flex-wrap: wrap;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.terminal-chip {
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #dbeafe;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 9px;
}

.page-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-head h1,
.page-head h2,
.section h2,
.section-head h2 {
  color: var(--ink);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 650;
  letter-spacing: 0;
}

.page-head h1,
.page-head h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
  margin: 0 0 8px;
}

.page-subtle {
  color: var(--muted);
  font-size: 14px;
}

.toolbar,
.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.surface,
.section,
.metric {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(8, 13, 24, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-control);
}

.section {
  padding: 18px;
}

.section + .section {
  margin-top: 16px;
}

.section-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: -2px 0 16px;
  padding-bottom: 12px;
}

.section h2,
.section-head h2 {
  font-size: 17px;
  margin: 0 0 12px;
}

.section-head h2 {
  margin: 0;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.metric {
  min-height: 112px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.metric::before {
  background: var(--accent);
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.metric:nth-child(3n + 2)::before {
  background: var(--accent-2);
}

.metric:nth-child(3n)::before {
  background: var(--warning);
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.metric strong {
  color: var(--ink);
  display: block;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(26px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 18px rgba(34, 197, 94, 0.12);
}

.metric small,
.metric .metric-note {
  color: var(--muted-2);
  display: block;
  font-size: 12px;
  margin-top: 12px;
}

.info-list {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: 132px minmax(0, 1fr);
  margin: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.info-list dd {
  color: #e2e8f0;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.table-responsive {
  background: rgba(2, 6, 23, 0.36);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-hover-bg: rgba(34, 197, 94, 0.055);
  --bs-table-hover-color: var(--ink);
  color: #e2e8f0;
  margin-bottom: 0;
  min-width: 720px;
}

.table thead th {
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid var(--line-strong);
  color: #93a4b8;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.table > :not(caption) > * > * {
  background-color: transparent;
  border-bottom-color: rgba(148, 163, 184, 0.13);
  padding: 0.82rem 0.85rem;
  vertical-align: middle;
}

.table tbody td {
  color: #dbe4ef;
  font-size: 13px;
}

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

.table tbody tr.table-group-row td {
  background: rgba(14, 165, 233, 0.08);
  border-bottom-color: rgba(56, 189, 248, 0.2);
  border-top: 1px solid rgba(56, 189, 248, 0.18);
  padding-bottom: 0.68rem;
  padding-top: 0.68rem;
}

.group-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-title span,
.group-title small {
  color: var(--muted-2);
  font-size: 12px;
}

.group-title strong {
  color: #bae6fd;
  font-size: 13px;
  font-weight: 700;
}

.table td:first-child,
.table th:first-child {
  padding-left: 1rem;
}

.table td:last-child,
.table th:last-child {
  padding-right: 1rem;
}

.btn {
  align-items: center;
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 650;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.btn-sm {
  min-height: 32px;
}

.btn-primary,
.btn-success {
  --bs-btn-bg: #16a34a;
  --bs-btn-border-color: rgba(34, 197, 94, 0.56);
  --bs-btn-color: #04130a;
  --bs-btn-hover-bg: #22c55e;
  --bs-btn-hover-border-color: #4ade80;
  --bs-btn-hover-color: #021006;
  --bs-btn-active-bg: #15803d;
  --bs-btn-active-border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08), 0 12px 28px rgba(34, 197, 94, 0.18);
}

.btn-outline-primary,
.btn-outline-success {
  --bs-btn-color: #86efac;
  --bs-btn-border-color: rgba(34, 197, 94, 0.42);
  --bs-btn-hover-bg: rgba(34, 197, 94, 0.14);
  --bs-btn-hover-border-color: rgba(74, 222, 128, 0.74);
  --bs-btn-hover-color: #dcfce7;
  --bs-btn-active-bg: rgba(34, 197, 94, 0.2);
}

.btn-outline-secondary {
  --bs-btn-color: #cbd5e1;
  --bs-btn-border-color: rgba(148, 163, 184, 0.32);
  --bs-btn-hover-bg: rgba(148, 163, 184, 0.12);
  --bs-btn-hover-border-color: rgba(203, 213, 225, 0.44);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: rgba(148, 163, 184, 0.18);
}

.btn-outline-warning {
  --bs-btn-color: #fbbf24;
  --bs-btn-border-color: rgba(245, 158, 11, 0.44);
  --bs-btn-hover-bg: rgba(245, 158, 11, 0.16);
  --bs-btn-hover-border-color: rgba(251, 191, 36, 0.7);
  --bs-btn-hover-color: #fde68a;
}

.btn-outline-danger {
  --bs-btn-color: #fca5a5;
  --bs-btn-border-color: rgba(239, 68, 68, 0.46);
  --bs-btn-hover-bg: rgba(239, 68, 68, 0.16);
  --bs-btn-hover-border-color: rgba(248, 113, 113, 0.76);
  --bs-btn-hover-color: #fee2e2;
}

.form-label {
  color: #9fb0c8;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
}

.form-section-title {
  align-items: center;
  border-top: 1px solid var(--line);
  color: #dbe4ef;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0;
  margin-top: 2px;
  padding-top: 14px;
}

.form-section-title [data-lucide] {
  color: var(--accent-2);
  height: 16px;
  width: 16px;
}

.form-control,
.form-select {
  background-color: rgba(2, 6, 23, 0.68);
  border-color: var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 40px;
}

.form-control-sm {
  min-height: 32px;
}

.form-control::placeholder {
  color: #64748b;
}

.form-text {
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 6px;
}

.form-control:focus,
.form-select:focus {
  background-color: rgba(2, 6, 23, 0.9);
  border-color: rgba(34, 197, 94, 0.72);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.12);
  color: var(--ink);
}

.form-select option {
  background: #0f172a;
  color: var(--ink);
}

.channel-picker {
  display: grid;
  gap: 6px;
}

.channel-search {
  background-color: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  min-height: 34px;
}

.channel-label {
  color: #dbeafe;
  font-weight: 650;
}

.form-check-input {
  background-color: rgba(2, 6, 23, 0.8);
  border-color: var(--line-strong);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.check-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.settings-note {
  align-items: flex-start;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius);
  color: #c7e6f7;
  display: flex;
  gap: 9px;
  padding: 10px 12px;
}

.settings-note [data-lucide] {
  color: var(--accent-2);
  flex: 0 0 auto;
  margin-top: 1px;
}

.check-row label {
  align-items: center;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  color: #dbe4ef;
  display: inline-flex;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
}

.list-compact {
  display: grid;
  gap: 8px;
}

.list-compact > div {
  align-items: center;
  background: rgba(148, 163, 184, 0.055);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
}

.list-compact span {
  color: #dbe4ef;
  overflow-wrap: anywhere;
}

.list-compact small {
  color: var(--muted-2);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.list-compact strong {
  color: #a7f3d0;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.queue-limit {
  color: var(--muted-2);
  font-size: 12px;
}

.queue-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.queue-summary span {
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  color: #b8c7da;
  font-size: 12px;
  padding: 9px 10px;
}

.queue-summary strong {
  color: #dbeafe;
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.queue-list {
  display: grid;
  gap: 9px;
}

.queue-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-left: 3px solid rgba(148, 163, 184, 0.42);
  border-radius: var(--radius);
  padding: 10px 11px;
}

.queue-item-running {
  background: rgba(34, 197, 94, 0.08);
  border-left-color: #22c55e;
}

.queue-item-pending {
  border-left-color: #38bdf8;
}

.queue-item-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.queue-item-head a {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.queue-status {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: #dbeafe;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.queue-item-running .queue-status {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(74, 222, 128, 0.38);
  color: #bbf7d0;
}

.queue-item-pending .queue-status {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.34);
  color: #bae6fd;
}

.queue-item-meta {
  color: var(--muted-2);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 7px;
  margin-top: 6px;
}

.queue-item-meta span + span::before {
  color: rgba(148, 163, 184, 0.62);
  content: "/";
  margin-right: 7px;
}

.queue-progress {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 9px;
}

.queue-progress strong {
  color: #dbeafe;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 650;
  min-width: 34px;
  text-align: right;
}

.queue-progress-bar {
  background: rgba(2, 6, 23, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.queue-progress-bar span {
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 2px;
  transition: width 180ms ease-out;
}

.queue-item-pending .queue-progress-bar span {
  background: #38bdf8;
}

.queue-stage {
  align-items: baseline;
  color: #dbe4ef;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px;
  margin-top: 7px;
}

.queue-stage span {
  font-weight: 650;
}

.queue-stage small {
  color: var(--muted-2);
  overflow-wrap: anywhere;
}

.queue-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.queue-metrics:empty {
  display: none;
}

.queue-metrics span {
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: #cbd5e1;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1;
  padding: 5px 7px;
}

.queue-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.rotation-panel {
  padding: 18px;
}

.rotation-panel-layout {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1fr) auto minmax(150px, 0.34fr) minmax(140px, 0.28fr) auto;
}

.rotation-copy {
  display: grid;
  gap: 5px;
}

.rotation-copy > span {
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rotation-copy small {
  color: var(--muted-2);
  line-height: 1.55;
  max-width: 620px;
}

.rotation-toggle,
.rotation-field {
  display: grid;
  gap: 6px;
}

.rotation-toggle {
  align-items: center;
  color: #dbeafe;
  grid-template-columns: auto auto;
  min-height: 44px;
}

.rotation-toggle input {
  accent-color: #22c55e;
  height: 18px;
  width: 36px;
}

.rotation-field > span,
.rotation-toggle span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 650;
}

.rotation-input-unit {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
}

.rotation-input-unit .form-control {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  min-width: 0;
}

.rotation-input-unit em {
  align-items: center;
  align-self: stretch;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-left: 0;
  border-bottom-right-radius: var(--radius);
  border-top-right-radius: var(--radius);
  color: var(--muted-2);
  display: inline-flex;
  font-size: 12px;
  font-style: normal;
  padding: 0 10px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .rotation-panel-layout {
    grid-template-columns: 1fr 1fr;
  }

  .rotation-copy,
  .rotation-panel-layout .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .rotation-panel-layout {
    grid-template-columns: 1fr;
  }
}

.queue-empty {
  background: rgba(148, 163, 184, 0.055);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: var(--radius);
  color: var(--muted-2);
  padding: 12px;
}

.maintenance-note {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0 0;
}

.countdown-cell {
  min-width: 132px;
}

.countdown-cell small {
  color: var(--muted-2);
  display: block;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  margin-top: 4px;
  white-space: nowrap;
}

.countdown-chip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius);
  color: #bae6fd;
  display: inline-flex;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 650;
  min-width: 74px;
  padding: 5px 8px;
}

.badge {
  border-radius: 999px;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 650;
  padding: 0.45em 0.72em;
}

.text-bg-success {
  background-color: rgba(34, 197, 94, 0.18) !important;
  border: 1px solid rgba(34, 197, 94, 0.42);
  color: #bbf7d0 !important;
}

.text-bg-secondary {
  background-color: rgba(100, 116, 139, 0.18) !important;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1 !important;
}

.text-muted {
  color: var(--muted) !important;
}

.text-danger {
  color: #fca5a5 !important;
}

.small,
small {
  font-size: 12px;
}

.alert {
  border-radius: var(--radius);
  border-width: 1px;
  color: var(--ink);
}

.alert-info {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.34);
  color: #bae6fd;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.34);
  color: #bbf7d0;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.34);
  color: #fecaca;
}

.login-wrap {
  display: grid;
  min-height: calc(100dvh - 48px);
  padding: 24px;
  place-items: center;
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-control);
  max-width: 440px;
  padding: 28px;
  position: relative;
  width: 100%;
}

.login-panel::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.login-panel h1 {
  color: var(--ink);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 24px;
  margin-bottom: 16px;
}

.login-panel .form-control {
  min-height: 44px;
}

.log-view {
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--radius);
  color: #cbd5e1;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  min-height: 560px;
  overflow: auto;
  padding: 16px;
}

.log-view div {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  padding: 3px 0;
}

.log-view div:last-child {
  border-bottom: 0;
}

.kpi-rail {
  display: grid;
  gap: 10px;
}

.route-flow {
  align-items: center;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-arrow {
  color: var(--accent);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .sidebar-foot {
    position: static;
  }

  .sidebar-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-nav a {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .sidebar-nav span {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .content-shell {
    padding: 14px 12px 24px;
  }

  .topbar,
  .page-head,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .section {
    padding: 14px;
  }

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

  .info-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .sidebar-nav a {
    min-height: 38px;
    padding: 8px;
  }

  .toolbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .btn,
  .actions .btn,
  .actions form {
    width: 100%;
  }
}
