:root {
    --cc-bg: #eef3f1;
    --cc-surface: #ffffff;
    --cc-ink: #15231f;
    --cc-muted: #5f726c;
    --cc-teal: #0f766e;
    --cc-teal-dark: #0b5a54;
    --cc-teal-soft: #d8f3ef;
    --cc-slate: #334155;
    --cc-coral: #c2410c;
    --cc-amber: #b45309;
    --cc-border: #d7e3de;
    --cc-sidebar: #0f1f1c;
    --cc-sidebar-text: #c8d8d3;
    --cc-shadow: 0 18px 40px rgba(15, 31, 28, 0.08);
    --font-body: "DM Sans", sans-serif;
    --font-display: "Instrument Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: var(--font-body);
    color: var(--cc-ink);
    background: var(--cc-bg);
}

h1, h2, h3, .brand-name, .topbar-title, .login-brand h1 {
    font-family: var(--font-display);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.35), transparent 45%),
        linear-gradient(180deg, #122824 0%, var(--cc-sidebar) 100%);
    color: var(--cc-sidebar-text);
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding: 0.5rem 0.75rem 1.5rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.35);
}

.brand-mark.lg {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
    border-radius: 18px;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.78rem;
    opacity: 0.7;
}

.nav-section-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
    padding: 1rem 0.85rem 0.4rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--cc-sidebar-text);
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-nav .nav-link i {
    width: 1.1rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
    background: rgba(20, 184, 166, 0.18);
    color: #fff;
    box-shadow: inset 3px 0 0 #14b8a6;
}

.sidebar-nav .nav-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.badge-soon {
    margin-left: auto;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.main-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 72px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cc-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.btn-icon {
    border: 1px solid var(--cc-border);
    background: #fff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
}

.topbar-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.user-chip-btn {
    border: 1px solid var(--cc-border);
    background: #fff;
    border-radius: 14px;
    padding: 0.35rem 0.7rem 0.35rem 0.4rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-chip-btn:hover,
.user-chip-btn:focus,
.user-chip-btn[aria-expanded="true"] {
    background: #f8faf9;
    border-color: #c5d6d0;
}

.user-chip-caret {
    font-size: 0.7rem;
    color: var(--cc-muted);
    margin-left: 0.15rem;
}

.user-dropdown {
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    box-shadow: var(--cc-shadow);
    padding: 0.4rem;
    min-width: 200px;
}

.user-dropdown .dropdown-item {
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.92rem;
}

.profile-tabs .nav-link {
    color: var(--cc-muted);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-weight: 600;
}

.profile-tabs .nav-link.active {
    color: var(--cc-teal-dark);
    border-bottom-color: var(--cc-teal);
    background: transparent;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--cc-teal-soft);
    color: var(--cc-teal-dark);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.1;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--cc-muted);
}

.btn-outline-logout {
    border: 1px solid var(--cc-border);
    background: #fff;
    color: var(--cc-ink);
    border-radius: 12px;
    padding: 0.55rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-outline-logout:hover {
    background: #f8faf9;
}

.content-area {
    padding: 1.5rem;
}

.page-intro h1 {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.page-intro p {
    color: var(--cc-muted);
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-tile {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    display: flex;
    gap: 0.9rem;
    align-items: center;
    box-shadow: var(--cc-shadow);
    animation: rise 0.45s ease both;
}

button.stat-tile {
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
}

.stat-tile.is-clickable {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-tile.is-clickable:hover {
    border-color: #0f766e;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
    transform: translateY(-1px);
}

.stat-tile.is-clickable:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

.stat-tile:nth-child(2) { animation-delay: 0.05s; }
.stat-tile:nth-child(3) { animation-delay: 0.1s; }
.stat-tile:nth-child(4) { animation-delay: 0.15s; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
}

.stat-icon.teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.stat-icon.slate { background: linear-gradient(135deg, #64748b, #334155); }
.stat-icon.coral { background: linear-gradient(135deg, #fb923c, #c2410c); }
.stat-icon.amber { background: linear-gradient(135deg, #fbbf24, #b45309); }

.stat-label {
    font-size: 0.82rem;
    color: var(--cc-muted);
}

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

.panel-block {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: var(--cc-shadow);
    animation: rise 0.5s ease 0.1s both;
}

.panel-head h2 {
    font-size: 1.15rem;
    margin: 0;
}

.panel-head p {
    color: var(--cc-muted);
    margin: 0.2rem 0 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-pill.success {
    background: #dcfce7;
    color: #166534;
}

.status-pill.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-pill.warning {
    background: #ffedd5;
    color: #9a3412;
}

.status-pill.info {
    background: #e0f2fe;
    color: #075985;
}

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

.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cc-muted);
    border-bottom-width: 1px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    background: #0f1f1c;
}

.login-atmosphere {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, 0.28), transparent 35%),
        radial-gradient(circle at 80% 70%, rgba(251, 146, 60, 0.18), transparent 30%),
        linear-gradient(160deg, #0f1f1c, #16332d 55%, #0b1614);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 2rem));
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
    animation: rise 0.55s ease both;
}

.login-brand {
    color: #fff;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand h1 {
    font-size: clamp(2.2rem, 4vw, 3rem);
    margin: 1rem 0 0.4rem;
}

.login-brand p {
    opacity: 0.75;
    max-width: 24rem;
}

.login-panel {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.login-panel h2 {
    margin-bottom: 0.35rem;
}

.login-lead {
    color: var(--cc-muted);
    margin-bottom: 1.5rem;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cc-muted);
}

.input-icon .form-control {
    padding-left: 2.5rem;
    border-radius: 12px;
    border-color: var(--cc-border);
    min-height: 46px;
}

.btn-login {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    border: none;
    color: #fff;
    border-radius: 12px;
    min-height: 48px;
    font-weight: 600;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0f766e, #0b5a54);
    color: #fff;
}

.sidebar-backdrop {
    display: none;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 31, 28, 0.45);
        z-index: 1035;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        text-align: center;
        align-items: center;
        padding-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-meta {
        display: none;
    }

    .content-area {
        padding: 1rem;
    }
}
