@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap");

:root {
  --bg: #f3f1ec;
  --bg-accent: #e7efe9;
  --panel: #fffcf7;
  --ink: #1c2420;
  --muted: #6b756f;
  --line: #ddd6cb;
  --line-soft: #ebe5db;
  --accent: #1f6b5a;
  --accent-soft: #d8ebe4;
  --accent-ink: #0f3f35;
  --sidebar: #16352e;
  --sidebar-muted: #9bb5ad;
  --sidebar-hover: #1e463d;
  --danger: #9f2d2d;
  --ok: #1b6b45;
  --warn: #8a6a1f;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Sora", "Manrope", sans-serif;
  --shadow: 0 1px 0 rgba(28, 36, 32, 0.04);
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, #dce8e1 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #ebe4d6 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.84em;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 2px 6px;
  border-radius: 6px;
}

.shell {
  display: block;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  /* Strip kiri selalu hijau penuh sampai bawah halaman */
  background: linear-gradient(
    to right,
    var(--sidebar) 0,
    var(--sidebar) 240px,
    transparent 240px
  );
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  height: 100vh;
  height: 100dvh;
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--sidebar);
  color: #e7f0ec;
  overflow: hidden;
  z-index: 40;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px 14px;
  margin: 0 2px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-text {
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #c8e6dc;
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--sidebar-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.nav::-webkit-scrollbar {
  width: 5px;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  color: #b7cdc5;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.12s ease, color 0.12s ease;
  flex-shrink: 0;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav a.active {
  background: #c8e6dc;
  color: var(--accent-ink);
  font-weight: 600;
}

.nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-ink);
}

.nav-label {
  margin: 0 10px 4px;
  padding: 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #7f9a91;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.2;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 4px 2px 0;
  padding: 12px 10px 4px;
  flex-shrink: 0;
}

.sidebar-foot-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7f9a91;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1px;
  line-height: 1.3;
}

.main {
  margin-left: 240px;
  padding: 32px 28px 48px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(1200px 600px at 100% -10%, #dce8e1 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #ebe4d6 0%, transparent 50%),
    var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.topbar > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 52ch;
  line-height: 1.45;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 1 auto;
  max-width: 100%;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  min-width: 0;
}

.stat-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel,
.machine-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.55;
}

