:root {
    --red-900: #6d1022;
    --red-800: #8c1931;
    --red-600: #b52543;
    --red-100: #fff0f3;
    --ink: #33131a;
    --muted: #74515a;
    --line: #efd3da;
    --paper: #ffffff;
    --bg: #fff7f8;
    --shadow: 0 22px 54px rgba(109, 16, 34, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 221, 227, 0.9), transparent 34%),
        linear-gradient(180deg, #fff7f8, #ffffff 420px);
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

a {
    color: var(--red-800);
    font-weight: 700;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--red-900), var(--red-600));
    color: #fff;
    position: relative;
    z-index: 20;
}

.brand-wrap {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 220px;
}

.brand-logo {
    display: block;
    width: 172px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
}

.topbar .brand-logo {
    filter: brightness(0) invert(1);
}

.brand {
    display: block;
    font-size: 1.24rem;
    line-height: 1;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav a {
    color: #fff;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.nav a.active,
.nav a.is-active,
.nav a:hover {
    background: #fff;
    color: var(--red-800);
}

.container {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 70px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.page-heading h1,
.login-card h1 {
    margin: 4px 0 0;
    color: var(--red-800);
    letter-spacing: -0.04em;
}

.page-heading h1 {
    font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.kicker {
    color: var(--red-800);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.user-pill,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--red-100);
    color: var(--red-800);
    font-weight: 800;
}

.badge.inativo,
.badge.expirado {
    background: #f3f0f1;
    color: #6d5c61;
}

.badge.usado {
    background: #f6ead2;
    color: #7b4d00;
}

.panel,
.metric,
.login-card,
.list-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
    margin-bottom: 22px;
}

.panel h2 {
    margin: 0 0 14px;
    color: var(--red-800);
}

.grid {
    display: grid;
    gap: 22px;
}

.grid.two {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric {
    padding: 20px;
}

.metric span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric strong {
    display: block;
    color: var(--red-800);
    font-size: 1.9rem;
    letter-spacing: -0.04em;
}

.metric.highlight {
    background: linear-gradient(135deg, var(--red-900), var(--red-600));
    border-color: transparent;
}

.metric.highlight span,
.metric.highlight strong {
    color: #fff;
}

.quick-actions,
.actions,
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.quick-actions {
    margin-bottom: 22px;
}

.btn,
button.btn,
.link-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 17px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--red-800);
    cursor: pointer;
    font-weight: 900;
}

.btn.primary {
    background: linear-gradient(135deg, var(--red-900), var(--red-600));
    color: #fff;
    border-color: transparent;
}

.btn.danger {
    background: #fff7f8;
    color: var(--red-900);
    border-color: #efd3da;
}

.btn.danger:hover,
.btn.danger:focus {
    background: #fff0f3;
    border-color: var(--red-600);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.link-danger {
    min-height: auto;
    padding: 0;
    border: 0;
    color: #a30022;
    background: transparent;
}

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

.form-grid label,
.inline-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.form-grid .full {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid #f4e1e5;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--red-800);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions form {
    margin: 0;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--red-100);
    color: var(--red-800);
    font-weight: 800;
}

.alert.success {
    background: #eef9f0;
    color: #136b2f;
    border-color: #cdebd4;
}

.alert.error {
    background: #fff0f3;
    color: #9f1230;
}

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

.list-card {
    display: grid;
    gap: 5px;
    padding: 14px;
}

.info-list {
    color: var(--muted);
    line-height: 1.8;
}

.balance-box {
    display: grid;
    gap: 4px;
    margin: 14px 0;
    padding: 18px;
    border-radius: 20px;
    background: var(--red-100);
}

.balance-box strong {
    color: var(--red-800);
    font-size: 2rem;
}

.hero-client {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    color: #fff;
    background: var(--red-900);
}

.login-body,
.login-shell {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
}

.login-body::before,
.login-shell::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .34;
    background-image:
        linear-gradient(90deg, rgba(109, 16, 34, .09) 1px, transparent 1px),
        linear-gradient(180deg, rgba(13, 148, 136, .07) 1px, transparent 1px);
    background-size: 46px 46px;
    animation: login-grid-drift 24s linear infinite;
}

.login-card {
    position: relative;
    z-index: 4;
    width: min(480px, 100%);
    padding: 34px;
    border: 1px solid rgba(239, 211, 218, .94);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 70px rgba(109, 16, 34, .14);
    animation: login-card-enter 480ms ease both;
}

