@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap');

:root {
    --bg-base: #f3f7fb;
    --bg-start: #f8fbff;
    --bg-gradient-a: rgba(14, 116, 144, 0.16);
    --bg-gradient-b: rgba(15, 118, 110, 0.14);
    --surface: rgba(255, 255, 255, 0.9);
    --surface-solid: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --accent: #0284c7;
    --border: #dbe6f1;
    --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
    --topbar-bg: rgba(248, 252, 255, 0.82);
    --topbar-border: rgba(148, 163, 184, 0.28);
    --nav-link-color: #3d4f68;
    --nav-link-active-bg: rgba(2, 132, 199, 0.12);
    --nav-link-active-color: #0b1f35;
    --user-pill-bg: rgba(15, 118, 110, 0.1);
    --user-pill-border: rgba(15, 118, 110, 0.2);
    --user-pill-color: #0f172a;
    --ghost-btn-bg: rgba(15, 23, 42, 0.08);
    --ghost-btn-text: #334155;
    --danger-btn-bg: rgba(220, 38, 38, 0.14);
    --danger-btn-text: #7f1d1d;
    --title-color: #0b162c;
    --label-color: #475569;
    --input-bg: #ffffff;
    --input-border: #d4deea;
    --input-placeholder: #9aa9bc;
    --table-head-bg: #f8fbff;
    --table-head-color: #334155;
    --table-text: #1e293b;
    --table-row-hover: #f3f8ff;
    --list-item-bg: #ffffff;
    --list-item-border: #e6eef6;
    --list-item-text: #1e293b;
    --panel-header-bg: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(15, 118, 110, 0.08));
    --panel-header-border: rgba(148, 163, 184, 0.24);
    --mini-card-bg: #ffffff;
    --mini-card-border: rgba(15, 23, 42, 0.08);
    --loading-overlay-bg: rgba(243, 247, 251, 0.72);
    --radius-lg: 18px;
    --radius-md: 12px;
}

html[data-theme="dark"] {
    --bg-base: #0b1220;
    --bg-start: #0a1323;
    --bg-gradient-a: rgba(30, 64, 175, 0.18);
    --bg-gradient-b: rgba(13, 148, 136, 0.16);
    --surface: rgba(16, 24, 39, 0.9);
    --surface-solid: #0f172a;
    --text: #e5edf8;
    --muted: #94a3b8;
    --border: #253448;
    --shadow: 0 18px 44px rgba(2, 8, 23, 0.48);
    --topbar-bg: rgba(9, 15, 28, 0.85);
    --topbar-border: rgba(71, 85, 105, 0.38);
    --nav-link-color: #a5b4c7;
    --nav-link-active-bg: rgba(14, 165, 233, 0.18);
    --nav-link-active-color: #e2e8f0;
    --user-pill-bg: rgba(2, 132, 199, 0.18);
    --user-pill-border: rgba(56, 189, 248, 0.34);
    --user-pill-color: #e2e8f0;
    --ghost-btn-bg: rgba(148, 163, 184, 0.14);
    --ghost-btn-text: #e2e8f0;
    --danger-btn-bg: rgba(248, 113, 113, 0.2);
    --danger-btn-text: #fecaca;
    --title-color: #f1f5f9;
    --label-color: #a9bacf;
    --input-bg: #0b1425;
    --input-border: #2b3b53;
    --input-placeholder: #7890ad;
    --table-head-bg: #111d33;
    --table-head-color: #b7c7dd;
    --table-text: #d5e1f0;
    --table-row-hover: #16243f;
    --list-item-bg: #111b2f;
    --list-item-border: #24344e;
    --list-item-text: #d9e5f3;
    --panel-header-bg: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(13, 148, 136, 0.16));
    --panel-header-border: rgba(71, 85, 105, 0.45);
    --mini-card-bg: #0f1a2f;
    --mini-card-border: rgba(100, 116, 139, 0.32);
    --loading-overlay-bg: rgba(6, 11, 21, 0.65);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 8%, var(--bg-gradient-a), transparent 38%),
        radial-gradient(circle at 84% 0%, var(--bg-gradient-b), transparent 40%),
        linear-gradient(160deg, var(--bg-start) 0%, var(--bg-base) 100%);
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Sora', sans-serif;
    letter-spacing: 0.01em;
}

