/*
 * InsightOne — app shell styles (light theme, Phase 0).
 * Chart/ink tokens follow the validated reference palette; white-label
 * theming per tenant replaces the accent variables in a later phase.
 */
:root {
    --io-page: #f9f9f7;
    --io-surface: #fcfcfb;
    --io-ink: #0b0b0b;
    --io-ink-secondary: #52514e;
    --io-ink-muted: #898781;
    --io-hairline: rgba(11, 11, 11, 0.1);
    --io-grid: #e1e0d9;
    --io-baseline: #c3c2b7;
    --io-accent: #2a78d6;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    background: var(--io-page);
    color: var(--io-ink);
}

/* ---- Brand ---- */
.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--io-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.brand-mark-sm {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ---- Auth ---- */
.auth-page {
    background: var(--io-page);
    padding: 1rem;
}

.login-card {
    max-width: 420px;
}

/* ---- App shell ---- */
.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--io-surface);
    border-inline-end: 1px solid var(--io-hairline);
    min-height: 100vh;
}

.sidebar-brand {
    height: 64px;
    display: flex;
    border-bottom: 1px solid var(--io-hairline);
}

.sidebar-link {
    border-radius: 8px;
    color: var(--io-ink-secondary);
    padding: 0.55rem 0.85rem;
}

.sidebar-link:hover:not(.disabled) {
    background: rgba(11, 11, 11, 0.04);
    color: var(--io-ink);
}

.sidebar-link.active {
    background: rgba(42, 120, 214, 0.12);
    color: var(--io-accent);
    font-weight: 600;
}

.topbar {
    height: 64px;
    background: var(--io-surface);
    border-bottom: 1px solid var(--io-hairline);
}

/* ---- Stat tiles ---- */
.stat-tile,
.chart-card {
    background: var(--io-surface);
    border: 1px solid var(--io-hairline);
    border-radius: 12px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(42, 120, 214, 0.12);
    color: var(--io-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--io-ink-secondary);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 650;
    line-height: 1.2;
}

/* ---- Connector gallery ---- */
.connector-card {
    background: var(--io-surface);
    border: 1px solid var(--io-hairline);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.connector-card:hover {
    border-color: rgba(42, 120, 214, 0.35);
    box-shadow: 0 2px 10px rgba(11, 11, 11, 0.06);
}

.connector-logo {
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: contain;
}

.connector-instance {
    border: 1px solid var(--io-hairline);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: rgba(11, 11, 11, 0.015);
}

.min-w-0 {
    min-width: 0;
}

/* ---- Alerts ----
 * Status colors are the reserved good/warning/serious/critical steps; every
 * alert also carries an icon and a priority label, so color never carries the
 * meaning alone.
 */
.alert-row {
    border-inline-start-width: 4px;
    border-inline-start-style: solid;
}

.alert-row.alert-critical { border-inline-start-color: #d03b3b; }
.alert-row.alert-high { border-inline-start-color: #ec835a; }
.alert-row.alert-medium { border-inline-start-color: #fab219; }
.alert-row.alert-low { border-inline-start-color: #2a78d6; }

.stat-icon.alert-critical { background: rgba(208, 59, 59, 0.12); color: #d03b3b; }
.stat-icon.alert-high { background: rgba(236, 131, 90, 0.14); color: #b4552b; }
.stat-icon.alert-medium { background: rgba(250, 178, 25, 0.16); color: #8a6100; }
.stat-icon.alert-low { background: rgba(42, 120, 214, 0.12); color: #2a78d6; }

.badge.alert-badge {
    color: #fff;
}

.badge.alert-badge.alert-critical { background: #d03b3b; }
.badge.alert-badge.alert-high { background: #b4552b; }
.badge.alert-badge.alert-medium { background: #8a6100; }
.badge.alert-badge.alert-low { background: #2a78d6; }

a.stat-tile {
    color: inherit;
}

a.stat-tile:hover {
    border-color: rgba(42, 120, 214, 0.35);
}

/* ---- Plans ---- */
.plan-card {
    background: var(--io-surface);
    border: 1px solid var(--io-hairline);
    border-radius: 12px;
}

.plan-card.plan-highlight {
    border-color: var(--io-accent);
    box-shadow: 0 2px 12px rgba(42, 120, 214, 0.12);
}

.plan-card.plan-current {
    border-color: #0ca30c;
}

.plan-price {
    font-size: 2rem;
    font-weight: 650;
    line-height: 1;
}

/* ---- Chart ---- */
.chart-holder {
    position: relative;
    height: 320px;
}

@media (max-width: 991.98px) {
    .sidebar {
        min-height: auto;
    }
}