.login-screen-runner {
    position: fixed;
    z-index: 5;
    left: 0;
    top: 0;
    width: clamp(104px, 9vw, 176px);
    height: auto;
    object-fit: contain;
    pointer-events: none;
    opacity: .98;
    filter: drop-shadow(0 18px 26px rgba(112, 23, 39, .16));
    transform: translate3d(var(--login-runner-x, 12vw), var(--login-runner-y, 58vh), 0) scaleX(var(--login-runner-dir, 1));
    will-change: transform;
}

.login-mario-runner {
    width: clamp(112px, 8vw, 166px);
}

.login-cat-runner {
    width: clamp(156px, 12vw, 248px);
}

.login-logo {
    display: block;
    width: 190px;
    max-width: 70%;
    margin-bottom: 16px;
    border-radius: 16px;
}

.login-card p {
    color: var(--muted);
}

@keyframes login-grid-drift {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 46px 46px, -46px 46px;
    }
}

@keyframes login-card-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.985);
    }

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

.operation-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: end;
    margin-bottom: 20px;
    padding: 28px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 232, 236, 0.96), transparent 35%),
        linear-gradient(135deg, #ffffff, #fff6f8);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.operation-hero h2 {
    max-width: 760px;
    margin: 8px 0 10px;
    color: var(--red-800);
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
}

.operation-hero p,
.muted {
    color: var(--muted);
}

.hero-filter {
    justify-content: flex-end;
}

.anchor-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 12;
    margin: 0 0 22px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 247, 248, 0.92);
    backdrop-filter: blur(12px);
}

.report-metrics {
    margin-top: -4px;
}

.anchor-bar a.is-active {
    background: linear-gradient(135deg, var(--red-900), var(--red-600));
    border-color: transparent;
    color: #fff;
}

.balcao-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 22px;
    align-items: start;
}

.balcao-main {
    min-width: 0;
}

.balcao-side {
    min-width: 0;
}

.sticky-panel {
    position: relative;
    top: auto;
}

.section-block {
    scroll-margin-top: 150px;
}

body.sections-ready .workspace-section {
    display: none;
}

body.sections-ready .workspace-section.is-active {
    display: block;
}

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

.section-title h2 {
    margin: 3px 0 0;
}

.soft-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    background: #fff7f8;
    border: 1px solid var(--line);
    color: var(--red-800);
    font-weight: 800;
    white-space: nowrap;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.client-results {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.client-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, auto) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.client-result.is-selected {
    border-color: var(--red-600);
    box-shadow: 0 0 0 3px rgba(181, 37, 67, 0.08);
}

.client-result strong,
.client-result span,
.result-balance span,
.result-balance strong {
    display: block;
}

.client-result span,
.result-balance span {
    color: var(--muted);
}

.result-balance strong {
    color: var(--red-800);
    font-size: 1.35rem;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.selected-client-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.selected-client-strip span {
    padding: 8px 11px;
    border-radius: 999px;
    background: var(--red-100);
    color: var(--red-800);
    font-weight: 800;
}

.client-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.history-panel {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.mini-heading h3,
.team-form h3 {
    margin: 4px 0 12px;
    color: var(--red-800);
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-list article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 16px;
    background: var(--red-100);
}

.history-list strong,
.history-list span {
    display: block;
}

.history-list span {
    color: var(--muted);
}

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

.metrics.compact .metric strong {
    font-size: 1.35rem;
}

.form-grid.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-picker {
    position: relative;
    display: grid;
    gap: 10px;
}

.picker-results {
    position: relative;
    z-index: 18;
    padding: 0;
}

.client-picker-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.client-picker-option:hover,
.client-picker-option:focus {
    border-color: var(--red-600);
    box-shadow: 0 0 0 3px rgba(181, 37, 67, 0.08);
    outline: 0;
}

.client-picker-option span,
.client-picker-option small,
.client-picker-option em,
.client-picker-option strong {
    display: block;
}

.client-picker-option small,
.client-picker-option em {
    color: var(--muted);
    font-style: normal;
}

.selected-client-note {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--red-100);
    color: var(--red-800);
    font-weight: 800;
}

.charge-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.charge-summary div {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

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

.charge-summary span {
    color: var(--muted);
    font-weight: 800;
}

.charge-summary strong {
    margin-top: 4px;
    color: var(--red-800);
    font-size: 1.45rem;
}

.compact-summary div {
    background: var(--red-100);
}

.live-preview {
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff7f8;
    border: 1px dashed var(--line);
    color: var(--muted);
    font-weight: 800;
}

.live-preview.ok {
    background: #eef9f0;
    border-color: #cdebd4;
    color: #136b2f;
}

.live-preview.blocked {
    background: #fff0f3;
    border-color: #f5c1cc;
    color: #9f1230;
}

.compact-hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
}

.compact-hero h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.live-search-wrap {
    position: relative;
}

.live-client-results {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.live-client-empty,
.live-client-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(109, 16, 34, 0.08);
}

.live-client-empty {
    padding: 14px 16px;
    color: var(--muted);
    font-weight: 800;
}

.live-client-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(145px, auto) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
}

