:root {
    color-scheme: light;
    --ink: #111827;
    --muted: #667085;
    --line: #d9e2ec;
    --panel: #ffffff;
    --soft: #f5f7fb;
    --brand: #0b6b5b;
    --brand-2: #0f766e;
    --gold: #b87916;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eef3f7;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body::before {
    content: "\00a9 2026 Matarile Systems Studio. Todos los derechos reservados.";
    position: fixed;
    right: 18px;
    bottom: 14px;
    z-index: 0;
    color: rgba(17, 24, 39, 0.08);
    font-size: 22px;
    font-weight: 900;
    pointer-events: none;
}

body.home-page {
    background:
        radial-gradient(circle at 18% 12%, rgba(15, 118, 110, 0.16), transparent 30%),
        radial-gradient(circle at 82% 10%, rgba(184, 121, 22, 0.14), transparent 28%),
        linear-gradient(180deg, #f7fafc 0%, #edf4f7 48%, #eef3f7 100%);
}

body.home-page::after {
    content: "$  €  RD$  £  C$  ¥";
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    overflow: hidden;
    padding-top: 78px;
    color: rgba(15, 23, 42, 0.055);
    font-size: clamp(48px, 8vw, 118px);
    font-weight: 950;
    letter-spacing: 18px;
    line-height: 1.7;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-8deg) scale(1.08);
    white-space: pre-wrap;
    pointer-events: none;
}

.home-page .shell::before,
.home-page .shell::after {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.home-page .shell::before {
    left: 310px;
    top: 92px;
    width: min(68vw, 860px);
    height: min(54vw, 520px);
    opacity: 0.23;
    background:
        linear-gradient(128deg, transparent 0 9%, rgba(15, 118, 110, 0.42) 9% 10%, transparent 10% 100%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(236, 253, 245, 0.62)),
        repeating-linear-gradient(18deg, rgba(15, 118, 110, 0.12) 0 2px, transparent 2px 18px);
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 18px;
    box-shadow:
        0 28px 80px rgba(15, 23, 42, 0.08),
        inset 0 0 0 12px rgba(255, 255, 255, 0.34);
    transform: rotate(-13deg);
}

.home-page .shell::after {
    right: 18px;
    bottom: 64px;
    width: min(44vw, 520px);
    height: min(30vw, 330px);
    opacity: 0.2;
    background:
        radial-gradient(circle at 74% 28%, rgba(184, 121, 22, 0.36), transparent 24%),
        linear-gradient(145deg, rgba(255, 251, 235, 0.72), rgba(219, 234, 254, 0.62)),
        repeating-linear-gradient(-22deg, rgba(37, 99, 235, 0.1) 0 2px, transparent 2px 16px);
    border: 1px solid rgba(184, 121, 22, 0.18);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    transform: rotate(10deg);
}

.home-page .hero,
.home-page .reference-strip,
.home-page .card {
    position: relative;
    z-index: 2;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(16px, 4vw, 44px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.brand-mark,
.brand-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 8px;
}

.brand-mark {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #152036);
    color: #fff;
    font-weight: 800;
}

.brand-logo {
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
}

.brand strong,
.brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

nav a {
    padding: 9px 12px;
    border-radius: 8px;
    color: #344054;
    font-size: 14px;
    font-weight: 650;
}

nav a:hover {
    background: #e7eef4;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.site-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    color: var(--muted);
    font-size: 12px;
}

.hero,
.admin-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 18px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(11, 107, 91, 0.96), rgba(21, 32, 54, 0.97)),
        #152036;
    color: #fff;
    box-shadow: var(--shadow);
}

.hero h1,
.admin-head h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.08;
}

.lead,
.admin-head p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.78);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.company-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.company-line span {
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
}

.hero-rate {
    display: grid;
    gap: 7px;
    min-width: 190px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-rate img {
    max-width: 118px;
    max-height: 54px;
    object-fit: contain;
    margin-bottom: 4px;
}

.hero-rate span {
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
}

.hero-rate strong {
    font-size: 22px;
}

.currency-spotlight {
    min-width: 240px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
        radial-gradient(circle at 88% 16%, rgba(248, 181, 78, 0.32), transparent 34%);
}

.currency-spotlight small {
    max-width: 220px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.currency-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.currency-chip,
.currency-window {
    position: relative;
    overflow: hidden;
}

.currency-chip > *,
.currency-window > * {
    position: relative;
    z-index: 1;
}

.currency-chip {
    min-height: 98px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, #f8fafc);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.currency-chip::after,
.currency-window::after {
    content: attr(data-symbol);
    position: absolute;
    right: -6px;
    bottom: -16px;
    color: rgba(15, 23, 42, 0.06);
    font-size: 58px;
    font-weight: 950;
    line-height: 1;
    pointer-events: none;
}

.currency-chip span,
.currency-chip small {
    display: block;
}

.currency-chip span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.currency-chip strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 26px;
}

.currency-chip small {
    color: var(--muted);
    font-size: 12px;
}

.currency-window {
    border-color: rgba(148, 163, 184, 0.28) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)) !important;
}

