:root {
    --navy-950: #071426;
    --navy-900: #0b1f3a;
    --navy-800: #12365f;
    --navy-700: #174a7c;
    --blue-500: #2f80ed;
    --sky-100: #e8f2ff;
    --surface: #ffffff;
    --body-bg: #f3f7fc;
    --border: #dbe6f3;
    --text: #172033;
    --muted: #6b7a90;
}

body {
    background:
        radial-gradient(circle at top left, rgba(47,128,237,.14), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, var(--body-bg) 42%, #eef4fb 100%);
    color: var(--text);
    min-height: 100vh;
}

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

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 54%, #0f2f52 100%);
    color: #fff;
    flex-shrink: 0;
    transition: transform .2s ease;
    box-shadow: 12px 0 34px rgba(7,20,38,.18);
}

.sidebar-brand {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: .2px;
    padding: 1.35rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
}

.sidebar .nav-link {
    color: #c7d7ec;
    padding: .85rem 1.05rem;
    margin: .25rem .75rem;
    border-radius: 8px;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(47,128,237,.22);
    box-shadow: inset 3px 0 0 #73b7ff;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.navbar {
    min-height: 68px;
    box-shadow: 0 8px 28px rgba(11,31,58,.06);
}

.navbar-brand {
    color: var(--navy-900);
    font-weight: 700;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(180deg, #2f80ed 0%, #1d66c7 100%);
    border-color: #1d66c7;
    box-shadow: 0 8px 18px rgba(47,128,237,.22);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #2874d8 0%, #185bb2 100%);
    border-color: #185bb2;
}

.btn-outline-primary {
    color: var(--navy-800);
    border-color: #b8d3f4;
}

.btn-outline-primary:hover {
    background: var(--navy-800);
    border-color: var(--navy-800);
}

.stat-card {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 34px rgba(11,31,58,.08);
    overflow: hidden;
    position: relative;
}

.stat-card:before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--blue-500), var(--navy-800));
}

.stat-card .display-6 {
    color: var(--navy-900);
}

.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(11,31,58,.07);
}

.card-header {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    border-bottom-color: var(--border);
    color: var(--navy-900);
    font-weight: 700;
}

.card-body {
    color: var(--text);
}

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

.table {
    --bs-table-striped-bg: #f6f9fd;
}

.table thead th {
    color: var(--navy-800);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom-color: var(--border);
}

.table td {
    border-color: #e7eef7;
}

.form-control,
.form-select {
    border-color: #cfdbea;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 .2rem rgba(47,128,237,.16);
}

.alert {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(11,31,58,.08);
}

.category-count {
    min-width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sky-100);
    color: var(--navy-800);
    font-weight: 700;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(11,31,58,.14);
    overflow: hidden;
}

.auth-card:before {
    content: "";
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--navy-900), var(--blue-500));
}

.table td,
.table th {
    vertical-align: middle;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1040;
        height: 100vh;
        transform: translateX(-100%);
    }

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