/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --gray-light: #d1d5db;
    --bg: #f9fafb;
    --white: #ffffff;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.3s ease;

    /* Sidebar */
    --sidebar-width: 250px;
}

/* Sunrise Theme (6am - 10am) */
body.theme-sunrise {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --bg: #fff7ed;
}

body.theme-sunrise .login-page,
body.theme-sunrise body {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
}

/* Sunlight Theme (11am - 6pm) */
body.theme-sunlight {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --bg: #eff6ff;
}

body.theme-sunlight .login-page,
body.theme-sunlight body {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

/* Moonlight Theme (6pm - 12am & 12am - 6am) */
body.theme-moonlight {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --bg: #1e1b4b;
    --dark: #f9fafb;
    --dark-light: #e5e7eb;
    --gray: #d1d5db;
    --gray-light: #4b5563;
    --white: #1e293b;
}

body.theme-moonlight .login-page,
body.theme-moonlight body {
    background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
}

body.theme-moonlight .card,
body.theme-moonlight .login-card,
body.theme-moonlight .navbar,
body.theme-moonlight .stat-card {
    background: #1e293b;
    color: #f9fafb;
}

body.theme-moonlight .card-header h2,
body.theme-moonlight .auth-form h2,
body.theme-moonlight .form-group label,
body.theme-moonlight table th {
    color: #f9fafb;
}

body.theme-moonlight input,
body.theme-moonlight textarea,
body.theme-moonlight select {
    background: #334155;
    color: #f9fafb;
    border-color: #475569;
}

body.theme-moonlight table thead {
    background: #334155;
}

body.theme-moonlight table tbody tr:hover {
    background: #334155;
}

body.theme-moonlight table td {
    color: #e5e7eb;
    border-bottom-color: #475569;
}

body.theme-moonlight .close-summary {
    background: #334155;
    color: #f9fafb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================================
   Login Page Styles
   =================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-md);
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-xl);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.login-header p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ===================================
   Form Styles
   =================================== */
.auth-form h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-toggle {
    text-align: center;
    margin-top: var(--spacing-md);
    color: var(--gray);
    font-size: 0.9rem;
}

.form-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-toggle a:hover {
    color: var(--primary-dark);
}

/* ===================================
   Button Styles
   =================================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    width: 100%;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===================================
   Message Styles
   =================================== */