.topbar {
    background: var(--topbar-bg) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--topbar-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar .container-fluid {
    max-width: 1400px;
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.12rem;
    color: var(--text) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.28);
}

.topbar .nav-link {
    color: var(--nav-link-color) !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.4rem 0.9rem !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.topbar .nav-link:hover,
.topbar .nav-link.active {
    background: var(--nav-link-active-bg);
    color: var(--nav-link-active-color) !important;
}

.topbar .navbar-collapse {
    align-items: center;
}

.topbar .navbar-toggler {
    border: 1px solid var(--topbar-border);
}

html[data-theme="dark"] .topbar .navbar-toggler-icon {
    filter: invert(1) brightness(1.4);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-pill {
    background: var(--user-pill-bg);
    border: 1px solid var(--user-pill-border);
    color: var(--user-pill-color);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    line-height: 1;
}

.logout-btn {
    border: none;
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    background: var(--ghost-btn-bg);
    color: var(--ghost-btn-text);
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.logout-btn:hover {
    background: var(--danger-btn-bg);
    color: var(--danger-btn-text);
    transform: translateY(-1px);
}

.theme-btn {
    border: none;
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    background: var(--ghost-btn-bg);
    color: var(--ghost-btn-text);
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover {
    background: var(--nav-link-active-bg);
    color: var(--nav-link-active-color);
    transform: translateY(-1px);
}

.theme-btn .theme-label {
    font-size: 0.86rem;
}

.theme-btn .theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.app-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.35rem 1rem 2.2rem;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes item-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes soft-refresh {
    from {
        filter: saturate(0.92) brightness(0.98);
    }

    to {
        filter: saturate(1) brightness(1);
    }
}

.fx-refresh {
    animation: soft-refresh 0.34s ease both;
}

.fx-item-enter {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    animation: item-enter 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    will-change: transform, opacity;
}

.page-header {
    margin-bottom: 1rem;
    animation: rise-in 0.35s ease both;
}

.page-title {
    margin: 0;
    font-size: clamp(1.35rem, 1.2rem + 1vw, 2rem);
    font-weight: 700;
    color: var(--title-color);
}

.page-subtitle {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.surface-panel,
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: rise-in 0.45s ease both;
}

.card {
    overflow: hidden;
}

.card-header,
.surface-panel-header {
    border-bottom: 1px solid var(--panel-header-border);
    background: var(--panel-header-bg);
    font-weight: 700;
    color: var(--text);
    padding: 0.85rem 1rem;
}

.surface-panel-body {
    padding: 0.85rem;
}

.form-label,
.col-form-label {
    color: var(--label-color);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    min-height: 44px;
    background: var(--input-bg);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(2, 132, 199, 0.66);
    box-shadow: 0 0 0 0.2rem rgba(2, 132, 199, 0.14);
    background: var(--input-bg);
    color: var(--text);
}

.form-control::placeholder {
    color: var(--input-placeholder);
}

textarea.form-control {
    min-height: 84px;
    resize: vertical;
}

.btn {
    font-weight: 700;
    border-radius: 12px;
    padding: 0.52rem 1rem;
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-strong), #0369a1);
}

.btn-danger {
    border: none;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

#edit_off {
    color: #b45309 !important;
    font-weight: 700;
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    overflow: auto;
    max-height: 76vh;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--table-head-bg);
    color: var(--table-head-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.74rem;
    border-bottom: 1px solid var(--border);
}

.table tbody td {
    vertical-align: middle;
    color: var(--table-text);
}

.table-hover > tbody > tr:hover > * {
    background: var(--table-row-hover);
    color: var(--table-text);
}

.report-grid .surface-panel,
.report-grid .card {
    height: 100%;
}

.report-filters-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-head-inline {
    margin-bottom: 0.5rem;
}

.account-toolbar {
    display: inline-flex;
    gap: 0.4rem;
}

.report-filters-card .btn-outline-secondary {
    border-color: var(--border);
    color: var(--ghost-btn-text);
    background: transparent;
}

.report-filters-card .btn-outline-secondary:hover,
.report-filters-card .btn-outline-secondary:focus {
    border-color: rgba(2, 132, 199, 0.55);
    color: var(--nav-link-active-color);
    background: var(--nav-link-active-bg);
}

.account-selector {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-solid);
    padding: 0.48rem;
    display: grid;
    gap: 0.42rem;
    max-height: 250px;
    overflow: auto;
}

.account-option {
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--input-bg);
    color: var(--text);
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: 10px 1fr 16px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.62rem;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.account-option:hover {
    transform: translateY(-1px);
    border-color: rgba(2, 132, 199, 0.5);
}

.account-option.is-selected {
    border-color: rgba(2, 132, 199, 0.56);
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.18);
}

.account-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}

