:root {
  --bg: #f1f5f9;
  --bg-soft: #f8fafc;
  --panel: #0f172a;
  --panel-soft: #1e293b;
  --panel-hover: #334155;
  --surface: #ffffff;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --ink: #0f172a;
  --ink-soft: #64748b;
  --ink-muted: #94a3b8;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --ok-fg: #14532d;
  --bad: #dc2626;
  --bad-bg: #fee2e2;
  --bad-fg: #7f1d1d;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --warn-fg: #78350f;
  --neutral-bg: #f1f5f9;
  --neutral-fg: #475569;
  --running-bg: #ede9fe;
  --running-fg: #4c1d95;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ─── LAYOUT ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  background: var(--panel);
  color: #e2e8f0;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-wrap {
  padding: 4px 8px;
}

.brand-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 700;
  padding: 0 8px;
  margin-bottom: 4px;
  margin-top: 4px;
}

.sidebar a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar a .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
}

.sidebar a.active {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
}

.sidebar a.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding: 8px;
  font-size: 11px;
  color: #475569;
}

/* ─── CONTENT ────────────────────────────────────────────── */
.content {
  padding: 28px 32px 40px;
  min-width: 0;
}

.topbar {
  margin-bottom: 24px;
}

.topbar-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.topbar-subtitle {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

h2 {
  margin: 28px 0 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.section-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sched-head-copy {
  max-width: 680px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.section-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  max-width: 640px;
  line-height: 1.5;
}

/* ─── STATS GRID ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  border-top: 3px solid var(--line);
  padding: 16px 18px;
}

.stat-card.success {
  border-top-color: var(--ok);
}

.stat-card.fail {
  border-top-color: var(--bad);
}

.metric-label {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.metric-value {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.metric-hint {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
}

/* ─── JOB GRID ───────────────────────────────────────────── */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.job-card {
  padding: 16px;
}

.dashboard-job-card {
  border-top: 3px solid var(--line);
  transition: box-shadow 0.15s, transform 0.15s;
}

.dashboard-job-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.dashboard-job-card.ok {
  border-top-color: var(--ok);
}

.dashboard-job-card.attention {
  border-top-color: var(--bad);
}

.dashboard-job-card.idle {
  border-top-color: #94a3b8;
}

.dashboard-job-card.off {
  border-top-color: #cbd5e1;
  opacity: 0.75;
}

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

.job-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.job-summary {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
}

.job-meta-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.job-meta-line {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.label {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 60px;
  flex-shrink: 0;
}

.job-meta-value {
  color: var(--ink-soft);
  word-break: break-word;
}

.job-run-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}

.job-run-link:hover {
  text-decoration: underline;
}

/* ─── TABLES ─────────────────────────────────────────────── */
.table-modern {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

.table-modern th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-modern td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink);
}

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

.table-modern tbody tr:hover td {
  background: #f8fafc;
}

.table-modern td form {
  margin: 0;
}

.table-modern a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.table-modern a:hover {
  text-decoration: underline;
}

.sched-table td {
  vertical-align: top;
}

/* ─── CHIPS / BADGES ─────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.chip.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.chip.bad {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.chip.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.chip.neutral {
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}

.chip.running {
  background: var(--running-bg);
  color: var(--running-fg);
}

/* ─── FORMS & INPUTS ─────────────────────────────────────── */
select,
input[type="time"],
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.logout-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 30px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
}

.login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(14, 165, 233, .09), transparent 28rem),
    radial-gradient(circle at 90% 80%, rgba(37, 99, 235, .07), transparent 25rem),
    #eef3f8;
  font-family: "Manrope", sans-serif;
}

.login-shell {
  width: min(1040px, 100%);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .14), 0 3px 12px rgba(15, 23, 42, .05);
}

.login-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 46px 50px;
  overflow: hidden;
  color: #f8fafc;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, .1), transparent 55%),
    linear-gradient(135deg, #0b172b 0%, #0d2945 54%, #075985 100%);
}

.login-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -115px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018);
}

.login-visual-glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.login-visual-glow-one {
  top: 25%;
  right: -80px;
  width: 280px;
  height: 280px;
  background: rgba(14, 165, 233, .18);
}

.login-visual-glow-two {
  left: -120px;
  bottom: -110px;
  width: 330px;
  height: 330px;
  background: rgba(37, 99, 235, .15);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.login-logo-mark svg {
  width: 24px;
  fill: none;
  stroke: #7dd3fc;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-logo strong,
.login-logo small {
  display: block;
}

.login-logo strong {
  font-size: 14px;
  letter-spacing: -.01em;
}

.login-logo small {
  margin-top: 1px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.login-visual-copy {
  max-width: 460px;
  margin: auto 0;
  padding: 60px 0;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.login-visual-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.login-visual-copy p {
  max-width: 410px;
  margin: 22px 0 0;
  color: #b9c8d9;
  font-size: 15px;
  line-height: 1.75;
}

.login-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.login-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .1);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 54px 58px;
  background: #fff;
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
}

.login-mobile-brand {
  display: none;
}

.login-heading {
  margin-bottom: 32px;
}

.login-heading h2 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.login-heading p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-field {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap > svg {
  position: absolute;
  left: 14px;
  width: 18px;
  pointer-events: none;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 46px 0 44px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}

.login-input-wrap input::placeholder {
  color: #a8b3c2;
}

.login-input-wrap input:focus {
  border-color: #0ea5e9;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .1);
}

.login-password-toggle {
  position: absolute;
  right: 8px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  color: #94a3b8;
  background: transparent;
}

.login-password-toggle:hover {
  color: #475569;
  background: #eaf0f6;
}

.login-password-toggle svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 0 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 8px 20px rgba(2, 132, 199, .2);
  transition: transform .16s, box-shadow .16s, background .16s;
}

.login-submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 12px 25px rgba(2, 132, 199, .25);
}

.login-submit svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -12px 0 22px;
  padding: 12px 13px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  background: #fff7f7;
  font-size: 12px;
  line-height: 1.5;
}

