:root {
    --brand: #ff6b4a;
    --brand-dark: #e8532f;
    --brand-light: #ffe6de;
    --ink: #17181c;
    --muted: #9a9ca3;
    --sidebar-w: 250px;
    --sidebar-bg: #1c1c1f;
    --sidebar-bg-soft: rgba(255, 255, 255, 0.06);
    --radius: 1.25rem;
    --radius-lg: 1.75rem;
    --btn-grad: linear-gradient(155deg, #46474d 0%, #26262a 45%, #1c1c1f 75%, #101012 100%);
    --btn-grad-hover: linear-gradient(155deg, #57585f 0%, #313136 45%, #202023 75%, #000000 100%);
}

body {
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 40%),
        radial-gradient(circle at 100% 100%, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 55%),
        linear-gradient(135deg, #eef0f2 0%, #d8dade 35%, #b9bcc3 75%, #9a9da4 100%);
    background-attachment: fixed;
    color: var(--ink);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* ---------- App shell / sidebar ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem;
}

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(165deg, #46474d 0%, #26262a 32%, #1c1c1f 62%, #101012 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1.25rem;
    height: calc(100vh - 2.5rem);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    padding: 0 0.4rem;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand);
    display: inline-block;
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.25);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.55rem 0.6rem;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.side-link .side-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: var(--sidebar-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
}

.side-link:hover {
    color: #fff;
}

.side-link.active {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
    color: #fff;
    font-weight: 600;
}

.side-link.active .side-icon {
    background: #fff;
    color: var(--brand);
}

.sidebar-promo {
    background: linear-gradient(155deg, #4c4d54 0%, #2a2a2e 45%, #151517 100%);
    border-radius: var(--radius);
    padding: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-promo::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand) 0%, rgba(255, 107, 74, 0) 70%);
}

.sidebar-promo p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.sidebar-promo strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    position: relative;
}

.sidebar-promo .btn {
    position: relative;
    background: linear-gradient(155deg, #6a6b72 0%, #38383d 45%, #1c1c1f 85%, #101012 100%);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.sidebar-promo .btn:hover {
    background: linear-gradient(155deg, #78797f 0%, #45454b 45%, #232326 85%, #000000 100%);
    color: #fff;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.user-chip {
    font-size: 0.82rem;
    color: var(--muted);
    padding: 0 0.4rem;
}

.btn-logout {
    background: linear-gradient(155deg, #6a6b72 0%, #38383d 45%, #1c1c1f 85%, #101012 100%);
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-logout:hover {
    background: linear-gradient(155deg, #78797f 0%, #45454b 45%, #232326 85%, #000000 100%);
    color: #fff;
}

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

.content-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(18px);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 24px 60px rgba(20, 20, 40, 0.18);
    min-height: calc(100vh - 2.5rem);
}

.page-title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ---------- Mobile sidebar toggle ---------- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    width: 42px;
    height: 42px;
    border-radius: 0.9rem;
    border: none;
    background: linear-gradient(155deg, #46474d 0%, #1c1c1f 70%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 991.98px) {
    .app-shell {
        padding: 0;
        gap: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        z-index: 1045;
        left: 0.75rem;
        top: 0.75rem;
        height: calc(100vh - 1.5rem);
        transform: translateX(-120%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
    }

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

    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1040;
    }

    .content-panel {
        border-radius: 0;
        padding: 1.1rem;
        padding-top: 4.5rem;
        min-height: 100vh;
    }
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(165deg, #ffffff 0%, #f7f7f9 100%);
    box-shadow: 0 10px 28px -6px rgba(20, 20, 40, 0.12);
}

.card-title {
    font-weight: 600;
}

.card.card-accent {
    background: linear-gradient(160deg, #3a3b40 0%, #232327 55%, #1c1c1f 100%);
    background: linear-gradient(160deg in oklch, #3a3b40 0%, #232327 55%, #1c1c1f 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    background: linear-gradient(155deg, #6a6b72 0%, #38383d 45%, #1c1c1f 85%, #101012 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card.card-accent::after {
    content: '';
    position: absolute;
    right: -18px;
    bottom: -24px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand) 0%, rgba(255, 107, 74, 0) 70%);
}

.card.card-accent .text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* ---------- Quick action icon buttons ---------- */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink);
    width: 74px;
}

.quick-action .quick-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(165deg, #ffffff 0%, #f0f1f3 100%);
    box-shadow:
        0 12px 20px -6px rgba(20, 20, 40, 0.22),
        0 2px 4px rgba(20, 20, 40, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--brand);
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.quick-action:hover .quick-icon {
    background: var(--btn-grad);
    color: #fff;
    transform: translateY(-2px);
    box-shadow:
        0 14px 22px -6px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(20, 20, 40, 0.1);
}

.quick-action span.label {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 0.65rem;
    font-weight: 500;
}

.btn-primary {
    background: var(--btn-grad);
    border-color: #1c1c1f;
    color: #fff;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.45);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--btn-grad-hover);
    border-color: #000;
    color: #fff;
    box-shadow: 0 10px 20px -4px rgba(0, 0, 0, 0.55);
}

.btn-outline-primary {
    color: var(--ink);
    border-color: #1c1c1f;
    background: linear-gradient(155deg, #ffffff 0%, #f2f2f3 100%);
}

.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-outline-primary.active,
.btn-outline-primary:active {
    background: var(--btn-grad);
    border-color: #1c1c1f;
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(155deg, #4a4b52 0%, #2a2a2e 100%);
    border-color: #2a2a2e;
}

.btn-outline-danger:hover {
    background: linear-gradient(155deg, #f0685c 0%, #dc3545 100%);
}

.btn-outline-secondary {
    color: var(--ink);
    background: linear-gradient(155deg, #ffffff 0%, #f3f4f6 100%);
}

.btn-outline-secondary:hover,
.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary,
.btn-outline-secondary.active,
.btn-outline-secondary:active {
    background: linear-gradient(155deg, #6a6b72 0%, #38383d 45%, #1c1c1f 85%, #101012 100%);
    border-color: #1c1c1f;
    color: #fff;
}

/* ---------- Tables / misc ---------- */
.table {
    background: #fff;
}

.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
}

.progress {
    height: 0.6rem;
    border-radius: 999px;
    background-color: #ececef;
}

.progress-bar {
    border-radius: 999px;
}

.progress-bar.bg-success {
    background-color: var(--brand) !important;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-group .btn {
    border-radius: 999px;
}

.badge-pill-soft {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ---------- Segmented toggle ---------- */
.segmented {
    display: inline-flex;
    background: #ececef;
    border-radius: 999px;
    padding: 0.25rem;
    gap: 0.15rem;
}

.segmented .btn-check:checked + label {
    background: var(--sidebar-bg);
    color: #fff;
}

.segmented label {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
}

@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 0.2rem 0.4rem;
    }

    .page-title {
        font-size: 1.4rem;
    }
}
