* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --positive: #00f2a0;
    --negative: #ff6b9d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(102, 126, 234, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(118, 75, 162, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 400;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.summary-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-card.income .card-value {
    color: var(--positive);
}

.summary-card.expense .card-value {
    color: var(--negative);
}

.summary-card.balance .card-value {
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
}

/* Month Selector */
.month-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.month-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.month-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.month-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Month Details */
.month-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-value.positive {
    color: var(--positive);
}

.detail-value.negative {
    color: var(--negative);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.debt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.debt-table thead {
    background: rgba(102, 126, 234, 0.2);
}

.debt-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.debt-table td {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    white-space: nowrap;
}

.debt-table tbody tr {
    transition: background 0.2s ease;
}

.debt-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.debt-table .positive {
    color: var(--positive);
    font-weight: 600;
}

.debt-table .negative {
    color: var(--negative);
    font-weight: 600;
}

.debt-table .highlight {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 700;
}

/* Debt Cards */
.debt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.debt-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.debt-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.2);
}

.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.debt-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.debt-badge {
    background: var(--success-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.debt-badge.critical {
    background: var(--secondary-gradient);
}

.debt-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.debt-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 5px;
}

.debt-total {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Breakdown Grid */
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.breakdown-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
}

.breakdown-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.breakdown-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.breakdown-value.positive {
    color: var(--positive);
}

.breakdown-value.negative {
    color: var(--negative);
}

.breakdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.breakdown-item.total {
    padding-top: 15px;
}

.breakdown-item.total .breakdown-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.breakdown-item.total .breakdown-value {
    font-size: 1.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .section {
        padding: 20px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .month-selector {
        justify-content: center;
    }

    .month-btn {
        flex: 1;
        min-width: 70px;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .debt-table {
        font-size: 0.8rem;
    }

    .debt-table th,
    .debt-table td {
        padding: 10px 8px;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .card-value {
        font-size: 1.5rem;
    }

    .debt-amount {
        font-size: 1.5rem;
    }

    .month-btn {
        min-width: 60px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}
