/* ========================================
   🎨 Design Tokens (MVP)
   Inspiração visual: Nubank — roxo profundo, verde para positivo,
   superfícies limpas, hierarquia financeira clara.
======================================== */

:root {
    /* Primary — Roxo Nubank */
    --primary: #820AD1;
    --primary-hover: #6B09AC;
    --primary-soft: #F5E5FD;

    /* Success — Verde (estados financeiros positivos: pago, recebido) */
    --success: #00A868;
    --success-hover: #008A55;
    --success-soft: #D6F5EA;

    /* Error — Laranja (vencido, erro) */
    --error: #C2410C;
    --error-soft: #FFF7ED;

    /* Warning — Âmbar (atenção, reversão) */
    --warning: #D97706;
    --warning-hover: #B45309;
    --warning-soft: #FEF3C7;
    --warning-text: #92400E;
    --warning-bg: #FFFBEB;

    /* Neutral / Warning */
    --neutral: #374151;
    --neutral-soft: #F3F4F6;

    /* Base */
    --bg: #F9F9FB;
    --surface: #FFFFFF;
    --border: #E5E7EB;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6B7280;
}

/* ========================================
   🌍 Base Layout
======================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ========================================
   🧭 Top Bar — Roxo sólido (Nubank)
======================================== */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--primary);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.app-topbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: -.02em;
    text-decoration: none;
}

.app-topbar-brand:hover {
    color: #fff;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.app-topbar-link {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    font-size: .875rem;
    padding: 6px 12px;
}

.app-topbar-link:hover {
    color: #fff;
}

.app-topbar-cta {
    background: rgba(255, 255, 255, .15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    font-size: .8rem;
    border-radius: 6px;
}

.app-topbar-cta:hover {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

/* ── Notification Bell ──────────────────────────────────────── */

.app-bell-wrapper {
    position: relative;
}

.app-bell-btn {
    position: relative;
    background: none;
    border: none;
    color: rgba(255, 255, 255, .85);
    font-size: 1.25rem;
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    transition: background .15s;
}

.app-bell-btn:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.app-bell-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: #EF4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ── Notification Dropdown Panel ─────────────────────────── */

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -60px;
    width: 420px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .15), 0 0 0 1px rgba(0, 0, 0, .05);
    opacity: 0;
    transform: translateY(-8px) scale(.97);
    pointer-events: none;
    transition: .2s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    max-height: 520px;
    overflow: hidden;
    z-index: 1060;
}

.notif-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 575.98px) {
    .notif-dropdown {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        width: auto;
        border-radius: 12px;
        max-height: calc(100vh - 72px);
    }
}

.notif-dd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.notif-dd-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.notif-dd-mark-all {
    font-size: .78rem;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 500;
}

.notif-dd-mark-all:hover {
    text-decoration: underline;
}

.notif-dd-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notif-dd-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .12s;
}

.notif-dd-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.notif-dd-list {
    flex: 1;
    overflow-y: auto;
}

.notif-dd-group {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    padding: 10px 20px 4px;
}

.notif-dd-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background .12s;
}

.notif-dd-item:hover {
    background: #FAFAFA;
}

.notif-dd-item.unread {
    background: var(--primary-soft);
}

.notif-dd-item.unread:hover {
    background: #EDD5FC;
}

.notif-dd-item+.notif-dd-item {
    border-top: 1px solid var(--border);
}

.notif-dd-body {
    flex: 1;
    min-width: 0;
}

.notif-dd-item-title {
    font-weight: 600;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-dd-item-title .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    display: none;
    flex-shrink: 0;
}

.notif-dd-item.unread .notif-dd-item-title .dot {
    display: block;
}