.currency-usd,
.currency-window.currency-usd {
    border-color: rgba(22, 163, 74, 0.35) !important;
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.82)) !important;
}

.currency-eur,
.currency-window.currency-eur {
    border-color: rgba(37, 99, 235, 0.32) !important;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.82)) !important;
}

.currency-dop,
.currency-window.currency-dop {
    border-color: rgba(15, 118, 110, 0.32) !important;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(204, 251, 241, 0.78)) !important;
}

.currency-htg,
.currency-window.currency-htg {
    border-color: rgba(124, 58, 237, 0.32) !important;
    background: linear-gradient(135deg, rgba(245, 243, 255, 0.98), rgba(237, 233, 254, 0.82)) !important;
}

.currency-cad,
.currency-gbp,
.currency-window.currency-cad,
.currency-window.currency-gbp {
    border-color: rgba(8, 145, 178, 0.3) !important;
    background: linear-gradient(135deg, rgba(236, 254, 255, 0.98), rgba(207, 250, 254, 0.78)) !important;
}

.currency-mxn,
.currency-brl,
.currency-window.currency-mxn,
.currency-window.currency-brl {
    border-color: rgba(101, 163, 13, 0.3) !important;
    background: linear-gradient(135deg, rgba(247, 254, 231, 0.98), rgba(236, 252, 203, 0.78)) !important;
}

.currency-cop,
.currency-window.currency-cop {
    border-color: rgba(217, 119, 6, 0.28) !important;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.76)) !important;
}

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

.section-title h2,
.card h2 {
    margin: 0;
    font-size: 19px;
}

