/* =====================================================
   IDENTIDADE VISUAL — SCORTEGAGNA
   Paleta terracota/pedra: reflete o negócio (pedras,
   telhas, materiais de construção) em vez de um azul
   corporativo genérico. Sidebar escura + acentos quentes.
   ===================================================== */

:root {
    --azul-principal: #c2410c;
    --azul-hover: #9a3412;
    --azul-claro: #fdece1;
    --azul-escuro: #431407;
    --preto-azulado: #1c1917;
    --texto: #2b2521;
    --texto-claro: #6b625a;
    --borda: #e7e0d6;
    --fundo: #faf6f0;
    --branco: #ffffff;
    --superficie: #ffffff;
    --fundo-suave: #fbf8f3;
    --placeholder: #a89c8d;
    --sombra: 0 8px 25px rgba(28, 25, 23, 0.08);
    --sombra-hover: 0 12px 30px rgba(28, 25, 23, 0.14);

    --verde: #15803d;
    --verde-claro: #ecfdf3;
    --amarelo: #a16207;
    --amarelo-claro: #fef3e2;
    --vermelho: #b91c1c;
    --vermelho-claro: #fef2f2;
    --info: #0f766e;
    --info-claro: #f0fdfa;

    --raio: 18px;
    --raio-sm: 13px;

    /* sidebar (tema escuro dedicado, igual nos dois temas) */
    --sidebar-bg: #1b1613;
    --sidebar-bg-soft: #2a221d;
    --sidebar-text: #f3ece4;
    --sidebar-text-muted: #a89a8c;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(251, 146, 60, 0.14);
    --sidebar-active-text: #fb923c;

    color-scheme: light;
}

/* =====================================================
   TEMA ESCURO
   Ativado via [data-theme="dark"] no <html> (alternado
   pelo botão no cabeçalho, persistido em localStorage).
   A sidebar já é escura nos dois temas — só o restante
   do app (fundo, cartões, texto, bordas) muda.
   ===================================================== */

:root[data-theme="dark"] {
    --azul-claro: rgba(194, 65, 12, 0.22);
    --preto-azulado: #f3ece4;
    --texto: #e4dcd1;
    --texto-claro: #a89a8c;
    --borda: #3a322b;
    --fundo: #15120f;
    --superficie: #201b17;
    --fundo-suave: #221d18;
    --placeholder: #8a7d6f;
    --sombra: 0 8px 25px rgba(0, 0, 0, 0.35);
    --sombra-hover: 0 12px 30px rgba(0, 0, 0, 0.45);

    --verde-claro: rgba(21, 128, 61, 0.2);
    --amarelo-claro: rgba(161, 98, 7, 0.22);
    --vermelho-claro: rgba(185, 28, 28, 0.22);
    --info-claro: rgba(15, 118, 110, 0.22);

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--preto-azulado);
    font-weight: 700;
}

a {
    color: var(--azul-principal);
}

::selection {
    background: var(--azul-claro);
    color: var(--azul-escuro);
}

/* barra de rolagem discreta */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2d9cc;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbbfae;
}

/* =====================================================
   ESTRUTURA PRINCIPAL
   ===================================================== */

.system-layout {
    display: flex;
    min-height: 100vh;
}

/* MENU LATERAL (tema escuro) */

.system-sidebar {
    position: sticky;
    top: 0;
    width: 245px;
    min-width: 245px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
}

/* MARCA */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    background: linear-gradient( 135deg, var(--azul-principal), #f97316 );
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(194, 65, 12, 0.4);
}

.sidebar-brand-name {
    color: var(--sidebar-text);
    font-size: 15px;
    font-weight: 750;
}

.sidebar-brand-description {
    margin-top: 2px;
    color: var(--sidebar-text-muted);
    font-size: 11px;
}

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

/* LINKS DO MENU */

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-menu-title {
    margin: 19px 10px 7px;
    color: var(--sidebar-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

    .sidebar-menu-title:first-child {
        margin-top: 0;
    }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 10px 12px;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

    .sidebar-link:hover {
        color: var(--sidebar-text);
        background: var(--sidebar-bg-soft);
        transform: translateX(2px);
    }

    .sidebar-link.active {
        color: var(--sidebar-active-text);
        background: var(--sidebar-active-bg);
        font-weight: 750;
        box-shadow: inset 4px 0 0 var(--sidebar-active-text), 0 4px 12px rgba(251, 146, 60, 0.12);
    }

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex: none;
}

    .sidebar-icon svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
    }

/* PARTE INFERIOR DO MENU */

.sidebar-footer {
    margin-top: auto;
}

.sidebar-help {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 17px 12px;
    margin-bottom: 12px;
    color: var(--sidebar-text);
    text-align: center;
    background: var(--sidebar-bg-soft);
    border: 1px solid var(--sidebar-border);
    border-radius: 12px;
}

.sidebar-help-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--branco);
    background: linear-gradient(135deg, var(--azul-principal), #f97316);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.sidebar-help strong {
    font-size: 12px;
}

.sidebar-help span {
    margin-top: 4px;
    color: var(--sidebar-text-muted);
    font-size: 10px;
}

.sidebar-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--sidebar-text-muted);
    font-size: 10px;
}

.sidebar-status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.22);
}

/* ÁREA PRINCIPAL */

.system-main {
    min-width: 0;
    flex: 1;
    padding: 0 28px 40px;
}

/* CABEÇALHO */

.system-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--borda);
}

.system-breadcrumb {
    margin-bottom: 3px;
    color: var(--texto-claro);
    font-size: 11px;
}

.system-page-name {
    margin: 0;
    color: var(--preto-azulado);
    font-size: 19px;
    font-weight: 750;
}

.system-header-company {
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-header-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    background: linear-gradient(135deg, var(--azul-principal), #f97316);
    border-radius: 50%;
    font-weight: 750;
}

.system-header-company div:last-child {
    display: flex;
    flex-direction: column;
}

.system-header-company strong {
    color: var(--preto-azulado);
    font-size: 12px;
}

.system-header-company span {
    color: var(--texto-claro);
    font-size: 10px;
}

/* ALTERNADOR DE TEMA (claro/escuro) */

.crm-theme-toggle {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--texto-claro);
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .crm-theme-toggle:hover {
        color: var(--azul-principal);
        border-color: var(--azul-principal);
    }

    .crm-theme-toggle svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        position: absolute;
        transition: opacity 0.15s ease, transform 0.25s ease;
    }

    .crm-theme-toggle .crm-theme-icon-moon {
        opacity: 0;
        transform: rotate(-40deg) scale(0.6);
    }

    :root[data-theme="dark"] .crm-theme-toggle .crm-theme-icon-sun {
        opacity: 0;
        transform: rotate(40deg) scale(0.6);
    }

    :root[data-theme="dark"] .crm-theme-toggle .crm-theme-icon-moon {
        opacity: 1;
        transform: rotate(0) scale(1);
    }