.notif-dd-msg {
    font-size: .78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.notif-dd-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.notif-dd-time {
    font-size: .68rem;
    color: var(--text-secondary);
}

.notif-dd-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.notif-dd-footer a {
    font-size: .82rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.notif-dd-footer a:hover {
    text-decoration: underline;
}

.notif-dd-empty {
    text-align: center;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.notif-dd-empty i {
    font-size: 2rem;
    opacity: .4;
}

/* ── Shared Notification Icon Bubble ────────────────────── */

:root {
    --notif-ic-expense-bg: #FEF3C7;
    --notif-ic-expense-fg: #D97706;
    --notif-ic-sale-bg: #D6F5EA;
    --notif-ic-sale-fg: #00A868;
    --notif-ic-os-bg: #DBEAFE;
    --notif-ic-os-fg: #2563EB;
    --notif-ic-invite-bg: var(--primary-soft);
    --notif-ic-invite-fg: var(--primary);
    --notif-ic-report-bg: #E0E7FF;
    --notif-ic-report-fg: #4F46E5;
    --notif-ic-system-bg: var(--neutral-soft);
    --notif-ic-system-fg: var(--neutral);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notif-ic-expense {
    background: var(--notif-ic-expense-bg);
    color: var(--notif-ic-expense-fg);
}

.notif-ic-sale {
    background: var(--notif-ic-sale-bg);
    color: var(--notif-ic-sale-fg);
}

.notif-ic-os {
    background: var(--notif-ic-os-bg);
    color: var(--notif-ic-os-fg);
}

.notif-ic-invite {
    background: var(--notif-ic-invite-bg);
    color: var(--notif-ic-invite-fg);
}

.notif-ic-report {
    background: var(--notif-ic-report-bg);
    color: var(--notif-ic-report-fg);
}

.notif-ic-system {
    background: var(--notif-ic-system-bg);
    color: var(--notif-ic-system-fg);
}

/* ── Notification Page (Full /Notificacoes) ─────────────── */

.notif-page {
    max-width: 780px;
    margin-inline: auto;
}

.notif-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.notif-page-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

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

.notif-page-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .12s;
}

.notif-page-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.notif-page-icon-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.notif-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.notif-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    transition: .15s;
    white-space: nowrap;
    text-decoration: none;
}

.notif-filter.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.notif-filter:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.notif-filter .count {
    font-size: .7rem;
    font-weight: 600;
    background: rgba(0, 0, 0, .08);
    padding: 1px 6px;
    border-radius: 10px;
}

.notif-filter.active .count {
    background: rgba(255, 255, 255, .25);
}

.notif-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-date-sep {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    padding: 16px 0 4px;
}

.notif-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: .15s;
    cursor: pointer;
    position: relative;
}

.notif-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    border-color: #D1D5DB;
}

.notif-card.unread {
    border-left: 3px solid var(--primary);
    background: #FDFAFF;
}

.notif-card .notif-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.15rem;
}

.notif-card-body {
    flex: 1;
    min-width: 0;
}

.notif-card-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.notif-card-title {
    font-weight: 600;
    font-size: .88rem;
}

.notif-card-time {
    font-size: .72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-card-msg {
    font-size: .82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.notif-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notif-card-action {
    font-size: .75rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.notif-card-action:hover {
    text-decoration: underline;
}

.notif-empty {
    text-align: center;
    padding: 60px 20px;
}

.notif-empty-icon {
    font-size: 3.5rem;
    color: var(--text-secondary);
    opacity: .3;
}

.notif-empty-title {
    font-weight: 600;
    margin-top: 12px;
}

.notif-empty-text {
    color: var(--text-secondary);
    font-size: .9rem;
}

.notif-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 24px 0;
}

.notif-pg-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    transition: .15s;
    text-decoration: none;
}

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

.notif-pg-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Avatar / Profile Dropdown ─────────────────────────────── */

.app-avatar-wrapper {
    position: relative;
}

.app-avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
    border: 2px solid rgba(255, 255, 255, .4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.app-avatar-btn:hover {
    background: rgba(255, 255, 255, .3);
}

.app-avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    min-width: 220px;
    padding: 8px 0;
    display: none;
    z-index: 1050;
}

.app-avatar-dropdown.show {
    display: block;
}

.app-avatar-dropdown-header {
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.app-avatar-dropdown-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: .9rem;
}

.app-avatar-dropdown a,
.app-avatar-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 16px;
    font-size: .875rem;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.app-avatar-dropdown a:hover,
.app-avatar-dropdown button:hover {
    background: var(--neutral-soft);
}

.app-avatar-dropdown .bi {
    color: var(--text-secondary);
    font-size: 1rem;
}

.app-avatar-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.app-avatar-dropdown-logout {
    color: var(--error) !important;
}

.app-avatar-dropdown-logout .bi {
    color: var(--error) !important;
}

.app-avatar-dropdown-footer {
    padding: 8px 14px 10px;
    font-size: .65rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: .6;
}

/* ========================================
   🗂️ Sidebar (desktop only)
======================================== */

.app-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 60px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 1020;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: width .3s cubic-bezier(.4, 0, .2, 1);
}

.app-sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.app-sidebar-section {
    padding: 4px 0;
}

.app-sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    justify-content: center;
    font-size: .875rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background .15s;
}

.app-sidebar-link:hover {
    background: var(--neutral-soft);
    color: var(--text-primary);
}

.app-sidebar-link.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-soft);
    border-right: 3px solid var(--primary);
}

