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

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: #080A12;
    background: radial-gradient(circle at top right, #13172e, #0a0c16 40%, #05060b 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e2e8f0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === LOGIN PAGE === */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: #141727;
    background: linear-gradient(135deg, rgba(20, 23, 39, 0.9), rgba(15, 17, 30, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 60px;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255,255,255,0.05);
    width: 100%;
    max-width: 500px;
}

.login-box h1 {
    text-align: center;
    color: #94a3b8;
    margin-bottom: 5px;
    font-size: 20px;
    font-weight: 500;
}

.login-box h2 {
    text-align: center;
    background: linear-gradient(135deg, #7ec4ff 0%, #a274ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-box .company-name {
    text-align: center;
    color: #64748b;
    font-size: 15px;
    margin-bottom: 50px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px;
    background: rgba(10, 11, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #475569;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.form-group select option {
    background: #0f111e;
    color: #f8fafc;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #7971fb;
    box-shadow: 0 0 0 3px rgba(121, 113, 251, 0.15), inset 0 0 10px rgba(0,0,0,0.5);
    background: rgba(10, 11, 20, 0.9);
}

.btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #7e22ce 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 4px 15px rgba(126, 34, 206, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(126, 34, 206, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #6b21a8 100%);
}

.btn:active {
    transform: translateY(0);
}

.btn-logout {
    padding: 10px 20px;
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.2);
    width: auto;
    font-size: 13px;
    box-shadow: none;
}
.btn-logout:hover {
    background: rgba(220, 38, 38, 0.2);
    box-shadow: none;
    color: #fca5a5;
    transform: none;
}

.error-message {
    color: #fca5a5;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
    font-size: 14px;
    border-left: 4px solid #ef4444;
}

.success-message {
    color: #6ee7b7;
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
    font-size: 14px;
    border-left: 4px solid #10b981;
}

/* === APP DASHBOARD === */
.header {
    background: #141727;
    background: linear-gradient(135deg, rgba(20, 23, 39, 0.8), rgba(15, 17, 30, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 25px 35px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    font-weight: 700;
    font-size: 26px;
    margin: 0;
    color: #f8fafc;
}

.header .subtitle {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

.user-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === CARDS === */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
}

.stat-card {
    background: #141727;
    background: linear-gradient(180deg, rgba(25, 29, 48, 0.7) 0%, rgba(18, 20, 33, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 28px 24px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #4f46e5;
    border-radius: 4px 0 0 4px;
}

.stat-card h3 {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-card .amount {
    font-size: 32px;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

/* Color Coding for specific cards */
.stat-card.spent::before { background: #ef4444; }
.stat-card.spent .amount { color: #fca5a5; text-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }

.stat-card.available::before { background: #10b981; }
.stat-card.available .amount { color: #6ee7b7; text-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }

.stat-card.due::before { background: #f59e0b; }
.stat-card.due .amount { color: #fcd34d; text-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }

.currency {
    color: #64748b;
    font-weight: 600;
    font-size: 18px;
}

.subtitle-date {
    font-size: 13px;
    color: #64748b;
    margin-top: 10px;
    font-weight: 500;
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    background: rgba(20, 23, 39, 0.6);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    flex-wrap: wrap;
    align-items: center;
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #94a3b8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.03);
    color: #e2e8f0;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(126, 34, 206, 0.2) 100%);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: inset 0 0 15px rgba(139, 92, 246, 0.1);
}

/* === TAB CONTENT === */
.tab-content {
    display: none;
    background: #141727;
    background: linear-gradient(180deg, rgba(20, 23, 39, 0.8) 0%, rgba(15, 17, 30, 0.6) 100%);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #f8fafc;
    font-size: 22px;
    margin-bottom: 25px;
    font-weight: 600;
}

.form-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.form-section {
    background: rgba(10, 11, 20, 0.4);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.form-section h2 {
    color: #e2e8f0;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

/* === TABLES === */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    background: rgba(10, 11, 20, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table thead th {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
    color: #cbd5e1;
}

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

table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.amount-col {
    color: #e2e8f0;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 50px 20px !important;
    font-size: 14px;
}

/* === ACTIONS === */
.delete-btn {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
}

.delete-btn:hover:not(:disabled) {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    body { padding: 15px; }
    .login-box { padding: 40px 25px; }
    
    .header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
    }
    
    .tab-content {
        padding: 25px 20px;
    }
    
    table th, table td {
        padding: 12px 15px;
    }
}