:root {
    --bg-color: #0c111d;
    --surface-color: rgba(22, 29, 45, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    line-height: 1.5;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

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

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

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

.stat-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 1.25rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.3);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.stat-value.total { color: var(--primary); }
.stat-value.paid { color: var(--success); }
.stat-value.pending { color: var(--warning); }

/* Main Table Area */
.content-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* List Items */
.bill-list {
    width: 100%;
}

.bill-item {
    display: grid;
    grid-template-columns: auto 1fr 120px 100px auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.bill-item:hover { 
    background: rgba(56, 189, 248, 0.04); 
    box-shadow: inset 4px 0 0 var(--primary);
}

.bill-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.bill-info h4 { 
    font-size: 1.05rem; 
    font-weight: 700; 
    margin: 0; 
    display: flex;
    align-items: center;
    color: var(--text-main);
}

.bill-info span { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    font-weight: 500;
}

.amount { font-weight: 700; color: var(--text-main); }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status-paid { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-overdue { 
    background: rgba(244, 63, 94, 0.2); 
    color: #ff4d6d; 
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

/* Novos Badges e Ícones */
.badge-month {
    background: rgba(244, 63, 94, 0.15); 
    color: #ff4d6d; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 0.65rem; 
    font-weight: 800; 
    margin-right: 8px; 
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-estimated {
    background: rgba(56, 189, 248, 0.1); 
    color: var(--primary); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 0.6rem; 
    font-weight: 700; 
    margin-right: 8px; 
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.icon-recurring {
    width: 12px; 
    height: 12px; 
    color: var(--primary); 
    opacity: 0.6;
    margin-left: 4px;
    vertical-align: middle;
}

.category-icon-wrapper {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bill-item:hover .category-icon-wrapper {
    transform: scale(1.1);
}

.overdue-row {
    background: rgba(244, 63, 94, 0.03) !important;
    border-left: 4px solid #ff4d6d !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #161d2d;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    border-radius: 1.5rem;
    padding: 2rem;
    position: relative;
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.75rem;
    color: #fff;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    padding-right: 2rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2rem;
}

select.form-control:hover {
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.btn-icon:hover { color: var(--primary); background: var(--glass-bg); }

/* Responsive adjustments */
@media (max-width: 768px) {
    .bill-item {
        grid-template-columns: 3rem 1fr 1fr;
        gap: 0.5rem;
    }
    .amount, .actions { grid-row: 2; grid-column: 2; }
    .status-badge { grid-row: 2; grid-column: 3; justify-self: end; }
}