.app-sidebar-link .bi {
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.app-sidebar-link.active .bi {
    color: var(--primary);
}

.app-sidebar-link span {
    display: none;
}

.app-sidebar-toggle {
    margin: auto auto 16px;
    background: var(--neutral-soft);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: .85rem;
    transition: background .15s;
}

.app-sidebar-toggle:hover {
    background: var(--border);
}

/* Sidebar expanded state */
.app-sidebar.expanded {
    width: 220px;
}

.app-sidebar.expanded .app-sidebar-link {
    justify-content: flex-start;
    padding: 10px 16px;
}

.app-sidebar.expanded .app-sidebar-link span {
    display: inline;
}

.app-sidebar.expanded .app-sidebar-link .bi {
    font-size: 1.1rem;
}

/* ========================================
   📱 Bottom Tab Bar (mobile only)
======================================== */

.app-bottomtabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 4px 0 env(safe-area-inset-bottom, 8px);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
}

.app-bottomtab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    min-width: 56px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: .65rem;
    font-weight: 500;
    transition: color .15s;
}

.app-bottomtab .bi {
    font-size: 1.3rem;
}

.app-bottomtab.active {
    color: var(--primary);
    font-weight: 600;
}

.app-bottomtab:hover {
    color: var(--primary);
}

/* ========================================
   📱 Grid Overlay (mobile "Mais")
======================================== */

.app-grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.app-grid-overlay.show {
    opacity: 1;
    visibility: visible;
}

.app-grid-panel {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 0 0 env(safe-area-inset-bottom, 24px);
    transform: translateY(30px);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.app-grid-overlay.show .app-grid-panel {
    transform: translateY(0);
}

.app-grid-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    margin: 10px auto 0;
}

.app-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px;
}

.app-grid-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.app-grid-close {
    background: var(--neutral-soft);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: background .15s;
}

.app-grid-close:hover {
    background: var(--border);
}

.app-grid-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 12px 20px 20px;
}

.app-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 12px;
    transition: background .15s;
    font-size: .78rem;
    font-weight: 500;
}

.app-grid-item:hover,
.app-grid-item:active {
    background: var(--neutral-soft);
    color: var(--text-primary);
}

.app-grid-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.app-grid-ic-dashboard {
    background: var(--primary-soft);
    color: var(--primary);
}

.app-grid-ic-vendas {
    background: var(--success-soft);
    color: var(--success);
}

.app-grid-ic-os {
    background: #FEF3C7;
    color: #92400E;
}

.app-grid-ic-despesas {
    background: var(--error-soft);
    color: var(--error);
}

.app-grid-ic-clientes {
    background: #EAF3FF;
    color: #275EA8;
}

.app-grid-ic-produtos {
    background: #ECE7FF;
    color: #5B3FB3;
}

/* ========================================
   🖥️ Main Content Shift (sidebar aware)
======================================== */

.app-main-content {
    transition: margin-left .3s;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

.app-main-content>main {
    flex: 1;
}

/* ========================================
   📐 Responsive: Desktop (≥992px)
======================================== */

@media (min-width: 992px) {
    .app-topbar {
        height: 56px;
        padding: 0 24px;
    }

    .app-sidebar {
        display: flex;
    }

    .app-main-content {
        margin-left: 60px;
    }

    .app-main-content.shifted {
        margin-left: 220px;
    }

    .app-bottomtabs,
    .app-grid-overlay {
        display: none !important;
    }
}

/* ========================================
   📱 Responsive: Mobile (<992px)
======================================== */

@media (max-width: 991.98px) {
    .app-sidebar {
        display: none !important;
    }

    body.has-bottomtabs {
        padding-bottom: 68px;
    }
}

/* ========================================
   📦 Cards / Containers
======================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: none;
}

/* ========================================
   🔘 Buttons
======================================== */

.btn {
    border-radius: 8px;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-hover);
    --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-bg: var(--primary-hover);
    --bs-btn-active-border-color: var(--primary-hover);
    --bs-btn-focus-shadow-rgb: 130, 10, 209;
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}

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

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:checked+.btn-primary,
.btn.show.btn-primary {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 0.1rem rgba(130, 10, 209, 0.2);
}

.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--primary);
    border-color: var(--primary);
    opacity: 0.82;
}

/* ========================================
   🧾 Inputs
======================================== */

.form-control {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.form-select,
.form-check-input {
    border: 1px solid var(--border);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.1rem rgba(130, 10, 209, 0.2);
}

/* Switch: override Bootstrap SVG thumb colors */
.form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%236B7280'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23820AD1'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.1rem rgba(130, 10, 209, 0.2);
}

/* ========================================
   ⚠️ Validation
======================================== */