.live-client-card strong,
.live-client-card span,
.live-client-card small,
.live-client-balance span,
.live-client-balance strong,
.live-client-balance small {
    display: block;
}

.live-client-card span,
.live-client-card small,
.live-client-balance span,
.live-client-balance small {
    color: var(--muted);
}

.live-client-balance strong {
    color: var(--red-800);
    font-size: 1.25rem;
}

.message-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.message-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-card.is-sent {
    opacity: 0;
    transform: translateY(-8px);
}

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

.message-card-head > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
}

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

.message-phone {
    display: inline-flex;
    margin-top: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.message-card span,
.message-card p {
    color: var(--muted);
}

.message-card p {
    margin: 0;
    line-height: 1.5;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.user-access-card .user-delete-form {
    display: grid;
    gap: 10px;
}

.user-access-card .user-delete-form label {
    display: grid;
    gap: 7px;
}

.user-access-card .user-delete-form input {
    min-height: 44px;
}

.team-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    gap: 18px;
    align-items: start;
}

.team-form {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff7f8;
}

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

.attendant-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}

.attendant-edit-form {
    display: grid;
    gap: 12px;
}

.attendant-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    align-items: end;
}

.attendant-card-head label,
.attendant-notes {
    display: grid;
    gap: 7px;
}

.attendant-card-head span,
.attendant-notes span {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.82rem;
}

.attendant-card > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.attendant-card strong {
    color: var(--red-800);
    font-size: 1.15rem;
}

.attendant-card dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.attendant-card dt,
.attendant-card dd {
    margin: 0;
}

.attendant-card dt {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.82rem;
}

.attendant-card dd {
    color: var(--red-800);
    font-weight: 900;
}

.attendant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attendant-actions .btn {
    min-height: 40px;
}

.diagnostic-public {
    padding: 24px;
}

.diagnostic-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.diagnostic-shell h1 {
    color: var(--red-800);
}

.diagnostic-shell code {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px 5px;
}

.diagnostic-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
}

.diagnostic-table th,
.diagnostic-table td {
    padding: 10px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.diagnostic-table th {
    background: var(--red-800);
    color: #fff;
}

.diagnostic-table .ok {
    color: #0f7a35;
    font-weight: 900;
}

.diagnostic-table .erro {
    color: #b00020;
    font-weight: 900;
}

.toggle-line {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--red-100);
    color: var(--red-800);
}

.toggle-line input {
    width: auto;
    min-height: auto;
}

.maintenance-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border-color: rgba(181, 37, 67, 0.28);
    background:
        radial-gradient(circle at top right, rgba(255, 221, 227, 0.85), transparent 42%),
        #fff;
}

.maintenance-control p {
    max-width: 760px;
}

.maintenance-control-form {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.maintenance-page {
    overflow-x: hidden;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 220, 226, 0.95), transparent 26%),
        radial-gradient(circle at 84% 30%, rgba(181, 37, 67, 0.2), transparent 28%),
        linear-gradient(135deg, #fff9fa 0%, #ffe6eb 42%, #fff 100%);
}

.maintenance-shell {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 1fr);
    gap: 34px;
    align-items: center;
    width: min(1160px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 42px 0;
}

.maintenance-copy {
    position: relative;
    z-index: 2;
}

.maintenance-brand {
    display: block;
    width: min(260px, 80vw);
    margin-bottom: 34px;
    border-radius: 18px;
    filter: drop-shadow(0 18px 24px rgba(109, 16, 34, 0.18));
}

.maintenance-copy h1 {
    max-width: 620px;
    margin: 12px 0 16px;
    color: var(--red-900);
    font-size: clamp(3rem, 7vw, 6.6rem);
    line-height: 0.9;
    letter-spacing: -0.08em;
}

.maintenance-copy p {
    max-width: 560px;
    color: #5d2532;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.45;
}