.system-content {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

/* CELULAR */

@media (max-width: 768px) {
    .system-layout {
        display: block;
    }

    .system-sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        height: auto;
    }

    .sidebar-footer {
        display: none;
    }

    .system-main {
        padding: 0 14px 30px;
    }

    .system-header {
        min-height: 65px;
    }

    .system-header-company {
        display: none;
    }
}

/* =====================================================
   BOTÕES (override do Bootstrap para casar com a paleta)
   ===================================================== */

.btn {
    border-radius: var(--raio-sm);
    font-weight: 600;
    font-size: 13px;
    padding: 9px 16px;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    box-shadow: none;
}

    .btn:active {
        transform: translateY(1px);
    }

    .btn:focus, .btn:focus-visible {
        box-shadow: 0 0 0 3px var(--azul-claro);
    }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-primary {
    background: var(--azul-principal);
    border-color: var(--azul-principal);
    color: var(--branco);
}

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

.btn-success {
    background: var(--verde);
    border-color: var(--verde);
}

    .btn-success:hover, .btn-success:focus {
        background: #116932;
        border-color: #116932;
    }

.btn-danger {
    background: var(--vermelho);
    border-color: var(--vermelho);
}

    .btn-danger:hover, .btn-danger:focus {
        background: #991b1b;
        border-color: #991b1b;
    }

.btn-dark {
    /* Fundo fixo (não usa --preto-azulado, que inverte no tema escuro
       e deixaria o botão claro com texto branco por cima — invisível).
       --sidebar-bg é igual nos dois temas, então o botão continua
       escuro com texto branco tanto no tema claro quanto no escuro. */
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
    color: var(--branco);
}

    .btn-dark:hover, .btn-dark:focus {
        background: #000000;
        border-color: #000000;
        color: var(--branco);
    }

.btn-light {
    background: #f5f1ea;
    border-color: #f5f1ea;
    color: var(--texto);
}

    .btn-light:hover {
        background: #ece4d8;
    }

.btn-outline-primary {
    color: var(--azul-principal);
    border-color: var(--azul-principal);
}

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

.btn-outline-secondary {
    color: var(--texto-claro);
    border-color: var(--borda);
}

    .btn-outline-secondary:hover {
        background: #f1ece3;
        border-color: #d6c9b8;
        color: var(--texto);
    }

.btn-outline-info {
    color: var(--info);
    border-color: #a8d9d2;
}

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

.btn-outline-danger {
    color: var(--vermelho);
    border-color: #f3c1c1;
}

    .btn-outline-danger:hover {
        background: var(--vermelho);
        border-color: var(--vermelho);
    }

/* =====================================================
   FORMULÁRIOS
   ===================================================== */

.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 6px;
}

.form-control, .form-select {
    border: 1.5px solid var(--borda);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--texto);
    background-color: var(--fundo-suave);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .form-control:hover, .form-select:hover {
        border-color: #cbbfae;
    }

    .form-control:focus, .form-select:focus {
        background-color: var(--superficie);
        border-color: var(--azul-principal);
        box-shadow: 0 0 0 4px var(--azul-claro);
    }

    .form-control::placeholder {
        color: var(--placeholder);
    }

    .form-control:disabled, .form-select:disabled {
        background-color: var(--fundo-suave);
        opacity: 0.65;
    }

textarea.form-control {
    min-height: 90px;
}

.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    display: block;
    padding: 14px 18px;
    margin-bottom: 4px;
    background: var(--vermelho-claro);
    border: 1px solid var(--vermelho);
    border-radius: var(--raio-sm);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

    .validation-summary-errors li {
        color: #7f1d1d;
        font-size: 12.5px;
        font-weight: 650;
        line-height: 1.6;
    }

/* compatibilidade com views mais antigas (scaffold) */

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

.control-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--texto);
    display: inline-block;
    margin-bottom: 6px;
}

/* =====================================================
   CARDS, TABELAS E BADGES (base)
   ===================================================== */

.card {
    background-color: var(--superficie);
    color: var(--texto);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
}

.card.shadow-sm {
    box-shadow: var(--sombra) !important;
}

.badge {
    font-weight: 650;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 20px;
}

.table {
    color: var(--texto);
    font-size: 13px;
}

    .table thead th {
        color: var(--texto-claro);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: 1px solid var(--borda);
        padding: 14px 16px;
        background: var(--fundo-suave);
    }

    .table tbody td {
        padding: 14px 16px;
        vertical-align: middle;
        border-bottom: 1px solid var(--borda);
    }

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

    .table-hover tbody tr:hover {
        background: var(--azul-claro);
    }

.progress {
    height: 8px;
    border-radius: 20px;
    background: var(--fundo-suave);
}

    .progress-bar {
        border-radius: 20px;
    }

.modal-content {
    background-color: var(--superficie);
    color: var(--texto);
    border-radius: 18px;
}

.modal-header, .modal-footer {
    border-color: var(--borda);
}

.modal-icon-confirmacao {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amarelo-claro);
    color: var(--amarelo);
    border-radius: 50%;
    font-weight: 800;
    font-size: 16px;
}

/* =====================================================
   CABEÇALHO DE PÁGINA (crm-page-*)
   ===================================================== */

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

.crm-page-title {
    margin: 0;
    color: var(--preto-azulado);
    font-size: 22px;
    font-weight: 800;
}

.crm-page-subtitle {
    margin: 4px 0 0;
    color: var(--texto-claro);
    font-size: 13px;
}

/* =====================================================
   CARDS DE FILTRO / TOOLBAR / FORMULÁRIO
   ===================================================== */

.crm-toolbar-card, .crm-filter-card, .crm-form-section-card {
    border: 1px solid var(--borda);
}

.crm-form-section-card + .crm-form-section-card {
    margin-top: 20px;
}

.crm-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.crm-section-title {
    margin: 0;
    color: var(--preto-azulado);
    font-size: 15px;
    font-weight: 750;
}

.crm-section-subtitle {
    margin: 3px 0 0;
    color: var(--texto-claro);
    font-size: 12px;
}

/* =====================================================
   TABELAS (crm-table-*)
   ===================================================== */

.crm-table-card {
    overflow: hidden;
}

.crm-table-title {
    color: var(--preto-azulado);
    font-size: 13px;
    font-weight: 700;
}

.crm-table-subtitle {
    margin-top: 2px;
    color: var(--texto-claro);
    font-size: 11px;
}

.crm-table-address {
    max-width: 220px;
    white-space: normal;
}

