/* Oxium Licensing — dashboard theme (ember glass) */
:root {
  --bg: #080705;
  --surface: rgba(18,16,8,0.55);
  --surface-solid: #100e09;
  --surface-2: #15120b;
  --hairline: rgba(255,255,255,0.07);
  --hairline-strong: rgba(255,255,255,0.13);

  --text: #f2ece0;
  --text-soft: #c9bfa8;
  --muted: #8a826f;

  --e1: #f46311;
  --e2: #fa9726;
  --e3: #ffca3a;
  --grad: linear-gradient(110deg, #f46311 0%, #fa9726 45%, #ffca3a 100%);

  --ok: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: 'Outfit', var(--sans);
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* Ambient corner glows */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1000px 600px at 8% -12%, rgba(244,99,17,0.14), transparent 60%),
    radial-gradient(900px 520px at 96% 0%, rgba(255,202,58,0.07), transparent 62%),
    radial-gradient(700px 500px at 60% 110%, rgba(250,151,38,0.05), transparent 60%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--e2) 22%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--e2) 36%, transparent); background-clip: padding-box; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; padding: 22px 14px;
  border-right: 1px solid var(--hairline);
  background: rgba(12,11,8,0.6); backdrop-filter: blur(18px);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand img { width: 32px; height: 32px; filter: drop-shadow(0 4px 10px rgba(244,99,17,0.4)); animation: float 5s ease-in-out infinite; }
.brand .name { font-family: var(--display); font-weight: 700; font-size: 16px; }
.brand .sub { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 7px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; position: relative; transition: background .25s var(--ease), color .25s var(--ease);
}
.nav a:hover { background: rgba(255,255,255,0.03); color: var(--text-soft); }
.nav a.active { background: color-mix(in srgb, var(--e2) 9%, transparent); color: var(--text); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 12px var(--e2); }
.nav a .ic { width: 17px; height: 17px; opacity: .9; }
.side-foot { margin-top: auto; border-top: 1px solid var(--hairline); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; }
.side-foot .who .n { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who .r { color: var(--muted); font-size: 11px; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 30px 18px; }
.topbar h1 { font-size: 22px; }
.topbar .crumb { color: var(--muted); font-size: 11.5px; margin-top: 3px; font-family: var(--mono); }
.content { padding: 6px 30px 70px; max-width: 1220px; }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 18px; backdrop-filter: blur(16px); overflow: hidden; padding: 20px;
  transition: border-color .2s, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.card::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 40%; background: linear-gradient(180deg, rgba(255,255,255,0.035), transparent); pointer-events: none; }
