/* ==========================================================================
   Kontrolo MZ — App shell (carregado POR ÚLTIMO no layout da app)
   - Camada única de tokens de design (cores, raios, espaçamento, tipografia)
   - Barra superior + barra de separadores no telemóvel (< 900px)
   - Componentes: card, linha de lista, botões, valor grande, chips,
     estado vazio, bottom sheet, grupos tipo "Definições"
   - Tema escuro (data-theme="escuro")
   O app.css / system.css antigos continuam carregados; aqui só se
   neutraliza o que entra em conflito (navegação antiga, fontes, espaçamentos).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    --km-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --km-font-num: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Marca */
    --km-primary: #0f8f3d;
    --km-primary-strong: #0b7331;
    --km-primary-soft: #e7f5ec;
    --km-on-primary: #ffffff;

    /* Neutros */
    --km-bg: #f4f6f5;
    --km-surface: #ffffff;
    --km-surface-2: #f0f3f1;
    --km-border: #e3e8e5;
    --km-text: #121a16;
    --km-text-2: #5b6660;
    --km-text-3: #8a948f;

    /* Estados */
    --km-success: #128a44;
    --km-success-soft: #e6f6ec;
    --km-warning: #b86e00;
    --km-warning-soft: #fff4e0;
    --km-danger: #c9362b;
    --km-danger-soft: #fdecea;
    --km-info: #2563c9;
    --km-info-soft: #e8f0fd;

    /* Raios */
    --km-radius-xs: 6px;
    --km-radius-sm: 10px;
    --km-radius-md: 14px;
    --km-radius-lg: 20px;
    --km-radius-pill: 999px;

    /* Espaçamento 4 / 8 / 12 / 16 / 24 / 32 */
    --km-space-1: 4px;
    --km-space-2: 8px;
    --km-space-3: 12px;
    --km-space-4: 16px;
    --km-space-5: 24px;
    --km-space-6: 32px;

    /* Tipografia */
    --km-text-xs: 0.75rem;   /* 12 */
    --km-text-sm: 0.875rem;  /* 14 */
    --km-text-md: 1rem;      /* 16 */
    --km-text-lg: 1.125rem;  /* 18 */
    --km-text-xl: 1.375rem;  /* 22 */
    --km-text-2xl: 2rem;     /* 32 */

    /* Sombra e movimento */
    --km-shadow-1: 0 1px 2px rgba(16, 24, 20, 0.06), 0 1px 1px rgba(16, 24, 20, 0.04);
    --km-shadow-2: 0 8px 24px rgba(16, 24, 20, 0.12);
    --km-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --km-dur: 180ms;

    /* Chrome */
    --km-touch: 48px;
    --km-appbar-h: 56px;
    --km-tabbar-h: 64px;
    --km-safe-top: env(safe-area-inset-top, 0px);
    --km-safe-bottom: env(safe-area-inset-bottom, 0px);
    --km-safe-left: env(safe-area-inset-left, 0px);
    --km-safe-right: env(safe-area-inset-right, 0px);
}

html[data-theme="escuro"],
body.km-app[data-theme="escuro"] {
    color-scheme: dark;
    --km-primary: #2fbf68;
    --km-primary-strong: #25a457;
    --km-primary-soft: rgba(47, 191, 104, 0.16);
    --km-on-primary: #04130a;
    --km-bg: #0b1210;
    --km-surface: #141d1a;
    --km-surface-2: #1c2723;
    --km-border: #26332e;
    --km-text: #e9efec;
    --km-text-2: #a7b3ad;
    --km-text-3: #7a8780;
    --km-success: #3ccf78;
    --km-success-soft: rgba(60, 207, 120, 0.14);
    --km-warning: #f0a83a;
    --km-warning-soft: rgba(240, 168, 58, 0.14);
    --km-danger: #ff6b5f;
    --km-danger-soft: rgba(255, 107, 95, 0.14);
    --km-info: #6ea2ff;
    --km-info-soft: rgba(110, 162, 255, 0.14);
    --km-shadow-1: none;
    --km-shadow-2: 0 10px 28px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
html body.km-app {
    --km-ios-font: var(--km-font);
    font-family: var(--km-font);
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

html body.km-app :is(button, input, select, textarea) {
    font-family: inherit;
}

html body.km-app .km-dashboard-v2,
html body.km-app .km-dashboard-v2 .km-axis-label {
    font-family: var(--km-font);
}

/* Cromo da navegação: sem seleção de texto nem realce ao tocar */
.km-appbar,
.km-tabbar,
.km-sheet-head,
.km-quick,
.sidebar {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.km-page,
.km-sheet .km-list {
    -webkit-user-select: text;
    user-select: text;
}

/* Valores numéricos alinhados */
.km-hero-amount,
.km-row-amount,
.km-amount-input input {
    font-variant-numeric: tabular-nums;
}

/* Barra superior e separadores escondidos por omissão (desktop) */
.km-appbar,
.km-tabbar {
    display: none;
}

/* --------------------------------------------------------------------------
   3. Componentes
   -------------------------------------------------------------------------- */

/* Card */
.km-card {
    display: block;
    padding: var(--km-space-4);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    color: var(--km-text);
    box-shadow: var(--km-shadow-1);
}

/* Títulos de página e secção */
.km-page-title {
    margin: 0 0 var(--km-space-4);
    color: var(--km-text);
    font-size: var(--km-text-xl);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.km-section {
    margin-top: var(--km-space-5);
}

.km-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--km-space-3);
    margin: 0 var(--km-space-1) var(--km-space-2);
}

.km-section-head h2 {
    margin: 0;
    color: var(--km-text);
    font-size: var(--km-text-md);
    font-weight: 700;
}

.km-section-head a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--km-primary);
    font-size: var(--km-text-sm);
    font-weight: 600;
    text-decoration: none;
}

/* Lista agrupada (estilo Definições) */
.km-list-group {
    margin-top: var(--km-space-5);
}

.km-list-title {
    margin: 0 var(--km-space-4) var(--km-space-2);
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.km-list {
    overflow: hidden;
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    box-shadow: var(--km-shadow-1);
}

/* Linha de lista: ícone · título/subtítulo · valor à direita */
html body .km-row {
    display: flex;
    align-items: center;
    gap: var(--km-space-3);
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: var(--km-space-2) var(--km-space-4);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--km-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}

html body div.km-row {
    cursor: default;
}

.km-list > .km-row + .km-row,
.km-list > .km-row + .km-row-form,
.km-list > .km-row-form + .km-row,
.km-list > .km-row-form + .km-row-form {
    border-top: 1px solid var(--km-border);
}

.km-row-form {
    display: block;
    margin: 0;
}

a.km-row:active,
button.km-row:active {
    background: var(--km-surface-2);
}

.km-row-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--km-radius-sm);
    background: var(--km-primary-soft);
    color: var(--km-primary);
}

.km-row-icon .nav-svg,
.km-row-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.km-row-icon.is-income { background: var(--km-success-soft); color: var(--km-success); }
.km-row-icon.is-expense { background: var(--km-danger-soft); color: var(--km-danger); }
.km-row-icon.is-danger { background: var(--km-danger-soft); color: var(--km-danger); }
.km-row-icon.is-warning { background: var(--km-warning-soft); color: var(--km-warning); }
.km-row-icon.is-info { background: var(--km-info-soft); color: var(--km-info); }

.km-row-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.km-row-main strong {
    overflow: hidden;
    color: var(--km-text);
    font-size: var(--km-text-md);
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.km-row-main small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.km-row-amount {
    flex: 0 0 auto;
    color: var(--km-text);
    font-size: var(--km-text-md);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.km-row-amount.is-income { color: var(--km-success); }
.km-row-amount.is-expense { color: var(--km-text); }

.km-row-chevron {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--km-text-3);
}

.km-row-chevron .nav-svg,
.km-row-chevron svg {
    width: 18px;
    height: 18px;
}

.km-row-danger .km-row-main strong,
.km-row-danger .km-row-icon {
    color: var(--km-danger);
}

.km-row-danger .km-row-icon {
    background: var(--km-danger-soft);
}

.km-row.is-locked .km-row-main strong {
    color: var(--km-text-2);
}

html body:not(#km-boost) .km-row-badge,
html body:not(#km-boost) .km-tab-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 0;
    border-radius: var(--km-radius-pill);
    background: var(--km-danger);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.km-row-badge[hidden],
.km-tab-badge[hidden] {
    display: none !important;
}

/* Pequeno selo (ex.: "Plano") */
.km-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--km-radius-pill);
    background: var(--km-warning-soft);
    color: var(--km-warning);
    font-size: 11px;
    font-weight: 700;
}

/* Botões */
.km-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--km-space-2);
    min-height: var(--km-touch);
    padding: 0 var(--km-space-5);
    border: 1px solid transparent;
    border-radius: var(--km-radius-md);
    font: inherit;
    font-size: var(--km-text-md);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--km-dur) var(--km-ease), transform var(--km-dur) var(--km-ease);
}

.km-btn:active { transform: scale(0.98); }

.km-btn-primary {
    background: var(--km-primary);
    color: var(--km-on-primary);
}

.km-btn-primary:active { background: var(--km-primary-strong); }

.km-btn-secondary {
    border-color: var(--km-border);
    background: var(--km-surface);
    color: var(--km-text);
}

.km-btn-block { width: 100%; }

/* Valor grande (input de montante) */
.km-amount-input {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--km-space-2);
    padding: var(--km-space-5) var(--km-space-4);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
}

.km-amount-input input {
    width: 100%;
    max-width: 12ch;
    border: 0;
    background: transparent;
    color: var(--km-text);
    font-size: var(--km-text-2xl);
    font-weight: 700;
    text-align: center;
    outline: none;
}

.km-amount-input span {
    color: var(--km-text-2);
    font-size: var(--km-text-lg);
    font-weight: 600;
}

/* Chips */
.km-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--km-space-2);
    min-height: 32px;
    padding: 0 var(--km-space-3);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-pill);
    background: var(--km-surface);
    color: var(--km-text);
    font-size: var(--km-text-sm);
    font-weight: 600;
    text-decoration: none;
}

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

.km-chip-trial {
    margin-bottom: var(--km-space-3);
    border-color: transparent;
    background: var(--km-warning-soft);
    color: var(--km-warning);
}

.km-chip-trial span {
    text-decoration: underline;
}

/* Estado vazio */
.km-empty {
    display: grid;
    justify-items: center;
    gap: var(--km-space-2);
    padding: var(--km-space-6) var(--km-space-4);
    border: 1px dashed var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    text-align: center;
}

.km-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--km-primary-soft);
    color: var(--km-primary);
}

.km-empty-icon .nav-svg,
.km-empty-icon svg { width: 24px; height: 24px; }

.km-empty strong { color: var(--km-text); font-size: var(--km-text-md); }
.km-empty small { max-width: 32ch; color: var(--km-text-2); font-size: var(--km-text-sm); }
.km-empty .km-btn { margin-top: var(--km-space-2); }

/* Bottom sheet */
.km-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(8, 14, 11, 0.45);
    animation: km-fade-in var(--km-dur) var(--km-ease);
}

.km-sheet-backdrop[hidden] { display: none; }

.km-sheet {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--km-space-2) var(--km-space-4) calc(var(--km-space-5) + var(--km-safe-bottom));
    border-radius: var(--km-radius-lg) var(--km-radius-lg) 0 0;
    background: var(--km-bg);
    color: var(--km-text);
    box-shadow: var(--km-shadow-2);
    animation: km-sheet-up 240ms var(--km-ease);
}

.km-sheet-handle {
    width: 36px;
    height: 5px;
    margin: 0 auto var(--km-space-3);
    border-radius: var(--km-radius-pill);
    background: var(--km-border);
}

.km-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.km-sheet-head h2 {
    margin: 0;
    color: var(--km-text);
    font-size: var(--km-text-lg);
}

.km-sheet-close {
    width: var(--km-touch);
    height: var(--km-touch);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--km-text-2);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.km-sheet .km-list-group:first-of-type { margin-top: var(--km-space-3); }

/* --------------------------------------------------------------------------
   4. Início (pessoal e negócio)
   -------------------------------------------------------------------------- */
.km-home {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    color: var(--km-text);
}

.km-home-business > .km-home {
    padding: 0;
}

/* Hero: "Podes gastar hoje" / "Vendas de hoje" */
.km-hero {
    position: relative;
    padding: var(--km-space-5) var(--km-space-4) var(--km-space-4);
    border-radius: var(--km-radius-lg);
    background: var(--km-primary);
    color: var(--km-on-primary);
    box-shadow: var(--km-shadow-1);
}

.km-hero.is-warning {
    background: var(--km-warning);
    color: #ffffff;
}

.km-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.km-hero-label {
    font-size: var(--km-text-sm);
    font-weight: 600;
    opacity: 0.9;
}

html body .km-hero-eye {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: -8px -8px -8px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.km-hero-eye .nav-svg,
.km-hero-eye svg { width: 22px; height: 22px; }

.km-hero-amount {
    display: block;
    margin-top: var(--km-space-1);
    font-size: 2.25rem;
    font-size: clamp(2rem, 9vw, 2.5rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.km-hero-hint {
    margin: var(--km-space-2) 0 0;
    font-size: var(--km-text-sm);
    line-height: 1.4;
    opacity: 0.92;
}

.km-hero-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--km-space-3);
    margin-top: var(--km-space-4);
    padding-top: var(--km-space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.km-hero-foot small {
    display: block;
    font-size: var(--km-text-xs);
    opacity: 0.85;
}

.km-hero-foot strong {
    display: block;
    margin-top: 2px;
    font-size: var(--km-text-md);
    font-weight: 700;
}

/* Ações rápidas */
.km-quick {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: var(--km-space-2);
    margin-top: var(--km-space-4);
}

html body .km-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--km-space-2);
    min-height: 80px;
    padding: var(--km-space-3) var(--km-space-1);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface);
    color: var(--km-text);
    font: inherit;
    text-decoration: none;
    box-shadow: var(--km-shadow-1);
    cursor: pointer;
}

.km-quick-item:active { background: var(--km-surface-2); }

.km-quick-item b {
    overflow: hidden;
    max-width: 100%;
    font-size: var(--km-text-sm);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.km-quick-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--km-primary-soft);
    color: var(--km-primary);
}

.km-quick-icon.is-primary { background: var(--km-primary); color: var(--km-on-primary); }
.km-quick-icon.is-income { background: var(--km-success-soft); color: var(--km-success); }
.km-quick-icon.is-expense { background: var(--km-danger-soft); color: var(--km-danger); }

.km-quick-icon .nav-svg,
.km-quick-icon svg { width: 22px; height: 22px; }

/* Ligação "Ver relatórios" */
.km-link-row {
    display: flex;
    align-items: center;
    gap: var(--km-space-3);
    min-height: var(--km-touch);
    margin-top: var(--km-space-5);
    padding: 0 var(--km-space-4);
    border-radius: var(--km-radius-md);
    background: var(--km-primary-soft);
    color: var(--km-primary);
    font-weight: 600;
    text-decoration: none;
}

.km-link-row span { flex: 1 1 auto; }
.km-link-row .nav-svg,
.km-link-row svg { width: 20px; height: 20px; }

/* Secções recolhíveis "Ver mais" */
.km-disclosure {
    margin-top: var(--km-space-3);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
}

.km-disclosure > summary {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
    padding: var(--km-space-2) 48px var(--km-space-2) var(--km-space-4);
    color: var(--km-text);
    list-style: none;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.km-disclosure > summary::-webkit-details-marker { display: none; }

.km-disclosure > summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 20px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--km-text-3);
    border-bottom: 2px solid var(--km-text-3);
    transform: translateY(-70%) rotate(45deg);
    transition: transform var(--km-dur) var(--km-ease);
}

.km-disclosure[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }

.km-disclosure > summary span {
    font-size: var(--km-text-md);
    font-weight: 600;
}

.km-disclosure > summary small {
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
}

/* Blocos antigos dentro do "Ver mais": neutraliza fundos e alturas do painel antigo */
html body .km-dashboard-v2.km-home-legacy {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--km-space-3);
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0 var(--km-space-3) var(--km-space-3);
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html body .km-home-legacy > * {
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

/* --------------------------------------------------------------------------
   5. Página "Mais"
   -------------------------------------------------------------------------- */
.km-more {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

html body .km-profile-card {
    display: flex;
    align-items: center;
    gap: var(--km-space-3);
    min-height: 72px;
    text-decoration: none;
}

.km-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--km-primary);
    color: var(--km-on-primary);
    font-size: var(--km-text-lg);
    font-weight: 700;
}

.km-more-foot {
    margin: var(--km-space-5) 0 0;
    color: var(--km-text-3);
    font-size: var(--km-text-xs);
    text-align: center;
}

/* --------------------------------------------------------------------------
   6. Desktop (>= 900px): menu lateral mais limpo
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
    html body.km-app .km-more .km-page-title,
    html body.km-app .km-home .km-page-title {
        display: none;
    }

    .km-side-nav .km-side-group > summary {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 40px;
        padding: 0 12px;
        border-radius: var(--km-radius-sm);
        color: inherit;
        font-weight: 600;
        list-style: none;
        cursor: pointer;
    }

    .km-side-nav .km-side-group > summary::-webkit-details-marker { display: none; }

    .km-side-nav .km-side-group > a {
        padding-left: 28px;
    }

    .km-home {
        padding-top: var(--km-space-2);
    }
}

/* --------------------------------------------------------------------------
   7. Telemóvel (< 900px): app shell
   -------------------------------------------------------------------------- */