.crm-action-group {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ESTADOS VAZIOS */

.crm-empty-state {
    padding: 24px;
    color: var(--texto-claro);
    font-size: 13px;
    text-align: center;
}

.crm-empty-state-lg {
    padding: 56px 24px;
    text-align: center;
}

    .crm-empty-state-lg::before {
        content: "";
        display: block;
        width: 56px;
        height: 56px;
        margin: 0 auto 16px;
        border-radius: 50%;
        background: var(--azul-claro);
        background-image: radial-gradient(circle, var(--azul-principal) 0 4px, transparent 4px);
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.6;
        pointer-events: none;
    }

    .crm-empty-state-lg h5 {
        color: var(--preto-azulado);
        font-weight: 750;
        font-size: 15px;
    }

/* =====================================================
   HERO DO DASHBOARD (crm-hero)
   ===================================================== */

.crm-hero {
    padding: 28px 30px;
    border-radius: var(--raio);
    background: linear-gradient(120deg, var(--azul-escuro) 0%, var(--azul-principal) 100%);
    box-shadow: 0 14px 30px rgba(67, 20, 7, 0.28);
    position: relative;
    overflow: hidden;
}

    .crm-hero::after {
        content: "";
        position: absolute;
        right: -60px;
        top: -60px;
        width: 220px;
        height: 220px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        pointer-events: none;
    }

.crm-badge-periodo {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffe9d6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    position: relative;
}

.crm-hero-title {
    color: var(--branco);
    font-size: 21px;
    font-weight: 800;
    position: relative;
}

.crm-hero-text {
    color: #f6d9c2;
    font-size: 13px;
    max-width: 640px;
    position: relative;
}

/* =====================================================
   CARTÕES DE MÉTRICA (dashboard)
   ===================================================== */

.crm-metric-card .card-body,
.crm-mini-stat-card .card-body,
.crm-summary-card .card-body,
.crm-info-card .card-body {
    padding: 20px 22px;
}

.crm-metric-label, .crm-mini-stat-label, .crm-summary-label {
    color: var(--texto-claro);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crm-metric-value {
    margin-top: 8px;
    color: var(--preto-azulado);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
}

.crm-metric-foot, .crm-mini-stat-foot, .crm-summary-foot {
    margin-top: 6px;
    color: var(--texto-claro);
    font-size: 11.5px;
}

.crm-summary-foot-lg {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.crm-metric-card-highlight {
    background: linear-gradient(135deg, var(--azul-principal), #f97316);
    border: none;
}

    .crm-metric-card-highlight .crm-metric-label,
    .crm-metric-card-highlight .crm-metric-foot {
        color: rgba(255, 255, 255, 0.8);
    }

    .crm-metric-card-highlight .crm-metric-value {
        color: var(--branco);
    }

.crm-mini-stat-value {
    margin-top: 8px;
    color: var(--preto-azulado);
    font-size: 19px;
    font-weight: 750;
}

/* Ícone colorido no topo de um cartão de métrica (inspirado em
   dashboards de CRM: cada indicador ganha um "chip" de ícone). */

.crm-metric-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 12px;
}

    .crm-metric-icon svg {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        fill: none;
    }

.crm-metric-icon-azul {
    background: var(--azul-claro);
    color: var(--azul-principal);
}

.crm-metric-icon-verde {
    background: var(--verde-claro);
    color: var(--verde);
}

.crm-metric-icon-amarelo {
    background: var(--amarelo-claro);
    color: var(--amarelo);
}

.crm-metric-icon-vermelho {
    background: var(--vermelho-claro);
    color: var(--vermelho);
}

.crm-metric-icon-info {
    background: var(--info-claro);
    color: var(--info);
}

.crm-metric-card-highlight .crm-metric-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--branco);
}

/* =====================================================
   GRÁFICOS
   ===================================================== */

.crm-chart-wrap {
    position: relative;
    width: 100%;
    height: 300px;
}

.crm-status-chart-wrap {
    position: relative;
    width: 100%;
    height: 190px;
}

.crm-status-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.crm-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--texto);
}

    .crm-status-head strong {
        color: var(--preto-azulado);
    }

/* =====================================================
   RANKING DE PRODUTOS
   ===================================================== */

.crm-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--borda);
}

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

.crm-ranking-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.crm-ranking-index {
    width: 26px;
    height: 26px;
    min-width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azul-claro);
    color: var(--azul-principal);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.crm-ranking-title {
    color: var(--preto-azulado);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-ranking-subtitle {
    color: var(--texto-claro);
    font-size: 11px;
}

.crm-ranking-value {
    color: var(--preto-azulado);
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

/* =====================================================
   INSIGHTS E OBSERVAÇÕES
   ===================================================== */

.crm-insight-box {
    height: 100%;
    padding: 14px 16px;
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
}

.crm-insight-label {
    color: var(--texto-claro);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-insight-value {
    margin-top: 6px;
    color: var(--preto-azulado);
    font-size: 14px;
    font-weight: 700;
}

.crm-observation-box {
    padding: 14px 16px;
    background: var(--azul-claro);
    border-radius: var(--raio-sm);
    color: var(--azul-escuro);
    font-size: 12.5px;
    line-height: 1.6;
}

/* =====================================================
   DETALHES / HERO SECUNDÁRIO (usado em Details, Delete, forms)
   ===================================================== */

.crm-details-hero-card {
    background: linear-gradient(120deg, #fdf1e7 0%, #fff9f4 100%);
    border: 1px solid var(--azul-claro);
}

    /* No tema escuro, esse degradê claro fixo deixava o título quase
       invisível (o texto usa --preto-azulado, que vira claro no escuro,
       por cima de um fundo também claro). Aqui trocamos por um degradê
       escuro com leve tom terracota, mantendo o mesmo texto legível. */
    :root[data-theme="dark"] .crm-details-hero-card {
        background: linear-gradient(120deg, rgba(194, 65, 12, 0.16) 0%, rgba(194, 65, 12, 0.05) 100%);
    }

.crm-details-hero-name {
    color: var(--preto-azulado);
    font-size: 16px;
    font-weight: 800;
}

.crm-details-hero-text {
    margin-top: 4px;
    color: var(--texto-claro);
    font-size: 12.5px;
}

/* =====================================================
   HERO DE LISTAGEM + BUSCA FLUTUANTE (crm-list-hero)
   Usado em Clientes, Produtos, Estoque e Orçamentos: uma
   faixa em degradê no topo da página com título, ação
   principal e pílulas de indicadores, seguida por um
   cartão de busca "flutuante" que sobrepõe a faixa.
   ===================================================== */

.crm-list-hero {
    padding: 26px 28px 58px;
    border-radius: var(--raio);
    background: linear-gradient(125deg, var(--azul-escuro) 0%, var(--azul-principal) 55%, #ea580c 100%);
    box-shadow: 0 16px 34px rgba(67, 20, 7, 0.25);
    position: relative;
    overflow: hidden;
}

    .crm-list-hero::after {
        content: "";
        position: absolute;
        right: -70px;
        top: -70px;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        pointer-events: none;
    }

    .crm-list-hero::before {
        content: "";
        position: absolute;
        left: 32%;
        bottom: -100px;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.05);
        pointer-events: none;
    }

.crm-list-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
}

.crm-list-hero-title {
    margin: 0;
    color: var(--branco);
    font-size: 22px;
    font-weight: 800;
}

.crm-list-hero-subtitle {
    margin: 5px 0 0;
    color: #ffe4d0;
    font-size: 13px;
    max-width: 460px;
}

.crm-list-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

.crm-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    background: var(--branco);
    color: var(--azul-principal) !important;
    font-size: 13px;
    font-weight: 750;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .crm-hero-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
        color: var(--azul-hover) !important;
    }

.crm-hero-btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--branco) !important;
}

    .crm-hero-btn-ghost:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--branco) !important;
    }

