/* Estilo Fintech Profissional Moderno */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    /* Primary Colors */
    --primary: #00d4aa;
    --primary-light: #26debc;
    --primary-dark: #00b894;
    --primary-50: rgba(0, 212, 170, 0.05);
    --primary-100: rgba(0, 212, 170, 0.1);
    --primary-200: rgba(0, 212, 170, 0.2);
    --primary-300: rgba(0, 212, 170, 0.3);

    /* Secondary Colors */
    --secondary: #667eea;
    --secondary-light: #7c8ff0;
    --secondary-dark: #5a67d8;
    --secondary-50: rgba(102, 126, 234, 0.05);
    --secondary-100: rgba(102, 126, 234, 0.1);

    /* Accent Colors */
    --accent: #ff6b00;
    --accent-light: #ff8533;
    --accent-dark: #e55a00;
    --accent-50: rgba(255, 107, 0, 0.05);
    --accent-100: rgba(255, 107, 0, 0.1);

    /* Success/Error Colors */
    --success: #10b981;
    --success-light: #34d399;
    --success-50: rgba(16, 185, 129, 0.05);
    --success-100: rgba(16, 185, 129, 0.1);

    --error: #ef4444;
    --error-light: #f87171;
    --error-50: rgba(239, 68, 68, 0.05);
    --error-100: rgba(239, 68, 68, 0.1);

    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-50: rgba(245, 158, 11, 0.05);
    --warning-100: rgba(245, 158, 11, 0.1);

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Background Gradients */
    --bg-primary: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --bg-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);

    /* Dark Background Colors */
    --dark-bg: #0f0c29;
    --dark-secondary: #302b63;
    --dark-tertiary: #24243e;

    /* Glass Morphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4aa 0%, #667eea 100%);
    --gradient-accent: linear-gradient(135deg, #ff6b00 0%, #ff8533 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-error: linear-gradient(135deg, #ef4444 0%, #f87171 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 40px 80px -20px rgba(0, 0, 0, 0.3);

    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-2xl: 48px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    min-height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-secondary) 50%, var(--dark-tertiary) 100%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--white);
    min-height: 100%;
    line-height: 1.6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

@media (max-width: 767px) {
    body {
        background-attachment: scroll;
    }
}



/* Header */
header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .logo {
    height: 4rem; /* Adjust height to match font-size */
    width: auto;
    max-width: 300px; /* Prevent logo from being too wide */
    object-fit: contain;
    display: block;
}

@media (max-width: 767px) {
    header .logo {
        height: 2.5rem; /* Smaller on mobile */
        max-width: 150px;
    }
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    border: 1px solid transparent;
}

nav a::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

nav a[href*="dashboard"]::before { content: '\f015'; } /* home */
nav a[href*="receita"]::before { content: '\f51e'; } /* plus */
nav a[href*="contas_pagar"]::before { content: '\f1ec'; } /* credit-card */
nav a[href*="custos_fixos"]::before { content: '\f1ad'; } /* building */
nav a[href*="saidas"]::before { content: '\f290'; } /* cash-register */
nav a[href*="configuracao"]::before { content: '\f013'; } /* cog */
nav a[href*="usuarios"]::before { content: '\f0c0'; } /* users */
nav a[href*="dre"]::before { content: '\f201'; } /* chart-line */
nav a[href*="logout"]::before { content: '\f2f5'; } /* sign-out */

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Content */
main {
    padding: 2.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: 0 20px 60px rgba(0, 212, 170, 0.3);
}

.card:hover::before {
    transform: scaleX(1);
}

.dark .card {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.3);
}

/* Summary Cards */
.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.summary .card {
    text-align: center;
    padding: 1.5rem;
}

.summary .card h3 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.summary .card p {
    font-size: clamp(1.3rem, 1.3vw, 1.3rem);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    white-space: nowrap;
    overflow: visible;
}

/* Charts */
.charts {
    margin: 3rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.charts .card {
    padding: 2rem;
}

.charts canvas {
    max-width: 100%;
    height: 350px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: clamp(0.8rem, 2vw, 1rem);
}

/* Users Table - Borderless Glassmorphism Design */
.users-table {
    border: none !important;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(25px) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

.users-table thead {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(255, 107, 0, 0.05) 100%) !important;
    border-bottom: none !important;
}

.users-table th {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--accent) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 1.2rem 1.5rem !important;
}