.stat-card .label,
.machine-card .label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.stat-card .value {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.value.sm {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.machine-card {
  padding: 18px;
  border-left: 3px solid var(--accent);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

a.machine-card:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: var(--line);
  border-left-color: var(--accent);
}

.machine-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
}

.machine-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.pill {
  display: inline-block;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.panel {
  padding: 0;
  overflow: hidden;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.55);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-subhead {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.panel > .stack > .panel-subhead:first-child,
.two-col .stack > .panel-subhead:first-child {
  margin-top: 0;
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap table {
  width: max-content;
  min-width: 100%;
}

.class-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px 18px;
  min-width: 0;
}

.class-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.class-card-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
}

.class-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.class-card-metrics strong {
  display: block;
  font-size: 1.05rem;
  margin-top: 2px;
}

.class-card .filter-actions {
  margin-top: auto;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
  vertical-align: top;
}

th {
  background: #f7f4ef;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:hover td {
  background: rgba(216, 235, 228, 0.28);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.muted { color: var(--muted); }
.tiny { font-size: 0.76rem; line-height: 1.4; }
.note { padding: 0 18px 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: #f7f4ef;
  border-color: #cfc6b8;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: #185a4b;
  border-color: #185a4b;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

.btn.block { width: 100%; }

.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.ok { background: #d9f0e4; color: var(--ok); }
.badge.off { background: #f7e0e0; color: var(--danger); }
.badge.soft { background: #efeae2; color: #3d4742; }

.alert {
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.alert.ok {
  background: #e7f5ef;
  color: #14533a;
  border: 1px solid #b7dfc9;
}

.alert.err {
  background: #faf0f0;
  color: #7f2424;
  border: 1px solid #e8c4c4;
}

.alert ul { margin: 0; padding-left: 18px; }

.field-error {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--danger);
  font-weight: 600;
  line-height: 1.35;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tabs a {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,252,247,0.8);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}

.tabs a:hover {
  color: var(--ink);
  border-color: #cfc6b8;
}

.tabs a.active {
  background: var(--tab, var(--accent));
  border-color: var(--tab, var(--accent));
  color: #fff;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  align-items: end;
  background: rgba(255,255,255,0.4);
  min-width: 0;
  max-width: 100%;
}

.filters.filters-nested {
  border-bottom: 0;
  background: transparent;
  padding: 0;
}

.filters.filters-checks {
  grid-template-columns: 1fr;
  align-items: center;
}

.filters-checks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

.filters label,
.stack label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}

.filters input,
.filters select,
.stack input,
.stack select,
.login-card input,
.machine-card input,
td input,
td select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filters input:focus,
.filters select:focus,
.stack input:focus,
.stack select:focus,
td input:focus {
  outline: none;
  border-color: #7aa898;
  box-shadow: 0 0 0 3px rgba(31, 107, 90, 0.12);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.filters > .filter-actions {
  grid-column: 1 / -1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  min-width: 0;
}

.stack textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  resize: vertical;
}

.pager { padding: 14px 18px; }

.pagination {
  display: flex;
  gap: 14px;
  align-items: center;
}

.pagination a {
  font-weight: 600;
  color: var(--accent);
}

.pagination .disabled { color: #a8b0ab; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 80% 0%, #dce8e1, transparent),
    var(--bg);
}

.login-card {
  width: min(400px, calc(100% - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}

.login-brand { margin-bottom: 20px; }

.check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  font-weight: 500 !important;
}

.linkish {
  background: none;
  border: 0;
  color: var(--sidebar-muted);
  cursor: pointer;
  padding: 0;
  font: inherit;
}

tr.row-absent td {
  background: #faf2f0;
}

/* —— Kalender absensi —— */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.82rem;
  color: var(--muted);
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cal-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.cal-dot.sd { background: #2a9d8f; }
.cal-dot.smp { background: #3d6b8a; }
.cal-dot.sma { background: #8a6d3d; }

.cal-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.cal-badge.holiday { background: #f8e4e4; color: #9f2d2d; }
.cal-badge.weekend { background: #efeae2; color: #6b756f; }
.cal-badge.today { background: #d8ebe4; color: #0f3f35; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  min-width: 0;
}

.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px;
}

.cal-cell {
  min-height: 118px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cal-cell.empty {
  background: transparent;
  border-color: transparent;
  min-height: 0;
}

.cal-cell.is-weekend {
  background: #f7f4ef;
}

.cal-cell.is-holiday {
  background: #ef4444;
  border-color: #dc2626;
  color: #fff;
}

.cal-cell.is-holiday .cal-daynum {
  color: #fff;
}

.cal-cell.is-holiday.is-today {
  box-shadow: inset 0 0 0 2px #fef08a;
}

.cal-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cal-daynum {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
}

.cal-holiday-name {
  font-size: 0.72rem;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
  margin-top: 4px;
}

.cal-units {
  display: grid;
  gap: 3px;
  margin-top: auto;
}

.cal-unit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 5px;
  gap: 4px;
  min-width: 0;
}

.cal-unit span {
  opacity: 0.85;
  font-weight: 600;
}

.cal-unit strong {
  font-variant-numeric: tabular-nums;
}

.cal-unit.sd { background: rgba(42, 157, 143, 0.14); color: #1a6b61; }
.cal-unit.smp { background: rgba(61, 107, 138, 0.14); color: #2a4f66; }
.cal-unit.sma { background: rgba(138, 109, 61, 0.16); color: #6a5228; }

.cal-late {
  font-size: 0.64rem;
  color: #9f2d2d;
  line-height: 1.25;
}

.cal-total {
  margin-top: 2px;
}

.holiday-edit summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
}

.holiday-edit summary::-webkit-details-marker { display: none; }

.holiday-summary-row {
  display: grid;
  grid-template-columns: 100px 1.4fr auto auto 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

@media (max-width: 1100px) {
  .cal-grid {
    gap: 6px;
    padding: 10px;
  }
  .cal-cell {
    min-height: 100px;
    padding: 6px;
  }
  .cal-unit span { display: none; }
}

@media (max-width: 720px) {
  .cal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cal-dow { display: none; }
  .holiday-summary-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .stat-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— Hub page: status, explain, cleanup —— */
.hub-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.hub-status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.hub-status-card .kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.hub-status-card .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.hub-status-card .title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.hub-status-card .meta {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.hub-status-card .meta strong {
  color: var(--ink);
  font-weight: 600;
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.explain-card {
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.explain-card.keep {
  background: linear-gradient(180deg, #f3faf6 0%, var(--panel) 48%);
  border-color: #c5e0d2;
}

.explain-card.remove {
  background: linear-gradient(180deg, #faf6f0 0%, var(--panel) 48%);
  border-color: #e2d5c4;
}

.explain-card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.explain-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.explain-card li + li {
  margin-top: 4px;
}

.explain-card .lead {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.45;
  font-weight: 500;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 18px;
}

.flow-step {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
  min-width: 0;
}

.flow-step .step-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.flow-step h4 {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.flow-step p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.machine-ip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.machine-ip-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.machine-ip-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.machine-ip-card .fields {
  display: grid;
  gap: 8px;
}

.machine-ip-card label span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.cmd-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cmd-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 1fr) 100px 90px;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem;
}

.cmd-row:last-child {
  border-bottom: 0;
}

.cmd-row:hover {
  background: rgba(216, 235, 228, 0.28);
}

.cmd-row .id {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}

.cmd-row .cmd-name {
  font-weight: 600;
}

.cmd-row .result {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.pending { background: #f3ead4; color: #7a5c12; }
.badge.sent { background: #dde8f3; color: #2a4f66; }
.badge.done { background: #d9f0e4; color: var(--ok); }
.badge.failed { background: #f7e0e0; color: var(--danger); }

.cleanup-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.cleanup-banner .copy {
  flex: 1 1 280px;
  min-width: 0;
}

.cleanup-banner .copy h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}

.cleanup-banner .copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 54ch;
}

.cleanup-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f0ebe3;
  font-size: 0.76rem;
  font-weight: 600;
  color: #3d4742;
}

.chip .n {
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}

.btn.warn {
  background: #8a6a1f;
  border-color: #8a6a1f;
  color: #fff;
}

.btn.warn:hover {
  background: #725816;
  border-color: #725816;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .hub-hero,
  .explain-grid,
  .flow-steps,
  .machine-ip-grid {
    grid-template-columns: 1fr;
  }
  .cmd-row {
    grid-template-columns: 48px 1fr;
    gap: 6px 10px;
  }
  .cmd-row .result,
  .cmd-row .when {
    grid-column: 2;
  }
}

@media (max-width: 980px) {
  .shell {
    background: none;
  }
  .sidebar {
    position: relative;
    width: auto;
    height: auto;
    max-height: none;
    inset: auto;
    overflow: visible;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 14px 12px 10px;
  }
  .brand {
    margin-bottom: 10px;
    padding-bottom: 12px;
  }
  .nav {
    overflow: visible;
    min-height: 0;
    flex: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }
  .nav-group {
    min-width: 0;
  }
  .sidebar-foot {
    margin-top: 10px;
  }
  .main {
    margin-left: 0;
    padding: 22px 16px 36px;
  }
  .machine-grid,
  .stat-grid,
  .stat-grid.cols-4,
  .two-col,
  .filters { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
}
