/* 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 .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;
}

/* ══════════════════════════════════════════════
   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: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.page-action-bar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    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: wrap;
    flex-shrink: 0;
}

@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;
    }

    .page-action-bar__spacer {
        height: 52px;
    }

    /* 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;
}

.breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-link:hover {
    color: var(--cc-primary);
}

.breadcrumb-separator {
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.breadcrumb-current {
    color: #6b7280;
    font-weight: 400;
}

.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 */
.listing-page__content table tbody .rounded-lg.transition-colors {
    border-radius: 8px !important;
    width: 34px;
    height: 34px;
    display: inline-flex;
    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: #15803d !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, #15803d 0%, #16a34a 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, #14532d 0%, #15803d 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, #15803d 0%, #16a34a 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, #14532d 0%, #15803d 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: #dcfce7;
    color: #15803d;
}

.status-badge--cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.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 #16a34a;
    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: 8px;
    z-index: 40;
    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: #dcfce7;
    color: #166534;
}

.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: #166534;
}

.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 {
    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: #15803d;
}

.insight-btn-secondary {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

.insight-btn-ghost {
    color: #14532d;
    background: #fff;
    border-color: #bbf7d0;
}

.insight-hero {
    border-left: 5px solid #eab308;
}

.insight-hero-low {
    border-left-color: #16a34a;
}

.insight-hero-medium {
    border-left-color: #eab308;
}

.insight-hero-high {
    border-left-color: #dc2626;
}

.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: #dcfce7;
    color: #166534;
}

.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, #16a34a 0%, #22c55e 100%);
}

.insight-bar-good {
    background: #22c55e;
}

.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: #86efac;
    background: #f0fdf4;
}

.insight-rank-position {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: #ecfdf3;
    color: #166534;
    font-size: 0.74rem;
    font-weight: 700;
}

.insight-alert-block {
    border-left: 4px solid transparent;
}

.insight-alert-critical {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.insight-alert-info {
    border-left-color: #eab308;
    background: #fffbeb;
}

.insight-alert-summary {
    border-left-color: #3b82f6;
    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: #16a34a;
    background: #f0fdf4;
    border-color: #22c55e;
}

.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-left: 4px solid #e2e8f0;
    padding: 16px 18px;
}

.insight-diag-verde {
    border-left-color: #22c55e;
}

.insight-diag-amarelo {
    border-left-color: #eab308;
}

.insight-diag-vermelho {
    border-left-color: #ef4444;
}

.insight-diag-neutro {
    border-left-color: #94a3b8;
}

.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: #dcfce7;
    color: #166534;
}

.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-left: 4px solid #e2e8f0;
}

.insight-valor-positivo {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.insight-valor-parcial {
    border-left-color: #eab308;
    background: #fffbeb;
}

.insight-valor-negativo {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.insight-valor-neutro {
    border-left-color: #94a3b8;
}

.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 #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

/* ── 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: #dcfce7;
    color: #166534;
}

.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: #dcfce7;
    color: #166534;
}

.insight-diff-medio {
    background: #fef3c7;
    color: #92400e;
}

.insight-diff-alto {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Alert OK state ── */
.insight-alert-ok {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.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);
}

.insight-hero.insight-hero-model.insight-hero-low {
    border-top: 4px solid #16a34a;
}

.insight-hero.insight-hero-model.insight-hero-medium {
    border-top: 4px solid #eab308;
}

.insight-hero.insight-hero-model.insight-hero-high {
    border-top: 4px solid #dc2626;
}

.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, #16a34a 0%, #15803d 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: #16a34a; 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: #16a34a; background: #f0fdf4; }
.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: #16a34a; color: #fff;
}
.btn-primary:hover, .btn-generate:hover, .btn-cotacao:hover {
    background: #15803d; 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: #16a34a; }
.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: #f0fdf4; color: #16a34a; }

/* 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: #f0fdf4; color: #16a34a; }
.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; }
}
