/* creatina.wtf — dashboard. Dark, modern, green accent (#6bc310). */
:root {
  --bg:        #070907;
  --surface:   #0d100d;
  --surface-2: #111511;
  --surface-3: #151a15;
  --border:    #1e241e;
  --border-2:  #2a322a;
  --text:      #eef1ee;
  --muted:     #949d94;
  --faint:     #5c655c;
  --green:     #6bc310;
  --green-2:   #82d92a;
  --green-deep:#2f5c08;
  --green-glow:rgba(107,195,16,.25);
  --red:       #ff6b6b;
  --amber:     #e0a415;
  --r:   10px;   /* panels */
  --r-sm:8px;    /* tiles, buttons */
  --r-xs:6px;    /* chips */
  --sidebar: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.mono { font-family: var(--mono); }

/* ---------- Brand ---------- */
.brand { font-weight: 700; font-size: 19px; letter-spacing: -0.03em; color: #fff; }
.brand > span { color: var(--green); }

/* ================= App shell ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 4px 10px 22px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(107,195,16,.12), rgba(107,195,16,.03));
  color: var(--text);
  border-color: rgba(107,195,16,.18);
}
.nav-item.active svg { color: var(--green); opacity: 1; }
.nav-item.disabled { color: var(--faint); cursor: default; }
.nav-item.disabled:hover { background: transparent; color: var(--faint); }
.nav-sep {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); padding: 18px 11px 8px;
}
.badge-soon {
  margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--faint); border: 1px solid var(--border-2); border-radius: 4px; padding: 1px 5px;
}

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 34px;
  display: grid; place-items: center; font-weight: 700; color: #08210a;
  background: linear-gradient(135deg, var(--green-2), var(--green));
}
.uname { font-weight: 600; font-size: 13.5px; }
.urole { font-size: 11.5px; color: var(--faint); }
.btn-logout {
  width: 100%; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 8px; cursor: pointer; transition: all .12s;
}
.btn-logout:hover { color: var(--text); border-color: var(--green-deep); background: var(--surface-3); }

/* ================= Main ================= */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(7,9,7,.75); backdrop-filter: blur(10px); z-index: 5;
}
.topbar h1 { font-size: 19px; }
.topbar .crumb { font-size: 12px; color: var(--faint); margin-bottom: 2px; }
.content { padding: 28px 32px 56px; max-width: 1100px; width: 100%; }

/* ---------- Live status chip ---------- */
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500;
  color: var(--muted); border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 13px 6px 11px; }
.dot { width: 8px; height: 8px; border-radius: 999px; }
.dot-on  { background: var(--green); box-shadow: 0 0 0 0 var(--green-glow); animation: pulse 1.9s infinite; }
.dot-off { background: #4a514a; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(107,195,16,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(107,195,16,0); }
  100% { box-shadow: 0 0 0 0 rgba(107,195,16,0); }
}

/* ---------- KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.tile-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.tile-label svg { width: 15px; height: 15px; color: var(--faint); }
.tile-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.tile-value.ok { color: var(--green); }
.tile-value.bad { color: var(--red); }
.tile-sub { font-size: 11.5px; color: var(--faint); margin-top: 7px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 20px; scroll-margin-top: 84px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 14px; }
.panel-head .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.panel-body { padding: 6px 22px 12px; }

/* spec grid (2 columns on wide) */
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
@media (max-width: 640px) { .spec { grid-template-columns: 1fr; } }
.spec .row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.spec .row dt { color: var(--muted); font-size: 13px; }
.spec .row dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.spec .row dd .sub { color: var(--faint); font-weight: 400; }

/* ---------- Chips / pills ---------- */
.chip {
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-xs); display: inline-block;
}
.chip-ok  { color: #0a2109; background: var(--green); }
.chip-bad { color: var(--red); background: rgba(255,107,107,.10); border: 1px solid rgba(255,107,107,.3); }
.chip-plan{ color: var(--green-2); background: rgba(107,195,16,.10); border: 1px solid rgba(107,195,16,.25); }

/* ---------- Meter ---------- */
.meter { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green)); border-radius: 999px; transition: width .5s ease; }

/* ================= Login ================= */
.auth {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(900px 440px at 50% -8%, rgba(107,195,16,.09), transparent 62%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 384px; margin: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 38px 34px; box-shadow: 0 24px 60px -28px rgba(0,0,0,.75);
}
.auth-card .brand { font-size: 30px; display: block; text-align: center; }
.auth-sub { color: var(--muted); text-align: center; margin: 8px 0 26px; font-size: 13.5px; }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 11px 13px;
  transition: border-color .13s, box-shadow .13s;
}
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(107,195,16,.16); }
.btn-primary {
  width: 100%; font: inherit; font-weight: 600; color: #08210a; cursor: pointer;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  border: 0; border-radius: var(--r-sm); padding: 12px; margin-top: 6px;
  box-shadow: 0 6px 18px -8px var(--green-glow); transition: filter .13s, transform .05s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.auth-foot { color: var(--faint); font-size: 12px; text-align: center; margin: 20px 0 0; }
.alert {
  background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.28); color: #ffb4b4;
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 18px;
}

/* ================= Responsive ================= */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 6px; padding: 12px 16px; overflow-x: auto;
  }
  .sidebar .brand { padding: 0 14px 0 4px; }
  .nav { flex-direction: row; }
  .nav-sep, .badge-soon, .sidebar-foot .user { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .nav-item span.label { display: none; }  /* icons only on mobile nav */
  .content { padding: 20px 18px 48px; }
  .topbar { padding: 16px 18px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) { .tiles { grid-template-columns: 1fr; } }