.error-message,
.success-message {
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ===================================
   Dashboard Layout
   =================================== */
.dashboard {
    min-height: 100vh;
    background: var(--bg);
}

.navbar {
    background: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.navbar-user span {
    color: var(--gray);
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* ===================================
   Stats Cards
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-card.income .value {
    color: var(--secondary);
}

.stat-card.expense .value {
    color: var(--danger);
}

.stat-card.balance .value {
    color: var(--primary);
}

/* ===================================
   Card Styles
   =================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--bg);
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--dark);
}

/* ===================================
   Table Styles
   =================================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--bg);
}

table th {
    padding: var(--spacing-sm);
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-light);
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--bg);
}

/* ===================================
   Badge Styles
   =================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ===================================
   Status Indicator
   =================================== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.status-indicator.open {
    background: #d1fae5;
    color: #065f46;
}

.status-indicator.closed {
    background: #fee2e2;
    color: #991b1b;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.open .status-dot {
    background: #10b981;
}

.status-indicator.closed .status-dot {
    background: #ef4444;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: var(--spacing-xs);
    }
}

/* ===================================
   Modal Styles
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

.close-summary {
    background: var(--bg);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.close-summary p {
    margin-bottom: var(--spacing-xs);
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.modal-actions .btn {
    flex: 1;
}

/* ===================================
   Sidebar Styles
   =================================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 100;
}

body.theme-moonlight .sidebar {
    background: #1e293b;
    border-right: 1px solid #475569;
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--bg);
}

body.theme-moonlight .sidebar-header {
    border-bottom-color: #475569;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: block;
}

.sidebar-nav {
    padding: var(--spacing-md) 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

body.theme-moonlight .sidebar-nav-item {
    color: #e5e7eb;
}

.sidebar-nav-item:hover {
    background: var(--bg);
    border-left-color: var(--primary);
}

body.theme-moonlight .sidebar-nav-item:hover {
    background: #334155;
}

.sidebar-nav-item.active {
    background: var(--bg);
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

body.theme-moonlight .sidebar-nav-item.active {
    background: #334155;
}

.sidebar-nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: var(--transition);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 200;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Sidebar Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }
}

/* ===================================
   Settings Page Styles
   =================================== */
.settings-section {
    padding: var(--spacing-md) 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

body.theme-moonlight .setting-item {
    border-bottom-color: #475569;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--dark);
}

body.theme-moonlight .setting-info h3 {
    color: #f9fafb;
}

.setting-info p {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 0.25rem;
}

body.theme-moonlight .setting-info p {
    color: #d1d5db;
}

.setting-info small {
    font-size: 0.75rem;
    color: var(--gray);
}

body.theme-moonlight .setting-info small {
    color: #9ca3af;
}

.setting-control {
    flex-shrink: 0;
}

/* Toggle Switch with ON/OFF Text */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 36px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: var(--transition);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:after {
    content: 'OFF';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

input:checked+.toggle-slider {
    background-color: #10b981;
}

input:checked+.toggle-slider:before {
    transform: translateX(44px);
}

input:checked+.toggle-slider:after {
    content: 'ON';
    left: 12px;
    right: auto;
    color: white;
}

body.theme-moonlight .toggle-slider {
    background-color: #475569;
}

body.theme-moonlight input:checked+.toggle-slider {
    background-color: var(--primary);
}

.theme-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

body.theme-moonlight .theme-select {
    background: #334155;
    color: #f9fafb;
    border-color: #475569;
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .setting-control {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

/* ===================================
   Filter Grid & Search Styles
   =================================== */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.search-bar {
    padding: var(--spacing-md);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.theme-moonlight .search-input {
    background: #334155;
    color: #f9fafb;
    border-color: #475569;
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Reports Layout Styles (Original)
   =================================== */
.reports-layout {
    display: flex;
    gap: var(--spacing-lg);
}

.reports-sidebar {
    width: 220px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: var(--spacing-md);
}

body.theme-moonlight .reports-sidebar {
    background: #1e293b;
    border: 1px solid #475569;
}

.reports-sidebar h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

body.theme-moonlight .reports-sidebar h3 {
    color: #f9fafb;
}

.report-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
    font-size: 0.875rem;
}

body.theme-moonlight .report-menu-item {
    color: #d1d5db;
}

.report-menu-item:hover {
    background: var(--bg);
}

body.theme-moonlight .report-menu-item:hover {
    background: #334155;
}

.report-menu-item.active {
    background: var(--primary);
    color: white;
}

.report-menu-item.active .report-icon {
    filter: brightness(0) invert(1);
}

.report-icon {
    font-size: 1.25rem;
}

.reports-content {
    flex: 1;
}

.report-options {
    padding: var(--spacing-md);
}

.options-row {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    align-items: flex-end;
}

.option-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
}

body.theme-moonlight .option-group label {
    color: #d1d5db;
}

.option-group select,
.option-group input[type="text"],
.option-group input[type="date"],
.option-group input[type="month"],
.option-group input[type="number"] {
    padding: 0.5rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
}

body.theme-moonlight .option-group select,
body.theme-moonlight .option-group input[type="text"],
body.theme-moonlight .option-group input[type="date"],
body.theme-moonlight .option-group input[type="month"],
body.theme-moonlight .option-group input[type="number"] {
    background: #334155;
    color: #f9fafb;
    border-color: #475569;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.options-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--gray-light);
}

body.theme-moonlight .options-actions {
    border-top-color: #475569;
}

.options-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 1024px) {
    .reports-layout {
        flex-direction: column;
    }

    .reports-sidebar {
        width: 100%;
        position: static;
    }

    .report-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .report-menu-item {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .options-row {
        flex-direction: column;
        align-items: stretch;
    }

    .options-actions {
        flex-direction: column;
    }

    .options-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   Compact Toolbar Reports Styles (Latest)
   =================================== */
.compact-filter-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

body.theme-moonlight .compact-filter-container {
    background: #1e293b;
    border: 1px solid #475569;
}

.report-types-bar {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

body.theme-moonlight .report-types-bar {
    border-bottom-color: #475569;
}

.report-type-options {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.type-option {
    cursor: pointer;
    position: relative;
}

.type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-pill {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

body.theme-moonlight .option-pill {
    background: #334155;
    color: #d1d5db;
}

.type-option:hover .option-pill {
    background: #e0e7ff;
    color: var(--primary);
}

body.theme-moonlight .type-option:hover .option-pill {
    background: #475569;
    color: #a78bfa;
}

.type-option input:checked+.option-pill {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Controls Bar */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-group {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-light);
}

body.theme-moonlight .date-group {
    background: #0f172a;
    border-color: #475569;
}

.date-group input[type="date"] {
    border: none;
    background: transparent;
    padding: 0.25rem;
    font-size: 0.85rem;
    color: var(--dark);
    width: 130px;
}

body.theme-moonlight .date-group input[type="date"] {
    color: #f9fafb;
}

.date-group input:focus {
    outline: none;
    box-shadow: none;
}

.separator {
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 500;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: var(--white);
    color: var(--dark);
}

body.theme-moonlight .filter-group select,
body.theme-moonlight .filter-group input {
    background: #334155;
    border-color: #475569;
    color: #f9fafb;
}

.filter-group select {
    min-width: 100px;
}

.compact-input {
    min-width: 120px;
    flex: 1;
}

.btn-compact {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 1024px) {
    .controls-bar {
        gap: 0.75rem;
    }

    .filter-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .date-group {
        width: 100%;
        justify-content: space-between;
    }

    .date-group input[type="date"] {
        width: 45%;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    .action-group {
        display: flex;
        width: 100%;
    }

    .action-group .btn {
        flex: 1;
    }

    .report-type-options {
        padding-bottom: 0.5rem;
    }
}

/* Compact Table & Summary */
.professional-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

body.theme-moonlight .summary-card {
    background: #1e293b;
    border: 1px solid #475569;
}

.summary-card .card-icon {
    font-size: 2rem;
    line-height: 1;
}

.summary-card h4 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
}

.summary-card .amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.income-card .amount {
    color: #10b981;
}

.expense-card .amount {
    color: #ef4444;
}

.balance-card .amount {
    color: #6366f1;
}

.pending-card .amount {
    color: #f59e0b;
}

@media (max-width: 768px) {
    .professional-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.compact-header {
    padding: 1rem;
}

.compact-header h3 {
    font-size: 1rem;
}

/* Professional Table */
.professional-table-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

body.theme-moonlight .professional-table-card {
    background: #1e293b;
    border: 1px solid #475569;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

body.theme-moonlight .table-header {
    border-bottom-color: #475569;
}

.table-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
}

body.theme-moonlight .table-header h3 {
    color: #f9fafb;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.professional-table-container {
    overflow-x: auto;
}

.professional-table {
    width: 100%;
    border-collapse: collapse;
}

.professional-table thead {
    background: var(--bg);
}

body.theme-moonlight .professional-table thead {
    background: #334155;
}

.professional-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.theme-moonlight .professional-table th {
    color: #d1d5db;
}

.professional-table th.text-right {
    text-align: right;
}

.professional-table tbody tr {
    border-bottom: 1px solid var(--gray-light);
    transition: var(--transition);
}

body.theme-moonlight .professional-table tbody tr {
    border-bottom-color: #475569;
}

.professional-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

body.theme-moonlight .professional-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.professional-table td {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--dark);
}

body.theme-moonlight .professional-table td {
    color: #d1d5db;
}

.professional-table td.text-right {
    text-align: right;
    font-weight: 600;
}

/* ===================================
   File Upload Styles
   =================================== */
.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
}

.file-upload-label:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.file-upload-label input {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--gray);
}

.file-name {
    margin-top: var(--spacing-sm);
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.import-instructions {
    background: #f3f4f6;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.import-instructions p {
    margin-bottom: var(--spacing-sm);
    color: var(--dark-light);
}

.import-instructions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    margin: var(--spacing-md) 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressIndeterminate 1.5s infinite linear;
}

@keyframes progressIndeterminate {
    0% {
        transform: translateX(-100%);
        width: 50%;
    }

    100% {
        transform: translateX(200%);
        width: 50%;
    }
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Moonlight Theme Adjustments */
body.theme-moonlight .file-upload-label {
    background: #334155;
    border-color: #475569;
}

body.theme-moonlight .file-upload-label:hover {
    background: #1e293b;
    border-color: var(--primary);
}

body.theme-moonlight .import-instructions {
    background: #334155;
}

body.theme-moonlight .import-instructions p {
    color: #e5e7eb;
}