.validation-message {
    color: var(--error);
    font-size: 0.85rem;
}

.form-control.input-validation-error,
.form-select.input-validation-error {
    border-color: var(--error);
    background-color: var(--error-soft);
    background-image: none;
    padding-right: .75rem;
}

.form-control.is-invalid,
.form-select.is-invalid {
    background-image: none;
    padding-right: .75rem;
}

.form-control.input-validation-error:focus,
.form-select.input-validation-error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 0.1rem rgba(194, 65, 12, 0.18);
}

/* ========================================
   💬 Toast / Feedback
======================================== */

.toast {
    border-radius: 10px;
    border: none;
}

.app-toast-success {
    background: var(--success-soft);
    color: var(--success);
}

.app-toast-error {
    background: var(--error-soft);
    color: var(--error);
}

.app-toast-warning {
    background: var(--warning-soft);
    color: var(--warning-text);
}

/* ========================================
   ⚪ Alerts (Inline)
======================================== */

.app-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.app-alert-neutral {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.app-alert-error {
    background: var(--error-soft);
    color: var(--error);
}

.app-alert-cta {
    background: var(--primary-soft);
    color: var(--text-primary);
    border: 1px solid rgba(130, 10, 209, .12);
    text-align: center;
}

.app-cta-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.app-cta-link:hover {
    color: var(--primary-hover);
}

/* ========================================
   ➕ Floating Action Button
======================================== */

.fab,
.fab-button {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1085;
}

.fab:hover,
.fab-button:hover {
    background: var(--primary-hover);
    color: white;
}

@media (max-width: 767.98px) {

    .fab,
    .fab-button {
        right: 16px;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }

    .app-page-shell {
        padding-bottom: 96px;
    }
}

/* Floating alert offset for topbar */
.app-floating-alert {
    z-index: 1080;
    margin-top: 72px;
}

/* ========================================
   📄 Typography
======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* ========================================
   📐 Helpers
======================================== */

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

/* Espaçamento padrão */
.section {
    margin-bottom: 24px;
}

.app-page-shell {
    max-width: 960px;
    margin: 0 auto;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.app-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.app-page-header-centered {
    justify-content: center;
    text-align: center;
}

.app-page-header-centered .app-page-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.app-page-title {
    margin-bottom: 8px;
}

.app-page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 0;
    max-width: 640px;
}

.app-page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.app-form-card,
.app-content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.app-onboarding-centered-card {
    max-width: 760px;
    margin: 0 auto;
}

.app-form-section+.app-form-section {
    border-top: 1px solid var(--border);
    margin-top: 24px;
    padding-top: 24px;
}

/* ── Remember me row ──────────────────────────────────────────── */
.app-remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.app-remember-row .form-check {
    margin-bottom: 0;
}

.app-remember-row .form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.app-forgot-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
}

.app-forgot-link:hover {
    text-decoration: underline;
}

.app-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.app-help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.app-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.app-form-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 0.95rem;
}

.app-form-actions-end {
    justify-content: flex-end;
}

.app-wizard-actions .app-btn-primary-cta {
    min-width: 200px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
}

.app-wizard-actions .app-btn-secondary {
    padding: 0.45rem 0.9rem;
    font-size: 0.95rem;
}

.app-card-subtitle,
.app-card-text {
    color: var(--text-secondary);
}

.app-card-subtitle {
    margin-bottom: 8px;
}

.validation-message {
    display: block;
    margin-top: 6px;
}

.validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

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

.app-wizard-progress {
    margin: 0 auto 24px;
    max-width: 760px;
}

.app-wizard-mobile-track {
    display: none;
    height: 8px;
    border-radius: 999px;
    background: var(--neutral-soft);
    overflow: hidden;
    margin-bottom: 8px;
}

.app-wizard-mobile-fill {
    display: block;
    height: 100%;
    width: 33.333%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.app-wizard-progress-step-1 .app-wizard-mobile-fill {
    width: 33.333%;
}

.app-wizard-progress-step-2 .app-wizard-mobile-fill {
    width: 66.666%;
}

.app-wizard-progress-step-3 .app-wizard-mobile-fill {
    width: 100%;
}

.app-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-secondary);
}

.app-step-marker {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-soft);
    color: var(--neutral);
    font-weight: 600;
    flex-shrink: 0;
}

.app-step-label {
    font-size: 0.95rem;
    line-height: 1.3;
}

.app-step.is-active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--text-primary);
}

.app-step.is-active .app-step-marker {
    background: var(--primary);
    color: var(--surface);
}

.app-step.is-complete .app-step-marker {
    background: var(--neutral);
    color: var(--surface);
}

