:root {
  --bg: #070a11;
  --bg-soft: #0c111b;
  --panel: #101722;
  --panel-2: #141d2b;
  --line: #223047;
  --text: #f4f7fb;
  --muted: #8e9bb0;
  --muted-2: #65748d;
  --brand: #7d8cff;
  --brand-2: #40cddd;
  --green: #3ad486;
  --green-soft: rgba(58, 212, 134, .13);
  --yellow: #f3b64d;
  --yellow-soft: rgba(243, 182, 77, .14);
  --red: #ff697b;
  --red-soft: rgba(255, 105, 123, .14);
  --shadow: 0 24px 80px rgba(0, 0, 0, .24);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f6fa;
  --bg-soft: #eaf0f6;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --line: #dbe3ee;
  --text: #172033;
  --muted: #65748d;
  --muted-2: #8190a5;
  --shadow: 0 18px 50px rgba(41, 60, 89, .1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 92% -10%, rgba(71, 103, 206, .2), transparent 34rem), var(--bg); color: var(--text); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 42px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 10px 0 38px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #08101c; font-weight: 900; letter-spacing: -.08em; background: linear-gradient(145deg, #8c9bff, #45d4dd); box-shadow: 0 10px 24px rgba(76, 150, 255, .22); }
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.top-actions, .action-row, .form-row, .filters, .probe-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { border: 1px solid var(--line); border-radius: 11px; padding: 10px 15px; color: var(--text); background: var(--panel-2); font-weight: 750; transition: .2s ease; }
.button:hover { transform: translateY(-1px); border-color: #415272; }
.button.primary { border-color: transparent; color: #09101b; background: linear-gradient(135deg, #8a89ff, #62c9e6); box-shadow: 0 12px 25px rgba(105, 137, 255, .2); }
.button.secondary { background: #192437; }
.button.subtle { background: transparent; }
.button.danger { color: var(--red); background: var(--red-soft); border-color: transparent; }

main { display: grid; gap: 18px; }
.status-hero { position: relative; display: flex; align-items: center; gap: 20px; min-height: 140px; padding: 28px 32px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg, rgba(24, 38, 62, .88), rgba(15, 22, 35, .88)); box-shadow: var(--shadow); }
.status-hero::after { content: ""; position: absolute; right: -80px; top: -130px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(61, 207, 148, .14), transparent 68%); pointer-events: none; }
.status-hero.warning::after { background: radial-gradient(circle, rgba(243, 182, 77, .17), transparent 68%); }
.status-hero.failed::after { background: radial-gradient(circle, rgba(255, 105, 123, .17), transparent 68%); }
.status-orb { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 8px var(--green-soft), 0 0 28px rgba(58, 212, 134, .46); }
.status-orb.warning { background: var(--yellow); box-shadow: 0 0 0 8px var(--yellow-soft), 0 0 28px rgba(243, 182, 77, .35); }
.status-orb.failed { background: var(--red); box-shadow: 0 0 0 8px var(--red-soft), 0 0 28px rgba(255, 105, 123, .35); }
.kicker { margin: 0 0 7px; color: var(--brand-2); font-size: 10px; font-weight: 850; letter-spacing: .17em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(25px, 4vw, 38px); letter-spacing: -.04em; line-height: 1.05; }
h2 { margin-bottom: 4px; font-size: 21px; letter-spacing: -.025em; }
.status-hero p:not(.kicker), .section-heading p:not(.kicker) { margin-bottom: 0; color: var(--muted); }
.hero-meta { position: relative; z-index: 1; margin-left: auto; align-self: flex-start; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot-separator { padding: 0 7px; color: var(--brand-2); }

.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.monitor-form { padding: 25px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.count-pill { padding: 6px 11px; border: 1px solid rgba(64, 205, 221, .2); border-radius: 99px; color: var(--brand-2); background: rgba(64, 205, 221, .08); font-size: 12px; font-weight: 850; white-space: nowrap; }
textarea { width: 100%; min-height: 132px; resize: vertical; padding: 17px 18px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--text); background: var(--bg-soft); }
textarea:focus, input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(125, 140, 255, .13); }
.form-row { margin: 15px 0; }
.probe-picker { min-height: 42px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.row-label, .select-field { color: var(--muted); font-size: 12px; font-weight: 750; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; color: var(--text); background: rgba(125, 140, 255, .1); font-size: 12px; font-weight: 800; }
input[type="checkbox"] { accent-color: var(--brand); }
.select-field { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
select, input[type="search"] { border: 0; outline: 0; color: var(--text); background: transparent; }
.select-field select { font-weight: 800; }
.action-row { padding-top: 2px; }
.progress-area { display: grid; gap: 8px; margin-top: 17px; color: var(--muted); font-size: 12px; }
.progress-area.hidden { display: none; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: var(--bg-soft); }
.progress-track div { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s ease; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.summary-card { position: relative; min-height: 116px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.summary-card::after { content: ""; position: absolute; right: -24px; bottom: -42px; width: 110px; height: 110px; border-radius: 50%; background: rgba(125, 140, 255, .08); }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.summary-card strong { display: block; margin: 6px 0 2px; font-size: 30px; letter-spacing: -.05em; }
.summary-card small { color: var(--muted-2); font-size: 10px; letter-spacing: 0; text-transform: none; }

.services-panel { padding: 25px; }
.services-heading { align-items: center; }
.filters input { width: 210px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--bg-soft); }
.filters select { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); font-weight: 700; }
.service-list { border-top: 1px solid var(--line); }
.bulk-toolbar { display: flex; align-items: center; gap: 14px; padding: 0 0 13px; color: var(--muted); font-size: 12px; }
.select-all { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.service-row { display: grid; grid-template-columns: 28px minmax(190px, 1.2fr) minmax(250px, 1fr) 155px 104px 94px; align-items: center; gap: 15px; padding: 19px 5px; border-bottom: 1px solid var(--line); }
.service-row:last-child { border-bottom: 0; }
.site-select { display: grid; place-items: center; }
.site-check { width: 16px; height: 16px; accent-color: var(--brand); }
.service-name { min-width: 0; }
.service-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.service-name small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.service-name .service-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.service-name .service-dot.warning { background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-soft); }
.service-name .service-dot.failed { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.probe-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.probe-chip, .ssl-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 6px 9px; border-radius: 9px; color: var(--muted); background: var(--panel-2); font-size: 11px; font-weight: 800; }
.probe-chip b { color: var(--text); }
.probe-chip.online, .ssl-chip.online { color: var(--green); background: var(--green-soft); }
.probe-chip.warning, .ssl-chip.warning { color: var(--yellow); background: var(--yellow-soft); }
.probe-chip.failed, .ssl-chip.failed { color: var(--red); background: var(--red-soft); }
.metric-label { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.metric-value { color: var(--text); font-weight: 800; }
.row-action { justify-self: end; }
.mini { padding: 8px 10px; font-size: 11px; }
.empty-state { padding: 38px 12px; color: var(--muted); text-align: center; }

footer { padding: 22px 0 0; color: var(--muted-2); font-size: 11px; text-align: center; }
footer span { padding: 0 6px; color: var(--brand-2); }
dialog { width: min(530px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--panel); box-shadow: 0 30px 100px rgba(0, 0, 0, .55); }
dialog::backdrop { background: rgba(3, 6, 11, .75); backdrop-filter: blur(5px); }
dialog form { padding: 24px; }
.modal-heading { display: flex; justify-content: space-between; gap: 18px; }
.modal-heading h2 { margin-bottom: 20px; }
.close-button { align-self: flex-start; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; }
dialog label { display: grid; gap: 7px; margin: 15px 0; color: var(--muted); font-size: 12px; font-weight: 800; }
dialog input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--text); background: var(--bg-soft); }
.note { color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

@media (max-width: 900px) {
  .service-row { grid-template-columns: 28px minmax(180px, 1fr) minmax(220px, 1fr) 130px 95px; }
  .service-row > .metric:nth-child(4) { display: none; }
}
@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 600px); padding-top: 12px; }
  .topbar, .section-heading, .services-heading { align-items: flex-start; flex-direction: column; }
  .topbar { gap: 16px; padding-bottom: 24px; }
  .top-actions { width: 100%; }
  .top-actions .button { flex: 1; }
  .status-hero { align-items: flex-start; flex-wrap: wrap; padding: 22px; }
  .hero-meta { width: 100%; margin-left: 38px; }
  .monitor-form, .services-panel { padding: 18px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { align-items: stretch; flex-direction: column; }
  .probe-picker, .select-field { width: 100%; }
  .action-row .button { flex: 1; }
  .filters { width: 100%; }
  .filters input, .filters select { flex: 1; width: auto; }
  .service-row { grid-template-columns: 28px 1fr; gap: 12px; padding: 18px 0; }
  .service-row > div:nth-child(n+3) { grid-column: 2; }
  .service-row > .metric:nth-child(4) { display: block; }
  .row-action { justify-self: start; }
}