.users-table td {
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 1.2rem 1.5rem !important;
    vertical-align: middle !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.users-table tbody tr {
    background: transparent !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
}

.users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.1) !important;
    border-radius: 12px !important;
}

.users-table tbody tr:last-child td {
    border-bottom: none !important;
}

.users-table .actions {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
    height: 100% !important;
    align-items: center !important;
}

.users-table .btn-action {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    text-decoration: none !important;
    font-family: inherit !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 32px !important;
    justify-content: center !important;
}

.users-table .btn-action:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.users-table .btn-pay {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%) !important;
    color: var(--white) !important;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3) !important;
}

.users-table .btn-pay:hover {
    background: linear-gradient(135deg, #00b894 0%, #009b7d 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4) !important;
}

.users-table .btn-code {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #000 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3) !important;
}

.users-table .btn-code:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4) !important;
}

.users-table .btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
}

.users-table .btn-delete:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
}

.users-table .btn-action:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.users-table .btn-action:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive adjustments for users table */
@media (max-width: 767px) {
    .users-table {
        font-size: 0.75rem !important;
        overflow-x: auto !important;
        display: block !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px !important;
    }

    .users-table th,
    .users-table td {
        padding: 0.8rem 0.5rem !important;
        min-width: 80px !important;
    }

    .users-table th:first-child,
    .users-table td:first-child {
        min-width: 120px !important;
        position: sticky !important;
        left: 0 !important;
        background: inherit !important;
        backdrop-filter: blur(10px) !important;
        z-index: 3 !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1) !important;
    }

    .users-table tbody tr:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .users-table .actions {
        gap: 0.3rem !important;
        justify-content: center !important;
    }

    .users-table .btn-action {
        min-width: 28px !important;
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
}

