:root {
    --cide-ink: #172033;
    --cide-muted: #647084;
    --cide-surface: #ffffff;
    --cide-canvas: #f4f7fb;
    --cide-primary: #123d6b;
    --cide-primary-2: #1f5f99;
    --cide-gold: #b58a32;
    --cide-border: #dbe4ef;
    --cide-focus: #7aa7d9;
    --cide-danger: #b42318;
    --cide-shadow: 0 18px 50px rgba(18, 61, 107, 0.12);
    --cide-radius-lg: 24px;
    --cide-radius-md: 16px;
    --cide-transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--cide-ink);
    background:
        radial-gradient(circle at top left, rgba(31, 95, 153, 0.12), transparent 32rem),
        linear-gradient(135deg, #f8fbff 0%, var(--cide-canvas) 48%, #eef4fb 100%);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    transform: translateY(-160%);
    padding: .75rem 1rem;
    color: #fff;
    background: var(--cide-primary);
    border-radius: .75rem;
    transition: transform var(--cide-transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.cide-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.cide-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.25rem;
    color: #eef5ff;
    background: linear-gradient(180deg, #102f52 0%, #0c243f 100%);
    border-right: 1px solid rgba(255, 255, 255, .1);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: .875rem;
    min-height: 64px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #102f52;
    background: linear-gradient(135deg, #ffffff, #d8e8f8);
    border: 2px solid rgba(181, 138, 50, .75);
    border-radius: 16px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.brand-block span,
.eyebrow,
.metric-card span,
.status-card small {
    color: var(--cide-muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.brand-block span {
    display: block;
    color: #b8c9dc;
    letter-spacing: .04em;
    text-transform: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 46px;
    color: #d8e8f8;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: background var(--cide-transition), border-color var(--cide-transition), transform var(--cide-transition);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
    transform: translateX(2px);
}

.nav-link:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid var(--cide-focus);
    outline-offset: 3px;
}

.cide-main {
    min-width: 0;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.cide-main > .content-panel {
    flex: 1 0 auto;
}

.cide-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(219, 228, 239, .9);
    border-radius: var(--cide-radius-lg);
    box-shadow: var(--cide-shadow);
    backdrop-filter: blur(14px);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.search-shell {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: min(360px, 42vw);
    min-height: 46px;
    padding: 0 .875rem;
    background: #f8fbff;
    border: 1px solid var(--cide-border);
    border-radius: 999px;
    color: var(--cide-muted);
}

.search-shell input {
    width: 100%;
    min-height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--cide-ink);
}

.btn {
    min-height: 44px;
    border-radius: 999px;
    transition: transform var(--cide-transition), box-shadow var(--cide-transition), background var(--cide-transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-ghost,
.btn-primary-cide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.btn-ghost {
    color: var(--cide-primary);
    background: #fff;
    border: 1px solid var(--cide-border);
}

.btn-primary-cide {
    color: #fff;
    background: linear-gradient(135deg, var(--cide-primary), var(--cide-primary-2));
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 14px 28px rgba(18, 61, 107, .22);
}

.btn-primary-cide:hover,
.btn-primary-cide:focus {
    color: #fff;
    box-shadow: 0 16px 34px rgba(18, 61, 107, .28);
}

.content-panel {
    padding: 1.25rem;
    background: rgba(255, 255, 255, .64);
    border: 1px solid rgba(219, 228, 239, .85);
    border-radius: var(--cide-radius-lg);
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 58%, #edf5fc 100%);
    border: 1px solid var(--cide-border);
    border-radius: var(--cide-radius-lg);
    box-shadow: var(--cide-shadow);
}

.hero-card h2 {
    margin-bottom: .5rem;
    color: var(--cide-primary);
    font-weight: 750;
    letter-spacing: -.035em;
}

.hero-card p:last-child {
    max-width: 62ch;
    margin-bottom: 0;
    color: var(--cide-muted);
}

.status-card,
.metric-card {
    background: var(--cide-surface);
    border: 1px solid var(--cide-border);
    border-radius: var(--cide-radius-md);
    box-shadow: 0 10px 30px rgba(23, 32, 51, .07);
}

.status-card {
    display: grid;
    gap: .25rem;
    min-width: 190px;
    padding: 1rem;
}

.status-dot {
    width: .75rem;
    height: .75rem;
    background: #1f9d69;
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(31, 157, 105, .12);
}

.metric-card {
    display: grid;
    gap: .35rem;
    min-height: 150px;
    padding: 1.2rem;
}

.metric-card i {
    color: var(--cide-gold);
    font-size: 1.65rem;
}

.metric-card strong {
    color: var(--cide-primary);
    font-size: 1.35rem;
}

.form-floating > label {
    color: var(--cide-muted);
}

.form-control,
.form-select {
    min-height: 48px;
    border-color: var(--cide-border);
    border-radius: 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cide-primary-2);
    box-shadow: 0 0 0 .25rem rgba(31, 95, 153, .15);
}

.auth-body {
    min-height: 100vh;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.25rem;
}

.auth-card {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(320px, .75fr);
    width: min(980px, 100%);
    overflow: hidden;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--cide-border);
    border-radius: 30px;
    box-shadow: var(--cide-shadow);
    backdrop-filter: blur(14px);
}

.auth-panel-copy {
    padding: clamp(1.5rem, 4vw, 3rem);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(18, 61, 107, .96), rgba(12, 36, 63, .96)),
        radial-gradient(circle at 20% 10%, rgba(181, 138, 50, .45), transparent 18rem);
}

.auth-panel-copy h1 {
    max-width: 10ch;
    font-size: clamp(2rem, 5vw, 4.25rem);
    line-height: .96;
    letter-spacing: -.06em;
}

.auth-panel-copy p:not(.eyebrow) {
    max-width: 42ch;
    color: #d8e8f8;
}

.auth-brand {
    border-bottom-color: rgba(255,255,255,.16);
}

.login-form {
    display: grid;
    align-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 980px) {
    .cide-shell {
        grid-template-columns: 1fr;
    }

    .cide-sidebar {
        position: static;
        height: auto;
    }

    .cide-topbar,
    .hero-card,
    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .search-shell {
        min-width: 100%;
    }

    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-panel-copy h1 {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
