@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #091014;
  --surface: rgba(17, 27, 32, .88);
  --surface-2: #151f24;
  --line: rgba(173, 205, 214, .12);
  --muted: #8b9ba2;
  --text: #ecf4f5;
  --green: #87e0a0;
  --cyan: #5ed7d2;
  --amber: #f1c979;
  --red: #ff7c7c;
  --purple: #b7a2ff;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 15% 0%, #143436 0, transparent 38%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
  font-family: Manrope, system-ui, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; border-radius: 50%; filter: blur(100px); opacity: .12; pointer-events: none; }
.ambient-a { width: 380px; height: 380px; background: var(--cyan); top: -160px; left: 20%; }
.ambient-b { width: 320px; height: 320px; background: var(--purple); right: -180px; top: 36%; }
.shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 24px; position: relative; z-index: 1; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; border: 1px solid rgba(94,215,210,.45); display: flex; align-items: end; justify-content: center; gap: 3px; padding: 9px; background: rgba(94,215,210,.07); }
.brand-mark span { width: 5px; border-radius: 1px; background: var(--cyan); box-shadow: 0 0 12px rgba(94,215,210,.55); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .75; }
.eyebrow { margin: 0 0 4px; color: #71858d; font: 500 10px/1.2 'DM Mono', monospace; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 19px; line-height: 1; letter-spacing: -.02em; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.live-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: rgba(10,17,21,.7); color: #b9c7cb; font-size: 12px; }
.live-pill i { width: 7px; height: 7px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 0 4px rgba(241,201,121,.08); }
.live-pill.ok i { background: var(--green); box-shadow: 0 0 0 4px rgba(135,224,160,.09); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(10,17,21,.7); color: #a9bdc2; }
.icon-button:hover { border-color: rgba(94,215,210,.45); color: var(--cyan); }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel { background: linear-gradient(145deg, rgba(20,31,36,.93), rgba(13,21,25,.92)); border: 1px solid var(--line); box-shadow: 0 16px 60px rgba(0,0,0,.16); }
.hero { min-height: 190px; padding: 34px 38px; display: flex; justify-content: space-between; align-items: center; overflow: hidden; position: relative; }
.hero::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 48%; background: linear-gradient(90deg, transparent, rgba(94,215,210,.035)), repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.015) 23px 24px); }
.section-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--cyan); font: 500 11px/1 'DM Mono', monospace; letter-spacing: .1em; }
.section-kicker span { width: 28px; height: 1px; background: var(--cyan); }
.hero h2 { margin-bottom: 9px; font-size: clamp(26px, 3.1vw, 45px); letter-spacing: -.045em; line-height: 1.03; }
.hero p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.hero-score { position: relative; width: 126px; height: 126px; z-index: 1; flex: 0 0 auto; }
.hero-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-score circle { fill: none; stroke-width: 7; }
.score-track { stroke: rgba(255,255,255,.06); }
.score-value { stroke: var(--green); stroke-linecap: square; stroke-dasharray: 308; stroke-dashoffset: 308; transition: stroke-dashoffset .8s ease; filter: drop-shadow(0 0 7px rgba(135,224,160,.25)); }
.hero-score > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.hero-score strong { font: 500 29px/1 'DM Mono', monospace; }
.hero-score small { margin-top: 5px; color: var(--muted); font: 500 9px/1 'DM Mono', monospace; letter-spacing: .17em; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.metric { min-height: 124px; padding: 22px; display: grid; grid-template-columns: 40px 1fr; gap: 14px; position: relative; overflow: hidden; }
.metric-icon { width: 39px; height: 39px; display: grid; place-items: center; background: rgba(94,215,210,.07); border: 1px solid rgba(94,215,210,.14); color: var(--cyan); font: 500 9px 'DM Mono', monospace; letter-spacing: .06em; }
.metric-icon.memory { color: var(--purple); background: rgba(183,162,255,.07); border-color: rgba(183,162,255,.15); }
.metric-icon.disk { color: var(--amber); background: rgba(241,201,121,.07); border-color: rgba(241,201,121,.15); }
.metric-icon.uptime { color: var(--green); background: rgba(135,224,160,.07); border-color: rgba(135,224,160,.15); }
.metric span { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin: 5px 0 4px; font: 500 24px/1 'DM Mono', monospace; }
.metric small { color: #64777e; font-size: 10px; }
.spark { position: absolute; height: 2px; background: rgba(255,255,255,.035); bottom: 0; left: 0; right: 0; }
.spark i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .5s ease; }
.metric:nth-child(2) .spark i { background: var(--purple); }
.metric:nth-child(3) .spark i { background: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 12px; margin-bottom: 12px; }
.stack-panel { padding: 26px; min-height: 380px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.panel-heading h3 { font-size: 18px; margin-bottom: 0; letter-spacing: -.025em; }
.counter { background: rgba(135,224,160,.07); border: 1px solid rgba(135,224,160,.14); color: var(--green); padding: 6px 9px; font: 500 10px 'DM Mono', monospace; }
.timestamp { color: #64777e; font: 400 9px 'DM Mono', monospace; }
.container-list { display: grid; gap: 7px; }
.container-row { display: grid; grid-template-columns: 42px 1fr 94px 72px; align-items: center; gap: 13px; padding: 12px 13px; background: rgba(255,255,255,.018); border: 1px solid rgba(255,255,255,.045); }
.ct-id { color: #697d84; font: 500 10px 'DM Mono', monospace; }
.ct-name strong { display: block; font-size: 12px; font-weight: 600; }
.ct-name small { color: #667980; font-size: 9px; }
.mini-meter { height: 3px; background: rgba(255,255,255,.06); }
.mini-meter i { display: block; height: 100%; background: var(--cyan); }
.status { display: flex; justify-content: flex-end; align-items: center; gap: 7px; color: var(--green); font: 500 9px 'DM Mono', monospace; text-transform: uppercase; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.status.offline { color: var(--red); }
.status.pending { color: var(--amber); }

.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.service-card { min-height: 76px; padding: 13px; background: rgba(255,255,255,.018); border: 1px solid rgba(255,255,255,.045); }
.service-card .service-top { display: flex; justify-content: space-between; align-items: center; }
.service-card strong { font-size: 11px; }
.service-card p { margin: 9px 0 0; color: #65787f; font: 400 8px/1.35 'DM Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.storage-wrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.subheading { display: flex; justify-content: space-between; color: #9dafb4; font-size: 10px; margin-bottom: 11px; }
.subheading small { color: #5f7279; font: 400 9px 'DM Mono', monospace; }
.storage-list { display: grid; gap: 10px; }
.storage-item header { display: flex; justify-content: space-between; margin-bottom: 5px; color: #7f9197; font: 400 9px 'DM Mono', monospace; }
.storage-bar { height: 4px; background: rgba(255,255,255,.05); }
.storage-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3f9c9c, var(--cyan)); }

.caddy-panel { padding: 27px; }
.caddy-heading { align-items: center; }
.integration-banner { margin: -4px 0 22px; padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,255,255,.018); border: 1px solid rgba(255,255,255,.055); }
.integration-brand, .integration-side { display: flex; align-items: center; gap: 11px; }
.integration-brand strong { display: block; font-size: 11px; }
.integration-brand small { display: block; margin-top: 3px; color: #65787f; font: 400 9px 'DM Mono', monospace; }
.cloud-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #ffad5b; background: rgba(255,173,91,.08); border: 1px solid rgba(255,173,91,.2); font: 600 9px 'DM Mono', monospace; }
.secondary-button.compact { padding: 7px 10px; font-size: 9px; }
.muted { color: var(--muted); font-size: 11px; margin: 7px 0 0; }
.primary-button, .secondary-button { border: 0; padding: 11px 15px; font-weight: 700; font-size: 11px; }
.primary-button { background: var(--cyan); color: #071214; box-shadow: 0 8px 25px rgba(94,215,210,.12); }
.primary-button:hover { background: #79e8e4; }
.primary-button span { margin-right: 4px; font-size: 15px; line-height: 0; }
.secondary-button { background: rgba(255,255,255,.05); color: #b9c7cb; border: 1px solid var(--line); }
.route-table-wrap { overflow-x: auto; }
.route-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.route-table th { padding: 10px 13px; border-bottom: 1px solid var(--line); color: #5f7279; font: 500 8px 'DM Mono', monospace; letter-spacing: .13em; text-align: left; }
.route-table td { padding: 14px 13px; border-bottom: 1px solid rgba(255,255,255,.04); color: #98a9ae; font-size: 11px; }
.route-table td:first-child { color: #dfeaec; font-weight: 600; }
.route-table code { color: var(--cyan); font: 400 10px 'DM Mono', monospace; }
.tag { display: inline-block; padding: 4px 6px; border: 1px solid rgba(255,255,255,.08); color: #71858c; font: 500 8px 'DM Mono', monospace; text-transform: uppercase; }
.delete-button { border: 0; background: transparent; color: #73868d; font-size: 17px; }
.delete-button:hover { color: var(--red); }
.empty { padding: 28px; text-align: center; color: #63767d; font-size: 11px; }

footer { padding: 18px 2px 0; display: flex; justify-content: space-between; color: #52636a; font: 400 9px 'DM Mono', monospace; }
dialog { width: min(480px, calc(100% - 32px)); padding: 0; border: 1px solid rgba(94,215,210,.2); color: var(--text); background: #111b20; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(2,8,10,.78); backdrop-filter: blur(5px); }
dialog form { padding: 27px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { margin-bottom: 0; font-size: 20px; }
.close-button { border: 0; background: transparent; color: #73868d; font-size: 27px; line-height: 1; }
.modal-copy { margin: 18px 0 22px; color: #81939a; font-size: 11px; line-height: 1.7; }
label { display: block; color: #9badb2; font-size: 10px; margin-top: 16px; }
input, select { width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid rgba(255,255,255,.09); outline: 0; background: #0b1317; color: var(--text); font: 400 11px 'DM Mono', monospace; }
input:focus, select:focus { border-color: rgba(94,215,210,.55); box-shadow: 0 0 0 3px rgba(94,215,210,.06); }
.check-row { display: flex; align-items: flex-start; gap: 11px; padding: 13px; background: rgba(94,215,210,.025); border: 1px solid rgba(94,215,210,.1); cursor: pointer; }
.check-row input { width: 15px; height: 15px; margin: 1px 0 0; padding: 0; accent-color: var(--cyan); flex: 0 0 auto; }
.check-row strong, .check-row small { display: block; }
.check-row strong { color: #bfd0d4; font-size: 10px; }
.check-row small { margin-top: 4px; color: #667980; font-size: 9px; line-height: 1.4; }
.cloudflare-fields { transition: opacity .18s ease; }
.cloudflare-fields.disabled { opacity: .35; }
.field-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 10px; }
.compact-check { margin-top: 10px; padding: 11px 13px; }
.modal-actions { margin-top: 23px; display: flex; justify-content: flex-end; gap: 8px; }
.form-message { min-height: 16px; margin-top: 12px; color: var(--red); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; max-width: 360px; padding: 13px 16px; background: #17252a; border: 1px solid rgba(135,224,160,.25); color: #cfe8d5; font-size: 11px; box-shadow: 0 18px 50px rgba(0,0,0,.4); transform: translateY(120px); opacity: 0; transition: .25s ease; }
.toast.show { transform: none; opacity: 1; }
.toast.error { border-color: rgba(255,124,124,.3); color: #ffc1c1; }

@media (max-width: 980px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 1480px); padding-top: 20px; }
  .hero { min-height: 240px; padding: 25px; align-items: flex-start; }
  .hero-score { width: 92px; height: 92px; margin-top: 6px; }
  .hero-score strong { font-size: 21px; }
  .metrics { grid-template-columns: 1fr; }
  .container-row { grid-template-columns: 36px 1fr 62px; }
  .container-row .mini-meter { display: none; }
  .stack-panel, .caddy-panel { padding: 20px; }
  .service-grid { grid-template-columns: 1fr; }
  .integration-banner { align-items: flex-start; }
  .integration-side { flex-direction: column; align-items: flex-end; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  footer { flex-direction: column; gap: 7px; }
}