.section-title > span {
    max-width: 380px;
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

.reference-strip,
.card,
.kpi,
.auth-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.reference-strip {
    margin-bottom: 18px;
    padding: 20px;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.reference-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.reference-card span,
.reference-card small,
.empty-reference {
    color: var(--muted);
    font-size: 12px;
}

.reference-card strong {
    font-size: 20px;
}

.reference-card b {
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 8px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.45fr);
    gap: 18px;
    margin-bottom: 18px;
}

.card {
    padding: 20px;
}

.wide-card {
    grid-column: auto;
}

.stack {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus {
    outline: 3px solid rgba(15, 118, 110, 0.16);
    border-color: var(--brand-2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

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

.btn.slim {
    min-height: 38px;
    padding: 8px 10px;
}

.btn:hover {
    filter: brightness(0.97);
}

.button-row,
.receipt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.result {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #b7e3d8;
    border-radius: 8px;
    background: #ecfdf7;
}

.auth-help {
    margin-top: 14px;
    text-align: center;
}

.auth-help a {
    color: var(--brand-2);
    font-size: 13px;
    font-weight: 850;
}

.success-alert {
    margin: 14px 0;
    padding: 11px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 8px;
    background: #ecfdf7;
    color: #0b6b5b;
    font-weight: 800;
}

.recovery-card .eyebrow {
    color: var(--brand-2);
}

.recovery-contact {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    padding: 13px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(239, 246, 255, 0.86));
}

.recovery-contact span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.recovery-contact strong {
    color: var(--ink);
    font-size: 14px;
}

.operation-type-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.operation-type-btn {
    min-height: 58px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.78);
    color: #344054;
    font: inherit;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.operation-type-btn.sell {
    border-color: rgba(15, 118, 110, 0.24);
    background: rgba(236, 253, 245, 0.68);
}

.operation-type-btn.buy {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(239, 246, 255, 0.72);
}

.operation-type-btn:hover,
.operation-type-btn.active {
    border-color: rgba(14, 116, 144, 0.64);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(219, 234, 254, 0.92));
    color: #0f172a;
    box-shadow: 0 12px 26px rgba(14, 116, 144, 0.14);
}

.operation-type-btn:active,
.operation-type-btn.pressed {
    transform: scale(0.98);
}

.change-panel {
    display: grid;
    gap: 5px;
    padding: 16px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.change-panel span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.change-panel strong {
    color: var(--ink);
    font-size: 30px;
    line-height: 1;
}

.change-panel small {
    color: var(--muted);
}

.change-panel.has-change {
    border-color: rgba(184, 121, 22, 0.5);
    background: #fffbeb;
    box-shadow: 0 12px 26px rgba(184, 121, 22, 0.12);
}

.change-panel.has-change strong {
    color: #92400e;
}

.change-screen {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(184, 121, 22, 0.56);
    border-radius: 8px;
    background: rgba(255, 251, 235, 0.98);
    box-shadow: 0 18px 40px rgba(146, 64, 14, 0.18);
}

.change-screen.show {
    display: flex;
}

.change-screen div {
    display: grid;
    gap: 4px;
}

.change-screen span {
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.change-screen strong {
    color: #78350f;
    font-size: 34px;
    line-height: 1;
}

.change-screen small {
    color: #854d0e;
}

.result span,
.result small {
    color: var(--muted);
    font-size: 13px;
}

.result strong {
    font-size: 20px;
}

.rates,
.history,
.report-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.rate-row,
.history > div,
.report-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.rate-row span,
.rate-row small,
.history small,
.report-list span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.table,
.operation-table {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
}

.grid-divisas {
    display: grid;
    grid-template-columns: 86px minmax(180px, 1fr) 110px 110px 110px 104px 104px;
    gap: 8px;
    align-items: center;
    min-width: 900px;
}

.users-grid {
    display: grid;
    grid-template-columns: 120px minmax(170px, 1fr) 100px 92px minmax(150px, 1fr) 92px;
    gap: 8px;
    align-items: center;
    min-width: 860px;
}

.clients-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 130px 130px minmax(170px, 1fr) 92px 92px;
    gap: 8px;
    align-items: center;
    min-width: 980px;
}

.clients-grid .span-2 {
    grid-column: span 2;
}

.clients-grid .span-3 {
    grid-column: span 4;
}

.search-inline {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 10px;
    align-items: end;
}

.thead {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.row-form {
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.check {
    display: flex;
    align-items: center;
    gap: 7px;
}

.check input {
    width: 18px;
    min-height: 18px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.cash-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.floating-cash {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    width: min(360px, calc(100vw - 36px));
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(14px);
}

.floating-cash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.97), rgba(21, 32, 54, 0.98));
    color: #fff;
}

.floating-cash-head span,
.floating-cash-main span,
.floating-cash-grid span {
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.floating-cash-head span {
    color: rgba(255, 255, 255, 0.72);
}

.floating-cash-head strong {
    display: block;
    margin-top: 2px;
}

.floating-cash-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: inherit;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}

.floating-cash-body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.floating-cash-main {
    padding: 12px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(239, 246, 255, 0.88));
}

.floating-cash-main span,
.floating-cash-grid span {
    color: var(--muted);
}

.floating-cash-main strong {
    display: block;
    margin-top: 4px;
    color: #0b6b5b;
    font-size: 27px;
    line-height: 1;
}

.floating-cash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.floating-cash-grid div {
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: #f8fafc;
}

.floating-cash-grid strong {
    display: block;
    margin-top: 3px;
    font-size: 15px;
}

.floating-cash-grid .cash-low {
    border-color: rgba(217, 119, 6, 0.44);
    background: #fffbeb;
}

.floating-cash-alert {
    display: grid;
    gap: 5px;
    padding: 9px;
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: 8px;
    background: rgba(255, 251, 235, 0.92);
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
}

.floating-cash-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.floating-cash-actions a {
    display: grid;
    place-items: center;
    min-height: 36px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: #ecfdf7;
    color: #0b6b5b;
    font-size: 12px;
    font-weight: 900;
}

.floating-cash.collapsed .floating-cash-body {
    display: none;
}

.audit-form {
    margin-top: 14px;
}

.audit-grid {
    display: grid;
    grid-template-columns: 90px minmax(110px, 1fr) minmax(130px, 1fr) minmax(110px, 1fr);
    gap: 10px;
    align-items: center;
}

.audit-row {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.audit-row strong {
    font-size: 18px;
}

.audit-diff {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.audit-result {
    display: grid;
    gap: 5px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(239, 246, 255, 0.86));
}

.audit-result > span,
.audit-result small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.audit-result strong {
    font-size: 28px;
}

.audit-details {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.audit-details div {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.audit-details small {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
}

.audit-positive {
    border-color: rgba(15, 118, 110, 0.24) !important;
    background: #ecfdf7 !important;
}

.audit-negative {
    border-color: rgba(185, 28, 28, 0.2) !important;
    background: #fef2f2 !important;
}

.success-text {
    color: #0b6b5b;
}

.danger-text {
    color: #991b1b;
}

.compact-history a {
    display: block;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.compact-history a + a {
    margin-top: 8px;
}

.opening-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.opening-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.money-field {
    min-height: 100%;
    padding: 14px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.money-field input {
    min-height: 52px;
    font-size: 22px;
    font-weight: 850;
}

.picker-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 8px;
}

.currency-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
}

.currency-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.currency-option.selected {
    border-color: rgba(14, 116, 144, 0.5);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(239, 246, 255, 0.95));
    box-shadow: 0 12px 28px rgba(14, 116, 144, 0.13);
}

.currency-option > span {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
}

.currency-option .currency-check {
    width: 18px;
    min-height: 18px;
    grid-row: span 2;
}

.currency-option strong,
.currency-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.currency-option small {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
}

.currency-option input[type="number"]:disabled {
    background: #eef2f6;
    color: #98a2b3;
}

.opening-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head h2,
.card-head p {
    margin-top: 0;
}

.status-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf7;
    color: #0b6b5b;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.mini-grid div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.mini-grid div.negative-balance {
    border-color: rgba(185, 28, 28, 0.18);
    background: rgba(254, 242, 242, 0.9);
}

.mini-grid div.negative-balance strong {
    color: #991b1b;
}

.quick-currency-grid {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.quick-currency-btn,
.quick-currency-static {
    display: grid;
    gap: 5px;
    min-height: 68px;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95));
    color: var(--ink);
    text-align: left;
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.quick-currency-btn.main-currency,
.quick-currency-static.main-currency {
    border-color: rgba(15, 118, 110, 0.28);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(240, 253, 250, 0.88));
}

.quick-currency-btn.main-currency span,
.quick-currency-static.main-currency span {
    color: #0b6b5b;
}

.quick-currency-btn[data-currency="USD"] {
    border-color: rgba(22, 163, 74, 0.34);
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.84));
}