.crm-list-hero-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
    position: relative;
}

.crm-list-hero-pill {
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    min-width: 132px;
}

.crm-list-hero-pill-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffe4d0;
    font-weight: 700;
}

.crm-list-hero-pill-value {
    margin-top: 3px;
    font-size: 19px;
    font-weight: 800;
    color: var(--branco);
}

.crm-search-float {
    position: relative;
    margin: -34px 6px 24px;
    z-index: 2;
}

    .crm-search-float .card {
        border-radius: var(--raio);
    }

/* =====================================================
   AVATAR DE LINHA (tabelas de clientes, produtos, etc.)
   ===================================================== */

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

.crm-row-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--azul-principal), #f97316);
    color: var(--branco);
    font-size: 14px;
    font-weight: 800;
}

    .crm-row-avatar svg {
        width: 17px;
        height: 17px;
        stroke: currentColor;
        fill: none;
    }

.crm-row-avatar-muted {
    background: linear-gradient(135deg, #a89a8c, #c9beae);
}

    .crm-profile-avatar svg {
        width: 26px;
        height: 26px;
        stroke: currentColor;
        fill: none;
    }

.crm-info-label {
    color: var(--texto-claro);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-info-value {
    margin-top: 7px;
    color: var(--preto-azulado);
    font-size: 14px;
    font-weight: 700;
}

.crm-info-note {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.6;
    color: var(--texto);
}

/* =====================================================
   TOTAL DO ORÇAMENTO
   ===================================================== */

.crm-total-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 22px;
    background: linear-gradient(120deg, var(--azul-escuro), var(--azul-principal));
    border-radius: var(--raio-sm);
}

.crm-total-label {
    color: var(--branco);
    font-size: 13px;
    font-weight: 750;
}

.crm-total-note {
    margin-top: 2px;
    color: #f6d9c2;
    font-size: 11.5px;
}

.crm-total-value {
    color: var(--branco);
    font-size: 24px;
    font-weight: 800;
}

/* =====================================================
   ALERTA DE EXCLUSÃO
   ===================================================== */

.crm-delete-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--vermelho-claro);
    border: 1px solid var(--vermelho);
    border-radius: var(--raio-sm);
}

.crm-delete-alert-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vermelho);
    color: var(--branco);
    border-radius: 50%;
    font-weight: 800;
}

.crm-delete-alert-title {
    color: #7f1d1d;
    font-size: 13px;
    font-weight: 800;
}

.crm-delete-alert-text {
    margin-top: 2px;
    color: #9a3434;
    font-size: 12.5px;
}

.crm-confirm-card {
    border: 1px solid var(--borda);
}

/* =====================================================
   PÁGINA INICIAL (Home)
   ===================================================== */

.crm-home-hero {
    padding: 34px 32px;
    border-radius: var(--raio);
    background: linear-gradient(120deg, var(--azul-escuro) 0%, var(--azul-principal) 65%, #f97316 100%);
    box-shadow: 0 16px 34px rgba(67, 20, 7, 0.28);
    position: relative;
    overflow: hidden;
}

    .crm-home-hero::after {
        content: "";
        position: absolute;
        right: -50px;
        bottom: -70px;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        pointer-events: none;
    }

.crm-home-hero-content {
    position: relative;
    max-width: 620px;
}

.crm-home-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffe9d6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.crm-home-title {
    margin: 14px 0 0;
    color: var(--branco);
    font-size: 24px;
    font-weight: 800;
}

.crm-home-text {
    margin-top: 8px;
    color: #f6d9c2;
    font-size: 13.5px;
    line-height: 1.6;
}

.crm-home-stat-card .card-body {
    padding: 22px;
}

.crm-home-stat-label {
    color: var(--texto-claro);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crm-home-stat-text {
    margin-top: 8px;
    color: var(--texto);
    font-size: 12.5px;
    line-height: 1.55;
    min-height: 55px;
}

.crm-home-stat-highlight {
    background: linear-gradient(135deg, var(--azul-principal), #f97316);
    border: none;
}

    .crm-home-stat-highlight .crm-home-stat-label,
    .crm-home-stat-highlight .crm-home-stat-text {
        color: rgba(255, 255, 255, 0.88);
    }

/* PASSOS DE USO */

.crm-home-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crm-home-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.crm-home-step-number {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azul-claro);
    color: var(--azul-principal);
    border-radius: 9px;
    font-weight: 800;
    font-size: 13px;
}

.crm-home-step-title {
    color: var(--preto-azulado);
    font-size: 13px;
    font-weight: 750;
}

.crm-home-step-text {
    margin-top: 2px;
    color: var(--texto-claro);
    font-size: 12px;
    line-height: 1.5;
}

/* ACESSOS RÁPIDOS */

.crm-home-link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-home-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

    .crm-home-link-item:hover {
        background: var(--azul-claro);
        border-color: var(--azul-claro);
        transform: translateX(2px);
    }

.crm-home-link-title {
    color: var(--preto-azulado);
    font-size: 13px;
    font-weight: 700;
}

.crm-home-link-text {
    margin-top: 2px;
    color: var(--texto-claro);
    font-size: 11.5px;
}

.crm-home-link-arrow {
    color: var(--azul-principal);
    font-size: 16px;
    font-weight: 700;
}

/* =====================================================
   TOAST DE SUCESSO
   ===================================================== */

.toast-sucesso {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 14px 18px;
    background: var(--superficie);
    border: 1px solid #bbf0cf;
    border-left: 4px solid var(--verde);
    border-radius: var(--raio-sm);
    box-shadow: var(--sombra-hover);
    color: var(--preto-azulado);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    animation: toast-entrar 0.25s ease;
}

.toast-sucesso-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: var(--verde-claro);
    color: var(--verde);
    font-weight: 800;
    font-size: 13px;
}

.toast-sucesso-saindo {
    animation: toast-sair 0.3s ease forwards;
}

@keyframes toast-entrar {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

@keyframes toast-sair {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@media (max-width: 768px) {
    .toast-sucesso {
        left: 14px;
        right: 14px;
        top: 14px;
        max-width: none;
    }
}

/* Espaçamento do spinner nos botões de salvar */

.btn .spinner-border {
    margin-right: 6px;
}

/* =====================================================
   FORM SHELL PROFISSIONAL (Novo/Editar Orçamento, Cliente)
   ===================================================== */

.crm-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.crm-form-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.crm-form-card {
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    overflow: hidden;
}

.crm-form-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--borda);
    background: var(--fundo-suave);
}

.crm-form-card-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--azul-claro);
    color: var(--azul-principal);
}

    .crm-form-card-icon svg {
        width: 17px;
        height: 17px;
        stroke: currentColor;
        fill: none;
    }

.crm-form-card-title {
    margin: 0;
    color: var(--preto-azulado);
    font-size: 14px;
    font-weight: 750;
}

.crm-form-card-subtitle {
    margin-top: 1px;
    color: var(--texto-claro);
    font-size: 11.5px;
}

.crm-form-card-body {
    padding: 22px;
}

