:root {
    --ci-bg: #f4f7fb;
    --ci-panel: rgba(255, 255, 255, 0.9);
    --ci-text: #172033;
    --ci-muted: #64748b;
    --ci-line: rgba(23, 32, 51, 0.12);
    --ci-brand: #116a7b;
    --ci-brand-strong: #0c4f5c;
    --ci-accent: #f2b544;
    --ci-good: #178a62;
}

[data-bs-theme="dark"] {
    --ci-bg: #101318;
    --ci-panel: rgba(25, 30, 38, 0.94);
    --ci-text: #eef3f8;
    --ci-muted: #a9b4c4;
    --ci-line: rgba(238, 243, 248, 0.13);
    --ci-brand: #4cc4d6;
    --ci-brand-strong: #8bdbe7;
    --ci-accent: #f4c766;
    --ci-good: #54d19b;
}

body {
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 20% 0%, rgba(17, 106, 123, 0.13), transparent 34rem),
        linear-gradient(180deg, var(--ci-bg), color-mix(in srgb, var(--ci-bg) 88%, #ffffff));
    color: var(--ci-text);
}

.app-navbar {
    background: color-mix(in srgb, var(--ci-bg) 84%, transparent);
    border-bottom: 1px solid var(--ci-line);
    backdrop-filter: blur(16px);
}

.navbar-brand {
    color: var(--ci-text);
}

.brand-mark {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    margin-right: .5rem;
    place-items: center;
    border-radius: .5rem;
    background: var(--ci-brand);
    color: #fff;
    font-size: .82rem;
}

.btn-icon {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--ci-line);
    background: var(--ci-panel);
    color: var(--ci-text);
}

.panel,
.metric,
.empty-state {
    border: 1px solid var(--ci-line);
    border-radius: .75rem;
    background: var(--ci-panel);
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.08);
}

.panel {
    padding: clamp(1.25rem, 2vw, 2rem);
}

.app-hero h1 {
    max-width: 12ch;
    margin-bottom: 1rem;
    font-size: clamp(2.1rem, 4vw, 4.2rem);
    line-height: .98;
    letter-spacing: 0;
}

.admin-title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: 0;
}

.section-kicker {
    margin-bottom: .65rem;
    color: var(--ci-brand-strong);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--ci-line);
    background-color: color-mix(in srgb, var(--ci-panel) 90%, transparent);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ci-brand);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--ci-brand) 20%, transparent);
}

.btn-primary {
    --bs-btn-bg: var(--ci-brand);
    --bs-btn-border-color: var(--ci-brand);
    --bs-btn-hover-bg: var(--ci-brand-strong);
    --bs-btn-hover-border-color: var(--ci-brand-strong);
}

.metric {
    padding: 1rem;
}

.metric span {
    display: block;
    color: var(--ci-muted);
    font-size: .85rem;
}

.metric strong,
.compare-total {
    display: block;
    margin-top: .2rem;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.empty-state {
    display: grid;
    min-height: 34rem;
    padding: 2rem;
    align-content: center;
}

.empty-visual {
    width: min(100%, 28rem);
    aspect-ratio: 16 / 10;
    margin-bottom: 1.5rem;
    border-radius: .75rem;
    background:
        linear-gradient(135deg, rgba(17, 106, 123, .88), rgba(84, 209, 155, .78)),
        repeating-linear-gradient(90deg, transparent 0 2.2rem, rgba(255,255,255,.16) 2.2rem 2.25rem);
    position: relative;
    overflow: hidden;
}

.empty-visual::after {
    content: "";
    position: absolute;
    inset: 18% 12%;
    border-radius: .6rem;
    background:
        linear-gradient(#fff, #fff) 1rem 1.2rem / 42% .45rem no-repeat,
        linear-gradient(#fff, #fff) 1rem 2.4rem / 70% .45rem no-repeat,
        linear-gradient(#fff, #fff) 1rem 3.6rem / 56% .45rem no-repeat,
        rgba(255, 255, 255, .22);
}

.table {
    --bs-table-bg: transparent;
}

.badge {
    white-space: normal;
    text-align: left;
}

.source-muted {
    opacity: .48;
}

.suggestion-group {
    height: 100%;
    border: 1px solid var(--ci-line);
    border-radius: .75rem;
    overflow: hidden;
}

.suggestion-title {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--ci-line);
    font-weight: 800;
    text-transform: uppercase;
}

.suggestion-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--ci-line);
}

.suggestion-row:last-child {
    border-bottom: 0;
}

.suggestion-pills {
    display: grid;
    gap: .5rem;
    max-height: 16rem;
    overflow: auto;
}

.suggestion-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--ci-line);
    border-radius: .5rem;
    background: color-mix(in srgb, var(--ci-panel) 90%, transparent);
    color: var(--ci-text);
    text-align: left;
}

.suggestion-pill span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.suggestion-pill strong {
    white-space: nowrap;
    color: var(--ci-brand-strong);
}

@media (max-width: 575.98px) {
    .panel {
        padding: 1rem;
    }

    .app-hero h1 {
        max-width: 100%;
        font-size: 2.4rem;
    }

    .empty-state {
        min-height: 24rem;
    }
}
