:root {
    --ccg-bg: #17131d;
    --ccg-bg-deep: #100d14;
    --ccg-surface: #211a29;
    --ccg-surface-raised: #2a2133;
    --ccg-surface-hover: #33283e;

    --ccg-text: #f7eee8;
    --ccg-text-muted: #bcaebb;

    --ccg-sunrise-red: #ef4d42;
    --ccg-sunrise-orange: #ff8b3d;
    --ccg-sunrise-gold: #ffc56f;

    --ccg-border: rgba(255, 139, 61, 0.16);
    --ccg-border-strong: rgba(255, 139, 61, 0.38);

    --ccg-shadow:
        0 20px 50px rgba(0, 0, 0, 0.28);

    --ccg-sidebar-width: 17rem;

    --bs-body-bg: var(--ccg-bg);
    --bs-body-color: var(--ccg-text);
    --bs-secondary-color: var(--ccg-text-muted);
    --bs-border-color: var(--ccg-border);
    --bs-link-color: var(--ccg-sunrise-orange);
    --bs-link-hover-color: var(--ccg-sunrise-gold);
}

html,
body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(
            circle at 90% 5%,
            rgba(239, 77, 66, 0.12),
            transparent 30rem
        ),
        radial-gradient(
            circle at 10% 90%,
            rgba(255, 139, 61, 0.08),
            transparent 35rem
        ),
        var(--ccg-bg);
    color: var(--ccg-text);
}

::selection {
    background: var(--ccg-sunrise-orange);
    color: var(--ccg-bg-deep);
}

.ccg-shell {
    min-height: 100vh;
}

.ccg-sidebar {
    width: var(--ccg-sidebar-width);
    background:
        linear-gradient(
            180deg,
            rgba(42, 33, 51, 0.96),
            rgba(16, 13, 20, 0.98)
        );
    border-right: 1px solid var(--ccg-border);
}

.ccg-brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-grid;
    place-items: center;
    border-radius: 0.65rem;
    color: var(--ccg-bg-deep);
    background:
        linear-gradient(
            135deg,
            var(--ccg-sunrise-red),
            var(--ccg-sunrise-orange),
            var(--ccg-sunrise-gold)
        );
    box-shadow:
        0 0 1.4rem rgba(255, 139, 61, 0.22);
}

.ccg-brand-title {
    color: var(--ccg-text);
    font-weight: 700;
    letter-spacing: 0.025em;
}

.ccg-brand-subtitle {
    color: var(--ccg-sunrise-orange);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ccg-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.65rem;
    color: var(--ccg-text-muted);
    transition:
        color 160ms ease,
        background-color 160ms ease,
        transform 160ms ease;
}

.ccg-nav .nav-link:hover,
.ccg-nav .nav-link:focus-visible {
    color: var(--ccg-text);
    background: rgba(255, 139, 61, 0.08);
    transform: translateX(0.15rem);
}

.ccg-nav .nav-link.active {
    color: var(--ccg-text);
    background:
        linear-gradient(
            90deg,
            rgba(239, 77, 66, 0.17),
            rgba(255, 139, 61, 0.08)
        );
}

.ccg-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    width: 0.2rem;
    height: 55%;
    border-radius: 99rem;
    background:
        linear-gradient(
            var(--ccg-sunrise-red),
            var(--ccg-sunrise-orange)
        );
    box-shadow:
        0 0 0.8rem rgba(255, 139, 61, 0.5);
}

.ccg-nav .nav-link.disabled {
    opacity: 0.45;
}

.ccg-main {
    min-width: 0;
}

.ccg-topbar {
    min-height: 4.5rem;
    background: rgba(23, 19, 29, 0.82);
    border-bottom: 1px solid var(--ccg-border);
    backdrop-filter: blur(16px);
}

.ccg-page-heading {
    font-weight: 700;
    letter-spacing: -0.025em;
}

.ccg-page-kicker {
    color: var(--ccg-sunrise-orange);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ccg-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    background:
        linear-gradient(
            145deg,
            rgba(42, 33, 51, 0.96),
            rgba(33, 26, 41, 0.96)
        );
    border: 1px solid var(--ccg-border);
    border-radius: 1rem;
    box-shadow: var(--ccg-shadow);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.ccg-card::after {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 139, 61, 0.55),
            transparent
        );
}