.account-text {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--table-text);
}

.account-check {
    opacity: 0.18;
    font-weight: 800;
    color: var(--accent);
}

.account-option.is-selected .account-check {
    opacity: 1;
}

.report-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.58rem;
    margin-bottom: 0.75rem;
}

.report-pill {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: flex-start;
}

.report-pill-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    opacity: 0.9;
}

.report-pill-value {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.report-table-wrap {
    max-height: 68vh;
}

.report-table-wrap table {
    min-width: 980px;
}

.report-account-cell {
    display: flex;
    align-items: center;
    gap: 0.46rem;
    min-width: 220px;
    white-space: nowrap;
}

.report-account-cell span:last-child {
    white-space: nowrap;
    overflow: visible;
}

.account-line {
    width: 4px;
    height: 18px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.report-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.52rem;
}

.report-type.type-debito {
    background: rgba(22, 163, 74, 0.15);
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.22);
}

.report-type.type-credito {
    background: rgba(220, 38, 38, 0.14);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.22);
}

.historic-grid .surface-panel,
.historic-grid .card {
    height: 100%;
}

.historic-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.58rem;
}

.historic-summary-panel .summary-pill {
    background: linear-gradient(135deg, #0f766e, #0284c7);
    color: #f8fafc;
    border: 1px solid rgba(14, 116, 144, 0.42);
    box-shadow: 0 8px 16px rgba(2, 132, 199, 0.24);
    min-height: 78px;
}

.historic-summary-panel .report-pill-label {
    color: rgba(248, 250, 252, 0.9);
}

.historic-trend-list {
    display: grid;
    gap: 0.5rem;
}

.historic-trend-item {
    border: 1px solid var(--border);
    background: var(--surface-solid);
    border-radius: 10px;
    padding: 0.5rem 0.62rem;
    font-size: 0.87rem;
    color: var(--table-text);
    font-weight: 600;
}

.historic-chart-panel .surface-panel-body {
    padding: 0.75rem;
}

.chart-canvas-wrap {
    position: relative;
    min-height: 300px;
}

.category-card .card-header,
.movement-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.category-card .card-body {
    padding: 0.7rem;
}

.icon-btn {
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0284c7, #0f766e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 18px rgba(2, 132, 199, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(2, 132, 199, 0.32);
}

.action-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
}

.action-icon-btn {
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.action-icon-btn:hover {
    transform: translateY(-1px);
}

.action-save {
    background: rgba(22, 163, 74, 0.16);
    color: #166534;
}

.action-save:hover {
    background: rgba(22, 163, 74, 0.24);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.25);
}

