:root {
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --accent-light: #eef2ff;
    --bg-body: #f6f7fb;
    --border-color: #e6e8f0;
    --text-muted-2: #6b7280;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    min-height: 100vh;
    color: #1f2937;
}

a {
    text-decoration: none;
}

/* --- App shell: sidebar + main --------------------------------------- */

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

.app-shell-guest {
    background:
        radial-gradient(circle at 15% 10%, var(--accent-light), transparent 45%),
        var(--bg-body);
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

.sidebar-body {
    padding: 1.25rem 1rem;
    height: 100%;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
    padding: .5rem .5rem 1.25rem;
}

.sidebar-brand i {
    color: var(--accent);
    font-size: 1.25rem;
}

.sidebar-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted-2);
    padding: .5rem .8rem .35rem;
}

.sidebar-section-title:not(:first-child) {
    margin-top: .5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.sidebar-nav .nav-link {
    color: #374151;
    border-radius: .6rem;
    padding: .65rem .8rem;
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .925rem;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.sidebar-nav .nav-link.active {
    background: var(--accent);
    color: #fff;
}

.sidebar-footer {
    padding: .5rem;
}

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

.app-topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    gap: .75rem;
}

.app-topbar-title {
    font-weight: 600;
    color: #374151;
}

.app-content {
    padding: 1.5rem;
    flex: 1;
}

.guest-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 1rem;
    }
}

/* --- Topbar user menu --------------------------------------------------- */

.btn-icon {
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: .6rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 999px;
    padding: .3rem .9rem .3rem .3rem;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

/* --- Cards / general ------------------------------------------------- */

.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    border-radius: .85rem;
}

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}

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

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

/* --- Dashboard quick-access cards ------------------------------------ */

.quick-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: .85rem;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #1f2937;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    height: 100%;
}

.quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .12);
    border-color: var(--accent);
    color: #1f2937;
}

.quick-card-icon {
    width: 46px;
    height: 46px;
    border-radius: .7rem;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card {
    border-radius: .85rem;
    border: 1px solid var(--border-color);
    background: #fff;
    padding: 1.1rem 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #111827;
}

.stat-card .stat-label {
    color: var(--text-muted-2);
    font-size: .875rem;
}