.app-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.app-plan-card {
    display: block;
    height: 100%;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.app-plan-card:hover {
    border-color: var(--primary);
}

.app-plan-card.is-selected {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.app-plan-input {
    margin-bottom: 16px;
}

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

.app-switch-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    align-items: flex-start;
}

.app-switch-item .form-check {
    margin-bottom: 0;
}

.app-key-value {
    display: grid;
    gap: 12px;
}

.app-key-value-item {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.app-key-value-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.app-key-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.app-key-value-text {
    font-weight: 600;
}

.app-empty-state {
    max-width: 720px;
    margin: 0 auto;
}

.app-empty-state-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
}

.app-inline-note {
    background: var(--neutral-soft);
    color: var(--neutral);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.app-toast {
    min-width: 280px;
    max-width: 420px;
    animation: toastSlideIn 0.3s ease;
}

.app-toast .toast-body {
    font-size: 0.88rem;
    font-weight: 500;
    padding: 12px 16px;
}

.app-toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
    padding: 0 2px;
    color: inherit;
}

.app-toast-close:hover {
    opacity: 1;
}

.app-toast-hide {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.app-password-control {
    position: relative;
}

.app-password-input-field {
    padding-right: 52px;
}

.app-password-toggle {
    position: absolute;
    top: 50%;
    right: 1px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-password-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.app-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.1rem rgba(130, 10, 209, 0.2);
}

/* ========================================
   📊 Despesas — Summary Bar
======================================== */

.summary-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.summary-metrics {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.summary-metric-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.summary-metric-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.expense-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--neutral-soft);
    overflow: hidden;
    display: flex;
    margin-top: 14px;
}

.expense-bar-paid {
    background: var(--success);
}

.expense-bar-open {
    background: var(--primary);
}

.expense-bar-overdue {
    background: var(--error);
}

/* ── Metric Bar (reusable proportion bar) ── */
.metric-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--neutral-soft);
    overflow: hidden;
    display: flex;
    margin-top: 14px;
}

.customer-bar-active {
    background: var(--success);
}

.customer-bar-inactive {
    background: var(--neutral);
}

/* ========================================
   🗓️ Month Navigation (pill roxo)
======================================== */

.month-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 10px;
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 3px;
}

.month-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}

.month-nav-btn:hover {
    background: rgba(130, 10, 209, 0.12);
    color: var(--primary);
}

.month-nav-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.month-nav-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
    text-align: center;
    padding: 6px 8px;
}

/* ========================================
   💰 Input Money (R$ prefix)
======================================== */

.input-money {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.input-money:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.1rem rgba(130, 10, 209, 0.2);
}

.input-money.is-invalid {
    border-color: var(--error);
}

.input-money.is-invalid:focus-within {
    box-shadow: 0 0 0 0.1rem rgba(194, 65, 12, 0.2);
}

.input-money-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--neutral-soft);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    border-right: 1px solid var(--border);
    user-select: none;
}

.input-money input {
    flex: 1;
    border: none;
    outline: none;
    padding: 6px 10px;
    font-size: 0.95rem;
    background: transparent;
    min-width: 0;
}

.input-money input.is-empty::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Clear button (×) */
.input-money {
    position: relative;
}

.input-money-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.input-money-clear:hover {
    color: var(--error);
}

/* Shake animation on zero submit */
@keyframes moneyShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

.input-money-shake {
    animation: moneyShake 0.4s ease;
    border-color: var(--error) !important;
}

/* ========================================
   🔘 Toggle Switch Item
======================================== */

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-item:hover {
    border-color: var(--primary);
}

.toggle-item.is-active {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.toggle-item-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-item-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.toggle-item.is-active .toggle-switch {
    background: var(--primary);
}

.toggle-item.is-active .toggle-switch::after {
    transform: translateX(18px);
}

/* ========================================
   ⚠️ Due Alert
======================================== */

.due-alert {
    background: var(--error-soft);
    color: var(--error);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ========================================
   📋 Results Row
======================================== */

.results-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.results-count {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ========================================
   💳 Expense Cards (mobile)
======================================== */

.expense-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: box-shadow 0.15s ease;
    cursor: pointer;
}

.expense-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    color: inherit;
    text-decoration: none;
}

.expense-card.is-open {
    border-left-color: var(--primary);
}

.expense-card.is-overdue {
    border-left-color: var(--error);
}

.expense-card.is-paid {
    border-left-color: var(--success);
    opacity: 0.8;
}

.expense-card.stock-ok {
    border-left-color: var(--success);
}

.expense-card.stock-low {
    border-left-color: var(--warning);
}

.expense-card.stock-zero {
    border-left-color: var(--error);
}

.expense-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.expense-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.expense-amount {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.expense-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.expense-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ========================================
   👥 Customer Cards (mobile)
======================================== */

.customer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.customer-card.is-inactive {
    border-left-color: var(--neutral);
}

.customer-card.is-anonymized {
    border-left-color: var(--warning);
    background: var(--warning-bg);
}

.customer-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.customer-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.mobile-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-pill {
    min-width: 96px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.summary-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-section-block {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--neutral-soft);
}

.type-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--border);
}