.card > * { position: relative; }
.card.flush { padding: 0; }
.card.hover:hover { border-color: var(--hairline-strong); transform: translateY(-2px); box-shadow: 0 22px 50px -30px #000, 0 0 0 1px color-mix(in srgb, var(--e2) 12%, transparent) inset; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 14px; }
.stat .label { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 9px; font-family: var(--display); letter-spacing: -0.02em; }
.stat .value.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.stat .top-accent { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad); opacity: .8; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15.5px; }
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } .content, .topbar { padding-left: 18px; padding-right: 18px; } .sidebar { width: 210px; } }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
td { padding: 13px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.key-chip { font-family: var(--mono); font-size: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--hairline); padding: 4px 9px; border-radius: 7px; transition: border-color .16s, color .16s; display: inline-block; }
a.key-chip:hover, .key-chip.copy:hover { border-color: color-mix(in srgb, var(--e2) 45%, transparent); color: var(--e3); cursor: pointer; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 9px 3px 8px; border-radius: 7px; text-transform: capitalize; border: 1px solid transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; animation: pulseDot 1.9s ease-in-out infinite; }
@keyframes pulseDot { 50% { opacity: .5; transform: scale(.82); } }
.badge.ok { color: var(--ok); background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.22); }
.badge.warn { color: var(--warn); background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.22); }
.badge.bad { color: var(--bad); background: rgba(251,113,133,0.1); border-color: rgba(251,113,133,0.22); }
.badge.muted { color: var(--muted); background: rgba(255,255,255,0.03); border-color: var(--hairline); }
.badge.ember { color: var(--e3); background: linear-gradient(110deg, rgba(244,99,17,0.16), rgba(255,202,58,0.12)); border-color: rgba(250,151,38,0.3); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--hairline); background: rgba(255,255,255,0.03); color: var(--text); cursor: pointer; transition: all .4s var(--ease); white-space: nowrap; }
.btn:hover { border-color: var(--hairline-strong); background: rgba(255,255,255,0.05); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #1a0a00; border-color: transparent; box-shadow: 0 1px 0 rgba(255,255,255,0.45) inset, 0 10px 24px -14px rgba(244,99,17,0.7); }
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn.danger { color: var(--bad); border-color: rgba(251,113,133,0.25); }
.btn.danger:hover { background: rgba(251,113,133,0.12); border-color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.xs { padding: 5px 10px; font-size: 11px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; color: var(--text-soft); margin-bottom: 7px; font-weight: 500; }
input, select, textarea { width: 100%; background: rgba(255,255,255,0.02); border: 1px solid var(--hairline); color: var(--text); border-radius: 10px; padding: 10px 13px; font-family: var(--sans); font-size: 14px; transition: all .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(250,151,38,0.45); background: rgba(255,255,255,0.04); box-shadow: 0 0 0 3px rgba(250,151,38,0.1); }
select option { background: var(--surface-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.help { font-size: 12px; color: var(--muted); margin-top: 7px; }

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 23px; }
.switch input { position: absolute; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: rgba(255,255,255,0.08); border: 1px solid var(--hairline); border-radius: 999px; transition: background .22s, border-color .22s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: rgba(255,255,255,0.85); transition: transform .22s var(--ease), background .22s; }
.switch input:checked + span { background: rgba(250,151,38,0.4); border-color: rgba(250,151,38,0.6); }
.switch input:checked + span::after { transform: translateX(17px); background: var(--e3); }

/* ---------- Tabs / segmented ---------- */
.tabs { display: inline-flex; gap: 3px; padding: 4px; background: rgba(255,255,255,0.03); border: 1px solid var(--hairline); border-radius: 11px; }
.tabs a, .tabs button { padding: 7px 14px; border-radius: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; border: none; background: transparent; cursor: pointer; transition: all .3s var(--ease); }
.tabs a:hover, .tabs button:hover { color: var(--text-soft); }
.tabs a.active, .tabs button.active { color: #1a1206; font-weight: 600; background: var(--grad); box-shadow: 0 6px 16px -9px rgba(244,99,17,0.7); }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.callout { background: rgba(255,255,255,0.02); border: 1px solid var(--hairline); border-left: 2px solid var(--e2); border-radius: 12px; padding: 15px 17px; margin: 14px 0; font-size: 13px; color: var(--text-soft); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 11px 16px; }
.kv .k { color: var(--muted); }
.pill-rate { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; }
.pill-rate > span { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; background: var(--grad); color: #1a0a00; font-weight: 700; font-size: 12px; flex-shrink: 0; }
svg.line { width: 100%; height: 220px; overflow: visible; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); background: var(--surface-2); border: 1px solid var(--hairline-strong); color: var(--text); padding: 11px 17px; border-radius: 11px; font-size: 13px; opacity: 0; transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 1000; box-shadow: 0 18px 40px -18px #000; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,7,5,0.82); backdrop-filter: blur(12px); z-index: 90; display: none; place-items: center; padding: 20px; }
.modal-backdrop.open { display: grid; animation: fadeIn .25s var(--ease); }
.modal { width: min(520px, 100%); background: var(--surface-2); border: 1px solid var(--hairline-strong); border-radius: 20px; box-shadow: 0 40px 100px -30px #000; animation: rise .35s var(--ease); overflow: hidden; }
.modal-head { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hairline); }
.modal-head h3 { font-size: 17px; }
.modal-head .x { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; background: none; border: none; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot { padding: 15px 22px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--hairline); background: rgba(255,255,255,0.01); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 400px; max-width: 100%; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: 22px; padding: 36px; text-align: center; backdrop-filter: blur(20px); box-shadow: 0 40px 90px -40px #000; }
.login-card img { width: 58px; height: 58px; margin-bottom: 16px; filter: drop-shadow(0 6px 16px rgba(244,99,17,0.5)); }
.login-card h1 { font-size: 23px; }
.login-card p { color: var(--muted); margin: 8px 0 26px; }
.login-card .btn { width: 100%; padding: 12px; margin-bottom: 11px; }
.discord-btn { background: #5865F2; border: none; color: #fff; }
.discord-btn:hover { background: #4a56e0; }

/* ---------- Customer portal (top-bar layout) ---------- */
.portal-top { display: flex; align-items: center; gap: 22px; padding: 15px 28px; border-bottom: 1px solid var(--hairline); background: rgba(12,11,8,0.55); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-family: var(--display); }
.portal-brand img { width: 26px; height: 26px; }
.portal-brand .dim { color: var(--muted); font-weight: 500; }
.portal-nav { display: flex; gap: 3px; }
.portal-nav a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.portal-nav a.active, .portal-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.portal-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.portal-main { max-width: 900px; margin: 0 auto; padding: 34px 24px 70px; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .brand { padding: 0 12px 0 4px; } .nav { flex-direction: row; } .nav-label { display: none; } .side-foot { display: none; }
  .nav a.active::before { display: none; }
}
