/* CoteCerto - Custom Styles */
/* Tailwind CSS carregado via CDN no index.html */

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ── Sidebar — usa left em vez de transform para não criar stacking context
      (transform cria containing block para position:fixed, quebrando modais) ── */
.sidebar-panel {
    position: fixed;
    top: 0; bottom: 0;
    left: -256px;
    width: 256px;
    z-index: 49;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    transition: left 300ms ease-in-out;
}
.sidebar-panel.sidebar-open {
    left: 0;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.insight-hero-subtitle {
    margin: -4px 0 10px;
    color: #64748b;
    font-size: 0.95rem;
}

body {
    background-color: #F3F4F6 !important;
}

.page-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-content--no-top {
    padding-top: 0;
}

.page-header {
    background: #FFFFFF;
    padding: 20px 32px;
    border-bottom: 1px solid #E5E7EB;
}

.breadcrumb {
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: transparent;
    box-shadow: none;
}

.breadcrumb /* Item pai do breadcrumb quando e acao (fecha o formulario) em vez de navegacao. */
.breadcrumb-link--acao {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.breadcrumb-separator {
    color: #9CA3AF;
}

.page-heading h1,
.page-header > h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.page-heading .subtitle,
.page-header > p.subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-top: 4px;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .page-header {
        padding: 16px;
    }

    .page-content {
        padding: 16px;
    }

    .page-content--no-top {
        padding-top: 0;
    }
}

.page-card,
.form-card,
.option-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    border: none;
}

.timeline-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    border: none;
}

.timeline-card--compact {
    padding: 14px 18px;
    margin-bottom: 16px;
}

.timeline-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-step__label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.timeline-separator {
    width: 28px;
    height: 1px;
    background: #E5E7EB;
}

.page-card .page-card,
.page-card .form-card,
.page-card .option-card,
.form-card .page-card,
.form-card .form-card,
.form-card .option-card,
.option-card .page-card,
.option-card .form-card,
.option-card .option-card {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border: none;
    padding: 0;
}

:root {
    --cc-primary: #2e7d32;
    --cc-primary-hover: #276a2b;
    --cc-secondary-border: #dcdcdc;
    --cc-secondary-text: #444;

    /* Rampa de verde da marca (ver DESIGN.md). Fonte única dos verdes do app. */
    --cc-green-900: #14532d; /* hover/active mais escuro */
    --cc-green-800: #166534; /* texto verde sobre tint claro */
    --cc-green-700: #15803d; /* primária canônica */
    --cc-green-600: #16a34a; /* brilho / 2º ponto do gradiente */
    --cc-green-500: #22c55e; /* acento / sinal positivo */
    --cc-green-300: #86efac; /* borda de tint */
    --cc-green-200: #bbf7d0; /* borda de status verde */
    --cc-green-100: #dcfce7; /* fundo de badge confirmado/sucesso */
    --cc-green-50:  #f0fdf4; /* fundo claro / realce sutil */

    /* Neutros e semânticos do DESIGN.md. Existiam só como literais espalhados pelas
       páginas — 83 tons diferentes só na tela de contrato — e é assim que a paleta
       se desfaz: cada tela escolhe o seu cinza. Aqui é a fonte única. */
    --cc-ink:          #111827; /* títulos e números de protagonismo */
    --cc-ink-body:     #374151; /* texto de leitura — piso de contraste do corpo */
    --cc-muted:        #6B7280; /* legendas e metadados */
    --cc-muted-soft:   #9CA3AF; /* separadores e ornamento; nunca corpo */
    --cc-label:        #475569; /* rótulo de campo em maiúsculas */
    --cc-bg:           #F3F4F6; /* fundo da aplicação */
    --cc-surface:      #FFFFFF; /* painéis e cards */
    --cc-border:       #E5E7EB; /* divisores e contorno de painel */
    --cc-border-input: #D1D9E0; /* contorno de campo em repouso */

    --cc-warning-bg:   #FFF7CC;
    --cc-warning-text: #B45309;
    --cc-danger-bg:    #FEE2E2;
    --cc-danger-text:  #B91C1C;
    --cc-info-bg:      #EFF6FF;
    --cc-info-text:    #2563EB;

    /* Raios e sombras — o padrão é 10px em campo/botão e 12px em card. */
    --cc-r-sm: 8px;
    --cc-r-md: 10px;
    --cc-r-lg: 12px;
    --cc-shadow-panel: 0 6px 18px rgba(0,0,0,.05);
    --cc-shadow-focus: 0 0 0 3px rgba(21,128,61,.1);

    --app-header-height: 72px; /* altura do MainHeader fixo (h-[72px]) */
}

/* ══════════════════════════════════════════════
   App Header — fixo no topo, padrão Gestão 3
   ══════════════════════════════════════════════ */
.app-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 64px;
}

/* Entrada Mercadoria - page background and panel highlight */
.entrada-page {
    background: #f5f7fa;
    margin: -16px -16px 0;
}

@media (min-width: 768px) {
    .entrada-page {
        margin: -24px -24px 0;
    }
}

.entrada-page__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.entrada-page__panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    padding: 24px;
}

.entrada-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.entrada-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.entrada-card__icon {
    color: #4b5563;
}

.entrada-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.entrada-table {
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10), 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* ══════════════════════════════════════════════
   PageActionBar — toolbar padrão Gestão 3
   ══════════════════════════════════════════════ */
.page-action-bar {
    /* Fixed abaixo do App Header — padrão Gestão 3 */
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 40;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    margin: 0;
}

.page-action-bar__spacer {
    height: 56px;
    flex-shrink: 0;
}

.page-action-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px;
    height: 56px;
    max-width: 1540px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.page-action-bar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.page-action-bar__heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.page-action-bar__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    color: #374151;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.page-action-bar__back:hover {
    background: #f3f4f6;
}