.crm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-field-label {
    color: var(--texto);
    font-size: 12px;
    font-weight: 700;
}

.crm-field-hint {
    color: var(--texto-claro);
    font-size: 11px;
    line-height: 1.5;
}

.crm-client-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--texto-claro);
    font-size: 11.5px;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
}

    .crm-client-toggle input {
        width: 15px;
        height: 15px;
        accent-color: var(--azul-principal);
        cursor: pointer;
    }

.crm-form-aside {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crm-summary-card {
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crm-summary-title {
    margin: 0;
    color: var(--preto-azulado);
    font-size: 13.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-summary-divider {
    height: 1px;
    background: var(--borda);
    margin: 2px 0;
}

.crm-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
    color: var(--texto);
}

.crm-summary-row-muted {
    color: var(--texto-claro);
}

.crm-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px dashed var(--borda);
}

.crm-summary-total-label {
    color: var(--texto-claro);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crm-summary-total-value {
    color: var(--preto-azulado);
    font-size: 23px;
    font-weight: 800;
}

.crm-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-chip-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-chip {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--borda);
    background: var(--superficie);
    color: var(--texto);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .crm-chip:hover {
        border-color: var(--azul-principal);
        color: var(--azul-principal);
    }

    .crm-chip.active {
        background: var(--azul-principal);
        border-color: var(--azul-principal);
        color: var(--branco);
    }

.crm-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--amarelo-claro);
    color: var(--amarelo);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.crm-profile-banner {
    padding: 24px 26px;
    border-radius: var(--raio);
    background: linear-gradient(120deg, var(--azul-escuro) 0%, var(--azul-principal) 100%);
    box-shadow: 0 14px 30px rgba(67, 20, 7, 0.24);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

    .crm-profile-banner::after {
        content: "";
        position: absolute;
        right: -50px;
        top: -50px;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        pointer-events: none;
    }

.crm-profile-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--branco);
    font-size: 19px;
    font-weight: 800;
    position: relative;
}

.crm-profile-name {
    margin: 0;
    color: var(--branco);
    font-size: 18px;
    font-weight: 800;
    position: relative;
}

.crm-profile-text {
    margin-top: 3px;
    color: #f6d9c2;
    font-size: 12.5px;
    position: relative;
}

/* =====================================================
   TOGGLES (Entregue / Encomenda)
   ===================================================== */

.crm-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
}

.crm-switch-row + .crm-switch-row {
    margin-top: 8px;
}

.crm-switch-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.crm-switch-label strong {
    color: var(--texto);
    font-size: 12.5px;
    font-weight: 700;
}

.crm-switch-label span {
    color: var(--texto-claro);
    font-size: 11px;
}

.crm-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: none;
}

    .crm-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.crm-switch-track {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d8cfc1;
    border-radius: 20px;
    transition: background 0.18s ease;
}

    .crm-switch-track::before {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        left: 3px;
        top: 3px;
        background: var(--branco);
        border-radius: 50%;
        transition: transform 0.18s ease;
        box-shadow: 0 2px 4px rgba(28, 25, 23, 0.25);
    }

.crm-switch input:checked + .crm-switch-track {
    background: var(--azul-principal);
}

    .crm-switch input:checked + .crm-switch-track::before {
        transform: translateX(18px);
    }

.crm-encomenda-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--info-claro);
    color: var(--info);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.crm-entregue-sim {
    color: var(--verde);
}

.crm-entregue-nao {
    color: var(--texto-claro);
}

@media (max-width: 992px) {
    .crm-form-layout {
        grid-template-columns: 1fr;
    }

    .crm-form-aside {
        position: static;
    }
}

/* =====================================================
   MENU LATERAL RECOLHÍVEL + MOBILE
   html.menu-recolhido  -> só ícones (desktop)
   html.menu-mobile-aberto -> gaveta aberta (telas pequenas)
   ===================================================== */

.system-sidebar {
    transition: width 0.22s ease, min-width 0.22s ease, transform 0.25s ease;
}

.sidebar-brand {
    position: relative;
}

.sidebar-brand-texto {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-toggle {
    margin-left: auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    background: var(--sidebar-bg-soft);
    color: var(--sidebar-text-muted);
    cursor: pointer;
    transition: color 0.18s ease, transform 0.22s ease, background 0.18s ease;
}

    .sidebar-toggle svg {
        width: 16px;
        height: 16px;
    }

    .sidebar-toggle:hover {
        color: var(--sidebar-text);
        background: rgba(255, 255, 255, 0.08);
    }

.sidebar-link-texto {
    white-space: nowrap;
}

html.menu-recolhido .system-sidebar {
    width: 84px;
    min-width: 84px;
    padding-left: 12px;
    padding-right: 12px;
}

html.menu-recolhido .sidebar-brand {
    flex-direction: column;
    gap: 10px;
    padding: 6px 4px;
}

html.menu-recolhido .sidebar-brand-texto,
html.menu-recolhido .sidebar-menu-title,
html.menu-recolhido .sidebar-link-texto,
html.menu-recolhido .sidebar-help strong,
html.menu-recolhido .sidebar-help span {
    display: none;
}

html.menu-recolhido .sidebar-toggle {
    margin-left: 0;
    transform: rotate(180deg);
}

html.menu-recolhido .sidebar-link {
    justify-content: center;
    padding: 12px 0;
}

html.menu-recolhido .sidebar-link.active {
    box-shadow: inset 0 -3px 0 var(--sidebar-active-text);
}

html.menu-recolhido .sidebar-menu {
    gap: 4px;
}

html.menu-recolhido .sidebar-help {
    padding: 12px 6px;
}

html.menu-recolhido .sidebar-help-icon {
    margin-bottom: 0;
}

html.menu-recolhido .sidebar-status {
    justify-content: center;
}

.sidebar-overlay {
    display: none;
}

.crm-menu-mobile {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    background: var(--superficie);
    color: var(--texto);
    cursor: pointer;
}

    .crm-menu-mobile svg {
        width: 20px;
        height: 20px;
    }

@media (max-width: 992px) {
    .system-layout {
        display: block;
    }

    .system-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        width: 260px;
        min-width: 260px;
        height: 100vh;
        transform: translateX(-105%);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    }

    html.menu-recolhido .system-sidebar {
        width: 260px;
        min-width: 260px;
        padding: 22px 16px;
    }

    html.menu-recolhido .sidebar-brand-texto,
    html.menu-recolhido .sidebar-menu-title,
    html.menu-recolhido .sidebar-link-texto,
    html.menu-recolhido .sidebar-help strong,
    html.menu-recolhido .sidebar-help span {
        display: block;
    }

    html.menu-recolhido .sidebar-brand {
        flex-direction: row;
        gap: 12px;
        padding: 8px;
    }

    html.menu-recolhido .sidebar-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    html.menu-recolhido .sidebar-toggle {
        transform: none;
        margin-left: auto;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-footer {
        display: block;
    }

    html.menu-mobile-aberto .system-sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        display: block;
    }

    html.menu-mobile-aberto .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    html.menu-mobile-aberto {
        overflow: hidden;
    }

    .crm-menu-mobile {
        display: inline-flex;
    }

    .system-main {
        padding: 0 14px 30px;
    }

    .system-header {
        min-height: 65px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .system-header-company {
        display: flex;
    }

    .crm-user-menu-texto {
        display: none !important;
    }

    .crm-busca-global-btn-texto,
    .crm-busca-global-btn kbd {
        display: none;
    }

    .crm-list-hero-actions {
        width: 100%;
    }

    .crm-page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =====================================================
   CABEÇALHO: menu do usuário, busca global
   ===================================================== */

.crm-user-menu-btn {
    border: 1px solid transparent;
    background: transparent;
    padding: 6px 8px;
    border-radius: var(--raio-sm);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

    .crm-user-menu-btn:hover {
        background: var(--fundo-suave);
        border-color: var(--borda);
    }

.crm-user-menu-texto {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.crm-user-menu-seta {
    width: 16px;
    height: 16px;
    color: var(--texto-claro);
}

.crm-dropdown {
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    padding: 6px;
    min-width: 240px;
}

    .crm-dropdown .dropdown-item {
        color: var(--texto);
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 13px;
    }

        .crm-dropdown .dropdown-item:hover {
            background: var(--fundo-suave);
            color: var(--texto);
        }

    .crm-dropdown .dropdown-header {
        color: var(--texto-claro);
        font-size: 11px;
    }

    .crm-dropdown .dropdown-divider {
        border-color: var(--borda);
    }

.crm-busca-global-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--borda);
    border-radius: 999px;
    background: var(--fundo-suave);
    color: var(--texto-claro);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

    .crm-busca-global-btn:hover {
        border-color: var(--azul-principal);
        color: var(--texto);
    }

    .crm-busca-global-btn svg {
        width: 16px;
        height: 16px;
    }

    .crm-busca-global-btn kbd {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 6px;
        background: var(--superficie);
        border: 1px solid var(--borda);
        color: var(--texto-claro);
    }

.crm-busca-global {
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.crm-busca-global-fundo {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, 0.45);
    backdrop-filter: blur(2px);
}

.crm-busca-global-caixa {
    position: relative;
    width: min(640px, calc(100% - 32px));
    margin: 12vh auto 0;
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.crm-busca-global-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--borda);
    color: var(--texto-claro);
}

    .crm-busca-global-input-wrap svg {
        width: 20px;
        height: 20px;
        flex: none;
    }

.crm-busca-global-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--texto);
    font-size: 16px;
    font-family: inherit;
}

