/* Theme */
:root {
    --orange: #ff8a25;
    --orange-600: #ff7a00;
    --orange-700: #ff6a00;
    --bg-light: #ffffff;
    --bg-soft: #fdf9f6;
    --bg-section: #fdeee2;
    --text: #2b2b2b;
    --muted: #6c6c6c;
    --border: #f7d7c3;
    --white: #fff;
    --shadow: 0 4px 10px rgba(0,0,0,.05);
    --danger: #e44;
    --ok: #1b9e3f;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%;
    margin: 0;
    font-family: Arial,Helvetica,sans-serif;
    color: var(--text);
    background: var(--bg-soft)
}

a {
    color: inherit
}

button {
    cursor: pointer
}

input, select, button, textarea {
    font: inherit
}

/* App container now wider on desktop */
.app {
    max-width: 420px;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-light)
}

@media (min-width: 768px) {
    .app {
        max-width: 960px;
        border-left: 1px solid #eee;
        border-right: 1px solid #eee
    }
}

@media (min-width: 1200px) {
    .app {
        max-width: 1280px
    }
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eee
}

.back {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--bg-section);
    color: var(--orange-700);
    border: 1px solid var(--border)
}

.brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #333
}

.spacer {
    flex: 1
}

.link {
    color: var(--orange-700);
    text-decoration: none;
    font-weight: 700
}

/* Layout area */
.main {
    display: block;
    min-height: calc(100dvh - 70px)
}
/* Desktop two-column layout */
@media (min-width: 1024px) {
    .main.grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 16px;
        align-items: start;
        padding: 0 16px;
    }
}

/* Cards & sections */
.card {
    margin: 16px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden
}

    .card .title {
        text-align: center;
        font-weight: 700;
        color: var(--orange-700);
        padding: 14px 0 0
    }

.section {
    background: var(--bg-section);
    border-radius: 12px;
    margin: 0 16px 20px;
    padding: 14px
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--orange-600);
    color: #fff;
    font-weight: 700
}

    .btn.secondary {
        background: #fff;
        color: var(--orange-700);
        border: 1px solid var(--orange-600)
    }

    .btn.block {
        display: flex;
        justify-content: center;
        width: 100%
    }

/* Forms */
.form {
    display: grid;
    gap: 12px
}

.field label {
    display: block;
    font-size: 13px;
    color: #7a6e64;
    margin-bottom: 6px
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff
}

.inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

    .inline .field {
        flex: 1 1 200px
    }

.hint {
    font-size: 12px;
    color: #857468
}

.error {
    color: var(--danger);
    font-size: 13px
}

.success {
    color: var(--ok);
    font-size: 13px
}

/* Lists */
.list {
    background: var(--bg-section);
    border-radius: 12px;
    margin: 0 16px 20px
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    padding: 12px 16px;
    font-size: 14px
}

    .row + .row {
        border-top: 1px solid var(--border)
    }

.date {
    font-weight: 600
}

.label {
    color: var(--muted)
}

.amount {
    font-weight: 700;
    color: var(--orange-700)
}

/* Icon tile */
.round {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--bg-section);
    border: 1px solid var(--border);
    margin: 0 auto 8px
}

    .round i {
        font-size: 32px;
        color: var(--orange-700)
    }

.center {
    text-align: center
}

.hero-num {
    font-size: 48px;
    font-weight: 800;
    color: #333;
    margin: 8px 0
}

.muted {
    color: var(--muted)
}

/* Footer nav */
.tabbar {
    margin-top: auto;
    background: var(--orange-600);
    color: #fff;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    display: flex;
    justify-content: space-around;
    padding: 10px 6px 6px;
    position: sticky;
    bottom: 0
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    opacity: .95;
    text-decoration: none;
    color: #fff;
    position: relative
}

    .tab i {
        font-size: 20px
    }

    .tab span {
        font-size: 12px
    }

/* Dropdown */
.dropdown {
    display: none;
    position: absolute;
    bottom: 50px;
    background: var(--white);
    color: var(--text);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 180px;
    right: 0;
    z-index: 20
}

    .dropdown a {
        display: block;
        padding: 10px 12px;
        text-decoration: none;
        color: var(--text);
        font-size: 14px
    }

        .dropdown a:hover {
            background: var(--bg-section)
        }

.tab.show .dropdown {
    display: block
}
