:root {
    --forest-dark: #1a4d2e;
    --forest-medium: #2d6a4f;
    --sage: #52b788;
    --mint: #95d5b2;
    --cream: #f8f6f1;
    --earth: #d4a574;
    --terracotta: #d68c45;
    --sunset: #e07a5f;
    --shadow: rgba(26, 77, 46, 0.15);
}

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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #f8f6f1 0%, #e8f0e8 50%, #f8f6f1 100%);
    background-attachment: fixed;
    color: var(--forest-dark);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(149, 213, 178, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(82, 183, 136, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(212, 165, 116, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-family: 'Amatic SC', cursive;
    font-size: 5rem;
    color: var(--forest-dark);
    text-shadow: 2px 2px 4px var(--shadow);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--forest-medium);
    font-style: italic;
    opacity: 0.9;
}

.main-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 35px;
    box-shadow: 
        0 10px 40px var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(82, 183, 136, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(149, 213, 178, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.card-title {
    font-family: 'Amatic SC', cursive;
    font-size: 2.5rem;
    color: var(--forest-dark);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--forest-medium);
    font-weight: 600;
}

input[type="date"],
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--mint);
    border-radius: 15px;
    font-size: 1.05rem;
    font-family: 'Crimson Text', serif;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    color: var(--forest-dark);
}

input:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.15);
    transform: translateY(-2px);
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.radio-option {
    flex: 1;
    position: relative;
}

input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-label {
    display: block;
    padding: 12px 20px;
    border: 2px solid var(--mint);
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.5);
}

input[type="radio"]:checked + .radio-label {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
    transform: scale(1.05);
}

.radio-label:hover {
    border-color: var(--sage);
    transform: translateY(-2px);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 18px;
    font-size: 1.2rem;
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sage) 0%, var(--forest-medium) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(82, 183, 136, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--sunset) 0%, var(--terracotta) 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(224, 122, 95, 0.4);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 25px var(--shadow);
    border: 2px solid transparent;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--sage), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.summary-card:hover::before {
    transform: translateX(100%);
}

.summary-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 35px rgba(26, 77, 46, 0.2);
}

.summary-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.summary-label {
    font-size: 1.1rem;
    color: var(--forest-medium);
    margin-bottom: 8px;
    font-weight: 600;
}

.summary-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--forest-dark);
}

.income { border-left: 5px solid var(--sage); }
.expense { border-left: 5px solid var(--sunset); }
.balance { border-left: 5px solid var(--earth); }

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

thead tr {
    background: linear-gradient(135deg, var(--forest-medium), var(--sage));
    color: white;
}

th {
    padding: 16px;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

th:first-child {
    border-radius: 15px 0 0 15px;
}

th:last-child {
    border-radius: 0 15px 15px 0;
}

tbody tr {
    background: white;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

tbody tr:hover {
    transform: translateX(5px) scale(1.01);
    box-shadow: 0 4px 15px rgba(26, 77, 46, 0.2);
}

td {
    padding: 16px;
    border-top: 1px solid rgba(82, 183, 136, 0.1);
    border-bottom: 1px solid rgba(82, 183, 136, 0.1);
}

td:first-child {
    border-left: 1px solid rgba(82, 183, 136, 0.1);
    border-radius: 12px 0 0 12px;
}

td:last-child {
    border-right: 1px solid rgba(82, 183, 136, 0.1);
    border-radius: 0 12px 12px 0;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.badge-income {
    background: linear-gradient(135deg, rgba(82, 183, 136, 0.2), rgba(149, 213, 178, 0.3));
    color: var(--forest-dark);
    border: 1px solid var(--sage);
}

.badge-expense {
    background: linear-gradient(135deg, rgba(224, 122, 95, 0.2), rgba(214, 140, 69, 0.3));
    color: var(--forest-dark);
    border: 1px solid var(--sunset);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--forest-medium);
    font-style: italic;
    font-size: 1.2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
    animation: sway 3s ease-in-out infinite;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes sway {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

.delete-btn {
    background: none;
    border: none;
    color: var(--sunset);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 5px 10px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.delete-btn:hover {
    background: rgba(224, 122, 95, 0.1);
    transform: scale(1.2) rotate(10deg);
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 2rem;
    }
    
    table {
        font-size: 0.9rem;
    }
}