:root {
    --bg-main: #f4f6fb;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #2d2d2d;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --primary-color: #6c63ff;
    --primary-hover: #574fd6;
    --navbar-bg: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] {
    --bg-main: #0f1117;
    --bg-card: #1a1d29;
    --bg-sidebar: #1a1d29;
    --text-main: #e8e8e8;
    --text-muted: #9ca3af;
    --border-color: #2a2d3a;
    --primary-color: #7c74ff;
    --primary-hover: #948dff;
    --navbar-bg: #1a1d29;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

* {
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
}

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

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

.link-primary {
    color: var(--primary-color) !important;
}

.form-control {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 10px;
}

.form-control:focus {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.15);
}

/* ===== Top Navbar ===== */
.top-navbar {
    height: 60px;
    background-color: var(--navbar-bg);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.brand-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-main);
}

.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== App Layout ===== */
.app-wrapper {
    display: flex;
    margin-top: 60px;
}

.sidebar {
    width: 240px;
    background-color: var(--bg-sidebar);
    height: calc(100vh - 60px);
    position: fixed;
    top: 60px;
    left: 0;
    box-shadow: var(--shadow);
    padding: 20px 0;
    transition: transform 0.3s ease;
    z-index: 1020;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.sidebar-menu li a i {
    font-size: 1.1rem;
}

.sidebar-menu li a:hover {
    background-color: var(--bg-main);
    color: var(--primary-color);
}

.sidebar-menu li.active a {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background-color: var(--bg-main);
    font-weight: 600;
}

.main-content {
    margin-left: 240px;
    padding: 24px;
    width: 100%;
    min-height: calc(100vh - 60px);
}

.page-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.dashboard-hero {
    background: linear-gradient(120deg, #6c63ff 0%, #8c52ff 55%, #b04dff 100%);
    color: #fff;
    border-radius: 18px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 28px rgba(108, 99, 255, 0.22);
}

.dashboard-hero-icon {
    font-size: 4rem;
    opacity: 0.25;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1015;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== Bottom Nav (Mobile App Feel) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background-color: var(--navbar-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    padding: 0 5px;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    gap: 3px;
}

.bottom-nav a i {
    font-size: 1.3rem;
}

.bottom-nav a.active {
    color: var(--primary-color);
}

.bottom-nav a.add-btn {
    background-color: var(--primary-color);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    margin-top: -28px;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.bottom-nav a.add-btn i {
    font-size: 1.6rem;
}

/* ===== Auth Pages ===== */
.auth-body {
    background-color: var(--bg-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-card);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
}

/* ===== Responsive: Desktop vs Mobile ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        padding-bottom: 85px;
        /* space for bottom nav */
    }
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Card style used across app */
.card-box {
    background-color: var(--bg-card);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* ===== Dashboard Summary Icons ===== */
.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto;
}

.summary-icon-sm {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.bg-primary-soft {
    background-color: rgba(108, 99, 255, 0.12);
    color: var(--primary-color);
}

.bg-danger-soft {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.bg-info-soft {
    background-color: rgba(13, 202, 240, 0.12);
    color: #0dcaf0;
}

.category-card {
    padding: 24px 16px;
}

.pagination .page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}


.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.avatar-md {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.activity-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}