:root {
  --bg: #080b10;
  --panel: #0e141c;
  --panel-2: #121a24;
  --line: #22303e;
  --line-soft: #192430;
  --text: #e8eef5;
  --muted: #91a1b2;
  --faint: #5f7183;
  --amber: #e8a94d;
  --teal: #53c2b5;
  --blue: #67a9e8;
  --red: #e87575;
  --orange: #e89d5b;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 15% 10%, #101b25 0, var(--bg) 42%, #05070a 100%);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: "SF Mono", Menlo, monospace; }
.muted { color: var(--muted); }
.tiny { color: var(--faint); font-size: 11px; line-height: 1.55; }
.eyebrow { margin: 0 0 4px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }

.ambient { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: .28; }
.ambient-a { width: 520px; height: 520px; background: #25445a; top: -220px; left: -150px; }
.ambient-b { width: 460px; height: 460px; background: #4d3a1d; bottom: -220px; right: -100px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(20,30,42,.96), rgba(10,15,21,.97));
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.login-card h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.5px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  color: #0a0e13; background: linear-gradient(145deg, #f1be6e, #d99a3f);
  font-weight: 800; letter-spacing: -1px; margin-bottom: 18px;
}
.brand-mark.small { width: 36px; height: 36px; border-radius: 10px; margin: 0; font-size: 12px; }

.app-shell { min-height: 100vh; position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8,11,16,.86);
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 11px; align-items: center; min-width: 210px; }
.brand strong { font-size: 14px; letter-spacing: .2px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #0b1118; border: 1px solid var(--line-soft); border-radius: 10px; }
.tab {
  border: 0; background: transparent; color: var(--muted); border-radius: 7px;
  padding: 7px 14px; font-size: 12px; font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--amber); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

main { padding: 28px; max-width: 1500px; margin: 0 auto; }
.tab-panel { display: none; animation: fade .16s ease-out; }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 0 20px; }
.section-head h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.4px; }
.section-head p { margin: 0; max-width: 720px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(14,20,28,.82); padding: 18px; }
.card h3 { margin: 0; font-size: 13px; letter-spacing: .3px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10,15,21,.72); }
.table-wrap.compact { margin-top: 12px; }
.table-wrap.compact table { min-width: 700px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 8px 9px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; background: rgba(18,26,36,.65); }
tr:last-child td { border-bottom: 0; }
td { font-size: 12px; color: #c7d2de; }
.right { text-align: right; }
.empty { text-align: center; color: var(--faint); padding: 32px; }

.pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 20px; border: 1px solid #2c3b4a; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.pill.on { color: var(--teal); border-color: rgba(83,194,181,.35); background: rgba(83,194,181,.08); }
.pill.pro { color: var(--amber); border-color: rgba(232,169,77,.38); background: rgba(232,169,77,.08); }
.pill.off { color: var(--red); border-color: rgba(232,117,117,.3); background: rgba(232,117,117,.07); }

.primary, .ghost {
  border-radius: 8px; padding: 9px 14px; font-size: 12px; font-weight: 700; letter-spacing: .2px;
  border: 1px solid transparent; transition: .15s ease;
}
.primary { color: #0b0e12; background: linear-gradient(145deg, #f1be6e, #dfa044); }
.primary:hover { filter: brightness(1.07); }
.ghost { color: var(--muted); border-color: var(--line); background: #0d141c; }
.ghost:hover { color: var(--text); border-color: #3a4b5c; }
.small { padding: 5px 9px; font-size: 10px; }
.danger { color: var(--red); border-color: rgba(232,117,117,.3); background: rgba(232,117,117,.06); }
.file-button { position: relative; overflow: hidden; display: inline-flex; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.stack { display: flex; flex-direction: column; gap: 13px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
input, select, textarea {
  width: 100%; color: var(--text); background: #0a1017; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 11px; outline: none; font-size: 13px; text-transform: none; letter-spacing: 0;
}
input:focus, select:focus, textarea:focus { border-color: rgba(232,169,77,.65); box-shadow: 0 0 0 3px rgba(232,169,77,.08); }
textarea { resize: vertical; min-height: 100px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--red); font-size: 12px; margin: 0; }

.update-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(360px,.75fr); gap: 16px; align-items: start; }
.upload-progress { position: relative; height: 26px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #0a1017; }
#uploadProgressBar { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(232,169,77,.3), rgba(83,194,181,.4)); transition: width .15s linear; }
#uploadProgressText { position: relative; display: grid; place-items: center; height: 100%; font-size: 10px; color: var(--text); }

.manifest-preview { margin-top: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; white-space: pre-wrap; word-break: break-word; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
dl { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; margin: 14px 0 0; }
dt { color: var(--faint); font-size: 10px; letter-spacing: .6px; text-transform: uppercase; }
dd { margin: 0; color: #c7d2de; font-size: 12px; word-break: break-all; }

dialog {
  border: 1px solid var(--line); border-radius: 14px; background: #0d141c; color: var(--text);
  width: min(520px, calc(100vw - 32px)); padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.7);
}
dialog::backdrop { background: rgba(2,4,7,.72); backdrop-filter: blur(4px); }
.dialog-form { padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 99;
  max-width: 420px; padding: 12px 15px; border-radius: 9px;
  border: 1px solid var(--line); background: #101821; color: var(--text);
  box-shadow: 0 16px 44px rgba(0,0,0,.5); font-size: 12px;
}
.toast.error { border-color: rgba(232,117,117,.45); color: #ffd2d2; }

.badge { display: inline-flex; padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700; background: #16212d; color: var(--muted); }
.mono-cell { font-family: "SF Mono", Menlo, monospace; font-size: 10px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

@media (max-width: 1080px) {
  .update-grid, .account-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; }
}
@media (max-width: 680px) {
  main { padding: 18px; }
  .two { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
  .top-actions .muted { display: none; }
}
