* { box-sizing: border-box; }

:root {
    --bg: #f5f4f1;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: #ffffff;
    --text: #303338;
    --muted: #77766f;
    --line: rgba(48, 51, 56, 0.1);
    --primary: #bc9148;
    --primary-dark: #303338;
    --teal: #31836e;
    --orange: #bd8e41;
    --red: #c5534c;
    --gold: #d0a34f;
    --shadow: 0 24px 60px rgba(45, 46, 47, 0.1);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(150deg, #f1f1ef 0%, #faf7f0 48%, #efeeeb 100%);
    color: var(--text);
}

body.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

.page-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    background: rgba(255,255,255,0.74);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px 22px;
    box-shadow: var(--shadow);
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}

.brand-logo {
    display: block;
    width: 238px;
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notification-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(23, 43, 69, .1);
    border-radius: 13px;
    background: #fff;
    color: var(--primary-dark);
    font-size: .8rem;
    font-weight: 700;
}

.notification-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notification-count {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #e9675a;
    color: #fff;
    font-size: .7rem;
}

.notification-count[hidden] {
    display: none;
}

.user-pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(188, 145, 72, 0.13);
    color: #735624;
    font-weight: 700;
    font-size: 0.9rem;
}

.primary-btn,
.secondary-btn,
.quick-tab,
.tab-button {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    transition: .2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #303338, #4c4f52);
    color: white;
    font-weight: 700;
    border: 1px solid rgba(208, 163, 79, 0.68);
    box-shadow: 0 10px 22px rgba(48, 51, 56, 0.18);
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    background: rgba(17,24,39,.045);
    color: var(--text);
    font-weight: 600;
}

.dashboard {
    display: grid;
    gap: 20px;
}

.page-view-hidden {
    display: none !important;
}

.dashboard[data-current-page="transactions"] .content-grid,
.dashboard[data-current-page="portfolio"] .content-grid,
.dashboard[data-current-page="bills"] .content-grid,
.dashboard[data-current-page="market"] .content-grid,
.dashboard[data-current-page="assistant"] .content-grid {
    grid-template-columns: minmax(0, 1fr);
}

