:root {
    --bg: #f4f5f7;
    --sidebar-bg: #2d2b55;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b6b80;
    --border: #eeeef3;
    --accent: #6c5ce7;
    --table-head: #f0f0f5;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #e8e8f0;
    padding: 1.5rem;
}

.sidebar h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    margin-bottom: 0.5rem;
}

.sidebar nav a {
    display: block;
    text-decoration: none;
    color: #b8b8d0;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar nav a:hover {
    background: #3d3b6b;
    color: #ffffff;
}

.main {
    flex: 1;
    padding: 2rem;
}

.main h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

#transaction-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

#transaction-form input,
#transaction-form select {
    flex: 1;
    min-width: 140px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

#transaction-form input:focus,
#transaction-form select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

#submit-btn {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

#submit-btn:hover {
    background: #5b4bd6;
}

.cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.card {
    flex: 1;
    min-width: 160px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.card span {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

thead {
    background: var(--table-head);
}

th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

td {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    text-transform: capitalize;
}

.delete-btn {
    background: #fdecec;
    color: #e03131;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.delete-btn:hover {
    background: #e03131;
    color: #ffffff;
}

@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar h2 {
        margin-bottom: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