.dark table {
    background: rgba(31, 41, 55, 0.8);
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

th {
    background: rgba(255, 107, 0, 0.1);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark th {
    background: rgba(255, 107, 0, 0.2);
}

tbody tr {
    transition: all 0.3s;
    height: 60px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark tbody tr:hover {
    background: rgba(75, 85, 99, 0.2);
}

tbody tr.due-today {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

tbody tr.overdue {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

tbody tr.due-today:hover, tbody tr.overdue:hover {
    background: rgba(255, 193, 7, 0.2);
}

tbody tr.overdue:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* Forms */
form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Filter Form */
.filter-form {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-form > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.filter-form input,
.filter-form select {
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 1rem;
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.filter-form input:focus,
.filter-form select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.filter-form select[multiple] {
    height: 120px;
    resize: vertical;
}

.filter-form button {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    min-width: 120px;
    justify-self: start;
}

.filter-form a {
    min-width: 120px;
}

.filter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

.filter-form button[type="button"] {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.filter-form button[type="button"]:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.dark form {
    background: rgba(31, 41, 55, 0.8);
}

.form-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

label::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    opacity: 0.7;
}

input[type="text"], input[type="number"], input[type="date"], input[type="month"], input[type="password"],
select, textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

select option {
    background: var(--dark-bg);
    color: var(--white);
    padding: 0.5rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.1);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.checkbox-group {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
    user-select: none;
}

.checkbox-group label:hover {
    background: rgba(0, 212, 170, 0.05);
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.3);
}

/* Buttons */
.btn, button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary, button[type="submit"], .btn {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    border: none;
}

.btn-primary:hover, button[type="submit"]:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    height: 100%;
    align-items: center;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: none !important;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    font-family: inherit;
    box-shadow: none;
    outline: none;
}

.btn-pay {
    background: #00d4aa;
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.btn-pay:hover {
    background: #00b894;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.btn-code {
    background: #ffc107;
    color: #000;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-code:hover {
    background: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-pix {
    background: #007bff;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-pix:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-action:disabled:hover {
    transform: none;
    box-shadow: none;
}



/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h2 {
    text-align: center;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

/* Search */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

#search {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 1rem;
}

#search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#search:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Success Messages */
.success {
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-weight: 500;
}

/* Error Messages */
.error {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-weight: 500;
}

/* DRE Summary */
.dre-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

/* Theme Toggle */
#theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    background: var(--gradient-accent);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    z-index: 1000;
}

#theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 0, 0.4);
}

/* Responsive Design - Mobile First Approach */

/* Mobile Styles (320px - 767px) */
@media (max-width: 767px) {
    /* Header */
    header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: center;
    }

    header h1 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    nav {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Main Content */
    main {
        padding: 1rem 0.75rem 4rem 0.75rem; /* Extra bottom padding for nav */
    }

    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    /* Summary Grid */
    .summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        justify-items: center;
    }

    .summary .card {
        padding: 0.75rem;
    }

    .summary .card h3 {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
    }

    .summary .card p {
        font-size: 0.9rem;
    }

    /* Tables - Horizontal Scroll */
    table {
        font-size: 0.75rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    th, td {
        padding: 0.5rem 0.3rem;
        min-width: 70px;
    }

    th {
        position: sticky;
        top: 0;
        background: rgba(255, 107, 0, 0.1);
        backdrop-filter: blur(10px);
        z-index: 2;
    }

    th:first-child, td:first-child {
        min-width: 100px;
        position: sticky;
        left: 0;
        background: inherit;
        z-index: 3;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    tbody tr:hover {
        background: rgba(255, 255, 255, 0.08);
        transform: none;
    }

    /* Forms */
    form {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 12px;
    }

    .form-group {
        margin-bottom: 1.2rem;
    }

    label {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    input, select, textarea {
        padding: 0.7rem;
        font-size: 0.85rem;
        min-height: 44px; /* Touch-friendly */
        border-radius: 8px;
    }

    /* Buttons */
    .btn, button {
        min-height: 44px;
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 8px;
        width: 100%;
        justify-content: center;
    }

    .btn-action {
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem;
        font-size: 0.7rem;
        border-radius: 6px;
    }

    .actions {
        gap: 0.3rem;
        justify-content: center;
    }

    /* Modals */
    .modal-content {
        margin: 2% auto;
        padding: 1.2rem;
        width: 95%;
        max-width: none;
        border-radius: 12px;
    }

    /* Charts */
    .charts canvas {
        max-width: 100%;
        height: 250px;
    }

    /* Login */
    .login-container {
        padding: 0.5rem;
    }

    .login-box {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
        border-radius: 16px;
        max-width: 100%;
    }

    .login-box h2 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    /* DRE */
    .dre-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dre-table {
        font-size: 0.7rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        min-width: 100%;
    }

    .dre-table th, .dre-table td {
        padding: 0.4rem 0.2rem;
    }

    .dre-table th:first-child,
    .dre-table td:first-child {
        position: sticky;
        left: 0;
        background: inherit;
        backdrop-filter: blur(10px);
        z-index: 3;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        min-width: 200px;
    }
}

/* Tablet Styles (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    header {
        padding: 1.25rem 1.5rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    nav {
        position: static;
        flex-direction: row;
        gap: 0.75rem;
        padding: 0;
        background: transparent;
        border-top: none;
        box-shadow: none;
    }

    nav a {
        flex-direction: row;
        gap: 0.5rem;
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
        min-width: auto;
        min-height: auto;
    }

    nav a::before {
        font-size: 1rem;
    }

    main {
        padding: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .card {
        padding: 1.75rem;
    }

    table {
        font-size: 0.85rem;
        overflow-x: visible;
        display: table;
        white-space: normal;
    }

    th, td {
        padding: 0.8rem 0.6rem;
        min-width: auto;
        position: static;
    }

    form {
        padding: 1.75rem;
    }

    .btn, button {
        min-height: auto;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        width: auto;
    }

    .btn-action {
        min-width: auto;
        min-height: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .modal-content {
        margin: 8% auto;
        padding: 2rem;
        width: 80%;
        max-width: 500px;
    }

    .charts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .charts canvas {
        height: 350px;
    }

    .dre-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Desktop Styles (1024px+) */
@media (min-width: 1024px) {
    main {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .summary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .charts {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .dre-summary {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    nav a {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    main {
        max-width: 1400px;
        padding: 2.5rem;
    }

    .summary {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Landscape Mobile Adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    header {
        padding: 0.5rem;
    }

    nav {
        padding: 0.3rem;
    }

    nav a {
        padding: 0.3rem 0.2rem;
        font-size: 0.65rem;
        min-width: 44px;
        min-height: 44px;
    }

    nav a::before {
        font-size: 1rem;
    }

    main {
        padding: 0.5rem 0.5rem 3.5rem 0.5rem;
    }

    .card {
        padding: 0.75rem;
    }

    .summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .login-container {
        padding: 0.25rem;
    }

    .login-box {
        padding: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .btn-action, nav a {
        min-height: 44px;
        min-width: 44px;
    }

    .card:hover {
        transform: none;
    }

    nav a:hover {
        transform: none;
    }

    .btn:hover, .btn-action:hover {
        transform: none;
    }

    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12px;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    nav, #theme-toggle, .btn-action, .modal {
        display: none !important;
    }

    table {
        font-size: 10px;
        break-inside: avoid;
    }

    .summary {
        display: flex !important;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .summary .card {
        flex: 1 1 200px;
        page-break-inside: avoid;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card, .btn, .btn-action {
        border-width: 0.5px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Typography Improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.875rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-100);
    color: var(--success);
    border: 1px solid var(--success-200);
}

.badge-warning {
    background: var(--warning-100);
    color: var(--warning);
    border: 1px solid var(--warning-200);
}

.badge-error {
    background: var(--error-100);
    color: var(--error);
    border: 1px solid var(--error-200);
}

.badge-info {
    background: var(--secondary-100);
    color: var(--secondary);
    border: 1px solid var(--secondary-200);
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary);
    border: 1px solid var(--primary-200);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.success { background: var(--success); }
.status-indicator.warning { background: var(--warning); }
.status-indicator.error { background: var(--error); }
.status-indicator.info { background: var(--secondary); }

/* Enhanced Cards with Depth */
.card {
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.card:hover::after {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

/* Micro-interactions */
.btn, .btn-action {
    position: relative;
    overflow: hidden;
}

.btn::before, .btn-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--transition-fast), height var(--transition-fast);
}

.btn:active::before, .btn-action:active::before {
    width: 300px;
    height: 300px;
}

input:focus, select:focus, textarea:focus {
    transform: scale(1.02);
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 60%;
}

/* Enhanced Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.card {
    animation: slideInUp 0.6s ease-out;
}

.btn-primary:hover {
    animation: pulse 2s infinite;
}

/* Enhanced Table Rows */
tbody tr {
    cursor: pointer;
    transition: all var(--transition-normal);
}

tbody tr:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

/* Improved Form Elements */
.form-group {
    position: relative;
}

.form-group input, .form-group select, .form-group textarea {
    transition: all var(--transition-normal);
}

.form-group label {
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--bg-primary);
    padding: 0 8px;
    font-size: 0.75rem;
    color: var(--primary);
    border-radius: 4px;
    font-weight: 500;
}

/* Enhanced Navigation */
nav a.active {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--white);
    border-radius: 1px;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.1);
        --glass-border: rgba(255, 255, 255, 0.3);
    }
}

/* Ripple Effect Styles */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xl);
    animation: slideInUp 0.3s ease-out;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

.toast-warning {
    background: var(--warning);
}

.toast-info {
    background: var(--secondary);
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Form Validation States */
input.success, select.success, textarea.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

input.error, select.error, textarea.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced Focus States */
input:focus.success, select:focus.success, textarea:focus.success {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

input:focus.error, select:focus.error, textarea:focus.error {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Loading Button States */
.btn.loading, .btn-action.loading {
    color: transparent !important;
    position: relative;
}

.btn.loading::after, .btn-action.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
    nav a.active {
        background: var(--gradient-primary);
        transform: scale(1.05);
    }

    nav a.active::before {
        color: var(--white);
    }
}

/* Password Container Styles */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    flex: 1;
    padding-right: 40px;
}

.btn-toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.3s;
}

.btn-toggle-password:hover {
    color: var(--primary);
}

.btn-toggle-password i {
    font-size: 1rem;
}

/* Dark Mode Enhancements */
body.dark .badge-success {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
}

body.dark .badge-warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--warning);
}

body.dark .badge-error {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

body.dark .badge-info {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--secondary);
}

/* Performance Optimizations */
.card, .btn, .btn-action {
    will-change: transform;
}

.card:hover, .btn:hover, .btn-action:hover {
    will-change: transform, box-shadow;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ripple, .toast, .card, .btn, .btn-action {
        animation: none !important;
        transition: none !important;
    }
}

/* DRE Table Wrapper for Horizontal Scrolling */
.dre-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
}

/* Media query for large screens: center the table */
@media (min-width: 1200px) {
    .dre-table-wrapper {
        display: flex;
        justify-content: center;
        overflow-x: visible;
    }
    .dre-table {
        width: auto;
        min-width: 1200px;
    }
}

/* DRE Table Styles */
.dre-table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 100%;
    white-space: nowrap;
}

.dre-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dre-table th:first-child {
    text-align: left;
    width: 200px;
    min-width: 200px;
}

.dre-table td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
}

.dre-table td:first-child {
    text-align: left;
    font-weight: 600;
    padding-left: 1.5rem;
    position: relative;
    max-width: 190px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dre-table .revenue-row {
    background: linear-gradient(90deg, var(--success-50) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.dre-table .revenue-row td {
    font-weight: 700;
    color: var(--success);
}

.dre-table .revenue-row td:first-child::before {
    content: '📈';
    margin-right: 0.5rem;
    font-size: 1rem;
}

.dre-table .expense-row {
    background: linear-gradient(90deg, var(--error-50) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-left: 4px solid var(--error);
    color: var(--error);
}

.dre-table .expense-row td {
    color: var(--error);
}

.dre-table .expense-row td:first-child::before {
    content: '📉';
    margin-right: 0.5rem;
    font-size: 1rem;
}

.dre-table .sub-row {
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.dre-table .sub-row td:first-child {
    padding-left: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 1.2em;
    max-width: 150px; /* Adjust as needed */
}

.dre-table .total-expense-row {
    background: linear-gradient(90deg, var(--error-100) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-top: 2px solid var(--error);
    border-bottom: 2px solid var(--error);
    font-weight: 700;
    color: var(--error);
}

.dre-table .total-expense-row td:first-child::before {
    content: '💸';
    margin-right: 0.5rem;
    font-size: 1rem;
}

.dre-table .result-row {
    font-weight: 800;
    font-size: 1rem;
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
    background: linear-gradient(90deg, var(--primary-50) 0%, rgba(0, 212, 170, 0.1) 100%);
}

.dre-table .result-row.positive {
    background: linear-gradient(90deg, var(--success-50) 0%, rgba(16, 185, 129, 0.15) 100%);
    color: var(--success);
    border-color: var(--success);
}

.dre-table .result-row.positive td:first-child::before {
    content: '✅';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.dre-table .result-row.negative {
    background: linear-gradient(90deg, var(--error-50) 0%, rgba(239, 68, 68, 0.15) 100%);
    color: var(--error);
    border-color: var(--error);
}

.dre-table .result-row.negative td:first-child::before {
    content: '❌';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.dre-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
    transition: all 0.2s ease;
}

.dre-table .total-column {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border-left: 2px solid var(--gray-400);
}

.dre-table .month-column {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-2xl);
    animation: fadeInScale 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.item-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-row input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 1rem;
}

.item-row input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.item-row .btn-action {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .item-row {
        flex-direction: column;
        align-items: stretch;
    }

    .item-row input {
        margin-bottom: 0.5rem;
    }

    .item-row .btn-action {
        align-self: flex-end;
    }
}

.close {
    color: rgba(255, 255, 255, 0.7);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--white);
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.modal-buttons button[type="button"] {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-buttons button[type="button"]:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-buttons button[type="submit"] {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.modal-buttons button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

/* New Responsive Classes */
.login-title {
    height: 8rem;
    width: auto;
    max-width: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.5rem auto;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.login-btn {
    margin-top: 1rem;
}

.secondary-card {
    margin-top: 3rem;
}

.installments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.installment-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.installment-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 212, 170, 0.3);
}

.installment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.installment-card:hover::before {
    transform: scaleX(1);
}

.installment-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.installment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.installment-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.installment-actions {
    display: flex;
    gap: 0.5rem;
}

.total-summary {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.total-value {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0.5rem 0 0 0;
}

.add-installment-btn {
    margin-top: 2rem;
}

.edit-btn {
    margin-top: 2rem;
}

.section-title {
    color: var(--accent);
    margin-bottom: 1rem;
}

.installment-details {
    display: none;
    margin-top: 2rem;
}

/* Utility Classes for Responsive Design */

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Gap Utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* Spacing Utilities */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

/* Width Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Text Alignment */
.text-center { text-align: center; }

/* Touch Target Enhancements */
.btn, .btn-action, nav a {
    min-height: 44px;
    min-width: 44px;
}

/* Responsive Breakpoints */

/* Extra Small (xs): 0 - 479px */
@media (max-width: 479px) {
    .grid-cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .summary { grid-template-columns: repeat(1, 1fr); }
    .charts { flex-direction: column; }
    .filter-form { flex-direction: column; align-items: stretch; }
    .installments-grid { grid-template-columns: 1fr; }
    .installment-fields { grid-template-columns: 1fr; }
    .login-title { font-size: 1.5rem; }
    .login-subtitle { font-size: 0.8rem; }
    .installment-title { font-size: 0.9rem; }
    .status-badge { font-size: 0.65rem; padding: 0.15rem 0.4rem; }
    .total-value { font-size: 0.9rem; }
}

/* Small (sm): 480px - 599px */
@media (min-width: 480px) and (max-width: 599px) {
    .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .summary .card { padding: 1rem; }
    .summary .card h3 { font-size: 0.7rem; }
    .summary .card p { font-size: 1rem; }
    .installments-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .installment-card { padding: 1rem; }
    .installment-title { font-size: 0.95rem; }
    .login-title { font-size: 1.7rem; }
    .login-subtitle { font-size: 0.85rem; }
}

/* Medium (md): 600px - 767px */
@media (min-width: 600px) and (max-width: 767px) {
    .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary { grid-template-columns: repeat(3, 1fr); }
    .installments-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .installment-card { padding: 1.25rem; }
    .installment-title { font-size: 1rem; }
    .charts { flex-direction: row; }
    .filter-form { flex-direction: row; }
}

/* Large (lg): 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .installments-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .installment-card { padding: 1.25rem; }
    .installment-title { font-size: 1rem; }
    .charts { grid-template-columns: 1fr; }
}

/* Extra Large (xl): 1024px - 1199px */
@media (min-width: 1024px) and (max-width: 1199px) {
    .installments-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
}

/* XXL: 1200px+ */
@media (min-width: 1200px) {
    .installments-grid { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 767px) {
    .login-title {
        font-size: 1.8rem;
    }
    .login-subtitle {
        font-size: 0.9rem;
    }
    .installments-grid {
        grid-template-columns: 1fr;
    }
    .installment-fields {
        grid-template-columns: 1fr;
    }
    .installment-title {
        font-size: 1rem;
    }
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .total-value {
        font-size: 1rem;
    }
}

/* Additional Breakpoints for Better Responsiveness */
@media (min-width: 480px) and (max-width: 767px) {
    .summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .summary .card {
        padding: 1rem;
    }
    .summary .card h3 {
        font-size: 0.7rem;
    }
    .summary .card p {
        font-size: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .installments-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .installment-card {
        padding: 1.25rem;
    }
    .installment-title {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .installments-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (min-width: 1200px) {
    .installments-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Submenu behavior on large screens */
@media (min-width: 768px) {
    .submenu {
        display: none;
    }
    .submenu.open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
        z-index: 100;
        min-width: 200px;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
    }
    .submenu.open a {
        display: block;
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }
}