.type-toggle .btn {
    flex: 1;
    border-radius: 0;
    border: 0;
    background: var(--surface);
    color: var(--neutral);
    font-size: 0.88rem;
    padding: 8px 0;
    font-weight: 500;
}

.type-toggle .btn+.btn {
    border-left: 1.5px solid var(--border);
}

.type-toggle .btn.active-product {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.type-toggle .btn.active-service {
    background: #5B3FB3;
    color: #fff;
    font-weight: 600;
}

.mobile-actions-full .btn-action {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 26px rgba(0, 0, 0, 0.18);
    padding: 14px;
    z-index: 1060;
    display: none;
}

.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.15);
    z-index: 1059;
    display: none;
}

/* ========================================
   🏷️ Status Badges (slim)
======================================== */

.sbadge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.sbadge-open {
    background: var(--primary-soft);
    color: var(--primary);
}

.sbadge-overdue {
    background: var(--error-soft);
    color: var(--error);
}

.sbadge-paid {
    background: var(--success-soft);
    color: #065F46;
}

.sbadge-recur {
    background: #E0F2FE;
    color: #0369A1;
}

.sbadge-product {
    background: #EAF3FF;
    color: #275EA8;
}

.sbadge-service {
    background: #EEE8FF;
    color: #5B3FB3;
}

.stock-bar-ok {
    background: var(--success);
}

.stock-bar-low {
    background: var(--warning);
}

.stock-bar-zero {
    background: var(--error);
}

.stock-ok {
    color: var(--success);
    font-weight: 700;
}

.stock-low {
    color: var(--warning);
    font-weight: 700;
}

.stock-zero {
    color: var(--error);
    font-weight: 700;
}

.sbadge-active {
    background: var(--success-soft);
    color: #065F46;
}

.sbadge-inactive {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.sbadge-anonymized {
    background: var(--warning-soft);
    color: var(--warning-text);
}

/* Service Order status badges */
.sbadge-os-open {
    background: #EFF6FF;
    color: #1D4ED8;
}

.sbadge-os-waiting {
    background: var(--warning-soft);
    color: var(--warning-text);
}

.sbadge-os-approved {
    background: #F0FDF4;
    color: #166534;
}

.sbadge-os-progress {
    background: #EDE9FE;
    color: #5B21B6;
}

.sbadge-os-parts {
    background: #FFF7ED;
    color: #9A3412;
}

.sbadge-os-done {
    background: var(--success-soft);
    color: #065F46;
}

.sbadge-os-delivered {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.sbadge-os-cancelled {
    background: #FEF2F2;
    color: #991B1B;
}

/* ========================================
   🔧 OS Card border-left colors
======================================== */

.expense-card.is-os-open {
    border-left-color: #1D4ED8;
}

.expense-card.is-os-waiting {
    border-left-color: var(--warning);
}

.expense-card.is-os-approved {
    border-left-color: #166534;
}

.expense-card.is-os-progress {
    border-left-color: #5B21B6;
}

.expense-card.is-os-parts {
    border-left-color: #9A3412;
}

.expense-card.is-os-done {
    border-left-color: #065F46;
}

.expense-card.is-os-delivered {
    border-left-color: var(--neutral);
    opacity: .75;
}

.expense-card.is-os-cancelled {
    border-left-color: #991B1B;
    opacity: .65;
}

.os-group-header {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    padding: 10px 2px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.os-group-header .os-group-count {
    background: var(--border);
    color: var(--text-secondary);
    font-size: .65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 7px;
}

.os-attention-card {
    border-radius: 10px;
    padding: 10px 14px;
    flex: 1;
    min-width: 130px;
}

/* ========================================
   ✅ Pay Button (CTA verde)
======================================== */

.btn-pay {
    font-size: 0.85rem;
    padding: 6px 20px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 8px;
    background: var(--success);
    color: #fff;
    border: none;
    font-weight: 600;
    z-index: 2;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 168, 104, 0.25);
    transition: all 0.15s;
}

.btn-pay:hover {
    background: var(--success-hover);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 168, 104, 0.35);
}

/* Pay Button Large (Detail page CTA) */
.btn-pay-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--success);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 168, 104, 0.25);
    transition: all 0.15s;
}