.quick-currency-btn[data-currency="EUR"] {
    border-color: rgba(37, 99, 235, 0.3);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.84));
}

.quick-currency-btn[data-currency="HTG"] {
    border-color: rgba(124, 58, 237, 0.3);
    background: linear-gradient(135deg, rgba(245, 243, 255, 0.98), rgba(237, 233, 254, 0.84));
}

.quick-currency-btn[data-currency="CAD"] {
    border-color: rgba(8, 145, 178, 0.3);
    background: linear-gradient(135deg, rgba(236, 254, 255, 0.98), rgba(207, 250, 254, 0.8));
}

.quick-currency-btn[data-currency="GBP"] {
    border-color: rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.98), rgba(224, 231, 255, 0.82));
}

.quick-currency-btn[data-currency="MXN"],
.quick-currency-btn[data-currency="BRL"] {
    border-color: rgba(101, 163, 13, 0.3);
    background: linear-gradient(135deg, rgba(247, 254, 231, 0.98), rgba(236, 252, 203, 0.82));
}

.quick-currency-btn[data-currency="COP"],
.quick-currency-btn[data-currency="CLP"],
.quick-currency-btn[data-currency="ARS"],
.quick-currency-btn[data-currency="PEN"] {
    border-color: rgba(217, 119, 6, 0.24);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.74));
}

.quick-currency-btn {
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.quick-currency-btn:hover,
.quick-currency-btn.active {
    border-color: rgba(14, 116, 144, 0.68);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(219, 234, 254, 0.92));
    box-shadow: 0 12px 26px rgba(14, 116, 144, 0.16);
}

.quick-currency-btn.below-minimum {
    border-color: rgba(217, 119, 6, 0.72);
    box-shadow: inset 0 0 0 2px rgba(217, 119, 6, 0.18), 0 10px 24px rgba(217, 119, 6, 0.1);
}

.quick-currency-btn.below-minimum strong {
    color: #92400e;
}

.quick-currency-btn.active span {
    color: #92400e;
}

.quick-currency-btn.active strong {
    color: #78350f;
}

.quick-currency-btn:active,
.quick-currency-btn.pressed {
    transform: scale(0.98);
}

