:root {
    --bg: #f3f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fbfc;
    --text: #122022;
    --muted: #667579;
    --line: #dce5e8;
    --primary: #07856f;
    --primary-2: #2457e6;
    --primary-soft: #e4f5f1;
    --accent: #09a88a;
    --danger: #bf2f2f;
    --shadow: 0 14px 34px rgba(18, 32, 34, 0.12);
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    overflow-x: hidden;
}

a,
.btn-link {
    color: var(--primary);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1:focus {
    outline: none;
}

.app-shell,
.app-main {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(9, 168, 138, 0.12), transparent 34%), var(--bg);
}

.app-content {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 18px 14px 96px;
}

.screen-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mobile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
}

.mobile-header h1 {
    font-size: 1.72rem;
    line-height: 1.12;
    margin-bottom: 0;
    font-weight: 760;
}

.eyebrow {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.status-pill,
.balance-toggle,
.text-action {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    color: var(--primary);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.balance-toggle,
.text-action {
    cursor: pointer;
}

.wallet-hero,
.action-hero {
    border-radius: 8px;
    color: #ffffff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.wallet-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    min-height: 178px;
    padding: 22px;
    background: linear-gradient(135deg, #102f35 0%, #087966 56%, #2457e6 130%);
}

.wallet-hero span,
.wallet-hero small {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.wallet-hero strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 3rem;
    line-height: 1;
    font-weight: 760;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.qr-main-button,
.primary-tile {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.qr-main-button {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    background: #ffffff;
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 10px rgba(9, 168, 138, 0.14);
}

.action-hero {
    padding: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #eef8f5 100%);
    color: var(--text);
    border: 1px solid rgba(7, 133, 111, 0.14);
}

.action-hero h2 {
    margin-bottom: 6px;
    font-size: 1.22rem;
    font-weight: 760;
}

.action-hero p {
    color: var(--muted);
    margin-bottom: 14px;
}

.primary-tile {
    width: 100%;
    min-height: 56px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-weight: 750;
}

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

.metric-card,
.empty-state,
.section-block,
.filter-panel,
.result-card {
    border: 1px solid rgba(220, 229, 232, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(18, 32, 34, 0.05);
    min-width: 0;
}

.metric-card {
    padding: 15px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 760;
}

.section-block,
.empty-state,
.result-card {
    padding: 16px;
}

.empty-state {
    text-align: left;
}

.empty-state h2 {
    font-size: 1.18rem;
    margin-bottom: 7px;
    font-weight: 760;
}

.empty-state p,
.muted,
.helper-text {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-title h2 {
    margin-bottom: 0;
    font-size: 1.06rem;
    font-weight: 760;
}

.visual-list,
.card-list {
    display: grid;
    gap: 10px;
}

.movement-row,
.movement-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
}

.movement-row strong,
.movement-row span,
.movement-card strong,
.movement-card span {
    display: block;
}

.movement-row span,
.movement-card span {
    color: var(--muted);
    font-size: 0.82rem;
}

.movement-row b,
.movement-card b {
    font-size: 1.08rem;
    font-weight: 760;
}

.movement-row.positive b,
.movement-card.positive b {
    color: var(--primary);
}

.movement-row.negative b,
.movement-card.negative b {
    color: var(--danger);
}

.movement-row.neutral b,
.movement-card.neutral b {
    color: var(--primary-2);
}

.movement-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 760;
}

.movement-main {
    min-width: 0;
    flex: 1;
}

.filter-panel {
    padding: 0;
    overflow: hidden;
}

.filter-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 720;
}

.filter-panel > summary::-webkit-details-marker {
    display: none;
}

.filter-panel > summary::after {
    content: "+";
    color: var(--primary);
    font-size: 1.15rem;
}

.filter-panel[open] > summary::after {
    content: "-";
}

.filter-body {
    border-top: 1px solid var(--line);
    padding: 14px 16px 16px;
}

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

.field-grid.single {
    grid-template-columns: 1fr;
}

.form-label {
    color: var(--muted);
    font-weight: 650;
}

.form-control {
    border-radius: 8px;
    border-color: var(--line);
    min-height: 46px;
    background: #ffffff;
}

.form-control:focus,
.btn:focus,
.bottom-nav-link:focus,
.qr-main-button:focus,
.primary-tile:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 0.18rem rgba(36, 87, 230, 0.16);
}

.btn {
    border-radius: 8px;
    font-weight: 720;
    min-height: 44px;
}

.btn-primary {
    color: #ffffff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.notice,
.alert {
    border-radius: 8px;
}

.notice {
    border: 1px solid #c5e8e0;
    background: #edf9f6;
    color: #0f5c4f;
    padding: 11px 12px;
}

table.table {
    display: block;
    min-width: 100%;
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 8px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: min(100%, 520px);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(220, 229, 232, 0.8);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 7px 2px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

.bottom-nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-token {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #eef3f5;
    color: inherit;
    font-size: 0.7rem;
    font-weight: 760;
}

.bottom-nav-link.primary .nav-token {
    background: var(--primary);
    color: #ffffff;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #dce5e8;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Cargando");
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    background: #fff4d6;
    color: #4a3a12;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.12);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.65rem;
}

.blazor-error-boundary {
    border-radius: 8px;
    background: #bf2f2f;
    color: #ffffff;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Ocurrio un error.";
}

code {
    color: #8a1a55;
}

@media (max-width: 430px) {
    .wallet-hero {
        min-height: 162px;
        padding: 18px;
    }

    .wallet-hero strong {
        font-size: 2.72rem;
    }

    .qr-main-button {
        width: 84px;
        height: 84px;
    }
}
