@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light;
    --bg: #e1efdd;
    --surface: #ffffff;
    --border: rgba(60, 94, 34, 0.2);
    --muted: #4b5d3b;
    --accent: #2c8730;
    --accent-light: #6fbf3d;
    --text-dark: #182514;
    --shadow-color: rgba(33, 55, 21, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.app-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(180deg, #dfe7d0 0%, #f8fcf1 50%, #d3e1c4 100%);
    color: var(--text-dark);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-radius: 24px;
    border: 1px solid rgba(44, 135, 48, 0.3);
    background: linear-gradient(135deg, #2c8730, #6bbf3f);
    box-shadow: 0 20px 30px rgba(33, 61, 17, 0.35);
    color: #fff;
}

.brand {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.brand-subtitle {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.97rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #0b2c0c;
}

.user-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #2c8730;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

.user-name {
    margin: 0;
    font-weight: 600;
}

.user-role {
    margin: 2px 0 0;
    font-size: 0.9rem;
    color: rgba(11, 44, 12, 0.75);
}

.tab-panel {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--surface);
    border-radius: 24px;
    padding: 32px;
    border: 1px solid rgba(44, 135, 48, 0.25);
    box-shadow: 0 25px 45px rgba(38, 75, 20, 0.12);
    min-height: 420px;
}

main {
    margin-top: 32px;
}

.tab-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.tab-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    background: #f5fbef;
    border-radius: 18px;
    padding: 8px;
    border: 1px solid rgba(44, 135, 48, 0.2);
    box-shadow: 0 10px 30px rgba(38, 75, 20, 0.12);
}

.tab-nav--bottom {
    margin-top: 18px;
    margin-bottom: 0;
    display: none;
}

.tab-panel {
    row-gap: 12px;
}

@media (max-width: 768px) {
    .tab-nav--top {
        display: none;
    }
    .tab-panel {
        padding: 20px;
        gap: 12px;
    }

    .tab-content {
        gap: 18px;
    }
}

.tab-button {
    flex: 1;
    border: 1px solid rgba(44, 135, 48, 0.2);
    border-radius: 12px;
    background: rgba(44, 135, 48, 0.08);
    color: var(--text-dark);
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 70px;
}

.tab-button.active {
    background: linear-gradient(135deg, #2c8730, #6fbf3d);
    border-color: transparent;
    color: #fff;
    transform: translateY(-4px);
}

.tab-button:hover {
    background: rgba(44, 135, 48, 0.16);
}

.tab-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
}

.tab-label {
    font-size: 0.85rem;
    line-height: 1.2;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(21, 64, 31, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.hidden {
    display: none;
}

.modal {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(44, 135, 48, 0.2);
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 45px rgba(33, 62, 27, 0.15);
}

.modal h3 {
    margin: 0 0 12px;
    font-size: 1.4rem;
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .primary {
    background: linear-gradient(135deg, #2c8730, #6fbf3d);
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
}

.modal-actions .ghost {
    background: transparent;
    border: 1px solid rgba(44, 135, 48, 0.5);
    border-radius: 12px;
    color: #274d24;
    padding: 12px 20px;
    cursor: pointer;
}

.account-card {
    background: linear-gradient(180deg, #ffffff, #edf5e7 70%);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(44, 135, 48, 0.15);
    box-shadow: 0 20px 35px rgba(38, 75, 20, 0.08);
}

.account-card__header {
    margin-bottom: 16px;
}

.account-card__title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--muted);
}

.account-card__subtitle {
    margin: 4px 0 0;
    font-weight: 600;
    font-size: 1.3rem;
}

.account-card__balance {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
    margin-top: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-card__balance .balance-info {
    flex: 1 1 260px;
}

.label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 6px;
}

#balance {
    margin: 0;
    font-size: 3rem;
}

.account-card__timestamp {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.available-block {
    flex: 1 1 180px;
    min-width: 180px;
    text-align: right;
}

.available-amount {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
}

.account-card__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.account-card__details strong {
    display: block;
    font-size: 1rem;
    margin-top: 6px;
    color: #1b3b06;
}

.section-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.section-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.history-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

@media (max-width: 768px) {
    .app-shell {
        padding: 16px;
    }

    .tab-panel {
        padding: 24px;
    }

    .tab-nav--top {
        display: none;
    }

    .tab-nav--bottom {
        display: flex;
        position: sticky;
        bottom: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 8px;
        gap: 8px;
        background: linear-gradient(135deg, #e0f0da, #f7fcf4);
        border-top: 1px solid rgba(44, 135, 48, 0.2);
        box-shadow: 0 -6px 16px rgba(44, 135, 48, 0.18);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        z-index: 15;
    }

    .tab-button {
        font-size: 0.9rem;
        padding: 10px;
    }

    .app-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .account-card__balance {
        flex-direction: column;
        align-items: flex-start;
    }

    .available-block {
        text-align: left;
        width: 100%;
    }
    main {
        margin-top: 16px;
    }
    .tab-panel {
        min-height: auto;
    }
}

.history-entry {
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(44, 135, 48, 0.2);
    background: #f7f9f4;
    box-shadow: 0 12px 30px rgba(33, 61, 17, 0.08);
}

.history-entry header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.history-type {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.history-amount {
    font-weight: 600;
    font-size: 1.25rem;
}

.history-amount.positive {
    color: #2c8730;
}

.history-amount.negative {
    color: #c0392b;
}

.history-date,
.history-counterparty,
.history-description,
.history-details,
.history-balance {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.history-counterparty {
    font-weight: 600;
    color: var(--text-dark);
}

.transfer-form {
    margin-top: 24px;
    display: grid;
    gap: 18px;
    background: #f3f7ef;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(44, 135, 48, 0.15);
    box-shadow: 0 20px 40px rgba(34, 72, 29, 0.08);
}

.transfer-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
}

.transfer-form input {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(38, 75, 20, 0.2);
    background: #fff;
    color: var(--text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.transfer-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(111, 191, 61, 0.25);
}

.transfer-form button {
    padding: 16px 0;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2c8730, #6fbf3d);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.transfer-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(33, 61, 17, 0.3);
    filter: brightness(1.05);
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.form-status {
    min-height: 1.4em;
    font-size: 0.95rem;
    margin-top: 6px;
    transition: color 0.2s ease;
}

.form-status.success {
    color: #34d399;
}

.form-status.error {
    color: #f87171;
}

.empty-state {
    margin: 0;
    color: var(--muted);
    font-style: italic;
}