.maintenance-unlock {
    display: grid;
    gap: 14px;
    width: min(460px, 100%);
    margin-top: 28px;
    padding: 20px;
    border: 1px solid rgba(181, 37, 67, 0.22);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 24px 80px rgba(109, 16, 34, 0.16);
    backdrop-filter: blur(16px);
}

.maintenance-unlock label,
.maintenance-unlock span {
    display: grid;
    gap: 8px;
    font-weight: 900;
    color: var(--red-900);
}

.maintenance-visual {
    position: relative;
    min-height: 650px;
    perspective: 1100px;
}

.maintenance-visual::before {
    content: "";
    position: absolute;
    inset: 8% 0 8% 8%;
    border-radius: 52px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.18)),
        radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.95), transparent 18%),
        linear-gradient(160deg, #9f1837, #e2314b 52%, #4a0b18);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.7),
        0 36px 90px rgba(109, 16, 34, 0.3);
    transform: rotateY(-14deg) rotateX(8deg) rotateZ(-1deg);
}

.maintenance-console {
    position: absolute;
    right: 8%;
    bottom: 14%;
    width: min(430px, 82%);
    min-height: 250px;
    padding: 86px 28px 28px;
    border: 1px solid rgba(255,255,255,0.34);
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,246,248,0.66)),
        linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.8),
        0 32px 70px rgba(68, 7, 20, 0.26);
    transform: rotateY(-18deg) rotateX(10deg) translateZ(76px);
}

.maintenance-console span {
    position: absolute;
    top: 26px;
    width: 48px;
    height: 14px;
    border-radius: 999px;
    background: #ffc7d2;
}

.maintenance-console span:nth-child(1) {
    left: 28px;
}

.maintenance-console span:nth-child(2) {
    left: 84px;
    width: 82px;
    background: #fff;
}

.maintenance-console span:nth-child(3) {
    left: 176px;
    width: 118px;
    background: var(--red-600);
}

.maintenance-console strong {
    display: block;
    color: var(--red-900);
    font-size: clamp(1.7rem, 4vw, 3.2rem);
    line-height: 0.92;
    letter-spacing: -0.05em;
}

.maintenance-console p {
    margin: 16px 0 0;
    color: #64303b;
    font-size: 1.04rem;
}

.maintenance-avatar {
    position: absolute;
    top: 12%;
    left: 6%;
    display: grid;
    place-items: center;
    width: min(330px, 58vw);
    aspect-ratio: 1;
    border-radius: 44px;
    background:
        radial-gradient(circle at 38% 28%, rgba(255,255,255,0.95), transparent 26%),
        linear-gradient(145deg, #fff, #ffdfe6 60%, #b52543);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.86),
        0 28px 70px rgba(68, 7, 20, 0.28);
    transform: rotateY(12deg) rotateX(8deg) rotateZ(-5deg) translateZ(110px);
}

.maintenance-avatar img {
    width: 72%;
    filter: drop-shadow(0 18px 18px rgba(109, 16, 34, 0.18));
}

.maintenance-cube,
.maintenance-orbit {
    position: absolute;
    z-index: 2;
}

.maintenance-cube {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 26px;
    color: #fff;
    background: linear-gradient(145deg, #d92544, #7d1228);
    box-shadow: 0 24px 42px rgba(68, 7, 20, 0.28);
    font-weight: 1000;
    letter-spacing: 0.08em;
}

.cube-one {
    top: 13%;
    right: 10%;
    transform: rotateY(-22deg) rotateX(18deg) rotateZ(10deg);
}

.cube-two {
    right: 3%;
    bottom: 26%;
    transform: rotateY(26deg) rotateX(-12deg) rotateZ(-8deg);
}

.maintenance-orbit {
    border: 2px solid rgba(255,255,255,0.56);
    border-radius: 999px;
    transform: rotateY(64deg) rotateX(28deg);
}

.orbit-one {
    top: 20%;
    left: 16%;
    width: 420px;
    height: 118px;
}

.orbit-two {
    right: 3%;
    bottom: 22%;
    width: 340px;
    height: 94px;
}

.finance-module {
    display: grid;
    gap: 22px;
}

.finance-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
}

.finance-tabs a {
    white-space: nowrap;
}

.finance-kpis {
    margin-bottom: 4px;
}

.finance-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}

.finance-table {
    width: 100%;
    min-width: 1480px;
    border-collapse: separate;
    border-spacing: 0;
}

.finance-table th,
.finance-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.finance-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff5f7;
    color: var(--red-800);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.finance-table tbody tr:hover {
    background: rgba(181, 37, 67, 0.04);
}

.finance-table tfoot th {
    background: var(--red-900);
    color: #fff;
    position: static;
}

.money-mini,
.text-mini,
.select-mini {
    min-width: 120px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
}

.text-mini {
    min-width: 220px;
}

.finance-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f7e8eb;
    color: var(--red-800);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-fechado {
    background: #e7f7ee;
    color: #106b3c;
}

.status-divergente {
    background: #fff3cd;
    color: #8a5a00;
}

.status-conferencia {
    background: #eef4ff;
    color: #28549d;
}

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

.finance-summary-card,
.finance-report-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.finance-summary-card span,
.finance-report-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.finance-summary-card strong,
.finance-report-card strong {
    display: block;
    margin-top: 8px;
    color: var(--red-800);
    font-size: clamp(24px, 3vw, 36px);
}

.form-grid.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-live-summary {
    margin-top: 18px;
}

.is-positive {
    color: #0f7a42 !important;
}

.is-negative {
    color: #b42318 !important;
}

.is-zero {
    color: var(--red-800) !important;
}

.finance-reopen-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 18px;
    padding: 16px;
    border: 1px dashed var(--red-600);
    border-radius: 18px;
    background: #fff5f7;
}

.finance-entry-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.finance-entry {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) repeat(3, minmax(110px, auto)) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.finance-entry.is-cancelled {
    opacity: 0.62;
    background: #f8f2f3;
}

.finance-entry strong {
    color: var(--red-800);
}

.finance-entry-edit {
    grid-column: 1 / -1;
}

.finance-entry-edit summary {
    width: fit-content;
    cursor: pointer;
    list-style: none;
}

.finance-entry-edit summary::-webkit-details-marker {
    display: none;
}

.finance-entry-edit form {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: #fff8fa;
}

.finance-audit-wrap code {
    display: block;
    max-width: 520px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 12px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.filter-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    color: var(--muted);
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
    min-height: 0;
}

.btn.compact {
    min-height: 38px;
    padding: 9px 14px;
    font-size: 13px;
}

@media print {
    .topbar,
    .finance-tabs,
    .form-actions,
    .filter-form,
    .btn {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .shell {
        max-width: none;
        padding: 0;
    }

    .panel,
    .finance-table-wrap {
        box-shadow: none;
        border-color: #ddd;
    }
}

@media (max-width: 850px) {
    .topbar,
    .page-heading,
    .hero-client,
    .footer,
    .operation-hero,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid.two,
    .operation-hero,
    .balcao-grid,
    .form-grid.two-cols,
    .maintenance-control,
    .maintenance-shell,
    .client-result,
    .live-client-card,
    .client-history-grid,
    .team-layout,
    .attendant-card-head,
    .attendant-card dl,
    .finance-day-grid,
    .finance-report-grid,
    .form-grid.three-cols,
    .finance-entry,
    .finance-reopen-form,
    .search-row {
        grid-template-columns: 1fr;
    }

    .maintenance-control-form {
        justify-items: stretch;
    }

    .maintenance-shell {
        min-height: auto;
        padding: 28px 0;
    }

    .maintenance-visual {
        min-height: 520px;
    }

    .maintenance-visual::before {
        inset: 4% 0 8%;
        transform: rotateY(-8deg) rotateX(5deg);
    }

    .maintenance-console {
        right: 5%;
        bottom: 9%;
    }

    .maintenance-avatar {
        left: 2%;
        width: min(280px, 70vw);
    }

    .maintenance-cube {
        width: 74px;
        height: 74px;
    }

    .orbit-one {
        left: 3%;
        width: 330px;
    }

    .nav {
        width: 100%;
    }

    .brand-wrap {
        min-width: 0;
    }

    .brand-logo {
        width: 150px;
        height: 46px;
        max-width: 100%;
    }

    .anchor-bar,
    .sticky-panel {
        position: static;
    }

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

    .result-actions,
    .message-actions,
    .result-actions .btn,
    .message-actions .btn,
    .search-row .btn {
        width: 100%;
    }
}

.cashback-screen-runner {
    position: fixed;
    z-index: 42;
    left: 0;
    top: 0;
    width: clamp(66px, 5.5vw, 108px);
    height: auto;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 12px 18px rgba(112, 23, 39, .18));
    transform: translate3d(var(--cashback-runner-x, 16vw), var(--cashback-runner-y, 46vh), 0) scaleX(var(--cashback-runner-dir, 1));
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .login-screen-runner,
    .cashback-screen-runner {
        opacity: .9;
    }
}
