:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f3f7f7;
  --brand: #087f8c;
  --brand-dark: #075964;
  --brand-soft: #e7f6f3;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
}

* { box-sizing: border-box; }
body { background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }

.app-shell { min-height: calc(100vh - 73px); background: radial-gradient(circle at 50% -20%, #e7f6f3 0, transparent 32rem); }
.app-nav { height: 73px; border-color: rgba(226,232,240,.9); box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.brand-logo-switch { display: inline-flex; flex: 0 0 auto; height: 34px; line-height: 0; overflow: hidden; width: 34px; }
.brand-logo { display: block; height: 34px; object-fit: cover; width: 34px; }
.brand-logo-dark { display: none; }
.brand-wordmark { color: #172033; font-size: 1.07em; font-weight: 800; letter-spacing: -.055em; }
.brand-wordmark span { color: #27bfa0; }
.theme-toggle { align-items: center; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 9px; color: #475569; display: inline-flex; height: 32px; justify-content: center; padding: 0; transition: background .15s, color .15s, border-color .15s; width: 32px; }
.theme-toggle:hover { background: #e8ecf3; color: #172033; }.theme-icon { height: 16px; width: 16px; }.theme-icon-moon { display: none; }
.nav-link { color: #475569; font-weight: 500; }
.nav-link:hover { color: var(--brand); }
.nav-link-active { color: var(--brand); background: var(--brand-soft); }
.site-nav-group { margin: .25rem 0; }
.site-nav-group summary { align-items: center; color: #475569; cursor: pointer; display: flex; font-size: .875rem; font-weight: 500; justify-content: space-between; list-style: none; padding: .5rem .75rem; border-radius: .5rem; }
.site-nav-group summary::-webkit-details-marker { display: none; }
.site-nav-group summary:hover { background: #f8fafc; color: var(--brand-dark); }
.site-nav-group summary::after { content: "›"; color: #94a3b8; font-size: 1.1rem; margin-left: .45rem; transform: rotate(0deg); transition: transform .15s; }
.site-nav-group[open] summary::after { transform: rotate(90deg); }
.site-nav-count { background: #f1f5f9; border-radius: 999px; color: #64748b; font-size: .65rem; font-weight: 700; margin-left: auto; padding: .1rem .4rem; }
.site-nav-content { padding: .3rem .25rem .15rem 1.1rem; }
.site-nav-search { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .45rem; color: #334155; font-size: .72rem; margin: .2rem 0 .45rem; outline: none; padding: .42rem .55rem; width: 100%; }
.site-nav-search:focus { background: #fff; border-color: #6dd3c5; box-shadow: 0 0 0 3px rgba(0,143,135,.12); }
.site-nav-list { display: grid; gap: 1px; max-height: 13.5rem; overflow-y: auto; padding-right: .1rem; }
.site-nav-item { align-items: center; border-radius: .4rem; color: #475569; display: flex; font-size: .76rem; gap: .45rem; min-width: 0; padding: .4rem .5rem; }
.site-nav-item:hover { background: #f8fafc; color: var(--brand-dark); }.site-nav-item.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.site-nav-dot { background: #cbd5e1; border-radius: 999px; flex: 0 0 auto; height: .4rem; width: .4rem; }.site-nav-item.is-active .site-nav-dot { background: #008d87; }
.site-nav-empty { color: #94a3b8; font-size: .72rem; padding: .35rem .5rem; }.site-nav-add { color: var(--brand); display: block; font-size: .72rem; font-weight: 700; margin: .45rem .5rem .2rem; }

.page-heading { letter-spacing: -.035em; color: #0f172a; }
.eyebrow { color: #008d87; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(15,23,42,.045); }
.panel-soft { background: rgba(255,255,255,.72); border: 1px solid rgba(226,232,240,.9); border-radius: 16px; }
.field { border: 1px solid #dbe2ec; border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: #20b9aa; box-shadow: 0 0 0 3px rgba(0,143,135,.13); outline: none; }
.btn-primary { border-radius: 10px; background: linear-gradient(135deg, #008d87, #087f8c); box-shadow: 0 8px 16px rgba(0,143,135,.18); font-weight: 700; transition: transform .15s, box-shadow .15s; }
.btn-primary:hover { background: linear-gradient(135deg, #087f8c, #075964); box-shadow: 0 10px 20px rgba(0,143,135,.26); transform: translateY(-1px); }
.btn-secondary { border-radius: 10px; background: #0f172a; font-weight: 700; }
.plan-badge { border-radius: 999px; background: var(--brand-soft); color: #075964; font-size: .7rem; font-weight: 800; letter-spacing: .07em; padding: .3rem .6rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.site-card { overflow: hidden; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 10px 25px rgba(15,23,42,.045); transition: transform .18s, box-shadow .18s, border-color .18s; }
.site-card:hover { transform: translateY(-2px); border-color: #b6e5dd; box-shadow: 0 16px 32px rgba(15,23,42,.08); }
.deleted-monitors { border-color: #fde68a; background: linear-gradient(135deg, #fffdf7, #fff); }.deleted-monitor-row { background: rgba(255,255,255,.78); border-color: #fde68a; box-shadow: none; }.restore-monitor-button { border: 1px solid var(--warning); border-radius: .55rem; color: #92400e; font-size: .78rem; font-weight: 800; padding: .5rem .75rem; white-space: nowrap; }.restore-monitor-button:hover { background: var(--warning-soft); }
.alert-rule-actions { align-items: center; display: flex; gap: .65rem; }.alert-rule-enabled { align-items: center; color: #64748b; cursor: pointer; display: inline-flex; font-size: .78rem; font-weight: 800; gap: .4rem; }.alert-rule-checkbox { accent-color: var(--success); cursor: pointer; height: 1.05rem; width: 1.05rem; }.alert-rule-checkbox:checked + span { color: #166534; }.alert-rule-delete { align-items: center; border: 1px solid #fecaca; border-radius: .55rem; background: #fff; color: #b91c1c; display: inline-flex; height: 2rem; justify-content: center; padding: 0; width: 2rem; }.alert-rule-delete:hover { background: var(--danger-soft); }.alert-rule-triggered { background: var(--danger-soft); color: #b91c1c; }
.metric-label { color: #94a3b8; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.site-row { background: linear-gradient(90deg, #fff, #fcfdff); }
.history-row { background: #f6faf9; border-top: 1px solid #eef2f7; }
.alert-warning { border: 1px solid #fcd34d; background: var(--warning-soft); color: #92400e; border-radius: 12px; }
.alert-info { border: 1px solid #93c5fd; background: var(--info-soft); color: #1d4ed8; border-radius: 12px; }
.auth-card { border: 1px solid rgba(226,232,240,.95); border-radius: 20px; box-shadow: 0 20px 45px rgba(15,23,42,.10); }

/* Monitoring cards: dense, uptime-first visual language. */
.monitor-card { border-radius: 18px; }
.monitor-card-head { min-height: 104px; }
.monitor-status { display: inline-flex; align-items: center; gap: .42rem; padding: .38rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; }
.monitor-status i { width: .48rem; height: .48rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px currentColor; opacity: .18; }
.monitor-status-up { color: var(--success); background: var(--success-soft); }
.monitor-status-down { color: var(--danger); background: var(--danger-soft); }
.monitor-status-pending { color: #64748b; background: #f1f5f9; }
.monitor-identity a { color: #103849; font-size: .96rem; letter-spacing: -.01em; }
.monitor-identity div { color: #94a3b8; margin-top: .2rem; }
.monitor-kpi { border-left: 1px solid #eef2f7; padding-left: 1rem; }
.monitor-kpi-value { color: #103849; letter-spacing: -.035em; }
.monitor-actions button { font-weight: 700; }
.monitor-history { background: linear-gradient(180deg, #f8fbfa 0%, #f2f9f7 100%); }
.monitor-detail-link { color: #087f8c; font-size: .72rem; font-weight: 800; }
.monitor-detail-link span { margin-left: .2rem; transition: transform .15s; display: inline-block; }
.monitor-detail-link:hover span { transform: translateX(3px); }
.uptime-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(4px, 1fr)); gap: 3px; min-width: 240px; }
.uptime-cell { height: 34px; min-width: 4px; border-radius: 999px; background: #e2e8f0; transition: opacity .15s, transform .15s; }
.uptime-cell:hover { opacity: .78; transform: scaleY(1.08); }
.uptime-cell.is-up { background: var(--success); }
.uptime-cell.is-degraded { background: #86efac; }
.uptime-cell.is-warning { background: var(--warning); }
.uptime-cell.is-down { background: var(--danger); }
.uptime-cell.is-empty { background: #e2e8f0; }
.uptime-sparkline { display: grid; grid-template-columns: repeat(24, minmax(3px, 1fr)); align-items: end; gap: 3px; height: 35px; }
.uptime-sparkline .uptime-cell { height: 100%; border-radius: 5px; }
.uptime-legend { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; color: #94a3b8; font-size: .65rem; margin-top: .65rem; }
.uptime-legend-item { display: inline-flex; align-items: center; gap: .28rem; }
.uptime-legend-item i { width: .46rem; height: .46rem; border-radius: 50%; background: currentColor; }
.uptime-legend-item.ok { color: var(--success); }.uptime-legend-item.warn { color: var(--warning); }.uptime-legend-item.down { color: var(--danger); }.uptime-legend-item.empty { color: #cbd5e1; }
.status-page-settings { border-color: #dbeafe; background: linear-gradient(135deg, #ffffff 0%, #f2f9f7 100%); }
.status-site-option { transition: border-color .15s, background .15s; }
.status-site-option:has(input:checked) { border-color: #6dd3c5; background: var(--brand-soft); }
.status-overall { display: inline-flex; align-items: center; gap: .5rem; padding: .48rem .9rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status-overall i { width: .5rem; height: .5rem; border-radius: 999px; background: currentColor; }
.status-overall-up { background: var(--success-soft); color: #15803d; }.status-overall-down { background: var(--danger-soft); color: #b91c1c; }.status-overall-pending { background: #f1f5f9; color: #475569; }
.status-service { border-color: #e8edf6; }
.status-service .uptime-cell { height: 26px; }
.status-service .uptime-legend { display: none; }
.status-page-logo { max-width: 180px; max-height: 64px; object-fit: contain; }

/* Detail dashboard: deliberately restrained, letting monitoring data lead. */
.detail-hero { background: #fff; }
.detail-url { color: #087f8c; font-size: .875rem; font-weight: 600; display: inline-block; margin-top: .35rem; overflow-wrap: anywhere; }
.detail-url:hover { color: #075964; }
.detail-kpi { min-height: 96px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: .9rem 1rem; display: flex; flex-direction: column; justify-content: space-between; }
.detail-kpi span { color: #64748b; font-size: .72rem; font-weight: 600; }
.detail-kpi strong { color: #103849; font-size: 1.35rem; letter-spacing: -.035em; line-height: 1; }
.detail-kpi small { color: #64748b; font-size: .72rem; font-weight: 700; letter-spacing: 0; }
.detail-kpi-primary { border-color: #b6e5dd; background: #e7f6f3; }
.detail-kpi-primary strong { color: #075964; }
.detail-kpi-primary small { color: #087f8c; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.chart-heading h2, .detail-section-title { color: #103849; font-size: 1rem; font-weight: 800; letter-spacing: -.02em; margin-top: .18rem; }
.chart-select { border: 1px solid #dbe2ec; border-radius: 8px; background: #fff; color: #475569; font-size: .75rem; font-weight: 700; padding: .35rem .5rem; }
.chart-caption, .chart-footnote { color: #94a3b8; font-size: .72rem; }
.chart-footnote { margin-top: .9rem; }
.chart-canvas { height: 236px; position: relative; }
.detail-history .uptime-strip { grid-template-columns: repeat(auto-fit, minmax(7px, 1fr)); min-width: 0; gap: 4px; }
.detail-history .uptime-cell { height: 30px; border-radius: 3px; }
.detail-history .uptime-legend { justify-content: flex-start; }
.detail-list { margin-top: .9rem; }
.detail-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .52rem 0; border-bottom: 1px solid #eef2f7; font-size: .8rem; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: #64748b; }.detail-list dd { color: #103849; font-weight: 650; text-align: right; }

/* Global theme bridge for the legacy Tailwind utility classes in templates.
   Keep the visual system coherent while templates are progressively simplified. */
.bg-slate-50, .bg-gray-50 { background-color: var(--canvas); }
.bg-slate-100, .bg-gray-100 { background-color: #f1f5f9; }
.bg-slate-200, .bg-gray-200 { background-color: var(--line); }
.border-slate-200, .border-gray-200, .border-gray-100 { border-color: var(--line); }
.text-slate-900, .text-gray-900 { color: var(--ink); }
.text-slate-800, .text-gray-800 { color: #1e293b; }
.text-slate-700, .text-gray-700 { color: #334155; }
.text-slate-600, .text-gray-600, .text-gray-500 { color: var(--muted); }
.text-slate-400, .text-gray-400 { color: #94a3b8; }

.bg-indigo-50, .bg-blue-50 { background-color: var(--brand-soft); }
.bg-indigo-100, .bg-blue-100 { background-color: #d7f1eb; }
.border-indigo-50, .border-indigo-100, .border-blue-100 { border-color: #b6e5dd; }
.border-blue-600 { border-color: var(--brand); }
.text-indigo-600, .text-blue-600 { color: var(--brand); }
.text-indigo-900 { color: var(--brand-dark); }
.text-blue-700, .text-blue-800 { color: #075964; }
.bg-indigo-600, .bg-blue-600 { background-color: var(--brand); }
.hover\\:bg-indigo-700:hover, .hover\\:bg-blue-700:hover { background-color: var(--brand-dark); }
.hover\\:text-indigo-600:hover, .hover\\:text-blue-600:hover { color: var(--brand); }
.shadow-blue-100, .shadow-blue-200 { --tw-shadow-color: rgba(0,143,135,.18); }

html[data-theme="dark"] { color-scheme: dark; --ink: #e6edf7; --muted: #9cabbe; --line: #263447; --surface: #111b2a; --canvas: #0a1220; --brand-soft: #182a45; --success-soft: #113d30; --warning-soft: #4a3512; --danger-soft: #481f2a; --info-soft: #132f50; }
html[data-theme="dark"] .app-shell { background: radial-gradient(circle at 50% -20%, #152a47 0, transparent 32rem); }
html[data-theme="dark"] .bg-white, html[data-theme="dark"] .bg-slate-50, html[data-theme="dark"] .bg-gray-50 { background-color: var(--surface); }
html[data-theme="dark"] .bg-slate-100, html[data-theme="dark"] .bg-gray-100 { background-color: #182536; }
html[data-theme="dark"] .border-slate-200, html[data-theme="dark"] .border-gray-200, html[data-theme="dark"] .border-gray-100 { border-color: var(--line); }
html[data-theme="dark"] .text-slate-900, html[data-theme="dark"] .text-gray-900, html[data-theme="dark"] .text-slate-800, html[data-theme="dark"] .text-gray-800, html[data-theme="dark"] .page-heading, html[data-theme="dark"] .brand-wordmark { color: var(--ink); }
html[data-theme="dark"] .text-slate-700, html[data-theme="dark"] .text-gray-700 { color: #c3cfdd; } html[data-theme="dark"] .text-slate-600, html[data-theme="dark"] .text-gray-600, html[data-theme="dark"] .text-gray-500 { color: var(--muted); }
html[data-theme="dark"] .panel, html[data-theme="dark"] .detail-hero, html[data-theme="dark"] .detail-kpi, html[data-theme="dark"] .field, html[data-theme="dark"] .chart-select { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .panel-soft, html[data-theme="dark"] .site-row, html[data-theme="dark"] .history-row, html[data-theme="dark"] .monitor-history { background: #0f1928; border-color: var(--line); }
html[data-theme="dark"] .site-card, html[data-theme="dark"] .status-service { border-color: var(--line); box-shadow: 0 10px 25px rgba(0,0,0,.18); }
html[data-theme="dark"] .monitor-identity a, html[data-theme="dark"] .monitor-kpi-value, html[data-theme="dark"] .detail-kpi strong, html[data-theme="dark"] .detail-list dd, html[data-theme="dark"] .chart-heading h2, html[data-theme="dark"] .detail-section-title { color: var(--ink); }
html[data-theme="dark"] .theme-toggle { background: #182536; border-color: #31445d; color: #d5e1ef; }html[data-theme="dark"] .theme-icon-sun { display: none; }html[data-theme="dark"] .theme-icon-moon { display: block; }
html[data-theme="dark"] .brand-logo-light { display: none; }html[data-theme="dark"] .brand-logo-dark { display: block; }

@media (max-width: 768px) {
  .app-nav { height: auto; padding-top: 1rem; padding-bottom: 1rem; }
  .site-row { align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
  .site-row > div { width: auto !important; }
  .monitor-kpi { border-left: 0; border-top: 1px solid #eef2f7; padding: .7rem 1rem 0 0; }
  .uptime-strip { min-width: 100%; grid-template-columns: repeat(auto-fit, minmax(3px, 1fr)); }
}