.action-edit {
    background: rgba(217, 119, 6, 0.17);
    color: #92400e;
}

.action-edit:hover {
    background: rgba(217, 119, 6, 0.28);
    box-shadow: 0 6px 14px rgba(217, 119, 6, 0.26);
}

.action-delete {
    background: rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.action-delete:hover {
    background: rgba(220, 38, 38, 0.24);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.24);
}

.table-action-cell {
    width: 52px;
    text-align: center;
    padding: 0.35rem !important;
}

.dashboard-grid .section-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--surface);
    padding: 0.85rem;
    height: 100%;
}

.dashboard-grid > div:nth-child(1) .section-card,
.dashboard-grid > div:nth-child(2) .section-card,
.dashboard-grid > div:nth-child(3) .section-card,
.dashboard-grid > div:nth-child(4) .section-card,
.dashboard-grid > div:nth-child(5) .section-card,
.dashboard-grid > div:nth-child(6) .section-card {
    animation: rise-in 0.42s ease both;
}

.dashboard-grid > div:nth-child(1) .section-card {
    animation-delay: 0.03s;
}

.dashboard-grid > div:nth-child(2) .section-card {
    animation-delay: 0.07s;
}

.dashboard-grid > div:nth-child(3) .section-card {
    animation-delay: 0.11s;
}

.dashboard-grid > div:nth-child(4) .section-card {
    animation-delay: 0.15s;
}

.dashboard-grid > div:nth-child(5) .section-card {
    animation-delay: 0.19s;
}

.dashboard-grid > div:nth-child(6) .section-card {
    animation-delay: 0.23s;
}

.dashboard-grid .section-card h3 {
    margin: 0 0 0.75rem;
    font-size: 0.96rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--table-head-color);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.section-head h3 {
    margin: 0 !important;
}

.section-toggle-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--table-head-color);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.32rem 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.section-toggle-btn:hover {
    background: rgba(2, 132, 199, 0.14);
    color: var(--text);
    transform: translateY(-1px);
}

.panel-scroll {
    overflow-y: auto;
    max-height: 65vh;
    padding-right: 0.2rem;
}

.list-group {
    border-radius: 12px;
    overflow: hidden;
}

.list-group-item {
    border-color: var(--list-item-border);
    background: var(--list-item-bg);
    color: var(--list-item-text);
    padding: 0.7rem 0.75rem;
    font-weight: 600;
}

#summary .summary-pill {
    background: linear-gradient(135deg, #0f766e, #0284c7);
    color: #f8fafc;
    border: 1px solid rgba(14, 116, 144, 0.42);
    font-weight: 700;
    padding: 0.32rem 0.64rem;
    box-shadow: 0 8px 16px rgba(2, 132, 199, 0.24);
}

html[data-theme="dark"] #summary .summary-pill {
    background: linear-gradient(135deg, #22d3ee, #38bdf8);
    color: #04213a;
    border-color: rgba(125, 211, 252, 0.52);
    box-shadow: 0 8px 16px rgba(56, 189, 248, 0.28);
}

