:root {
  --bg: #10151c;
  --bg-2: #171e27;
  --bg-3: #1e2733;
  --line: #2c3848;
  --text: #e8eef6;
  --muted: #8ea0b5;
  --mint: #6ee7b7;
  --mint-2: #12362c;
  --blue: #8eb6ff;
  --bad: #fb7185;
  --warn: #fbbf24;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  font-family: "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(110, 231, 183, 0.08), transparent 50%),
    var(--bg);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); }
.card, .panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card { padding: 28px; }
.login-card h1 { margin: 12px 0 6px; font-size: 28px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: var(--mint-2); color: var(--mint); font-weight: 700;
}
label { display: grid; gap: 6px; margin: 14px 0; font-size: 13px; color: var(--muted); }
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #3f6f62; }
button.primary, button.ghost, button.danger, .icon-btn {
  border: 0; border-radius: 10px; padding: 10px 14px;
}
button.primary { background: var(--mint); color: #06281d; font-weight: 700; }
button.ghost { background: var(--bg-3); border: 1px solid var(--line); }
button.danger { background: #3a1c24; color: #ffd0d7; }
button:disabled { opacity: 0.45; cursor: default; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside {
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px;
  background: rgba(12, 16, 22, 0.7);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand strong { display: block; }
.brand span { color: var(--muted); font-size: 13px; }
nav { display: grid; gap: 4px; }
nav button {
  text-align: left; background: transparent; border: 0; color: var(--muted);
  border-radius: 10px; padding: 10px 12px;
}
nav button.active, nav button:hover { background: var(--bg-3); color: var(--text); }
.account {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account button { padding: 8px 10px; }
.runtime { font-size: 12px; color: var(--muted); line-height: 1.45; }
.workspace { padding: 22px 26px 40px; min-width: 0; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.top h1 { margin: 0; font-size: 26px; }
.top p { margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters, .bulk {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center;
}
.filters input, .filters select { min-width: 140px; }
.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 230px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: #1a222c; color: var(--muted); font-weight: 600; font-size: 12px; }
tr:hover td { background: rgba(255,255,255,0.02); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 8px; background: var(--bg-3); font-size: 12px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--mint); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; padding: 0; background: var(--bg-3); border: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.stat b { display: block; font-size: 22px; margin-top: 4px; }
.detail { margin-top: 16px; }
.modal-back {
  position: fixed; inset: 0; background: rgba(5, 8, 12, 0.72);
  display: grid; place-items: center; padding: 20px; z-index: 20;
}
.modal {
  width: min(860px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: #161d26;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.days { display: flex; gap: 6px; overflow: auto; margin: 8px 0 14px; }
.days button { background: transparent; border: 0; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid transparent; }
.days button.active { color: var(--text); border-color: var(--mint); }
.timeline { display: grid; gap: 0; }
.event { display: grid; grid-template-columns: 1fr 16px auto; gap: 10px; align-items: center; min-height: 36px; }
.event i { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(110,231,183,.12); justify-self: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 30; }
.toast { background: #223042; border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; max-width: 360px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button.active { background: var(--mint-2); color: var(--mint); }
.empty { padding: 28px; color: var(--muted); }
.linkish { background: none; border: 0; color: var(--blue); padding: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  nav { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .workspace { padding: 16px; }
}
