/* Deldown Account — dashboard. Uncodixfy aesthetic: Linear/GitHub-flat.
   Solid surfaces, 1px borders, small radius, no glass/gradient/blobs. */

[hidden] {
  display: none !important;
}

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --muted: #7d8590;
  --primary: #2f81f7;
  --primary-hover: #1f6feb;
  --link: #58a6ff;
  --green: #3fb950;
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

body.dash {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sprite {
  position: absolute;
}
.ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---- loading ---- */
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spin {
    animation-duration: 1.6s;
  }
}

/* ---- shell ---- */
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- sidebar ---- */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: var(--bg);
  border-right: 1px solid var(--border-muted);
}
.brandmark {
  font-weight: 700;
  font-size: 16px;
  padding: 6px 8px 0;
}
.brandmark span {
  color: var(--link);
}
.brandsub {
  margin: 0 0 16px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.side nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.side nav a .ic {
  width: 16px;
  height: 16px;
}
.side nav a:hover {
  color: var(--text);
  background: var(--surface);
}
.side nav a.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 2px 0 0 var(--primary);
}
.btn-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  margin-top: 4px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.btn-side .ic {
  width: 16px;
  height: 16px;
}
.btn-side:hover {
  color: var(--text);
  background: var(--surface);
}

/* ---- main ---- */
.main {
  padding: 28px clamp(20px, 4vw, 40px) 56px;
  max-width: 960px;
  width: 100%;
}
.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-muted);
}
.head-id {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--primary);
  text-transform: uppercase;
}
.hello {
  font-size: 16px;
  font-weight: 600;
}
.sub {
  color: var(--muted);
  font-size: 13px;
}
.since {
  color: var(--muted);
}
.posture {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.posture .ic {
  width: 15px;
  height: 15px;
}
.posture[data-level="good"] {
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.4);
}
.posture[data-level="warn"] {
  color: #d29922;
  border-color: rgba(210, 153, 34, 0.4);
}

/* ---- stats: one bordered strip, divided columns (not floating cards) ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 24px;
}
.stat {
  padding: 16px 18px;
  border-left: 1px solid var(--border-muted);
}
.stat:first-child {
  border-left: none;
}
.stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat-top .ic {
  width: 15px;
  height: 15px;
}
.tile {
  display: contents;
}
.lbl {
  font-size: 13px;
  font-weight: 500;
}
.num {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.stat[data-accent].off .num {
  color: var(--muted);
}

/* ---- blocks (no floating cards; flat sections separated by hairlines) ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.card-head .card-title {
  margin: 0;
}
.lead {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin: 14px 0 6px;
}
.main input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.main input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.3);
}
.main input[disabled] {
  color: var(--muted);
  background: var(--surface-2);
}
.code-input {
  letter-spacing: 4px;
  font-size: 18px !important;
  text-align: center;
  max-width: 200px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover {
  background: var(--primary-hover);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn .ic {
  width: 16px;
  height: 16px;
}
.btn.ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}
.btn.small {
  padding: 5px 10px;
  font-size: 13px;
}
.btn.danger {
  background: transparent;
  border-color: rgba(248, 81, 73, 0.4);
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* quick links — plain list rows */
.quick {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.quick-btn span {
  flex: 1;
}
.quick-btn .ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.quick-btn .ch {
  color: var(--muted);
}
.quick-btn:hover {
  background: var(--surface-2);
}

/* badge / pill — small, square-ish */
.pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.pill.on {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}
.pill.off {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* 2FA */
.steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13.5px;
}
.steps li {
  padding: 3px 0;
}
.qr-wrap {
  display: inline-block;
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
  margin: 4px 0 12px;
}
.qr {
  width: 176px;
  height: 176px;
  display: block;
}
.secret {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.secret span {
  font-size: 13px;
  color: var(--muted);
}
.secret code {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.status-line .ok {
  color: var(--green);
  width: 16px;
  height: 16px;
}
.codes {
  margin-top: 16px;
  border-top: 1px solid var(--border-muted);
  padding-top: 16px;
}
.codes pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 10px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  columns: 2;
}

/* rows (sessions, apps) */
.rows {
  display: flex;
  flex-direction: column;
}
.rowi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-muted);
}
.rowi:first-child {
  border-top: none;
}
.rowi .ricon {
  color: var(--muted);
  display: grid;
  place-items: center;
}
.rowi .ricon .ic {
  width: 18px;
  height: 18px;
}
.rowi .rmain {
  flex: 1;
  min-width: 0;
}
.rowi .t {
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rowi .d {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  background: rgba(63, 185, 80, 0.15);
  padding: 1px 7px;
  border-radius: 6px;
}
.rowi .btn {
  padding: 5px 11px;
  font-size: 13px;
}

/* storage bars */
.big-num {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.bar-top .by {
  color: var(--muted);
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border-muted);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

/* messages */
.msg {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  display: none;
}
.msg.error {
  display: block;
  background: var(--danger-bg);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #ff7b72;
}
.msg.ok {
  display: block;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--green);
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 0;
}

/* responsive */
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    padding: 8px;
    border-right: none;
    border-bottom: 1px solid var(--border-muted);
  }
  .brandmark,
  .brandsub {
    display: none;
  }
  .side nav {
    flex-direction: row;
    flex: 1;
  }
  .side nav a span {
    display: none;
  }
  .side nav a.active {
    box-shadow: inset 0 -2px 0 var(--primary);
  }
  .btn-side span {
    display: none;
  }
  .head {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    border-top: 1px solid var(--border-muted);
  }
  .stat:nth-child(-n + 2) {
    border-top: none;
  }
  .stat:nth-child(odd) {
    border-left: none;
  }
  .codes pre {
    columns: 1;
  }
}