.page-action-bar__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-action-bar__title--header {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.page-action-bar__title-description {
    font-size: 14px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.page-action-bar--detailed .page-action-bar__inner {
    height: auto;
    min-height: 72px;
    padding: 20px 32px;
    align-items: flex-start;
}

.page-action-bar--detailed .page-breadcrumb--clean {
    font-size: 13px;
    margin-bottom: 6px;
}

.page-action-bar--detailed .page-action-bar__left {
    align-items: flex-start;
}

.page-action-bar__subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-action-bar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

@media (max-width: 640px) {
    .page-action-bar__inner {
        flex-direction: row;
        align-items: center;
        height: 52px;
        padding: 0 12px;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .page-action-bar--detailed .page-action-bar__inner {
        padding: 0 12px;
    }

    /* A barra termina em 116px (top 64 + 52); o espaçador fica dentro do <main>, que já
       soma 16px de padding — com 52px o conteúdo começava em 140px, 24px de vazio. */
    .page-action-bar__spacer {
        height: 36px;
    }

    /* Breadcrumb mobile: esconde intermediários, mostra só o atual */
    .page-action-bar__left {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .page-breadcrumb .breadcrumb-link,
    .page-breadcrumb .breadcrumb-separator {
        display: none;
    }

    .page-breadcrumb .breadcrumb-current {
        font-size: 13px;
        font-weight: 600;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        max-width: 100%;
    }

    /* Título simples (sem breadcrumb) */
    .page-action-bar__title {
        font-size: 14px;
    }

    /* Botões: ícone apenas nos secundários, primário mantém texto curto */
    .page-action-bar__right {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    .page-action-bar__right .action-btn {
        padding: 7px 10px;
        font-size: 0;      /* esconde texto */
        gap: 0;
    }

    .page-action-bar__right .action-btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    /* Botão primário mantém texto */
    .page-action-bar__right .action-btn--primary {
        font-size: 12px;
        gap: 5px;
        padding: 7px 12px;
    }
}

/* ══════════════════════════════════════════════
   Breadcrumb — navegação hierárquica
   ══════════════════════════════════════════════ */
.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    min-width: 0;
    flex-wrap: nowrap;
}

.breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.breadcrumb-link:hover {
    color: var(--cc-primary);
}

.breadcrumb-separator {
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.breadcrumb-current {
    color: #6b7280;
    font-weight: 400;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-breadcrumb--clean {
    font-size: 1rem;
    gap: 8px;
}

.page-breadcrumb--clean .breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ══════════════════════════════════════════════
   Action buttons — pill style padrão Gestão 3
   ══════════════════════════════════════════════ */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.8125rem;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

.action-btn--primary {
    background: var(--cc-primary);
    color: #ffffff;
    border-color: var(--cc-primary);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.24);
}

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

.action-btn--secondary {
    background: transparent;
    color: var(--cc-secondary-text);
    border-color: var(--cc-secondary-border);
}

.action-btn--secondary:hover {
    background: #f8faf8;
    border-color: #b8c8b9;
    color: #2f3a31;
}

.action-btn--ghost {
    background: none;
    border: none;
    color: #6b7280;
    padding-left: 6px;
    padding-right: 6px;
    box-shadow: none;
}

.action-btn--ghost:hover {
    color: #374151;
    background: #f8fafc;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ══════════════════════════════════════════════
   Listing Page — wrapper padrão para listagens
   ══════════════════════════════════════════════ */
.listing-page {
    background: #F3F4F6;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
    min-height: calc(100vh - 64px - 56px);
}

@media (min-width: 768px) {
    .listing-page {
        margin-left: -24px;
        margin-right: -24px;
        margin-bottom: -24px;
    }
}

.listing-page__content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

@media (min-width: 640px) {
    .listing-page__content {
        padding: 32px 24px 48px;
    }
}

/* Standard listing cards */
.content-area,
.listing-page__content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-card,
.list-card,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100.overflow-hidden,
.listing-page__content > .bg-white.rounded-lg.shadow.overflow-hidden.table-wrapper {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    border: none;
}

.filter-card,
.list-card {
    padding: 24px;
}

/* Standard table look inside listing cards */
.list-card table,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100 table,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100.overflow-hidden table,
.listing-page__content > .bg-white.rounded-lg.shadow.overflow-hidden.table-wrapper table {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.list-card thead,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100 thead,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100.overflow-hidden thead,
.listing-page__content > .bg-white.rounded-lg.shadow.overflow-hidden.table-wrapper thead {
    background: #F9FAFB;
}

.list-card thead th,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100 thead th,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100.overflow-hidden thead th,
.listing-page__content > .bg-white.rounded-lg.shadow.overflow-hidden.table-wrapper thead th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.list-card tbody tr,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100 tbody tr,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100.overflow-hidden tbody tr,
.listing-page__content > .bg-white.rounded-lg.shadow.overflow-hidden.table-wrapper tbody tr {
    border-bottom: 1px solid #F1F5F9;
}

.list-card tbody tr:hover,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100 tbody tr:hover,
.listing-page__content > .bg-white.rounded-2xl.shadow-sm.border.border-gray-100.overflow-hidden tbody tr:hover,
.listing-page__content > .bg-white.rounded-lg.shadow.overflow-hidden.table-wrapper tbody tr:hover {
    background: #F8FAFC;
}

/* ══════════════════════════════════════════════
   Dashboard KPI Cards — visual upgrade profissional
   ══════════════════════════════════════════════ */
.listing-page__content > .grid {
    gap: 16px !important;
}

/* Cards de métricas dentro do grid de 4 colunas */
.listing-page__content > .grid > .bg-white.rounded-2xl {
    border: 1px solid #e8ecf0 !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.02) !important;
    padding: 20px 22px !important;
    transition: box-shadow .2s ease, transform .15s ease;
    position: relative;
    overflow: hidden;
}

.listing-page__content > .grid > .bg-white.rounded-2xl:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04) !important;
    transform: translateY(-1px);
}

/* Números grandes nos cards */
.listing-page__content > .grid > .bg-white.rounded-2xl .text-3xl {
    font-size: 28px !important;
    font-weight: 800 !important;
    letter-spacing: -.5px;
    line-height: 1.1;
}

/* Labels dos cards */
.listing-page__content > .grid > .bg-white.rounded-2xl .text-sm.font-medium {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280 !important;
}

/* Ícones circulares nos cards */
.listing-page__content > .grid > .bg-white.rounded-2xl .rounded-xl {
    border-radius: 10px !important;
    width: 42px !important;
    height: 42px !important;
}

/* ══════════════════════════════════════════════
   Table container — bordas e sombra refinada
   ══════════════════════════════════════════════ */
.filter-card,
.list-card {
    border: 1px solid #e8ecf0 !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.02) !important;
}

/* Table header refinado */
.list-card thead,
.listing-page__content table thead {
    background: linear-gradient(180deg, #f8fafb 0%, #f1f5f9 100%) !important;
}

.list-card thead th,
.listing-page__content table thead th {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .06em !important;
    color: #64748b !important;
    padding: 14px 20px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    white-space: nowrap;
}

/* Table rows */
.list-card tbody td,
.listing-page__content table tbody td {
    padding: 14px 20px !important;
    font-size: 13px !important;
    color: #1e293b;
    vertical-align: middle;
}

.list-card tbody tr,
.listing-page__content table tbody tr {
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background .12s ease;
}

.list-card tbody tr:hover,
.listing-page__content table tbody tr:hover {
    background: #f8fafb !important;
}

/* Valor bold na tabela */
.list-card tbody td .font-semibold,
.list-card tbody td .font-bold {
    font-weight: 700 !important;
    color: #0f172a;
}

/* Status badges refinados */
.listing-page__content .rounded-full.text-xs.font-medium,
.listing-page__content .rounded-full.text-xs.font-semibold {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    letter-spacing: .02em;
}

/* Action buttons na tabela — apenas botões de ÍCONE (inline-flex). Botões de texto
   (com px-* / text-xs) são preservados com o tamanho intrínseco do Tailwind. */
.listing-page__content table tbody .rounded-lg.transition-colors.inline-flex {
    border-radius: 8px !important;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════════════
   Form containers — entrada de mercadoria nova
   ══════════════════════════════════════════════ */
.min-h-screen .bg-white.rounded-2xl {
    border: 1px solid #e8ecf0 !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.02) !important;
}

/* Section headers dentro de forms */
.min-h-screen .text-base.font-semibold,
.min-h-screen .text-lg.font-semibold {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -.2px;
}

/* Form inputs refinados */
.min-h-screen input.border-gray-200,
.min-h-screen select.border-gray-200,
.min-h-screen textarea.border-gray-200,
.min-h-screen input.border.border-gray-200,
.min-h-screen select.border.border-gray-200 {
    border-color: #d1d9e0 !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.min-h-screen input.border-gray-200:focus,
.min-h-screen select.border-gray-200:focus,
.min-h-screen textarea.border-gray-200:focus {
    border-color: var(--cc-green-700) !important;
    box-shadow: 0 0 0 3px rgba(21,128,61,.1) !important;
}

/* Form labels */
.min-h-screen .text-xs.font-semibold.text-slate-600,
.min-h-screen label.text-xs.font-semibold {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #475569 !important;
}

/* Primary buttons */
.min-h-screen .bg-emerald-600 {
    background: linear-gradient(135deg, var(--cc-green-700) 0%, var(--cc-green-600) 100%) !important;
    box-shadow: 0 2px 8px rgba(21,128,61,.2) !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    transition: all .15s ease;
}

.min-h-screen .bg-emerald-600:hover {
    background: linear-gradient(135deg, var(--cc-green-900) 0%, var(--cc-green-700) 100%) !important;
    box-shadow: 0 4px 12px rgba(21,128,61,.3) !important;
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════
   Page Action Bar — refinamento
   ══════════════════════════════════════════════ */
.page-action-bar {
    border-bottom: 2px solid #e8ecf0;
}

.action-btn--primary {
    background: linear-gradient(135deg, var(--cc-green-700) 0%, var(--cc-green-600) 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(21,128,61,.2) !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
}

.action-btn--primary:hover {
    background: linear-gradient(135deg, var(--cc-green-900) 0%, var(--cc-green-700) 100%) !important;
    box-shadow: 0 4px 12px rgba(21,128,61,.3) !important;
    transform: translateY(-1px);
}

.action-btn--secondary {
    border-radius: 10px !important;
    border-color: #d1d9e0 !important;
    font-weight: 600 !important;
}

.action-btn--secondary:hover {
    background: #f8fafb !important;
    border-color: #b8c4ce !important;
}

.list-pagination {
    margin-top: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.status-badge--draft {
    background: #fff7cc;
    color: #b45309;
}

.status-badge--confirmed {
    background: var(--cc-green-100);
    color: var(--cc-green-700);
}

.status-badge--cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.status-badge--info {
    background: #eff6ff;
    color: #2563eb;
}

.status-badge--neutral {
    background: #f3f4f6;
    color: #374151;
}

.entrada-table__body {
    max-height: 420px;
    overflow: auto;
}

.entrada-table__head {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: inset 0 -1px 0 #e2e8f0;
}

/* Scrollbars discretos e visíveis */
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

html, body {
    overflow-y: auto;
}

*::-webkit-scrollbar {
    width: 6px;
}

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

*::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Remoção de foco/outline em wrappers de tabela */
.table-wrapper,
.table-responsive,
.table-container {
    outline: none !important;
}

.table-wrapper:focus,
.table-wrapper:focus-visible,
.table-wrapper:focus-within,
.table-responsive:focus,
.table-responsive:focus-visible,
.table-responsive:focus-within,
.table-container:focus,
.table-container:focus-visible,
.table-container:focus-within {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.table-wrapper table,
.table-responsive table,
.table-container table,
.table-wrapper table tr,
.table-responsive table tr,
.table-container table tr,
.table-wrapper table tbody,
.table-responsive table tbody,
.table-container table tbody {
    outline: none !important;
    box-shadow: none !important;
}

.table-wrapper table:focus,
.table-wrapper table:focus-visible,
.table-wrapper table:focus-within,
.table-responsive table:focus,
.table-responsive table:focus-visible,
.table-responsive table:focus-within,
.table-container table:focus,
.table-container table:focus-visible,
.table-container table:focus-within {
    outline: none !important;
    box-shadow: none !important;
}

/* Manter foco visível em elementos interativos */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--cc-green-600);
    outline-offset: 2px;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Insight dashboard (global fallback for componentized summary page) */
.insight-page-bg {
    min-height: 100vh;
    background: linear-gradient(180deg, #f4f8f5 0%, #ffffff 52%, #f7faf8 100%);
    padding: 24px 16px 32px;
}

.insight-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.insight-main {
    display: grid;
    gap: 24px;
}

.insight-ops-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.insight-card {
    background: #ffffff;
    border: 1px solid #dbe6de;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    padding: 20px;
}

.insight-action-header {
    position: sticky;
    top: calc(var(--app-header-height) + 8px); /* gruda abaixo do MainHeader fixo + folga */
    z-index: 30; /* abaixo do MainHeader (z-40) para nunca cobri-lo */
    scroll-margin-top: calc(var(--app-header-height) + 8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #d4e3d9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
}

.insight-hero-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.insight-strength-pill {
    border-radius: 999px;
    padding: 0.24rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 700;
}

.insight-strength-low {
    background: #fee2e2;
    color: #b91c1c;
}

.insight-strength-medium {
    background: #fef3c7;
    color: #92400e;
}

.insight-strength-high {
    background: var(--cc-green-100);
    color: var(--cc-green-800);
}

.insight-action-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.insight-header-title {
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
}

.insight-header-subtitle,
.insight-overline,
.insight-section-header p,
.insight-kpi-label,
.insight-kpi-subtitle,
.insight-empty {
    color: #64748b;
}

.insight-overline {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--cc-green-800);
}

.insight-select,
.insight-input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 0.56rem 0.72rem;
    font-size: 0.85rem;
}

.insight-input {
    width: 100%;
}

.insight-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.58rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.insight-btn-primary {
    color: #fff;
    background: var(--cc-green-700);
}

.insight-btn-secondary {
    color: var(--cc-green-800);
    background: var(--cc-green-100);
    border-color: var(--cc-green-300);
}

.insight-btn-ghost {
    color: var(--cc-green-900);
    background: #fff;
    border-color: var(--cc-green-200);
}

.insight-hero {
    border: 1px solid #e5e7eb;
}

.insight-hero-low {
    border-color: var(--cc-green-200);
}

.insight-hero-medium {
    border-color: #fde68a;
}

.insight-hero-high {
    border-color: #fecaca;
}

.insight-hero-top,
.insight-compare-head,
.insight-rank-header,
.insight-rank-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.insight-hero-title {
    font-size: 1.65rem;
    line-height: 1.18;
    color: #0f172a;
    margin-bottom: 16px;
}

.insight-hero-grid,
.insight-kpi-grid,
.insight-compare-grid,
.insight-two-column,
.insight-alert-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.insight-hero-grid {
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
}

.insight-metric {
    position: relative;
}

.insight-kpi-icon {
    margin: 0;
    font-size: 1.05rem;
}

.insight-empty-box {
    border: 1px dashed #d7dde7;
    border-radius: 8px;
    padding: 10px 12px;
    color: #334155;
    text-align: center;
    font-weight: 600;
    background: #f8fafc;
}

.insight-metric-label {
    font-size: 0.74rem;
    color: #64748b;
}

.insight-metric-value,
.insight-kpi-value,
.insight-rank-value {
    font-weight: 700;
    color: #0f172a;
}

.insight-metric-value {
    font-size: 1.35rem;
}

.insight-kpi-value {
    font-size: 1.6rem;
}

.insight-risk-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.24rem 0.64rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.insight-risk-low {
    background: var(--cc-green-100);
    color: var(--cc-green-800);
}

.insight-risk-medium {
    background: #fef3c7;
    color: #92400e;
}

.insight-risk-high {
    background: #fee2e2;
    color: #991b1b;
}

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

.insight-bar-fill {
    height: 8px;
}

.insight-bar-best {
    background: linear-gradient(90deg, var(--cc-green-600) 0%, var(--cc-green-500) 100%);
}

.insight-bar-good {
    background: var(--cc-green-500);
}

.insight-bar-risk {
    background: #ef4444;
}

.insight-bar-neutral {
    background: #0f766e;
}

.insight-rank-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.insight-rank-row-best {
    border-color: var(--cc-green-300);
    background: var(--cc-green-50);
}

.insight-rank-position {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: #ecfdf3;
    color: var(--cc-green-800);
    font-size: 0.74rem;
    font-weight: 700;
}

.insight-alert-block {
    border: 1px solid #e5e7eb;
}

.insight-alert-critical {
    border-color: #fecaca;
    background: #fef2f2;
}

.insight-alert-info {
    border-color: #fde68a;
    background: #fffbeb;
}

.insight-alert-summary {
    border-color: #bfdbfe;
    background: #f8fafc;
}

.insight-empty-rich {
    border: 1px dashed #fbcfe8;
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.7);
}

.insight-empty-rich strong {
    display: block;
    color: #1e293b;
    margin-bottom: 2px;
}

.insight-empty-rich p {
    margin: 0;
    color: #475569;
}

.insight-summary-list {
    display: grid;
    gap: 8px;
}

.insight-summary-list p {
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed #dbe3ee;
    color: #334155;
}

.insight-summary-list p span {
    color: #1e293b;
}

.insight-summary-warning {
    margin-top: 10px;
    border: 1px solid #f3d2d2;
    border-radius: 8px;
    background: #fff1f1;
    color: #7f1d1d;
    padding: 8px 10px;
    text-align: center;
}

/* ── Decision Hero: Score circle ── */
.insight-hero-score-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.insight-hero-score-circle {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid currentColor;
}

.insight-hero-score-number {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.insight-hero-score-max {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.7;
}

.insight-score-green {
    color: var(--cc-green-600);
    background: var(--cc-green-50);
    border-color: var(--cc-green-500);
}

.insight-score-yellow {
    color: #a16207;
    background: #fefce8;
    border-color: #eab308;
}

.insight-score-red {
    color: #dc2626;
    background: #fef2f2;
    border-color: #ef4444;
}

.insight-hero-score-context {
    flex: 1;
    min-width: 0;
}

.insight-hero-subtitle {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 6px;
}

/* ── Diagnóstico Estratégico ── */
.insight-diagnostico {
    margin-bottom: 4px;
}

.insight-diagnostico-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}

.insight-diag-card {
    border: 1px solid #e2e8f0;
    padding: 16px 18px;
}

.insight-diag-verde {
    border-color: var(--cc-green-200);
}

.insight-diag-amarelo {
    border-color: #fde68a;
}

.insight-diag-vermelho {
    border-color: #fecaca;
}

.insight-diag-neutro {
    border-color: #e2e8f0;
}

.insight-diag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.insight-diag-icon {
    font-size: 1.15rem;
}

.insight-diag-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.insight-diag-badge-verde {
    background: var(--cc-green-100);
    color: var(--cc-green-800);
}

.insight-diag-badge-amarelo {
    background: #fef3c7;
    color: #92400e;
}

.insight-diag-badge-vermelho {
    background: #fee2e2;
    color: #991b1b;
}

.insight-diag-badge-neutro {
    background: #f1f5f9;
    color: #475569;
}

.insight-diag-text {
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.45;
    margin: 0;
}

.insight-economia-potencial-flag {
    margin: 10px 0 0;
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* ── Valor Agregado ── */
.insight-valor-agregado {
    border: 1px solid #e2e8f0;
}

.insight-valor-positivo {
    border-color: var(--cc-green-200);
    background: var(--cc-green-50);
}

.insight-valor-parcial {
    border-color: #fde68a;
    background: #fffbeb;
}

.insight-valor-negativo {
    border-color: #fecaca;
    background: #fef2f2;
}

.insight-valor-neutro {
    border-color: #e2e8f0;
}

.insight-valor-resposta {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 12px;
}

.insight-valor-icone {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
}

.insight-valor-corpo {
    flex: 1;
    min-width: 0;
}

.insight-valor-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-bottom: 4px;
}

.insight-valor-justificativa {
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.5;
    margin: 0;
}

/* ── Interpretive messages (replace "Sem dados") ── */
.insight-interpretive-msg {
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 8px;
}

.insight-msg-neutral {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.insight-msg-positivo {
    border: 1px solid var(--cc-green-200);
    background: var(--cc-green-50);
    color: var(--cc-green-800);
}

/* ── Inline badges (Atende / Não atende / Melhor preço) ── */
.insight-compare-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-inline-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.insight-badge-ok {
    background: var(--cc-green-100);
    color: var(--cc-green-800);
}

.insight-badge-risco {
    background: #fee2e2;
    color: #991b1b;
}

.insight-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ── Ranking diff labels ── */
.insight-rank-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.insight-rank-diff {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}

.insight-diff-best {
    background: var(--cc-green-100);
    color: var(--cc-green-800);
}

.insight-diff-medio {
    background: #fef3c7;
    color: #92400e;
}

.insight-diff-alto {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Alert OK state ── */
.insight-alert-ok {
    border-left-color: var(--cc-green-500);
    background: var(--cc-green-50);
}

.insight-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.insight-alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.insight-alert-item p {
    margin: 0;
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.45;
}

/* ── Responsive ── */
@media (min-width: 768px) {
    .insight-kpi-grid,
    .insight-compare-grid,
    .insight-two-column,
    .insight-alert-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insight-hero-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (min-width: 1200px) {
    .insight-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* === Hero executivo (modelo cotacao) === */
.insight-hero.insight-hero-model {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

/* Risco do cenário é comunicado pelo score, pelos badges e pela cor da borda
   (insight-hero-low/medium/high); sem faixa colorida pesada no topo. */

.insight-hero.insight-hero-model .insight-hero-header {
    margin: 0;
    padding: 18px 24px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.insight-hero.insight-hero-model .insight-hero-layout {
    display: grid;
    grid-template-columns: 170px minmax(320px, 1fr) minmax(220px, 260px);
    gap: 24px;
    align-items: center;
    padding: 14px 24px;
}

.insight-hero.insight-hero-model .insight-hero-score-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.insight-hero.insight-hero-model .insight-hero-score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid currentColor;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.insight-hero.insight-hero-model .insight-hero-score-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.insight-hero.insight-hero-model .insight-hero-score-text,
.insight-hero.insight-hero-model .insight-hero-score-label,
.insight-hero.insight-hero-model .insight-hero-indicator-label {
    font-size: 12px;
}

.insight-hero.insight-hero-model .insight-hero-diagnostic-panel {
    border-left: 1px solid #e5e7eb;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-hero.insight-hero-model .insight-hero-insight {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.insight-hero.insight-hero-model .insight-hero-alert-icon {
    color: #f59e0b;
    line-height: 1;
}

.insight-hero.insight-hero-model .insight-hero-description {
    font-size: 14px;
    line-height: 1.4;
    color: #6b7280;
}

.insight-hero.insight-hero-model .insight-hero-indicators-panel {
    border-left: 1px solid #e5e7eb;
    padding-left: 20px;
}

.insight-hero.insight-hero-model .insight-hero-indicator-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 9px 0;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.insight-hero.insight-hero-model .insight-hero-indicator-item:last-child {
    border-bottom: 0;
}

.insight-hero.insight-hero-model .insight-hero-indicator-text {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.insight-hero.insight-hero-model .insight-risk-pill {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
}

.insight-hero.insight-hero-model .insight-hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #e5e7eb;
    padding: 12px 24px 16px;
}

.insight-hero.insight-hero-model .insight-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.insight-hero.insight-hero-model .insight-hero-analysis-date {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.insight-hero.insight-hero-model .insight-hero-analysis-label,
.insight-hero.insight-hero-model .insight-hero-analysis-value {
    font-size: 13px;
    color: #475569;
}

@media (max-width: 768px) {
    .insight-hero.insight-hero-model .insight-hero-header {
        padding: 14px 16px;
    }

    .insight-hero.insight-hero-model .insight-hero-layout {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px 16px;
    }

    .insight-hero.insight-hero-model .insight-hero-diagnostic-panel,
    .insight-hero.insight-hero-model .insight-hero-indicators-panel {
        border-left: 0;
        border-top: 1px solid #e5e7eb;
        padding-left: 0;
        padding-top: 10px;
    }

    .insight-hero.insight-hero-model .insight-hero-footer {
        padding: 12px 16px 16px;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Agro Intelligence — Leaflet tooltip custom ── */
.agro-tooltip-custom {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    padding: 10px 12px;
    pointer-events: none;
}
.agro-tooltip-custom::before {
    display: none;
}
.leaflet-tooltip.agro-tooltip-custom {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    padding: 10px 12px;
}
.leaflet-tooltip.agro-tooltip-custom::before,
.leaflet-tooltip.agro-tooltip-custom::after {
    display: none;
}

/* ══════════════════════════════════════════════════════
   MELHORIAS DASHBOARD — Tarefas 7 e 8
   ══════════════════════════════════════════════════════ */

/* 7.1 — Banner de boas-vindas compacto */
.welcome-banner, .dashboard-header, .greeting-card {
    padding: 20px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cc-green-600) 0%, var(--cc-green-700) 100%);
    margin-bottom: 16px;
}
.welcome-banner h2, .greeting-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.welcome-banner p, .greeting-card p { font-size: 13px; opacity: 0.85; }

/* 7.2 — Barra de filtros com chips */
.filter-bar {
    display: flex; align-items: center; gap: 10px; padding: 12px 0;
    margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar select, .filter-bar .filter-select {
    padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 20px;
    font-size: 12px; color: #374151; background: #fff; cursor: pointer;
    transition: all 0.15s; white-space: nowrap; appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.filter-bar select:focus, .filter-bar .filter-select:focus {
    border-color: var(--cc-green-600); outline: none; box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}

/* 7.3 — Cards KPI melhorados */
.kpi-container, .dashboard-cards, .stats-cards, .cards-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.kpi-card, .stat-card, .dashboard-card {
    background: #fff; border-radius: 12px; padding: 20px;
    border: 1px solid #e5e7eb; transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover, .stat-card:hover, .dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px);
}
.kpi-card .card-label, .kpi-card .card-title, .stat-card .label {
    font-size: 11px; font-weight: 600; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px;
}
.kpi-card .card-value, .stat-card .value {
    font-size: 26px; font-weight: 700; color: #1a1a1a; line-height: 1.2;
}
.kpi-change, .card-change, .stat-change {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 6px; margin-left: 8px;
}
.kpi-change.positive, .card-change.up, .stat-change.up { color: var(--cc-green-600); background: var(--cc-green-50); }
.kpi-change.negative, .card-change.down, .stat-change.down { color: #ef4444; background: #fef2f2; }

/* 7.4 — Botões de ação */
.dashboard-actions, .action-buttons { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.btn-primary, .btn-generate, .btn-cotacao {
    padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--cc-green-600); color: #fff;
}
.btn-primary:hover, .btn-generate:hover, .btn-cotacao:hover {
    background: var(--cc-green-700); box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.btn-secondary, .btn-filter, .btn-refresh {
    padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
    border: 1px solid #d1d5db; cursor: pointer; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #374151;
}
.btn-secondary:hover, .btn-filter:hover, .btn-refresh:hover { background: #f3f4f6; border-color: #9ca3af; }

/* 7.5 — Gráficos e tabelas */
.chart-container, .graph-card, .dashboard-chart {
    background: #fff; border-radius: 12px; padding: 20px;
    border: 1px solid #e5e7eb; margin-bottom: 16px;
}
.chart-container h3, .graph-card h3, .dashboard-chart h3 {
    font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 16px;
}
.charts-grid, .dashboard-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }

/* 7.6 — Funil de compras */
.funnel-card, .flow-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e5e7eb; }
.funnel-row, .flow-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid #f3f4f6;
}
.funnel-row:last-child, .flow-row:last-child { border-bottom: none; }
.funnel-label { font-size: 13px; color: #6b7280; }
.funnel-value { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.funnel-bar { height: 6px; border-radius: 3px; background: #e5e7eb; margin-top: 6px; overflow: hidden; }
.funnel-bar .fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.funnel-bar .fill.blue { background: #3b82f6; }
.funnel-bar .fill.green { background: var(--cc-green-600); }
.funnel-bar .fill.yellow { background: #f59e0b; }

/* Alertas e status */
.alert-card, .status-card {
    background: #fff; border-radius: 12px; padding: 16px 20px; border: 1px solid #e5e7eb;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px; transition: background 0.15s;
}
.alert-card:hover { background: #fafafa; }
.alert-badge {
    min-width: 28px; height: 28px; display: flex; align-items: center;
    justify-content: center; border-radius: 8px; font-size: 13px; font-weight: 700;
}
.alert-badge.danger { background: #fef2f2; color: #ef4444; }
.alert-badge.warning { background: #fffbeb; color: #f59e0b; }
.alert-badge.success { background: var(--cc-green-50); color: var(--cc-green-600); }

/* 8 — Atividade recente */
.activity-card, .recent-activity { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e5e7eb; }
.activity-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 12px 0; border-bottom: 1px solid #f3f4f6; gap: 12px;
}
.activity-item:last-child { border-bottom: none; }
.activity-info { flex: 1; }
.activity-title { font-size: 13px; color: #1a1a1a; font-weight: 500; margin-bottom: 2px; }
.activity-date { font-size: 11px; color: #9ca3af; }
.activity-status { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.activity-status.aprovado { background: var(--cc-green-50); color: var(--cc-green-600); }
.activity-status.em-cotacao { background: #eff6ff; color: #3b82f6; }
.activity-status.em-ordem { background: #fefce8; color: #ca8a04; }
.activity-status.pendente { background: #fef2f2; color: #ef4444; }

/* ══════════════════════════════════════════════════════
   RESPONSIVIDADE MOBILE COMPLETA
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* KPIs em 2 colunas */
    .kpi-container, .dashboard-cards, .stats-cards, .cards-row, .card-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 0 12px !important;
    }
    .kpi-card, .stat-card, .dashboard-card, .card {
        padding: 12px !important; border-radius: 10px !important;
    }
    .kpi-card .card-value, .stat-card .value, .card-value { font-size: 18px !important; }
    .kpi-card .card-label, .card-title, .stat-label { font-size: 9px !important; }
    .kpi-card canvas, .kpi-card .sparkline, .stat-card .mini-chart { display: none !important; }

    /* Gráficos em 1 coluna */
    .charts-grid, .dashboard-charts, .chart-row, .graphs-container {
        display: grid !important; grid-template-columns: 1fr !important;
        gap: 12px !important; padding: 0 12px !important;
    }
    .chart-container, .graph-card, .dashboard-chart {
        padding: 12px !important; border-radius: 10px !important; overflow-x: auto !important;
    }

    /* Tabelas com scroll horizontal */
    .table-container, .data-table-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; font-size: 11px !important; }

    /* Banner compacto */
    .welcome-banner, .greeting-card, .dashboard-header {
        padding: 16px !important; margin: 12px !important; border-radius: 10px !important;
    }
    .welcome-banner h2, .greeting-card h2 { font-size: 16px !important; }
    .welcome-banner p, .greeting-card p { font-size: 11px !important; }

    /* Filtros empilhados */
    .filter-container, .dashboard-filters, .welcome-banner .filters {
        display: flex !important; flex-direction: column !important; gap: 8px !important; margin-top: 12px !important;
    }
    .filter-container select, .dashboard-filters select {
        width: 100% !important; font-size: 12px !important; padding: 8px !important; border-radius: 8px !important;
    }
    .filter-bar { padding: 8px 12px; gap: 8px; }

    /* Botões de ação em scroll horizontal */
    .dashboard-actions, .action-buttons, .welcome-banner .buttons {
        display: flex !important; gap: 8px !important; overflow-x: auto !important;
        flex-wrap: nowrap !important; padding-bottom: 4px !important; -webkit-overflow-scrolling: touch;
    }
    .dashboard-actions::-webkit-scrollbar, .action-buttons::-webkit-scrollbar { display: none; }
    .dashboard-actions button, .action-buttons button, .btn-primary, .btn-secondary {
        white-space: nowrap !important; flex-shrink: 0 !important; font-size: 12px !important; padding: 8px 14px !important;
    }

    /* Funil / Flow cards */
    .flow-card, .funnel-card { padding: 12px !important; }
    .flow-card h3, .funnel-card h3 { font-size: 13px !important; }

    /* Alertas empilhados */
    .alert-cards, .alerts-container {
        display: flex !important; flex-direction: column !important; gap: 8px !important; padding: 0 12px !important;
    }

    /* Atividade recente */
    .activity-card, .recent-activity { padding: 12px !important; margin: 0 12px !important; }
    .activity-item { flex-direction: column !important; gap: 4px !important; }
}

/* ══════════════════════════════════════════════
   Movimento reduzido — respeita prefers-reduced-motion
   (animações como spin, slideInRight e animate-pulse viram quase instantâneas)
   ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ══════════════════════════════════════════════
   Hero de veredito — redesign do resumo da cotação
   Veredito como manchete, score como anel de dado.
   ══════════════════════════════════════════════ */
.verdict-hero {
    --verdict-color: #64748b;
    --verdict-tint: #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 28px;
    border: 1px solid var(--verdict-tint);
    border-radius: 16px;
}

.verdict-hero.verdict--green { --verdict-color: var(--cc-green-600); --verdict-tint: var(--cc-green-200); }
.verdict-hero.verdict--amber { --verdict-color: #d97706; --verdict-tint: #fde68a; }
.verdict-hero.verdict--red   { --verdict-color: #dc2626; --verdict-tint: #fecaca; }

.verdict-top {
    display: flex;
    align-items: center;
    gap: 24px;
}

.verdict-score {
    position: relative;
    flex-shrink: 0;
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
}

.verdict-ring { position: absolute; inset: 0; }
.verdict-ring__track { fill: none; stroke: #eef2f5; stroke-width: 7; }
.verdict-ring__value {
    fill: none;
    stroke: var(--verdict-color);
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dasharray .6s cubic-bezier(.22, 1, .36, 1);
}

.verdict-score__num { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.verdict-score__value { font-size: 1.9rem; font-weight: 800; color: #111827; letter-spacing: -0.02em; }
.verdict-score__max { font-size: 0.7rem; font-weight: 600; color: #9ca3af; margin-top: 2px; }

.verdict-headline-zone { min-width: 0; }
.verdict-eyebrow-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.verdict-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.verdict-headline {
    margin: 0 0 8px;
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    text-wrap: balance;
}
.verdict-explain { margin: 0; font-size: 0.95rem; line-height: 1.55; color: #374151; max-width: 68ch; }

.verdict-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 32px;
    padding: 16px 0;
    border-top: 1px solid #eef2f5;
    border-bottom: 1px solid #eef2f5;
}
.verdict-stat { display: flex; flex-direction: column; gap: 6px; }
.verdict-stat__label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #64748b; }
.verdict-stat__value { font-size: 0.95rem; font-weight: 600; color: #111827; }

.verdict-choice__title { margin: 0 0 10px; font-size: 0.95rem; font-weight: 600; color: #111827; }
.verdict-choice__grid { margin: 0; display: grid; gap: 10px; }
.verdict-choice__row { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 6px 20px; align-items: baseline; }
.verdict-choice__row dt { margin: 0; font-size: 0.85rem; font-weight: 600; color: #475569; }
.verdict-choice__situ { display: inline-block; margin-left: 4px; font-size: 0.72rem; font-weight: 700; color: #64748b; }
.verdict-choice__row dd { margin: 0; font-size: 0.9rem; line-height: 1.5; color: #374151; }

.verdict-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.verdict-date { display: flex; flex-direction: column; align-items: flex-end; }
.verdict-date__label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #94a3b8; }
.verdict-date__value { font-size: 0.85rem; font-weight: 600; color: #475569; }

@media (max-width: 640px) {
    .verdict-hero { padding: 20px; }
    .verdict-top { flex-direction: column; align-items: flex-start; gap: 16px; }
    .verdict-choice__row { grid-template-columns: 1fr; gap: 2px; }
    .verdict-footer { align-items: flex-start; }
    .verdict-date { align-items: flex-start; }
}

/* ══════════════════════════════════════════════
   Painéis comparativos (SPEC-COT-RESUMO-001 / resumo-cotacao.html)
   Entrega · Pagamento · Ranking. Linhas com divisor, sem card aninhado;
   líder marcado por badge, não por fundo verde.
   ══════════════════════════════════════════════ */
.cc-cmp-head { display: flex; align-items: flex-start; gap: 10px; }
.cc-cmp-head .cc-cmp-ic { color: #6b7280; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.cc-cmp-title { font-size: 18px; font-weight: 600; color: #111827; line-height: 1.3; margin: 0; }
.cc-cmp-sub { font-size: 12px; color: #6b7280; margin: 2px 0 0; }
.cc-cmp-sub b { color: #374151; font-weight: 600; }
.cc-cmp-nota { font-size: 12.5px; color: #6b7280; margin: 14px 0 6px; padding-left: 14px; border-left: 2px solid #e5e7eb; }

.cc-cmp-rows { margin-top: 6px; }
.cc-cmp-row { display: block; width: 100%; text-align: left; border: none; border-top: 1px solid #e5e7eb; padding: 13px 8px; background: transparent; font-family: inherit; cursor: pointer; transition: background .15s; }
.cc-cmp-row:hover { background: #f8fafc; }
.cc-cmp-row:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(21, 128, 61, .12); border-radius: 8px; }
.cc-cmp-chev { color: #9ca3af; display: inline-flex; transition: color .15s; }
.cc-cmp-row:hover .cc-cmp-chev { color: var(--cc-green-700); }
.cc-cmp-row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cc-cmp-name { font-size: 13.5px; font-weight: 600; color: #374151; line-height: 1.35; }
.cc-cmp-dias { font-size: 14px; font-weight: 700; color: #111827; white-space: nowrap; }
.cc-cmp-row-bot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }

.cc-cmp-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.cc-cmp-badge .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.cc-cmp-badge.ok { background: var(--cc-green-100); color: var(--cc-green-700); }
.cc-cmp-badge.no { background: #fee2e2; color: #b91c1c; }
.cc-cmp-badge.warn { display: inline-flex; align-items: center; gap: 5px; background: #fff7cc; color: #b45309; }

.cc-cmp-trilho { height: 6px; background: #eef0f2; border-radius: 999px; margin-top: 11px; overflow: hidden; }
.cc-cmp-fill { height: 100%; border-radius: 999px; transform-origin: left center; animation: ccCmpGrow .7s cubic-bezier(.22, 1, .36, 1) both; }
.cc-cmp-fill.neu { background: #9ca3af; }
.cc-cmp-fill.green { background: var(--cc-green-700); }

/* ranking */
.cc-cmp-rank-row { display: block; width: 100%; text-align: left; border: none; border-top: 1px solid #e5e7eb; padding: 16px 8px 14px; position: relative; background: transparent; font-family: inherit; cursor: pointer; transition: background .15s; }
.cc-cmp-rank-row:first-of-type { border-top: none; }
.cc-cmp-rank-row:hover { background: #f8fafc; }
.cc-cmp-rank-row:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(21, 128, 61, .12); border-radius: 8px; }
.cc-cmp-ver { display: inline-flex; align-items: center; gap: 3px; margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--cc-green-700); opacity: 0; transition: opacity .15s; }
.cc-cmp-rank-row:hover .cc-cmp-ver { opacity: 1; }
.cc-cmp-rank-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.cc-cmp-rank-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cc-cmp-pos { font-size: 13px; font-weight: 800; color: #6b7280; min-width: 26px; text-align: center; flex-shrink: 0; }
.cc-cmp-rank-row.lider .cc-cmp-pos { color: var(--cc-green-700); }
.cc-cmp-rank-name { font-size: 14px; font-weight: 600; color: #374151; line-height: 1.3; }
.cc-cmp-rank-right { text-align: right; flex-shrink: 0; }
.cc-cmp-valor { display: block; font-size: 24px; font-weight: 800; color: #111827; line-height: 1.1; letter-spacing: -.01em; }
.cc-cmp-rank-tag { margin-top: 6px; }
.cc-cmp-rank-trilho { height: 7px; background: #eef0f2; border-radius: 999px; margin-top: 13px; overflow: hidden; }

.cc-cmp-economia { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px 14px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13px; color: #374151; }
.cc-cmp-economia b { color: var(--cc-green-700); }
.cc-cmp-economia .cc-cmp-ic { color: var(--cc-green-700); display: grid; place-items: center; flex-shrink: 0; }

@keyframes ccCmpGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- Drawer de itens do fornecedor (IX01/IX02) ---- */
.cc-drawer-overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .4); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; }
.cc-drawer-overlay.on { opacity: 1; pointer-events: auto; }
.cc-drawer {
    position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 92vw);
    background: #fff; box-shadow: -16px 0 40px rgba(17, 24, 39, .25);
    transform: translateX(100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
    z-index: 61; display: flex; flex-direction: column; outline: none;
}
.cc-drawer.on { transform: translateX(0); }
.cc-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px; border-bottom: 1px solid #e5e7eb; }
.cc-drawer-title { font-size: 18px; font-weight: 600; color: #111827; margin: 0; line-height: 1.3; }
.cc-drawer-meta { font-size: 12px; color: #6b7280; margin-top: 3px; }
.cc-drawer-x { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #d1d9e0; background: #fff; color: #6b7280; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; transition: .15s; }
.cc-drawer-x:hover { background: #f8fafc; color: #374151; }
.cc-drawer-body { padding: 8px 22px; overflow-y: auto; flex: 1; }
.cc-drawer-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.cc-drawer-item-prod { font-size: 13.5px; font-weight: 600; color: #374151; }
.cc-drawer-item-det { font-size: 12px; color: #6b7280; margin-top: 2px; }
.cc-drawer-item-tot { font-size: 14px; font-weight: 700; color: #111827; white-space: nowrap; }
.cc-drawer-foot { border-top: 1px solid #e5e7eb; padding: 16px 22px 22px; }
.cc-drawer-foot-l { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: #374151; }
.cc-drawer-foot-l .l { color: #6b7280; }
.cc-drawer-foot-total { margin-top: 8px; padding-top: 12px; border-top: 1px solid #e5e7eb; font-size: 15px; font-weight: 700; color: #111827; }
.cc-drawer-foot-total .v { color: var(--cc-green-700); font-size: 20px; font-weight: 800; }

/* ---- FiltroAutocomplete (combobox de filtro) ---- */
.fa-field { position: relative; }
.fa-control { position: relative; }
.fa-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: grid; place-items: center; border: none; background: transparent; color: #9ca3af; cursor: pointer; border-radius: 6px; }
.fa-clear:hover { color: #374151; background: #f3f4f6; }
.fa-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
    margin: 0; padding: 4px; list-style: none; max-height: 240px; overflow-y: auto;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
}
.fa-list li { margin: 0; }
.fa-opt { display: block; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: #374151; line-height: 1.35; }
.fa-opt:hover { background: #f0fdf4; color: var(--cc-green-700); }
.fa-opt--sel { background: var(--cc-green-100); color: var(--cc-green-700); font-weight: 600; }
.fa-empty { padding: 8px 10px; font-size: 13px; color: #9ca3af; }

/* ── Animação dos drawers laterais ─────────────────────────────────────────
   A classe .animate-slide-in-right é usada em ~15 telas (Drawer.razor,
   ContasReceber, TitulosApagar, Financeiro, MovimentosEstoque, Negociacoes,
   PainelNotificacoes...), mas os keyframes nunca existiram: o Tailwind vem por
   CDN sem tailwind.config, então a classe era inerte e todos abriam sem
   transição. Definir aqui conserta todos de uma vez.
   ------------------------------------------------------------------------- */
@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.animate-slide-in-right {
    animation: slide-in-right 220ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* Respeita quem pediu menos movimento no sistema operacional. */
@media (prefers-reduced-motion: reduce) {
    .animate-slide-in-right { animation: none; }
}

/* =========================================================================
   Balança — Tickets de balança, Nova pesagem e gavetas de Components/Balanca.
   Classes globais (prefixo bal-) de propósito: o conteúdo das gavetas (Drawer)
   e dos modais chega por RenderFragment, onde o CSS isolado não alcança.
   ------------------------------------------------------------------------- */
.bal-painel { background:#fff; border:1px solid #E5E7EB; border-radius:12px; }
.bal-secao { background:#fff; border:1px solid #E5E7EB; border-radius:12px; padding:20px; display:flex; flex-direction:column; gap:14px; }
.bal-secao__hd { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.bal-rot { display:block; margin:0; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; line-height:1.3; }
.bal-obrig { color:#B91C1C; }
.bal-fld { display:flex; flex-direction:column; gap:6px; min-width:0; }
.bal-campo { height:42px; width:100%; box-sizing:border-box; padding:0 12px; border-radius:10px; border:1px solid #D1D9E0; background:#fff; color:#111827; font:inherit; font-size:14px; outline:none; transition:border-color .15s, box-shadow .15s; }
.bal-campo::placeholder { color:#9CA3AF; }
.bal-campo:focus { border-color:#15803d; box-shadow:0 0 0 3px rgba(21,128,61,.1); }
.bal-campo[readonly], .bal-campo:disabled { background:#F9FAFB; color:#374151; }
select.bal-campo { padding:0 10px; }
.bal-campo--placa { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:15px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.bal-campo--num { text-align:right; font-variant-numeric:tabular-nums; }
.bal-mono { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bal-num { font-variant-numeric:tabular-nums; }
.bal-dica { font-size:12px; color:#6B7280; line-height:1.4; margin:0; }
.bal-dica--aviso { color:#B45309; }
.bal-dica--ok { color:#15803D; }
.bal-dica--erro { color:#B91C1C; }

.bal-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:40px; padding:0 16px; border-radius:10px; border:1px solid transparent; font:inherit; font-size:14px; font-weight:600; line-height:1; cursor:pointer; white-space:nowrap; text-decoration:none; transition:background .15s, border-color .15s, box-shadow .15s, transform .15s, color .15s; }
.bal-btn svg { width:16px; height:16px; flex-shrink:0; }
.bal-btn--pri { background:linear-gradient(135deg,#15803d 0%,#16a34a 100%); color:#fff; box-shadow:0 2px 8px rgba(21,128,61,.2); }
.bal-btn--pri:hover:not(:disabled) { background:linear-gradient(135deg,#14532d 0%,#15803d 100%); box-shadow:0 4px 12px rgba(21,128,61,.3); transform:translateY(-1px); color:#fff; }
.bal-btn--sec { background:#fff; border-color:#D1D9E0; color:#374151; }
.bal-btn--sec:hover:not(:disabled) { background:#f8fafb; border-color:#BBF7D0; }
.bal-btn--ghost { background:none; color:#374151; padding:0 10px; }
.bal-btn--ghost:hover:not(:disabled) { background:#F3F4F6; }
.bal-btn--escuro { background:#374151; color:#fff; }
.bal-btn--escuro:hover:not(:disabled) { background:#111827; }
.bal-btn--lg { height:44px; padding:0 20px; }
.bal-btn--sm { height:36px; padding:0 12px; font-size:13px; }
.bal-btn:disabled, .bal-btn[aria-disabled="true"] { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }
.bal-link { background:none; border:0; padding:0; color:#15803d; font:inherit; font-weight:700; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.bal-link:hover { color:#14532d; }
.bal-icone-btn { width:36px; height:36px; flex:none; border-radius:10px; border:1px solid #D1D9E0; background:#fff; color:#374151; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.bal-icone-btn:hover { background:#F3F4F6; }

.bal-pilula { display:inline-flex; align-items:center; gap:6px; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; line-height:1.5; }
.bal-ponto { width:6px; height:6px; border-radius:999px; background:currentColor; flex-shrink:0; }

.bal-alerta { display:flex; gap:8px; align-items:flex-start; padding:8px 10px; border-radius:8px; font-size:13px; line-height:1.45; }
.bal-alerta svg { width:16px; height:16px; flex-shrink:0; margin-top:1px; }
.bal-alerta--erro { background:#FEE2E2; color:#991B1B; }
.bal-alerta--aviso { background:#FFF7CC; color:#92400E; }
.bal-alerta--info { background:#EFF6FF; color:#1E40AF; }

/* Pílulas de escolha (operação) e cartões de escolha (destino, conexão) */
.bal-opcao { display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:0 14px; border-radius:999px; border:1px solid #D1D9E0; background:#fff; color:#111827; cursor:pointer; font-size:14px; }
.bal-opcao input { accent-color:#15803d; }
.bal-opcao:hover { border-color:#86EFAC; }
.bal-opcao--sel { border:2px solid #15803d; padding:0 13px; background:#F0FDF4; color:#14532D; font-weight:600; }
.bal-escolha { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:10px; border:1px solid #D1D9E0; cursor:pointer; background:#fff; }
.bal-escolha input { margin-top:3px; accent-color:#15803d; }
.bal-escolha--sel { border:2px solid #15803d; padding:11px 13px; }

/* Modal central */
.bal-overlay { position:fixed; inset:0; z-index:60; background:rgba(17,24,39,.45); display:flex; align-items:center; justify-content:center; padding:16px; }
.bal-modal { background:#fff; border-radius:16px; width:100%; max-width:640px; max-height:calc(100vh - 32px); display:flex; flex-direction:column; box-shadow:0 24px 64px rgba(17,24,39,.25); }
.bal-modal__hd { padding:14px 20px; border-bottom:1px solid #E5E7EB; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; }
.bal-modal__titulo { margin:0; font-size:18px; font-weight:600; color:#111827; line-height:1.3; }
.bal-modal__corpo { padding:20px; overflow-y:auto; display:flex; flex-direction:column; gap:16px; }
.bal-modal__rodape { padding:14px 20px; border-top:1px solid #E5E7EB; display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; flex-shrink:0; }
.bal-fechar { width:40px; height:40px; border-radius:10px; border:0; background:none; color:#6B7280; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex:none; }
.bal-fechar:hover { background:#F3F4F6; color:#111827; }

/* Menu de ações do ticket (fixo, fora da tabela) */
.bal-menu { position:fixed; z-index:56; width:270px; max-width:calc(100vw - 16px); overflow-y:auto; background:#fff; border:1px solid #E5E7EB; border-radius:12px; box-shadow:0 12px 32px rgba(17,24,39,.18); padding:6px; }
.bal-menu__grupo { padding:6px 10px; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; }
.bal-menu__item { display:flex; align-items:center; width:100%; min-height:44px; padding:0 10px; border:0; border-radius:8px; background:none; color:#111827; font:inherit; font-size:14px; text-align:left; cursor:pointer; }
.bal-menu__item:hover, .bal-menu__item:focus-visible { background:#F3F4F6; outline:none; }
.bal-menu__item--destaque { background:#F0FDF4; color:#14532D; font-weight:600; }
.bal-menu__item--destaque:hover { background:#DCFCE7; }
.bal-menu__item--refazer { color:#B45309; }
.bal-menu__sep { height:1px; background:#E5E7EB; margin:6px 0; }

/* ComboBusca dentro das telas de balança: rótulo e campo no padrão do DESIGN.md */
.bal-root .cb-field .cb-label { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; }
.bal-root .cb-field .cb-input { height:42px; border-color:#D1D9E0; border-radius:10px; font-family:inherit; }
.bal-root .cb-field .cb-input:focus { border-color:#15803d; box-shadow:0 0 0 3px rgba(21,128,61,.1); }
.bal-root .cb-field .cb-opt, .bal-root .cb-field .cb-empty, .bal-root .cb-field .cb-more { font-family:inherit; }

/* =========================================================================
   Cadastros (redesenho 11/2026, etapa 1: Produtos) — prefixo cad-.
   Globais de propósito: gavetas (Drawer) e modais recebem o conteúdo por
   RenderFragment, onde o CSS isolado não alcança. Seguem o DESIGN.md:
   rótulo 11px maiúsculo, campo 42px, cartão 12px, verde só como sinal.
   ------------------------------------------------------------------------- */
.cad-root { font-family:"Helvetica Neue", Helvetica, Arial, sans-serif; color:#111827; font-size:14px; line-height:1.5; }
.cad-card { background:#fff; border:1px solid #E5E7EB; border-radius:12px; padding:20px; box-sizing:border-box; box-shadow:0 6px 18px rgba(0,0,0,.05); }
.cad-card0 { background:#fff; border:1px solid #E5E7EB; border-radius:12px; box-shadow:0 6px 18px rgba(0,0,0,.05); }
.cad-card__hd { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.cad-card__ic { width:32px; height:32px; flex:none; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; background:#F0FDF4; color:#15803d; }
.cad-card__ic svg { width:16px; height:16px; }
.cad-card__ic--ambar { background:#FFF7CC; color:#B45309; }
.cad-card__titulo { margin:0; font-size:16px; font-weight:600; color:#111827; line-height:1.3; }
.cad-card__sub { margin:0; font-size:12px; color:#6B7280; }
.cad-divisor { margin-top:16px; padding-top:16px; border-top:1px solid #EEF0F3; }

.cad-rot { display:block; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; margin:0 0 6px; line-height:1.3; }
.cad-obrig { color:#B91C1C; }
.cad-campo { width:100%; height:42px; box-sizing:border-box; padding:0 12px; border:1px solid #D1D9E0; border-radius:10px; background:#fff; color:#111827; font:inherit; font-size:14px; outline:none; transition:border-color .15s, box-shadow .15s; }
.cad-campo::placeholder, .cad-ta::placeholder { color:#9CA3AF; }
.cad-campo:focus, .cad-ta:focus { border-color:#15803d; box-shadow:0 0 0 3px rgba(21,128,61,.1); }
.cad-campo--erro, .cad-campo--erro:focus { border-color:#DC2626; box-shadow:0 0 0 3px rgba(220,38,38,.08); }
.cad-campo[readonly], .cad-campo:disabled, .cad-campo--ro { background:#F3F4F6; color:#6B7280; cursor:not-allowed; }
select.cad-campo { padding:0 10px; }
.cad-campo--btn { display:flex; align-items:center; justify-content:space-between; gap:8px; text-align:left; cursor:pointer; }
.cad-campo--btn svg { width:16px; height:16px; flex:none; color:#6B7280; }
.cad-campo--pre { padding-left:40px; }
.cad-campo--suf { padding-right:32px; }
.cad-afixo { position:absolute; top:50%; transform:translateY(-50%); color:#6B7280; pointer-events:none; font-size:14px; }
.cad-ta { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid #D1D9E0; border-radius:10px; font:inherit; font-size:14px; resize:vertical; outline:none; background:#fff; color:#111827; }
.cad-dica { font-size:12px; color:#6B7280; margin:6px 0 0; line-height:1.45; }
.cad-erro { font-size:12px; color:#B91C1C; margin:6px 0 0; }
.cad-mono { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cad-num { font-variant-numeric:tabular-nums; }

.cad-g2, .cad-g3, .cad-g4 { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
@media (min-width:768px) {
    .cad-g2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .cad-g3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .cad-g4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .cad-s2 { grid-column:span 2; }
}
@media (min-width:1100px) { .cad-g4 { grid-template-columns:repeat(4,minmax(0,1fr)); } }

/* Abas em pílula */
.cad-abas { background:#fff; border:1px solid #E5E7EB; border-radius:12px; padding:10px 12px; display:flex; gap:8px; flex-wrap:wrap; }
.cad-aba { height:34px; padding:0 14px; border:0; border-radius:999px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; background:#F3F4F6; color:#475569; display:inline-flex; align-items:center; gap:6px; }
.cad-aba:hover { background:#E5E7EB; }
.cad-aba--on, .cad-aba--on:hover { background:#15803d; color:#fff; }
.cad-aba__ponto { width:6px; height:6px; border-radius:999px; background:#B45309; }
.cad-aba--on .cad-aba__ponto { background:#FDE68A; }

/* Botões */
.cad-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:40px; padding:0 18px; border-radius:10px; border:1px solid transparent; font:inherit; font-size:14px; font-weight:600; line-height:1; cursor:pointer; white-space:nowrap; text-decoration:none; transition:background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.cad-btn svg { width:16px; height:16px; flex:none; }
.cad-btn--pri { background:linear-gradient(135deg,#15803d 0%,#16a34a 100%); color:#fff; box-shadow:0 2px 8px rgba(21,128,61,.2); }
.cad-btn--pri:hover:not(:disabled) { background:linear-gradient(135deg,#14532d 0%,#15803d 100%); box-shadow:0 4px 12px rgba(21,128,61,.3); transform:translateY(-1px); color:#fff; }
.cad-btn--sec { background:#fff; border-color:#D1D9E0; color:#374151; }
.cad-btn--sec:hover:not(:disabled) { background:#f8fafb; border-color:#BBF7D0; }
.cad-btn--perigo { background:#B91C1C; color:#fff; }
.cad-btn--perigo:hover:not(:disabled) { background:#991B1B; }
.cad-btn--escuro { background:#111827; color:#fff; }
.cad-btn--escuro:hover:not(:disabled) { background:#374151; }
.cad-btn--sm { height:32px; padding:0 12px; font-size:13px; }
.cad-btn:disabled { background:#D1D5DB; color:#6B7280; border-color:transparent; box-shadow:none; transform:none; cursor:not-allowed; }
.cad-link { background:none; border:0; padding:0; font:inherit; font-weight:700; color:#15803d; cursor:pointer; text-decoration:none; }
.cad-link:hover { color:#14532d; text-decoration:underline; text-underline-offset:2px; }
.cad-icbtn { width:32px; height:32px; border:0; border-radius:8px; background:none; color:#9CA3AF; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.cad-icbtn svg { width:16px; height:16px; }
.cad-icbtn:hover { background:#ECFDF5; color:#15803d; }
.cad-icbtn--perigo:hover { background:#FEE2E2; color:#B91C1C; }

/* Pílulas de situação (lista), selos e etiquetas de filtro */
.cad-situacoes { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.cad-situacao { height:32px; padding:0 14px; border-radius:999px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; border:1px solid #D1D9E0; background:#fff; color:#374151; display:inline-flex; align-items:center; gap:6px; }
.cad-situacao:hover { border-color:#86EFAC; }
.cad-situacao--on, .cad-situacao--on:hover { border-color:#15803d; background:#15803d; color:#fff; }
.cad-situacao__n { opacity:.75; font-weight:500; font-variant-numeric:tabular-nums; }
.cad-selo { display:inline-flex; align-items:center; padding:1px 8px; border-radius:999px; font-size:11px; font-weight:600; line-height:1.6; white-space:nowrap; }
.cad-selo--ambar { background:#FFF7CC; color:#92400E; }
.cad-selo--cinza { background:#F3F4F6; color:#4B5563; }
.cad-selo--verde { background:#DCFCE7; color:#166534; }
.cad-etiqueta { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; background:#DCFCE7; color:#166534; }
.cad-etiqueta--ambar { background:#FFF7CC; color:#92400E; }
.cad-etiqueta button { border:0; background:none; color:inherit; cursor:pointer; padding:0 0 0 2px; font-size:14px; line-height:1; }
.cad-etiqueta--limpar { border:1px solid #FECACA; background:#FEF2F2; color:#B91C1C; cursor:pointer; font-family:inherit; }

/* Tabela da lista */
.cad-tabela { width:100%; min-width:760px; border-collapse:collapse; }
.cad-tabela th { padding:12px 20px; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; text-align:left; background:#F8FAFC; border-bottom:1px solid #E5E7EB; }
.cad-tabela td { padding:14px 20px; border-top:1px solid #EEF0F3; vertical-align:middle; }
.cad-tabela tbody tr.cad-linha { cursor:pointer; }
.cad-tabela tbody tr.cad-linha:hover { background:#F0FDF4; }
.cad-tabela tbody tr.cad-linha--aberta { background:#F0FDF4; }
.cad-linha--inativa { color:#6B7280; }
.cad-nome { background:none; border:0; padding:0; font:inherit; font-weight:700; color:inherit; text-align:left; cursor:pointer; }
.cad-nome:hover { color:#15803d; text-decoration:underline; text-underline-offset:2px; }
.cad-seta { display:inline-flex; transition:transform .15s; }
.cad-seta--aberta { transform:rotate(90deg); }
.cad-tabela tr.cad-detalhe td { background:#F9FAFB; padding:12px 20px 16px 60px; cursor:default; }
.cad-saldo { width:100%; max-width:860px; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid #E5E7EB; border-radius:10px; overflow:hidden; font-size:13px; }
.cad-saldo th { padding:8px 12px; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; text-align:left; background:#F1F5F9; }
.cad-saldo td { padding:8px 12px; border-top:1px solid #EEF0F3; }
.cad-saldo tfoot td { font-weight:700; background:#F9FAFB; }
.cad-rodape-lista { padding:12px 20px; border-top:1px solid #EEF0F3; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; color:#6B7280; font-size:13px; }

/* Menu suspenso (Exportar) */
.cad-menu-fundo { position:fixed; inset:0; z-index:55; }
.cad-menu { position:fixed; z-index:56; top:122px; right:24px; width:210px; background:#fff; border:1px solid #E5E7EB; border-radius:12px; box-shadow:0 12px 32px rgba(17,24,39,.14); padding:6px; }
.cad-menu__item { width:100%; min-height:40px; padding:0 10px; border:0; border-radius:8px; background:none; font:inherit; font-size:14px; text-align:left; cursor:pointer; display:flex; align-items:center; gap:8px; color:#374151; }
.cad-menu__item svg { width:15px; height:15px; }
.cad-menu__item:hover, .cad-menu__item:focus-visible { background:#F3F4F6; outline:none; }

/* Interruptor */
.cad-switch { display:inline-flex; align-items:center; gap:10px; border:0; background:none; padding:0; font:inherit; cursor:pointer; color:#111827; }
.cad-switch:disabled { cursor:not-allowed; opacity:.6; }
.cad-switch__trilho { width:40px; height:22px; border-radius:999px; position:relative; flex:none; background:#D1D5DB; transition:background .15s; }
.cad-switch__bola { position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:999px; background:#fff; transition:left .15s; box-shadow:0 1px 2px rgba(0,0,0,.15); }
.cad-switch--on .cad-switch__trilho { background:#15803d; }
.cad-switch--on .cad-switch__bola { left:20px; }
.cad-bloco { padding:12px 14px; border:1px solid #E5E7EB; border-radius:10px; background:#F9FAFB; }

/* Escolha em cartão (Estocável / Não estocável) e caixas de opção */
.cad-escolhas { display:flex; gap:12px; flex-wrap:wrap; }
.cad-escolha { flex:1 1 240px; display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:10px; cursor:pointer; border:2px solid #E5E7EB; background:#fff; }
.cad-escolha input { width:18px; height:18px; margin:0; accent-color:#15803d; }
.cad-escolha--on { border-color:#15803d; background:#F0FDF4; }
.cad-escolha--travada { cursor:not-allowed; opacity:.65; }
.cad-escolha__t { display:block; font-weight:700; }
.cad-escolha__s { display:block; font-size:12px; color:#6B7280; }
.cad-chk { display:flex; align-items:center; gap:10px; font-size:14px; color:#374151; cursor:pointer; min-height:32px; }
.cad-chk input { width:18px; height:18px; margin:0; accent-color:#15803d; flex:none; }
.cad-chk--caixa { width:100%; box-sizing:border-box; padding:8px 14px; border:1px solid #E5E7EB; border-radius:10px; }
.cad-expansor { width:100%; height:44px; padding:0 14px; border:1px solid #E5E7EB; border-radius:10px; background:#F9FAFB; font:inherit; font-weight:700; color:#374151; display:flex; align-items:center; justify-content:space-between; cursor:pointer; }
.cad-expansor svg { width:16px; height:16px; transition:transform .15s; }
.cad-expansor[aria-expanded="true"] svg { transform:rotate(180deg); }

/* Avisos */
.cad-aviso { border-radius:10px; padding:12px 14px; font-size:13px; line-height:1.5; }
.cad-aviso--ambar { background:#FFFBEB; border:1px solid #FDE68A; color:#92400E; }
.cad-aviso--ambar .cad-link { color:#92400E; }
.cad-aviso--info { background:#EFF6FF; border:1px solid #BFDBFE; color:#1E40AF; }
.cad-aviso ul { margin:6px 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:4px; }

/* Formulário em duas colunas: conteúdo + resumo fixo */
.cad-form { display:flex; flex-direction:column; gap:24px; }
.cad-form__col { flex:1; min-width:0; display:flex; flex-direction:column; gap:16px; }
.cad-form__resumo { display:flex; flex-direction:column; gap:12px; }
@media (min-width:1100px) {
    .cad-form { flex-direction:row; align-items:flex-start; }
    .cad-form__resumo { width:320px; flex:0 0 320px; position:sticky; top:136px; }
}
.cad-resumo-lista { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; font-size:13px; }
.cad-resumo-lista li { display:flex; gap:8px; align-items:flex-start; }
.cad-resumo-lista svg { width:16px; height:16px; flex:none; margin-top:1px; }
.cad-ok { color:#15803d; }
.cad-pend { color:#B45309; }

/* Rodapé fixo do formulário */
.cad-rodape { position:fixed; bottom:0; left:0; right:0; z-index:40; background:#fff; border-top:1px solid #E5E7EB; box-shadow:0 -4px 12px rgba(17,24,39,.06); }
.cad-rodape__in { padding:12px 24px; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }

/* Modal central (excluir, importar CSV) */
.cad-overlay { position:fixed; inset:0; z-index:60; background:rgba(17,24,39,.55); display:flex; align-items:center; justify-content:center; padding:16px; }
.cad-modal { background:#fff; border:1px solid #E5E7EB; border-radius:12px; width:100%; max-width:448px; max-height:calc(100vh - 32px); display:flex; flex-direction:column; box-shadow:0 20px 50px rgba(17,24,39,.25); overflow:hidden; }
.cad-modal--lg { max-width:760px; }
.cad-modal__hd { min-height:56px; box-sizing:border-box; padding:12px 20px; border-bottom:1px solid #E5E7EB; display:flex; align-items:center; justify-content:space-between; gap:12px; flex:none; }
.cad-modal__titulo { margin:0; font-size:17px; font-weight:700; color:#111827; }
.cad-modal__corpo { padding:16px 20px; overflow-y:auto; display:flex; flex-direction:column; gap:16px; }
.cad-modal__rodape { padding:12px 20px; border-top:1px solid #E5E7EB; display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; flex:none; }
.cad-fechar { width:40px; height:40px; border-radius:10px; border:0; background:none; color:#6B7280; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex:none; }
.cad-fechar:hover { background:#F3F4F6; color:#111827; }
.cad-fechar svg { width:20px; height:20px; }
.cad-soltar { border:2px dashed #D1D9E0; border-radius:12px; padding:28px; text-align:center; }
.cad-soltar:hover { border-color:#86EFAC; }
.cad-soltar input[type=file]::file-selector-button { margin-right:12px; padding:8px 14px; border:0; border-radius:8px; background:#DCFCE7; color:#166534; font:inherit; font-weight:600; cursor:pointer; }
.cad-numeros { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
@media (min-width:640px) { .cad-numeros { grid-template-columns:repeat(4,minmax(0,1fr)); } }
.cad-numero { border:1px solid #E5E7EB; border-radius:12px; padding:14px; text-align:center; }
.cad-numero b { display:block; font-size:24px; font-weight:800; line-height:1.1; font-variant-numeric:tabular-nums; }
.cad-numero span { font-size:12px; color:#6B7280; }
.cad-tabela-mini { width:100%; border-collapse:collapse; font-size:12px; }
.cad-tabela-mini th { padding:8px 12px; text-align:left; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; background:#F8FAFC; }
.cad-tabela-mini td { padding:8px 12px; border-top:1px solid #EEF0F3; }

@media (max-width:640px) {
    .cad-menu { right:16px; top:104px; }
    .cad-rodape__in { padding:10px 16px; }
    .cad-tabela tr.cad-detalhe td { padding-left:20px; }
}

/* etapa 3 — Grupos, Endereços, Unidades, Princípios, Municípios, Fabricantes */
.cad-busca { width:100%; max-width:375px; }
.cad-gaveta-rodape { width:100%; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.cad-selo--vermelho { background:#FEE2E2; color:#991B1B; }
.cad-icbtn--laranja { color:#EA580C; }
.cad-icbtn--laranja:hover { background:#FFF7ED; color:#C2410C; }
.cad-icbtn--verde { color:#15803d; }
.cad-icbtn:disabled { opacity:.5; cursor:not-allowed; }
.cad-aviso--erro { background:#FEF2F2; border:1px solid #FECACA; color:#991B1B; }
/* ComboBusca dentro dos cadastros: rótulo e campo no padrão (como na balança) e erro no campo */
.cad-root .cb-field .cb-label { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#475569; }
.cad-root .cb-field .cb-input { height:42px; border-color:#D1D9E0; border-radius:10px; font-family:inherit; }
.cad-root .cb-field .cb-input:focus { border-color:#15803d; box-shadow:0 0 0 3px rgba(21,128,61,.1); }
.cad-root .cb-field .cb-opt, .cad-root .cb-field .cb-empty, .cad-root .cb-field .cb-more { font-family:inherit; }
.cad-root .cad-cb-erro .cb-field .cb-input { border-color:#DC2626; box-shadow:0 0 0 3px rgba(220,38,38,.08); }

/* etapa 2 — Pessoas, Produtores e Fazenda */
/* Tipo de pessoa: botões grandes PF/PJ (como hoje), no padrão do canvas */
.cad-tipo { flex:1; height:52px; border-radius:10px; font:inherit; font-size:16px; font-weight:600; cursor:pointer; border:2px solid #E5E7EB; background:#fff; color:#111827; transition:border-color .15s, background .15s; }
.cad-tipo:hover { border-color:#86EFAC; }
.cad-tipo--on, .cad-tipo--on:hover { border-color:#15803d; background:#15803d; color:#fff; }
/* Item de lista dentro do cartão (endereço, conta, fazenda): borda simples, sem sombra (não é card em card) */
.cad-item { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:14px 16px; border:1px solid #E5E7EB; border-radius:10px; background:#fff; }
.cad-item:hover { background:#F9FAFB; }
.cad-item--pendente { border-style:dashed; border-color:#FDE68A; background:#FFFBEB; }
.cad-item--inativo { background:#F9FAFB; }
.cad-item--inativo > div:first-child { opacity:.6; }
.cad-vazio { text-align:center; padding:32px 16px; border:2px dashed #E5E7EB; border-radius:10px; background:#F9FAFB; }
/* Logo do PDF da OC */
.cad-logo { width:56px; height:56px; flex:none; border-radius:10px; border:1px solid #E5E7EB; background:#F9FAFB; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.cad-logo img { max-width:100%; max-height:100%; object-fit:contain; }
.cad-logo--vazio { border:2px dashed #D1D9E0; color:#9CA3AF; }
.cad-logo--vazio svg { width:22px; height:22px; }
/* Fazenda: bloco de endereço (Principal / Entrega) e "details" do LCDPR */
.cad-endbloco { padding:16px; border:1px solid #E5E7EB; border-radius:10px; background:#F9FAFB; }
.cad-endbloco + .cad-endbloco { margin-top:12px; }
.cad-details > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cad-details > summary::-webkit-details-marker { display:none; }
.cad-details > summary svg { width:16px; height:16px; color:#6B7280; transition:transform .15s; flex:none; }
.cad-details[open] > summary svg { transform:rotate(180deg); }