.mini-card {
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
    margin-bottom: 0.7rem;
    overflow: hidden;
    border: 1px solid var(--mini-card-border);
    background: var(--mini-card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.mini-card-header {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.46rem 0.64rem;
    color: #fff;
    text-transform: capitalize;
}

.mini-card-body {
    font-size: 0.98rem;
    font-weight: 700;
    padding: 0.65rem 0.7rem;
    color: var(--text);
}

.recurrent-card.recurrent-paid {
    border: 1px solid rgba(34, 197, 94, 0.38);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.16);
}

.recurrent-card.recurrent-paid .mini-card-header {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    color: #f0fdf4;
}

.recurrent-card.recurrent-paid .mini-card-body {
    color: #166534;
}

.recurrent-empty {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 0.7rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    background: rgba(148, 163, 184, 0.08);
}

.recurrent-meta {
    font-size: 0.74rem;
    opacity: 0.9;
    margin-top: 0.26rem;
}

.table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.table tbody tr:hover {
    transform: translateY(-1px);
}

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-layout {
    width: min(960px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    animation: rise-in 0.45s ease both;
}

.auth-brand {
    background: linear-gradient(150deg, #0f172a 0%, #0f766e 56%, #0284c7 100%);
    color: #e2e8f0;
    padding: clamp(1.4rem, 2vw, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand h1 {
    color: #f8fafc;
    margin: 0 0 0.8rem;
    font-size: clamp(1.3rem, 1.1rem + 1vw, 2.1rem);
}

.auth-brand p {
    margin: 0;
    color: rgba(226, 232, 240, 0.92);
}

.auth-card {
    padding: clamp(1.25rem, 2.2vw, 2.3rem);
}

.auth-card .btn-primary {
    width: 100%;
}

.auth-footer-note {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--loading-overlay-bg);
    backdrop-filter: blur(4px);
}

.auth-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.55rem;
}

html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--table-text);
    --bs-table-border-color: var(--border);
}

html[data-theme="dark"] .table-primary {
    --bs-table-bg: #18263f;
    --bs-table-striped-bg: #18263f;
    --bs-table-active-bg: #213153;
    --bs-table-hover-bg: #223456;
    --bs-table-color: #d7e6f9;
}

html[data-theme="dark"] .text-muted {
    color: #9fb2cb !important;
}

html[data-theme="dark"] .section-toggle-btn {
    background: rgba(148, 163, 184, 0.12);
    color: #c7d7ea;
    border-color: #334155;
}

html[data-theme="dark"] .section-toggle-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #e2e8f0;
}

html[data-theme="dark"] .recurrent-card.recurrent-paid {
    border-color: rgba(74, 222, 128, 0.38);
    box-shadow: 0 10px 22px rgba(74, 222, 128, 0.18);
}

html[data-theme="dark"] .recurrent-card.recurrent-paid .mini-card-body {
    color: #86efac;
}

html[data-theme="dark"] .action-edit {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(251, 191, 36, 0.35) !important;
}

html[data-theme="dark"] .action-edit:hover {
    background: rgba(251, 191, 36, 0.3) !important;
    color: #fde68a !important;
    box-shadow: 0 6px 14px rgba(251, 191, 36, 0.28) !important;
}

html[data-theme="dark"] .action-delete {
    background: rgba(248, 113, 113, 0.18) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(248, 113, 113, 0.34) !important;
}

html[data-theme="dark"] .action-delete:hover {
    background: rgba(248, 113, 113, 0.28) !important;
    color: #fecaca !important;
    box-shadow: 0 6px 14px rgba(248, 113, 113, 0.28) !important;
}

html[data-theme="dark"] .action-icon-btn .icon-svg {
    stroke: currentColor !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .report-filters-card .btn-outline-secondary {
    border-color: #334155;
    color: #c9d8eb;
}

html[data-theme="dark"] .report-filters-card .btn-outline-secondary:hover,
html[data-theme="dark"] .report-filters-card .btn-outline-secondary:focus {
    border-color: #38bdf8;
    color: #e6f0ff;
    background: rgba(56, 189, 248, 0.18);
}

html[data-theme="dark"] .account-option {
    border-color: #32425b;
    background: #0c162a;
}

html[data-theme="dark"] .account-option:hover {
    border-color: rgba(56, 189, 248, 0.6);
}

html[data-theme="dark"] .account-option.is-selected {
    border-color: rgba(56, 189, 248, 0.76);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.22);
}

html[data-theme="dark"] .account-dot {
    box-shadow: 0 0 0 2px rgba(226, 232, 240, 0.12);
}

html[data-theme="dark"] .report-type.type-debito {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.36);
}

html[data-theme="dark"] .report-type.type-credito {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.34);
}

