:root {
    /* Base Colors - Wealth & Cleanliness */
    --bg-body: #f4f7f6;
    /* Very light gray/white */
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    /* Accents - Trust & Growth */
    --primary: #059669;
    /* Emerald Green - Money/Growth */
    --primary-light: #d1fae5;
    --primary-dark: #065f46;

    /* Text */
    --text-main: #1f2937;
    /* Dark Gray, almost black */
    --text-muted: #6b7280;
    /* Medium Gray */
    --text-light: #9ca3af;

    /* Borders & Shadows */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --gradient-1: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    /* Fix: Enable scrolling */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 3rem;
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: var(--primary-dark);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-profile .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    filter: brightness(110%);
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    background: #f9fafb;
    color: var(--primary);
    border-color: var(--primary-light);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.05em;
}

.stat-trend {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.trend-up {
    color: var(--primary);
}

.trend-down {
    color: #dc2626;
}

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f9fafb;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f9fafb;
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

/* Forms */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Privacy Mode */
.privacy-active .sensitive {
    filter: blur(8px) !important;
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s ease;
}

/* Pagination Styles (Bootstrap-compatible structure) */
.pagination {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    padding: 0 0.75rem;
}

.page-item .page-link:hover {
    background: #f9fafb;
    border-color: var(--primary-light);
    color: var(--primary);
}

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


.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
    background: #f3f4f6;
}

/* Modal Improvements */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Tiny Button tweaks */
.btn-tiny {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 32px;
}

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

.btn-danger-outline {
    color: #ef4444;
    border-color: #fca5a5;
    background: white;
}

.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* Responsive Grid Utilities */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
/* Chip Checkbox */
.chip-checkbox input[type="checkbox"] {
    display: none;
}

.chip-checkbox span {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-checkbox input[type="checkbox"]:checked + span {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.chip-checkbox:hover span {
    background: #e5e7eb;
}

.chip-checkbox input[type="checkbox"]:checked:hover + span {
    background: #dbeafe;
}
