/* OptiCore Control Center: black, charcoal, red and orange. */
:root {
  --bg: #08080a; --bg-2: #0e0e11; --panel: #141418; --panel-2: #1a1a1f; --line: #26262d; --line-2: #33333c;
  --text: #ececf1; --text-2: #a9a9b6; --text-3: #6f6f7c;
  --red: #e63946; --orange: #ff7a1a; --amber: #ffb020; --green: #2fbf71; --blue: #4ea1ff;
  --grad: linear-gradient(135deg, #e63946 0%, #ff7a1a 100%);
  --radius: 12px; --radius-s: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--text-2); } .dim { color: var(--text-3); } .small { font-size: 12.5px; }
.hidden { display: none !important; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; letter-spacing: .01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #fff; box-shadow: 0 6px 18px rgba(230, 57, 70, .35); }
.brand small { display: block; font-weight: 500; color: var(--text-3); font-size: 11.5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(230, 57, 70, .18), rgba(255, 122, 26, .06)); color: var(--text); box-shadow: inset 2px 0 0 var(--orange); }
.nav svg { width: 17px; height: 17px; flex: none; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--text-2); }
.me .who { min-width: 0; flex: 1; } .me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 26px 30px 60px; min-width: 0; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.btn.burger { display: none; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* building blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stat .k { color: var(--text-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.stat.hot .v { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #4a4a55; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(230, 57, 70, .25); }
.btn.danger { background: rgba(230, 57, 70, .12); border-color: rgba(230, 57, 70, .5); color: #ff8a92; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
input[type=text], input[type=number], input[type=search], select, textarea {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 8px 11px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 122, 26, .15); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
label.f input, label.f select { color: var(--text); font-weight: 400; font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge.active, .badge.paid, .badge.on { color: #5fe3a1; border-color: rgba(47, 191, 113, .45); background: rgba(47, 191, 113, .1); }
.badge.revoked, .badge.refunded, .badge.failed, .badge.off { color: #ff8a92; border-color: rgba(230, 57, 70, .45); background: rgba(230, 57, 70, .1); }
.badge.expired, .badge.partially_refunded { color: var(--amber); border-color: rgba(255, 176, 32, .45); background: rgba(255, 176, 32, .08); }
.badge.trial { color: var(--blue); border-color: rgba(78, 161, 255, .45); background: rgba(78, 161, 255, .08); }
.badge.owner { color: #fff; border-color: transparent; background: var(--grad); }
.badge.admin { color: var(--orange); border-color: rgba(255, 122, 26, .5); }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--panel-2); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 34px; text-align: center; color: var(--text-3); }
.scroll-x { overflow-x: auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; max-width: 380px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }

/* chart */
.chart svg { width: 100%; height: 190px; display: block; }
.chart .bar { fill: url(#cc-grad); } .chart .bar:hover { opacity: .8; }
.chart .axis { stroke: var(--line); } .chart text { fill: var(--text-3); font-size: 10.5px; }
.legend { display: flex; gap: 8px; }

/* events list */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--text-3); font-size: 12px; min-width: 120px; }
.feed .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 20% -10%, rgba(230, 57, 70, .18), transparent 60%), radial-gradient(800px 500px at 110% 110%, rgba(255, 122, 26, .14), transparent 60%), var(--bg); }
.auth .box { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); text-align: center; }
.auth .brand { justify-content: center; padding: 0 0 18px; }
.auth .brand .mark { width: 44px; height: 44px; border-radius: 13px; font-size: 20px; }
.auth h1 { margin-bottom: 6px; }
.auth p { color: var(--text-2); margin: 0 0 20px; }
.auth .code { font-size: 26px; letter-spacing: .4em; text-align: center; width: 100%; padding: 12px; font-family: var(--mono); }
.auth .qr { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; margin: 6px 0 12px; }
.auth .qr img { display: block; width: 180px; height: 180px; image-rendering: pixelated; }
.auth .secret { font-family: var(--mono); background: var(--bg-2); border: 1px dashed var(--line-2); padding: 8px; border-radius: 8px; word-break: break-all; font-size: 12.5px; margin-bottom: 16px; }
.discord { background: #5865f2 !important; border-color: transparent !important; color: #fff; width: 100%; justify-content: center; }
.err { color: #ff8a92; min-height: 20px; margin-top: 10px; font-size: 13px; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); }
.modal { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { color: var(--text-2); margin: 0 0 14px; }
.modal .row.end { justify-content: flex-end; margin-top: 18px; }
.modal .stack { gap: 12px; }
.warnbox { border: 1px solid rgba(230, 57, 70, .45); background: rgba(230, 57, 70, .08); border-radius: var(--radius-s); padding: 10px 12px; color: #ffb3b8; font-size: 13px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--green); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; }
.toast.error { border-left-color: var(--red); }
.loading { padding: 40px; text-align: center; color: var(--text-3); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .btn.burger { display: inline-flex; }
  .main { padding: 18px 16px 50px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
}

/* servers */
.srv { display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.srv:hover { border-color: var(--line-2); text-decoration: none; }
.meter .bar { height: 7px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-top: 5px; border: 1px solid var(--line); }
.meter .bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.meter .bar.warm i { background: var(--amber); } .meter .bar.hot i { background: var(--grad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); vertical-align: middle; }
.dot.on { background: var(--green); box-shadow: 0 0 8px rgba(47, 191, 113, .7); } .dot.off { background: var(--red); box-shadow: 0 0 8px rgba(230, 57, 70, .7); }
.alertnote { color: #ff8a92; font-weight: 600; }
.alertcard { border-color: rgba(230, 57, 70, .45); background: linear-gradient(180deg, rgba(230, 57, 70, .08), var(--panel) 60%); }
a.srvline { color: var(--text); padding: 14px 18px; } a.srvline:hover { text-decoration: none; border-color: var(--line-2); }
.copyable { background: var(--bg-2); border: 1px solid var(--line-2); padding: 7px 10px; border-radius: 8px; flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); font-weight: 400; }
.modal.wide { max-width: 860px; }
pre.out { background: #050506; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 60vh; overflow: auto; font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; color: #d6d6de; }
.legend .lg::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg.cpu::before { background: #ff7a1a; } .lg.mem::before { background: #e63946; } .lg.disk::before { background: #4ea1ff; }
.legend { gap: 14px; }
