:root {
    color-scheme: light;
    --bg: #f4efe8;
    --bg-alt: #fffaf4;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --line: rgba(31, 41, 55, 0.12);
    --primary: #d97706;
    --primary-strong: #b45309;
    --credit: #0f766e;
    --debit: #b91c1c;
    --shadow: 0 24px 60px rgba(43, 31, 16, 0.16);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 28%),
        linear-gradient(180deg, #f9f3eb 0%, #f4efe8 52%, #efe7dc 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 88%);
    opacity: 0.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #d97706, #f59e0b 45%, #0f766e 125%);
    box-shadow: 0 16px 30px rgba(217, 119, 6, 0.28);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-copy h1,
.brand-copy h2,
.hero-copy h1,
.hero-copy h2,
.panel h3,
.card h3 {
    margin: 0;
}

.brand-copy p,
.eyebrow,
.muted,
.supporting,
.helper-text,
.subtle {
    color: var(--muted);
}

.brand-copy p {
    margin: 4px 0 0;
    font-size: 0.95rem;
}

.nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pill-link,
.ghost-button,
.primary-button,
.calendar-day,
.tab-button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pill-link,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid rgba(31, 41, 55, 0.08);
    background: rgba(255, 255, 255, 0.62);
    color: var(--text);
}

.pill-link:hover,
.ghost-button:hover,
.primary-button:hover,
.tab-button:hover,
.calendar-day:hover {
    transform: translateY(-1px);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    color: white;
    box-shadow: 0 18px 34px rgba(217, 119, 6, 0.24);
}

.hero,
.auth-layout,
.dashboard-grid {
    display: grid;
    gap: 20px;
}

.hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
    align-items: stretch;
}

.hero-card,
.panel,
.auth-card,
.metric,
.calendar-card,
.entry-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero-card,
.auth-card,
.panel,
.calendar-card,
.entry-card {
    border-radius: var(--radius-xl);
}

.hero-card {
    padding: 30px;
    min-height: 100%;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -90px;
    top: -90px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 60%);
    pointer-events: none;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 700;
}

.hero-copy h1 {
    margin-top: 10px;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    max-width: 10ch;
}

.hero-copy p {
    margin: 16px 0 0;
    max-width: 60ch;
    line-height: 1.7;
    font-size: 1.02rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.feature-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.feature {
    border-radius: var(--radius-lg);
    padding: 16px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.feature strong,
.metric strong,
.summary-value {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.feature span,
.metric span {
    color: var(--muted);
    font-size: 0.92rem;
}

.side-stack {
    display: grid;
    gap: 16px;
}

.auth-card {
    padding: 28px;
}

.auth-card h2 {
    font-size: 2rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.66);
    margin: 22px 0 18px;
}

.tab-button {
    padding: 12px 14px;
    background: transparent;
    color: var(--muted);
}

.tab-button.active {
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.08);
}

.form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.92rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(31, 41, 55, 0.10);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-control:focus {
    border-color: rgba(217, 119, 6, 0.55);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12);
}

.form-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.mini-card {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.mini-card strong {
    display: block;
    margin-bottom: 6px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    align-items: start;
}

.hero-banner {
    padding: 26px 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hero-banner h2 {
    font-size: clamp(1.7rem, 3vw, 3rem);
    letter-spacing: -0.04em;
}

.hero-banner p {
    margin: 10px 0 0;
    max-width: 62ch;
    line-height: 1.65;
}

.status-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.10);
    color: var(--credit);
    font-weight: 700;
    white-space: nowrap;
}

.panel {
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric {
    border-radius: var(--radius-lg);
    padding: 18px;
}

.metric .accent {
    color: var(--primary-strong);
}

.metric .credit {
    color: var(--credit);
}

.metric .debit {
    color: var(--debit);
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.calendar-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(31, 41, 55, 0.10);
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.weekday-row,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.weekday-row {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.weekday-row span,
.calendar-day {
    min-height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 41, 55, 0.08);
    color: var(--text);
    position: relative;
}

.calendar-day.is-muted {
    opacity: 0.35;
}

.calendar-day.is-today {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.18), rgba(245, 158, 11, 0.28));
    border-color: rgba(217, 119, 6, 0.28);
    font-weight: 700;
}

.calendar-day.is-selected {
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    color: white;
    box-shadow: 0 14px 22px rgba(217, 119, 6, 0.26);
    font-weight: 700;
}

.calendar-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.60);
    border: 1px solid rgba(31, 41, 55, 0.08);
    font-size: 0.9rem;
    color: var(--muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.today {
    background: var(--primary);
}

.legend-dot.selected {
    background: var(--credit);
}

.legend-dot.credit {
    background: var(--credit);
}

.legend-dot.debit {
    background: var(--debit);
}

.filter-button {
    padding: 10px 16px;
}

.filter-button.active {
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.08);
}

.transaction-card {
    align-items: center;
}

.transaction-meta {
    gap: 10px;
}

.transaction-topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.transaction-side {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.transaction-delete {
    padding-inline: 14px;
}

.legend-pill.credit {
    color: var(--credit);
}

.legend-pill.debit {
    color: var(--debit);
}

.helper-text {
    margin-top: 4px;
    display: inline-block;
    font-size: 0.86rem;
}

.entry-form {
    display: grid;
    gap: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.amount-prefix {
    position: relative;
}

.amount-prefix::before {
    content: "₹";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--muted);
    pointer-events: none;
}

.amount-prefix .form-control {
    padding-left: 34px;
}

.type-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.radio-chip {
    position: relative;
}

.radio-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-chip span {
    display: block;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(31, 41, 55, 0.10);
    text-align: center;
    font-weight: 600;
}

.radio-chip input:checked + span {
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.12);
    color: var(--primary-strong);
}

.entry-list {
    display: grid;
    gap: 12px;
}

.entry-card {
    padding: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.entry-meta {
    display: grid;
    gap: 6px;
}

.entry-meta strong {
    font-size: 1rem;
}

.entry-amount {
    font-size: 1.1rem;
    font-weight: 800;
    white-space: nowrap;
}

.entry-amount.credit {
    color: var(--credit);
}

.entry-amount.debit {
    color: var(--debit);
}

.split-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.empty-state {
    padding: 26px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.6);
    border: 1px dashed rgba(31, 41, 55, 0.14);
    color: var(--muted);
    line-height: 1.7;
}

.notice {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.10);
    color: var(--credit);
    font-weight: 600;
}

.error {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(185, 28, 28, 0.10);
    color: var(--debit);
    font-weight: 600;
}

.footer-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 980px) {
    .hero,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .feature-row,
    .form-row {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 18px;
    }

    .topbar,
    .hero-banner,
    .panel-header,
    .calendar-toolbar,
    .entry-card,
    .split-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-card,
    .hero-card,
    .panel {
        padding: 20px;
    }

    .calendar-grid,
    .weekday-row {
        gap: 6px;
    }

    .weekday-row span,
    .calendar-day {
        min-height: 40px;
        border-radius: 12px;
        font-size: 0.9rem;
    }

    .transaction-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .transaction-side {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
}