/* Hosting portal design system. Dark navy surfaces, blue/violet accents. */
:root {
  --bg: #0b0e16;
  --bg-soft: #10141f;
  --surface: #151a28;
  --surface-2: #1b2133;
  --surface-hover: #212941;
  --border: #262e45;
  --border-soft: #1f2740;
  --text: #eef1fa;
  --text-dim: #9aa5c0;
  --muted: #6f7a99;
  --accent: #6d8bff;
  --accent-strong: #4f6ef7;
  --accent-soft: rgba(109, 139, 255, .14);
  --violet: #9d7bff;
  --green: #46d39a;
  --green-soft: rgba(70, 211, 154, .13);
  --amber: #f0b455;
  --amber-soft: rgba(240, 180, 85, .14);
  --red: #ff7a8a;
  --red-soft: rgba(255, 122, 138, .13);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
  color: var(--text);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
code { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 1px 6px; }
pre { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }

/* ── buttons ─────────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-weight: 550; font-size: 13.5px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.button:hover { background: var(--surface-hover); border-color: #303a58; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.button.primary:hover { background: #5e7cff; }
.button.danger { background: transparent; border-color: rgba(255, 122, 138, .4); color: var(--red); }
.button.danger:hover { background: var(--red-soft); border-color: var(--red); }
.button.small { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.text-link { color: var(--accent); font-weight: 550; }
.text-link:hover { text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.back-link:hover { color: var(--text); }

/* ── layout shell ────────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 25;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border-right: 1px solid var(--border-soft);
  padding: 18px 14px; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; padding: 6px 8px 14px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent-strong), var(--violet)); color: #fff; font-size: 14px; }
.workspace { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.workspace small { display: block; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.dim-dot { background: var(--muted); box-shadow: 0 0 0 3px rgba(111, 122, 153, .15); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-dim); font-weight: 500; font-size: 13.5px; }
.sidebar nav a:hover { background: var(--surface); color: var(--text); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar nav a .nav-icon { width: 18px; text-align: center; flex: none; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border-soft); padding-top: 12px; margin-top: 8px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 650; flex: none; }
.identity { flex: 1; min-width: 0; }
.identity small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 6px; border-radius: 8px; }
.logout:hover { color: var(--red); background: var(--red-soft); }

.app-shell { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 32px; border-bottom: 1px solid var(--border-soft); background: rgba(11, 14, 22, .8); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(8px); }
.topbar > span:first-of-type { flex: 1; font-weight: 550; }
.breadcrumb-slash { color: var(--muted); margin: 0 6px; }
.topbar-state { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border-soft); border-radius: 999px; padding: 5px 12px; }
.menu-button { display: none; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 11px; cursor: pointer; font-size: 15px; }
.app-shell main { flex: 1; padding: 30px 32px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-footer { border-top: 1px solid var(--border-soft); padding: 16px 32px; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; }

/* ── page furniture ──────────────────────────────────────────── */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 650; display: block; margin-bottom: 4px; }
.page-heading p { color: var(--text-dim); margin-top: 4px; }
.page-heading .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 26px 0 12px; }
.flash-messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 12px 15px; font-size: 13.5px; }
.notice.success-notice { border-color: rgba(70, 211, 154, .35); background: var(--green-soft); }
.notice.error-notice { border-color: rgba(255, 122, 138, .35); background: var(--red-soft); }
.notice::before { content: "◆"; font-size: 10px; margin-top: 4px; }
.notice.success-notice::before { color: var(--green); content: "✔"; }
.notice.error-notice::before { color: var(--red); content: "✕"; }

