* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #eef5ff 0%, #f5f7fb 100%);
    color: #14213d;
}

button, input, select {
    font: inherit;
}

a { text-decoration: none; }

html {
    scroll-behavior: smooth;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelReveal {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.topbar {
    background: linear-gradient(90deg, #0a3d91 0%, #0d5bd6 100%);
    color: white;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(12, 66, 153, 0.18);
}

.brand-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-block span {
    opacity: 0.8;
    font-size: 0.84rem;
}

.actions-row {
    gap: 10px;
}

.container {
    max-width: 1320px;
    margin: 28px auto;
    padding: 0 18px 36px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.stat-card {
    border-radius: 16px;
    padding: 18px 20px;
    color: white;
    box-shadow: 0 18px 30px rgba(13, 67, 167, 0.15);
}

.blue-card { background: linear-gradient(135deg, #0d5bd6, #0d76d6); }
.red-card { background: linear-gradient(135deg, #bf1d1d, #d84f4f); }
.neutral-card { background: linear-gradient(135deg, #335381, #1c2f50); }

.stat-card span {
    display: block;
    opacity: 0.8;
    font-size: 0.85rem;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 1.8rem;
}

.layout-two {
    display: grid;
    grid-template-columns: 1.8fr 0.95fr;
    gap: 18px;
    margin-bottom: 20px;
}

.panel {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(162, 177, 210, 0.45);
    border-radius: 18px;
    box-shadow: 0 18px 35px rgba(20, 33, 61, 0.08);
    padding: 18px;
    animation: panelReveal 0.35s ease-out;
}

.calendar-panel, .list-panel, .form-panel { margin-bottom: 20px; }

.stat-card,
.account-item,
.panel-card,
.day-cell,
.recommendation-card,
.account-summary-panel,
.account-ledger-panel,
.account-menu-panel {
    animation: fadeInUp 0.38s ease-out;
}

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

.panel-header h2, .panel h2, .panel h3 {
    margin: 0 0 16px;
    color: #12274f;
}

.month-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #1b335b;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #32548d;
    text-align: center;
    font-size: 0.78rem;
}

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

.day-cell {
    min-height: 118px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f9fbff 0%, #edf4ff 100%);
    border: 1px solid #dfeafc;
    padding: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.muted-day {
    opacity: 0.5;
    background: #f4f6fa;
}

.today-day {
    border: 2px solid #0d5bd6;
    box-shadow: inset 0 0 0 1px rgba(13,93,214,0.18);
}

.expired-day {
    background: linear-gradient(180deg, #fff2f2 0%, #ffe5e5 100%);
    border-color: #f8b4b4;
}

.day-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: #183867;
    margin-bottom: 6px;
}

.event-pill {
    display: block;
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 0.6rem;
    line-height: 1.25;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(16, 68, 150, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(16, 68, 150, 0.16);
}

.event-blue { background: linear-gradient(135deg, #0d5bd6, #2e7cf7); }
.event-green { background: linear-gradient(135deg, #137a42, #3cb66a); }
.event-red { background: linear-gradient(135deg, #d93c3c, #ff6a6a); }
.event-more {
    background: linear-gradient(135deg, #475976, #667fa8);
    text-align: center;
    font-size: 0.62rem;
}

.calendar-panel {
    background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
    border-radius: 18px;
    border: 1px solid #dfeafc;
    padding: 18px;
}

.day-cell {
    min-height: 122px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    border: 1px solid #dfeafc;
    padding: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.account-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.account-overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.account-summary-panel,
.account-forms-panel,
.panel-card,
.account-ledger-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    border: 1px solid #dfeafc;
    border-radius: 16px;
    padding: 18px;
}

.account-summary-panel h3,
.account-forms-panel h3,
.panel-card h3,
.account-ledger-panel h3 {
    margin: 0 0 16px;
    color: #183867;
}

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

.account-detail-panel-wrapper {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.account-detail-panel {
    display: none;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    border: 1px solid #dfeafc;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 14px 24px rgba(17, 42, 83, 0.06);
}

.account-detail-panel.active {
    display: block;
}

.account-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.account-detail-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a79a8;
    margin-bottom: 4px;
}

.account-detail-header h3 {
    margin: 0;
    color: #183867;
}

.account-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.account-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.account-detail-table th,
.account-detail-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e3ebfa;
    text-align: left;
}

.account-detail-table th {
    color: #1d3d6e;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #edf4ff;
}

.account-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fbff 0%, #edf4ff 100%);
    border: 1px solid #dfeafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
    position: relative;
    overflow: visible;
    flex-wrap: wrap;
}

.account-item {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.account-extra {
    width: 100%;
}

.account-movements {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #dfeafc;
    border-radius: 12px;
    background: rgba(255,255,255,0.65);
    overflow: hidden;
}

.account-movements summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 700;
    color: #1f447f;
    background: #edf4ff;
    border-bottom: 1px solid #dfeafc;
}

.account-movements summary::-webkit-details-marker {
    display: none;
}

.account-movements[open] summary {
    border-bottom: 1px solid #dfeafc;
}

.account-movements-body {
    padding: 12px;
}

.account-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mini-stat {
    background: #f8fbff;
    border: 1px solid #e3ebfa;
    border-radius: 12px;
    padding: 10px 12px;
}

.mini-stat span {
    display: block;
    color: #6881ad;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.mini-stat strong {
    color: #183867;
    font-size: 0.95rem;
}

.mini-stat.danger strong {
    color: #a92e2e;
}

.account-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.account-detail-table th,
.account-detail-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #edf2ff;
    text-align: left;
}

.account-detail-table th {
    background: #f7faff;
    color: #32518d;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-item:hover,
.account-item:focus-visible,
.account-item.active {
    transform: translateY(-1px);
    border-color: #9fc1ff;
    box-shadow: 0 10px 18px rgba(13, 93, 214, 0.12);
}

.account-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #0d5bd6, #84b3ff);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.account-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

.account-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d5bd6, #6fa6ff);
    box-shadow: 0 8px 16px rgba(13, 93, 214, 0.15);
    font-size: 1rem;
}

.account-main strong {
    display: block;
    color: #1b335b;
    font-size: 1rem;
}

.account-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.account-mini-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.account-mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.account-mini-pill:hover {
    transform: translateY(-1px);
}

.account-positive {
    background: #eafaf1;
    border-color: #bfe9ce;
    color: #0f7d41;
}

.account-neutral {
    background: #edf3ff;
    border-color: #d9e6ff;
    color: #234a94;
}

.account-time-pill {
    background: #f5f7fb;
    border-color: #e4ebf7;
    color: #405d8f;
}

.account-pill-icon {
    font-size: 0.72rem;
}

.account-type-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eaf2ff;
    border: 1px solid #d7e6ff;
    color: #214d88;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.account-sub-label {
    color: #6c7ea0;
    font-size: 0.72rem;
    font-weight: 600;
}

.account-side {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.balance {
    font-weight: 800;
    letter-spacing: 0.01em;
    font-size: 1rem;
}

.balance-positive { color: #0c7b41; }
.balance-negative { color: #c52d2d; }

.account-menu {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.account-menu summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(13, 93, 214, 0.2);
    background: linear-gradient(135deg, #0d5bd6, #2c79f5);
    color: #fff;
    font-weight: 800;
    min-width: 138px;
    text-align: center;
    box-shadow: 0 12px 22px rgba(13, 93, 214, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.account-menu summary:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 16px 22px rgba(13, 93, 214, 0.22);
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.account-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    padding: 10px;
    background: rgba(255,255,255,0.99);
    border: 1px solid #dfeafc;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 18px 28px rgba(13, 93, 214, 0.09);
    z-index: 50;
    backdrop-filter: blur(4px);
}

.action-menu-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    font-size: 0.74rem;
    border-radius: 10px;
}

.inline-account-form {
    display: inline;
}

.hint-inline {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #657aa3;
}

.compact-form {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.panel-card + .panel-card {
    margin-top: 18px;
}

.account-actions-grid {
    margin-top: 20px;
}

.action-panel.hidden {
    display: none;
}

.action-panel:not(.hidden) {
    animation: panelReveal 0.28s ease-out;
}

.account-item:hover,
.panel-card:hover,
.day-cell:hover,
.recommendation-card:hover,
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(18, 39, 79, 0.08);
}

.account-item,
.panel-card,
.day-cell,
.recommendation-card,
.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multi-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }

label {
    display: block;
    margin-bottom: 6px;
    color: #31528d;
    font-size: 0.8rem;
    font-weight: 700;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd8ee;
    border-radius: 10px;
    background: #fff;
    color: #21375d;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d5bd6, #2c79f5);
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 18px rgba(13, 93, 214, 0.18);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 22px rgba(13, 93, 214, 0.22);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary { background: linear-gradient(135deg, #475976, #60739a); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #c62828, #e44d4d); box-shadow: none; }
.btn.small { padding: 7px 10px; font-size: 0.75rem; }

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid #e8edf7;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #35538d;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.status-finished {
    color: #a61a1a;
    font-weight: 700;
}

.status-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.status-badge.paid {
    background: #eafaf1;
    color: #0f7d41;
    border-color: #bfe9ce;
}

.status-badge.overdue {
    background: #fff1f1;
    color: #b52b2b;
    border-color: #f2c4c4;
}

.status-badge.pending {
    background: #eef4ff;
    color: #2857a6;
    border-color: #d9e6ff;
}

.money-positive { color: #118a4f; font-weight: 700; }
.money-negative { color: #c72f2f; font-weight: 700; }

.inline-form { display: inline; }

.action-stack {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.two-column-lists {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.sub-heading {
    margin-top: 18px;
    color: #244d91;
}

.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

.tab-link {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    background: #edf3ff;
    color: #244d91;
    font-weight: 700;
    border: 1px solid #d8e6ff;
}

.tab-link.active {
    background: linear-gradient(135deg, #0d5bd6, #2c79f5);
    color: white;
    border-color: transparent;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.report-header {
    margin-bottom: 18px;
}

.report-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.report-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    border: 1px solid #dfeafc;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 120px;
}

.report-summary-card span {
    color: #5976a5;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.report-summary-card strong {
    color: #183867;
    font-size: 1.35rem;
    line-height: 1.2;
}

.report-summary-card small {
    color: #647da6;
    font-size: 0.72rem;
}

.report-blue { background: linear-gradient(135deg, #edf5ff 0%, #dfeeff 100%); }
.report-red { background: linear-gradient(135deg, #fff3f3 0%, #ffe6e6 100%); }
.report-neutral { background: linear-gradient(135deg, #f5f7fb 0%, #eceff8 100%); }
.report-green { background: linear-gradient(135deg, #edfdf3 0%, #e4f9ea 100%); }

.report-export-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid #dfeafc;
    background: linear-gradient(135deg, #f6f9ff 0%, #edf4ff 100%);
}

.report-export-card h3 {
    margin: 6px 0 8px;
    color: #183867;
}

.report-export-card p {
    margin: 0;
    color: #536d9a;
}

.report-export-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 700;
    color: #4468a5;
}

.report-layout {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
}

.report-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border: 1px solid #dfeafc;
    border-radius: 16px;
    padding: 18px;
}

.report-filters {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #dfeafc;
    border-radius: 14px;
    background: linear-gradient(180deg, #f9fbff 0%, #edf4ff 100%);
}

.report-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.report-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-filter-field label {
    margin: 0;
    color: #30518f;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

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

.report-panel-header h3 {
    margin: 0;
    color: #183867;
}

.report-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #edf3ff;
    color: #284d8c;
    font-size: 0.72rem;
    font-weight: 700;
}

.report-subsection {
    margin-top: 18px;
}

.small-header {
    margin-bottom: 10px;
}

.report-table-wrap {
    overflow: hidden;
    border: 1px solid #e2ebff;
    border-radius: 12px;
    background: #fff;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}

.report-table th,
.report-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #edf2ff;
    vertical-align: top;
}

.report-table th {
    background: #f3f7ff;
    color: #2d4f85;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
}

.report-table tbody tr:hover {
    background: #f9fbff;
}

.report-item-name {
    font-weight: 700;
    color: #1a3767;
    margin-bottom: 4px;
}

.report-category {
    display: inline-block;
    border-radius: 999px;
    background: #edf3ff;
    color: #2a4d8d;
    padding: 4px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.report-type.deposit {
    background: #eafaf1;
    color: #0d7a42;
    border-color: #bae7ce;
}

.report-type.charge {
    background: #fff1f1;
    color: #b12e2e;
    border-color: #f0c4c4;
}

.report-money {
    font-weight: 800;
    color: #183867;
    white-space: nowrap;
}

.compact-actions {
    gap: 6px;
}

.compact-table td,
.compact-table th {
    padding-top: 8px;
    padding-bottom: 8px;
}

.summary-box {
    margin-top: 18px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f7faff 0%, #edf3ff 100%);
    border: 1px solid #dfeafc;
    border-radius: 12px;
    color: #173b76;
}

.summary-box p {
    margin: 6px 0;
}

.priority-box {
    margin-top: 18px;
    padding: 16px;
    background: linear-gradient(180deg, #fffaf7 0%, #fff3ef 100%);
    border: 1px solid #f9d9cc;
    border-radius: 12px;
}

.priority-box h3 {
    margin: 0 0 12px;
    color: #1a3a6a;
}

.priority-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.priority-box li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.72);
    border-radius: 10px;
    border: 1px solid rgba(232, 167, 150, 0.45);
}

.priority-box li span {
    color: #203a63;
}

.priority-box li strong {
    color: #b33b30;
}

.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.mini-stat {
    background: linear-gradient(135deg, #edf5ff 0%, #dfeeff 100%);
    border: 1px solid #d1e1ff;
    border-radius: 12px;
    padding: 12px 10px;
}

.mini-stat.danger {
    background: linear-gradient(135deg, #fff1f1 0%, #ffe0e0 100%);
    border-color: #f2c4c4;
}

.mini-stat.neutral {
    background: linear-gradient(135deg, #f5f6fa 0%, #eceff8 100%);
    border-color: #dfe5f2;
}

.mini-stat span {
    display: block;
    font-size: 0.72rem;
    color: #536d9b;
    margin-bottom: 8px;
}

.mini-stat strong {
    display: block;
    font-size: 1.05rem;
    color: #183867;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.chart-card,
.recommendation-panel {
    background: linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%);
    border: 1px solid #dfeafc;
    border-radius: 16px;
    padding: 18px;
}

.chart-card h3,
.recommendation-panel h3 {
    margin: 0 0 14px;
    color: #1d3d73;
}

.bar-chart {
    display: grid;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: #203d69;
}

.bar-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e8eefc;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0d5bd6, #7ab2ff);
}

.line-chart {
    width: 100%;
    height: 140px;
    background: linear-gradient(180deg, #eef6ff 0%, #f9fbff 100%);
    border-radius: 12px;
    border: 1px solid #dfeafc;
}

.chart-legend {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #35538d;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.legend-dot.blue {
    background: #0d5bd6;
}

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

.recommendation-card {
    background: #fff;
    border: 1px solid #e2ebff;
    border-radius: 12px;
    padding: 14px;
    color: #244d91;
}

.recommendation-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.recommendation-card p {
    margin: 0;
    line-height: 1.45;
    font-size: 0.8rem;
    color: #4d607d;
}

.category-badge {
    display: inline-block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 6px;
    background: #edf3ff;
    color: #234a94;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.category-badge.large {
    font-size: 0.72rem;
    padding: 6px 10px;
    margin: 4px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.flash {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 700;
}
.flash.success { background: #eafaf1; color: #11663d; border: 1px solid #bfe9d0; }
.flash.error { background: #fff1f1; color: #a91e1e; border: 1px solid #f5c7c7; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eaf2ff 0%, #f4f7ff 100%);
}

.auth-box {
    width: min(440px, 92vw);
    background: rgba(255,255,255,0.96);
    border-radius: 18px;
    padding: 30px 28px;
    box-shadow: 0 24px 50px rgba(21, 42, 87, 0.12);
}

.auth-box h1 {
    margin-top: 0;
    color: #162d61;
}

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

.muted { color: #5d6f8f; }

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
    .container {
        padding: 0 16px 36px;
        margin: 18px auto;
    }

    .layout-two {
        grid-template-columns: 1fr;
    }

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

    .report-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .topbar {
        padding: 14px 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .topbar .actions-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px 18px;
    }

    .stat-card strong {
        font-size: 1.5rem;
    }

    .dashboard-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        display: flex;
        gap: 8px;
        margin-bottom: 14px;
    }

    .tab-link {
        padding: 8px 14px;
        font-size: 0.82rem;
        flex-shrink: 0;
    }

    .form-grid.multi-col,
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .two-column-lists,
    .chart-grid,
    .recommendations-grid,
    .finance-grid {
        grid-template-columns: 1fr;
    }

    .report-filter-form {
        grid-template-columns: 1fr;
    }

    .report-filter-actions {
        justify-content: stretch;
    }

    .report-filter-actions .btn {
        width: 100%;
    }

    .calendar-weekdays {
        font-size: 0.7rem;
    }

    .calendar-grid {
        gap: 4px;
    }

    .day-cell {
        min-height: 75px;
        padding: 4px;
        border-radius: 8px;
    }

    .day-number {
        font-size: 0.72rem;
        margin-bottom: 2px;
    }

    .event-pill {
        padding: 3px 5px;
        font-size: 0.55rem;
        border-radius: 6px;
    }

    .account-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .account-side {
        width: 100%;
        justify-content: space-between;
    }

    .account-menu {
        width: 100%;
    }

    .account-menu summary {
        width: 100%;
    }

    .account-menu-panel {
        left: 0;
        right: 0;
        width: 100%;
    }

    .report-export-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .report-export-card .btn {
        width: 100%;
    }

    input, select, .btn {
        min-height: 44px; /* Mobile touch target standard */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px 28px;
    }

    .panel {
        padding: 14px;
        border-radius: 14px;
    }

    .report-overview-grid {
        grid-template-columns: 1fr;
    }

    .day-cell {
        min-height: 60px;
    }

    .event-pill {
        font-size: 0.5rem;
        padding: 2px 4px;
    }
}

/* ==========================================================================
   DARK MODE SUPPORT
   ========================================================================== */
body.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
}

body.dark-theme .topbar {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
}

body.dark-theme .panel,
body.dark-theme .account-summary-panel,
body.dark-theme .account-forms-panel,
body.dark-theme .account-ledger-panel,
body.dark-theme .panel-card,
body.dark-theme .calendar-panel,
body.dark-theme .report-summary-card,
body.dark-theme .report-panel,
body.dark-theme .chart-card,
body.dark-theme .recommendation-panel,
body.dark-theme .recommendation-card,
body.dark-theme .detail-card,
body.dark-theme .auth-box {
    background: rgba(30, 41, 59, 0.95);
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-theme .panel-header h2,
body.dark-theme .panel h2,
body.dark-theme .panel h3,
body.dark-theme label,
body.dark-theme .month-switcher,
body.dark-theme .day-number,
body.dark-theme .report-item-name,
body.dark-theme .report-money,
body.dark-theme .account-main strong {
    color: #f8fafc;
}

body.dark-theme input,
body.dark-theme select {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

body.dark-theme .day-cell {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

body.dark-theme .muted-day {
    background: #0f172a;
    opacity: 0.4;
}

body.dark-theme .today-day {
    border-color: #38bdf8;
}

body.dark-theme .account-item {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

body.dark-theme table th {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-theme table td {
    border-color: #334155;
}

.theme-toggle-btn {
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.3);
}


