/* AutoDM dashboard — dark, clean SaaS look */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --border: #2b3442;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #7c5cff;
  --accent2: #4f8cff;
  --green: #2ea043;
  --red: #f85149;
  --amber: #d29922;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h3 { margin: 0 0 10px; font-size: 15px; }
code { background: var(--panel2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--panel); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: .3px; padding: 0 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a {
  color: var(--muted); padding: 9px 12px; border-radius: 8px; font-weight: 500;
}
.sidebar nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.content { flex: 1; padding: 28px 32px; max-width: 1100px; }

/* cards & pages */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card.stat { text-align: center; padding: 16px 10px; margin: 0; }
.card.stat .num { font-size: 26px; font-weight: 800; }
.card.stat .lbl { color: var(--muted); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .sidebar { width: 64px; } .sidebar nav a, .brand, .sidebar-foot { font-size: 0; } }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.payload { white-space: pre-wrap; word-break: break-all; font-size: 11.5px; color: var(--muted); max-height: 220px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 8px; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; }
label.check { flex-direction: row; align-items: center; gap: 10px; }
input, select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0; }
legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
@media (max-width: 700px) { .row2 { grid-template-columns: 1fr; } }
.codebox { display: block; background: var(--bg); border: 1px dashed var(--border); padding: 10px 12px; border-radius: 8px; word-break: break-all; }

/* buttons */
.btn {
  display: inline-block; background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; text-align: center;
}
.btn:hover { filter: brightness(1.2); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: 0; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.big { padding: 13px 22px; font-size: 15px; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }

/* badges, flash, misc */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.badge.demo { background: rgba(210,153,34,.15); color: var(--amber); }
.badge.live { background: rgba(46,160,67,.15); color: #3fb950; }
.badge.ok { background: rgba(46,160,67,.15); color: #3fb950; }
.badge.err { background: rgba(248,81,73,.15); color: var(--red); }
.badge.type { background: rgba(124,92,255,.15); color: #a78bfa; }
.flash { padding: 12px 16px; border-radius: 8px; margin: 10px 32px; font-weight: 500; }
.flash.success { background: rgba(46,160,67,.15); color: #3fb950; }
.flash.error { background: rgba(248,81,73,.15); color: var(--red); }
.flash.info { background: rgba(79,140,255,.12); color: var(--accent2); }

/* auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 100%; max-width: 560px; }
.auth-card.slim { max-width: 400px; }
.brand-big { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.syscheck { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; padding: 12px 16px; }
.syscheck .ok { color: #3fb950; font-weight: 700; }
.syscheck .err { color: var(--red); font-weight: 700; }

/* checklist + funnel + switch */
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { padding: 7px 0 7px 28px; position: relative; color: var(--muted); border-bottom: 1px dashed var(--border); }
.checklist li::before { content: "○"; position: absolute; left: 4px; }
.checklist li.done { color: var(--text); }
.checklist li.done::before { content: "✓"; color: #3fb950; font-weight: 700; }
.funnel-cell { min-width: 180px; }
.funnel { display: flex; flex-direction: column; gap: 3px; }
.funnel .bar { height: 7px; border-radius: 4px; background: var(--accent2); opacity: .35; }
.funnel .bar.mid { background: var(--accent); opacity: .6; }
.funnel .bar.hot { background: #3fb950; opacity: 1; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 20px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }
