:root {
    --black: #000000;
    --red: #C00202;
    --white: #FFFFFF;
    --bg: #F3F4F6;
    --text: #111827;
    --muted: #6B7280;
    --border: #E5E7EB;
    --card: #FFFFFF;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.10);
    --radius: 22px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-family: 'Poppins', Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(192, 2, 2, 0.10), transparent 30%),
        linear-gradient(135deg, #F8FAFC 0%, #EEF2F7 100%);
    color: var(--text);
}

/* =========================
   LOGIN
========================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 30% 10%, rgba(192, 2, 2, 0.28), transparent 30%),
        linear-gradient(145deg, #000000 0%, #111111 48%, #260000 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255,255,255,0.12);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.login-logo img {
    width: 330px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.login-title {
    text-align: center;
    margin-bottom: 26px;
}

.login-title h1 {
    font-size: 23px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--black);
}

.login-title p {
    margin-top: 7px;
    font-size: 13px;
    color: var(--muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #222;
}

.input-hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.form-control {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid #D7DCE3;
    padding: 0 15px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #FAFAFA;
}

.form-control:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(192, 2, 2, 0.10);
    background: #FFFFFF;
}

.field-hint {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
}

.btn-primary {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #C00202 0%, #8f0000 100%);
    color: var(--white);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 30px rgba(192, 2, 2, 0.28);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(192, 2, 2, 0.35);
}

.error-box {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    margin-bottom: 16px;
    font-weight: 600;
}

/* =========================
   LOADING
========================= */

.loading-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at center, rgba(192, 2, 2, 0.22), transparent 32%),
        linear-gradient(145deg, #000000 0%, #0A0A0A 55%, #210000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.loading-box {
    width: 90%;
    max-width: 460px;
    text-align: center;
    color: var(--white);
    animation: fadeUp 0.8s ease forwards;
}

.loading-logo-wrap {
    position: relative;
    width: 360px;
    max-width: 92%;
    margin: 0 auto 30px;
    filter: drop-shadow(0 18px 35px rgba(192, 2, 2, 0.30));
}

.loading-logo-wrap img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.loading-title {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.loading-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.10);
}

.loading-progress {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #C00202, #FF2B2B);
    animation: loadProgress 1.25s ease forwards;
}

.loading-small {
    margin-top: 14px;
    color: rgba(255,255,255,0.70);
    font-size: 13px;
}

/* =========================
   HEADER / MENU
========================= */

.topbar {
    width: 100%;
    min-height: 78px;
    background: linear-gradient(135deg, #000000 0%, #111111 65%, #270000 100%);
    color: var(--white);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
}

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

.brand-logo-box {
    width: clamp(150px, 18vw, 250px);
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
}

.brand-logo-box:hover {
    opacity: 0.95;
}

.brand-logo {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-text span {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.68);
    letter-spacing: 2px;
}

.main-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.main-menu a {
    text-decoration: none;
    color: rgba(255,255,255,0.86);
    font-size: 13px;
    font-weight: 700;
    padding: 11px 18px;
    border-radius: 999px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.main-menu a:hover,
.main-menu a.active {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 10px 26px rgba(192, 2, 2, 0.28);
}

.main-menu a.logout-link {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.14);
}

.main-menu a.logout-link:hover {
    background: #FFFFFF;
    color: #000000;
    box-shadow: none;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.09);
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
}

/* =========================
   CONTENT
========================= */

.app-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 26px 48px;
}

.page-hero {
    background:
        linear-gradient(135deg, rgba(0,0,0,0.92), rgba(31,0,0,0.94)),
        radial-gradient(circle at right, rgba(192, 2, 2, 0.36), transparent 38%);
    border-radius: 28px;
    padding: 28px;
    color: var(--white);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -90px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 35px solid rgba(192, 2, 2, 0.18);
}

.page-hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.page-hero p {
    color: rgba(255,255,255,0.72);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

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

.info-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    min-height: 148px;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 7px;
    height: 100%;
    background: var(--red);
}

.info-card span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 10px;
}

.info-card strong {
    font-size: 28px;
    font-weight: 800;
    color: var(--black);
}

.info-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.empty-panel {
    background: var(--white);
    border-radius: var(--radius);
    min-height: 360px;
    border: 1px dashed #CBD5E1;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

.empty-panel h2 {
    color: var(--black);
    font-size: 21px;
    margin-bottom: 8px;
}

.empty-panel p {
    font-size: 14px;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 1100px) {
    .topbar {
        padding: 12px 18px;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-menu {
        width: 100%;
        max-width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        background: rgba(255,255,255,0.06);
        border-radius: 20px;
        padding: 10px;
    }

    .main-menu.open {
        display: flex;
    }

    .main-menu a {
        width: 100%;
        text-align: center;
    }

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

    .brand-text strong {
        font-size: 12px;
    }
}

@media (max-width: 520px) {
    .app-container {
        padding: 22px 14px 36px;
    }

    .login-card {
        padding: 26px 22px;
    }

    .page-hero {
        padding: 24px 20px;
    }

    .page-hero h1 {
        font-size: 23px;
    }

    .brand-area {
        min-width: auto;
        gap: 10px;
    }

    .brand-logo-box {
        width: 190px;
        height: 48px;
    }

    .brand-text strong {
        max-width: 190px;
    }
}

@media (max-width: 420px) {
    .brand-logo-box {
        width: 165px;
        height: 44px;
    }

    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@keyframes loadProgress {
    from { width: 0%; }
    to { width: 100%; }
}

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

/* =========================
   VENDAS / FINANCEIRO
========================= */

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

.success-card::before {
    background: #16A34A;
}

.danger-card::before {
    background: #DC2626;
}

.dark-card::before {
    background: #111827;
}

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

.vendas-layout {
    grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.4fr);
    align-items: start;
}

.form-panel,
.table-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    padding: 24px;
}

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

.section-title h2 {
    font-size: 20px;
    line-height: 1.2;
    color: var(--black);
    font-weight: 800;
}

.section-title p {
    margin-top: 5px;
    font-size: 13px;
    color: var(--muted);
}

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

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

.status-field > label:first-child {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #222;
}

.status-field small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

/* Campo Status corrigido: precisa ser mais específico que .form-group label */
.form-group.status-field label.switch-line {
    min-height: 48px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    margin: 0;
    border-radius: 14px;
    border: 1px solid #D7DCE3;
    background: #FAFAFA;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.form-group.status-field label.switch-line input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}

.form-group.status-field label.switch-line .fake-switch {
    display: inline-block;
    flex: 0 0 46px;
    width: 46px;
    height: 25px;
    border-radius: 999px;
    background: #DC2626;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.form-group.status-field label.switch-line .fake-switch::after {
    content: '';
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #FFFFFF;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.24);
}

.form-group.status-field label.switch-line input[type="checkbox"]:checked + .fake-switch {
    background: #16A34A;
}

.form-group.status-field label.switch-line input[type="checkbox"]:checked + .fake-switch::after {
    transform: translateX(21px);
}

.form-group.status-field label.switch-line strong {
    font-size: 13px;
    font-weight: 800;
    color: #222;
    white-space: nowrap;
}

.form-submit {
    margin-top: 18px;
}

.green-text {
    color: #15803D;
}

.red-text {
    color: #B91C1C;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}

.alert.success {
    background: #DCFCE7;
    color: #166534;
    border-color: #86EFAC;
}

.alert.warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.alert.danger {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FCA5A5;
}

.responsive-table {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.responsive-table table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    background: #FFFFFF;
}

.responsive-table th {
    background: #0B0B0B;
    color: #FFFFFF;
    text-align: left;
    padding: 14px 13px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.responsive-table td {
    padding: 13px;
    border-bottom: 1px solid #EEF2F7;
    font-size: 13px;
    color: #1F2937;
    vertical-align: middle;
    white-space: nowrap;
}

.responsive-table tbody tr:hover {
    background: #FAFAFA;
}

.responsive-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.status-badge.paid {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #86EFAC;
}

.status-badge.unpaid {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FCA5A5;
}

.delete-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 70px;
    padding: 0 12px;
    border-radius: 999px;
    background: #FFF1F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.delete-link:hover {
    background: #991B1B;
    color: #FFFFFF;
}

.actions-col {
    width: 190px;
    min-width: 190px;
}

.actions-col-cell {
    width: 190px;
    min-width: 190px;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex-wrap: nowrap;
    min-width: 170px;
}

.paid-link,
.unpaid-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 84px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.paid-link {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #86EFAC;
}

.paid-link:hover {
    background: #15803D;
    color: #FFFFFF;
}

.unpaid-link {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.unpaid-link:hover {
    background: #111827;
    color: #FFFFFF;
}

.empty-state-small {
    min-height: 260px;
    border: 1px dashed #CBD5E1;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted);
}

.empty-state-small h3 {
    font-size: 18px;
    color: var(--black);
    margin-bottom: 6px;
}

.empty-state-small p {
    font-size: 13px;
}

.home-panel {
    min-height: 260px;
}

.btn-inline {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #C00202 0%, #8f0000 100%);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(192, 2, 2, 0.22);
}

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

@media (max-width: 720px) {
    .form-grid.two-columns {
        grid-template-columns: 1fr;
    }

    .form-panel,
    .table-panel {
        padding: 20px;
    }
}


.btn-inline-dark {
    margin-left: 8px;
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.18);
}

.gastos-layout {
    grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.45fr);
}

.gastos-table table {
    min-width: 680px;
}

@media (max-width: 720px) {
    .btn-inline-dark {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* =========================
   ABA VALORES / RELATÓRIO
========================= */

.page-hero-luxury {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 30px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(192, 2, 2, 0.18), transparent 28%),
        linear-gradient(135deg, #0E0E10 0%, #17181C 60%, #230809 100%);
    color: #FFFFFF;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255,255,255,0.08);
}

.page-hero-luxury h1 {
    color: #FFFFFF;
    margin-bottom: 10px;
}

.page-hero-luxury p {
    color: rgba(255,255,255,0.72);
    max-width: 760px;
}

.hero-badge,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.hero-badge {
    margin-bottom: 14px;
    color: #FFD3D3;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.09);
}

.section-kicker {
    margin-bottom: 12px;
    color: #8f0000;
    background: rgba(192, 2, 2, 0.08);
}

.section-kicker.light {
    color: #FFDADA;
    background: rgba(255,255,255,0.08);
}

.hero-side-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 240px;
}

.hero-mini-card {
    min-width: 220px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
}

.hero-mini-card span,
.hero-mini-card small {
    display: block;
}

.hero-mini-card span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.65);
}

.hero-mini-card strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 22px;
    line-height: 1.1;
}

.hero-mini-card small {
    color: rgba(255,255,255,0.60);
    font-size: 12px;
}

.hero-mini-card.positive strong,
.insight-pill.positive {
    color: #58FF8C;
}

.hero-mini-card.negative strong,
.insight-pill.negative {
    color: #FF8282;
}

.valores-modern-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.65fr);
    gap: 24px;
    align-items: start;
}

.valores-main-column,
.valores-side-column {
    display: grid;
    gap: 24px;
}

.lux-summary-shell,
.financial-insight-card,
.action-lux-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 28px;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.09);
    backdrop-filter: blur(14px);
}

.lux-summary-shell::before,
.financial-insight-card::before,
.action-lux-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.35), transparent 45%);
    pointer-events: none;
}

.lux-summary-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 28px 14px;
}

.lux-summary-header h2,
.insight-head h3,
.action-lux-card h3 {
    font-size: 28px;
    line-height: 1.1;
    color: #101113;
    font-weight: 800;
}

.lux-summary-header p,
.action-lux-card p {
    margin-top: 6px;
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
}

.btn-report-elevated {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #C00202 0%, #7B0000 100%);
    color: #FFFFFF;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 18px 30px rgba(192, 2, 2, 0.24);
}

.metrics-lux-grid {
    position: relative;
    padding: 10px 28px 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.metric-lux-card {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,250,0.98));
    border: 1px solid #ECEFF3;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 10px 22px rgba(15, 23, 42, 0.05);
}

.metric-lux-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.metric-sales::after,
.metric-paid::after,
.metric-profit.positive::after {
    background: linear-gradient(90deg, #05B83D, #45D46E);
}

.metric-expenses::after,
.metric-unpaid::after,
.metric-profit.negative::after {
    background: linear-gradient(90deg, #C00202, #FF4747);
}

.metric-lux-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.metric-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #101113;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
}

.metric-sales .metric-icon,
.metric-paid .metric-icon,
.metric-profit.positive .metric-icon {
    background: linear-gradient(135deg, #00A832 0%, #0B7C2C 100%);
}

.metric-expenses .metric-icon,
.metric-unpaid .metric-icon,
.metric-profit.negative .metric-icon {
    background: linear-gradient(135deg, #C00202 0%, #880000 100%);
}

.metric-tag {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #6B7280;
    background: #F3F4F6;
}

.metric-label {
    color: #4B5563;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-value {
    display: block;
    font-size: clamp(25px, 2vw, 33px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.9px;
    color: #111827;
}

.metric-sales .metric-value,
.metric-paid .metric-value,
.metric-profit.positive .metric-value {
    color: #009E2F;
}

.metric-expenses .metric-value,
.metric-unpaid .metric-value,
.metric-profit.negative .metric-value {
    color: #C00202;
}

.metric-note {
    display: block;
    margin-top: 10px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.5;
}

.financial-insight-card {
    padding: 26px 28px 28px;
}

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

.insight-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #F3F4F6;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-progress-list {
    display: grid;
    gap: 18px;
}

.insight-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.insight-progress-label strong {
    font-size: 14px;
    color: #111827;
}

.insight-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #ECEFF3;
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.bar-fill.green {
    background: linear-gradient(90deg, #00A832 0%, #3DD067 100%);
}

.bar-fill.red {
    background: linear-gradient(90deg, #C00202 0%, #FF4A4A 100%);
}

.bar-fill.dark {
    background: linear-gradient(90deg, #1F2937 0%, #000000 100%);
}

.action-lux-card {
    padding: 26px;
}

.action-lux-card.dark {
    background:
        radial-gradient(circle at top right, rgba(192, 2, 2, 0.18), transparent 30%),
        linear-gradient(135deg, #0E0E10 0%, #17181C 55%, #230809 100%);
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

.action-lux-card.dark h3,
.action-lux-card.dark p {
    color: #FFFFFF;
}

.action-lux-card.dark p {
    color: rgba(255,255,255,0.74);
}

.btn-inline-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    background: #FFFFFF;
    color: #121212;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.mini-check-list {
    list-style: none;
    display: grid;
    gap: 14px;
    margin-top: 4px;
}

.mini-check-list li {
    padding: 14px 16px;
    border-radius: 18px;
    background: #F8FAFC;
    border: 1px solid #EEF2F7;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 1180px) {
    .valores-modern-grid {
        grid-template-columns: 1fr;
    }

    .hero-side-info {
        min-width: 0;
    }
}

@media (max-width: 900px) {
    .page-hero-luxury,
    .lux-summary-header,
    .insight-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .metrics-lux-grid {
        grid-template-columns: 1fr;
    }

    .hero-mini-card {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .page-hero-luxury,
    .lux-summary-shell,
    .financial-insight-card,
    .action-lux-card {
        border-radius: 22px;
    }

    .page-hero-luxury {
        padding: 22px;
    }

    .lux-summary-header,
    .financial-insight-card,
    .action-lux-card {
        padding: 22px;
    }

    .metrics-lux-grid {
        padding: 0 22px 22px;
        gap: 14px;
    }

    .metric-lux-card {
        padding: 18px;
        min-height: 154px;
    }

    .lux-summary-header h2,
    .insight-head h3,
    .action-lux-card h3 {
        font-size: 22px;
    }

    .metric-value {
        font-size: 28px;
    }

    .btn-report-elevated,
    .btn-inline-white {
        width: 100%;
    }
}


/* =========================
   BACKUP
========================= */

.system-alert {
    margin: 0 0 22px;
    padding: 15px 18px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.system-alert.success {
    background: #E9FBEF;
    color: #06752A;
    border: 1px solid #B7F0C8;
}

.system-alert.danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.backup-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 0.75fr) minmax(300px, 0.9fr);
    gap: 22px;
    align-items: stretch;
}

.backup-card,
.backup-list-card {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.74);
    border-radius: 28px;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.09);
    padding: 26px;
    backdrop-filter: blur(14px);
}

.backup-card h2,
.backup-list-card h2 {
    font-size: 24px;
    line-height: 1.12;
    font-weight: 800;
    color: #101113;
    margin-bottom: 8px;
}

.backup-card p,
.backup-list-card p {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.dark-backup-card {
    background:
        radial-gradient(circle at top right, rgba(192, 2, 2, 0.22), transparent 35%),
        linear-gradient(135deg, #0E0E10 0%, #17181C 55%, #240707 100%);
    color: #FFFFFF;
    border-color: rgba(255,255,255,0.08);
}

.dark-backup-card h2,
.dark-backup-card p {
    color: #FFFFFF;
}

.dark-backup-card p {
    color: rgba(255,255,255,0.72);
}

.backup-schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.backup-schedule-grid span {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
}

.backup-last-info {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.72);
    font-size: 13px;
}

.backup-last-info strong {
    color: #FFFFFF;
}

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

.file-drop {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px dashed #C9D1DC;
    border-radius: 20px;
    background: #F8FAFC;
    cursor: pointer;
    transition: 0.2s ease;
}

.file-drop:hover {
    border-color: #C00202;
    background: #FFF7F7;
}

.file-drop input {
    width: 100%;
    font-size: 13px;
}

.file-drop span {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.file-drop small {
    color: #6B7280;
    font-size: 12px;
}

.backup-list-card {
    margin-top: 24px;
}

.backup-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.empty-backup-state {
    padding: 22px;
    border-radius: 20px;
    background: #F8FAFC;
    border: 1px solid #EEF2F7;
}

.empty-backup-state strong {
    display: block;
    margin-bottom: 6px;
    color: #111827;
}

.backup-table table {
    min-width: 760px;
}

.backup-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.backup-type.auto {
    color: #06752A;
    background: #E9FBEF;
}

.backup-type.manual,
.backup-type.antes {
    color: #8f0000;
    background: #FEE2E2;
}

.mini-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #111827;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .backup-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .backup-card,
    .backup-list-card {
        padding: 22px;
        border-radius: 22px;
    }

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

/* =========================
   MODAL DE NOVA VENDA
========================= */

.sales-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    padding: 20px 22px;
    margin-bottom: 22px;
}

.sales-toolbar h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 4px;
}

.sales-toolbar p {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}

.btn-modal-open {
    width: auto;
    min-width: 170px;
    padding: 0 22px;
    white-space: nowrap;
}

.sales-empty-button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.sales-table-full {
    width: 100%;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
}

.modal-overlay.is-open {
    display: flex;
    animation: modalFadeIn 0.18s ease forwards;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
    animation: modalSlideUp 0.22s ease forwards;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 18px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5F5 100%);
    border-bottom: 1px solid #F1F5F9;
    border-radius: 28px 28px 0 0;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--black);
    line-height: 1.15;
}

.modal-header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.modal-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: none;
    border-radius: 14px;
    background: #111827;
    color: #FFFFFF;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--red);
    transform: translateY(-1px);
}

.sale-modal form {
    padding: 24px;
}

.modal-actions {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) minmax(180px, 0.65fr);
    gap: 14px;
    margin-top: 20px;
}

.modal-actions .form-submit {
    margin-top: 0;
}

.btn-secondary-modal {
    width: 100%;
    height: 50px;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    background: #F9FAFB;
    color: #374151;
    font-family: inherit;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary-modal:hover {
    background: #111827;
    color: #FFFFFF;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 720px) {
    .sales-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 18px;
    }

    .btn-modal-open {
        width: 100%;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 24px 24px 0 0;
    }

    .modal-header {
        padding: 20px 18px 15px;
        border-radius: 24px 24px 0 0;
    }

    .sale-modal form {
        padding: 18px;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }

    .form-control {
        font-size: 16px;
    }
}

/* =========================
   AJUSTE VISUAL DA TABELA DE VENDAS - STATUS E AÇÕES
========================= */

.sales-table-full .responsive-table {
    border-radius: 22px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.sales-table-full .responsive-table table {
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.sales-table-full .responsive-table th {
    height: 54px;
    padding: 0 16px;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

.sales-table-full .responsive-table td {
    height: 66px;
    padding: 0 16px;
    vertical-align: middle;
    border-bottom: 1px solid #EDF2F7;
}

.sales-table-full .responsive-table th:nth-child(1),
.sales-table-full .responsive-table td:nth-child(1) { width: 170px; }
.sales-table-full .responsive-table th:nth-child(2),
.sales-table-full .responsive-table td:nth-child(2) { width: 104px; }
.sales-table-full .responsive-table th:nth-child(3),
.sales-table-full .responsive-table td:nth-child(3) { width: 180px; }
.sales-table-full .responsive-table th:nth-child(4),
.sales-table-full .responsive-table td:nth-child(4) { width: 82px; }
.sales-table-full .responsive-table th:nth-child(5),
.sales-table-full .responsive-table td:nth-child(5) { width: 150px; }
.sales-table-full .responsive-table th:nth-child(6),
.sales-table-full .responsive-table td:nth-child(6) { width: 112px; }
.sales-table-full .responsive-table th:nth-child(7),
.sales-table-full .responsive-table td:nth-child(7) { width: 120px; }
.sales-table-full .responsive-table th:nth-child(8),
.sales-table-full .responsive-table td:nth-child(8) {
    width: 126px;
    min-width: 126px;
    text-align: center;
}

.sales-table-full .responsive-table th.actions-col,
.sales-table-full .responsive-table td.actions-col-cell {
    width: 252px;
    min-width: 252px;
    text-align: center;
}

.sales-table-full .responsive-table th:first-child {
    border-top-left-radius: 20px;
}

.sales-table-full .responsive-table th:last-child {
    border-top-right-radius: 20px;
}

.sales-table-full .responsive-table tbody tr {
    transition: background 0.18s ease;
}

.sales-table-full .responsive-table tbody tr:hover {
    background: #FFF7F7;
}

.sales-table-full .responsive-table tbody tr:last-child td {
    border-bottom: none;
}

.sales-table-full .status-badge {
    width: 96px;
    min-width: 96px;
    height: 34px;
    padding: 0 14px;
    margin: 0 auto;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-sizing: border-box;
}

.sales-table-full .status-badge.paid {
    background: #DCFCE7;
    color: #0F8A3B;
    border-color: #86EFAC;
}

.sales-table-full .status-badge.unpaid {
    background: #FEE2E2;
    color: #C00202;
    border-color: #FDA4AF;
}

.sales-table-full .table-actions {
    display: grid;
    grid-template-columns: 132px 88px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.sales-table-full .paid-link,
.sales-table-full .unpaid-link,
.sales-table-full .delete-link {
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-sizing: border-box;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.sales-table-full .paid-link {
    background: #DCFCE7;
    color: #0F8A3B;
    border-color: #86EFAC;
}

.sales-table-full .unpaid-link {
    background: #F3F4F6;
    color: #1F2937;
    border-color: #E5E7EB;
}

.sales-table-full .delete-link {
    background: #FFF1F2;
    color: #C00202;
    border-color: #FECACA;
}

.sales-table-full .paid-link:hover,
.sales-table-full .unpaid-link:hover,
.sales-table-full .delete-link:hover {
    transform: translateY(-1px);
}

.sales-table-full .paid-link:hover {
    background: #15803D;
    color: #FFFFFF;
}

.sales-table-full .unpaid-link:hover {
    background: #111827;
    color: #FFFFFF;
}

.sales-table-full .delete-link:hover {
    background: #C00202;
    color: #FFFFFF;
}

@media (max-width: 760px) {
    .sales-table-full .responsive-table {
        border-radius: 18px;
        -webkit-overflow-scrolling: touch;
    }

    .sales-table-full .responsive-table table {
        min-width: 1080px;
    }

    .sales-table-full .responsive-table th {
        height: 50px;
        padding: 0 12px;
        font-size: 11px;
    }

    .sales-table-full .responsive-table td {
        height: 58px;
        padding: 0 12px;
        font-size: 12px;
    }

    .sales-table-full .responsive-table th:nth-child(8),
    .sales-table-full .responsive-table td:nth-child(8) {
        width: 116px;
        min-width: 116px;
    }

    .sales-table-full .responsive-table th.actions-col,
    .sales-table-full .responsive-table td.actions-col-cell {
        width: 226px;
        min-width: 226px;
    }

    .sales-table-full .status-badge {
        width: 86px;
        min-width: 86px;
        height: 31px;
        font-size: 11px;
    }

    .sales-table-full .table-actions {
        grid-template-columns: 122px 76px;
        gap: 9px;
    }

    .sales-table-full .paid-link,
    .sales-table-full .unpaid-link,
    .sales-table-full .delete-link {
        height: 31px;
        min-height: 31px;
        padding: 0 8px;
        font-size: 10px;
    }
}

/* =========================================================
   ATUALIZAÇÃO HOSTINGER SAFE — submenus, admin, logs e updates
========================================================= */
.brand-text-header {
    display: flex;
}

.app-nav {
    position: relative;
}

.nav-group {
    position: relative;
}

.nav-parent {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.86);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 11px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-group.active > .nav-parent,
.nav-group.is-open > .nav-parent,
.nav-parent:hover {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 10px 26px rgba(192, 2, 2, 0.28);
}

.nav-arrow {
    margin-left: 4px;
    font-size: 11px;
}

.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 22px 55px rgba(0,0,0,0.22);
    z-index: 999;
}

.nav-group::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    display: none;
}

.nav-group:hover::after,
.nav-group.is-open::after {
    display: block;
}

.main-menu > .nav-group:nth-last-of-type(1) > .nav-submenu,
.main-menu > .nav-group:last-of-type > .nav-submenu {
    left: auto;
    right: 0;
}

.nav-group:hover > .nav-submenu,
.nav-group.is-open > .nav-submenu {
    display: flex;
}

.main-menu .nav-submenu a {
    width: 100%;
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    color: #111827;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.main-menu .nav-submenu a:hover,
.main-menu .nav-submenu a.active {
    background: #FEE2E2;
    color: #8f0000;
    box-shadow: none;
}

.settings-layout,
.updates-layout,
.logs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 22px;
    align-items: start;
}

.settings-panel,
.update-panel,
.logs-panel {
    width: 100%;
}

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

.admin-safe-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.admin-safe-item {
    padding: 13px 14px;
    border-radius: 16px;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    color: #374151;
    font-size: 13px;
    line-height: 1.45;
}

.update-drop-box {
    border: 1px dashed #CBD5E1;
    border-radius: 20px;
    padding: 18px;
    background: #F8FAFC;
    margin-bottom: 16px;
}

.file-name-preview {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.table-compact td,
.table-compact th {
    font-size: 12px;
    vertical-align: top;
}

.log-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: #E5E7EB;
    color: #374151;
}

.log-type.info,
.log-type.success {
    background: #DCFCE7;
    color: #166534;
}

.log-type.warning {
    background: #FEF3C7;
    color: #92400E;
}

.log-type.danger {
    background: #FEE2E2;
    color: #991B1B;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 0;
    background: #111827;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.btn-mini.red {
    background: var(--red);
}

.system-note {
    padding: 14px 16px;
    border-radius: 18px;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    color: #4B5563;
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .brand-area {
        min-width: 0;
        flex: 1;
    }

    .brand-logo-box {
        width: 190px;
    }

    .brand-text-header {
        display: none;
    }

    .main-menu .nav-group,
    .main-menu .nav-parent,
    .main-menu .nav-item {
        width: 100%;
    }

    .nav-parent {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.10);
    }

    .nav-submenu {
        position: static;
        min-width: 100%;
        width: 100%;
        margin-top: 8px;
        margin-bottom: 8px;
        box-shadow: none;
        border-radius: 16px;
    }

    .nav-group:hover > .nav-submenu {
        display: none;
    }

    .nav-group.is-open > .nav-submenu {
        display: flex;
    }

    .nav-group::after {
        display: none !important;
    }

    .settings-layout,
    .updates-layout,
    .logs-layout {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   HOTFIX V1.2 — MENU ESTÁVEL BASEADO NO FÁBRICA DE TELAS
   Corrige submenu fechando rápido, barra horizontal e responsivo.
========================================================= */
html,
body {
    max-width: 100%;
    overflow-x: hidden !important;
}

.topbar,
.main-menu,
.app-nav,
.nav-group {
    overflow: visible !important;
}

.topbar {
    z-index: 5000;
}

.menu-toggle {
    flex: 0 0 auto;
}

.nav-parent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 46px;
    line-height: 1;
    white-space: nowrap;
}

.nav-group {
    z-index: 5001;
}

.nav-submenu {
    display: flex !important;
    top: calc(100% + 2px);
    max-width: calc(100vw - 24px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    z-index: 99999;
}

.nav-group::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 18px;
    display: block !important;
    pointer-events: auto;
}

.nav-group:hover > .nav-submenu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nav-group.is-open > .nav-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.nav-admin > .nav-submenu {
    left: auto !important;
    right: 0 !important;
}

.nav-financeiro > .nav-submenu {
    left: 0;
    right: auto;
}

.main-menu .nav-submenu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.nav-group.is-open > .nav-parent .nav-arrow {
    transform: rotate(180deg);
}

.nav-arrow {
    display: inline-flex;
    transition: transform .16s ease;
}

@media (min-width: 1101px) {
    .topbar {
        flex-wrap: nowrap;
    }

    .main-menu {
        flex-wrap: nowrap;
    }

    .main-menu .nav-item,
    .main-menu .nav-parent {
        flex: 0 0 auto;
    }
}

@media (max-width: 1100px) {
    .topbar {
        align-items: center;
        overflow: visible !important;
    }

    .brand-area {
        flex: 1 1 auto;
        min-width: 0;
    }

    .brand-logo-box {
        width: min(190px, 62vw) !important;
        min-width: 0;
    }

    .main-menu {
        overflow: visible !important;
    }

    .main-menu .nav-group,
    .main-menu .nav-parent,
    .main-menu .nav-item {
        width: 100%;
    }

    .nav-submenu {
        position: static !important;
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 8px 0 8px 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 16px !important;
    }

    .nav-group.is-open > .nav-submenu {
        display: flex !important;
    }

    .nav-group:hover > .nav-submenu {
        display: none !important;
    }

    .nav-group.is-open:hover > .nav-submenu {
        display: flex !important;
    }

    .nav-group::after {
        display: none !important;
    }

    .main-menu .nav-submenu a {
        justify-content: center;
        white-space: normal;
    }
}

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

    .brand-logo-box {
        height: 50px;
    }

    .menu-toggle {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }
}

/* =========================================================
   HOTFIX V1.3 — MENU NÃO FECHA + SEM BARRA DE ROLAGEM
   - remove texto/frase ao lado da logo
   - usa logo em ícone
   - dropdown desktop fica fixed para não criar scrollbars
   - submenu só fecha com clique fora, Esc ou ao abrir outro menu
========================================================= */
.brand-text-header,
.brand-text {
    display: none !important;
}

.brand-area {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

.brand-logo-box {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 18px;
}

.brand-logo,
.brand-logo-icon {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
}

.topbar {
    min-height: 78px !important;
    overflow: visible !important;
}

@media (min-width: 1101px) {
    html,
    body {
        overflow-x: hidden !important;
    }

    .topbar,
    .main-menu,
    .app-nav,
    .nav-group {
        overflow: visible !important;
    }

    .main-menu {
        position: relative !important;
        z-index: 6000 !important;
    }

    .nav-group {
        position: relative !important;
        z-index: 6001 !important;
    }

    .nav-group::after {
        display: none !important;
        pointer-events: none !important;
    }

    .nav-submenu {
        position: fixed !important;
        top: auto;
        left: auto;
        right: auto;
        min-width: 238px !important;
        max-width: min(260px, calc(100vw - 28px)) !important;
        display: flex !important;
        flex-direction: column !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(6px) !important;
        z-index: 999999 !important;
        transition: opacity .12s ease, transform .12s ease, visibility .12s ease !important;
        will-change: transform, opacity;
    }

    .nav-group:hover > .nav-submenu,
    .nav-group:not(.is-open) > .nav-submenu {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(6px) !important;
    }

    .nav-group.is-open > .nav-submenu,
    .nav-group.is-open:hover > .nav-submenu {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    .main-menu .nav-submenu a {
        width: 100% !important;
        justify-content: flex-start !important;
        white-space: nowrap !important;
        text-align: left !important;
    }
}

@media (max-width: 1100px) {
    .brand-logo-box {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
    }

    .brand-logo,
    .brand-logo-icon {
        width: 54px !important;
        height: 54px !important;
        max-width: 54px !important;
        max-height: 54px !important;
    }

    .nav-submenu {
        position: static !important;
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .nav-group.is-open > .nav-submenu {
        display: flex !important;
    }
}


/* =========================================================
   HOTFIX V1.4 — MENU SEM FLASH/CLONE + BACKUP MAIS LEVE
   - elimina o efeito de submenu duplicado piscando no lado direito
   - mantém dropdown fora do fluxo da página para não criar barras de rolagem
   - melhora a lista de backup para ficar compacta
========================================================= */
@media (min-width: 1101px) {
    .nav-submenu {
        position: fixed !important;
        left: -9999px !important;
        right: auto !important;
        top: -9999px !important;
        display: flex !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: none !important;
        transition: none !important;
    }

    .nav-admin > .nav-submenu,
    .nav-financeiro > .nav-submenu {
        right: auto !important;
    }

    .nav-group.is-open > .nav-submenu {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .nav-group:hover > .nav-submenu:not(:hover) {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .nav-group.is-open:hover > .nav-submenu,
    .nav-group.is-open > .nav-submenu:hover {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

.backup-list-card {
    overflow: visible;
}

.backup-table table {
    min-width: 680px;
}

.backup-list-header p::after {
    content: ' Limite atual: 3 backups.';
    font-weight: 800;
    color: #8f0000;
}


/* =========================================================
   HOTFIX V1.5 — MENU DESKTOP CLICÁVEL DE VERDADE
   Corrige bug da V1.4 em que o CSS mantinha o submenu em -9999px
   e fazia Financeiro/Admin não abrirem ao clicar.
========================================================= */
@media (min-width: 1101px) {
    .nav-submenu {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        right: auto !important;
        min-width: 238px !important;
        max-width: min(260px, calc(100vw - 28px)) !important;
        z-index: 999999 !important;
        transition: none !important;
    }

    .nav-group:not(.is-open) > .nav-submenu,
    .nav-group:not(.is-open):hover > .nav-submenu,
    .nav-group:not(.is-open) > .nav-submenu:hover {
        left: -9999px !important;
        top: -9999px !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: none !important;
    }

    .nav-group.is-open > .nav-submenu,
    .nav-group.is-open:hover > .nav-submenu,
    .nav-group.is-open > .nav-submenu:hover,
    .nav-group.is-open > .nav-submenu:not(:hover) {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .nav-group:hover > .nav-submenu:not(:hover) {
        /* Regra antiga anulada: quando o grupo está aberto, o submenu precisa permanecer clicável. */
    }
}

.backup-table table {
    min-width: 0 !important;
    width: 100% !important;
}

@media (max-width: 760px) {
    .backup-table table {
        min-width: 560px !important;
    }
}


/* =========================
   VALORES — VERSÃO OTIMIZADA V1.6
   Página mais leve, sem blur pesado e sem efeitos que travavam em alguns navegadores.
========================= */
.valores-lite-hero {
    margin-bottom: 18px;
}

.valores-lite-grid {
    margin-bottom: 22px;
}

.valores-lite-grid .info-card {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    min-height: 132px;
}

.valores-lite-content {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    align-items: start;
}

.valores-lite-panel,
.valores-lite-actions {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.lite-progress-list {
    display: grid;
    gap: 16px;
}

.lite-progress-item > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
}

.lite-progress-item strong {
    color: var(--black);
}

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

.lite-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--red);
}

.valores-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 900px) {
    .valores-lite-content {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   V1.7 — INSTALAÇÃO COMO APP (PWA) + PAGINAÇÃO
========================================================= */
.pwa-install-banner {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1000000;
    width: min(680px, calc(100vw - 28px));
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(5, 5, 5, 0.97);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    transform: translate(-50%, calc(100% + 50px));
    opacity: 0;
    pointer-events: none;
    transition: transform .24s ease, opacity .24s ease;
}

.pwa-install-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-icon {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    object-fit: cover;
    background: #FFFFFF;
}

.pwa-install-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pwa-install-copy strong {
    font-size: 14px;
    font-weight: 800;
}

.pwa-install-copy span {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-btn {
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: linear-gradient(135deg, #E50000, #9B0000);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(192, 2, 2, 0.30);
}

.pwa-install-close,
.pwa-ios-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: #FFFFFF;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.pwa-ios-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.70);
}

.pwa-ios-card {
    position: relative;
    width: min(430px, 100%);
    border-radius: 26px;
    padding: 28px;
    background: #FFFFFF;
    color: #111827;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.pwa-ios-card > img {
    width: 74px;
    height: 74px;
    display: block;
    margin: 0 auto 16px;
    border-radius: 22px;
}

.pwa-ios-card h2 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 18px;
}

.pwa-ios-card ol {
    display: grid;
    gap: 12px;
    padding-left: 22px;
    margin-bottom: 22px;
    color: #4B5563;
    font-size: 13px;
    line-height: 1.55;
}

.pwa-ios-card .pwa-ios-close {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #111827;
    background: #F1F5F9;
}

.pwa-ios-ok {
    width: 100%;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
}

.pagination-summary {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.pagination-summary strong {
    color: var(--text);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #DDE2E8;
    background: #FFFFFF;
    color: #111827;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.pagination-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(192, 2, 2, 0.45);
    background: #FFF5F5;
}

.pagination-btn.is-active {
    border-color: var(--red);
    background: var(--red);
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(192, 2, 2, 0.24);
}

.pagination-btn.is-disabled {
    opacity: .36;
    cursor: not-allowed;
}

.pagination-nav {
    font-size: 22px;
    font-weight: 500;
}

.pagination-ellipsis {
    color: var(--muted);
    padding: 0 2px;
}

@media (max-width: 680px) {
    .pwa-install-banner {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
        border-radius: 20px;
    }

    .pwa-install-icon {
        width: 50px;
        height: 50px;
        border-radius: 15px;
    }

    .pwa-install-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .pwa-install-btn {
        flex: 1;
    }

    .pagination-wrap {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-buttons {
        justify-content: center;
    }

    .pagination-summary {
        text-align: center;
    }
}

/* Tutorial para criar atalho na tela inicial */
.shortcut-tutorial-open {
    overflow: hidden;
}

.shortcut-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.shortcut-tutorial-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.shortcut-tutorial-card {
    position: relative;
    width: min(100%, 470px);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 30px 24px 24px;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
    text-align: center;
    transform: translateY(16px) scale(.98);
    transition: transform .22s ease;
}

.shortcut-tutorial-overlay.is-visible .shortcut-tutorial-card {
    transform: translateY(0) scale(1);
}

.shortcut-tutorial-close {
    position: absolute;
    top: 13px;
    right: 15px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    color: #111;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.shortcut-tutorial-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    padding: 8px;
    border-radius: 21px;
    background: #080808;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.shortcut-tutorial-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.shortcut-tutorial-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
}

.shortcut-tutorial-card h2 {
    margin: 0 30px 7px;
    color: #111;
    font-size: clamp(21px, 5.3vw, 27px);
    line-height: 1.2;
}

.shortcut-tutorial-intro,
.shortcut-tutorial-note {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
}

.shortcut-tutorial-steps {
    display: grid;
    gap: 10px;
    margin: 20px 0 16px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.shortcut-tutorial-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 15px;
    background: #fafafa;
}

.shortcut-step-number {
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.shortcut-tutorial-steps p {
    margin: 3px 0 0;
    color: #232323;
    font-size: 14px;
    line-height: 1.45;
}

.shortcut-tutorial-done {
    width: 100%;
    margin-top: 18px;
}

.shortcut-settings-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 8px 0 20px;
    padding: 15px;
    border: 1px solid #e7e7e7;
    border-radius: 17px;
    background: #fafafa;
}

.shortcut-settings-content img {
    width: 58px;
    height: 58px;
    padding: 5px;
    border-radius: 16px;
    background: #080808;
    object-fit: contain;
}

.shortcut-settings-content strong {
    display: block;
    margin-bottom: 4px;
    color: #111;
}

.shortcut-settings-content p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 560px) {
    .shortcut-tutorial-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .shortcut-tutorial-card {
        width: 100%;
        max-height: 92vh;
        padding: 27px 18px 20px;
        border-radius: 25px 25px 0 0;
    }
}

/* =========================================================
   V2.0 — MOBILE COMPLETO + EDIÇÃO + PAGINAÇÃO RESPONSIVA
========================================================= */

img,
svg,
video,
canvas {
    max-width: 100%;
}

.app-container,
.app-container > *,
.content-grid,
.content-grid > *,
.form-grid,
.form-grid > *,
.cards-grid,
.cards-grid > * {
    min-width: 0;
}

[id^="lista-"],
#form-gasto {
    scroll-margin-top: 104px;
}

.edit-link {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 72px;
    padding: 0 12px;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    background: #EFF6FF;
    color: #1D4ED8;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all .18s ease;
}

.edit-link:hover {
    border-color: #1D4ED8;
    background: #1D4ED8;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.sales-table-full .responsive-table table {
    min-width: 1280px;
}

.sales-table-full .responsive-table th.actions-col,
.sales-table-full .responsive-table td.actions-col-cell {
    width: 330px;
    min-width: 330px;
}

.sales-table-full .table-actions {
    grid-template-columns: 78px 132px 88px;
    gap: 9px;
}

.sales-table-full .edit-link,
.sales-table-full .paid-link,
.sales-table-full .unpaid-link,
.sales-table-full .delete-link {
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    box-sizing: border-box;
}

.expense-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.expense-form-actions .form-submit {
    flex: 1;
    margin-top: 0;
}

.expense-form-actions .expense-cancel-edit {
    flex: 0 1 180px;
}

.expense-cancel-edit[hidden] {
    display: none !important;
}

.expense-table-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: 82px 82px;
    justify-content: start;
}

/* Paginação nova: mantém páginas no desktop e vira Anterior/Próxima no celular. */
.pagination-buttons {
    flex-wrap: nowrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-mobile-status {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 10px;
    color: #374151;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.pagination-nav {
    gap: 7px;
    width: auto;
    padding: 0 13px;
    font-size: 18px;
}

.pagination-nav-text {
    font-size: 11px;
    font-weight: 800;
}

.pagination-btn:focus-visible,
.edit-link:focus-visible,
.paid-link:focus-visible,
.unpaid-link:focus-visible,
.delete-link:focus-visible,
.btn-primary:focus-visible,
.btn-secondary-modal:focus-visible {
    outline: 3px solid rgba(29, 78, 216, .24);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .app-container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .updates-layout,
    .logs-layout,
    .backup-grid,
    .vendas-layout,
    .gastos-layout,
    .valores-lite-content {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 760px) {
    body {
        background: #F3F4F6;
        -webkit-text-size-adjust: 100%;
    }

    .topbar {
        min-height: 68px !important;
        padding: max(8px, env(safe-area-inset-top)) 12px 8px !important;
    }

    .brand-logo-box,
    .brand-logo,
    .brand-logo-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        border-radius: 15px;
    }

    .menu-toggle {
        width: 48px;
        height: 48px;
        font-size: 21px;
    }

    .main-menu.open {
        max-height: calc(100dvh - 82px - env(safe-area-inset-bottom));
        overflow-y: auto !important;
        overscroll-behavior: contain;
        padding: 10px;
    }

    .main-menu a,
    .nav-parent,
    .main-menu .nav-submenu a {
        min-height: 48px;
        font-size: 14px;
    }

    .app-container {
        width: 100%;
        padding: 16px 12px calc(34px + env(safe-area-inset-bottom));
    }

    .page-hero,
    .page-hero-luxury {
        margin-bottom: 16px;
        padding: 20px 18px;
        border-radius: 20px;
    }

    .page-hero::after {
        right: -92px;
        top: -105px;
        opacity: .72;
    }

    .page-hero h1,
    .page-hero-luxury h1 {
        font-size: clamp(22px, 6.2vw, 27px);
    }

    .page-hero p,
    .page-hero-luxury p {
        font-size: 13px;
        line-height: 1.55;
    }

    .cards-grid,
    .finance-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px;
        margin-bottom: 16px;
    }

    .info-card {
        min-height: 0;
        padding: 19px 18px 18px 21px;
        border-radius: 18px;
        box-shadow: 0 7px 20px rgba(15, 23, 42, .07);
    }

    .info-card strong,
    .metric-value {
        display: block;
        max-width: 100%;
        font-size: clamp(23px, 7vw, 29px);
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .sales-toolbar,
    .form-panel,
    .table-panel,
    .backup-card,
    .backup-list-card,
    .lux-summary-shell,
    .financial-insight-card,
    .action-lux-card {
        padding: 17px;
        border-radius: 19px;
        box-shadow: 0 7px 20px rgba(15, 23, 42, .06);
    }

    .section-title {
        display: block;
        margin-bottom: 15px;
    }

    .section-title h2,
    .sales-toolbar h2 {
        font-size: 18px;
    }

    .section-title p,
    .sales-toolbar p {
        font-size: 12px;
        line-height: 1.55;
    }

    .sales-toolbar {
        gap: 14px;
        margin-bottom: 16px;
    }

    .btn-primary,
    .btn-modal-open,
    .btn-secondary-modal,
    .btn-inline,
    .btn-inline-dark,
    .valores-pdf-btn {
        width: 100%;
        min-height: 50px;
        margin-left: 0;
        justify-content: center;
        font-size: 14px;
    }

    .home-panel {
        min-height: 0;
        padding: 24px 18px;
    }

    .home-panel .btn-inline + .btn-inline {
        margin-top: 10px;
    }

    .form-grid.two-columns,
    .metrics-lux-grid,
    .backup-schedule-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .form-group {
        min-width: 0;
        margin-bottom: 13px;
    }

    .form-control,
    select.form-control,
    textarea.form-control,
    input[type="date"],
    input[type="number"] {
        width: 100%;
        max-width: 100%;
        min-height: 50px;
        font-size: 16px !important;
    }

    .form-group.status-field label.switch-line {
        min-height: 50px;
    }

    .expense-form-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .expense-form-actions .expense-cancel-edit,
    .expense-form-actions .form-submit {
        width: 100%;
        max-width: none;
        flex: none;
    }

    /* Modal em formato de painel inferior, com área útil completa no iPhone/Android. */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-card {
        width: 100%;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        border-radius: 24px 24px 0 0;
        overscroll-behavior: contain;
    }

    .modal-header {
        padding: 18px 16px 14px;
        border-radius: 24px 24px 0 0;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .sale-modal form {
        padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    }

    .modal-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        grid-template-columns: minmax(0, 1fr);
        padding-top: 10px;
        padding-bottom: max(2px, env(safe-area-inset-bottom));
        background: linear-gradient(to top, #FFFFFF 80%, rgba(255,255,255,0));
    }

    /* Tabelas viram cartões; nada fica cortado nem exige rolagem lateral. */
    .responsive-table,
    .sales-table-full .responsive-table,
    .table-responsive,
    .backup-table {
        width: 100%;
        max-width: 100%;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .responsive-table table.mobile-card-table,
    .sales-table-full .responsive-table table.mobile-card-table,
    .gastos-table table.mobile-card-table,
    .backup-table table.mobile-card-table,
    table.mobile-card-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: auto !important;
        border: 0 !important;
        border-collapse: separate !important;
        background: transparent !important;
    }

    table.mobile-card-table thead {
        display: none !important;
    }

    table.mobile-card-table tbody {
        display: grid !important;
        width: 100% !important;
        gap: 12px;
    }

    table.mobile-card-table tbody tr,
    .sales-table-full .responsive-table table.mobile-card-table tbody tr {
        display: block !important;
        width: 100% !important;
        overflow: hidden;
        margin: 0 !important;
        border: 1px solid #E5E7EB;
        border-radius: 17px;
        background: #FFFFFF;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .06);
    }

    table.mobile-card-table tbody tr:hover,
    .sales-table-full .responsive-table table.mobile-card-table tbody tr:hover {
        background: #FFFFFF;
    }

    table.mobile-card-table tbody td,
    .sales-table-full .responsive-table table.mobile-card-table tbody td,
    .sales-table-full .responsive-table table.mobile-card-table tbody td:nth-child(n),
    .gastos-table table.mobile-card-table tbody td,
    .backup-table table.mobile-card-table tbody td {
        display: grid !important;
        grid-template-columns: minmax(94px, 38%) minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 45px;
        padding: 10px 13px !important;
        border: 0 !important;
        border-bottom: 1px solid #EEF2F7 !important;
        color: #1F2937;
        font-size: 13px !important;
        line-height: 1.45;
        text-align: right !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    table.mobile-card-table tbody td::before {
        content: attr(data-label);
        min-width: 0;
        color: #6B7280;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.35;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: .025em;
    }

    table.mobile-card-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    table.mobile-card-table tbody td.mobile-primary,
    .sales-table-full .responsive-table table.mobile-card-table tbody td.mobile-primary {
        display: block !important;
        padding: 14px 13px !important;
        background: #FAFAFA;
        color: #111827;
        font-size: 14px !important;
        font-weight: 800;
        text-align: left !important;
    }

    table.mobile-card-table tbody td.mobile-primary::before {
        display: block;
        margin-bottom: 5px;
    }

    table.mobile-card-table tbody td.mobile-empty-cell {
        display: block !important;
        padding: 20px 15px !important;
        text-align: center !important;
    }

    table.mobile-card-table tbody td.mobile-empty-cell::before {
        display: none;
    }

    table.mobile-card-table tbody td.mobile-actions,
    .sales-table-full .responsive-table table.mobile-card-table tbody td.mobile-actions {
        display: block !important;
        padding: 12px 13px 14px !important;
        background: #FAFAFA;
        text-align: left !important;
    }

    table.mobile-card-table tbody td.mobile-actions::before {
        display: block;
        margin-bottom: 9px;
    }

    .sales-table-full .status-badge {
        width: auto;
        min-width: 88px;
        height: 32px;
        margin: 0 0 0 auto !important;
    }

    .table-actions,
    .sales-table-full .table-actions,
    .expense-table-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 8px !important;
    }

    .edit-link,
    .paid-link,
    .unpaid-link,
    .delete-link,
    .sales-table-full .edit-link,
    .sales-table-full .paid-link,
    .sales-table-full .unpaid-link,
    .sales-table-full .delete-link,
    .btn-mini,
    .mini-download-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 46px !important;
        height: auto !important;
        padding: 0 13px !important;
        border-radius: 13px !important;
        font-size: 12px !important;
    }

    /* Paginação sem números espremidos no celular. */
    .pagination-wrap {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
        padding-top: 15px;
    }

    .pagination-summary {
        text-align: center;
        font-size: 12px;
    }

    .pagination-buttons {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .pagination-pages {
        display: none;
    }

    .pagination-mobile-status {
        display: inline-flex;
    }

    .pagination-nav {
        width: 100%;
        min-width: 0;
        height: 46px;
        padding: 0 10px;
        border-radius: 13px;
        font-size: 18px;
    }

    .pagination-nav-text {
        font-size: 11px;
    }

    .pagination-prev {
        justify-self: stretch;
    }

    .pagination-next {
        justify-self: stretch;
    }

    .update-drop-box,
    .file-drop,
    .shortcut-settings-content {
        max-width: 100%;
        min-width: 0;
    }

    .file-name-preview,
    .updates-history-mobile-table td,
    .logs-mobile-table td,
    .backup-mobile-table td {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 390px) {
    .app-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sales-toolbar,
    .form-panel,
    .table-panel,
    .info-card,
    .backup-card,
    .backup-list-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    table.mobile-card-table tbody td,
    .sales-table-full .responsive-table table.mobile-card-table tbody td,
    .sales-table-full .responsive-table table.mobile-card-table tbody td:nth-child(n) {
        grid-template-columns: minmax(82px, 36%) minmax(0, 1fr);
        gap: 8px;
        padding-left: 11px !important;
        padding-right: 11px !important;
    }

    .pagination-buttons {
        grid-template-columns: minmax(0, 1fr) minmax(76px, auto) minmax(0, 1fr);
        gap: 6px;
    }

    .pagination-nav-text {
        display: none;
    }
}

/* ==========================================================
   V2.1 — Início focado em vendas e navegação mobile-first
   ========================================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mobile-bottom-nav {
    display: none;
}

.sales-home-page {
    background: #F6F7F9;
}

.sales-home-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 8px 2px 4px;
}

.sales-home-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #9CA3AF;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.sales-home-header h1 {
    margin: 0;
    color: #111111;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.sales-home-header p {
    margin: 5px 0 0;
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 600;
}

.sales-home-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sales-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    background: #FFFFFF;
    color: #111827;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.sales-icon-button svg,
.sales-search-field svg,
.mobile-bottom-item svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sales-filter-panel {
    display: none;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto auto;
    gap: 9px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.sales-filter-panel.is-open {
    display: grid;
}

.sales-search-field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    height: 43px;
    padding: 0 13px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #F9FAFB;
    color: #9CA3AF;
}

.sales-search-field svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.sales-search-field input,
.sales-filter-panel select {
    width: 100%;
    min-width: 0;
    height: 43px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #F9FAFB;
    color: #111827;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.sales-search-field input {
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.sales-filter-panel select {
    padding: 0 12px;
}

.sales-filter-panel button,
.sales-filter-panel > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: #111111;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.sales-filter-panel > a {
    background: #EEF0F3;
    color: #374151;
}

.sales-compact-panel {
    overflow: hidden;
    border: 1px solid #E7E9ED;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

.sales-compact-head,
.sale-compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(92px, .8fr) 94px;
    align-items: center;
    gap: 12px;
}

.sales-compact-head {
    min-height: 42px;
    padding: 0 17px;
    border-bottom: 1px solid #ECEEF1;
    color: #9CA3AF;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sales-compact-list {
    display: block;
}

.sale-compact-item {
    border-bottom: 1px solid #EEF0F2;
    background: #FFFFFF;
}

.sale-compact-item:last-child {
    border-bottom: 0;
}

.sale-compact-item[open] {
    background: #FCFCFD;
}

.sale-compact-row {
    min-height: 51px;
    padding: 8px 17px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.sale-compact-row::-webkit-details-marker {
    display: none;
}

.sale-compact-row::marker {
    content: '';
}

.sale-compact-row:hover {
    background: #FAFAFB;
}

.sale-compact-name,
.sale-compact-date,
.sale-compact-status {
    min-width: 0;
    font-size: 12px;
}

.sale-compact-name {
    overflow: hidden;
    color: #31343A;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-compact-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4B5563;
    font-weight: 700;
    white-space: nowrap;
}

.sale-compact-status i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .08);
}

.sale-compact-status.is-paid i {
    background: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .08);
}

.sale-compact-date {
    color: #6B7280;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.sale-compact-details {
    padding: 5px 17px 15px;
    border-top: 1px dashed #E5E7EB;
}

.sale-detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
    padding: 12px 0;
}

.sale-detail-grid > div {
    min-width: 0;
    padding: 10px;
    border-radius: 11px;
    background: #F4F5F7;
}

.sale-detail-grid span {
    display: block;
    margin-bottom: 3px;
    color: #9CA3AF;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.sale-detail-grid strong {
    display: block;
    overflow-wrap: anywhere;
    color: #1F2937;
    font-size: 12px;
    line-height: 1.35;
}

.sale-detail-value strong {
    color: #111111;
}

.sale-compact-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.sale-compact-actions .edit-link,
.sale-compact-actions .paid-link,
.sale-compact-actions .unpaid-link,
.sale-compact-actions .delete-link {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border-radius: 11px;
    font-size: 11px;
}

.sales-compact-empty {
    padding: 48px 20px;
    text-align: center;
}

.sales-compact-empty h2 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 18px;
}

.sales-compact-empty p {
    margin: 0;
    color: #9CA3AF;
    font-size: 13px;
}

.sales-compact-panel .pagination-wrap {
    margin: 0;
    padding: 15px 17px;
    border-top: 1px solid #EEF0F2;
}

.sales-fab {
    position: fixed;
    right: max(24px, calc((100vw - 1320px) / 2));
    bottom: 24px;
    z-index: 70;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: #111111;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}

.sales-fab-plus {
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}

.financial-summary-actions .btn-inline {
    margin-right: 8px;
    margin-bottom: 8px;
}

@media (max-width: 760px) {
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .topbar .menu-toggle {
        display: none !important;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: calc(66px + env(safe-area-inset-bottom));
        padding: 5px 5px max(5px, env(safe-area-inset-bottom));
        border-top: 1px solid rgba(17, 24, 39, .1);
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .mobile-bottom-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        min-height: 55px;
        padding: 4px 2px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #9CA3AF;
        font-family: inherit;
        text-decoration: none;
        cursor: pointer;
    }

    .mobile-bottom-item svg {
        width: 20px;
        height: 20px;
    }

    .mobile-bottom-item span {
        overflow: hidden;
        max-width: 100%;
        font-size: 9px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-bottom-item.active {
        color: #111111;
        background: #F1F2F4;
    }

    .app-container {
        padding-bottom: calc(38px + env(safe-area-inset-bottom)) !important;
    }

    .sales-home-page .topbar {
        min-height: 60px !important;
        padding-top: max(6px, env(safe-area-inset-top)) !important;
        padding-bottom: 6px !important;
        border-bottom-color: #EEF0F2;
        background: rgba(255, 255, 255, .96) !important;
    }

    .sales-home-page .brand-logo-box,
    .sales-home-page .brand-logo,
    .sales-home-page .brand-logo-icon {
        width: 43px !important;
        height: 43px !important;
        min-width: 43px !important;
        max-width: 43px !important;
        max-height: 43px !important;
        border-radius: 13px;
    }

    .sales-home-page .app-container {
        padding: 11px 9px calc(36px + env(safe-area-inset-bottom)) !important;
    }

    .sales-home-header {
        align-items: center;
        margin-bottom: 10px;
        padding: 2px 3px 3px;
    }

    .sales-home-eyebrow {
        font-size: 8px;
    }

    .sales-home-header h1 {
        font-size: 24px;
    }

    .sales-home-header p {
        margin-top: 3px;
        font-size: 10px;
    }

    .sales-home-header-actions {
        gap: 6px;
    }

    .sales-icon-button {
        width: 38px;
        height: 38px;
        box-shadow: none;
    }

    .sales-icon-button svg {
        width: 18px;
        height: 18px;
    }

    .sales-filter-panel {
        grid-template-columns: minmax(0, 1fr) minmax(116px, .42fr);
        gap: 7px;
        margin-bottom: 9px;
        padding: 9px;
        border-radius: 13px;
    }

    .sales-search-field,
    .sales-filter-panel select {
        min-height: 44px;
        font-size: 16px !important;
    }

    .sales-filter-panel button,
    .sales-filter-panel > a {
        min-height: 43px;
    }

    .sales-filter-panel button {
        grid-column: 1 / 2;
    }

    .sales-filter-panel > a {
        grid-column: 2 / 3;
    }

    .sales-compact-panel {
        border-radius: 12px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
    }

    .sales-compact-head,
    .sale-compact-row {
        grid-template-columns: minmax(0, 1.45fr) minmax(76px, .85fr) 72px;
        gap: 7px;
    }

    .sales-compact-head {
        min-height: 33px;
        padding: 0 9px;
        font-size: 8px;
    }

    .sale-compact-row {
        min-height: 43px;
        padding: 6px 9px;
    }

    .sale-compact-name,
    .sale-compact-status,
    .sale-compact-date {
        font-size: 9.5px;
    }

    .sale-compact-name {
        font-weight: 600;
    }

    .sale-compact-status {
        gap: 5px;
        font-size: 8.5px;
    }

    .sale-compact-status i {
        width: 6px;
        height: 6px;
        flex-basis: 6px;
        box-shadow: none;
    }

    .sale-compact-date {
        font-size: 8.5px;
    }

    .sale-compact-details {
        padding: 4px 9px 10px;
    }

    .sale-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 8px 0;
    }

    .sale-detail-grid > div {
        padding: 8px;
        border-radius: 9px;
    }

    .sale-detail-grid span {
        font-size: 8px;
    }

    .sale-detail-grid strong {
        font-size: 10px;
    }

    .sale-detail-value {
        grid-column: 1 / -1;
    }

    .sale-compact-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .sale-compact-actions .edit-link,
    .sale-compact-actions .paid-link,
    .sale-compact-actions .unpaid-link,
    .sale-compact-actions .delete-link {
        min-height: 38px !important;
        height: auto !important;
        padding: 0 5px !important;
        border-radius: 9px !important;
        font-size: 9px !important;
    }

    .sales-compact-empty {
        padding: 40px 16px;
    }

    .sales-compact-empty h2 {
        font-size: 16px;
    }

    .sales-compact-empty p {
        font-size: 11px;
    }

    .sales-compact-panel .pagination-wrap {
        padding: 11px 9px;
    }

    .sales-fab {
        right: 14px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        width: 56px;
        min-width: 56px;
        height: 56px;
        min-height: 56px;
        padding: 0;
        border-radius: 50%;
    }

    .sales-fab-plus {
        font-size: 30px;
    }

    .sales-fab-label {
        display: none;
    }

    .financial-summary-actions .btn-inline {
        margin-right: 0;
    }
}

@media (max-width: 380px) {
    .sales-compact-head,
    .sale-compact-row {
        grid-template-columns: minmax(0, 1.4fr) 72px 65px;
        gap: 5px;
    }

    .sale-compact-name,
    .sale-compact-status,
    .sale-compact-date {
        font-size: 8.5px;
    }

    .mobile-bottom-item span {
        font-size: 8px;
    }
}