.quick-currency-btn span,
.quick-currency-static span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.quick-currency-btn strong,
.quick-currency-static strong {
    font-size: 18px;
}

.mini-grid span,
.hint {
    color: var(--muted);
    font-size: 12px;
}

.mini-grid strong {
    font-size: 18px;
}

.section-gap {
    margin-top: 22px !important;
}

.close-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.company-preview {
    display: grid;
    gap: 9px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.company-preview img {
    width: 150px;
    max-height: 86px;
    object-fit: contain;
}

.company-preview strong {
    font-size: 24px;
}

.company-preview span {
    color: var(--muted);
}

.single-wide {
    grid-template-columns: minmax(0, 1fr);
}

.compact-card {
    max-width: 520px;
}

.report-filter {
    display: grid;
    grid-template-columns: 150px 150px 170px repeat(4, auto);
    align-items: center;
}

.print-report-title {
    display: none;
}

.kpi {
    padding: 16px;
}

.kpi span {
    color: var(--muted);
    font-size: 13px;
}

.kpi strong {
    display: block;
    margin-top: 6px;
    font-size: 23px;
}

.date-filter {
    display: flex;
    gap: 8px;
}

.op-grid {
    display: grid;
    grid-template-columns: 82px 88px 74px 110px 84px 118px 90px 94px 94px;
    gap: 8px;
    min-width: 940px;
    align-items: center;
}

.op-row {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.auth-card {
    max-width: 430px;
    margin: 48px auto;
    padding: 26px;
}

.auth-card h1 {
    margin: 0;
}

.auth-card p,
.alert {
    color: var(--muted);
}

.alert {
    margin: 14px 0;
    padding: 11px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--danger);
}

.stock-alert {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
    gap: 14px;
    margin: 14px 0 18px;
    padding: 14px;
    border: 1px solid rgba(217, 119, 6, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.94));
    box-shadow: 0 14px 34px rgba(217, 119, 6, 0.12);
}

.stock-alert span {
    display: block;
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stock-alert strong {
    display: block;
    margin-top: 3px;
    color: #78350f;
}

.stock-alert-list {
    display: grid;
    gap: 6px;
}

.stock-alert-list b {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #92400e;
    font-size: 13px;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.logo-preview img {
    width: 76px;
    height: 52px;
    object-fit: contain;
}

.receipt-actions {
    justify-content: flex-end;
    margin-bottom: 14px;
}

.receipt-print-format {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-size: 13px;
    font-weight: 850;
}

.receipt-print-format select {
    min-height: 34px;
    padding: 6px 8px;
    border: 0;
    background: transparent;
}

.receipt-paper {
    position: relative;
    overflow: hidden;
    width: min(460px, 100%);
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff 0%, #ffffff 72%, #f8fafc 100%);
    box-shadow: var(--shadow);
}

.receipt-paper::before {
    content: attr(data-watermark);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(17, 24, 39, 0.06);
    font-size: 30px;
    font-weight: 900;
    text-align: center;
    transform: rotate(-22deg);
    pointer-events: none;
}

.receipt-paper > * {
    position: relative;
    z-index: 1;
}

.receipt-head {
    border-bottom: 1px solid #d8e0e8;
    padding-bottom: 12px;
}

.receipt-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.receipt-head img {
    width: 74px;
    max-height: 58px;
    object-fit: contain;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.receipt-brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), #152036);
    color: #fff;
    font-size: 26px;
    font-weight: 900;
}

.receipt-head h1 {
    margin: 0 0 4px;
    font-size: 21px;
    line-height: 1.12;
}

.receipt-head p,
.receipt-foot p,
.receipt-foot small,
.receipt-note {
    margin: 3px 0;
    color: var(--muted);
    font-size: 12px;
}

.receipt-contact {
    display: grid;
    gap: 3px;
    margin-top: 10px;
    padding: 9px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
}

.receipt-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #d8e0e8;
}

.receipt-title strong,
.receipt-title small {
    display: block;
}

.receipt-title strong {
    font-size: 17px;
}

.receipt-title small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.receipt-title > span {
    padding: 7px 9px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 850;
}

.receipt-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 13px 0 5px;
}

.receipt-summary div {
    padding: 10px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.9), rgba(239, 246, 255, 0.82));
}

.receipt-summary span,
.receipt-summary strong {
    display: block;
}

.receipt-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.receipt-summary strong {
    margin-top: 4px;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.receipt-lines {
    display: grid;
    gap: 7px;
    padding: 13px 0 12px;
}

.receipt-lines div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dotted #d8e0e8;
}