html[data-theme="dark"] .historic-summary-panel .summary-pill {
    background: linear-gradient(135deg, #22d3ee, #38bdf8);
    color: #04213a;
    border-color: rgba(125, 211, 252, 0.52);
    box-shadow: 0 8px 16px rgba(56, 189, 248, 0.28);
}

html[data-theme="dark"] .historic-summary-panel .report-pill-label {
    color: rgba(4, 33, 58, 0.82);
}

html[data-theme="dark"] .historic-trend-item {
    border-color: #334155;
    background: #0f1a2f;
    color: #cfe0f5;
}

html[data-theme="dark"] .jconfirm .jconfirm-bg {
    background-color: rgba(2, 8, 23, 0.72) !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-box {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.56) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-title-c .jconfirm-title,
html[data-theme="dark"] .jconfirm .jconfirm-content,
html[data-theme="dark"] .jconfirm .jconfirm-content-pane {
    color: #dbe7f5 !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-closeIcon {
    color: #9fb2cb !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-closeIcon:hover {
    color: #f8fafc !important;
}

html[data-theme="dark"] .jconfirm .form-group label {
    color: #b6c7dc !important;
}

html[data-theme="dark"] .jconfirm input[type="text"],
html[data-theme="dark"] .jconfirm input[type="number"],
html[data-theme="dark"] .jconfirm input[type="password"],
html[data-theme="dark"] .jconfirm input[type="date"],
html[data-theme="dark"] .jconfirm select,
html[data-theme="dark"] .jconfirm textarea {
    background: #0b1425 !important;
    color: #e2e8f0 !important;
    border: 1px solid #2b3b53 !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .jconfirm input[type="text"]:focus,
html[data-theme="dark"] .jconfirm input[type="number"]:focus,
html[data-theme="dark"] .jconfirm input[type="password"]:focus,
html[data-theme="dark"] .jconfirm input[type="date"]:focus,
html[data-theme="dark"] .jconfirm select:focus,
html[data-theme="dark"] .jconfirm textarea:focus {
    background: #0b1425 !important;
    color: #e2e8f0 !important;
    border-color: #3b5f87 !important;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2) !important;
}

html[data-theme="dark"] .jconfirm input::placeholder,
html[data-theme="dark"] .jconfirm textarea::placeholder {
    color: #7f95b1 !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-buttons button {
    border: 1px solid transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-buttons button.btn-blue {
    background: linear-gradient(135deg, #0284c7, #0f766e) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-buttons button.btn-red {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #fff5f5 !important;
}

html[data-theme="dark"] .jconfirm .jconfirm-buttons button.btn-default,
html[data-theme="dark"] .jconfirm .jconfirm-buttons button:not(.btn-blue):not(.btn-red) {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .fx-refresh,
    .fx-item-enter {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .mini-card,
    .table tbody tr,
    .section-toggle-btn,
    .theme-btn,
    .logout-btn,
    .icon-btn,
    .account-option {
        transition: none !important;
    }
}

.loading-overlay img {
    width: min(180px, 40vw);
}

@media (max-width: 991.98px) {
    .app-shell {
        padding-top: 1rem;
    }

    .nav-actions {
        margin-top: 0.8rem;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    #all_accounts {
        min-width: 210px;
    }

    .panel-scroll {
        max-height: 52vh;
    }

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

    .report-table-wrap {
        max-height: 56vh;
    }

    .historic-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chart-canvas-wrap {
        min-height: 270px;
    }
}

@media (max-width: 820px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 180px;
    }
}

@media (max-width: 767.98px) {
    .table {
        font-size: 0.86rem;
    }

    .table thead th {
        font-size: 0.68rem;
    }

    .surface-panel-body,
    .card-body {
        padding: 0.75rem;
    }

    .report-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .account-selector {
        max-height: 190px;
    }

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

    .historic-kpi-grid {
        grid-template-columns: 1fr;
    }

    .chart-canvas-wrap {
        min-height: 240px;
    }
}
