:root {
  color: #172026;
  background: #f4f8f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #172026;
  --muted: #6f7e82;
  --line: #dbe5e3;
  --panel: rgba(255, 255, 255, 0.88);
  --teal: #0f766e;
  --teal-dark: #115e59;
  --red: #c2413b;
  --red-dark: #a9322e;
  --shadow: 0 18px 45px rgba(26, 54, 50, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.6; }

.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 28px; }
.brand-block { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 10px 18px rgba(23, 32, 38, 0.18); }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 22px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 17px; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: 0; font-size: 14px; }

.panel { border: 1px solid rgba(219, 229, 227, .9); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.login-panel { width: min(440px, 100%); padding: 28px; }
.panel-heading, .toolbar, .status-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading { margin-bottom: 22px; }
.stack-form, .detail-panel label { display: grid; gap: 9px; color: #435257; font-size: 13px; font-weight: 700; }
.stack-form { gap: 16px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #fff; color: var(--ink); padding: 12px 13px; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15, 118, 110, .12); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 0 17px; font-size: 13px; font-weight: 800; transition: transform .2s, background .2s, border-color .2s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button--primary { background: var(--teal); color: #fff; }
.button--primary:hover:not(:disabled) { background: var(--teal-dark); }
.button--danger { background: var(--red); color: #fff; }
.button--danger:hover:not(:disabled) { background: var(--red-dark); }
.button--ghost { border-color: var(--line); background: #fff; color: #425156; }
.button--ghost:hover:not(:disabled) { border-color: #a8c2bd; background: #f8fbfa; }
.form-error { min-height: 20px; margin: 0; color: var(--red-dark); font-size: 13px; }

.dashboard { display: grid; gap: 20px; }
.toolbar { align-items: center; padding: 4px 2px 0; }
.toolbar h2 { margin-bottom: 0; }
.status-panel { align-items: center; padding: 28px; }
.status-line { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #b8c2c2; }
.status-dot--on { background: #169c78; box-shadow: 0 0 0 5px rgba(22, 156, 120, .13); }
.status-dot--off { background: var(--red); box-shadow: 0 0 0 5px rgba(194, 65, 59, .13); }
.status-dot--muted { background: #b8c2c2; }
.status-copy h2 { margin-bottom: 7px; }
.status-copy p { margin-bottom: 0; }
.state-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.version-badge { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-panel { padding: 24px; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.notes { display: grid; gap: 14px; margin: 0; padding: 0 0 0 19px; color: #506064; font-size: 13px; line-height: 1.6; }
.audit-panel { padding: 24px; }
.audit-panel .panel-heading { align-items: center; margin-bottom: 16px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 12px; }
th, td { padding: 13px 14px; border-bottom: 1px solid #edf2f1; text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f8fbfa; font-size: 11px; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
.empty-cell { padding: 28px; color: var(--muted); text-align: center; }
footer { margin-top: 26px; color: #91a09f; font-size: 11px; text-align: center; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 560px); padding-top: 30px; }
  .status-panel, .toolbar { align-items: flex-start; flex-direction: column; }
  .state-actions { justify-content: flex-start; }
  .grid-two { grid-template-columns: 1fr; }
  .toolbar .button { align-self: flex-start; }
}
