/* DankProxies control panel.
   Shares the visual language of the public site (site/style.css) so the
   marketing pages and the portal read as one product. */

:root {
  --bg: #0b0b0d;
  --panel: #141418;
  --panel-2: #1b1b21;
  --line: #2a2a32;
  --line-soft: #22222a;
  --text: #ececf0;
  --muted: #9b9ba6;
  --dim: #6f6f7a;
  --accent: #e01e26;
  --accent-2: #ff3b43;
  --ok: #3fbf5a;
  --warn: #e0a129;
  --info: #4a9eff;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; letter-spacing: -.3px; }
h2 { font-size: 1.15rem; margin: 0 0 .9rem; letter-spacing: -.2px; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .8rem; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,11,13,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.4rem;
  height: 60px; display: flex; align-items: center; gap: 1.6rem;
}
.brand {
  font-weight: 800; letter-spacing: .4px; color: var(--text); font-size: 1.02rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.brand-logo { height: 36px; width: auto; display: block; }
.brand span { color: var(--accent); }
.brand small { color: var(--dim); font-weight: 500; letter-spacing: 0; margin-left: .1rem; }
.auth .brand { justify-content: center; }
.auth .brand-logo { height: 40px; }
.topnav { display: flex; gap: .3rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topnav a {
  color: var(--muted); font-size: .92rem; padding: .42rem .75rem;
  border-radius: 7px; white-space: nowrap;
}
.topnav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.topnav a.active { color: var(--text); background: var(--panel-2); }
.topnav form { margin: 0; }

.layout { max-width: 1200px; margin: 0 auto; padding: 1.8rem 1.4rem 4rem; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 0; font-size: .95rem; }
.page-head .spacer { margin-left: auto; }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.1rem;
}
.card.tight { padding: 1rem 1.1rem; }
.card-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }

.grid { display: grid; gap: 1.1rem; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- stat tiles ---------- */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .7px; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin: .3rem 0 .1rem; letter-spacing: -.5px; }
.stat .value.sm { font-size: 1.25rem; }
.stat .foot { color: var(--dim); font-size: .85rem; }

/* ---------- usage meter ---------- */
.meter { background: #0e0e12; border: 1px solid var(--line); border-radius: 7px; height: 12px; overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; }
.meter .used { background: var(--ok); }
.meter .used.warn { background: var(--warn); }
.meter .used.over { background: var(--accent); }
.meter .topup { background: var(--info); opacity: .75; }
.meter-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-top: .55rem; }
.meter-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .62rem .6rem; border-bottom: 1px solid var(--line-soft); font-size: .93rem; }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .6px; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- forms ---------- */
label { display: block; color: var(--muted); font-size: .85rem; margin-bottom: .3rem; }
input, select, textarea {
  background: #0e0e12; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: .58rem .7rem; width: 100%; font: inherit; font-size: .93rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.field { margin-bottom: .95rem; }
.form-row { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.check input { margin: 0; }
.hint { color: var(--dim); font-size: .85rem; margin: .3rem 0 0; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: .55rem 1.1rem; border-radius: 8px; font-weight: 600; font-size: .93rem;
  cursor: pointer; font-family: inherit; text-align: center;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--muted); }
.btn.sm { padding: .34rem .7rem; font-size: .85rem; }
.btn-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

/* segmented control (session type, duration, quantity presets) */
.seg { display: inline-flex; background: #0e0e12; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; padding: .38rem .78rem; border-radius: 6px; cursor: pointer;
  color: var(--muted); font-size: .88rem; font-weight: 500; user-select: none;
}
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg span:hover { color: var(--text); }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-block; padding: .16rem .6rem; border-radius: 99px;
  font-size: .76rem; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.pill.active, .pill.paid { background: rgba(63,191,90,.14); color: #79e293; }
.pill.suspended_quota, .pill.past_due, .pill.open, .pill.pending { background: rgba(224,161,41,.15); color: #efc272; }
.pill.suspended_billing, .pill.suspended_abuse, .pill.canceled, .pill.deprovisioned,
.pill.flagged, .pill.held { background: rgba(224,30,38,.15); color: #ff8b91; }
.pill.info { background: rgba(74,158,255,.14); color: #8dc3ff; }
.pill.muted { background: var(--panel-2); color: var(--muted); }

/* ---------- alerts ---------- */
.alert { border-radius: 9px; padding: .8rem 1.05rem; margin-bottom: 1.1rem; border: 1px solid; font-size: .93rem; }
.alert p:last-child { margin-bottom: 0; }
.alert.error { background: rgba(224,30,38,.1); border-color: rgba(224,30,38,.4); color: #ffb4b8; }
.alert.ok { background: rgba(63,191,90,.1); border-color: rgba(63,191,90,.35); color: #a9eebb; }
.alert.warn { background: rgba(224,161,41,.1); border-color: rgba(224,161,41,.38); color: #f0cf90; }
.alert.info { background: rgba(74,158,255,.09); border-color: rgba(74,158,255,.32); color: #a9d1ff; }

/* ---------- misc ---------- */
code, .mono {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: .87em;
}
code { background: #0e0e12; border: 1px solid var(--line); padding: .1rem .4rem; border-radius: 5px; }
pre.out {
  background: #0e0e12; border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem 1rem; overflow: auto; max-height: 340px; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem;
  line-height: 1.55; color: #cfcfd8; white-space: pre;
}
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: .87rem; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty h3 { color: var(--text); }
.divider { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.nowrap { white-space: nowrap; }

/* auth pages */
.auth { max-width: 420px; margin: 3.5rem auto; }
.auth .brand { display: block; text-align: center; font-size: 1.3rem; margin-bottom: 1.4rem; }
.auth .card { padding: 1.6rem; }
.auth .foot { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1rem; }

/* usage chart */
.chart { width: 100%; height: 120px; display: block; }
.chart .bar { fill: var(--accent); opacity: .82; }
.chart .bar:hover { opacity: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--dim); font-size: 9px; }

@media (max-width: 720px) {
  .topbar-inner { height: auto; padding: .7rem 1rem; flex-wrap: wrap; }
  .topnav { width: 100%; margin-left: 0; }
  .layout { padding: 1.2rem 1rem 3rem; }
}
