/* Dashboard styling — dark, dense, operator-focused. */

:root {
  --bg: #0a0b10;
  --panel: #14161f;
  --panel-2: #1b1e2a;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --muted: rgba(238, 240, 246, 0.55);
  --accent: #7c5cff;
  --accent-2: #b079ff;
  --good: #4fd08a;
  --bad: #e0566b;
  --warn: #f2c14e;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
h1,
h2,
h3 {
  margin: 0;
}
h2 {
  font-size: 15px;
  font-weight: 700;
}
h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 14px 0 8px;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
select {
  font-family: inherit;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  width: 100%;
}
input[type='color'] {
  padding: 2px;
  height: 34px;
}
input[type='checkbox'] {
  width: auto;
}

/* ------------------------------- login ------------------------------- */
.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(80% 60% at 50% 30%, rgba(124, 92, 255, 0.12), transparent), var(--bg);
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.login-card h1 {
  font-size: 22px;
}
.login-card button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  font-weight: 700;
}
.login-error {
  color: var(--bad);
  min-height: 16px;
  font-size: 13px;
}

/* ------------------------------ topbar ------------------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.logo {
  color: var(--accent-2);
}
.pills {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pill-good {
  background: rgba(79, 208, 138, 0.16);
  color: var(--good);
}
.pill-bad {
  background: rgba(224, 86, 107, 0.16);
  color: var(--bad);
}
.pill-mut {
  color: var(--muted);
}

/* ------------------------------- grid -------------------------------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 880px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
.col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* buttons */
.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
}
.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
}
.btn-ghost.danger {
  color: var(--bad);
}
.btn:active,
.btn-ghost:active {
  transform: translateY(1px);
}

.tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}

/* ------------------------------- now --------------------------------- */
.now-empty {
  padding: 12px 0;
}
.now-name {
  font-size: 30px;
  font-weight: 800;
}
.now-label {
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 13px;
  margin-top: 2px;
}
.now-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
}
.now-remaining {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 800;
}
.chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chip-warn {
  background: rgba(242, 193, 78, 0.18);
  color: var(--warn);
}
.bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
}
.now-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.now-controls .btn {
  flex: 1;
}

/* ------------------------------ queue -------------------------------- */
.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qitem {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.qitem .qname {
  font-weight: 700;
}
.qitem .qmeta {
  color: var(--muted);
  font-size: 12px;
}
.qitem .grow {
  flex: 1;
  min-width: 0;
}
.qitem .qdur {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}
.iconbtn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.iconbtn.x {
  color: var(--bad);
}
.emph-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.emph-medium {
  background: #6ec1ff;
}
.emph-strong {
  background: var(--accent-2);
}
.emph-max {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

/* ------------------------------ forms -------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid.colors {
  grid-template-columns: repeat(5, 1fr);
}
.form-grid label,
.row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.form-grid label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.row {
  display: flex;
  align-items: flex-end;
}
.row.gap {
  gap: 8px;
  margin-top: 10px;
}

/* ----------------------------- link overlay -------------------------- */
.link-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 4px;
}
.ov-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 8px 12px;
}
.ov-url {
  flex: 1;
  min-width: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent-2);
  overflow-x: auto;
  white-space: nowrap;
}
.ov-url-box .btn-ghost {
  flex: none;
}
.link-hint {
  margin-top: 10px;
  line-height: 1.5;
}
.link-hint code {
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ------------------------------- log --------------------------------- */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}
.log-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--panel-2);
}
.log-item .ldim {
  color: var(--muted);
}