.ccg-card:hover {
    transform: translateY(-0.15rem);
    border-color: var(--ccg-border-strong);
    box-shadow:
        0 24px 58px rgba(0, 0, 0, 0.34);
}

.ccg-card-icon {
    width: 2.7rem;
    height: 2.7rem;
    display: inline-grid;
    place-items: center;
    border-radius: 0.75rem;
    color: var(--ccg-sunrise-gold);
    background: rgba(255, 139, 61, 0.1);
    border: 1px solid rgba(255, 139, 61, 0.14);
}

.ccg-muted {
    color: var(--ccg-text-muted);
}

.ccg-accent-text {
    color: var(--ccg-sunrise-orange);
}

.ccg-btn-primary {
    --bs-btn-color: var(--ccg-bg-deep);
    --bs-btn-bg: var(--ccg-sunrise-orange);
    --bs-btn-border-color: var(--ccg-sunrise-orange);
    --bs-btn-hover-color: var(--ccg-bg-deep);
    --bs-btn-hover-bg: var(--ccg-sunrise-gold);
    --bs-btn-hover-border-color: var(--ccg-sunrise-gold);
    --bs-btn-active-color: var(--ccg-bg-deep);
    --bs-btn-active-bg: var(--ccg-sunrise-gold);
    --bs-btn-active-border-color: var(--ccg-sunrise-gold);
    font-weight: 700;
}

.form-control {
    background: rgba(16, 13, 20, 0.72);
    border-color: var(--ccg-border);
    color: var(--ccg-text);
}

.form-control:focus {
    background: rgba(16, 13, 20, 0.9);
    border-color: var(--ccg-sunrise-orange);
    color: var(--ccg-text);
    box-shadow:
        0 0 0 0.2rem rgba(255, 139, 61, 0.12);
}

.ccg-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.ccg-login-card {
    width: min(100%, 30rem);
    height: auto;
}

.ccg-sunrise-rule {
    width: 4.5rem;
    height: 0.2rem;
    border: 0;
    border-radius: 99rem;
    opacity: 1;
    background:
        linear-gradient(
            90deg,
            var(--ccg-sunrise-red),
            var(--ccg-sunrise-orange),
            var(--ccg-sunrise-gold)
        );
}

.ccg-fade-in {
    animation: ccg-fade-in 300ms ease both;
}

@keyframes ccg-fade-in {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 992px) {
    .ccg-main {
        margin-left: var(--ccg-sidebar-width);
    }

    .ccg-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1030;
    }

    .ccg-sidebar .offcanvas-header {
        display: flex;
    }
}

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

/* Operational state colours are semantic and deliberately separate
   from the CCG sunrise brand palette. */
:root {
    --ccg-state-success: #68d391;
    --ccg-state-warning: #f6c85f;
    --ccg-state-danger: #ff6b6b;
    --ccg-state-neutral: #a69dac;

    --ccg-state-success-bg: rgba(104, 211, 145, 0.10);
    --ccg-state-warning-bg: rgba(246, 200, 95, 0.10);
    --ccg-state-danger-bg: rgba(255, 107, 107, 0.10);
    --ccg-state-neutral-bg: rgba(166, 157, 172, 0.10);
}

.ccg-card-value {
    color: var(--ccg-text);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.ccg-card-detail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--ccg-text-muted);
    font-size: 0.875rem;
}

.ccg-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.65rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 999rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.ccg-status-success {
    color: var(--ccg-state-success);
    background: var(--ccg-state-success-bg);
    border-color: rgba(104, 211, 145, 0.24);
}

.ccg-status-warning {
    color: var(--ccg-state-warning);
    background: var(--ccg-state-warning-bg);
    border-color: rgba(246, 200, 95, 0.24);
}

.ccg-status-danger {
    color: var(--ccg-state-danger);
    background: var(--ccg-state-danger-bg);
    border-color: rgba(255, 107, 107, 0.24);
}

.ccg-status-neutral {
    color: var(--ccg-state-neutral);
    background: var(--ccg-state-neutral-bg);
    border-color: rgba(166, 157, 172, 0.22);
}

.ccg-state-success-text {
    color: var(--ccg-state-success);
}

.ccg-state-warning-text {
    color: var(--ccg-state-warning);
}

.ccg-state-danger-text {
    color: var(--ccg-state-danger);
}

.ccg-runtime-status {
    color: var(--ccg-text);
    font-weight: 600;
    text-transform: capitalize;
}