.content-grid > [data-page-view]:not(.page-view-hidden) {
    grid-column: 1 / -1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-card span {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong {
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    line-height: 1.2;
}

.stat-card.primary { background: linear-gradient(135deg, #fbfaf7, #f0e8d8); }
.stat-card.blue { background: linear-gradient(135deg, #f8f8f6, #e9e9e5); }
.stat-card.green { background: linear-gradient(135deg, #f2f7f2, #e2eee4); }
.stat-card.orange { background: linear-gradient(135deg, #fbf7ed, #f1e4c9); }

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 20px;
}

.panel {
    background: rgba(255,255,255,0.82);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel.span-2 {
    grid-column: span 2;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.transaction-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid rgba(24, 69, 65, .08);
    border-radius: 16px;
    background: #f8fbf9;
}

.transaction-filters label {
    min-width: 0;
    font-size: .75rem;
}

.transaction-filters input,
.transaction-filters select {
    min-width: 0;
}

.currency-note {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.45;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

input, select {
    width: 100%;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 12px;
    background: rgba(247, 249, 245, 0.9);
    padding: 12px 14px;
    color: var(--text);
    outline: none;
}

input:focus, select:focus {
    border-color: rgba(188, 145, 72, 0.6);
    box-shadow: 0 0 0 4px rgba(188, 145, 72, 0.12);
}

.full-width {
    grid-column: 1 / -1;
}

.quick-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.quick-tab,
.tab-button {
    background: rgba(17,24,39,0.04);
    color: var(--text);
    font-weight: 700;
}

.quick-tab.active,
.tab-button.active {
    background: linear-gradient(135deg, #303338, #4c4f52);
    color: white;
    box-shadow: 0 10px 20px rgba(48, 51, 56, 0.19);
}

.list-box,
.market-box,
.assistant-box,
.table-box {
    display: grid;
    gap: 12px;
}

.list-item,
.market-item,
.bill-item,
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(245,247,252,0.8);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}

.list-item strong, .market-item strong, .bill-item strong {
    display: block;
    margin-bottom: 4px;
}

.muted {
    color: var(--muted);
    font-size: 0.82rem;
}

.asset-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(22,160,133,0.1);
    color: var(--teal);
    font-weight: 700;
    font-size: 0.8rem;
}

.portfolio-asset-item {
    align-items: stretch;
    gap: 20px;
    padding: 16px 18px;
}

.portfolio-asset-details {
    flex: 1 1 auto;
    min-width: 0;
}

.portfolio-asset-details > strong {
    margin-bottom: 2px;
    color: var(--primary-dark);
    font-size: 1rem;
}

.portfolio-asset-type {
    color: var(--muted);
    font-size: .8rem;
}

.portfolio-asset-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.portfolio-asset-metrics > div {
    display: grid;
    gap: 3px;
}

.portfolio-asset-metrics span,
.portfolio-total-label {
    color: var(--muted);
    font-size: .7rem;
}

.portfolio-asset-metrics strong {
    margin: 0;
    color: var(--text);
    font-size: .78rem;
    font-weight: 650;
}

.portfolio-asset-value {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    text-align: right;
}

.portfolio-total-value {
    margin: 0;
    color: var(--teal);
    font-size: 1rem;
}

.portfolio-profit-loss {
    font-size: .74rem;
    font-weight: 650;
}

.portfolio-profit-loss.positive {
    color: #21805d;
}

.portfolio-profit-loss.negative {
    color: var(--red);
}

.portfolio-profit-loss.neutral {
    color: var(--muted);
}

.warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border: 1px solid #f1d48a;
    border-radius: 999px;
    background: #fff7df;
    color: #805b11;
    box-shadow: 0 2px 6px rgba(128, 91, 17, .08);
    font-size: .74rem;
    font-weight: 750;
    line-height: 1.2;
}

@media (max-width: 760px) {
    .portfolio-asset-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .portfolio-asset-item {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .portfolio-asset-value {
        align-items: flex-start;
        text-align: left;
    }
}

.market-item {
    flex-direction: column;
    align-items: flex-start;
}

.assistant-box {
    background: linear-gradient(135deg, #f5f4f1, #faf6ea);
    border-radius: 18px;
    border: 1px solid var(--line);
    padding: 18px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.table-box {
    overflow: hidden;
}

#transactionsList {
    overflow-x: auto;
}

.table-box table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.transaction-history-table {
    min-width: 940px;
}

.table-box th, .table-box td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.transaction-type-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.transaction-type-badge--income {
    border-color: #b9e4d2;
    background: #e5f6ee;
    color: #176b4b;
}

.transaction-type-badge--forex {
    border-color: #bfdbfe;
    background: #eaf3ff;
    color: #1e5eaa;
}

.transaction-type-badge--stock-buy {
    border-color: #d5c8f2;
    background: #f1ecfb;
    color: #6442a0;
}

.transaction-type-badge--stock-sell {
    border-color: #f3c2c2;
    background: #fff0f0;
    color: #a63232;
}

.transaction-type-badge--gold {
    border-color: #f0d99b;
    background: #fff5d9;
    color: #89620c;
}

.transaction-type-badge--other {
    border-color: #d9e0e2;
    background: #f0f3f4;
    color: #53636a;
}

#recent-transactions tbody tr:nth-child(odd) td {
    background: #fff;
}

#recent-transactions tbody tr:nth-child(even) td {
    background: #f1f3f4;
}

#recent-transactions tbody tr:hover td {
    background: #e8edef;
}

.table-box th {
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-message {
    min-height: 20px;
    margin-top: 12px;
    font-weight: 600;
    color: var(--red);
}

.hidden {
    display: none !important;
}

.auth-shell {
    width: min(520px, 100%);
}

.auth-card {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(17,24,39,0.08);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 28px 28px 24px;
}

.brand-block {
    text-align: center;
    margin-bottom: 18px;
}

.brand-block h1 {
    margin: 12px 0 6px;
    font-size: 2rem;
}

.auth-logo {
    display: block;
    width: min(340px, 100%);
    height: auto;
    margin: 0 auto 16px;
}

.brand-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

#loginForm {
    display: grid;
    gap: 16px;
}

@media (max-width: 980px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .panel.span-2 {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-inline: 12px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stats-grid,
    .form-grid,
    .form-grid.compact {
        grid-template-columns: 1fr;
    }
}

.entry-panel {
    padding: 26px;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,246,240,.96));
}

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.panel-header h3 {
    font-size: 1.22rem;
    letter-spacing: -.025em;
}

.quick-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 7px;
    margin: 18px 0 24px;
    border: 1px solid rgba(36, 55, 92, .07);
    border-radius: 18px;
    background: #f2f1ee;
}

.quick-tab {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    text-align: left;
}

.quick-tab > span:last-child {
    display: grid;
    gap: 3px;
}

.quick-tab strong {
    font-size: .83rem;
    color: var(--text);
}

.quick-tab small {
    font-size: .68rem;
    color: var(--muted);
}

.quick-tab .tab-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    background: #eae8e3;
    color: #66645e;
    font-size: 1.2rem;
    font-weight: 700;
}

.quick-tab.active {
    border-color: rgba(188, 145, 72, .35);
    background: white;
    box-shadow: 0 5px 18px rgba(31, 49, 82, .09);
    color: var(--text);
}

.quick-tab.active .tab-icon {
    background: #f1e7d4;
    color: #936d2e;
}

.quick-tab[data-kind="expense"].active .tab-icon,
.quick-tab[data-kind="sell"].active .tab-icon {
    background: #f9ede8;
    color: #b65c43;
}

.quick-tab[data-kind="buy"].active .tab-icon,
.quick-tab[data-kind="income"].active .tab-icon {
    background: #f1e7d4;
    color: #936d2e;
}

#transactionForm {
    align-items: end;
    gap: 18px;
}

#transactionForm label,
#billForm label {
    color: #53627a;
    font-size: .78rem;
    font-weight: 700;
}

#transactionForm input,
#transactionForm select,
#billForm input {
    min-height: 48px;
    border-color: rgba(55, 75, 110, .12);
    border-radius: 13px;
    background: #f8faff;
    font-size: .9rem;
}

#transactionForm input[readonly] {
    color: var(--primary-dark);
    background: #f4f0e7;
    font-weight: 700;
}

#transactionForm .primary-btn {
    min-width: 190px;
    min-height: 48px;
}

