:root {
    --bs-primary: #6366F1;
    --bs-primary-rgb: 99, 102, 241;
    --sidebar-width: 260px;
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: #6366F1;
    --content-bg: #f4f6fb;
}

body {
    background-color: var(--content-bg);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.btn-primary,
.bg-primary,
.badge.bg-primary,
.nav-pills .nav-link.active,
.page-item.active .page-link {
    background-color: #6366F1 !important;
    border-color: #6366F1 !important;
}

.text-primary {
    color: #6366F1 !important;
}

.btn-outline-primary {
    color: #6366F1;
    border-color: #6366F1;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #6366F1;
    border-color: #6366F1;
    color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.2);
}

.app-wrapper {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand i {
    color: #a5b4fc;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

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

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

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

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #6366F1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 1.5rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card.stat-card:hover,
.card.hover-lift:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.chart-container {
    position: relative;
    min-height: 280px;
    height: 280px;
}

.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
    border-bottom-width: 1px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.empty-state i {
    font-size: 2.5rem;
    color: #c7d2fe;
    margin-bottom: 1rem;
}

.guest-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 40%, #f8fafc 100%);
    padding: 1.5rem;
}

.guest-card {
    width: 100%;
    max-width: 440px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.15);
}

.guest-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.guest-brand .brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    background: #6366F1;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1035;
}

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

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

.badge-status-pending { background-color: #f59e0b !important; }
.badge-status-partially_paid { background-color: #0dcaf0 !important; color: #000 !important; }
.badge-status-fully_paid { background-color: #198754 !important; }
.badge-status-overdue { background-color: #dc3545 !important; }

.action-btns .btn {
    padding: 0.25rem 0.5rem;
}

.profile-photo-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e7ff;
}