.btn-pay-lg:hover {
    background: var(--success-hover);
    box-shadow: 0 3px 12px rgba(0, 168, 104, 0.35);
}

/* Revert Button (undo payment) */
.btn-revert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--warning);
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-revert:hover {
    background: var(--warning-soft);
    border-color: var(--warning-hover);
}

/* Key-Value pairs (Detail data) */
.kv-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

/* ── User / Invite Badges ───────────────────────────────────────── */
.sbadge-owner {
    background: var(--primary-soft);
    color: var(--primary);
}

.sbadge-employee {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.sbadge-pending {
    background: var(--warning-soft);
    color: #92400E;
}

.sbadge-accepted {
    background: var(--success-soft);
    color: #065F46;
}

.sbadge-declined {
    background: var(--error-soft);
    color: var(--error);
}

/* ── User Cards ─────────────────────────────────────────────────── */
.user-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: box-shadow .15s;
}

.user-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.user-card.is-inactive {
    border-left-color: var(--neutral);
    opacity: .7;
}

.user-name {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-meta {
    font-size: .78rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* ── Invite Cards ───────────────────────────────────────────────── */
.invite-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.invite-card.is-accepted {
    border-left-color: var(--success);
    opacity: .8;
}

.invite-card.is-declined {
    border-left-color: var(--error);
    opacity: .65;
}

/* ── Invite Banner (received) ───────────────────────────────────── */
.invite-banner {
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.invite-banner-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.invite-banner-text {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ── User Bar Segments ──────────────────────────────────────────── */
.user-bar-owner {
    background: var(--primary);
}

.user-bar-employee {
    background: var(--neutral);
}

.kv-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Timeline (Histórico) */
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    position: relative;
}

.timeline-item+.timeline-item {
    border-top: 1px dashed var(--border);
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.timeline-dot.is-created {
    background: var(--neutral);
}

.timeline-dot.is-paid {
    background: var(--success);
}

.timeline-dot.is-generated {
    background: var(--primary);
}

.timeline-dot.is-reverted {
    background: var(--warning);
}

.timeline-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.timeline-text strong {
    color: var(--text-primary);
}

/* Payment confirmed banner */
.payment-confirmed {
    background: var(--success-soft);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-confirmed-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #065F46;
}

.payment-confirmed-sub {
    font-size: 0.78rem;
    color: #065F46;
}

/* ========================================
   🔗 Action Buttons (secondary)
======================================== */

.btn-action {
    font-size: 0.82rem;
    padding: 5px 14px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--neutral);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    text-decoration: none;
}

.btn-action.is-danger:hover {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-soft);
}

.btn-action.is-warning:hover {
    border-color: var(--warning);
    color: var(--warning-text);
    background: var(--warning-soft);
}

.btn-action svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.action-col .btn-action,
.action-col .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

/* ========================================
   📊 Desktop Table (Despesas)
======================================== */

.card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table th {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
}

.table td {
    font-size: 0.88rem;
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--neutral-soft);
}

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

.table tbody tr:hover td {
    background: var(--neutral-soft);
}

.table .cell-amount {
    font-weight: 600;
}

.row-open td:first-child {
    box-shadow: inset 3px 0 0 var(--primary);
}

.row-overdue td:first-child {
    box-shadow: inset 3px 0 0 var(--error);
}

.row-paid td:first-child {
    box-shadow: inset 3px 0 0 var(--success);
}

.row-stock-low td:first-child {
    box-shadow: inset 3px 0 0 var(--warning);
}

.row-stock-zero td:first-child {
    box-shadow: inset 3px 0 0 var(--error);
}

.app-password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-password-strength-bar {
    width: 220px;
    max-width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--neutral-soft);
    overflow: hidden;
    flex: 0 0 220px;
}

.app-password-strength-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--neutral);
    transition: width 0.2s ease, background-color 0.2s ease;
}

.app-password-strength-fill.is-weak {
    background: var(--neutral);
}

.app-password-strength-fill.is-medium {
    background: var(--primary);
}

.app-password-strength-fill.is-strong {
    background: var(--primary-hover);
}

.app-password-strength-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.landing-hero {
    background: linear-gradient(180deg, var(--surface) 0%, var(--primary-soft) 100%);
}