.crm-busca-global-fechar {
    border: 1px solid var(--borda);
    background: var(--fundo-suave);
    color: var(--texto-claro);
    border-radius: 6px;
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
}

.crm-busca-global-resultados {
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
}

.crm-busca-global-dica {
    padding: 18px 12px;
    text-align: center;
    color: var(--texto-claro);
    font-size: 13px;
}

.crm-busca-global-grupo {
    padding: 10px 12px 4px;
    color: var(--texto-claro);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-busca-global-item {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--texto);
}

    .crm-busca-global-item:hover,
    .crm-busca-global-item.active {
        background: var(--azul-claro);
        color: var(--texto);
    }

.crm-busca-global-item-titulo {
    font-weight: 700;
    font-size: 13.5px;
}

.crm-busca-global-item-sub {
    font-size: 12px;
    color: var(--texto-claro);
}

body.crm-busca-aberta {
    overflow: hidden;
}

/* =====================================================
   FILTROS (chips), BADGES E TABELAS INTELIGENTES
   ===================================================== */

.crm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--borda);
    border-radius: 999px;
    background: var(--fundo-suave);
    color: var(--texto-claro);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}

    .crm-filter-chip span {
        padding: 1px 7px;
        border-radius: 999px;
        background: var(--superficie);
        border: 1px solid var(--borda);
        font-size: 11px;
        color: var(--texto);
    }

    .crm-filter-chip:hover {
        border-color: var(--azul-principal);
        color: var(--texto);
    }

    .crm-filter-chip.active {
        background: var(--azul-principal);
        border-color: var(--azul-principal);
        color: var(--branco);
    }

        .crm-filter-chip.active span {
            background: rgba(255, 255, 255, 0.2);
            border-color: transparent;
            color: var(--branco);
        }

.crm-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--texto-claro);
    cursor: pointer;
    margin: 0;
}

    .crm-check-inline input {
        width: 16px;
        height: 16px;
        accent-color: var(--azul-principal);
    }

.crm-chip-static {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    color: var(--texto);
    font-size: 12px;
    font-weight: 600;
}

.crm-badge-alerta,
.crm-badge-perigo,
.crm-badge-soft {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.crm-badge-alerta {
    background: var(--amarelo-claro);
    color: var(--amarelo);
}

.crm-badge-perigo {
    background: var(--vermelho-claro);
    color: var(--vermelho);
}

.crm-badge-soft {
    background: var(--azul-claro);
    color: var(--azul-principal);
}

.crm-row-inativa {
    opacity: 0.6;
}

.crm-th-ordenavel {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px !important;
}

    .crm-th-ordenavel::after {
        content: "↕";
        position: absolute;
        right: 6px;
        opacity: 0.35;
        font-size: 11px;
    }

    .crm-th-ordenavel.crm-th-asc::after {
        content: "↑";
        opacity: 1;
        color: var(--azul-principal);
    }

    .crm-th-ordenavel.crm-th-desc::after {
        content: "↓";
        opacity: 1;
        color: var(--azul-principal);
    }

.crm-paginacao {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--borda);
    font-size: 12.5px;
    color: var(--texto-claro);
}

.crm-paginacao-botoes {
    display: flex;
    gap: 4px;
}

.crm-paginacao-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    background: var(--superficie);
    color: var(--texto);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

    .crm-paginacao-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

    .crm-paginacao-btn.active {
        background: var(--azul-principal);
        border-color: var(--azul-principal);
        color: var(--branco);
    }

/* =====================================================
   ORÇAMENTO: linha do tempo, ações rápidas, WhatsApp
   ===================================================== */

.crm-quick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.crm-quick-actions-label {
    font-size: 12px;
    color: var(--texto-claro);
    margin-right: 4px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    border-color: #25d366;
    color: #ffffff;
}

    .btn-whatsapp:hover,
    .btn-whatsapp:focus {
        background: #1ebe5a;
        border-color: #1ebe5a;
        color: #ffffff;
    }

.crm-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 4px;
    position: relative;
}

    .crm-timeline::before {
        content: "";
        position: absolute;
        left: 11px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: var(--borda);
    }

.crm-timeline-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 0 0 16px 0;
}

    .crm-timeline-item:last-child {
        padding-bottom: 0;
    }

.crm-timeline-dot {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 3px;
    border-radius: 50%;
    border: 3px solid var(--superficie);
    background: var(--texto-claro);
    box-shadow: 0 0 0 2px var(--borda);
}

