/* SKYLEO Portal — component styles. Load after tokens.css. Classes are prefixed sp-. */

.sp-root { font-family: var(--font-text); color: var(--ink); background: var(--surface-000); font-size: 16px; line-height: 24px; }
.sp-num { font-variant-numeric: tabular-nums; }
.sp-muted { color: var(--ink-muted); }
.sp-icon { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sp-eyebrow { font-family: var(--font-text); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: var(--ink-muted); margin: 0; }
:where(.sp-root) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Wordmark */
.sp-wordmark { font-family: var(--font-display); font-size: 24px; line-height: 24px; color: var(--ink); letter-spacing: 0; text-decoration: none; white-space: nowrap; }
.sp-wordmark b { font-weight: 800; } .sp-wordmark span { font-weight: 400; }

/* Status badge */
.sp-status { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 14px; line-height: 20px; font-weight: 600; }
.sp-status--ok { color: var(--status-ok); } .sp-status--warn { color: var(--status-warn); }
.sp-status--down { color: var(--status-down); } .sp-status--maint { color: var(--ink-muted); }
.sp-status--down .sp-icon, .sp-status--ok .sp-icon { stroke-width: 2; }

/* Buttons */
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); font: 600 14px/20px var(--font-text); border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.sp-btn--primary { background: var(--ink); color: var(--on-ink); }
.sp-btn--secondary { background: var(--surface-000); color: var(--ink); border-color: var(--line-strong); }
.sp-btn--secondary:hover { background: var(--surface-100); }
.sp-btn--ghost { background: transparent; color: var(--ink); }
.sp-btn--ghost:hover { background: var(--surface-100); }
.sp-btn:disabled { background: var(--surface-200); color: var(--ink-faint); border-color: transparent; cursor: not-allowed; }

/* Field */
.sp-field { display: flex; flex-direction: column; gap: var(--space-1); }
.sp-field label { font-size: 14px; line-height: 20px; font-weight: 600; }
.sp-input { min-height: 44px; box-sizing: border-box; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-000); color: var(--ink); font: 400 16px/24px var(--font-text); }
.sp-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* Tag */
.sp-tag { display: inline-flex; align-items: center; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--surface-100); font: 600 12px/16px var(--font-text); letter-spacing: .08em; color: var(--ink); }
.sp-tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Header */
.sp-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.sp-header nav { display: flex; flex-wrap: wrap; gap: var(--space-1); flex: 1; }
.sp-header nav a { padding: var(--space-2) var(--space-3); min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; color: var(--ink-muted); text-decoration: none; font-size: 14px; font-weight: 600; border-radius: var(--radius-md); }
.sp-header nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.sp-header nav a:hover { background: var(--surface-100); }
.sp-header__client { font-size: 14px; color: var(--ink-muted); }

/* Uptime bar */
.sp-uptime { display: flex; gap: var(--space-half); height: 32px; align-items: stretch; }
.sp-uptime i { flex: 1; min-width: 2px; background: var(--status-ok); }
.sp-uptime i.w { background: var(--status-warn); } .sp-uptime i.d { background: var(--status-down); }
.sp-uptime i.n { background: var(--status-none); } .sp-uptime i.m { background: var(--status-maintenance); }
.sp-uptime__legend { display: flex; justify-content: space-between; font-size: 14px; line-height: 20px; color: var(--ink-muted); margin-top: var(--space-1); }