.landing-list {
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.landing-list li+li {
    margin-top: 0.35rem;
}

.landing-plan-highlight {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.landing-cta {
    background: var(--surface);
}

@media (max-width: 991.98px) {

    .app-stepper,
    .app-plan-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   🔧 OS Detail — Stepper
======================================== */

.os-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.os-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.os-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.os-step.is-done .os-step-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.os-step.is-active .os-step-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.os-step-label {
    font-size: .58rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: center;
    line-height: 1.2;
}

.os-step.is-done .os-step-label {
    color: var(--success);
    font-weight: 600;
}

.os-step.is-active .os-step-label {
    color: var(--primary);
    font-weight: 700;
}

.os-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-top: -12px;
}

.os-step-line.is-done {
    background: var(--success);
}

/* ========================================
   🔧 OS Detail — Status highlight
======================================== */

.os-status-highlight {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.os-status-label {
    font-size: .75rem;
    color: var(--text-secondary);
}

.os-status-label strong {
    display: block;
    font-size: .82rem;
    color: var(--text-primary);
}

/* ========================================
   🔧 OS Detail — Equipment block
======================================== */

.equipment-block {
    background: var(--primary-soft);
    border: 1px solid rgba(130, 10, 209, .15);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.equipment-block .eq-label {
    font-size: .72rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.equipment-block .eq-name {
    font-size: .95rem;
    font-weight: 700;
}

.equipment-block .eq-meta {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========================================
   🔧 OS Detail — Item cards (readonly)
======================================== */

.os-item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}

.os-item-card .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.os-item-card .item-name {
    font-size: .88rem;
    font-weight: 600;
    display: block;
}

.os-item-card .item-type {
    font-size: .7rem;
}

.os-item-card .item-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.os-item-card .item-qty-text {
    font-size: .82rem;
    color: var(--text-secondary);
}

.os-item-card .item-price {
    font-size: .82rem;
    color: var(--text-secondary);
}

.os-item-card .item-total {
    font-size: .92rem;
    font-weight: 700;
    margin-left: auto;
}

.os-item-card.is-readonly {
    padding: 10px 12px;
}

.os-item-card.is-readonly .item-header {
    margin-bottom: 4px;
}

/* ========================================
   🔧 OS Detail — Summary
======================================== */

.os-summary {
    background: var(--neutral-soft);
    border-radius: 10px;
    padding: 14px 16px;
}

.os-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: .88rem;
    padding: 3px 0;
}

.os-summary-row.total {
    font-weight: 700;
    font-size: .98rem;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 8px;
}

/* ========================================
   🔧 OS Detail — Checklist (readonly)
======================================== */

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--neutral-soft);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item .checklist-label {
    font-size: .86rem;
    font-weight: 500;
    flex: 1;
    padding-top: 2px;
    margin-bottom: 0;
}

.checklist-item .checklist-label.is-hidden {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hidden-badge {
    font-size: .62rem;
    background: var(--neutral-soft);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
}

.checklist-item.is-readonly .checklist-answer {
    font-size: .86rem;
    font-weight: 600;
}

.checklist-item.is-readonly .checklist-answer.is-true {
    color: var(--success);
}

.checklist-item.is-readonly .checklist-answer.is-false {
    color: var(--error);
}

/* ========================================
   🔧 OS Detail — Timeline additions
======================================== */

.timeline-dot.is-status {
    background: var(--primary);
}

.timeline-dot.is-approved {
    background: var(--success);
}

.timeline-dot.is-cancelled {
    background: var(--error);
}

.timeline-obs {
    font-size: .78rem;
    color: var(--text-primary);
    font-style: italic;
    margin-top: 2px;
    background: var(--neutral-soft);
    border-radius: 6px;
    padding: 4px 8px;
}

/* ========================================
   🔧 OS Detail — urgent badge
======================================== */

.urgent-badge {
    font-size: .62rem;
    font-weight: 700;
    background: #FFEDD5;
    color: #9A3412;
    border: 1px solid #EA580C;
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: .04em;
}

@media (max-width: 767.98px) {

    .app-form-card,
    .app-content-card,
    .app-card {
        padding: 20px;
    }

    .app-switch-item {
        flex-direction: column;
    }

    .app-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .app-form-actions .btn {
        flex: unset;
        width: 100%;
    }

    .app-wizard-actions {
        flex-direction: column-reverse;
    }

    .app-wizard-actions .btn {
        width: 100%;
    }

    .app-wizard-actions .app-btn-primary-cta {
        min-width: 0;
    }

    .app-wizard-progress {
        margin-bottom: 16px;
        max-width: 100%;
    }

    .app-wizard-mobile-track {
        display: block;
    }

    .app-stepper {
        display: none;
    }

    .app-password-strength {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .app-password-strength-bar {
        width: 100%;
        flex: 0 0 auto;
    }

}