/* ── cards and grids ─────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 20px; }
.card > h2 { margin-bottom: 4px; }
.card > .card-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card-grid.narrow { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.server-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 18px; transition: border-color .15s, transform .12s, box-shadow .15s;
}
.server-card:hover { border-color: #35406a; transform: translateY(-2px); box-shadow: var(--shadow); }
.server-card.unavailable { opacity: .75; }
.server-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.server-name { font-size: 16px; font-weight: 640; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-plan { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--violet); background: rgba(157, 123, 255, .13); border-radius: 999px; padding: 3px 10px; }
.server-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.server-detail { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.detail-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.detail-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border-soft); padding-top: 12px; color: var(--accent); font-size: 13px; font-weight: 550; }

.status-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 11px; }
.status-badge .status-indicator { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-online { color: var(--green); background: var(--green-soft); }
.status-offline { color: var(--text-dim); background: var(--surface-2); }
.status-transition { color: var(--amber); background: var(--amber-soft); }
.status-error { color: var(--red); background: var(--red-soft); }

/* ── stats ───────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 16px 18px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 6px; }
.stat-card strong { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.stat-detail { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.meter { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-strong), var(--violet)); }
.meter > span.warn { background: linear-gradient(90deg, var(--amber), var(--red)); }

/* ── tabs ────────────────────────────────────────────────────── */
.server-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin: 22px 0; overflow-x: auto; }
.server-tabs .tab { padding: 9px 15px; border-radius: 9px 9px 0 0; color: var(--text-dim); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.server-tabs .tab:hover { color: var(--text); background: var(--surface); }
.server-tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── info grid / resource rows ───────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 22px; }
.info-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.info-value { font-size: 14px; overflow-wrap: anywhere; }
.info-value code { padding: 2px 8px; }

.resource-list { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.resource-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.resource-row:last-child { border-bottom: 0; }
.resource-info { min-width: 0; flex: 1; }
.resource-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.resource-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 60px 24px; border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--bg-soft); }
.empty-state .empty-icon { font-size: 30px; margin-bottom: 10px; opacity: .8; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--text-dim); max-width: 420px; margin: 0 auto; }

/* ── forms ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 550; }
.field-help { font-size: 12px; color: var(--muted); }
.optional { color: var(--muted); font-weight: 400; font-size: 11.5px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent-strong); }
.confirmation { display: flex; gap: 10px; align-items: flex-start; background: var(--red-soft); border: 1px solid rgba(255, 122, 138, .3); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; margin: 12px 0; }
.confirmation label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.confirmation input { margin-top: 3px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 170px; margin-bottom: 0; }

/* ── power controls ──────────────────────────────────────────── */
.power-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.power-note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.danger-zone { border-color: rgba(255, 122, 138, .3); }
.danger-zone > h2 { color: var(--red); }

/* ── login ───────────────────────────────────────────────────── */
.public-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1100px 500px at 70% -10%, rgba(109, 139, 255, .12), transparent 60%), var(--bg); }
.login-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; max-width: 980px; width: 100%; align-items: center; }
.login-copy h1 { font-size: 38px; line-height: 1.15; margin: 8px 0 14px; }
.login-copy p { color: var(--text-dim); max-width: 380px; }
.login-features { display: flex; flex-direction: column; gap: 9px; margin-top: 24px; color: var(--text-dim); font-size: 13.5px; }
.login-features span { display: inline-flex; align-items: center; gap: 9px; }
.login-intro > .muted { margin-top: 34px; font-size: 12.5px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 30px; }
.login-card h2 { margin-bottom: 6px; font-size: 19px; }
.login-card > p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 20px; }
.card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-strong), var(--violet)); color: #fff; font-size: 18px; margin-bottom: 18px; }
.discord-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #5865f2; border: 0; border-radius: 11px; color: #fff; font-weight: 600; padding: 13px 18px; cursor: pointer; }
.discord-button:hover { background: #6470ff; }
.discord-button svg { width: 20px; height: 20px; }
.discord-button > span:last-child { margin-left: auto; }
.login-policy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 18px; justify-content: center; }

/* ── usage bars, keys, activity ──────────────────────────────── */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.usage-row { display: flex; flex-direction: column; gap: 2px; }
.usage-value { font-size: 13px; color: var(--text-dim); }
.key-list { display: flex; flex-direction: column; gap: 10px; }
.key-item { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 18px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.activity-row:last-child { border-bottom: 0; }
.activity-time { color: var(--muted); font-size: 12.5px; }
.pagination { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent-strong); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }

@media (max-width: 1100px) {
  .sidebar { transform: translateX(-260px); visibility: hidden; transition: transform .18s ease, visibility .18s; }
  body.menu-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow); }
  .app-shell { margin-left: 0; }
  .menu-button { display: inline-block; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; }
}
@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; gap: 26px; }
  .login-copy h1 { font-size: 30px; }
}
@media (max-width: 700px) {
  body { overflow-x: hidden; }
  .app-shell main { padding: 20px 18px 40px; }
  .topbar { padding: 12px 16px; }
  .topbar > span:first-of-type { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-heading h1 { font-size: 20px; }
  .server-grid, .card-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .resource-row { align-items: flex-start; flex-direction: column; }
  .page-footer { padding: 14px 16px; }
  .topbar-state { display: none; }
}