/* Service row */
.sp-service-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 2fr) auto; gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.sp-service-row__name { font-weight: 600; } .sp-service-row__name small { display: block; font-weight: 400; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
@media (max-width: 640px) { .sp-service-row { grid-template-columns: 1fr auto; } .sp-service-row .sp-uptime-wrap { grid-column: 1 / -1; order: 3; } }

/* Incident */
.sp-incident { padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.sp-incident--down { background: var(--status-down-soft); } .sp-incident--warn { background: var(--status-warn-soft); } .sp-incident--ok { background: var(--status-ok-soft); }
.sp-incident h3 { margin: 0; font: 700 22px/28px var(--font-display); }
.sp-incident ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.sp-incident li { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-3); font-size: 14px; line-height: 20px; }
.sp-incident li time { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Stat tile */
.sp-stat { background: var(--surface-100); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.sp-stat__value { font: 800 40px/44px var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sp-stat__meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }

/* Chart */
.sp-chart { display: flex; flex-direction: column; gap: var(--space-2); }
.sp-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.sp-chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.sp-chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; }
.sp-chart .compare { fill: none; stroke: var(--chart-compare); stroke-width: 1.5; stroke-dasharray: 4 4; }
.sp-chart .threshold { stroke: var(--chart-threshold); stroke-width: 1; stroke-dasharray: 2 3; }
.sp-chart text { font: 400 12px/16px var(--font-text); fill: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sp-chart text.th { fill: var(--status-warn); font-weight: 600; }
.sp-chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sp-chart__legend span::before { content: ""; display: inline-block; width: 16px; height: 0; vertical-align: middle; margin-right: var(--space-1); border-top: 2px solid var(--chart-line); }
.sp-chart__legend span.c::before { border-top: 1.5px dashed var(--chart-compare); }

/* Web Vitals meter */
.sp-vital { display: flex; flex-direction: column; gap: var(--space-1); }
.sp-vital__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.sp-vital__value { font: 700 24px/28px var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sp-vital__track { position: relative; display: grid; gap: var(--space-half); height: 8px; }
.sp-vital__track span { background: var(--surface-200); }
.sp-vital__track span:nth-child(2) { background: var(--line); } .sp-vital__track span:nth-child(3) { background: var(--ink-faint); }
.sp-vital__pin { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink); }
.sp-vital__scale { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Table */
.sp-table-wrap { overflow-x: auto; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.sp-table th { text-align: left; font: 600 12px/16px var(--font-text); letter-spacing: .08em; color: var(--ink-muted); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.sp-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.sp-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.sp-table tfoot td { font-weight: 600; border-bottom: 0; }

/* Hours meter */
.sp-hours { display: flex; flex-direction: column; gap: var(--space-2); }
.sp-hours__top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: var(--space-2); }
.sp-hours__value { font: 700 24px/28px var(--font-display); font-variant-numeric: tabular-nums; }
.sp-hours__value small { font: 400 16px/24px var(--font-text); color: var(--ink-muted); }
.sp-hours__track { position: relative; height: 12px; background: var(--status-none); display: flex; }
.sp-hours__fill { background: var(--ink); }
.sp-hours__fill--abs { position: absolute; left: 0; top: 0; bottom: 0; }
.sp-hours__carry { background: repeating-linear-gradient(135deg, var(--line-strong) 0 1px, transparent 1px 5px), var(--status-none); }
.sp-hours__split { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.sp-hours__over { background: var(--status-down); }
.sp-hours__legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sp-hours__legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: var(--space-1); vertical-align: -1px; background: var(--ink); }
.sp-hours__legend .carry::before { background: repeating-linear-gradient(135deg, var(--line-strong) 0 1px, transparent 1px 5px), var(--status-none); }
.sp-hours__legend .left::before { background: var(--status-none); }
.sp-hours__roll { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 14px; line-height: 20px; font-weight: 600; }

/* Service item */
.sp-service { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.sp-service h3 { margin: 0; font: 700 22px/28px var(--font-display); }
.sp-service p { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); grid-column: 1; }
.sp-service__price { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-service__price small { display: block; font-weight: 400; font-size: 14px; color: var(--ink-muted); }

/* Maintenance log */
.sp-log { list-style: none; margin: 0; padding: 0; }
.sp-log li { display: grid; grid-template-columns: 96px 1fr auto; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; align-items: start; }
.sp-log time { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sp-log .sp-tag { justify-self: end; }
@media (max-width: 520px) { .sp-log li { grid-template-columns: 1fr auto; } .sp-log time { grid-column: 1 / -1; } }

/* Login gate */
.sp-gate { max-width: 400px; margin: 0 auto; padding: var(--space-5) var(--space-4); background: var(--surface-000); border: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--space-4); }
.sp-gate h1 { margin: 0; font: 700 32px/36px var(--font-display); letter-spacing: -.01em; }
.sp-gate p { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