.login-alert svg {
  width: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.login-support {
  margin: 26px 0 0;
  color: #94a3b8;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 820px) {
  .login-body {
    padding: 20px;
  }

  .login-shell {
    width: min(480px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 600px;
    padding: 48px 38px;
  }

  .login-mobile-brand {
    display: block;
    margin-bottom: 14px;
    color: #0284c7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
}

@media (max-width: 480px) {
  .login-body {
    place-items: stretch;
    padding: 0;
    background: #fff;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-panel {
    align-items: center;
    min-height: 100vh;
    padding: 36px 24px;
  }

  .login-heading h2 {
    font-size: 29px;
  }
}
.alert { padding: 11px 14px; margin: 0 0 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600; }
.alert.error { color: var(--bad-fg); background: var(--bad-bg); border: 1px solid #fecaca; }
.alert.success { color: var(--ok-fg); background: var(--ok-bg); border: 1px solid #bbf7d0; }

select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

select {
  min-width: 200px;
}

input[type="text"] {
  min-width: 200px;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  min-height: 34px;
  padding: 7px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

button:hover {
  background: var(--accent-strong);
}

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

button.warn {
  background: var(--bad);
}

button.warn:hover {
  background: #b91c1c;
}

.secondary-btn {
  background: var(--panel-soft);
}

.secondary-btn:hover {
  background: var(--panel-hover);
}

.edit-btn {
  background: #334155;
}

.edit-btn:hover {
  background: #1e293b;
}

.ghost-btn {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  min-width: 0;
  justify-content: flex-start;
}

.ghost-btn:hover {
  background: var(--line);
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s;
}

.action-link:hover {
  background: var(--line);
  color: var(--ink);
}

/* ─── INLINE FORMS ───────────────────────────────────────── */
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-row-actions {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 6px;
  align-items: center;
}
.schedule-row-actions form { margin: 0; display: contents; }
.table-modern td button {
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  box-sizing: border-box;
  flex: 0 0 96px;
  justify-content: center;
}
.table-modern td form { margin: 0; }
.header-actions > button,
.header-actions > .action-link { width: 210px; height: 38px; box-sizing: border-box; }
.schedule-actions > button { width: 180px; height: 38px; box-sizing: border-box; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recipient-group { margin-bottom: 28px; }
.recipient-group-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.recipient-group-heading h3 { margin: 0; }
.secondary-btn { color: #fff; }

/* ─── SCHEDULE PAGE ──────────────────────────────────────── */
.schedule-mode-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.time-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.time-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
}

.slot-line {
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}

.schedule-note {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6vh;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 2;
  width: min(780px, 94vw);
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.modal-close {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 16px;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--line);
  color: var(--ink);
}

/* ─── SCHEDULE FORM ──────────────────────────────────────── */
.schedule-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.schedule-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  font-weight: 700;
}

.field-help {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
}

.preset-box {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.preset-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  font-weight: 700;
}

.schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.checkbox-line {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* ─── RUN DETAIL PAGE ────────────────────────────────────── */
.run-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.history-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.run-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.run-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.run-actions form {
  margin: 0;
}

.run-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 14px 16px;
}

.metric-number {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-shell {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  margin-bottom: 16px;
}

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

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #bae6fd;
}

.progress-bar {
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  animation: run-progress 1.6s ease-in-out infinite;
}

@keyframes run-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

/* ─── ERROR / CRITICAL BOX ───────────────────────────────── */
.critical-box {
  border-left: 4px solid var(--bad);
  background: #fff5f5;
  margin-bottom: 16px;
}

.critical-box h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bad);
}

.critical-foot {
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #b91c1c;
}

/* ─── LOG BOX ────────────────────────────────────────────── */
.log-shell {
  padding: 0;
  overflow: hidden;
}

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

.log-shell-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.log-meta {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: "IBM Plex Mono", monospace;
  word-break: break-all;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
}

.log-box {
  background: #0d1117;
  color: #c9d1d9;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 16px;
  overflow: auto;
  max-height: 68vh;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── STATUS HELPERS ─────────────────────────────────────── */
.status-text-ok {
  color: var(--ok);
  font-weight: 700;
}

.status-text-bad {
  color: var(--bad);
  font-weight: 700;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 220px 1fr;
  }

  .content {
    padding: 20px 20px 32px;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }

  .sidebar nav {
    flex-direction: row;
    gap: 4px;
  }

  .sidebar-footer {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .topbar-title {
    font-size: 22px;
  }

  .run-title-wrap {
    flex-direction: column;
  }

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

  .modal-head h3 {
    font-size: 18px;
  }
}