.quote-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.quote-controls .secondary-btn {
    min-height: 40px;
    border: 1px solid rgba(188,145,72,.25);
    background: #f4efe3;
    color: #735624;
    font-size: .82rem;
    font-weight: 700;
}

.quote-controls .secondary-btn:disabled {
    cursor: wait;
    opacity: .65;
}

.quote-error {
    color: #c34234 !important;
}

.market-item {
    min-height: 73px;
    flex-direction: row;
    align-items: center;
}

.market-price {
    color: var(--text);
    font-weight: 800;
    white-space: nowrap;
}

.market-price small {
    margin-left: 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
}

.market-prices {
    display: grid;
    gap: 4px;
    text-align: right;
    white-space: nowrap;
    color: var(--muted);
    font-size: .72rem;
}

.market-prices strong {
    display: inline;
    margin: 0;
    color: var(--text);
    font-size: .83rem;
}

.market-error {
    border-color: rgba(239,68,68,.12);
}

.market-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
}

.market-selection {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr);
    align-items: start;
    gap: 12px 18px;
    margin-bottom: 16px;
}

.market-selection-group {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.market-selection-group > label {
    color: var(--text);
    font-size: .72rem;
    font-weight: 700;
}

.market-add-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.market-selection select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: .78rem;
}

.market-add-control .primary-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: .75rem;
}

.market-add-control .secondary-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: .75rem;
}

.market-add-control input {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: .78rem;
    text-transform: uppercase;
}

.market-add-control .primary-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.market-add-control .secondary-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.market-selection #marketCustomSymbolStatus {
    font-size: .65rem;
}

.market-selected-instruments {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 22px;
}

.market-selection-wide {
    grid-column: 1 / -1;
}

.market-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 4px 3px 8px;
    border: 1px solid rgba(39, 139, 118, .2);
    border-radius: 999px;
    background: #edf7f3;
    color: var(--text);
    font-size: .66rem;
    font-weight: 650;
}

.market-remove-instrument {
    padding: 2px 6px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #a63232;
    cursor: pointer;
    font: inherit;
    font-size: .62rem;
    font-weight: 700;
}

.market-selection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.market-selection-actions .muted {
    font-size: .65rem;
}

.market-selection-actions .secondary-btn {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: .68rem;
}