.crm-timeline-criado .crm-timeline-dot { background: var(--azul-principal); }
.crm-timeline-status .crm-timeline-dot { background: var(--verde); }
.crm-timeline-entrega .crm-timeline-dot { background: var(--info); }
.crm-timeline-whatsapp .crm-timeline-dot { background: #25d366; }
.crm-timeline-edicao .crm-timeline-dot { background: var(--amarelo); }

.crm-timeline-text {
    font-size: 13px;
    color: var(--texto);
    font-weight: 600;
}

.crm-timeline-meta {
    font-size: 11.5px;
    color: var(--texto-claro);
    margin-top: 2px;
}

.crm-info-card-interna {
    border-left: 3px solid var(--amarelo);
}

.crm-estoque-aviso {
    margin-top: 4px;
    font-size: 11px;
    color: var(--texto-claro);
}

.crm-estoque-aviso-baixo {
    color: var(--vermelho);
    font-weight: 700;
}

.crm-summary-static {
    padding: 10px 12px;
    border-radius: var(--raio-sm);
    background: var(--fundo-suave);
    border: 1px dashed var(--borda);
    font-weight: 700;
    color: var(--preto-azulado);
    font-size: 13px;
}

/* =====================================================
   PRODUTOS: margem, importação
   ===================================================== */

.crm-margem-preview {
    padding: 14px 16px;
    border-radius: var(--raio-sm);
    background: var(--verde-claro);
    border: 1px solid transparent;
}

.crm-margem-preview-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--texto-claro);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.crm-margem-preview-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--verde);
    line-height: 1.2;
}

.crm-margem-preview-hint {
    font-size: 12px;
    color: var(--texto-claro);
}

.crm-margem-negativa {
    background: var(--vermelho-claro);
}

    .crm-margem-negativa .crm-margem-preview-value {
        color: var(--vermelho);
    }

.crm-import-resultado {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--raio-sm);
    background: var(--verde-claro);
    color: var(--texto);
    font-size: 13px;
}

.crm-lista-regras {
    padding-left: 18px;
    font-size: 13px;
    color: var(--texto);
}

    .crm-lista-regras li {
        margin-bottom: 8px;
    }

.crm-validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

/* =====================================================
   DASHBOARD: alertas, comparativo, meta
   ===================================================== */

.crm-alert-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crm-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    text-decoration: none;
    border: 1px solid transparent;
    color: var(--texto);
}

.crm-alert-chip-vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.crm-alert-chip-amarelo { background: var(--amarelo-claro); color: var(--amarelo); }
.crm-alert-chip-cinza { background: var(--fundo-suave); color: var(--texto-claro); border-color: var(--borda); }
.crm-alert-chip-info { background: var(--info-claro); color: var(--info); }

a.crm-alert-chip:hover {
    filter: brightness(0.96);
}

.crm-delta {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 4px;
}

.crm-delta-positiva { background: var(--verde-claro); color: var(--verde); }
.crm-delta-negativa { background: var(--vermelho-claro); color: var(--vermelho); }
.crm-delta-neutra { background: var(--fundo-suave); color: var(--texto-claro); border: 1px solid var(--borda); }

.crm-metric-card-highlight .crm-delta-positiva,
.crm-metric-card-highlight .crm-delta-negativa,
.crm-metric-card-highlight .crm-delta-neutra {
    background: rgba(255, 255, 255, 0.2);
    color: var(--branco);
    border-color: transparent;
}

.crm-meta-valor {
    font-size: 34px;
    font-weight: 800;
    color: var(--preto-azulado);
    line-height: 1.1;
    margin-bottom: 12px;
}

    .crm-meta-valor small {
        font-size: 13px;
        font-weight: 600;
        color: var(--texto-claro);
        margin-left: 6px;
    }

.crm-meta-progress {
    height: 14px;
    border-radius: 999px;
}

    .crm-meta-progress .progress-bar {
        background: linear-gradient(90deg, var(--azul-escuro), var(--azul-principal));
        border-radius: 999px;
    }

.crm-meta-foot {
    margin-top: 10px;
    font-size: 13px;
    color: var(--texto-claro);
}

.crm-ranking-index-alerta { background: var(--amarelo-claro); color: var(--amarelo); }
.crm-ranking-index-perigo { background: var(--vermelho-claro); color: var(--vermelho); }
.crm-ranking-index-neutro { background: var(--fundo-suave); color: var(--texto-claro); }

.crm-ranking-title a {
    color: inherit;
    text-decoration: none;
}

    .crm-ranking-title a:hover {
        color: var(--azul-principal);
    }

.crm-ranking-value a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed var(--texto-claro);
}

/* =====================================================
   MODAL DE CONFIRMAÇÃO (perigo)
   ===================================================== */

.modal-icon-perigo {
    background: var(--vermelho-claro);
    color: var(--vermelho);
}

.modal-content .modal-title {
    color: var(--preto-azulado);
}

/* =====================================================
   LOGIN (layout próprio, sem menu lateral)
   ===================================================== */

.auth-body {
    min-height: 100vh;
    background: var(--fundo);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(320px, 42%) 1fr;
    min-height: 100vh;
}

.auth-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 44px;
    color: var(--sidebar-text);
    background: linear-gradient(160deg, var(--sidebar-bg) 0%, #2a1a12 55%, var(--azul-escuro) 100%);
    position: relative;
    overflow: hidden;
}

    .auth-side::after {
        content: "";
        position: absolute;
        right: -120px;
        bottom: -120px;
        width: 360px;
        height: 360px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(249, 115, 22, 0.35), transparent 65%);
        pointer-events: none;
    }

.auth-side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-side-brand-name {
    font-size: 16px;
    font-weight: 800;
}

.auth-side-brand-sub {
    font-size: 11px;
    color: var(--sidebar-text-muted);
}

.auth-side-content {
    max-width: 420px;
}

.auth-side-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--sidebar-text);
    margin-bottom: 14px;
}

.auth-side-text {
    color: var(--sidebar-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.auth-side-list {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .auth-side-list li {
        position: relative;
        padding-left: 22px;
        font-size: 13.5px;
        color: var(--sidebar-text);
    }

        .auth-side-list li::before {
            content: "✓";
            position: absolute;
            left: 0;
            color: var(--sidebar-active-text);
            font-weight: 800;
        }

.auth-side-foot {
    font-size: 12px;
    color: var(--sidebar-text-muted);
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: min(440px, 100%);
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 36px 34px;
}

.auth-card-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--preto-azulado);
    margin-bottom: 6px;
}

.auth-card-subtitle {
    color: var(--texto-claro);
    font-size: 13.5px;
    margin-bottom: 26px;
}

.auth-password-wrap {
    position: relative;
}

    .auth-password-wrap .form-control {
        padding-right: 46px;
    }

.auth-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--texto-claro);
    cursor: pointer;
}

    .auth-password-toggle svg {
        width: 18px;
        height: 18px;
    }

    .auth-password-toggle.active,
    .auth-password-toggle:hover {
        color: var(--azul-principal);
        background: var(--azul-claro);
    }

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--texto-claro);
    cursor: pointer;
}

    .auth-check input {
        width: 16px;
        height: 16px;
        accent-color: var(--azul-principal);
    }