.receipt-lines span {
    color: var(--muted);
}

.receipt-lines strong {
    text-align: right;
}

.receipt-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    border: 1px solid rgba(15, 118, 110, 0.34);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.96), rgba(21, 32, 54, 0.98));
    color: #fff;
}

.receipt-total span {
    font-weight: 800;
}

.receipt-total strong {
    font-size: 30px;
}

.receipt-foot {
    padding-top: 14px;
    text-align: center;
}

.receipt-stamp {
    display: inline-flex;
    margin-bottom: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 999px;
    background: #ecfdf7;
    color: #0b6b5b;
    font-size: 12px;
    font-weight: 900;
}

@media (max-width: 900px) {
    .topbar,
    .hero,
    .admin-head,
    .section-title,
    .layout,
    .kpis,
    .cash-summary {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
    }

    nav {
        justify-content: flex-start;
    }

    .hero h1,
    .admin-head h1 {
        font-size: 27px;
    }

    .section-title {
        display: grid;
    }

    .section-title > span {
        text-align: left;
    }

    .rate-row {
        grid-template-columns: 1fr;
    }

    .opening-toolbar {
        grid-template-columns: 1fr;
    }

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

    .floating-cash {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }

    .floating-cash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .floating-cash-actions,
    .audit-grid {
        grid-template-columns: 1fr;
    }

    .picker-tools,
    .opening-footer {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media print {
    @page report {
        size: letter;
        margin: 10mm;
    }

    @page receipt {
        size: auto;
        margin: 2mm;
    }

    body.report-page {
        page: report;
    }

    body.receipt-page {
        page: receipt;
    }

    body {
        background: #fff;
        color: #111827;
    }

    .topbar,
    .sidebar,
    .no-print,
    .site-footer,
    body::before,
    .admin-head,
    .btn,
    .date-filter {
        display: none !important;
    }

    .app-frame {
        margin-left: 0;
    }

    .shell {
        width: 100%;
        padding: 0;
    }

    .print-report-title {
        display: block;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid #111827;
        text-align: center;
    }

    .print-report-title h1 {
        margin: 0 0 4px;
        font-size: 22px;
    }

    .print-report-title p {
        margin: 2px 0;
        color: #344054;
        font-size: 12px;
    }

    .kpis {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 10px;
    }

    .kpi,
    .card {
        break-inside: avoid;
        border: 1px solid #cbd5e1;
        box-shadow: none;
    }

    .kpi {
        padding: 10px;
    }

    .kpi strong {
        font-size: 16px;
    }

    .layout {
        display: block;
    }

    .card {
        margin-bottom: 10px;
        padding: 12px;
    }

    .operation-table {
        overflow: visible;
    }

    .op-grid {
        grid-template-columns: 52px 52px 42px 72px 54px 74px 58px 62px;
        min-width: 0;
        font-size: 10px;
    }

    .op-grid > :last-child {
        display: none;
    }

    .receipt-paper {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body.receipt-page.receipt-print-58 {
        font-size: 10px;
        line-height: 1.22;
    }

    body.receipt-page.receipt-print-58 .receipt-paper {
        max-width: 54mm;
    }

    body.receipt-page.receipt-print-58 .receipt-paper::before {
        display: none;
    }

    body.receipt-page.receipt-print-58 .receipt-head {
        padding-bottom: 7px;
    }

    body.receipt-page.receipt-print-58 .receipt-brand-row {
        justify-content: center;
        gap: 7px;
        text-align: left;
    }

    body.receipt-page.receipt-print-80 .receipt-paper {
        max-width: 76mm;
    }

    body.receipt-page.receipt-print-letter .receipt-paper {
        max-width: 120mm;
        margin: 0 auto;
        padding: 8mm;
        border: 1px solid #cbd5e1;
    }

    body.receipt-page.receipt-print-58 .receipt-head img {
        width: 38px;
        max-height: 34px;
        padding: 3px;
    }

    body.receipt-page.receipt-print-58 .receipt-brand-mark {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    body.receipt-page.receipt-print-58 .receipt-head h1 {
        font-size: 14px;
        max-width: 37mm;
        overflow-wrap: anywhere;
    }

    body.receipt-page.receipt-print-58 .receipt-head p,
    body.receipt-page.receipt-print-58 .receipt-contact,
    body.receipt-page.receipt-print-58 .receipt-title small,
    body.receipt-page.receipt-print-58 .receipt-foot small,
    body.receipt-page.receipt-print-58 .receipt-note {
        font-size: 9px;
    }

    body.receipt-page.receipt-print-58 .receipt-contact {
        margin-top: 6px;
        padding: 0;
        background: transparent;
        text-align: center;
    }

    body.receipt-page.receipt-print-58 .receipt-title {
        display: grid;
        grid-template-columns: 1fr;
        padding: 8px 0;
    }

    body.receipt-page.receipt-print-58 .receipt-title > span {
        justify-self: start;
        padding: 3px 6px;
        border-radius: 6px;
        font-size: 9px;
    }

    body.receipt-page.receipt-print-58 .receipt-title,
    body.receipt-page.receipt-print-58 .receipt-lines div {
        gap: 5px;
    }

    body.receipt-page.receipt-print-58 .receipt-summary {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 7px 0 4px;
    }

    body.receipt-page.receipt-print-58 .receipt-summary div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 4px 0;
        border: 0;
        border-bottom: 1px dotted #111827;
        border-radius: 0;
        background: transparent;
    }

    body.receipt-page.receipt-print-58 .receipt-summary span {
        font-size: 9px;
    }

    body.receipt-page.receipt-print-58 .receipt-summary strong {
        margin-top: 0;
        font-size: 11px;
        text-align: right;
    }

    body.receipt-page.receipt-print-58 .receipt-lines {
        gap: 0;
        padding: 6px 0;
    }

    body.receipt-page.receipt-print-58 .receipt-lines div {
        display: grid;
        grid-template-columns: 38% 1fr;
        padding: 4px 0;
    }

    body.receipt-page.receipt-print-58 .receipt-lines span {
        font-size: 9px;
    }

    body.receipt-page.receipt-print-58 .receipt-lines strong {
        overflow-wrap: anywhere;
        font-size: 10px;
    }

    body.receipt-page.receipt-print-58 .receipt-total {
        padding: 8px 0;
        border-width: 1px 0;
        border-radius: 0;
        background: transparent;
        color: #111827;
    }

    body.receipt-page.receipt-print-58 .receipt-total strong {
        font-size: 19px;
    }

    body.receipt-page.receipt-print-58 .receipt-foot {
        padding-top: 8px;
    }

    body.receipt-page.receipt-print-58 .receipt-stamp {
        margin-bottom: 4px;
        padding: 3px 6px;
        border-radius: 6px;
        background: transparent;
        color: #111827;
        font-size: 9px;
    }

    body.receipt-page.receipt-print-80 .receipt-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 560px) {
    .shell {
        width: min(100% - 20px, 1220px);
        padding-top: 16px;
    }

    .topbar {
        padding: 12px;
    }

    .brand {
        width: 100%;
    }

    nav a {
        padding: 8px 9px;
        font-size: 13px;
    }

    .hero,
    .admin-head,
    .card,
    .reference-strip,
    .auth-card {
        padding: 16px;
    }

    .date-filter {
        display: grid;
    }

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

/* Modern app shell */
body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f6f8fb 0%, #edf2f7 44%, #eef3f7 100%);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: 286px;
    padding: 18px;
    background: #111827;
    color: #fff;
    box-shadow: 20px 0 55px rgba(17, 24, 39, 0.16);
}

.sidebar .brand {
    padding: 10px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand small {
    color: rgba(255, 255, 255, 0.62);
}

.side-nav {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.side-nav a {
    display: grid;
    gap: 2px;
    padding: 13px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.side-nav a:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
}

.side-nav span {
    font-size: 14px;
    font-weight: 850;
}

.side-nav small {
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
}

.sidebar-foot {
    display: grid;
    gap: 3px;
    margin-top: auto;
    padding: 14px 10px 4px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
}

.app-frame {
    position: relative;
    min-height: 100vh;
    margin-left: 286px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(217, 226, 236, 0.9);
    backdrop-filter: blur(18px);
}

.topbar > div:first-child {
    display: grid;
    gap: 2px;
}

.topbar > div:first-child strong {
    color: var(--ink);
    font-size: 14px;
}

.topbar > div:first-child span {
    color: var(--muted);
    font-size: 12px;
}

.top-rates {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.top-rate-source {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
    padding: 9px 11px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.top-rate-source b {
    color: var(--brand);
}

.top-rate-source span {
    padding-left: 8px;
    border-left: 1px solid #e5ebf2;
    font-size: 12px;
    font-weight: 750;
}

.shell {
    width: min(1260px, calc(100% - 36px));
    padding-top: 22px;
}

.hero,
.admin-head {
    background:
        radial-gradient(circle at 92% 10%, rgba(184, 121, 22, 0.22), transparent 30%),
        linear-gradient(135deg, #0b6b5b 0%, #111827 70%);
}

.reference-strip {
    order: -1;
}

.reference-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.reference-card {
    min-height: 116px;
    border-color: #dbe5ee;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.reference-card strong {
    color: #111827;
}

.card,
.reference-strip,
.kpi,
.auth-card {
    border-color: #dbe5ee;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

.rates {
    max-height: 620px;
    overflow-y: auto;
    padding-right: 4px;
}

.rate-row {
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto) minmax(96px, auto);
}

.rate-row strong {
    font-size: 17px;
}

.rate-row b {
    color: var(--brand);
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
        border-radius: 0;
    }

    .side-nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .sidebar-foot {
        display: none;
    }

    .app-frame {
        margin-left: 0;
    }

    .topbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 12px;
    }

    .top-rate-source {
        display: grid;
        gap: 5px;
    }

    .top-rate-source span {
        padding-left: 0;
        border-left: 0;
    }

    .shell {
        width: min(100% - 20px, 1260px);
    }

    .currency-option {
        grid-template-columns: 1fr;
    }

    .card-head {
        display: grid;
    }
}

/* Global money backdrop */
body:not(.receipt-page):not(.report-page) {
    background:
        radial-gradient(circle at 17% 11%, rgba(15, 118, 110, 0.2), transparent 29%),
        radial-gradient(circle at 83% 13%, rgba(184, 121, 22, 0.16), transparent 30%),
        radial-gradient(circle at 62% 92%, rgba(37, 99, 235, 0.1), transparent 36%),
        linear-gradient(180deg, #f6f8fb 0%, #edf4f7 48%, #eef3f7 100%);
}

body:not(.receipt-page):not(.report-page)::after {
    content: "$  \20ac  RD$  \00a3  C$  \00a5\A USD  EUR  DOP  GBP  CAD  MXN";
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    overflow: hidden;
    padding: 70px 0 0 280px;
    color: rgba(15, 23, 42, 0.078);
    font-size: clamp(42px, 7.5vw, 112px);
    font-weight: 950;
    letter-spacing: 15px;
    line-height: 1.65;
    text-align: center;
    transform: rotate(-7deg) scale(1.08);
    white-space: pre-wrap;
    pointer-events: none;
}

.app-frame::before,
.app-frame::after {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.app-frame::before {
    left: 326px;
    top: 104px;
    width: min(66vw, 860px);
    height: min(52vw, 520px);
    opacity: 0.34;
    background:
        linear-gradient(128deg, transparent 0 9%, rgba(15, 118, 110, 0.48) 9% 10%, transparent 10% 100%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(236, 253, 245, 0.68)),
        repeating-linear-gradient(18deg, rgba(15, 118, 110, 0.14) 0 2px, transparent 2px 18px);
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 18px;
    box-shadow:
        0 28px 80px rgba(15, 23, 42, 0.09),
        inset 0 0 0 12px rgba(255, 255, 255, 0.34);
    transform: rotate(-12deg);
}

.app-frame::after {
    right: 18px;
    bottom: 68px;
    width: min(43vw, 540px);
    height: min(30vw, 340px);
    opacity: 0.3;
    background:
        radial-gradient(circle at 74% 28%, rgba(184, 121, 22, 0.4), transparent 24%),
        linear-gradient(145deg, rgba(255, 251, 235, 0.74), rgba(219, 234, 254, 0.66)),
        repeating-linear-gradient(-22deg, rgba(37, 99, 235, 0.12) 0 2px, transparent 2px 16px);
    border: 1px solid rgba(184, 121, 22, 0.2);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.09);
    transform: rotate(10deg);
}

.receipt-page .app-frame::before,
.receipt-page .app-frame::after,
.report-page .app-frame::before,
.report-page .app-frame::after {
    display: none;
}

@media (max-width: 900px) {
    body:not(.receipt-page):not(.report-page)::after {
        padding-left: 0;
        font-size: clamp(38px, 14vw, 84px);
        letter-spacing: 10px;
    }

    .app-frame::before {
        left: -60px;
        top: 160px;
        width: 92vw;
        height: 54vw;
    }

    .app-frame::after {
        right: -70px;
        width: 78vw;
        height: 46vw;
    }
}