@media (max-width: 899.98px) {
    html body.km-app:not(#km-boost) {
        min-height: 100vh;
        min-height: 100dvh;
        background: var(--km-bg);
    }

    /* Esconde a navegação antiga (sidebar, navbar, menus e barras por página) */
    html body.km-app:not(#km-boost) .sidebar,
    html body.km-app:not(#km-boost) .navbar,
    html body.km-app:not(#km-boost) .mobile-menu,
    html body.km-app:not(#km-boost) .floating-add,
    html body.km-app:not(#km-boost) .phone-bottom-nav,
    html body.km-app:not(#km-boost) .km-bottom-nav,
    html body.km-app:not(#km-boost) .km-dashboard-toolbar,
    html body.km-app:not(#km-boost) .km-proto-topbar,
    html body.km-app:not(#km-boost) .km-hamburger,
    html body.km-app:not(#km-boost) .phone-header-actions,
    html body.km-app:not(#km-boost) .merchant-bottom-nav,
    html body.km-app:not(#km-boost) .merchant-account-nav {
        display: none !important;
    }

    html body.km-app:not(#km-boost) .app-shell {
        display: block !important;
        min-height: 0;
        background: transparent;
    }

    html body.km-app:not(#km-boost) .main-shell {
        width: 100%;
        min-height: 0;
        margin: 0;
        background: transparent;
    }

    html body.km-app:not(#km-boost) .main-shell > .content,
    html body.km-app.has-phone-dashboard:not(#km-boost) .main-shell > .content {
        display: block;
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 72px 16px 96px;
        padding:
            calc(var(--km-appbar-h) + var(--km-safe-top) + var(--km-space-4))
            calc(var(--km-space-4) + var(--km-safe-right))
            calc(var(--km-tabbar-h) + var(--km-safe-bottom) + var(--km-space-6))
            calc(var(--km-space-4) + var(--km-safe-left));
        background: transparent;
    }

    /* Páginas antigas em "telemóvel simulado": ocupam a largura toda */
    html body.km-app:not(#km-boost) .content > .phone-dashboard,
    html body.km-app:not(#km-boost) .phone-dashboard {
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }

    html body.km-app:not(#km-boost) .phone-bottom-space {
        display: none;
    }

    /* Avisos flash por baixo da barra superior */
    html body.km-app.has-phone-dashboard:not(#km-boost) .content > .alert {
        top: calc(var(--km-appbar-h) + var(--km-safe-top) + 8px);
    }

    /* Barra superior */
    html body.km-app:not(#km-boost) .km-appbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 90;
        display: block;
        padding: var(--km-safe-top) var(--km-safe-right) 0 var(--km-safe-left);
        background: var(--km-primary);
        color: var(--km-on-primary);
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    }

    .km-appbar-inner {
        display: flex;
        align-items: center;
        gap: var(--km-space-1);
        height: var(--km-appbar-h);
        padding: 0 var(--km-space-1) 0 var(--km-space-4);
    }

    .km-appbar-back + .km-appbar-title {
        margin-left: calc(var(--km-space-1) * -1);
    }

    .km-appbar:has(.km-appbar-back) .km-appbar-inner {
        padding-left: var(--km-space-1);
    }

    html body:not(#km-boost) .km-appbar-title {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        margin: 0;
        color: inherit;
        font-size: var(--km-text-lg);
        font-weight: 650;
        line-height: 1.2;
        letter-spacing: 0;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .km-appbar-actions {
        display: flex;
        flex: 0 0 auto;
        min-width: var(--km-touch);
        align-items: center;
    }

    html body:not(#km-boost) .km-appbar-btn {
        position: relative;
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: var(--km-touch);
        height: var(--km-touch);
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: inherit;
        box-shadow: none;
        text-decoration: none;
    }

    .km-appbar-btn:active { background: rgba(255, 255, 255, 0.16); }

    .km-appbar-btn .nav-svg,
    .km-appbar-btn svg {
        display: block;
        width: 24px;
        height: 24px;
        color: inherit;
    }

    html body:not(#km-boost) .km-appbar-bell .notification-badge {
        position: absolute;
        top: 6px;
        right: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border: 2px solid var(--km-primary);
        border-radius: var(--km-radius-pill);
        background: var(--km-danger);
        color: #ffffff;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
    }

    html body:not(#km-boost) .km-appbar-bell .notification-badge[hidden] { display: none; }

    /* Barra de separadores */
    html body.km-app:not(#km-boost) .km-tabbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        height: calc(var(--km-tabbar-h) + var(--km-safe-bottom));
        padding: 0 var(--km-safe-right) var(--km-safe-bottom) var(--km-safe-left);
        border-top: 1px solid var(--km-border);
        background: var(--km-surface);
        box-shadow: 0 -2px 12px rgba(16, 24, 20, 0.05);
    }

    html body:not(#km-boost) .km-tab {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        min-height: var(--km-touch);
        margin: 0;
        padding: 6px 2px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--km-text-2);
        font: inherit;
        text-decoration: none;
        box-shadow: none;
        cursor: pointer;
    }

    .km-tab-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 28px;
        border-radius: var(--km-radius-pill);
        transition: background-color var(--km-dur) var(--km-ease);
    }

    .km-tab-icon .nav-svg,
    .km-tab-icon svg {
        display: block;
        width: 24px;
        height: 24px;
    }

    .km-tab-label {
        overflow: hidden;
        max-width: 100%;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .km-tab.is-active {
        color: var(--km-primary);
    }

    .km-tab.is-active .km-tab-icon {
        background: var(--km-primary-soft);
    }

    .km-tab.is-locked { opacity: 0.55; }

    html body:not(#km-boost) .km-tab-icon .km-tab-badge {
        position: absolute;
        top: -4px;
        right: 6px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border: 2px solid var(--km-surface);
        font-size: 10px;
    }

    /* Botão central ＋ elevado */
    .km-tab-primary {
        color: var(--km-text-2);
    }

    .km-tab-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        margin-top: -22px;
        border: 4px solid var(--km-surface);
        border-radius: 50%;
        background: var(--km-primary);
        color: var(--km-on-primary);
        box-shadow: 0 6px 16px rgba(15, 143, 61, 0.35);
        transition: transform var(--km-dur) var(--km-ease);
    }

    .km-tab-primary:active .km-tab-fab { transform: scale(0.94); }

    .km-tab-fab .nav-svg,
    .km-tab-fab svg {
        width: 26px;
        height: 26px;
        stroke-width: 2.4;
    }

    /* Esconde a barra quando o teclado está aberto num formulário */
    body.km-keyboard-open .km-tabbar {
        display: none !important;
    }

    /* Toques confortáveis em controlos de formulário */
    html body.km-app:not(#km-boost) .content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
        font-size: max(16px, 1em); /* evita zoom automático no iOS */
    }

    html body.km-app:not(#km-boost) .content :is(.button, button[type="submit"]) {
        min-height: 44px;
    }

    /* Modais acima da barra de separadores e respeitando a área segura */
    html body.km-app:not(#km-boost) .app-modal {
        max-height: calc(100dvh - var(--km-safe-top) - 24px);
    }

    /* Modal "O que queres fazer?" (botão ＋) como bottom sheet */
    html body.km-app:not(#km-boost) .quick-action-backdrop:not([hidden]) {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    html body.km-app:not(#km-boost) .quick-action-modal {
        width: 100%;
        max-width: 560px;
        margin: 0;
        border-radius: var(--km-radius-lg) var(--km-radius-lg) 0 0;
        padding-bottom: calc(var(--km-space-5) + var(--km-safe-bottom));
        animation: km-sheet-up 240ms var(--km-ease);
    }

    /* Início no telemóvel */
    .km-home .km-page-title { display: none; }

    .km-more .km-page-title { display: none; }

    .km-more .km-profile-card { margin-top: 0; }
}

/* Ecrãs muito estreitos */
@media (max-width: 360px) {
    .km-tab-label { font-size: 10px; }
    .km-tab-icon { width: 44px; }
    .km-quick-item b { font-size: var(--km-text-xs); }
}

/* --------------------------------------------------------------------------
   8. Tema escuro (cromo e componentes novos; blocos antigos mantêm cartões claros)
   -------------------------------------------------------------------------- */
html[data-theme="escuro"] body.km-app:not(#km-boost) {
    background: var(--km-bg);
    color: var(--km-text);
}

@media (max-width: 899.98px) {
    html[data-theme="escuro"] body.km-app:not(#km-boost) .km-appbar {
        background: var(--km-surface);
        color: var(--km-text);
        box-shadow: 0 1px 0 var(--km-border);
    }

    html[data-theme="escuro"] body.km-app:not(#km-boost) .km-appbar-bell .notification-badge {
        border-color: var(--km-surface);
    }

    html[data-theme="escuro"] .km-appbar-btn:active { background: var(--km-surface-2); }
}

@media (min-width: 900px) {
    html[data-theme="escuro"] body.km-app :is(.app-shell, .main-shell) {
        background: var(--km-bg);
    }
}

html[data-theme="escuro"] .km-hero {
    background: linear-gradient(160deg, #136b35, #0d4f27);
    color: #ffffff;
}

html[data-theme="escuro"] .km-hero.is-warning {
    background: linear-gradient(160deg, #8a5200, #6b3f00);
}

html[data-theme="escuro"] .km-tab-fab {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   9. Movimento
   -------------------------------------------------------------------------- */
@keyframes km-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes km-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes km-page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes km-rise-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Entrada de página: fade no conteúdo; leve subida só nos blocos do Início/Mais
   (sem transformar .content, para não afetar modais com position: fixed) */
.km-page {
    animation: km-page-in 200ms var(--km-ease) backwards;
}

.km-home > *,
.km-more > * {
    animation: km-rise-in 260ms var(--km-ease) backwards;
}

.km-home > :nth-child(2),
.km-more > :nth-child(2) { animation-delay: 30ms; }
.km-home > :nth-child(3),
.km-more > :nth-child(3) { animation-delay: 60ms; }
.km-home > :nth-child(n + 4),
.km-more > :nth-child(n + 4) { animation-delay: 90ms; }

@media (prefers-reduced-motion: reduce) {
    html body.km-app *,
    html body.km-app *::before,
    html body.km-app *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Foco visível para teclado */
.km-row:focus-visible,
.km-tab:focus-visible,
.km-quick-item:focus-visible,
.km-appbar-btn:focus-visible,
.km-btn:focus-visible,
.km-disclosure > summary:focus-visible {
    outline: 3px solid var(--km-primary);
    outline-offset: -3px;
}

/* ==========================================================================
   10. Ponte para os ecrãs antigos (legacy bridge)
   Reestiliza as classes antigas de app.css / system.css com os tokens acima,
   para que todos os ecrãs interiores pareçam a mesma app (claro e escuro).
   Âmbito: body.km-ui (layouts app, auth, caixa, onboarding). O ":not(#km-boost)"
   dá peso de ID para vencer os seletores antigos sem usar !important.
   ========================================================================== */

/* 10.1 Variáveis antigas apontam para os tokens novos */
html body.km-ui:not(#km-boost) {
    --km-input-border: #cfd8d3;
    --km-focus-ring: 0 0 0 3px rgba(15, 143, 61, 0.22);
    --bg: var(--km-bg);
    --surface: var(--km-surface);
    --surface-soft: var(--km-surface-2);
    --text: var(--km-text);
    --muted: var(--km-text-2);
    --line: var(--km-border);
    --primary: var(--km-primary);
    --primary-dark: var(--km-primary-strong);
    --primary-soft: var(--km-primary-soft);
    --sys-bg: var(--km-bg);
    --sys-surface: var(--km-surface);
    --sys-border: var(--km-border);
    --sys-border-strong: var(--km-input-border);
    --sys-text: var(--km-text);
    --sys-muted: var(--km-text-2);
    --sys-faint: var(--km-text-3);
    --sys-primary: var(--km-primary);
    --sys-primary-strong: var(--km-primary-strong);
    --sys-primary-soft: var(--km-primary-soft);
    --sys-radius: var(--km-radius-sm);
    --sys-radius-lg: var(--km-radius-lg);
    --sys-shadow: var(--km-shadow-1);
    --km-ios-bg: var(--km-bg);
    --km-ios-surface: var(--km-surface);
    --km-ios-surface-solid: var(--km-surface);
    --km-ios-label: var(--km-text);
    --km-ios-secondary: var(--km-text-2);
    --km-ios-separator: var(--km-border);
    --km-ios-green: var(--km-primary);
    --km-ios-green-strong: var(--km-primary-strong);
    --card-bg: var(--km-surface);
}

html[data-theme="escuro"] body.km-ui:not(#km-boost) {
    --km-input-border: #34443d;
    --km-focus-ring: 0 0 0 3px rgba(47, 191, 104, 0.28);
}

/* 10.2 Cabeçalho de página: sem cartão, alinhado à esquerda */
.km-ui:not(#km-boost) :is(.page-header, .phone-dashboard-header, .merchant-header) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--km-space-3);
    min-height: 0;
    margin: 0 0 var(--km-space-4);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--km-text);
    text-align: left;
}

.km-ui:not(#km-boost) :is(.page-header, .phone-dashboard-header)::before,
.km-ui:not(#km-boost) :is(.page-header, .phone-dashboard-header)::after {
    display: none;
}

.km-ui:not(#km-boost) :is(.page-header, .phone-dashboard-header, .merchant-header) > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    text-align: left;
}

.km-ui:not(#km-boost) :is(.page-header, .phone-dashboard-header, .merchant-header) > div:first-child > * {
    text-align: left;
}

.km-ui:not(#km-boost) .page-header > div:first-child > p:not(.eyebrow) {
    margin: var(--km-space-1) 0 0;
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    line-height: 1.4;
}

.km-ui:not(#km-boost) :is(.page-header, .phone-dashboard-header, .merchant-header) h1 {
    margin: 2px 0 0;
    color: var(--km-text);
    font-size: var(--km-text-xl);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.km-ui:not(#km-boost) :is(.page-header .eyebrow, .phone-dashboard-header > div > p:first-child) {
    margin: 0;
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.km-ui:not(#km-boost) :is(.header-actions, .notification-actions) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--km-space-2);
    width: auto;
    margin: 0;
}

/* Sobretítulo genérico */
.km-ui:not(#km-boost) main .eyebrow {
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* 10.3 Ecrãs "phone-dashboard": sem faixa verde, conteúdo em coluna */
.km-ui:not(#km-boost) .phone-dashboard {
    min-height: 0;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

.km-ui:not(#km-boost) .phone-dashboard-bg,
.km-ui:not(#km-boost) .phone-bottom-space {
    display: none;
}

.km-ui:not(#km-boost) .phone-dashboard-content {
    position: static;
    display: flex;
    flex-direction: column;
    gap: var(--km-space-4);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.km-ui:not(#km-boost) .phone-dashboard-content > * {
    margin-top: 0;
    margin-bottom: 0;
}

.km-ui:not(#km-boost) .phone-dashboard-content > .phone-dashboard-header {
    margin-bottom: calc(var(--km-space-1) * -1);
}

/* Cartão de resumo (saldo / total) */
.km-ui:not(#km-boost) :is(.phone-balance-card, .business-hero-card) {
    position: relative;
    margin: 0;
    padding: var(--km-space-5) var(--km-space-4) var(--km-space-4);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    box-shadow: var(--km-shadow-1);
    color: var(--km-text);
}

.km-ui:not(#km-boost) .phone-balance-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--km-space-3);
}

.km-ui:not(#km-boost) .phone-balance-top > div:first-child {
    min-width: 0;
}

.km-ui:not(#km-boost) .phone-balance-top > div:first-child > :is(p, span):first-child {
    display: block;
    margin: 0;
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.km-ui:not(#km-boost) .phone-balance-top strong {
    display: block;
    margin-top: var(--km-space-1);
    color: var(--km-text);
    font-size: 2rem;
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.km-ui:not(#km-boost) .phone-balance-top small {
    display: block;
    margin-top: var(--km-space-2);
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    line-height: 1.4;
}

.km-ui:not(#km-boost) .phone-balance-top > button,
.km-ui:not(#km-boost) .phone-main-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--km-primary-soft);
    color: var(--km-primary);
    box-shadow: none;
}

.km-ui:not(#km-boost) .phone-main-icon.danger { background: var(--km-danger-soft); color: var(--km-danger); }
.km-ui:not(#km-boost) .phone-main-icon :is(svg, .nav-svg),
.km-ui:not(#km-boost) .phone-balance-top > button :is(svg, .nav-svg) { width: 20px; height: 20px; }

.km-ui:not(#km-boost) :is(.phone-income-expense, .phone-balance-reality, .xitique-total-card .phone-income-expense) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--km-space-2);
    margin-top: var(--km-space-4);
    padding: 0;
    border: 0;
    background: none;
}

.km-ui:not(#km-boost) :is(.phone-income-expense, .phone-balance-reality) > :is(div, span, a) {
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--km-radius-md);
    background: var(--km-surface-2);
    color: var(--km-text);
    text-decoration: none;
}

.km-ui:not(#km-boost) :is(.phone-income-expense, .phone-balance-reality) :is(span, small, p) {
    display: block;
    margin: 0;
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.km-ui:not(#km-boost) :is(.phone-income-expense, .phone-balance-reality) :is(strong, b) {
    display: block;
    margin-top: 2px;
    color: var(--km-text);
    font-size: var(--km-text-md);
    font-weight: 700;
}

/* 10.4 Ações rápidas antigas = .km-quick */
.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) {
    display: grid;
    grid-auto-columns: minmax(76px, 1fr);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: var(--km-space-2);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--km-space-2);
    min-width: 0;
    min-height: 80px;
    margin: 0;
    padding: var(--km-space-3) var(--km-space-1);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface);
    color: var(--km-text);
    font: inherit;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--km-shadow-1);
    cursor: pointer;
}

.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid)::-webkit-scrollbar { display: none; }
.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button) { scroll-snap-align: start; }
.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button):active { background: var(--km-surface-2); }

.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button) > :is(.nav-svg, .phone-icon, svg, i) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 9px;
    border-radius: 50%;
    background: var(--km-primary-soft);
    color: var(--km-primary);
}

.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button) > :is(.nav-svg, .phone-icon) svg { width: 22px; height: 22px; }

.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button) > :is(span, b, strong):not(.nav-svg):not(.phone-icon) {
    overflow: hidden;
    max-width: 100%;
    color: var(--km-text);
    font-size: var(--km-text-xs);
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.km-ui:not(#km-boost) :is(.phone-quick-actions, .business-action-grid) > :is(a, button) > small {
    display: none;
}

/* 10.5 Cartões / painéis */
.km-ui:not(#km-boost) :is(.panel, .phone-panel, .business-panel, .app-panel, .form-panel, .xitique-panel, .debt-panel, .merchant-card, .crm-card, .guide-card, .report-flow-panel, .history-toolbar, .notification-test-panel, .plan-support-card, .expense-clarity-card, .quick-sale-panel, .cashier-movements-panel, .business-rankings-panel, .report-expenses-panel, .wallet-phone-panel, .debt-contact-panel) {
    margin: 0;
    padding: var(--km-space-4);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    background-image: none;
    box-shadow: var(--km-shadow-1);
    color: var(--km-text);
}

/* Guia de três passos no topo de alguns ecrãs */
.km-ui:not(#km-boost) .flow-guide {
    display: grid;
    gap: var(--km-space-2);
    margin: 0 0 var(--km-space-4);
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.km-ui:not(#km-boost) .flow-guide .guide-card {
    padding: var(--km-space-3);
    border-radius: var(--km-radius-md);
    font-size: var(--km-text-sm);
    line-height: 1.4;
}

.km-ui:not(#km-boost) .flow-guide .guide-card :is(span, small, p) { color: var(--km-text-2); }
.km-ui:not(#km-boost) .flow-guide .guide-card :is(strong, b) { color: var(--km-text); }

/* painel dentro de painel: sem moldura dupla */
.km-ui:not(#km-boost) :is(.panel, .phone-panel, .business-panel) :is(.panel, .phone-panel, .business-panel) {
    padding: 0;
    border: 0;
    box-shadow: none;
}

.km-ui:not(#km-boost) main > :is(.panel, .phone-panel, .business-panel, .app-panel, .form-panel, section) + :is(.panel, .phone-panel, .business-panel, .app-panel, .form-panel, section) {
    margin-top: var(--km-space-4);
}

/* Cabeçalho de secção dentro do cartão */
.km-ui:not(#km-boost) :is(.phone-section-head, .panel-header, .app-panel-head, .app-section-head, .crm-card-head) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--km-space-3);
    margin: 0 0 var(--km-space-3);
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

.km-ui:not(#km-boost) :is(.phone-section-head, .panel-header, .app-panel-head, .app-section-head, .crm-card-head)::after { display: none; }

.km-ui:not(#km-boost) :is(.phone-section-head, .panel-header, .app-panel-head, .app-section-head, .crm-card-head) :is(h2, h3) {
    margin: 0;
    color: var(--km-text);
    font-size: var(--km-text-lg);
    font-weight: 700;
    line-height: 1.3;
}

.km-ui:not(#km-boost) :is(.phone-section-head, .panel-header, .app-panel-head, .app-section-head, .crm-card-head) p:not(.eyebrow) {
    margin: 2px 0 0;
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    line-height: 1.4;
}

.km-ui:not(#km-boost) :is(.phone-section-head, .panel-header) > :is(span, b, strong, small):last-child:not(:first-child) {
    flex: 0 0 auto;
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
}

/* Títulos soltos dentro de cartões */
.km-ui:not(#km-boost) :is(.panel, .phone-panel, .business-panel, .merchant-card, .app-panel) > :is(h2, h3) {
    color: var(--km-text);
    font-size: var(--km-text-lg);
    font-weight: 700;
}

/* Herói antigo (Saúde financeira / Conselhos) = .km-hero */
.km-ui:not(#km-boost) .dashboard-hero {
    position: relative;
    display: grid;
    gap: var(--km-space-4);
    margin: 0 0 var(--km-space-4);
    padding: var(--km-space-5) var(--km-space-4) var(--km-space-4);
    border: 0;
    border-radius: var(--km-radius-lg);
    background: linear-gradient(160deg, var(--km-primary), var(--km-primary-strong));
    box-shadow: var(--km-shadow-1);
    color: #ffffff;
    overflow: hidden;
}

.km-ui:not(#km-boost) .dashboard-hero::before,
.km-ui:not(#km-boost) .dashboard-hero::after { display: none; }

.km-ui:not(#km-boost) .dashboard-hero :is(h1, h2, strong, p, span, small, .eyebrow) { color: #ffffff; }
.km-ui:not(#km-boost) .dashboard-hero .eyebrow { opacity: 0.85; }
.km-ui:not(#km-boost) .dashboard-hero h1 { margin: 2px 0 0; font-size: var(--km-text-lg); font-weight: 700; }
.km-ui:not(#km-boost) .dashboard-hero > div:first-child > strong {
    display: block;
    margin-top: var(--km-space-1);
    font-size: 2.5rem;
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.km-ui:not(#km-boost) .dashboard-hero > div:first-child > p:not(.eyebrow) { font-size: var(--km-text-sm); line-height: 1.45; opacity: 0.92; }

.km-ui:not(#km-boost) .dashboard-hero .hero-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--km-space-3);
    min-height: 0;
    padding: var(--km-space-3) 0 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: var(--km-text-sm);
    font-weight: 600;
}

.km-ui:not(#km-boost) .dashboard-hero .hero-pill strong { font-size: var(--km-text-lg); font-weight: 700; }

html[data-theme="escuro"] .km-ui:not(#km-boost) .dashboard-hero { background: linear-gradient(160deg, #136b35, #0d4f27); }

/* Grelha de indicadores: 2 colunas no telemóvel */
.km-ui:not(#km-boost) .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--km-space-2);
    margin: 0 0 var(--km-space-4);
}

.km-ui:not(#km-boost) .stat-card::before,
.km-ui:not(#km-boost) .stat-card::after { display: none; }
.km-ui:not(#km-boost) .stat-card { position: relative; overflow: hidden; }
.km-ui:not(#km-boost) .stat-card strong { display: block; margin: 2px 0; }
.km-ui:not(#km-boost) .stat-card small { display: block; color: var(--km-text-3); line-height: 1.35; }
.km-ui:not(#km-boost) .stat-card.positive strong { color: var(--km-success); }
.km-ui:not(#km-boost) .stat-card.danger strong { color: var(--km-danger); }
.km-ui:not(#km-boost) .stat-card.warning strong { color: var(--km-warning); }

/* Botão "Sair" do ecrã do plano */
.km-ui:not(#km-boost) .plan-logout-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 var(--km-space-3);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-pill);
    background: var(--km-surface);
    color: var(--km-text-2);
    font: inherit;
    font-size: var(--km-text-sm);
    font-weight: 600;
    opacity: 1;
}

.km-ui:not(#km-boost) .plan-logout-button :is(svg, .nav-svg) { width: 18px; height: 18px; }

/* 10.6 Indicadores (KPI) */
.km-ui:not(#km-boost) :is(.stat-card, .manager-kpi-card, .crm-kpi, .notification-summary-card, .merchant-stat, .business-kpi, .alert-value) {
    min-width: 0;
    padding: var(--km-space-3);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface);
    background-image: none;
    box-shadow: none;
    color: var(--km-text);
}

.km-ui:not(#km-boost) :is(.panel, .phone-panel, .business-panel, .merchant-card, .crm-card, .app-panel) :is(.stat-card, .manager-kpi-card, .crm-kpi, .merchant-stat, .business-kpi) {
    border-color: transparent;
    background: var(--km-surface-2);
}

.km-ui:not(#km-boost) :is(.stat-card, .manager-kpi-card, .crm-kpi, .notification-summary-card, .merchant-stat) :is(span, small, p) {
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.km-ui:not(#km-boost) :is(.stat-card, .manager-kpi-card, .crm-kpi, .notification-summary-card, .merchant-stat) :is(strong, b) {
    color: var(--km-text);
    font-size: var(--km-text-lg);
    font-weight: 700;
}

.km-ui:not(#km-boost) .notification-summary-card.urgent strong,
.km-ui:not(#km-boost) .notification-summary-card.danger strong { color: var(--km-danger); }
.km-ui:not(#km-boost) .notification-summary-card.warning strong { color: var(--km-warning); }

/* 10.7 Campos de formulário: 48px, raio, anel de foco, rótulos */
.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) :is(input:where(:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="color"])), select, textarea) {
    width: 100%;
    min-height: var(--km-touch);
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--km-input-border);
    border-radius: var(--km-radius-sm);
    background-color: var(--km-surface);
    background-image: none;
    box-shadow: none;
    color: var(--km-text);
    font: inherit;
    font-size: var(--km-text-md);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    transition: border-color var(--km-dur) var(--km-ease), box-shadow var(--km-dur) var(--km-ease);
}

.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) textarea {
    min-height: 96px;
    padding: 12px 14px;
    resize: vertical;
}

.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) select:not([multiple]) {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238a948f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 12px 8px;
    -webkit-appearance: none;
    appearance: none;
}

.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) :is(input, select, textarea)::placeholder {
    color: var(--km-text-3);
    opacity: 1;
}

.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) :is(input, select, textarea):focus {
    border-color: var(--km-primary);
    outline: none;
    box-shadow: var(--km-focus-ring);
}

.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) :is(input, select, textarea):disabled {
    background-color: var(--km-surface-2);
    color: var(--km-text-2);
}

.km-ui:not(#km-boost) :is(main, .modal-backdrop, .km-sheet, .auth-card, .cashier-shell, .onboarding-shell) :is(input[type="checkbox"], input[type="radio"]) {
    width: 20px;
    height: 20px;
    min-height: 0;
    accent-color: var(--km-primary);
}

/* rótulo que envolve o campo */
.km-ui:not(#km-boost) :is(.form, .form-grid, .business-form, .business-form-row, .merchant-form, .xitique-simple-form, .wallet-simple-form, .form-modal-body, .history-search-form) label:not(.check-row):not(.choice-card):not(.rich-choice):not(.table-toolbar-search) {
    display: grid;
    gap: 6px;
    color: var(--km-text);
    font-size: var(--km-text-sm);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.km-ui:not(#km-boost) :is(.form, .form-grid, .business-form, .business-form-row, .merchant-form, .form-modal-body) label small {
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 500;
    line-height: 1.4;
}

.km-ui:not(#km-boost) :is(.form, .business-form, .merchant-form, .xitique-simple-form, .wallet-simple-form) {
    display: grid;
    gap: var(--km-space-4);
}

.km-ui:not(#km-boost) .form-grid {
    gap: var(--km-space-4);
}

.km-ui:not(#km-boost) .check-row {
    display: flex;
    align-items: center;
    gap: var(--km-space-3);
    min-height: var(--km-touch);
    color: var(--km-text);
    font-size: var(--km-text-md);
    font-weight: 500;
}

/* cartões de escolha (rádio) */
.km-ui:not(#km-boost) :is(.choice-card, .rich-choice) {
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface);
    color: var(--km-text);
    box-shadow: none;
}

.km-ui:not(#km-boost) :is(.choice-card, .rich-choice):has(input:checked) {
    border-color: var(--km-primary);
    background: var(--km-primary-soft);
}

/* 10.8 Botões */
.km-ui:not(#km-boost) .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--km-space-2);
    min-height: var(--km-touch);
    padding: 0 var(--km-space-5);
    border: 1px solid transparent;
    border-radius: var(--km-radius-md);
    background-image: none;
    box-shadow: none;
    font: inherit;
    font-size: var(--km-text-md);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    cursor: pointer;
    transition: background-color var(--km-dur) var(--km-ease), transform var(--km-dur) var(--km-ease);
}

.km-ui:not(#km-boost) .button:active { transform: scale(0.98); }
.km-ui:not(#km-boost) .button :is(svg, .nav-svg) { width: 18px; height: 18px; }

.km-ui:not(#km-boost) .button.button-primary,
.km-ui:not(#km-boost) button.button:not(.button-ghost):not(.button-google):not(.button-danger):not(.button-secondary) {
    border-color: transparent;
    background: var(--km-primary);
    color: var(--km-on-primary);
}

.km-ui:not(#km-boost) .button.button-primary:active { background: var(--km-primary-strong); }

.km-ui:not(#km-boost) .button:is(.button-ghost, .button-secondary, .button-light, .button-google) {
    border-color: var(--km-border);
    background: var(--km-surface);
    color: var(--km-text);
}

.km-ui:not(#km-boost) .button.button-danger {
    background: var(--km-danger-soft);
    color: var(--km-danger);
}

.km-ui:not(#km-boost) .button:disabled,
.km-ui:not(#km-boost) .button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.km-ui:not(#km-boost) :is(.header-actions, .notification-actions) .button {
    min-height: 40px;
    padding: 0 var(--km-space-4);
    font-size: var(--km-text-sm);
}

/* ações de linha (Corrigir / Eliminar) */
.km-ui:not(#km-boost) .row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--km-space-2);
}

.km-ui:not(#km-boost) .row-actions form { margin: 0; }

.km-ui:not(#km-boost) .row-actions :is(a, button) {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 var(--km-space-3);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-pill);
    background: var(--km-surface);
    color: var(--km-text);
    font: inherit;
    font-size: var(--km-text-sm);
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}

.km-ui:not(#km-boost) .row-actions button[type="submit"] { color: var(--km-danger); }

/* 10.9 Selos de estado / chips */
.km-ui:not(#km-boost) :is(.status-badge, .debt-kind-pill, .crm-badge, .business-status-badge, .total-pill, .notification-pill, .hero-pill, .app-chip, .expense-trend-badge) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--km-radius-pill);
    background: var(--km-surface-2);
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
    justify-self: start;
    align-self: center;
    width: auto;
    max-width: max-content;
}

.km-ui:not(#km-boost) .status-badge:is(.dentro, .success, .pago, .activo, .ativo, .baixa, .done, .resolvido) { background: var(--km-success-soft); color: var(--km-success); }
.km-ui:not(#km-boost) .status-badge:is(.atencao, .warning, .media, .pendente, .soft) { background: var(--km-warning-soft); color: var(--km-warning); }
.km-ui:not(#km-boost) .status-badge:is(.ultrapassado, .danger, .alta, .atrasado, .urgente, .error) { background: var(--km-danger-soft); color: var(--km-danger); }
.km-ui:not(#km-boost) .status-badge:is(.info, .blue) { background: var(--km-info-soft); color: var(--km-info); }
.km-ui:not(#km-boost) .business-product-alert {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--km-radius-pill);
    background: var(--km-warning-soft);
    color: var(--km-warning);
    font-size: var(--km-text-xs);
    font-weight: 700;
}
.km-ui:not(#km-boost) .debt-card.payable .debt-kind-pill { background: var(--km-danger-soft); color: var(--km-danger); }
.km-ui:not(#km-boost) .debt-card.receivable .debt-kind-pill { background: var(--km-success-soft); color: var(--km-success); }

/* 10.10 Linhas de lista antigas (cartões interiores) */
.km-ui:not(#km-boost) :is(.debt-card, .wallet-card, .notification-row, .xitique-goal-card, .phone-transaction-row, .business-account-item, .crm-lead, .merchant-row, .business-service-item, .stock-item, .advice-item, .alert-item, .business-ranking-row, .category-row, .goal-row) {
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface);
    background-image: none;
    box-shadow: none;
    color: var(--km-text);
}

.km-ui:not(#km-boost) :is(.debt-card, .wallet-card, .notification-row, .xitique-goal-card, .phone-transaction-row) :is(small, p) { color: var(--km-text-2); }
.km-ui:not(#km-boost) :is(.debt-card, .wallet-card, .xitique-goal-card, .phone-transaction-row) :is(strong, b) { color: var(--km-text); }
.km-ui:not(#km-boost) .notification-row.unread { border-color: var(--km-primary); box-shadow: inset 3px 0 0 var(--km-primary); }

/* 10.11 Detalhes recolhíveis */
.km-ui:not(#km-boost) main details:not(.km-disclosure):not(.user-menu):not(.quick-actions-menu):not(.km-side-group) > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--km-space-3);
    row-gap: 2px;
    min-height: var(--km-touch);
    padding: 10px var(--km-space-4);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface-2);
    color: var(--km-primary);
    font-size: var(--km-text-sm);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.km-ui:not(#km-boost) main details:not(.km-disclosure):not(.user-menu):not(.quick-actions-menu):not(.km-side-group) > summary::-webkit-details-marker { display: none; }

.km-ui:not(#km-boost) main details:not(.km-disclosure):not(.user-menu):not(.quick-actions-menu):not(.km-side-group) > summary > :is(span, strong, b, small, p) {
    grid-column: 1;
    margin: 0;
    text-align: left;
}

.km-ui:not(#km-boost) main details:not(.km-disclosure):not(.user-menu):not(.quick-actions-menu):not(.km-side-group) > summary > :is(small, p) {
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 500;
    line-height: 1.4;
}

.km-ui:not(#km-boost) main details:not(.km-disclosure):not(.user-menu):not(.quick-actions-menu):not(.km-side-group) > summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.km-ui:not(#km-boost) main details:not(.km-disclosure):not(.user-menu):not(.quick-actions-menu):not(.km-side-group)[open] > summary {
    margin-bottom: var(--km-space-3);
}

/* 10.12 Avisos e notas em linha */
.km-ui:not(#km-boost) :is(.inline-warning, .tip-text, .impact-preview, .human-preview, .spend-impact-panel, .trial-access-notice, .plan-customer-notice) {
    padding: var(--km-space-3);
    border: 0;
    border-radius: var(--km-radius-md);
    background: var(--km-info-soft);
    background-image: none;
    color: var(--km-text);
    font-size: var(--km-text-sm);
    line-height: 1.45;
    box-shadow: none;
}

.km-ui:not(#km-boost) .inline-warning { background: var(--km-warning-soft); }

.km-ui:not(#km-boost) :is(.inline-warning, .tip-text, .impact-preview, .human-preview) :is(strong, b, h3, h4) { color: var(--km-text); }
.km-ui:not(#km-boost) :is(.inline-warning, .tip-text, .impact-preview, .human-preview) :is(p, small, span) { color: var(--km-text-2); }

/* 10.13 Barras de progresso */
.km-ui:not(#km-boost) :is(.progress, .phone-progress) {
    height: 8px;
    overflow: hidden;
    border: 0;
    border-radius: var(--km-radius-pill);
    background: var(--km-surface-2);
}

.km-ui:not(#km-boost) :is(.progress, .phone-progress) > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--km-primary);
}

/* 10.14 Estados vazios */
.km-ui:not(#km-boost) :is(.empty-state, .phone-empty, .business-empty, .empty-app, .crm-empty, .business-ranking-empty, .business-pos-empty, .qs-cart-empty):not(td) {
    display: grid;
    justify-items: center;
    gap: var(--km-space-2);
    padding: var(--km-space-5) var(--km-space-4);
    border: 1px dashed var(--km-border);
    border-radius: var(--km-radius-lg);
    background: transparent;
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    line-height: 1.45;
    text-align: center;
}

.km-ui:not(#km-boost) :is(.empty-state, .phone-empty, .business-empty, .empty-app):not(td) strong {
    color: var(--km-text);
    font-size: var(--km-text-md);
}

.km-ui:not(#km-boost) td.empty-state {
    padding: var(--km-space-5) var(--km-space-4);
    color: var(--km-text-2);
    text-align: center;
}

/* 10.15 Tabelas */
.km-ui:not(#km-boost) .table-wrap {
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-md);
    background: var(--km-surface);
    box-shadow: none;
}

.km-ui:not(#km-boost) :is(.data-table, .merchant-table table) {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    color: var(--km-text);
    font-size: var(--km-text-sm);
}

.km-ui:not(#km-boost) :is(.data-table, .merchant-table table) th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--km-border);
    background: var(--km-surface-2);
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
}

.km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td {
    padding: 12px;
    border-bottom: 1px solid var(--km-border);
    background: transparent;
    color: var(--km-text);
    vertical-align: middle;
}

.km-ui:not(#km-boost) :is(.data-table, .merchant-table table) tr:last-child td { border-bottom: 0; }

.km-ui:not(#km-boost) :is(.money-danger, .negative, .expense-value) { color: var(--km-danger); }
.km-ui:not(#km-boost) :is(.money-success, .positive):not(.status-badge) { color: var(--km-success); }

/* filtro de lista criado pelo system.js */
.km-ui:not(#km-boost) .table-toolbar {
    display: flex;
    align-items: center;
    gap: var(--km-space-3);
    margin: 0 0 var(--km-space-3);
}

.km-ui:not(#km-boost) .table-toolbar-search {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
}

.km-ui:not(#km-boost) .table-toolbar-search > span {
    position: absolute;
    left: 14px;
    color: var(--km-text-3);
    pointer-events: none;
}

.km-ui:not(#km-boost) main .table-toolbar-search input { padding-left: 36px; }

.km-ui:not(#km-boost) .table-toolbar-count {
    flex: 0 0 auto;
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
}

/* 10.16 Pesquisa de histórico e paginação */
.km-ui:not(#km-boost) .history-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--km-space-2);
}

.km-ui:not(#km-boost) .history-search-form > label { flex: 1 1 160px; min-width: 0; }
.km-ui:not(#km-boost) .history-search-form > .button { flex: 0 0 auto; }
.km-ui:not(#km-boost) .history-search-form > label > span { color: var(--km-text-2); font-size: var(--km-text-xs); }

.km-ui:not(#km-boost) .history-toolbar > p {
    margin: var(--km-space-2) 0 0;
    color: var(--km-text-2);
    font-size: var(--km-text-xs);
    font-weight: 600;
}

.km-ui:not(#km-boost) .history-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--km-space-2);
    margin-top: var(--km-space-3);
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
}

.km-ui:not(#km-boost) .history-pagination p { margin: 0; color: var(--km-text-2); }
.km-ui:not(#km-boost) .history-pagination > div { display: flex; align-items: center; gap: var(--km-space-2); }
.km-ui:not(#km-boost) .history-pagination .button { min-height: 40px; padding: 0 var(--km-space-4); font-size: var(--km-text-sm); }

/* 10.17 Separadores / controlos segmentados */
.km-ui:not(#km-boost) :is(.business-report-tabs, .crm-toolbar-left, .crm-filterbar, .business-attendance-filters, .phone-report-filter) {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--km-space-2);
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0;
}

.km-ui:not(#km-boost) :is(.business-report-tabs, .crm-toolbar-left, .crm-filterbar, .business-attendance-filters)::-webkit-scrollbar { display: none; }

.km-ui:not(#km-boost) :is(.business-report-tab, .crm-tab, .km-period-link, [data-attendance-filter]) {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 var(--km-space-4);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-pill);
    background: var(--km-surface);
    box-shadow: none;
    color: var(--km-text);
    font: inherit;
    font-size: var(--km-text-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.km-ui:not(#km-boost) :is(.business-report-tab, .crm-tab, .km-period-link, [data-attendance-filter]):is(.is-active, .active, [aria-selected="true"], [aria-current="page"], [aria-pressed="true"]) {
    border-color: var(--km-primary);
    background: var(--km-primary-soft);
    color: var(--km-primary);
}

/* 10.18 Janelas (modais antigas) */
.km-ui:not(#km-boost) :is(.modal-backdrop, .success-modal-backdrop, .notification-optin-backdrop):not([hidden]) {
    background: rgba(8, 14, 11, 0.45);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.km-ui:not(#km-boost) :is(.app-modal, .success-modal, .notification-optin-card, .processing-card, .system-confirm-card) {
    border: 0;
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    background-image: none;
    box-shadow: var(--km-shadow-2);
    color: var(--km-text);
}

.km-ui:not(#km-boost) :is(.app-modal, .success-modal, .notification-optin-card) :is(h2, h3) { color: var(--km-text); }
.km-ui:not(#km-boost) :is(.app-modal, .success-modal, .notification-optin-card) p:not(.eyebrow) { color: var(--km-text-2); }

.km-ui:not(#km-boost) .form-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--km-space-3);
    margin: 0 0 var(--km-space-4);
    padding: 0;
    border: 0;
    background: none;
}

.km-ui:not(#km-boost) .form-modal-head h2 {
    margin: 0;
    color: var(--km-text);
    font-size: var(--km-text-lg);
    font-weight: 700;
}

.km-ui:not(#km-boost) .form-modal-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--km-surface-2);
    color: var(--km-text-2);
    font-size: 24px;
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
}

/* Botão que abre o formulário em janela: frase de apoio redundante */
.km-ui:not(#km-boost) .form-launch-copy { display: none; }
.km-ui:not(#km-boost) .form-launch-panel .form-open-button { width: 100%; margin-top: var(--km-space-2); }
.km-ui:not(#km-boost) .form-launch-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--km-primary-soft);
    color: var(--km-primary);
    font-size: 22px;
    font-weight: 600;
    box-shadow: none;
}
.km-ui:not(#km-boost) .form-launch-header { align-items: center; justify-content: flex-start; }

/* ---------- Telemóvel ---------- */
@media (max-width: 899.98px) {
    /* o título já está na barra superior: o sobretítulo repete-o */
    .km-ui:not(#km-boost) :is(.page-header .eyebrow, .phone-dashboard-header > div > p:first-child) {
        display: none;
    }

    .km-ui:not(#km-boost) .page-header :is(.header-actions, .notification-actions) {
        flex: 1 1 100%;
    }

    .km-ui:not(#km-boost) .page-header :is(.header-actions, .notification-actions) > :is(.button, a, button, form) {
        flex: 1 1 calc(50% - var(--km-space-1));
        min-width: 0;
    }

    .km-ui:not(#km-boost) .page-header :is(.header-actions, .notification-actions) > form > .button { width: 100%; }

    .km-ui:not(#km-boost) main > :is(.page-header, section, .panel, .phone-panel, .business-panel, div) + :is(section, .panel, .phone-panel, .business-panel, .history-toolbar) {
        margin-top: var(--km-space-4);
    }

    .km-ui:not(#km-boost) .history-search-form > label > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .km-ui:not(#km-boost) .history-search-form > label { position: relative; }

    /* Tabelas viram linhas empilhadas (rótulos vindos do cabeçalho via system.js) */
    .km-ui:not(#km-boost) .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table),
    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) tbody {
        display: block;
        min-width: 0;
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) thead { display: none; }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) tr {
        display: block;
        padding: var(--km-space-3) 0;
        border-bottom: 1px solid var(--km-border);
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) tr:first-child { padding-top: 0; }
    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) tr:last-child { border-bottom: 0; padding-bottom: 0; }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--km-space-3);
        padding: 3px 0;
        border: 0;
        text-align: right;
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--km-text-2);
        font-size: var(--km-text-xs);
        font-weight: 600;
        text-align: left;
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td:first-child {
        padding-bottom: 6px;
        color: var(--km-text);
        font-size: var(--km-text-md);
        font-weight: 600;
        text-align: left;
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td:first-child::before,
    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td:is([data-label=""], .row-actions, .empty-state)::before {
        content: none;
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td.row-actions {
        justify-content: flex-start;
        padding-top: var(--km-space-2);
    }

    .km-ui:not(#km-boost) :is(.data-table, .merchant-table table) td.empty-state {
        display: block;
        text-align: center;
    }

    /* Janelas antigas viram folha inferior */
    .km-ui:not(#km-boost) :is(.modal-backdrop, .form-modal-backdrop, .business-action-modal-backdrop):not([hidden]) {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .km-ui:not(#km-boost) :is(.modal-backdrop, .form-modal-backdrop) > .app-modal {
        width: 100%;
        max-width: 560px;
        max-height: 90vh;
        max-height: 90dvh;
        margin: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--km-space-5) var(--km-space-4) calc(var(--km-space-5) + var(--km-safe-bottom));
        border-radius: var(--km-radius-lg) var(--km-radius-lg) 0 0;
        animation: km-sheet-up 240ms var(--km-ease);
    }

    .km-ui:not(#km-boost) :is(.modal-backdrop, .form-modal-backdrop) > .app-modal::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 36px;
        height: 5px;
        border-radius: var(--km-radius-pill);
        background: var(--km-border);
        transform: translateX(-50%);
    }

    .km-ui:not(#km-boost) :is(.modal-backdrop, .form-modal-backdrop) > .app-modal { position: relative; }

    .km-ui:not(#km-boost) .modal-actions {
        display: grid;
        gap: var(--km-space-2);
    }

    .km-ui:not(#km-boost) .modal-actions .button { width: 100%; }
}

/* ---------- Computador ---------- */
@media (min-width: 900px) {
    .km-ui:not(#km-boost) .main-shell > .content {
        width: 100%;
        max-width: 1180px;
        margin-right: auto;
        margin-left: auto;
    }

    .km-ui:not(#km-boost) :is(.modal-backdrop, .form-modal-backdrop) > .app-modal {
        width: min(560px, calc(100vw - 48px));
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        padding: var(--km-space-5);
    }
}

/* ==========================================================================
   11. Entrar / Criar conta / PIN / Caixa / Primeira configuração
   ========================================================================== */
html body.km-auth-v2.km-ui:not(#km-boost) {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        linear-gradient(180deg, var(--km-primary) 0, var(--km-primary-strong) 200px, var(--km-bg) 200px) no-repeat,
        var(--km-bg);
    color: var(--km-text);
    font-family: var(--km-font);
}

.km-auth-v2.km-ui:not(#km-boost) .auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        calc(var(--km-space-6) + var(--km-safe-top))
        calc(var(--km-space-4) + var(--km-safe-right))
        calc(var(--km-space-6) + var(--km-safe-bottom))
        calc(var(--km-space-4) + var(--km-safe-left));
    background: none;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: var(--km-space-5);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    background-image: none;
    box-shadow: var(--km-shadow-2);
    color: var(--km-text);
}

.km-auth-v2.km-ui:not(#km-boost) .auth-card-logo {
    display: inline-flex;
    margin: 0 0 var(--km-space-5);
}

.km-auth-v2.km-ui:not(#km-boost) .auth-card-logo img {
    width: auto;
    height: 36px;
    max-width: 200px;
}

.km-ui:not(#km-boost) .form-header {
    margin: 0 0 var(--km-space-5);
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

.km-ui:not(#km-boost) .form-header .eyebrow {
    margin: 0 0 var(--km-space-1);
    color: var(--km-primary);
    font-size: var(--km-text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.km-ui:not(#km-boost) .form-header h2 {
    margin: 0;
    color: var(--km-text);
    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.km-ui:not(#km-boost) .form-header p:not(.eyebrow) {
    margin: var(--km-space-2) 0 0;
    color: var(--km-text-2);
    font-size: var(--km-text-md);
    line-height: 1.45;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-card :is(input:where(:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])), select) {
    min-height: 52px;
    border-radius: var(--km-radius-md);
    font-size: 1.0625rem;
}

.km-auth-v2.km-ui:not(#km-boost) .pin-form input[name="pin"] {
    min-height: 64px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.6em;
    text-align: center;
    text-indent: 0.6em;
}

.km-auth-v2.km-ui:not(#km-boost) :is(.auth-submit, .pin-form .button-primary) {
    width: 100%;
    min-height: 52px;
    margin-top: var(--km-space-1);
}

.km-auth-v2.km-ui:not(#km-boost) .auth-google-button {
    width: 100%;
    min-height: 52px;
}

.km-auth-v2.km-ui:not(#km-boost) .google-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--km-space-3);
    margin: var(--km-space-4) 0;
    color: var(--km-text-3);
    font-size: var(--km-text-xs);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-divider::before,
.km-auth-v2.km-ui:not(#km-boost) .auth-divider::after {
    content: "";
    display: block;
    position: static;
    flex: 1 1 auto;
    height: 1px;
    background: var(--km-border);
}

.km-auth-v2.km-ui:not(#km-boost) .auth-divider span {
    padding: 0;
    background: none;
    color: inherit;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-switch {
    margin: var(--km-space-5) 0 0;
    padding: var(--km-space-4) 0 0;
    border-top: 1px solid var(--km-border);
    color: var(--km-text-2);
    font-size: var(--km-text-sm);
    text-align: center;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-switch a,
.km-auth-v2.km-ui:not(#km-boost) .auth-legal-note a {
    color: var(--km-primary);
    font-weight: 600;
    text-decoration: none;
}

.km-auth-v2.km-ui:not(#km-boost) form.auth-switch .button { width: 100%; }

.km-auth-v2.km-ui:not(#km-boost) .auth-legal-note {
    margin: var(--km-space-3) 0 0;
    color: var(--km-text-3);
    font-size: var(--km-text-xs);
    text-align: center;
}

/* passos numerados do registo */
.km-auth-v2.km-ui:not(#km-boost) .auth-form-section {
    border: 0;
    border-radius: var(--km-radius-md);
    background: var(--km-surface-2);
    box-shadow: none;
}

.km-auth-v2.km-ui:not(#km-boost) .auth-form-section :is(strong, h3) { color: var(--km-text); }
.km-auth-v2.km-ui:not(#km-boost) .auth-form-section :is(small, p) { color: var(--km-text-2); }

@media (min-width: 900px) {
    html body.km-auth-v2.km-ui:not(#km-boost) {
        background: var(--km-bg);
    }

    .km-auth-v2.km-ui:not(#km-boost) .auth-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
        align-items: center;
        gap: var(--km-space-6);
        max-width: 1080px;
        margin: 0 auto;
    }

    .km-auth-v2.km-ui:not(#km-boost) .auth-brand {
        padding: var(--km-space-6);
        border-radius: var(--km-radius-lg);
        background: linear-gradient(160deg, var(--km-primary), var(--km-primary-strong));
        color: #ffffff;
    }

    .km-auth-v2.km-ui:not(#km-boost) .auth-brand :is(h1, p, strong, small, span) { color: #ffffff; }
    .km-auth-v2.km-ui:not(#km-boost) .auth-brand small { opacity: 0.85; }
}

/* Caixa (funcionário) */
html body.cashier-body.km-ui:not(#km-boost) {
    background: var(--km-bg);
    color: var(--km-text);
}

.cashier-body.km-ui:not(#km-boost) .cashier-shell {
    background: var(--km-bg);
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding:
        calc(var(--km-space-4) + var(--km-safe-top))
        calc(var(--km-space-4) + var(--km-safe-right))
        calc(var(--km-space-6) + var(--km-safe-bottom))
        calc(var(--km-space-4) + var(--km-safe-left));
}

.cashier-body.km-ui:not(#km-boost) .phone-header-actions {
    display: flex;
    gap: var(--km-space-2);
}

.cashier-body.km-ui:not(#km-boost) :is(.phone-header-actions :is(a, button), .cashier-logout) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--km-border);
    border-radius: 50%;
    background: var(--km-surface);
    color: var(--km-text);
    box-shadow: none;
}

.cashier-body.km-ui:not(#km-boost) .phone-dashboard-header {
    flex-wrap: nowrap;
    align-items: center;
}

/* Primeira configuração */
html body.onboarding-body.km-ui:not(#km-boost) {
    background: var(--km-bg);
    color: var(--km-text);
}

.onboarding-body.km-ui:not(#km-boost) .onboarding-shell {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding:
        calc(var(--km-space-4) + var(--km-safe-top))
        calc(var(--km-space-4) + var(--km-safe-right))
        calc(var(--km-space-6) + var(--km-safe-bottom))
        calc(var(--km-space-4) + var(--km-safe-left));
}

.onboarding-body.km-ui:not(#km-boost) .onboarding-shell :is(h1, h2, h3) {
    color: var(--km-text);
    letter-spacing: -0.01em;
}

.onboarding-body.km-ui:not(#km-boost) .onboarding-shell h1 { font-size: 1.5rem; line-height: 1.2; }
.onboarding-body.km-ui:not(#km-boost) .onboarding-shell h2 { font-size: var(--km-text-xl); line-height: 1.25; }

.onboarding-body.km-ui:not(#km-boost) :is(.onboarding-hero, .onboarding-fast-card) {
    margin: 0 0 var(--km-space-4);
    padding: var(--km-space-5) var(--km-space-4);
    border: 1px solid var(--km-border);
    border-radius: var(--km-radius-lg);
    background: var(--km-surface);
    background-image: none;
    box-shadow: var(--km-shadow-1);
}

.onboarding-body.km-ui:not(#km-boost) .onboarding-shell p:not(.eyebrow) { color: var(--km-text-2); }
.onboarding-body.km-ui:not(#km-boost) .onboarding-shell .eyebrow { color: var(--km-primary); }
.onboarding-body.km-ui:not(#km-boost) .onboarding-fast-actions .button { width: 100%; min-height: 52px; }

/* ==========================================================================
   12. Estilos próprios de ecrãs (antes em <style> dentro das views)
   Movidos sem alterações de valores; a ponte (secção 10) e o tema escuro
   sobrepõem-se onde for preciso.
   ========================================================================== */

/* --- Caixa: painel do gestor (caixa/index.php) --- */
.manager-kpi-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}.manager-kpi-card{padding:14px;border:1px solid rgba(15,23,42,.08);border-radius:16px;background:#fff}.manager-kpi-card span,.manager-kpi-card small{display:block;color:#64748b;font-size:12px}.manager-kpi-card strong{display:block;margin:6px 0 4px;font-size:20px;line-height:1.1}.manager-alert-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.manager-alert-row>div{padding:11px 8px;border-radius:14px;background:#f8fafc;text-align:center}.manager-alert-row strong,.manager-alert-row span{display:block}.manager-alert-row strong{font-size:18px}.manager-alert-row span{margin-top:2px;font-size:11px;color:#64748b}.manager-action-details{margin-top:14px;border:1px solid rgba(15,23,42,.08);border-radius:16px;background:#fff;overflow:hidden}.manager-action-details summary{cursor:pointer;padding:14px 16px;font-weight:700}.manager-stock-form{padding:0 16px 16px}.manager-stock-alerts{margin-bottom:6px}@media(max-width:420px){.manager-kpi-grid{grid-template-columns:1fr 1fr}.manager-kpi-card strong{font-size:17px}.manager-alert-row{grid-template-columns:1fr}.manager-alert-row>div{text-align:left;display:flex;align-items:center;gap:8px}.manager-alert-row span{margin-top:0}}

/* --- Negociante: estrutura comum (negociante/_ui.php) --- */
.merchant{max-width:1180px;margin:0 auto;padding:12px 0 105px}.merchant h1{font-size:28px;margin:6px 0}.merchant h2{font-size:20px;margin:0 0 14px}.merchant h3{font-size:16px}.merchant .muted{color:#64746e;font-size:13px}.merchant-header{display:flex;justify-content:space-between;gap:16px;align-items:start;margin-bottom:18px}.merchant-links{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.merchant-links a{padding:8px 12px;border:1px solid #d8e4dc;border-radius:10px;color:inherit;text-decoration:none}.merchant-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.merchant-card{background:var(--card-bg,#fff);border:1px solid #dce6df;border-radius:16px;padding:20px;margin-bottom:18px}.merchant-stat strong{display:block;font-size:26px;color:#087844;margin-top:8px}.merchant-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;align-items:end;margin:12px 0}.merchant-form label{display:grid;gap:6px;font-size:13px}.merchant-form input,.merchant-form select,.merchant-form textarea{width:100%;min-width:0;padding:10px;border:1px solid #cbd9d0;border-radius:8px;background:var(--card-bg,#fff);color:inherit}.merchant-form button{min-height:42px}.merchant-table{overflow:auto}.merchant table{width:100%;border-collapse:collapse;font-size:14px}.merchant th,.merchant td{text-align:left;padding:12px 8px;border-bottom:1px solid #e0e8e3;vertical-align:top}.merchant details{padding:10px 0}.merchant summary{cursor:pointer;font-weight:600}.merchant .overdue{color:#b34320}.merchant .empty{padding:18px;background:#f3f7f4;border-radius:10px;color:#62746a}.merchant progress{width:100%;accent-color:#0f8f3d}.merchant .merchant-row{border-bottom:1px solid #e0e8e3;padding:12px 0}

/* Navegação do modo Negociante */
.merchant-account-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.merchant-account-nav a,.merchant-more-trigger{appearance:none;background:#fff;border:1px solid #dce6df;border-radius:12px;padding:9px 12px;color:#2f4539;text-decoration:none;font:600 12px/1 inherit;cursor:pointer}.merchant-account-nav a:hover,.merchant-more-trigger:hover{background:#f5faf7}.merchant-account-nav .merchant-home-link{color:#087844;background:#eef9f2;border-color:#cce8d6}
.merchant-bottom-nav{display:none}.merchant-more-backdrop{position:fixed;inset:0;background:rgba(10,27,20,.34);z-index:198;opacity:0;pointer-events:none;transition:.18s}.merchant-more-backdrop.open{opacity:1;pointer-events:auto}.merchant-more-sheet{position:fixed;z-index:199;left:50%;bottom:18px;width:min(520px,calc(100% - 24px));transform:translate(-50%,115%);background:#fff;border:1px solid #dce6df;border-radius:24px;box-shadow:0 28px 80px rgba(15,48,33,.25);padding:18px;transition:.22s ease}.merchant-more-sheet.open{transform:translate(-50%,0)}.merchant-more-handle{width:46px;height:4px;border-radius:99px;background:#dce4df;margin:0 auto 14px}.merchant-more-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.merchant-more-head strong{font-size:18px}.merchant-more-close{width:34px;height:34px;border:0;border-radius:50%;background:#f0f5f2;cursor:pointer;font-size:18px}.merchant-more-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.merchant-more-grid a{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:#20362b;padding:13px;border-radius:15px;background:#f7faf8;border:1px solid #edf2ef}.merchant-more-grid a strong{font-size:13px}.merchant-more-grid a span{font-size:10px;color:#7b8981}.merchant-more-support{margin-top:12px;padding:13px;border-radius:15px;background:#eaf8ef;border:1px solid #cfead9}.merchant-more-support strong{display:block;font-size:13px;color:#075f37}.merchant-more-support span{font-size:11px;color:#527062}.merchant-more-support-actions{display:flex;gap:8px;margin-top:10px}.merchant-more-support-actions a{flex:1;text-align:center;text-decoration:none;border-radius:10px;padding:9px;font-size:11px;font-weight:700;background:#fff;color:#075f37;border:1px solid #cae5d4}

@media(max-width:600px){.merchant{padding:6px 0 94px}.merchant-header{display:flex;align-items:center;margin-bottom:12px;padding:0 2px}.merchant-header>div:first-child .muted{display:none}.merchant h1{font-size:20px;margin:0}.merchant-card{padding:15px}.merchant-grid{grid-template-columns:1fr 1fr}.merchant-form{grid-template-columns:1fr}.merchant-stat strong{font-size:20px}.merchant-account-nav{display:none}.merchant-bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:8px;right:8px;bottom:8px;z-index:190;background:rgba(255,255,255,.97);border:1px solid #dbe6df;border-radius:19px;padding:7px;box-shadow:0 14px 38px rgba(29,55,42,.18);backdrop-filter:blur(14px)}.merchant-bottom-nav a,.merchant-bottom-nav button{appearance:none;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:48px;text-decoration:none;color:#728078;font:600 9px/1.1 inherit;border-radius:12px;cursor:pointer}.merchant-bottom-nav .nav-ico{font-size:18px;line-height:1}.merchant-bottom-nav .active{background:#eaf8ef;color:#087844}.merchant-bottom-nav .sale-nav{color:#087844}.merchant-bottom-nav .sale-nav .nav-ico{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:#087844;color:#fff;margin-top:-12px;box-shadow:0 8px 18px rgba(8,120,68,.22)} }

/* --- Negociante: CRM (negociante/crm.php) --- */
.crm-page{--crm-blue:#1677ff;--crm-blue-soft:#eaf3ff;--crm-green:#0f9f65;--crm-green-soft:#e8f8f1;--crm-amber:#d88a05;--crm-amber-soft:#fff5df;--crm-red:#cf4a4a;--crm-red-soft:#fff0f0;--crm-border:#dce6df;--crm-text:#173029;--crm-muted:#6d7d76}.crm-page .crm-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:16px}.crm-page .crm-toolbar-left{display:flex;gap:8px;flex-wrap:wrap}.crm-page .crm-tab{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;border:1px solid var(--crm-border);background:var(--card-bg,#fff);border-radius:10px;color:inherit;text-decoration:none;font-size:13px;font-weight:600}.crm-page .crm-tab.active{background:#102b23;color:#fff;border-color:#102b23}.crm-page .crm-new summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:7px;background:#0d8d50;color:#fff;padding:10px 15px;border-radius:10px;font-size:13px;font-weight:700}.crm-page .crm-new summary::-webkit-details-marker{display:none}.crm-page .crm-create-body{margin-top:12px;background:var(--card-bg,#fff);border:1px solid var(--crm-border);border-radius:16px;padding:18px}.crm-page .crm-create-body h2{margin-bottom:4px}.crm-page .crm-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.crm-page .crm-kpi{background:var(--card-bg,#fff);border:1px solid var(--crm-border);border-radius:15px;padding:16px;display:flex;align-items:center;gap:12px;min-height:92px}.crm-page .crm-kpi-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;font-size:19px;flex:0 0 42px}.crm-page .crm-kpi.blue .crm-kpi-icon{background:var(--crm-blue-soft);color:var(--crm-blue)}.crm-page .crm-kpi.green .crm-kpi-icon{background:var(--crm-green-soft);color:var(--crm-green)}.crm-page .crm-kpi.amber .crm-kpi-icon{background:var(--crm-amber-soft);color:var(--crm-amber)}.crm-page .crm-kpi.red .crm-kpi-icon{background:var(--crm-red-soft);color:var(--crm-red)}.crm-page .crm-kpi small{display:block;color:var(--crm-muted);font-size:11px;margin-bottom:3px}.crm-page .crm-kpi strong{display:block;font-size:22px;line-height:1.1}.crm-page .crm-kpi span{font-size:10px;color:var(--crm-muted)}.crm-page .crm-main-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,.8fr);gap:16px;margin-bottom:16px}.crm-page .crm-card{background:var(--card-bg,#fff);border:1px solid var(--crm-border);border-radius:16px;padding:18px}.crm-page .crm-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.crm-page .crm-card-head h2{font-size:17px;margin:0}.crm-page .crm-card-head p{margin:3px 0 0}.crm-page .crm-card-link{font-size:12px;color:#0d75d8;text-decoration:none;font-weight:600}.crm-page .crm-alert-list{display:grid;gap:8px}.crm-page .crm-alert{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid #e7ece9;border-radius:11px;background:#fbfcfb}.crm-page .crm-alert-left{display:flex;align-items:center;gap:10px;min-width:0}.crm-page .crm-alert-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto}.crm-page .crm-alert strong{display:block;font-size:12px}.crm-page .crm-alert span{display:block;font-size:10px;color:var(--crm-muted);margin-top:2px}.crm-page .crm-alert b{font-size:18px}.crm-page .crm-progress{display:flex;height:10px;background:#eef3f0;border-radius:99px;overflow:hidden;margin:12px 0 15px}.crm-page .crm-progress span{display:block;height:100%}.crm-page .crm-progress .p-new{background:#3289ed}.crm-page .crm-progress .p-contact{background:#e8a51c}.crm-page .crm-progress .p-converted{background:#20aa70}.crm-page .crm-progress .p-lost{background:#dc5f5f}.crm-page .crm-pipeline{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.crm-page .crm-stage{border:1px solid #e1e8e4;border-radius:12px;padding:11px;background:#fbfcfb}.crm-page .crm-stage small{font-size:10px;color:var(--crm-muted);display:block}.crm-page .crm-stage strong{font-size:20px}.crm-page .crm-stage span{display:block;font-size:10px;margin-top:2px}.crm-page .crm-filterbar{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:12px}.crm-page .crm-search{flex:1;min-width:210px;border:1px solid var(--crm-border);border-radius:10px;padding:10px 12px;background:var(--card-bg,#fff);color:inherit}.crm-page .crm-filter{border:1px solid var(--crm-border);border-radius:10px;padding:9px 10px;background:var(--card-bg,#fff);color:inherit}.crm-page .crm-lead-list{display:grid;gap:9px}.crm-page .crm-lead{border:1px solid #e2e9e5;border-radius:13px;padding:13px;display:grid;grid-template-columns:minmax(240px,1.45fr) minmax(120px,.7fr) minmax(100px,.65fr) auto;gap:12px;align-items:center;background:var(--card-bg,#fff)}.crm-page .crm-person{display:flex;align-items:center;gap:11px;min-width:0}.crm-page .crm-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#edf2ef;font-size:11px;font-weight:800;color:#385348;flex:0 0 38px}.crm-page .crm-person strong{font-size:13px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crm-page .crm-person small{font-size:10px;color:var(--crm-muted);display:block;margin-top:3px}.crm-page .crm-meta small{font-size:10px;color:var(--crm-muted);display:block}.crm-page .crm-meta strong{font-size:12px;font-weight:600;display:block;margin-top:2px;overflow:hidden;text-overflow:ellipsis}.crm-page .crm-badge{display:inline-flex;padding:6px 9px;border-radius:99px;font-size:10px;font-weight:700;white-space:nowrap}.crm-page .crm-badge.new{background:var(--crm-blue-soft);color:#146fcb}.crm-page .crm-badge.contact{background:var(--crm-amber-soft);color:#a56c07}.crm-page .crm-badge.converted{background:var(--crm-green-soft);color:#087b4c}.crm-page .crm-badge.lost{background:var(--crm-red-soft);color:#b63e3e}.crm-page .crm-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px}.crm-page .crm-action{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;text-decoration:none;border:1px solid #dfe8e3;background:#fff;color:#244339;font-size:14px}.crm-page .crm-action.whatsapp{color:#0d9d5a}.crm-page .crm-edit summary{list-style:none;cursor:pointer;width:34px;height:34px;border-radius:9px;border:1px solid #dfe8e3;display:grid;place-items:center;background:#fff;font-weight:800}.crm-page .crm-edit summary::-webkit-details-marker{display:none}.crm-page .crm-edit[open]{grid-column:1/-1}.crm-page .crm-edit[open] summary{margin-left:auto}.crm-page .crm-edit .merchant-form{padding-top:10px}.crm-page .crm-followup{display:flex;align-items:flex-start;gap:10px;padding:11px 0;border-bottom:1px solid #e7ece9}.crm-page .crm-followup:last-child{border-bottom:0}.crm-page .crm-date{width:46px;height:46px;border-radius:10px;background:#f0f5f2;display:grid;place-items:center;text-align:center;flex:0 0 46px;line-height:1.05}.crm-page .crm-date strong{font-size:15px}.crm-page .crm-date small{font-size:8px;text-transform:uppercase;color:var(--crm-muted)}.crm-page .crm-followup-info{min-width:0;flex:1}.crm-page .crm-followup-info strong{display:block;font-size:12px}.crm-page .crm-followup-info span{font-size:10px;color:var(--crm-muted)}.crm-page .crm-followup.overdue .crm-date{background:var(--crm-red-soft);color:var(--crm-red)}.crm-page .crm-origin{display:grid;grid-template-columns:1fr auto;gap:9px;font-size:11px;padding:8px 0;border-bottom:1px solid #edf1ef}.crm-page .crm-origin:last-child{border-bottom:0}.crm-page .crm-origin span{color:var(--crm-muted)}.crm-page .crm-empty{padding:26px 15px;text-align:center;background:#f6f9f7;border-radius:12px;color:var(--crm-muted);font-size:12px}.crm-page .crm-section-anchor{scroll-margin-top:90px}.crm-page .crm-period{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.crm-page .crm-period .merchant-form{margin:0;display:flex;align-items:end;gap:8px}.crm-page .crm-period .merchant-form label{min-width:130px}.crm-page .crm-period .merchant-form button{min-height:39px}.crm-page .crm-footer-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}.crm-page .crm-followup-form details summary{cursor:pointer;font-weight:700;font-size:13px;color:#0d7750}.crm-page .crm-followup-form details[open] summary{margin-bottom:8px}
.crm-page .crm-followup-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.crm-page .crm-followup-details{margin-top:9px}.crm-page .crm-followup-details summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:5px;padding:7px 9px;border:1px solid #dfe8e3;border-radius:8px;background:#f7faf8;color:#244339;font-size:10px;font-weight:700}.crm-page .crm-followup-details summary::-webkit-details-marker{display:none}.crm-page .crm-followup-details[open] summary{margin-bottom:8px}.crm-page .crm-followup-detail-box{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:11px;border:1px solid #e3ebe6;background:#fbfcfb;border-radius:10px}.crm-page .crm-followup-detail-item{min-width:0}.crm-page .crm-followup-detail-item.wide{grid-column:1/-1}.crm-page .crm-followup-detail-item small{display:block;color:var(--crm-muted);font-size:9px;margin-bottom:2px}.crm-page .crm-followup-detail-item strong{display:block;font-size:11px;white-space:normal;word-break:break-word}@media(max-width:600px){.crm-page .crm-followup-detail-box{grid-template-columns:1fr}.crm-page .crm-followup-detail-item.wide{grid-column:auto}}.crm-page .crm-followup-action{display:inline-flex;align-items:center;gap:5px;padding:7px 9px;border:1px solid #dfe8e3;border-radius:8px;background:#fff;color:#244339;text-decoration:none;font-size:10px;font-weight:700;cursor:pointer}.crm-page .crm-followup-action.call{color:#126fca}.crm-page .crm-followup-action.whatsapp{color:#0d9d5a}.crm-page .crm-followup-action.done{color:#087b4c}.crm-page .crm-followup-action.edit{color:#8b6500}.crm-page .crm-followup-edit{margin-top:9px;border-top:1px dashed #dfe8e3;padding-top:9px}.crm-page .crm-followup-edit summary{list-style:none;cursor:pointer;font-size:10px;font-weight:700;color:#0d75d8}.crm-page .crm-followup-edit summary::-webkit-details-marker{display:none}.crm-page .crm-followup-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.crm-page .crm-followup-edit-grid .wide{grid-column:1/-1}.crm-page .crm-followup-edit .merchant-form{margin:0}.crm-page .crm-followup-edit .merchant-form label>span{font-size:10px}.crm-page .crm-inline-status{display:inline}.crm-page .crm-inline-status form{display:inline}.crm-page .crm-inline-status button{font:inherit}.crm-page .crm-person-readonly{padding:9px 10px;background:#f6f9f7;border:1px solid #dfe8e3;border-radius:9px;font-size:11px;font-weight:700}.crm-page .crm-person-readonly small{display:block;color:var(--crm-muted);font-weight:500;margin-top:2px}@media(max-width:600px){.crm-page .crm-followup-edit-grid{grid-template-columns:1fr}.crm-page .crm-followup-edit-grid .wide{grid-column:auto}}
@media(max-width:1000px){.crm-page .crm-kpis{grid-template-columns:repeat(2,1fr)}.crm-page .crm-main-grid,.crm-page .crm-footer-grid{grid-template-columns:1fr}.crm-page .crm-lead{grid-template-columns:minmax(220px,1fr) 120px auto}.crm-page .crm-lead .crm-meta.origin{display:none}}
@media(max-width:650px){.crm-page .crm-toolbar{align-items:stretch;flex-direction:column}.crm-page .crm-toolbar-left{overflow:auto;flex-wrap:nowrap;padding-bottom:2px}.crm-page .crm-tab{white-space:nowrap}.crm-page .crm-new summary{justify-content:center}.crm-page .crm-kpis{grid-template-columns:1fr 1fr;gap:8px}.crm-page .crm-kpi{padding:12px;min-height:82px}.crm-page .crm-kpi-icon{width:36px;height:36px;flex-basis:36px}.crm-page .crm-kpi strong{font-size:18px}.crm-page .crm-main-grid{gap:10px}.crm-page .crm-card{padding:14px}.crm-page .crm-pipeline{grid-template-columns:1fr 1fr}.crm-page .crm-lead{grid-template-columns:1fr auto;gap:9px}.crm-page .crm-lead .crm-meta{display:none}.crm-page .crm-actions{grid-column:2;grid-row:1}.crm-page .crm-edit[open]{grid-column:1/-1}.crm-page .crm-filterbar select{flex:1}.crm-page .crm-period .merchant-form{display:grid;grid-template-columns:1fr 1fr}.crm-page .crm-period .merchant-form button{grid-column:1/-1}.crm-page .crm-period .merchant-form label{min-width:0}}
.crm-page .crm-followup-form .merchant-form{margin-top:12px}
.crm-page .crm-followup-form .merchant-form label{display:block}
.crm-page .crm-followup-form .merchant-form label>span{display:block;font-size:11px;font-weight:700;margin-bottom:6px;color:var(--crm-text)}
.crm-page .crm-followup-form .merchant-form label>span b{color:var(--crm-red)}
.crm-page .crm-person-select{width:100%;min-height:42px;border:1px solid var(--crm-border);border-radius:10px;padding:9px 11px;background:var(--card-bg,#fff);color:inherit;font:inherit}
.crm-page .crm-quick-dates{display:flex;gap:7px;flex-wrap:wrap;margin:-3px 0 11px}
.crm-page .crm-quick-dates button{border:1px solid var(--crm-border);background:#fff;border-radius:999px;padding:6px 10px;font-size:10px;font-weight:700;color:#355047;cursor:pointer}
.crm-page .crm-quick-dates button:hover{border-color:#9dcbb4;background:#f1faf5;color:#0d7750}

/* --- Negociante: início (âmbito .merchant-home) (negociante/index.php) --- */
.merchant.merchant-home{max-width:1240px;padding-bottom:110px}
.merchant-home .merchant-header{margin-bottom:14px}
.merchant-home .app-hero{position:relative;overflow:hidden;background:linear-gradient(145deg,#092b24 0%,#0b5137 58%,#0b6a42 100%);color:#fff;border-radius:24px;padding:26px;margin-bottom:16px;box-shadow:0 18px 45px rgba(5,73,48,.16)}
.merchant-home .app-hero:after{content:"";position:absolute;width:230px;height:230px;border-radius:50%;right:-70px;top:-105px;background:rgba(255,255,255,.08)}
.merchant-home .app-hero-top{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;position:relative;z-index:2}
.merchant-home .app-eyebrow{font-size:12px;opacity:.78;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.merchant-home .app-hero h2{font-size:27px;margin:5px 0 7px;color:#fff}
.merchant-home .app-hero p{font-size:13px;margin:0;color:rgba(255,255,255,.76)}
.merchant-home .app-month{background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.17);border-radius:12px;padding:9px 12px;font-size:12px;white-space:nowrap}
.merchant-home .app-balance{margin-top:25px;position:relative;z-index:2}
.merchant-home .app-balance small{display:block;font-size:12px;color:rgba(255,255,255,.70);margin-bottom:6px}
.merchant-home .app-balance strong{font-size:35px;line-height:1;letter-spacing:-.03em}
.merchant-home .app-balance-meta{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.merchant-home .app-chip{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.13);border-radius:999px;padding:7px 10px;font-size:11px}
.merchant-home .app-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:22px 0 11px}
.merchant-home .app-section-head h2{font-size:17px;margin:0}
.merchant-home .app-section-head a{font-size:12px;text-decoration:none;color:#087844;font-weight:700}
.merchant-home .quick-actions{display:grid;grid-template-columns:repeat(5,1fr);gap:11px;margin-bottom:18px}
.merchant-home .quick-action{display:flex;flex-direction:column;align-items:flex-start;gap:12px;text-decoration:none;color:#173026;border:1px solid transparent;border-radius:18px;padding:16px;min-height:112px;transition:.18s ease;box-shadow:none;position:relative;overflow:hidden}
.merchant-home .quick-action:after{content:"";position:absolute;width:86px;height:86px;border-radius:50%;right:-26px;top:-28px;background:rgba(255,255,255,.38)}
.merchant-home .quick-action:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(22,64,45,.08)}
.merchant-home .qa-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;font-size:19px;background:rgba(255,255,255,.78);color:#087844;font-weight:800;position:relative;z-index:2;box-shadow:0 5px 12px rgba(0,0,0,.05)}
.merchant-home .quick-action:nth-child(1){background:linear-gradient(145deg,#e8f8ef,#dff3e8);border-color:#cbe9d7}
.merchant-home .quick-action:nth-child(2){background:linear-gradient(145deg,#edf4ff,#e5efff);border-color:#d6e4fb}
.merchant-home .quick-action:nth-child(3){background:linear-gradient(145deg,#fff6e8,#ffefda);border-color:#f4dfbf}
.merchant-home .quick-action:nth-child(4){background:linear-gradient(145deg,#f3efff,#ebe5ff);border-color:#ddd4fb}
.merchant-home .quick-action:nth-child(5){background:linear-gradient(145deg,#fff0ef,#fbe5e2);border-color:#f1d3cf}
.merchant-home .quick-action:nth-child(2) .qa-icon{color:#2f67d7}
.merchant-home .quick-action:nth-child(3) .qa-icon{color:#c36a00}
.merchant-home .quick-action:nth-child(4) .qa-icon{color:#7350c8}
.merchant-home .quick-action:nth-child(5) .qa-icon{color:#c34b43}
.merchant-home .quick-action strong{font-size:13px;position:relative;z-index:2}
.merchant-home .quick-action span{font-size:11px;color:#607269;line-height:1.35;position:relative;z-index:2}
.merchant-home .app-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}
.merchant-home .app-stat{background:var(--card-bg,#fff);border:1px solid #dde7e0;border-radius:18px;padding:17px;position:relative;overflow:hidden}
.merchant-home .app-stat span{font-size:11px;color:#748078;display:block;margin-bottom:8px}
.merchant-home .app-stat strong{font-size:22px;letter-spacing:-.025em;display:block}
.merchant-home .app-stat small{font-size:10px;color:#8d9891;margin-top:6px;display:block}
.merchant-home .app-stat.primary{background:#f0fbf4;border-color:#cfead9}
.merchant-home .app-stat.primary strong{color:#087844}
.merchant-home .app-dashboard-grid{display:grid;grid-template-columns:1.55fr .9fr;gap:15px;align-items:start}
.merchant-home .app-panel{background:var(--card-bg,#fff);border:1px solid #dde7e0;border-radius:20px;padding:18px;margin-bottom:15px;box-shadow:0 8px 26px rgba(22,64,45,.03)}
.merchant-home .app-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.merchant-home .app-panel-head h2{font-size:16px;margin:0}
.merchant-home .app-panel-head p{font-size:11px;color:#7b8780;margin:3px 0 0}
.merchant-home .app-panel-head a{font-size:11px;color:#087844;text-decoration:none;font-weight:700}
.merchant-home .alert-stack{display:grid;gap:9px}
.merchant-home .alert-item{display:flex;gap:11px;align-items:center;padding:11px;border-radius:14px;background:#f8faf8;border:1px solid #eef2ef}
.merchant-home .alert-dot{width:9px;height:9px;border-radius:50%;background:#d88c24;flex:0 0 auto;box-shadow:0 0 0 5px #fff3de}
.merchant-home .alert-item.danger .alert-dot{background:#ca493d;box-shadow:0 0 0 5px #fdeceb}
.merchant-home .alert-item.success .alert-dot{background:#15955a;box-shadow:0 0 0 5px #e8f8ef}
.merchant-home .alert-copy{min-width:0;flex:1}
.merchant-home .alert-copy strong{display:block;font-size:12px}
.merchant-home .alert-copy span{display:block;font-size:10px;color:#7a867f;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.merchant-home .alert-value{font-size:11px;font-weight:700;white-space:nowrap}
.merchant-home .sale-toggle{appearance:none;border:0;background:#087844;color:#fff;border-radius:12px;padding:10px 14px;font-weight:700;cursor:pointer;font-family:inherit}
.merchant-home .sale-sheet{display:none;margin-top:14px;padding-top:14px;border-top:1px solid #edf1ee}
.merchant-home .sale-sheet.open{display:block}
.merchant-home .sale-sheet .merchant-form{margin:0}
.merchant-home .sale-sheet .merchant-form label{font-weight:600;color:#45534b}
.merchant-home .sale-sheet .merchant-form input,.merchant-home .sale-sheet .merchant-form select{min-height:43px;border-radius:11px;background:#fbfdfb}
.merchant-home .sale-sheet .button-primary{border-radius:11px}
.merchant-home .sale-list{display:grid;gap:8px}
.merchant-home .sale-item{display:grid;grid-template-columns:44px 1fr auto;gap:11px;align-items:center;padding:11px 5px;border-bottom:1px solid #edf1ee}
.merchant-home .sale-item:last-child{border-bottom:0}
.merchant-home .sale-icon{width:42px;height:42px;border-radius:13px;background:#edf8f1;color:#087844;display:grid;place-items:center;font-weight:800;font-size:16px}
.merchant-home .sale-info{min-width:0}
.merchant-home .sale-info strong{font-size:12px;display:block}
.merchant-home .sale-info span{font-size:10px;color:#7a867f;display:block;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.merchant-home .sale-amount{text-align:right}
.merchant-home .sale-amount strong{font-size:12px;display:block}
.merchant-home .sale-amount span{font-size:9px;color:#89948e}
.merchant-home .stock-list{display:grid;gap:8px}
.merchant-home .stock-item{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #edf1ee}
.merchant-home .stock-item:last-child{border-bottom:0}
.merchant-home .stock-icon{width:35px;height:35px;border-radius:11px;background:#fff3df;color:#b86c09;display:grid;place-items:center}
.merchant-home .stock-copy{flex:1;min-width:0}
.merchant-home .stock-copy strong{font-size:11px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.merchant-home .stock-copy span{font-size:10px;color:#808a84}
.merchant-home .stock-qty{font-size:11px;font-weight:800;color:#b45f00}
.merchant-home .empty-app{padding:20px;border-radius:14px;background:#f7faf8;text-align:center;color:#718078;font-size:12px}
.merchant-home .app-bottom-nav{display:none}
@media (max-width:900px){.merchant-home .quick-actions{grid-template-columns:repeat(3,1fr)}
.merchant-home .app-stats{grid-template-columns:repeat(2,1fr)}
.merchant-home .app-dashboard-grid{grid-template-columns:1fr}}
@media (max-width:600px){.merchant.merchant-home{padding-top:2px;padding-bottom:95px}
.merchant-home .merchant-header{margin-bottom:10px}
.merchant-home .merchant-header>nav{display:none}
.merchant-home .app-hero{border-radius:20px;padding:20px;margin-left:-2px;margin-right:-2px}
.merchant-home .app-hero h2{font-size:23px}
.merchant-home .app-balance strong{font-size:30px}
.merchant-home .app-month{font-size:10px;padding:8px 9px}
.merchant-home .app-balance-meta{gap:7px}
.merchant-home .app-chip{font-size:9px}
.merchant-home .quick-actions{grid-template-columns:repeat(3,1fr);gap:8px}
.merchant-home .quick-action{min-height:95px;padding:12px;border-radius:16px;gap:9px}
.merchant-home .qa-icon{width:36px;height:36px;border-radius:11px}
.merchant-home .quick-action strong{font-size:11px}
.merchant-home .quick-action span{display:none}
.merchant-home .app-stats{gap:8px}
.merchant-home .app-stat{padding:14px;border-radius:16px}
.merchant-home .app-stat strong{font-size:18px}
.merchant-home .app-stat span{font-size:10px}
.merchant-home .app-stat small{font-size:9px}
.merchant-home .app-panel{border-radius:18px;padding:15px}
.merchant-home .sale-item{grid-template-columns:40px 1fr auto}
.merchant-home .sale-icon{width:38px;height:38px}
.merchant-home .app-bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:8px;right:8px;bottom:8px;z-index:90;background:rgba(255,255,255,.96);border:1px solid #dbe6df;border-radius:18px;padding:7px;box-shadow:0 14px 38px rgba(29,55,42,.18);backdrop-filter:blur(14px)}
.merchant-home .app-bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:46px;text-decoration:none;color:#728078;font-size:9px;font-weight:600;border-radius:12px}
.merchant-home .app-bottom-nav a.active{background:#eaf8ef;color:#087844}
.merchant-home .app-bottom-nav b{font-size:18px;line-height:1}}
.merchant-home .quick-sale-panel{overflow:hidden}
.merchant-home .quick-sale-form{display:grid;gap:17px}
.merchant-home .qs-label,.merchant-home .qs-field{font-size:12px;font-weight:700;color:#3e5147}
.merchant-home .qs-field{display:grid;gap:7px}
.merchant-home .qs-search-wrap{height:44px;display:flex;align-items:center;gap:9px;border:1px solid #d8e4dc;border-radius:12px;padding:0 12px;background:#fbfdfb;margin:7px 0 8px}
.merchant-home .qs-search-wrap input{border:0!important;background:transparent!important;outline:0;width:100%;padding:0!important;min-height:0!important}
.merchant-home .qs-product-select,.merchant-home .qs-field input,.merchant-home .qs-field select{width:100%;min-height:44px;border:1px solid #d6e2da;border-radius:12px;background:#fff;padding:0 12px;font:inherit;color:inherit}
.merchant-home .qs-product-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.merchant-home .qs-product-meta span{font-size:10px;background:#f1f7f3;border-radius:999px;padding:6px 9px;color:#607168}
.merchant-home .qs-two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.merchant-home .qs-qty-control{display:grid;grid-template-columns:42px 1fr 42px;height:44px;border:1px solid #d6e2da;border-radius:12px;overflow:hidden;background:#fff}
.merchant-home .qs-qty-control button{border:0;background:#f4f8f5;font-size:20px;color:#087844;cursor:pointer}
.merchant-home .qs-qty-control input{border:0!important;border-radius:0!important;text-align:center;padding:0!important;min-height:42px!important;font-weight:800}
.merchant-home .qs-money-input{display:flex;align-items:center;border:1px solid #d6e2da;border-radius:12px;background:#fff;overflow:hidden}
.merchant-home .qs-money-input span{padding:0 10px;font-size:11px;font-weight:800;color:#708078}
.merchant-home .qs-money-input input{border:0!important;border-radius:0!important;padding-left:0!important}
.merchant-home .qs-payment-section{display:grid;gap:8px}
.merchant-home .qs-payment-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.merchant-home .qs-pay{appearance:none;border:1px solid #dce6df;background:#fff;border-radius:13px;min-height:67px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:#617168;cursor:pointer;font-family:inherit}
.merchant-home .qs-pay b{font-size:16px}
.merchant-home .qs-pay span{font-size:10px;font-weight:700}
.merchant-home .qs-pay.active{background:#eaf8ef;border-color:#a9d8bc;color:#087844;box-shadow:0 0 0 2px rgba(8,120,68,.05)}
.merchant-home .qs-credit{background:#fff7e9;border:1px solid #f3dfbb;border-radius:14px;padding:13px}
.merchant-home .qs-credit-head{margin-bottom:10px}
.merchant-home .qs-credit-head strong{font-size:12px;display:block}
.merchant-home .qs-credit-head span{font-size:10px;color:#8a7451}
.merchant-home .qs-more{border-top:1px solid #edf1ee;padding-top:12px}
.merchant-home .qs-more summary{font-size:11px;color:#607168;cursor:pointer}
.merchant-home .qs-more-grid{margin-top:12px}
.merchant-home .qs-summary{background:#0b5137;color:#fff;border-radius:16px;padding:16px;display:flex;align-items:end;justify-content:space-between;gap:12px}
.merchant-home .qs-summary span{font-size:10px;display:block;color:rgba(255,255,255,.72);margin-bottom:4px}
.merchant-home .qs-summary strong{font-size:25px;letter-spacing:-.03em}
.merchant-home .qs-summary small{font-size:9px;color:rgba(255,255,255,.66);max-width:180px;text-align:right}
.merchant-home .qs-submit{appearance:none;border:0;border-radius:13px;background:#087844;color:#fff;min-height:49px;font:800 13px/1 inherit;cursor:pointer;box-shadow:0 8px 20px rgba(8,120,68,.16)}
.merchant-home .qs-submit:disabled{opacity:.5;cursor:not-allowed}
@media (max-width:600px){.merchant-home .qs-two-col{grid-template-columns:1fr}
.merchant-home .qs-payment-grid{grid-template-columns:repeat(3,1fr)}
.merchant-home .qs-pay{min-height:62px}
.merchant-home .qs-summary{align-items:flex-start}
.merchant-home .qs-summary small{display:none}
.merchant-home .qs-submit{min-height:52px;font-size:14px}}
.merchant-home .quick-actions-4{grid-template-columns:repeat(4,1fr)}
.merchant-home .app-section-hint{font-size:11px;color:#849087}
.merchant-home .quick-actions-4 .quick-action:nth-child(1){background:linear-gradient(145deg,#e8f8ef,#dff3e8);border-color:#cbe9d7}
.merchant-home .quick-actions-4 .quick-action:nth-child(2){background:linear-gradient(145deg,#fff0ef,#fbe5e2);border-color:#f1d3cf}
.merchant-home .quick-actions-4 .quick-action:nth-child(3){background:linear-gradient(145deg,#edf4ff,#e5efff);border-color:#d6e4fb}
.merchant-home .quick-actions-4 .quick-action:nth-child(4){background:linear-gradient(145deg,#fff6e8,#ffefda);border-color:#f4dfbf}
.merchant-home .quick-actions-4 .quick-action:nth-child(2) .qa-icon{color:#c34b43}
.merchant-home .quick-actions-4 .quick-action:nth-child(3) .qa-icon{color:#2f67d7}
.merchant-home .quick-actions-4 .quick-action:nth-child(4) .qa-icon{color:#c36a00}
@media (max-width:900px){.merchant-home .quick-actions-4{grid-template-columns:repeat(2,1fr)}}
@media (max-width:600px){.merchant-home .quick-actions-4{grid-template-columns:repeat(4,1fr)}
.merchant-home .quick-actions-4 .quick-action{min-height:84px;padding:11px 7px;align-items:center;text-align:center}
.merchant-home .quick-actions-4 .qa-icon{width:38px;height:38px}
.merchant-home .quick-actions-4 .quick-action span:last-child{display:none}}
.merchant-home .merchant-proto-finance{background:linear-gradient(140deg,#0A2540,#153F61);border-radius:27px;padding:20px;color:#fff;box-shadow:0 18px 36px rgba(10,37,64,.2);position:relative;overflow:hidden;margin-bottom:21px}
.merchant-home .merchant-proto-finance:after{content:"";position:absolute;width:180px;height:180px;border-radius:50%;background:rgba(255,255,255,.045);right:-75px;top:-80px}
.merchant-home .merchant-proto-finance>*{position:relative;z-index:2}
.merchant-home .merchant-proto-finance-top{display:flex;justify-content:space-between;align-items:flex-start}
.merchant-home .merchant-proto-finance-top small{display:block;font-size:12px;color:rgba(255,255,255,.75);margin-bottom:6px}
.merchant-home .merchant-proto-finance-top strong{font-size:33px;line-height:1.05;letter-spacing:-1px}
.merchant-home .merchant-proto-month{font-size:11px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.09);border-radius:999px;padding:7px 10px}
.merchant-home .merchant-proto-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:17px}
.merchant-home .merchant-proto-grid span{background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.06);border-radius:15px;padding:10px;min-width:0}
.merchant-home .merchant-proto-grid small{font-size:9px;opacity:.7;display:block;margin-bottom:4px}
.merchant-home .merchant-proto-grid b{font-size:12.5px;white-space:nowrap;display:block;overflow:hidden;text-overflow:ellipsis}
.merchant-home .merchant-proto-profit{margin-top:10px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.07);border-radius:16px;padding:12px 13px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.merchant-home .merchant-proto-profit span{font-size:11px;opacity:.76}
.merchant-home .merchant-proto-profit strong{font-size:16px}
.merchant-home .merchant-proto-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:16px}
.merchant-home .merchant-proto-action{display:block;text-align:center;text-decoration:none;color:#0A2540}
.merchant-home .merchant-proto-action i{width:58px;height:58px;margin:0 auto 7px;border-radius:18px;background:#fff;border:1px solid #E7ECF0;display:grid;place-items:center;font-style:normal;font-size:20px;box-shadow:0 10px 28px rgba(10,37,64,.07)}
.merchant-home .merchant-proto-action.primary i{background:#16A36A;color:#fff;border-color:#16A36A}
.merchant-home .merchant-proto-action b{font-size:10.5px;display:block}
.merchant-home .merchant-proto-tags{display:flex;gap:8px;overflow-x:auto;margin:0 0 21px;scrollbar-width:none}
.merchant-home .merchant-proto-tags a{flex:0 0 auto;border:1px solid #E7ECF0;background:#fff;color:#0A2540;border-radius:999px;padding:9px 12px;font-size:10.5px;font-weight:800;text-decoration:none}
.merchant-home .merchant-proto-summary{display:grid;grid-template-columns:repeat(3,1fr);background:#fff;border:1px solid #E7ECF0;border-radius:20px;overflow:hidden;margin-bottom:18px}
.merchant-home .merchant-proto-summary>div{padding:14px;border-right:1px solid #E7ECF0}
.merchant-home .merchant-proto-summary>div:last-child{border-right:0}
.merchant-home .merchant-proto-summary small{display:block;color:#7A8792;font-size:10.5px;margin-bottom:5px}
.merchant-home .merchant-proto-summary strong{font-size:14px;color:#0A2540}
@media (max-width:600px){.merchant-home .merchant-proto-finance-top strong{font-size:30px}
.merchant-home .merchant-proto-actions{grid-template-columns:repeat(4,1fr)}
.merchant-home .merchant-proto-action i{width:54px;height:54px}
.merchant-home .merchant-proto-summary{grid-template-columns:1fr}
.merchant-home .merchant-proto-summary>div{border-right:0;border-bottom:1px solid #E7ECF0}
.merchant-home .merchant-proto-summary>div:last-child{border-bottom:0}}

/* --- Negócio: ponto de venda (business-pos) (partials/business-pos.php) --- */
.business-pos{
    --pos-navy:#0A2540;
    --pos-navy-2:#163C5B;
    --pos-green:#16A36A;
    --pos-green-soft:#E9F8F1;
    --pos-text:#17232D;
    --pos-muted:#6F7E89;
    --pos-line:#E2E9EE;
    --pos-bg:#F7F9FA;
    --pos-danger:#C83D43;
    display:grid;
    gap:18px;
    color:var(--pos-text);
}
.business-pos .qs-label,.business-pos .qs-field{font-size:12.5px;font-weight:750;color:var(--pos-navy)}
.business-pos .qs-field{display:grid;gap:7px}
.business-pos .qs-search-wrap{height:46px;display:flex;align-items:center;gap:9px;border:1px solid var(--pos-line);border-radius:13px;padding:0 13px;background:#fff;margin:7px 0 8px;transition:border-color .18s,box-shadow .18s}
.business-pos .qs-search-wrap:focus-within{border-color:rgba(22,163,106,.65);box-shadow:0 0 0 3px rgba(22,163,106,.10)}
.business-pos .qs-search-wrap>span{color:var(--pos-muted);font-size:16px}
.business-pos .qs-search-wrap input{border:0!important;background:transparent!important;outline:0;width:100%;padding:0!important;min-height:0!important;color:var(--pos-text);font-size:13px}
.business-pos .qs-product-select,.business-pos .qs-field input,.business-pos .qs-field select{width:100%;min-height:46px;border:1px solid var(--pos-line);border-radius:13px;background:#fff;padding:0 12px;font:inherit;color:var(--pos-text);outline:none;transition:border-color .18s,box-shadow .18s}
.business-pos .qs-product-select:focus,.business-pos .qs-field input:focus,.business-pos .qs-field select:focus{border-color:rgba(22,163,106,.65);box-shadow:0 0 0 3px rgba(22,163,106,.10)}
.business-pos .qs-product-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.business-pos .qs-product-meta span{font-size:10.5px;background:#F1F5F7;border:1px solid #E7EDF1;border-radius:999px;padding:6px 9px;color:#586873}
.business-pos .qs-two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.business-pos .qs-qty-control{display:grid;grid-template-columns:44px 1fr 44px;height:46px;border:1px solid var(--pos-line);border-radius:13px;overflow:hidden;background:#fff}
.business-pos .qs-qty-control button{border:0;background:#F3F6F8;font-size:20px;color:var(--pos-navy);cursor:pointer;transition:background .16s,color .16s}
.business-pos .qs-qty-control button:hover{background:var(--pos-green-soft);color:var(--pos-green)}
.business-pos .qs-qty-control input{border:0!important;border-radius:0!important;text-align:center;padding:0!important;min-height:44px!important;font-weight:800;color:var(--pos-navy)}
.business-pos .qs-money-input{display:flex;align-items:center;border:1px solid var(--pos-line);border-radius:13px;background:#fff;overflow:hidden}
.business-pos .qs-money-input span{padding:0 10px;font-size:11px;font-weight:800;color:var(--pos-muted)}
.business-pos .qs-money-input input{border:0!important;border-radius:0!important;padding-left:0!important;box-shadow:none!important}
.business-pos .qs-add{appearance:none;border:1px solid rgba(22,163,106,.45);background:var(--pos-green-soft);color:#0E7F52;border-radius:13px;min-height:47px;font:800 12.5px/1 inherit;cursor:pointer;transition:transform .15s,background .15s,border-color .15s}
.business-pos .qs-add:hover:not(:disabled){background:#DDF4E9;border-color:var(--pos-green)}
.business-pos .qs-add:active:not(:disabled){transform:translateY(1px)}
.business-pos .qs-add:disabled{opacity:.45;cursor:not-allowed}
.business-pos .qs-cart{display:grid;gap:9px}
.business-pos .qs-cart-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.business-pos .qs-cart-head strong{font-size:13.5px;color:var(--pos-navy)}
.business-pos .qs-cart-head span{font-size:10.5px;color:var(--pos-muted)}
.business-pos .qs-cart-empty{border:1px dashed #CED9E0;border-radius:14px;padding:17px;text-align:center;font-size:11.5px;color:var(--pos-muted);background:var(--pos-bg)}
.business-pos .qs-cart-row{display:grid;grid-template-columns:minmax(0,1.5fr) 118px 118px 36px;gap:8px;align-items:center;border:1px solid var(--pos-line);border-radius:15px;padding:10px;background:#fff;box-shadow:0 5px 16px rgba(10,37,64,.035)}
.business-pos .qs-cart-name{min-width:0}
.business-pos .qs-cart-name strong{display:block;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--pos-navy)}
.business-pos .qs-cart-name small{display:block;margin-top:3px;font-size:9.5px;color:var(--pos-muted)}
.business-pos .qs-cart-row .qs-qty-control{height:39px;grid-template-columns:35px 1fr 35px}
.business-pos .qs-cart-row .qs-qty-control input{min-height:37px!important;font-size:12px}
.business-pos .qs-cart-row .qs-qty-control button{font-size:17px}
.business-pos .qs-cart-price{min-height:39px!important;height:39px;padding:0 8px!important;font-size:12px}
.business-pos .qs-cart-remove{width:36px;height:36px;border:0;border-radius:10px;background:#FFF0F1;color:var(--pos-danger);cursor:pointer;font-size:16px}
.business-pos .qs-cart-subtotal{grid-column:1/-1;text-align:right;font-size:10.5px;color:#596A75;font-weight:700}
.business-pos .qs-payment-section{display:grid;gap:8px}
.business-pos .qs-payment-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.business-pos .qs-pay{appearance:none;border:1px solid var(--pos-line);background:#fff;border-radius:14px;min-height:69px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:#61717C;cursor:pointer;font-family:inherit;transition:border-color .16s,background .16s,color .16s,box-shadow .16s}
.business-pos .qs-pay b{font-size:16px}
.business-pos .qs-pay span{font-size:10.5px;font-weight:750}
.business-pos .qs-pay:hover{border-color:#C7D4DC;background:#FBFCFD}
.business-pos .qs-pay.active{background:var(--pos-green-soft);border-color:rgba(22,163,106,.55);color:#0D7E51;box-shadow:0 0 0 2px rgba(22,163,106,.06)}
.business-pos .qs-credit{background:#FFF9EE;border:1px solid #F0DEBB;border-radius:15px;padding:13px}
.business-pos .qs-credit-head{margin-bottom:10px}
.business-pos .qs-credit-head strong{font-size:12.5px;display:block;color:#70501D}
.business-pos .qs-credit-head span{font-size:10.5px;color:#8A7451}
.business-pos .qs-more{border-top:1px solid #E9EEF2;padding-top:12px}
.business-pos .qs-more summary{font-size:11.5px;font-weight:700;color:#566874;cursor:pointer}
.business-pos .qs-more-grid{margin-top:12px}
.business-pos .qs-summary{background:linear-gradient(140deg,var(--pos-navy),var(--pos-navy-2));color:#fff;border-radius:17px;padding:17px;display:flex;align-items:end;justify-content:space-between;gap:12px;box-shadow:0 12px 26px rgba(10,37,64,.16)}
.business-pos .qs-summary span{font-size:10.5px;display:block;color:rgba(255,255,255,.72);margin-bottom:4px}
.business-pos .qs-summary strong{font-size:26px;letter-spacing:-.03em}
.business-pos .qs-summary small{font-size:9.5px;color:rgba(255,255,255,.70);max-width:210px;text-align:right}
.business-pos .qs-submit{appearance:none;border:0;border-radius:14px;background:var(--pos-green);color:#fff;min-height:51px;font:850 13.5px/1 inherit;cursor:pointer;box-shadow:0 10px 22px rgba(22,163,106,.22);transition:transform .15s,filter .15s,box-shadow .15s}
.business-pos .qs-submit:hover:not(:disabled){filter:brightness(.97);box-shadow:0 12px 25px rgba(22,163,106,.27)}
.business-pos .qs-submit:active:not(:disabled){transform:translateY(1px)}
.business-pos .qs-submit:disabled{opacity:.48;cursor:not-allowed;box-shadow:none}
.business-pos-empty{padding:20px;border-radius:14px;background:#F7F9FA;border:1px solid var(--pos-line);text-align:center;color:var(--pos-muted);font-size:12px}
@media(max-width:700px){
    .business-pos{gap:16px}
    .business-pos .qs-cart-row{grid-template-columns:minmax(0,1fr) minmax(90px,.7fr) 36px;padding:10px}
    .business-pos .qs-cart-name{grid-column:1/3}
    .business-pos .qs-cart-remove{grid-column:3/4;grid-row:1}
    .business-pos .qs-cart-row>.qs-qty-control{grid-column:1/2}
    .business-pos .qs-cart-row>.qs-cart-price{grid-column:2/4;width:100%}
    .business-pos .qs-cart-subtotal{grid-column:1/-1}
    .business-pos .qs-two-col{grid-template-columns:1fr}
    .business-pos .qs-payment-grid{grid-template-columns:repeat(3,1fr)}
    .business-pos .qs-pay{min-height:64px}
    .business-pos .qs-summary{align-items:flex-start}
    .business-pos .qs-summary small{display:none}
    .business-pos .qs-submit{min-height:54px;font-size:14px}
}

/* --- Relatórios do negócio (relatorios/negocio.php) --- */
.expense-clarity-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 16px;
        align-items: center;
        padding: 18px;
        margin-bottom: 14px;
        border: 1px solid rgba(239, 68, 68, .14);
        border-radius: 20px;
        background: linear-gradient(135deg, rgba(254, 242, 242, .96), rgba(255, 255, 255, .98));
        box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    }

    .expense-clarity-hero small,
    .expense-clarity-card small,
    .expense-impact-card small,
    .expense-ranking-meta,
    .expense-clarity-note small {
        color: #64748b;
    }

    .expense-clarity-hero h3 {
        margin: 4px 0 6px;
        font-size: clamp(1.7rem, 6vw, 2.35rem);
        line-height: 1;
        letter-spacing: -.04em;
        color: #0f172a;
    }

    .expense-clarity-hero p {
        margin: 0;
        color: #475569;
        font-size: .82rem;
        line-height: 1.45;
    }

    .expense-trend-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 76px;
        padding: 10px 12px;
        border-radius: 999px;
        font-weight: 800;
        font-size: .84rem;
        white-space: nowrap;
        color: #334155;
        background: #f1f5f9;
    }

    .expense-trend-badge.negative {
        color: #b91c1c;
        background: #fee2e2;
    }

    .expense-trend-badge.positive {
        color: #047857;
        background: #d1fae5;
    }

    .expense-clarity-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }

    .expense-clarity-card {
        min-width: 0;
        padding: 14px;
        border: 1px solid #e8edf4;
        border-radius: 16px;
        background: #fff;
    }

    .expense-clarity-card span {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
    }

    .expense-clarity-card strong {
        display: block;
        overflow: hidden;
        color: #0f172a;
        font-size: 1rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .expense-clarity-card small {
        display: block;
        margin-top: 4px;
        font-size: .72rem;
        line-height: 1.35;
    }

    .expense-impact-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        align-items: center;
        padding: 15px;
        margin-bottom: 16px;
        border-radius: 17px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .expense-impact-card strong {
        display: block;
        margin: 3px 0;
        color: #0f172a;
        font-size: 1rem;
    }

    .expense-impact-meter {
        width: 88px;
        height: 8px;
        overflow: hidden;
        border-radius: 999px;
        background: #e2e8f0;
    }

    .expense-impact-meter span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: #ef4444;
    }

    .expense-ranking-head {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
        margin: 4px 0 10px;
    }

    .expense-ranking-head h3 {
        margin: 0;
        color: #0f172a;
        font-size: .98rem;
    }

    .expense-ranking-head small {
        color: #64748b;
        text-align: right;
    }

    .expense-ranking-list {
        display: grid;
        gap: 9px;
    }

    .expense-ranking-row {
        padding: 13px;
        border: 1px solid #e8edf4;
        border-radius: 16px;
        background: #fff;
    }

    .expense-ranking-top {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
    }

    .expense-ranking-position {
        display: grid;
        width: 30px;
        height: 30px;
        place-items: center;
        border-radius: 10px;
        color: #64748b;
        background: #f1f5f9;
        font-size: .76rem;
        font-weight: 800;
    }

    .expense-ranking-name {
        min-width: 0;
    }

    .expense-ranking-name strong {
        display: block;
        overflow: hidden;
        color: #0f172a;
        font-size: .9rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .expense-ranking-meta {
        display: block;
        margin-top: 3px;
        font-size: .72rem;
    }

    .expense-ranking-value {
        text-align: right;
    }

    .expense-ranking-value strong {
        display: block;
        color: #b91c1c;
        font-size: .9rem;
    }

    .expense-ranking-value small {
        color: #64748b;
        font-size: .7rem;
    }

    .expense-share-track {
        height: 7px;
        margin-top: 11px;
        overflow: hidden;
        border-radius: 999px;
        background: #eef2f7;
    }

    .expense-share-track span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #fb7185, #ef4444);
    }

    .expense-clarity-note {
        display: flex;
        gap: 11px;
        align-items: flex-start;
        padding: 13px;
        margin-top: 14px;
        border-radius: 15px;
        color: #334155;
        background: #fff7ed;
        border: 1px solid #fed7aa;
    }

    .expense-clarity-note strong {
        display: block;
        margin-bottom: 2px;
        font-size: .82rem;
    }

    @media (max-width: 640px) {
        .expense-clarity-grid {
            grid-template-columns: 1fr 1fr;
        }

        .expense-clarity-card:last-child {
            grid-column: 1 / -1;
        }
    }

    @media (max-width: 420px) {
        .expense-clarity-hero,
        .expense-impact-card {
            grid-template-columns: 1fr;
        }

        .expense-trend-badge {
            width: fit-content;
        }

        .expense-impact-meter {
            width: 100%;
        }
    }

    .business-reports {
        --report-primary: var(--primary, #087b31);
        --report-primary-dark: var(--primary-dark, #056527);
        --report-primary-soft: var(--primary-soft, #e1f6e8);
        --report-surface: var(--surface, #fff);
        --report-line: var(--line, #dde6f2);
        --report-muted: var(--muted, #667085);
    }

    .business-reports .phone-dashboard-content {
        max-width: 1180px;
    }

    .business-report-layout-note {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 13px 14px;
        margin: 0 0 14px;
        border: 1px solid rgba(8, 123, 49, .14);
        border-radius: 8px;
        color: #254536;
        background: linear-gradient(135deg, rgba(225, 246, 232, .92), rgba(255, 255, 255, .96));
    }

    .business-report-layout-note strong,
    .business-report-layout-note small {
        display: block;
    }

    .business-report-layout-note strong {
        font-size: .9rem;
    }

    .business-report-layout-note small {
        margin-top: 3px;
        color: var(--report-muted);
        font-size: .72rem;
        line-height: 1.35;
    }

    .business-report-layout-note > span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        flex: 0 0 auto;
        border-radius: 8px;
        color: var(--report-primary);
        background: #fff;
        box-shadow: 0 10px 24px rgba(8, 123, 49, .12);
    }

    .business-report-tabs {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding: 7px;
        margin: 0 0 16px;
        border: 1px solid var(--report-line);
        border-radius: 8px;
        background: rgba(244, 247, 251, .94);
        backdrop-filter: blur(14px);
        scrollbar-width: none;
    }

    .business-report-tabs::-webkit-scrollbar {
        display: none;
    }

    .business-report-tab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 0 15px;
        border: 0;
        border-radius: 8px;
        color: #506070;
        background: transparent;
        cursor: pointer;
        font-size: .78rem;
        font-weight: 850;
        white-space: nowrap;
        transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
    }

    .business-report-tab:hover {
        transform: translateY(-1px);
        color: var(--report-primary);
        background: #fff;
    }

    .business-report-tab.is-active {
        color: #fff;
        background: linear-gradient(135deg, var(--report-primary), var(--report-primary-dark));
        box-shadow: 0 10px 22px rgba(8, 123, 49, .20);
    }

    .business-report-tab .nav-svg {
        width: 18px;
        height: 18px;
    }

    .business-report-tab-panel {
        display: none;
        animation: businessReportReveal .2s ease;
    }

    [data-business-report-section][hidden] {
        display: none !important;
    }

    .business-report-tab-panel.is-active {
        display: grid;
        gap: 14px;
    }

    .business-report-overview-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
        gap: 14px;
        align-items: start;
    }

    .business-report-overview-grid .phone-report-balance,
    .business-report-overview-grid .report-flow-panel {
        margin: 0;
    }

    .business-report-tab-panel .phone-panel,
    .business-report-tab-panel .phone-report-stats,
    .business-report-tab-panel .phone-insights {
        margin-top: 0;
    }

    .business-report-tab-panel .phone-report-stats {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
    }

    .business-report-tab-panel .phone-insights {
        display: grid;
        gap: 10px;
    }

    .business-report-tab-panel .phone-insights .phone-section-head {
        margin-bottom: 0;
    }

    .report-pending-strip {
        display: flex;
        align-items: center;
        gap: 18px;
        padding: 13px 16px;
        margin-top: 14px;
        border: 1px solid var(--report-line);
        border-radius: 14px;
        background: var(--report-primary-soft);
        text-decoration: none;
        transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
    }

    .report-pending-strip:hover {
        background: var(--report-surface);
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .report-pending-strip > span {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .report-pending-strip > span small {
        color: var(--report-muted);
        font-size: .68rem;
        font-weight: 750;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .report-pending-strip > span b {
        color: #0f172a;
        font-size: .92rem;
        font-weight: 850;
    }

    .report-pending-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-left: auto;
        padding: 9px 14px;
        border-radius: 999px;
        color: var(--report-primary);
        background: var(--report-surface);
        font-size: .76rem;
        font-weight: 850;
        white-space: nowrap;
        box-shadow: 0 8px 18px rgba(8, 123, 49, .16);
    }

    .report-pending-link svg {
        width: 16px;
        height: 16px;
    }

    @media (max-width: 480px) {
        .report-pending-strip {
            flex-wrap: wrap;
            gap: 10px 18px;
        }

        .report-pending-link {
            margin-left: 0;
            width: 100%;
            justify-content: center;
        }
    }

    @keyframes businessReportReveal {
        from {
            opacity: 0;
            transform: translateY(5px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }

    @media (max-width: 980px) {
        .business-report-overview-grid,
        .business-report-tab-panel .phone-report-stats {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 640px) {
        .business-report-layout-note {
            align-items: flex-start;
        }

        .business-report-tabs {
            margin-left: -2px;
            margin-right: -2px;
        }

        .business-report-tab {
            min-height: 39px;
            padding: 0 12px;
            font-size: .74rem;
        }
    }

/* --- Classes que substituem estilos inline (negociante/crm.php, negociante/index.php) --- */
.crm-page a.crm-alert,
.merchant-home a.alert-item { color: inherit; text-decoration: none; }
.crm-page .crm-alert-dot.is-danger { background: var(--km-danger); }
.crm-page .crm-alert-dot.is-warning { background: var(--km-warning); }
.crm-page .crm-alert-dot.is-info { background: var(--km-info); }
.crm-page .crm-min-w0 { min-width: 0; }
.crm-page .crm-gap-top-xs { margin-top: var(--km-space-2); }
.crm-page .crm-gap-top-sm { margin-top: 10px; }
.crm-page .crm-gap-top-md { margin-top: var(--km-space-3); }
.crm-page .crm-field-label { display: block; margin-bottom: 6px; font-size: var(--km-text-xs); font-weight: 700; }
.crm-page .crm-rate-block { padding: 2px 0 14px; }
.crm-page .crm-rate-row { display: flex; align-items: flex-end; gap: var(--km-space-2); margin-top: var(--km-space-1); }
.crm-page .crm-rate-value { font-size: 1.875rem; line-height: 1; }
.crm-page .crm-rate-note { font-size: var(--km-text-xs); }
.crm-page .crm-origins { margin-top: 18px; }
.crm-page .crm-origins-title { font-weight: 700; }
.crm-page .crm-card-link-spaced { display: inline-block; margin-top: var(--km-space-4); }
.merchant-links.merchant-links-flush { margin: 0; }

/* ===== 13. Correcções finais (UI uniformização) ===== */
body.km-ui .merchant-more-sheet:not(.open){visibility:hidden;transition:transform .22s ease,visibility 0s linear .22s}
body.km-ui .merchant-more-sheet.open{visibility:visible;transition:transform .22s ease,visibility 0s}
.km-plus-ico{display:inline-block;vertical-align:middle;flex:none}
.km-arrow{white-space:nowrap;display:inline-block}
body.km-ui .merchant-card span,body.km-ui .app-panel-head>a,body.km-ui .crm-card-link{white-space:nowrap}
/* Negociante – início: valores do herói sem reticências e acção principal verde também no escuro */
.merchant-home .merchant-proto-grid b{white-space:normal;overflow:visible;text-overflow:clip;font-size:12px;line-height:1.25;overflow-wrap:anywhere}
html[data-theme="escuro"] body.km-ui .merchant-home .merchant-proto-action.primary i{background:#16A36A;color:#fff;border-color:#16A36A}
/* No telemóvel a barra superior já diz "Olá, …": esconder o título repetido no início do negociante */
@media (max-width: 899.98px){body.km-app:not(#km-boost) .merchant-home>.merchant-header{display:none}}
/* CRM: cabeçalho do cartão pode quebrar linha; etapas do pipeline como mini-cartões */
body.km-ui .crm-page .crm-card-head{flex-wrap:wrap}
body.km-ui .crm-page .crm-card-head>div{min-width:0;flex:1 1 180px}
body.km-ui .crm-page .crm-stage{min-width:0;white-space:normal}
html[data-theme="escuro"] body.km-ui .crm-page .crm-kpi-icon{background:var(--km-surface-2)}
/* Acções rápidas em scroll: rótulos completos (até 2 linhas) em vez de reticências */
body.km-ui:not(#km-boost) .business-action-grid{grid-auto-columns:minmax(92px,1fr)}
body.km-ui:not(#km-boost) :is(.phone-quick-actions,.business-action-grid)>:is(a,button)>:is(span,b,strong):not(.nav-svg):not(.phone-icon){white-space:normal;overflow:visible;text-overflow:clip;line-height:1.15;overflow-wrap:normal;hyphens:auto;max-width:100%;font-size:11.5px}
/* Barra superior (desktop): ícone dentro da pesquisa, botão principal sem reticências, "Avisos" como botão */
body.km-ui:not(#km-boost) .navbar .navbar-search{position:relative;flex:1 1 260px;min-width:0;padding:0;background:none;border:0;box-shadow:none}
body.km-ui:not(#km-boost) .navbar .navbar-user{flex:0 1 auto;min-width:0}
body.km-ui:not(#km-boost) .navbar .navbar-search>.nav-svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:18px;height:18px;margin:0;padding:0;background:none;border:0;box-shadow:none;pointer-events:none;z-index:1;color:var(--km-text-3,#6b7a72)}
body.km-ui:not(#km-boost) .navbar .navbar-search>.nav-svg svg{width:18px;height:18px}
body.km-ui:not(#km-boost) .navbar .navbar-search input{padding-left:38px;width:100%}
body.km-ui:not(#km-boost) .navbar .navbar-actions{flex:none;min-width:max-content}
body.km-ui:not(#km-boost) .navbar .navbar-actions>*{flex:none}
body.km-ui:not(#km-boost) .navbar .navbar-main-action{min-width:max-content}
body.km-ui:not(#km-boost) .navbar .navbar-main-action .nav-label{overflow:visible;text-overflow:clip;white-space:nowrap}
body.km-ui:not(#km-boost) .navbar .notification-pill{position:relative;min-height:44px;padding:0 14px;font-size:14px;font-weight:600;background:var(--km-surface);border:1px solid var(--km-border);color:var(--km-text)}
/* Barra lateral no escuro: superfície escura em vez do verde vivo */
html[data-theme="escuro"] body.km-ui:not(#km-boost) .sidebar{background:var(--km-surface);border-right:1px solid var(--km-border)}
/* Linhas de movimentos: título até 2 linhas antes de cortar */
body.km-ui .km-row-main strong{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
/* Pesquisa do histórico no telemóvel: campo mais largo, texto de ajuda com reticências */
@media (max-width:599.98px){body.km-ui:not(#km-boost) .history-toolbar input[type="search"]{text-overflow:ellipsis;min-width:0}
body.km-ui:not(#km-boost) .history-toolbar button[type="submit"]{flex:none;padding-left:16px;padding-right:16px}}

/* v4.9 Ajudante: botão no cabeçalho do caixa do funcionário */
.cashier-head-actions { display: flex; align-items: center; gap: 8px; }
.cashier-head-actions form { margin: 0; }
.cashier-ajudante { text-decoration: none; }

/* CRM: oportunidades e análise financeira (v4.31) */
.crm-opportunities{margin-top:18px}
.crm-op-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}
.crm-op-kpis>div{padding:16px;border:1px solid var(--km-border,#e4ebe8);border-radius:12px;background:var(--km-surface-2,#f5f8f7);min-width:0}
.crm-op-kpis small,.crm-op-kpis span{display:block;color:var(--km-text-3,#66756f);font-size:12px}
.crm-op-kpis strong{display:block;font-size:clamp(17px,1.7vw,25px);margin:4px 0;color:var(--km-text,#1a2825);overflow-wrap:anywhere}
.crm-op-stages{display:grid;grid-template-columns:repeat(7,minmax(95px,1fr));gap:8px;overflow-x:auto;padding-bottom:8px}
.crm-op-stages>div{border:1px solid var(--km-border,#e4ebe8);border-radius:10px;padding:10px 9px;min-width:95px}
.crm-op-stages small{display:block;min-height:30px;color:var(--km-text-3,#66756f);font-size:11px;line-height:1.35}
.crm-op-stages strong{font-size:20px}
.crm-op-filter{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;margin:18px 0}
.crm-op-filter label{display:grid;gap:6px;min-width:120px;font-size:12px;color:var(--km-text-2,#51625d);flex:1}
.crm-op-filter input,.crm-op-filter select,.crm-op-form-grid input,.crm-op-form-grid select,.crm-op-form-grid textarea{background:var(--km-surface,#fff);border:1px solid var(--km-border,#dce6e1);color:var(--km-text,#22312c);border-radius:9px;min-height:40px;padding:9px 11px;width:100%;box-sizing:border-box}
.crm-op-editor{border:1px solid var(--km-border,#dce6e1);border-radius:12px;margin:14px 0;padding:0}
.crm-op-editor>summary{cursor:pointer;padding:14px;font-weight:700;color:var(--km-primary,#0d736d)}
.crm-op-editor-inner{padding:0 16px 16px;border-top:1px solid var(--km-border,#dce6e1)}
.crm-op-edit-title{display:flex;justify-content:space-between;align-items:center;margin:14px 0}
.crm-op-edit-title button{border:0;background:none;color:var(--km-primary,#0d736d);cursor:pointer}
.crm-op-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.crm-op-form-grid label{display:grid;align-content:start;gap:6px;font-size:12px;font-weight:600;min-width:0}
.crm-op-form-grid textarea{min-height:78px}
.crm-op-wide{grid-column:1/-1}
.crm-op-list{display:grid;gap:10px;margin-top:14px}
.crm-op-card{display:flex;align-items:center;gap:14px;padding:13px;border:1px solid var(--km-border,#e1e8e5);border-radius:12px}
.crm-op-card-main{flex:1;min-width:0}
.crm-op-card-main>strong{display:block;font-size:14px}
.crm-op-card-main>small{display:block;color:var(--km-text-3,#64726e);margin:5px 0;overflow-wrap:anywhere}
.crm-op-meta{display:flex;flex-wrap:wrap;gap:6px}
.crm-op-meta span{background:var(--km-surface-2,#f0f5f3);padding:3px 8px;border-radius:20px;font-size:11px}
.crm-op-card-finance{text-align:right;min-width:130px}
.crm-op-card-finance>*{display:block}
.crm-op-card-finance small,.crm-op-card-finance span{font-size:11px;color:var(--km-text-3,#66756f)}
.crm-op-card-finance strong{font-size:15px}
.crm-report-scroll{width:100%;overflow-x:auto}
.crm-report-table{width:100%;border-collapse:collapse;min-width:800px;font-size:12px}
.crm-report-table th,.crm-report-table td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--km-border,#dce6e1)}
.crm-report-table th{font-weight:700;background:var(--km-surface-2,#f5f8f7)}
.crm-negative{color:#ba302f!important}
.crm-op-note{margin-top:10px;font-size:12px}
@media(max-width:900px){.crm-op-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-op-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.crm-op-kpis{gap:8px}.crm-op-kpis>div{padding:11px}.crm-op-form-grid{grid-template-columns:1fr}.crm-op-card{flex-wrap:wrap}.crm-op-card-main{flex-basis:100%}.crm-op-card-finance{text-align:left;flex:1}.crm-op-filter label{flex:1 1 130px}}