.auth-hint {
    margin: 22px 0 0;
    padding: 12px 14px;
    border-radius: var(--raio-sm);
    background: var(--fundo-suave);
    border: 1px dashed var(--borda);
    font-size: 12px;
    color: var(--texto-claro);
}

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

    .auth-side {
        padding: 28px 24px;
        min-height: auto;
    }

    .auth-side-content {
        display: none;
    }

    .auth-side-foot {
        display: none;
    }

    .auth-main {
        padding: 24px 16px;
    }

    .auth-card {
        padding: 28px 22px;
    }
}

/* =====================================================
   DESCONTO: ALTERNADOR % / R$ (orçamento e venda rápida)
   ===================================================== */

.crm-toggle-tipo {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    gap: 2px;
}

.crm-toggle-tipo-btn {
    border: none;
    background: transparent;
    color: var(--texto-claro);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .crm-toggle-tipo-btn:hover {
        color: var(--azul-principal);
    }

    .crm-toggle-tipo-btn.active {
        background: var(--azul-principal);
        color: var(--branco);
        box-shadow: 0 2px 8px rgba(194, 65, 12, 0.3);
    }

.crm-toggle-tipo-lg {
    display: flex;
    width: 100%;
}

    .crm-toggle-tipo-lg .crm-toggle-tipo-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 13px;
    }

/* =====================================================
   PAGAMENTOS / CONTAS A RECEBER
   ===================================================== */

.crm-badge-ok {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--verde-claro);
    color: var(--verde);
}

:root[data-theme="dark"] .crm-badge-ok {
    color: #4ade80;
}

:root[data-theme="dark"] .crm-badge-perigo {
    color: #fca5a5;
}

:root[data-theme="dark"] .crm-badge-alerta {
    color: #fcd34d;
}

.crm-pag-resumo {
    padding: 14px 16px;
    border-radius: var(--raio-sm);
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
    height: 100%;
}

.crm-pag-resumo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--texto-claro);
    margin-bottom: 4px;
}

.crm-pag-resumo-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--preto-azulado);
    letter-spacing: -0.01em;
}

.crm-pag-resumo-ok {
    background: var(--verde-claro);
    border-color: rgba(21, 128, 61, 0.25);
}

    .crm-pag-resumo-ok .crm-pag-resumo-value {
        color: var(--verde);
    }

.crm-pag-resumo-alerta {
    background: var(--amarelo-claro);
    border-color: rgba(161, 98, 7, 0.3);
}

    .crm-pag-resumo-alerta .crm-pag-resumo-value {
        color: var(--amarelo);
    }

:root[data-theme="dark"] .crm-pag-resumo-ok .crm-pag-resumo-value {
    color: #4ade80;
}

:root[data-theme="dark"] .crm-pag-resumo-alerta .crm-pag-resumo-value {
    color: #fcd34d;
}

.crm-pag-form {
    padding: 14px 16px;
    border-radius: var(--raio-sm);
    border: 1px dashed var(--borda);
    background: var(--fundo-suave);
}

.crm-row-atrasada td {
    background: var(--vermelho-claro);
}

.crm-row-atrasada td:first-child {
    box-shadow: inset 3px 0 0 var(--vermelho);
}

/* =====================================================
   CALCULADORA DE m²
   ===================================================== */

.btn-calc {
    font-size: 12px;
    font-weight: 700;
    padding-left: 10px;
    padding-right: 10px;
    border-color: var(--borda);
    color: var(--texto-claro);
    background: var(--superficie);
    white-space: nowrap;
}

    .btn-calc:hover, .btn-calc:focus {
        background: var(--azul-claro);
        border-color: var(--azul-principal);
        color: var(--azul-principal);
    }

.crm-table .input-group .form-control.qtd {
    min-width: 80px;
}

.crm-calc-sub {
    font-size: 12px;
    color: var(--texto-claro);
    margin-top: 2px;
}

.crm-calc .form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--texto-claro);
    margin-bottom: 4px;
}

.crm-calc .form-text {
    font-size: 11px;
    color: var(--texto-claro);
}

.crm-calc-resultado {
    padding: 12px 16px;
    border-radius: var(--raio-sm);
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
}

.crm-calc-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--texto-claro);
    padding: 4px 0;
}

    .crm-calc-linha strong {
        color: var(--texto);
        font-weight: 600;
    }

.crm-calc-linha-total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--borda);
    font-weight: 700;
    color: var(--texto);
}

    .crm-calc-linha-total strong {
        font-size: 20px;
        font-weight: 800;
        color: var(--azul-principal);
    }

/* =====================================================
   PARCELAMENTO (cartão de crédito / boleto)
   ===================================================== */

.crm-parcelamento {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--raio-sm);
    background: var(--fundo-suave);
    border: 1px dashed var(--borda);
}

.crm-parcelamento-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--borda);
    font-size: 12.5px;
    color: var(--texto);
    line-height: 1.45;
}

.crm-parcelamento-aviso {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--amarelo-claro);
    color: var(--amarelo);
    font-size: 12px;
    font-weight: 600;
}

:root[data-theme="dark"] .crm-parcelamento-aviso {
    color: #fcd34d;
}

/* =====================================================
   AGENDA DE ENTREGAS / INVENTÁRIO / REAJUSTE
   ===================================================== */

.crm-entrega-agenda {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--raio-sm);
    background: var(--fundo-suave);
    border: 1px dashed var(--borda);
}

.crm-entrega-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crm-entrega-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    background: var(--superficie);
}

.crm-entrega-data {
    flex: 0 0 64px;
    text-align: center;
    padding: 6px 0;
    border-radius: 12px;
    background: var(--fundo-suave);
    border: 1px solid var(--borda);
}

.crm-entrega-dia {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--preto-azulado);
}

.crm-entrega-mes {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--texto-claro);
    margin-top: 2px;
}

.crm-entrega-periodo {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--azul-principal);
    margin-top: 4px;
}

.crm-entrega-atraso {
    font-size: 10px;
    font-weight: 700;
    color: var(--vermelho);
    margin-top: 2px;
}

.crm-entrega-corpo {
    flex: 1;
    min-width: 0;
}

.crm-entrega-titulo {
    font-size: 14px;
    margin-bottom: 4px;
}

.crm-entrega-linha {
    font-size: 12.5px;
    margin-top: 2px;
    color: var(--texto);
}

.crm-entrega-obs {
    color: var(--azul-principal);
    font-weight: 600;
}

.crm-entrega-acoes {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.crm-entrega-total {
    font-weight: 800;
    color: var(--preto-azulado);
}

.crm-entrega-grupo-atrasada {
    border-left: 4px solid var(--vermelho);
}

.crm-entrega-grupo-hoje {
    border-left: 4px solid var(--azul-principal);
}

@media (max-width: 640px) {
    .crm-entrega-item {
        flex-wrap: wrap;
    }

    .crm-entrega-acoes {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }
}

.crm-row-ok td {
    background: var(--verde-claro);
}

.crm-row-ok td:first-child {
    box-shadow: inset 3px 0 0 var(--verde);
}
