/* Status dashboard + login - dark theme, palette pulled from soteriasolutions.co.za's own
   brand colours (#071427/#0B192C navy, #5b79ff/#2fb0ff blue accents) rather than a generic
   dark-mode grey, so this reads as the same product rather than an unrelated internal tool. */

:root {
    --bg-deep: #071427;
    --bg-panel: #0b192c;
    --bg-panel-alt: #0f2a46;
    --border: rgba(122, 177, 255, 0.16);
    --border-strong: rgba(122, 177, 255, 0.32);
    --text: #eaf2ff;
    --text-muted: #8ba3c7;
    --text-faint: #4b6180;
    --accent: #5b79ff;
    --accent-cyan: #2fb0ff;
    --online: #34d399;
    --online-bg: rgba(52, 211, 153, 0.12);
    --offline: #f2495c;
    --offline-bg: rgba(242, 73, 92, 0.14);
    --warn: #fbbf24;
    --font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: radial-gradient(circle at top, var(--bg-panel) 0%, var(--bg-deep) 65%);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Login ---------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.auth-brand {
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 24px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 121, 255, 0.25);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 11px 12px;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.validation-summary {
    background: var(--offline-bg);
    border: 1px solid var(--offline);
    color: #ffd7db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

/* ---------- Dashboard ---------- */

.dash-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-brand .mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.dash-brand .titles .name {
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.95rem;
}

.dash-brand .titles .subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dash-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
    flex-shrink: 0;
}

.dot.live {
    background: var(--online);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
    animation: pulse 2s infinite;
}

.dot.dead {
    background: var(--offline);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}

.stat-card .value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.stat-card.online .value { color: var(--online); }
.stat-card.offline .value { color: var(--offline); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--online);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card.down {
    border-left-color: var(--offline);
    background: linear-gradient(180deg, var(--offline-bg), var(--bg-panel-alt) 60%);
    box-shadow: 0 0 0 1px rgba(242, 73, 92, 0.25);
}

.card .row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
}

.pill.online {
    background: var(--online-bg);
    color: var(--online);
}

.pill.offline {
    background: var(--offline-bg);
    color: var(--offline);
}

.card .company {
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 2px;
}

.card .controller {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0 0 12px;
}

.card .meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 5px 0;
    border-top: 1px solid var(--border);
}

.card .meta-row:first-of-type {
    border-top: none;
}

.card .meta-row span:last-child {
    color: var(--text);
    text-align: right;
}

.latency-badge {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.latency-good { color: var(--online); }
.latency-warn { color: var(--warn); }
.latency-bad { color: var(--offline); }
.latency-none { color: var(--text-faint); }

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 60px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
}

.sign-out-link {
    color: var(--text-muted);
    font-size: 0.85rem;
}