.market-item.market-card {
    position: relative;
    display: flex;
    min-height: 154px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 7px;
    overflow: hidden;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: linear-gradient(145deg, #173b3e, #102a30);
    box-shadow: 0 10px 22px rgba(16, 42, 48, .13);
    color: #f3f7f5;
}

.market-item.market-card::after {
    position: absolute;
    right: -28px;
    bottom: -44px;
    width: 110px;
    height: 110px;
    border: 1px solid rgba(212, 169, 79, .13);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.market-item.market-card-gold {
    background: linear-gradient(145deg, #4b3e26, #292d2a);
}

.market-item.market-card-stock {
    background: linear-gradient(145deg, #1b3a42, #132c34);
}

.market-item.market-card-forex {
    background: linear-gradient(145deg, #21483e, #15332f);
}

.market-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.market-type,
.market-symbol {
    color: #c2d3ce;
    font-size: .64rem;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.market-symbol {
    color: #e3c37d;
}

.market-item.market-card .market-card-name {
    overflow: hidden;
    margin: 0;
    color: #e7efec;
    font-size: .77rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-card-price {
    color: #fff;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -.025em;
    white-space: nowrap;
}

.market-unit {
    color: #a8bcb6;
    font-size: .65rem;
}

.market-item .market-prices {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #b9c9c4;
    font-size: .63rem;
}

.market-item .market-prices strong {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: .72rem;
}

.market-item.market-error {
    border-color: rgba(255, 140, 130, .3);
    background: linear-gradient(145deg, #442f32, #30272c);
}

@media (max-width: 760px) {
    .market-selection {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .market-selection-wide {
        grid-column: auto;
    }

    .market-add-control {
        align-items: stretch;
    }

    .market-selection-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-panel {
        padding: 18px;
    }
}

@media (max-width: 420px) {
    .quick-tab {
        gap: 8px;
        padding-inline: 8px;
    }

    .quick-tab strong {
        font-size: .75rem;
    }
}

:root {
    --bg: #f1f4f7;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-strong: #ffffff;
    --text: #172b45;
    --muted: #748194;
    --line: rgba(23, 43, 69, 0.1);
    --primary: #e9675a;
    --primary-dark: #172b45;
    --teal: #31836e;
    --orange: #ef8b72;
    --red: #c5534c;
    --gold: #ef8b72;
    --shadow: 0 24px 60px rgba(26, 47, 73, 0.1);
}

body {
    background: linear-gradient(145deg, #eef2f6 0%, #f8f9fb 52%, #e9eef3 100%);
}

.user-pill {
    background: rgba(233, 103, 90, 0.1);
    color: #a8443a;
}

.primary-btn {
    background: linear-gradient(135deg, #e9675a, #f1846c);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 10px 22px rgba(217, 95, 81, 0.23);
}

.stat-card.primary { background: linear-gradient(135deg, #ffffff, #e6edf5); }
.stat-card.blue { background: linear-gradient(135deg, #f9fbfd, #e5edf5); }
.stat-card.green { background: linear-gradient(135deg, #f4faf7, #deeee8); }
.stat-card.orange { background: linear-gradient(135deg, #fff9f6, #f8e5df); }

input, select {
    background: rgba(247, 249, 251, 0.94);
}

input:focus, select:focus {
    border-color: rgba(233, 103, 90, 0.55);
    box-shadow: 0 0 0 4px rgba(233, 103, 90, 0.1);
}

.quick-tab.active,
.tab-button.active {
    background: linear-gradient(135deg, #172b45, #294563);
    box-shadow: 0 10px 20px rgba(23, 43, 69, 0.18);
}

.quick-tab.active strong,
.quick-tab.active small {
    color: #ffffff;
}

.assistant-box {
    background: linear-gradient(135deg, #f4f7fa, #eef2f6);
}

.entry-panel {
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,247,250,.96));
}

.quick-tabs {
    background: #e9edf2;
}

.quick-tab .tab-icon {
    background: #e1e7ee;
    color: #586a80;
}

.quick-tab.active {
    border-color: rgba(233, 103, 90, .28);
}

.quick-tab.active .tab-icon,
.quick-tab[data-kind="buy"].active .tab-icon,
.quick-tab[data-kind="income"].active .tab-icon {
    background: #fbe8e4;
    color: #d55b50;
}

.quick-tab[data-kind="expense"].active .tab-icon,
.quick-tab[data-kind="sell"].active .tab-icon {
    background: #fbe8e4;
    color: #c75c4f;
}

#transactionForm label,
#billForm label {
    color: #586a80;
}

#transactionForm input,
#transactionForm select,
#billForm input {
    background: #f7f9fb;
}

#transactionForm input[readonly] {
    background: #eef2f7;
}

.quote-controls .secondary-btn {
    border-color: rgba(233, 103, 90, .2);
    background: #fbece8;
    color: #a8443a;
}

.page-shell {
    max-width: 1600px;
    padding: 18px;
}

.app-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 18px;
    display: flex;
    min-height: calc(100vh - 36px);
    flex-direction: column;
    padding: 20px 14px 14px;
    border: 1px solid rgba(23, 43, 69, .08);
    border-radius: 24px;
    background: rgba(255, 255, 255, .91);
    box-shadow: var(--shadow);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 75px;
    margin: 0 4px 26px;
    border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
    display: block;
    width: 100%;
    max-width: 210px;
    height: auto;
}

.sidebar-section-label {
    padding: 0 12px;
    margin-bottom: 10px;
    color: #929baa;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-link,
.sidebar-logout {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #637187;
    font-size: .86rem;
    font-weight: 650;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.sidebar-link:hover,
.sidebar-logout:hover {
    transform: translateX(2px);
    background: #f3f5f8;
    color: var(--primary-dark);
}

.sidebar-link.active {
    border-color: rgba(233, 103, 90, .1);
    background: linear-gradient(100deg, #fff1ed, #fff8f5);
    color: #c6534b;
}

.nav-icon {
    display: inline-grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    border-radius: 9px;
    background: #edf1f5;
    color: #53647a;
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-link.active .nav-icon {
    background: #fbe2dc;
    color: #c6534b;
}

.sidebar-bottom {
    display: grid;
    gap: 14px;
    margin-top: auto;
    padding-top: 24px;
}

.sidebar-tip {
    display: grid;
    gap: 7px;
    padding: 15px 13px;
    border: 1px solid rgba(233, 103, 90, .12);
    border-radius: 16px;
    background: linear-gradient(145deg, #fff7f3, #f3f6fa);
}

.sidebar-tip .tip-mark {
    color: #e9675a;
    font-size: 1.1rem;
}

.sidebar-tip strong {
    color: #263c57;
    font-size: .76rem;
    line-height: 1.4;
}

.sidebar-tip > span:last-child {
    color: var(--muted);
    font-size: .68rem;
    line-height: 1.5;
}

.sidebar-logout {
    min-height: 42px;
}

.app-main {
    min-width: 0;
}

.content-grid > *,
.form-grid > * {
    min-width: 0;
}

.form-grid input,
.form-grid select {
    min-width: 0;
}

.form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topbar {
    min-height: 100px;
    margin-bottom: 22px;
    padding: 16px 22px;
}

.topbar-leading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-heading .eyebrow {
    margin-bottom: 5px;
    font-size: .6rem;
}

.page-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.35rem;
    letter-spacing: -.035em;
}

.sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.dashboard {
    scroll-margin-top: 20px;
}

.dashboard [id] {
    scroll-margin-top: 24px;
}

.investment-chart-panel {
    overflow: hidden;
}

.investment-chart-panel .panel-header {
    margin-bottom: 10px;
}

.chart-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
}

.chart-link:hover {
    color: var(--primary-dark);
}

.investment-chart {
    position: relative;
    display: grid;
    grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 24px;
    min-height: 218px;
    padding: 18px 22px;
    border: 1px solid rgba(24, 69, 65, .08);
    border-radius: 18px;
    background: linear-gradient(120deg, #f8fbf9, #f1f7f4);
}

.investment-chart-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: min(280px, calc(100vw - 16px));
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: #173a36;
    box-shadow: 0 8px 24px rgba(15, 35, 32, .24);
    color: #fff;
    font-size: .76rem;
    line-height: 1.55;
    pointer-events: none;
    white-space: pre-line;
}

.investment-chart-tooltip[hidden] {
    display: none;
}

.portfolio-chart {
    margin-bottom: 16px;
}

.investment-bar-chart {
    display: grid;
    grid-column: 1 / -1;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(24, 69, 65, .09);
}

.investment-bar-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.investment-bar-heading strong {
    color: var(--text);
    font-size: .82rem;
}

.investment-bar-heading span {
    color: var(--muted);
    font-size: .7rem;
    text-align: right;
}

.investment-bar-list {
    display: grid;
    gap: 10px;
}

.investment-bar-row {
    display: grid;
    grid-template-columns: minmax(90px, .8fr) minmax(80px, 2fr) minmax(90px, .8fr);
    align-items: center;
    gap: 12px;
}

.investment-bar-label,
.investment-bar-value {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.investment-bar-label strong,
.investment-bar-value strong {
    overflow: hidden;
    color: var(--text);
    font-size: .73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.investment-bar-label span,
.investment-bar-value span {
    color: var(--muted);
    font-size: .66rem;
}

.investment-bar-value {
    justify-items: end;
}

.investment-bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(24, 69, 65, .09);
    cursor: help;
}

.investment-bar-fill {
    display: block;
    width: var(--bar-width);
    height: 100%;
    border-radius: inherit;
    background: var(--bar-color);
    transition: width .35s ease;
}

.investment-chart-visual {
    display: grid;
    place-items: center;
}

.investment-donut {
    display: block;
    width: min(100%, 205px);
    overflow: visible;
    transform: rotate(-90deg);
}

.investment-donut circle {
    transform-origin: 90px 90px;
}

.investment-donut .investment-chart-segment {
    transition: stroke-dasharray .35s ease, stroke-dashoffset .35s ease;
}

.investment-chart .investment-chart-segment {
    cursor: pointer;
}

.investment-chart .investment-chart-segment:focus {
    outline: none;
    stroke-width: 23;
}

.donut-caption,
.donut-total {
    transform: rotate(90deg);
    transform-origin: 90px 90px;
}

.donut-caption {
    fill: var(--muted);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .8px;
}

.donut-total {
    fill: var(--text);
    font-size: 11px;
    font-weight: 800;
}

.investment-legend {
    display: grid;
    max-height: 260px;
    gap: 4px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.investment-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 12px;
    transition: background .15s ease;
}

.investment-legend-item:hover {
    background: rgba(255, 255, 255, .75);
}

.legend-swatch {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--legend-color);
    outline: 4px solid rgba(39, 139, 118, .1);
}

.legend-name,
.legend-value {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.legend-name {
    flex: 1;
}

.legend-name strong,
.legend-value strong {
    overflow: hidden;
    color: var(--text);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-name small,
.legend-value small {
    color: var(--muted);
    font-size: .68rem;
}

.legend-value {
    justify-items: end;
}

.investment-chart-empty {
    display: grid;
    grid-column: 1 / -1;
    justify-items: center;
    gap: 8px;
    padding: 24px;
    color: var(--muted);
    text-align: center;
    font-size: .8rem;
}

.investment-chart-empty strong {
    color: var(--text);
    font-size: .9rem;
}

.chart-empty-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    background: #e5f1ec;
    color: var(--primary);
    font-size: 1.3rem;
}

.fixed-bill-caption {
    color: var(--muted);
    font-size: .78rem;
}

.fixed-bill-form {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid rgba(23, 43, 69, .08);
    border-radius: 18px;
    background: linear-gradient(145deg, #f8fafc, #f1f5f8);
}

#billForm select,
#billForm input {
    min-height: 48px;
    border: 1px solid rgba(23, 43, 69, .12);
    border-radius: 13px;
    background: #fff;
    font-size: .9rem;
}

#billForm label {
    color: #586a80;
    font-size: .78rem;
    font-weight: 700;
}

.bill-notifications {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(233, 103, 90, .18);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff9f7, #fff);
}

.bill-notifications[hidden] {
    display: none;
}

.bill-notifications-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bill-notifications-heading > div {
    display: grid;
    gap: 4px;
}

.bill-notifications-heading strong {
    color: var(--primary-dark);
    font-size: .92rem;
}

.bill-notifications-heading span {
    color: var(--muted);
    font-size: .76rem;
}

.bill-read-button {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid rgba(23, 43, 69, .1);
    background: #fff;
    color: var(--primary-dark);
    font-size: .72rem;
}

.bill-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(23, 43, 69, .08);
    border-radius: 13px;
    background: #fff;
}

.bill-notification .notice-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: #fff0eb;
    color: #b8493f;
    font-weight: 800;
}

.bill-notification > div {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.bill-notification > div strong {
    color: var(--text);
    font-size: .83rem;
}

.bill-notification > div span,
.bill-notification > b {
    color: var(--muted);
    font-size: .73rem;
}

.bill-notification > b {
    flex: 0 0 auto;
    color: #a8443a;
    text-align: right;
}

.bill-notification.overdue {
    border-color: rgba(197, 83, 76, .2);
    background: #fffaf9;
}

.bill-notification.upcoming .notice-icon {
    background: #fff5e6;
    color: #956b26;
}

.bill-category {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bill-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 210px;
}

.bill-paid-button {
    max-width: 100%;
    padding: 9px 13px;
    border: 1px solid #176653;
    border-radius: 11px;
    background: linear-gradient(135deg, #176653, #278c73);
    box-shadow: 0 5px 12px rgba(23, 102, 83, .16);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bill-paid-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #125544, #207a64);
    box-shadow: 0 7px 16px rgba(23, 102, 83, .24);
}

.bill-paid-button:disabled,
.bill-read-button:disabled {
    cursor: wait;
    opacity: .6;
}

.bill-item-paid {
    background: #f4faf7;
}

.bill-payment-status {
    display: inline-block;
    margin-top: 8px;
    font-size: .73rem;
    font-weight: 750;
}

.bill-payment-status.is-paid {
    color: #267158;
}

.bill-payment-status.is-unpaid {
    color: #a8443a;
}

.bill-repeat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.bill-repeat-actions .secondary-btn {
    padding: 7px 10px;
    border: 1px solid rgba(23, 43, 69, .1);
    background: #fff;
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 700;
}

.bill-repeat-actions button:disabled {
    cursor: wait;
    opacity: .6;
}

.bill-repeated-label {
    display: inline-block;
    margin-top: 9px;
    color: #267158;
    font-size: .76rem;
    font-weight: 750;
}

@media (max-width: 640px) {
    .investment-chart {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .investment-donut {
        width: min(100%, 190px);
    }

    .investment-legend {
        max-height: 240px;
    }

    .chart-link {
        font-size: .7rem;
    }
}

@media (max-width: 1100px) {
    .app-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 16px;
    }

    .content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .page-shell {
        padding: 10px;
    }

    .app-layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 1001;
        inset: 10px auto 10px 10px;
        width: min(285px, calc(100vw - 56px));
        min-height: 0;
        overflow-y: auto;
        transform: translateX(calc(-100% - 16px));
        transition: transform .22s ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open::after {
        position: fixed;
        z-index: 1000;
        inset: 0;
        background: rgba(17, 31, 49, .38);
        content: "";
    }

    .sidebar-toggle {
        display: inline-grid;
        flex: 0 0 42px;
        place-items: center;
    }

    .topbar {
        min-height: 82px;
        margin-bottom: 16px;
        padding: 12px 14px;
    }

    .topbar .brand-wrap,
    .topbar .brand-logo {
        display: none;
    }

    .topbar .header-logout {
        display: none;
    }
}

@media (max-width: 640px) {
    .notification-button {
        min-height: 38px;
        gap: 5px;
        padding: 0 8px;
        font-size: .72rem;
    }

    .header-actions {
        gap: 7px;
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-grid.compact {
        grid-template-columns: minmax(0, 1fr);
    }

    .transaction-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .investment-bar-row {
        grid-template-columns: minmax(72px, .8fr) minmax(50px, 1fr) minmax(75px, .8fr);
        gap: 8px;
    }

    .investment-bar-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .page-heading h1 {
        font-size: 1.1rem;
    }

    .user-pill {
        padding: 8px 10px;
        font-size: .78rem;
    }

    .fixed-bill-caption {
        display: none;
    }

    .bill-notification {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bill-notification > b {
        margin-left: 46px;
        text-align: left;
    }

    .bill-actions {
        max-width: 160px;
    }

    .bill-paid-button {
        padding: 8px 10px;
        font-size: .68rem;
    }

    .bill-notifications-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .bill-read-button {
        align-self: flex-start;
    }
}

:root {
    --bg: #f2f6f4;
    --panel: rgba(255, 255, 255, .96);
    --panel-strong: #ffffff;
    --text: #18343a;
    --muted: #718387;
    --line: rgba(24, 52, 58, .1);
    --primary: #21877d;
    --primary-dark: #173b42;
    --teal: #278b76;
    --orange: #d8a84e;
    --red: #c4564e;
    --gold: #d7ae5b;
    --shadow: 0 20px 48px rgba(28, 64, 62, .08);
}

body {
    background:
        radial-gradient(ellipse at 10% 0%, rgba(210, 231, 222, .52), transparent 36%),
        linear-gradient(145deg, #f1f6f3 0%, #f8faf8 52%, #edf3f0 100%);
    color: var(--text);
}

.topbar,
.panel,
.stat-card,
.sidebar {
    border-color: rgba(24, 69, 65, .09);
    background-color: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 46px rgba(28, 64, 62, .075);
}

.topbar {
    backdrop-filter: blur(18px);
}

.stat-card.primary { background: linear-gradient(135deg, #ffffff, #e8f2ee); }
.stat-card.blue { background: linear-gradient(135deg, #ffffff, #e7f0f1); }
.stat-card.green { background: linear-gradient(135deg, #f8fcf9, #e0f0e7); }
.stat-card.orange { background: linear-gradient(135deg, #fffdf8, #f6edd9); }

.primary-btn {
    border-color: rgba(255, 255, 255, .32);
    background: linear-gradient(135deg, #21877d, #35a18c);
    box-shadow: 0 9px 20px rgba(33, 135, 125, .2);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #19776e, #2b927e);
    box-shadow: 0 11px 24px rgba(33, 135, 125, .25);
}

.secondary-btn {
    border-color: rgba(24, 69, 65, .1);
    background: #f0f5f2;
    color: #31534f;
}

.secondary-btn:hover {
    background: #e4efea;
    color: #173b42;
}

.user-pill {
    background: #e5f1ec;
    color: #286b5c;
}

.page-heading h1,
.panel-header h3,
.stat-card strong {
    color: #18343a;
}

.eyebrow,
.bill-category,
.sidebar-tip .tip-mark {
    color: #21877d;
}

input,
select,
#transactionForm input,
#transactionForm select,
#billForm input,
#billForm select {
    border-color: rgba(24, 69, 65, .13);
    background: #f8fbf9;
}

input:focus,
select:focus {
    border-color: rgba(33, 135, 125, .55);
    box-shadow: 0 0 0 4px rgba(33, 135, 125, .11);
}

.quick-tabs {
    background: #e9f0ed;
}

.quick-tab .tab-icon,
.nav-icon {
    background: #e5eeea;
    color: #53716b;
}

.quick-tab.active,
.tab-button.active {
    border-color: rgba(33, 135, 125, .2);
    background: linear-gradient(135deg, #1d625d, #287a70);
    box-shadow: 0 9px 20px rgba(29, 98, 93, .18);
}

.quick-tab.active .tab-icon,
.quick-tab[data-kind="buy"].active .tab-icon,
.quick-tab[data-kind="income"].active .tab-icon,
.quick-tab[data-kind="expense"].active .tab-icon,
.quick-tab[data-kind="sell"].active .tab-icon {
    background: rgba(255, 255, 255, .16);
    color: #e7f4ef;
}

.sidebar-link,
.sidebar-logout {
    color: #5d7474;
}

.sidebar-link:hover,
.sidebar-logout:hover {
    background: #f0f6f3;
    color: #173b42;
}

.sidebar-link.active {
    border-color: rgba(33, 135, 125, .14);
    background: linear-gradient(100deg, #e5f3ed, #f2f8f5);
    color: #1b7068;
}

.sidebar-link.active .nav-icon {
    background: #d4ebe1;
    color: #1b7068;
}

.sidebar-tip {
    border-color: rgba(33, 135, 125, .12);
    background: linear-gradient(145deg, #eef7f2, #f6f8f4);
}

.sidebar-tip strong {
    color: #244b49;
}

.notification-button {
    border-color: rgba(24, 69, 65, .1);
    color: #28554f;
}

.notification-button:hover {
    background: #f0f6f3;
}

.notification-count {
    background: #cf9c3c;
    color: #fff;
}

.entry-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(240, 247, 243, .97));
}

.assistant-box {
    background: linear-gradient(135deg, #edf5f1, #e7f0ee);
}

.assistant-box {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(24, 69, 65, .1);
    border-radius: 16px;
}

.assistant-overview {
    margin: 0;
    color: var(--text);
    font-size: .9rem;
    line-height: 1.6;
}

.assistant-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.assistant-metric {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #c5ded4;
    border-radius: 11px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(24, 69, 65, .07);
}

.assistant-metric span,
.assistant-budget-rate {
    color: #526b63;
    font-size: .68rem;
}

.assistant-metric strong {
    overflow: hidden;
    color: #075b45;
    font-size: 1rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assistant-budget-rate {
    font-weight: 650;
}

.assistant-alert-list {
    display: grid;
    gap: 8px;
}

.assistant-alert {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: #fff;
}

.assistant-alert-mark {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: currentColor;
}

.assistant-alert strong {
    font-size: .78rem;
}

.assistant-alert p {
    margin: 3px 0 0;
    color: var(--text);
    font-size: .76rem;
    line-height: 1.5;
}

.assistant-alert--warning {
    border-color: #f1d6bc;
    background: #fff8f0;
    color: #9c5724;
}

.assistant-alert--positive {
    border-color: #c7e5d6;
    background: #f2faf5;
    color: #24724e;
}

.assistant-alert--opportunity {
    border-color: #d7d0ef;
    background: #f7f5fc;
    color: #644f9b;
}

.assistant-alert--info,
.assistant-alert--reminder {
    border-color: #cbdfe3;
    background: #f2f8f9;
    color: #316b76;
}

.assistant-ai-panel {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.assistant-ai-panel > .muted {
    font-size: .72rem;
    line-height: 1.5;
}

.assistant-ai-output {
    display: grid;
    gap: 10px;
}

.assistant-ai-summary {
    margin: 0;
    color: var(--text);
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.55;
}

.assistant-history-card {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(33, 135, 125, .16);
    border-radius: 14px;
    background: #fff;
}

.assistant-history-card > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(24, 69, 65, .09);
}

.assistant-history-card > header strong {
    color: var(--primary-dark);
    font-size: .85rem;
    text-transform: capitalize;
}

.assistant-history-card time,
.assistant-history-card > small {
    color: var(--muted);
    font-size: .66rem;
}

.assistant-history-snapshot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: var(--muted);
    font-size: .68rem;
}

.assistant-history-snapshot strong {
    color: var(--text);
}

.assistant-history-recommendations {
    display: grid;
    gap: 7px;
}

.assistant-history-recommendation {
    padding: 9px 11px;
    border-left: 3px solid var(--primary);
    border-radius: 0 9px 9px 0;
    background: #f8fbf9;
}

.assistant-history-recommendation strong {
    color: var(--primary-dark);
    font-size: .76rem;
}

.assistant-history-recommendation p,
.assistant-history-recommendation span {
    display: block;
    margin: 4px 0 0;
    color: var(--text);
    font-size: .76rem;
    line-height: 1.5;
}

.assistant-history-empty {
    padding: 12px 14px;
    border: 1px dashed rgba(24, 69, 65, .2);
    border-radius: 11px;
    color: var(--muted);
    font-size: .76rem;
}

.assistant-disclaimer {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: .68rem;
}

.panel-header #requestAssistantAi {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: .76rem;
}

.panel-header #requestAssistantAi:disabled {
    cursor: not-allowed;
    opacity: .55;
}

@media (max-width: 760px) {
    .assistant-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.fixed-bill-form {
    border-color: rgba(33, 135, 125, .1);
    background: linear-gradient(145deg, #f8fbf9, #edf5f1);
}

.bill-notifications {
    border-color: rgba(216, 168, 78, .28);
    background: linear-gradient(135deg, #fffaf0, #fffdf8);
}

.bill-notification {
    border-color: rgba(24, 69, 65, .08);
}

.bill-notification.overdue {
    border-color: rgba(196, 86, 78, .24);
    background: #fff8f6;
}

.bill-notification .notice-icon {
    background: #fbe9e5;
    color: #b64d45;
}

.bill-notification.upcoming .notice-icon {
    background: #fbf0d8;
    color: #856016;
}

.bill-notification > b,
.bill-payment-status.is-unpaid {
    color: #a94d43;
}

.bill-payment-status.is-paid,
.bill-repeated-label {
    color: #287861;
}

.warning-badge {
    border-color: #ead7a5;
    background: #fbf2dc;
    color: #755718;
    box-shadow: 0 2px 7px rgba(117, 87, 24, .07);
}

.bill-paid-button {
    border-color: #237563;
    background: linear-gradient(135deg, #277b68, #39a084);
    box-shadow: 0 5px 13px rgba(39, 123, 104, .17);
    color: #fff;
}

.bill-paid-button:hover {
    background: linear-gradient(135deg, #206957, #2f9077);
    box-shadow: 0 7px 16px rgba(39, 123, 104, .24);
}

.bill-repeat-actions .secondary-btn,
.bill-read-button {
    border-color: rgba(24, 69, 65, .1);
    background: #fff;
    color: #31534f;
}

.bill-item-paid {
    border-color: rgba(39, 139, 118, .12);
    background: #f2f8f4;
}

.asset-badge {
    background: rgba(39, 139, 118, .11);
    color: #287861;
}

.warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 750;
    line-height: 1.2;
}
