/*
 * LICITAÇÕES ERP — Redesign v3
 * Camada visual carregada DEPOIS de style.css. Redefine tokens e o "shell"
 * (sidebar, header, cards, tabelas, formulários, modais, login) sem mexer nas
 * páginas. Visual: limpo, plano, bordas finas, sem brilhos/animações pesadas.
 */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
    /* Tema Noir: tinta (neutros quentes), coral (destaque), rosa e dourado */
    --bg-primary: #0e1016;
    --bg-secondary: #14161f;
    --bg-tertiary: #1d202b;
    --bg-hover: #282c3a;

    --color-text-main: #f3efe9;
    --color-text-muted: #9a9689;

    --accent-primary: #ef5a3b;
    --accent-secondary: #dcae2e;
    --accent-glow: rgba(239, 90, 59, 0.16);

    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-danger: #f87171;
    --color-info: #60a5fa;

    --grad-primary: linear-gradient(135deg, #ef5a3b 0%, #e1407a 100%);
    --grad-teal: linear-gradient(135deg, #dcae2e 0%, #b88a16 100%);

    --glass-bg: #14161f;
    --glass-border: 1px solid rgba(148, 163, 184, 0.13);
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);

    --border-radius-sm: 8px;
    --border-radius-md: 10px;
    --border-radius-lg: 14px;

    --line: rgba(148, 163, 184, 0.13);
    --line-strong: rgba(148, 163, 184, 0.24);

    --sb-bg: #0a0b10;
    --sb-text: #a09c90;
    --sb-text-strong: #fbf9f6;
    --sb-line: rgba(255, 255, 255, 0.07);
    --sb-hover: rgba(255, 255, 255, 0.06);
    --sb-active: rgba(239, 90, 59, 0.16);

    --trans-fast: 0.15s ease;
    --trans-normal: 0.2s ease;
}

[data-theme="light"] {
    --bg-primary: #fbf9f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3efe9;
    --bg-hover: #e9e4db;

    --color-text-main: #14161f;
    --color-text-muted: #6b675d;

    --accent-primary: #d9431f;
    --accent-secondary: #9a7410;
    --accent-glow: rgba(217, 67, 31, 0.12);

    --grad-primary: linear-gradient(135deg, #ef5a3b 0%, #c62d64 100%);

    --glass-bg: #ffffff;
    --glass-border: 1px solid rgba(15, 23, 42, 0.09);
    --glass-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);

    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.18);
}

/* ==========================================================================
   2. BASE — remove ruído/efeitos antigos
   ========================================================================== */
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
body::before { display: none; }

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.015em; }

::-webkit-scrollbar-thumb { background: var(--line-strong); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* ==========================================================================
   3. SHELL: SIDEBAR
   ========================================================================== */
.app-layout {
    grid-template-columns: 252px 1fr;
    transition: grid-template-columns 0.2s ease;
}
.app-layout.sidebar-collapsed { grid-template-columns: 72px 1fr; }

.sidebar,
[data-theme="light"] .sidebar {
    background: var(--sb-bg) !important;
    border-right: 1px solid var(--sb-line) !important;
    color: var(--sb-text);
    overflow: hidden;
}

.sidebar-header,
[data-theme="light"] .sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--sb-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 72px;
}
.sidebar-header::after { display: none !important; }

.logo-container { gap: 12px; min-width: 0; }

.logo-mark {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--grad-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 19px;
    box-shadow: 0 4px 14px rgba(239, 90, 59, 0.35);
}

.logo-text h1,
[data-theme="light"] .sidebar .logo-text h1 {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: 0.02em;
    background: none;
    -webkit-text-fill-color: var(--sb-text-strong);
    color: var(--sb-text-strong);
}
.logo-text { min-width: 0; overflow: hidden; }
.logo-subtitle { font-size: 9.5px; letter-spacing: 0.03em; text-overflow: ellipsis; overflow: hidden; color: var(--sb-text); white-space: nowrap; display: block; }

.sidebar-collapse-btn {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sb-text);
    cursor: pointer;
    font-size: 18px;
    transition: var(--trans-fast);
}
.sidebar-collapse-btn:hover { background: var(--sb-hover); color: var(--sb-text-strong); }

.sidebar-menu { padding: 14px 12px; gap: 2px; }

.menu-section {
    padding: 14px 12px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 160, 184, 0.55);
    white-space: nowrap;
}
.sidebar-menu .menu-section:first-child { padding-top: 4px; }

.menu-item {
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--sb-text);
    white-space: nowrap;
}
.menu-item::before { display: none; }
.menu-item i { font-size: 19px; flex: none; }
.menu-item:hover {
    color: var(--sb-text-strong);
    background: var(--sb-hover);
    transform: none;
}
.menu-item.active,
[data-theme="light"] .menu-item.active {
    color: var(--sb-text-strong);
    background: var(--sb-active);
    box-shadow: none;
    animation: none;
}
.menu-item.active::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-secondary);
}
.menu-item.active i { transform: none; filter: none; color: var(--accent-secondary); }

.sidebar-footer,
[data-theme="light"] .sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--sb-line);
    gap: 8px;
}
.sidebar-footer::before { display: none !important; }

.user-profile { gap: 10px; min-width: 0; }
.user-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    box-shadow: none;
    font-size: 14px;
}
.user-info { min-width: 0; }
.user-name {
    color: var(--sb-text-strong);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.user-role { color: var(--sb-text); }
.btn-logout { color: var(--sb-text); flex: none; }
.btn-logout:hover { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }

/* Sidebar recolhida: só ícones */
.sidebar-collapsed .logo-text,
.sidebar-collapsed .menu-item span,
.sidebar-collapsed .user-info,
.sidebar-collapsed .menu-section { display: none; }
.sidebar-collapsed .sidebar-header { flex-direction: column; justify-content: center; padding: 14px 8px; gap: 10px; }
.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
.sidebar-collapsed .menu-item { justify-content: center; padding: 11px 0; }
.sidebar-collapsed .menu-item.active::after { left: -12px; }
.sidebar-collapsed .sidebar-menu { padding: 12px 8px; }
.sidebar-collapsed .sidebar-menu::before {
    content: '';
    display: block;
    height: 0;
}
.sidebar-collapsed .sidebar-footer { flex-direction: column; padding: 12px 8px; }

/* ==========================================================================
   4. SHELL: HEADER & CONTEÚDO
   ========================================================================== */
.app-header,
[data-theme="light"] .app-header {
    height: 68px;
    padding: 0 32px;
    background: var(--bg-secondary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--line);
}
.app-header::after { display: none !important; }

.header-left h2,
[data-theme="light"] .header-left h2 {
    font-size: 18px;
    font-weight: 700;
    background: none;
    -webkit-text-fill-color: var(--color-text-main);
    color: var(--color-text-main);
}
.header-left p { font-size: 12px; margin-top: 1px; }
.header-right { gap: 10px; }

.system-time {
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--color-text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--line);
    padding: 7px 12px;
}
.system-time:hover { background: var(--bg-tertiary); border-color: var(--line); }

.theme-toggle,
.notification-btn,
[data-theme="light"] .notification-btn {
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9px;
    background: var(--bg-tertiary);
    border: 1px solid var(--line);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: none;
    animation: none;
}
.theme-toggle:hover,
.notification-btn:hover,
[data-theme="light"] .notification-btn:hover {
    background: var(--bg-hover);
    color: var(--color-text-main);
}
.notification-dropdown {
    background: var(--bg-secondary) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25) !important;
}

.header-company-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 9px;
    background: var(--accent-glow);
    color: var(--accent-primary);
    font-size: 12.5px;
    font-weight: 600;
}

.app-container { padding: 28px 32px 40px; }

/* ==========================================================================
   5. CARDS
   ========================================================================== */
.card,
[data-theme="light"] .card {
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 18px;
    animation: none;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}
.card:hover,
[data-theme="light"] .card:hover {
    transform: none;
    border-color: var(--line-strong);
    box-shadow: var(--glass-shadow);
}
.card::after { display: none; }
/* barra lateral colorida → fio discreto no topo */
.card::before {
    width: 100%;
    height: 2px;
    opacity: 0.9;
}
.card:hover::before { width: 100%; }

.card-grid { gap: 16px; margin-bottom: 20px; }

.metric-value,
[data-theme="light"] .metric-value {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    background: none;
    -webkit-text-fill-color: currentColor;
}
.metric-icon-bg { border-radius: 10px; }

/* ==========================================================================
   6. BOTÕES
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning {
    padding: 9px 16px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: none;
}
.btn-primary::after, .btn-secondary::after, .btn-danger::after,
.btn-success::after, .btn-warning::after { display: none; }

.btn-primary { background: var(--accent-primary); color: #fff; }
.btn-primary:hover { transform: none; filter: brightness(1.1); box-shadow: 0 4px 14px var(--accent-glow); }

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--line-strong);
    color: var(--color-text-main);
}
.btn-secondary:hover { transform: none; background: var(--bg-tertiary); box-shadow: none; }

.btn-danger:hover, .btn-success:hover { transform: none; box-shadow: none; filter: brightness(1.1); }
.btn-success, .btn-danger { color: #fff; }
.btn-primary:active, .btn-secondary:active, .btn-danger:active,
.btn-success:active, .btn-warning:active { transform: scale(0.98); }

/* ==========================================================================
   7. FORMULÁRIOS
   ========================================================================== */
.form-group label { font-size: 12.5px; font-weight: 600; }

.form-group input, .form-group select, .form-group textarea {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--line-strong);
    border-radius: 9px;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--color-text-muted); opacity: 0.7; }
.form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: var(--accent-primary); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group .input-icon-wrapper input,
.form-group .input-icon-wrapper select { padding-left: 42px; }

/* ==========================================================================
   8. TABELAS, TABS, BADGES
   ========================================================================== */
.table-responsive {
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-radius: var(--border-radius-lg);
}
.table-master th,
[data-theme="light"] .table-master th {
    background: var(--bg-tertiary);
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    padding: 10px 14px;
}
.table-master th::after { display: none; }
.table-master td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table-master tr:hover td,
[data-theme="light"] .table-master tr:hover td { background-color: var(--accent-glow) !important; }

.status-badge { padding: 4px 10px; font-size: 10.5px; letter-spacing: 0.04em; }

.tab-btn { border-radius: 8px; }

/* ==========================================================================
   9. MODAIS & TOASTS
   ========================================================================== */
.modal-overlay { background: rgba(5, 8, 15, 0.6); backdrop-filter: blur(4px); }
.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.modal-header, .modal-footer { border-color: var(--line); }

.toast { border-radius: 12px; }

/* ==========================================================================
   10. LOGIN — painel de marca + formulário
   ========================================================================== */
.auth-layout,
[data-theme="light"] .auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    align-items: stretch;
    background: var(--bg-primary) !important;
}
.auth-layout.hidden { display: none !important; }
.auth-layout::before { display: none; }

.auth-brand {
    background:
        radial-gradient(900px 500px at 0% 0%, rgba(239, 90, 59, 0.35), transparent 60%),
        radial-gradient(700px 500px at 100% 100%, rgba(45, 212, 191, 0.2), transparent 60%),
        #0a0f1a;
    color: #f1f5fb;
    padding: 44px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-brand-top { display: flex; align-items: center; gap: 12px; letter-spacing: 0.06em; }
.auth-brand-copy { max-width: 460px; }
.auth-brand-copy h2 { font-size: 34px; line-height: 1.15; font-weight: 800; margin-bottom: 16px; }
.auth-brand-copy p { color: #a5b0c6; font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
.auth-brand-copy ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.auth-brand-copy li { display: flex; align-items: center; gap: 10px; color: #d3dbeb; font-size: 14px; }
.auth-brand-copy li i { color: var(--accent-secondary); font-size: 20px; }
.auth-brand small { color: #6f7b93; }

.auth-card,
[data-theme="light"] .auth-card {
    align-self: center;
    justify-self: center;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 40px 32px;
    max-width: 420px;
    text-align: left;
    animation: none;
}
.auth-card::before { display: none; }

.auth-header { margin-bottom: 28px; }
.auth-mark { width: 44px; height: 44px; font-size: 22px; margin-bottom: 18px; display: none; }
.auth-logo { display: none; }
.auth-header h1,
[data-theme="light"] .auth-header h1 {
    font-size: 26px;
    letter-spacing: -0.02em;
    background: none;
    -webkit-text-fill-color: var(--color-text-main);
    color: var(--color-text-main);
    margin-bottom: 6px;
}
.auth-footer { border-top: 1px solid var(--line); }


/* ==========================================================================
   12. PÁGINAS INTERNAS (Dashboard, Habilitação, Agenda, Acompanhamento,
       Contratos, Equipe) — neutraliza estilos inline antigos
   ========================================================================== */

/* KPIs: número sólido (o gradiente branco sumia no tema claro) */
.card-kpi .metric-value {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--color-text-main);
}
.metric-icon-bg { background: var(--bg-tertiary); }
.contrato-card:hover { transform: none; box-shadow: var(--glass-shadow); }

/* Expanders (status de pregões / certidões) */
.expander { border: 1px solid var(--line); border-radius: var(--border-radius-md); }
.expander-content { border-top: 1px solid var(--line); background: var(--bg-primary); }

/* Abas: estilo "segmentado" */
.tabs-headers { border-bottom: 1px solid var(--line); gap: 4px; padding-bottom: 0; }
.tab-btn {
    padding: 9px 14px;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
}
.tab-btn:hover { background: var(--bg-tertiary); }
.tab-btn.active {
    color: var(--accent-primary);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 2px solid var(--accent-primary);
    box-shadow: none;
}

/* Ações de tabela */
.btn-edit-tbl { color: var(--accent-primary); background: var(--accent-glow); }
.btn-edit-tbl:hover { background: var(--accent-glow); filter: brightness(1.15); }
.btn-delete-tbl { background: rgba(239, 68, 68, 0.12); }

/* Faixa de título escura do Acompanhamento e cabeçalho dos cards de Contratos */
[style*="#0B132B"] {
    background: var(--bg-tertiary) !important;
    color: var(--color-text-main) !important;
    border: 1px solid var(--line) !important;
}
[style*="linear-gradient(135deg, var(--bg-secondary)"] {
    background: var(--bg-tertiary) !important;
    border-bottom-color: var(--line) !important;
}

/* Avatar cinza da Equipe */
[style*="#4B5563"] { background: #475569 !important; }

/* Modais criados via JS com blur forte */
[style*="backdrop-filter:blur(8px)"] {
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    background: rgba(5, 8, 15, 0.6) !important;
}

/* Bordas/fundos "branco translúcido" inline: visíveis em ambos os temas */
[style*="border"][style*="rgba(255,255,255,0.0"],
[style*="border"][style*="rgba(255, 255, 255, 0.0"] {
    border-color: var(--line) !important;
}
[data-theme="light"] [style*="background:rgba(255,255,255,0.0"],
[data-theme="light"] [style*="background: rgba(255,255,255,0.0"],
[data-theme="light"] [style*="background:rgba(255, 255, 255, 0.0"],
[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.0"] {
    background: var(--bg-tertiary) !important;
}

/* Dropdown pesquisável customizado */
.custom-select-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: none;
}

/* Selo de dias restantes */
.dias-badge { border-radius: 6px; }


/* ==========================================================================
   13. ACOMPANHAMENTO
   ========================================================================== */
.acomp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acomp-kpi { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-secondary); border: 1px solid var(--line); border-radius: var(--border-radius-lg); }
.acomp-kpi-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--bg-tertiary); flex: none; }
.acomp-kpi-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.acomp-kpi-value { font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 800; line-height: 1.15; }
.acomp-kpi-extra { font-size: 12px; color: var(--color-text-muted); }

.acomp-toolbar { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; background: var(--bg-secondary); border: 1px solid var(--line); border-radius: var(--border-radius-lg); padding: 12px; margin: 12px 0 16px; }
.acomp-toolbar select, .acomp-search input { width: 100%; height: 38px; padding: 0 12px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); }
.acomp-toolbar select:focus, .acomp-search input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.acomp-search { position: relative; }
.acomp-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); font-size: 18px; }
.acomp-search input { padding-left: 38px; }
.acomp-toolbar-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acomp-toolbar-spacer { flex: 1; }
.acomp-chip { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.btn-sm { padding: 6px 12px !important; font-size: 12.5px !important; }

.grupo-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; margin-bottom: 10px; background: var(--bg-tertiary); border: 1px solid var(--line); border-left: 3px solid var(--accent-primary); border-radius: 10px; }
.grupo-nome { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.grupo-nome i { color: var(--accent-primary); font-size: 18px; }

@media (max-width: 1100px) { .acomp-toolbar { grid-template-columns: 1fr 1fr; } .acomp-search { grid-column: 1 / -1; } }


/* ==========================================================================
   14. BUSCA DE EDITAIS
   ========================================================================== */
.ed-painel { margin-bottom: 18px; }
.ed-painel::before { display: none; }
.ed-linha { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.ed-linha .form-group { flex: 1 1 180px; min-width: 0; }
.ed-linha .ed-grande { flex: 2 1 320px; }
.ed-empresa { flex: 2 1 260px !important; }
.ed-dica { font-size: 11.5px; color: var(--color-text-muted); }
.ed-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 5px 8px; background: var(--bg-secondary); border: 1px solid var(--line-strong); border-radius: 9px; cursor: text; }
.ed-tags:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.ed-tags input { flex: 1 1 120px; min-width: 120px; padding: 4px; font-size: 13px; color: var(--color-text-main); }
.ed-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--accent-glow); color: var(--accent-primary); }
.ed-tags-excluir .ed-tag { background: rgba(239, 68, 68, 0.13); color: var(--color-danger); }
.ed-tag button { width: 18px; height: 18px; border-radius: 50%; font-size: 14px; line-height: 1; color: inherit; cursor: pointer; }
.ed-tag button:hover { background: rgba(127, 127, 127, 0.25); }
.ed-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); cursor: pointer; background: transparent; }
.ed-chip:hover { color: var(--color-text-main); border-color: var(--accent-primary); }
.ed-chip.on { background: var(--accent-glow); border-color: var(--accent-primary); color: var(--accent-primary); }
.ed-chip-sm { padding: 4px 9px; font-size: 11.5px; }
.ed-acoes { align-items: center; margin-bottom: 4px; }
.ed-progresso { height: 4px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.ed-progresso-barra { height: 100%; background: var(--accent-primary); transition: width 0.3s ease; }
.ed-status { font-size: 12.5px; color: var(--color-text-muted); min-height: 18px; margin-top: 8px; }

.ed-barra { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; margin-top: 0; }
.ed-barra .acomp-search { grid-column: auto !important; }
.ed-contagem { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.ed-card { margin-bottom: 12px; }
.ed-card::before { display: none; }
.ed-card-topo { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ed-card-titulo { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.ed-card-selos { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.ed-objeto { font-size: 13.5px; line-height: 1.5; margin: 6px 0 10px; }
.ed-objeto mark { background: rgba(251, 191, 36, 0.3); color: inherit; border-radius: 3px; padding: 0 2px; }
.ed-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--color-text-muted); margin-bottom: 12px; }
.ed-meta i { vertical-align: -2px; margin-right: 3px; }
.ed-card-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.ed-card-acoes a { display: inline-flex; align-items: center; gap: 6px; }
.ed-card-acoes button:disabled { opacity: 0.55; cursor: default; }
.ed-vazio { text-align: center; padding: 48px 20px; }
.ed-vazio i { font-size: 44px; color: var(--color-text-muted); }
.ed-vazio h4 { margin: 10px 0 4px; }
.ed-mais { text-align: center; margin: 8px 0 24px; }
@media (max-width: 900px) { .ed-barra { grid-template-columns: 1fr 1fr; } .ed-barra .acomp-search { grid-column: 1 / -1 !important; } }


.ed-empresas { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.ed-empresa-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--bg-secondary); color: var(--color-text-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.ed-empresa-chip b { padding: 1px 8px; border-radius: 99px; background: var(--bg-tertiary); color: var(--color-text-main); font-size: 12px; }
.ed-empresa-chip:hover { border-color: var(--accent-primary); color: var(--color-text-main); }
.ed-empresa-chip.on { background: var(--accent-glow); border-color: var(--accent-primary); color: var(--accent-primary); }
.ed-empresa-chip.on b { background: var(--accent-primary); color: #fff; }
.ed-empresa-chip i { color: var(--color-warning); }
.ed-barra-dia { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); margin-top: 0; }
.ed-barra-dia .acomp-search { grid-column: span 1 !important; }
.ed-input-solo { width: 100%; height: 38px; padding: 0 12px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); }
.ed-para { height: 32px; max-width: 220px; padding: 0 8px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12.5px; color: var(--color-text-main); }
.ed-ufs-det summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.ed-imp-linha { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ed-imp-linha > span:nth-child(2) { flex: 1; }
.ed-imp-linha:last-child { border-bottom: none; }
@media (max-width: 900px) { .ed-barra-dia { grid-template-columns: 1fr 1fr; } .ed-barra-dia .acomp-search { grid-column: 1 / -1 !important; } }


/* ==========================================================================
   15. EDITAIS — telas completas (Dia, Empresas, Designadas, Estatísticas)
   ========================================================================== */
.ed-topo-acoes { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.ed-resumo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 13.5px; }
.ed-rotulo { display: block; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 6px; }
.ed-h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.ed-det { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; background: var(--bg-secondary); }
.ed-det summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.ed-abrangencia { margin-bottom: 14px; }
.ed-recolher { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; font-size: 13.5px; font-weight: 700; color: var(--color-text-main); cursor: pointer; }
.ed-recolher i { font-size: 18px; }
.ed-consulta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 2 1 320px; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.ed-consulta input { width: 130px; height: 38px; padding: 0 10px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); }
.ed-contagem-chip { margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--bg-tertiary); color: var(--color-text-main); font-size: 11px; font-weight: 700; }
.ed-chip.on .ed-contagem-chip { background: var(--accent-primary); color: #fff; }
.ed-paginacao { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 18px 0 28px; }
.ed-enrich { color: var(--accent-primary); font-weight: 600; }
.ed-aviso { margin: 14px 0; padding: 12px 16px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--line); font-size: 13px; color: var(--color-text-muted); }
.ed-aviso-erro { border-color: rgba(239, 68, 68, 0.4); color: var(--color-danger); }
.ed-casou { margin: -2px 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--accent-glow); font-size: 12.5px; }
.ed-itens-casou { margin-top: 4px; } .ed-itens-casou span { font-weight: 700; margin-right: 6px; }
.ed-onde { font-size: 11.5px; color: var(--color-text-muted); }
.ed-motivo { margin: -2px 0 10px; padding: 8px 12px; border-radius: 8px; background: rgba(239, 68, 68, 0.1); font-size: 12.5px; }
.ed-chips-des { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ed-chip-des { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 99px; background: rgba(52, 211, 153, 0.14); color: var(--color-success); font-size: 12px; font-weight: 700; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-chip-des button { width: 18px; height: 18px; border-radius: 50%; color: inherit; cursor: pointer; font-size: 12px; }
.ed-chip-des button:hover { background: rgba(127, 127, 127, 0.25); }
.ed-tag-item { background: rgba(45, 212, 191, 0.16); color: var(--accent-secondary); }
.ed-tag-ex { background: rgba(239, 68, 68, 0.13); color: var(--color-danger); }
.ed-tag-neutro { background: var(--bg-tertiary); color: var(--color-text-muted); }
.ed-tags-item .ed-tag { background: rgba(45, 212, 191, 0.16); color: var(--accent-secondary); }
.ed-form .form-group { margin-bottom: 14px; }
.ed-grade-empresas { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ed-emp-card::before { display: none; }
.ed-emp-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ed-emp-resumo { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; margin-bottom: 14px; }
.ed-emp-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.ed-emp-acoes a { display: inline-flex; align-items: center; gap: 6px; }
.ed-imp-lista { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ed-grade-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.ed-barra-linha { margin-bottom: 12px; }
.ed-barra-topo { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.ed-barra-fundo { height: 8px; border-radius: 99px; background: var(--bg-tertiary); overflow: hidden; }
.ed-barra-preenche { height: 100%; border-radius: 99px; background: var(--accent-primary); }
.ed-barra-preenche.cor-ciano { background: var(--accent-secondary); }
.ed-barra-preenche.cor-azul { background: var(--accent-primary); }
.ed-barra-preenche.cor-roxo { background: #8b7cf6; }
.ed-seg { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ed-seg:last-child { border-bottom: none; }
.acomp-kpi-icon.ed-ic-azul { color: var(--accent-primary); } .acomp-kpi-icon.ed-ic-roxo { color: #8b7cf6; }
.acomp-kpi-icon.ed-ic-ciano { color: var(--accent-secondary); } .acomp-kpi-icon.ed-ic-verde { color: var(--color-success); }
.acomp-kpi-icon.ed-ic-vermelho { color: var(--color-danger); }

/* ---------- impressão (relatórios e PDFs) ---------- */
#printArea { display: none; }
@media print {
    .app-layout, .auth-layout, #toast-container, #mobile-sidebar-overlay { display: none !important; }
    html, body { height: auto !important; min-height: 0 !important; overflow: visible !important; background: #fff !important; display: block !important; }
    #printArea { display: block !important; position: relative; background: #fff; color: #0f172a; }
}


/* ==========================================================================
   16. DASHBOARD
   ========================================================================== */
.dash-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-filtros { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-filtros select { height: 36px; padding: 0 12px; min-width: 200px; background: var(--bg-secondary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); }
.dash-acoes { display: flex; gap: 8px; }
.dash-faixa { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 12px 16px; margin-bottom: 12px; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--line); font-size: 13px; }
.dash-faixa-ok { color: var(--color-success); border-color: rgba(52, 211, 153, 0.35); }
.dash-faixa-ok i { font-size: 18px; vertical-align: -3px; }
.dash-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.dash-pill-red { background: rgba(239, 68, 68, 0.13); color: var(--color-danger); }
.dash-pill-yellow { background: rgba(251, 191, 36, 0.16); color: var(--color-warning); }
.dash-pill-blue { background: var(--accent-glow); color: var(--accent-primary); }
.dash-pill:hover { filter: brightness(1.15); }
.dash-atalhos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dash-atalhos .ed-chip { display: inline-flex; align-items: center; gap: 6px; }
a.dash-kpi { color: inherit; transition: border-color var(--trans-fast), transform var(--trans-fast); }
a.dash-kpi:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.dash-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.dash-painel::before { display: none; }
.dash-painel-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-painel-topo h4 { font-size: 14px; font-weight: 700; }
.dash-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; margin: 0 -10px; border-radius: 9px; color: inherit; }
a.dash-item:hover { background: var(--bg-tertiary); }
.dash-item + .dash-item { border-top: 1px solid var(--line); }
.dash-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.dash-item-main strong, .dash-item-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-lado { display: flex; align-items: center; gap: 8px; flex: none; }
.dash-vazio { text-align: center; padding: 22px 0; color: var(--color-text-muted); font-size: 13px; }
.dash-vazio i { font-size: 28px; display: block; margin-bottom: 6px; }
.dash-vazio.ok { color: var(--color-success); }


/* ==========================================================================
   17. AGENDA (licitações, reuniões, eventos, lembretes, observações)
   ========================================================================== */
.ag-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ag-topo .ed-chip i { vertical-align: -2px; }
.ag-acoes { display: flex; gap: 8px; align-items: center; }
.ag-barra { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; margin-top: 0; }
.ag-visao { display: flex; gap: 6px; }
.ag-grupo { margin-bottom: 18px; }
.ag-grupo-titulo { font-size: 13px; font-weight: 700; color: var(--color-text-muted); text-transform: capitalize; margin: 0 0 8px 2px; display: flex; gap: 8px; align-items: center; }
.ag-grupo-titulo.hoje { color: var(--accent-primary); }
.ag-grupo-titulo.alerta { color: var(--color-danger); }
.ag-mes { padding: 14px; }
.ag-mes::before { display: none; }
.ag-mes-topo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; }
.ag-semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); text-align: center; }
.ag-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ag-dia { min-height: 104px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-primary); display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.ag-dia:hover { border-color: var(--accent-primary); }
.ag-dia.vazio { background: transparent; border-color: transparent; cursor: default; }
.ag-dia.hoje { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-glow); }
.ag-dia.passado .ag-dia-num { color: var(--color-text-muted); }
.ag-dia-num { font-size: 12px; font-weight: 700; }
.ag-chip { display: block; width: 100%; text-align: left; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--ag-cor) 18%, transparent); color: var(--color-text-main); border-left: 3px solid var(--ag-cor); cursor: pointer; }
.ag-chip i { margin-right: 3px; color: var(--ag-cor); }
.ag-chip.concluido { opacity: 0.5; text-decoration: line-through; }
.ag-mais { font-size: 11px; color: var(--accent-primary); font-weight: 700; text-align: left; cursor: pointer; }
@media (max-width: 900px) {
    .ag-barra { grid-template-columns: 1fr 1fr; } .ag-barra .acomp-search { grid-column: 1 / -1; }
    .ag-dia { min-height: 70px; } .ag-chip b { display: none; }
}


/* ==========================================================================
   18. CONTRATOS
   ========================================================================== */
.ct-barra { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); margin-top: 0; }
.ed-desc-itens { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(251, 191, 36, 0.08); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.table-master tfoot td { background: var(--bg-tertiary); border-top: 1px solid var(--line); padding: 10px 14px; }
@media (max-width: 1100px) { .ct-barra { grid-template-columns: 1fr 1fr; } .ct-barra .acomp-search { grid-column: 1 / -1; } }


/* ==========================================================================
   19. RELATÓRIOS
   ========================================================================== */
.rl-escolha { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rl-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px 16px; cursor: pointer; border: 1px solid var(--line); }
.rl-card::before { display: none; }
.rl-card:hover { border-color: var(--accent-primary); }
.rl-card.on { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-glow); }
.rl-card strong { font-size: 14px; }
.rl-icone { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent-primary); }
.ed-pre { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--bg-primary); border: 1px solid var(--line); font-family: Consolas, monospace; font-size: 12px; white-space: pre-wrap; user-select: all; }
/* ==========================================================================
   11. RESPONSIVO
   ========================================================================== */
@media (max-width: 1024px) {
    .app-layout { grid-template-columns: 220px 1fr; }
    .app-container { padding: 22px 20px 32px; }
    .app-header { padding: 0 20px; }
}

@media (max-width: 900px) {
    .auth-layout, [data-theme="light"] .auth-layout { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mark { display: inline-flex; }
}

@media (max-width: 768px) {
    .app-layout, .app-layout.sidebar-collapsed { grid-template-columns: 1fr; }
    .sidebar { width: 272px; }
    .sidebar-collapse-btn { display: none; }
    .app-header { height: 60px; }
    .app-container { padding: 16px 14px 28px; }
    .theme-toggle span, .notification-btn #notification-label, .system-time { display: none; }
    .mobile-sidebar-toggle { width: 38px; height: 38px; border-radius: 9px; background: var(--bg-tertiary); border: 1px solid var(--line); }
    /* no mobile o menu aberto sempre mostra os rótulos */
    .sidebar-collapsed .logo-text, .sidebar-collapsed .menu-item span,
    .sidebar-collapsed .user-info, .sidebar-collapsed .menu-section { display: revert; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ==========================================================================
   15. ACOMPANHAMENTO — cartões limpos (mantém só a barra lateral do status)
   ========================================================================== */
.empresa-grupo-secao { margin-bottom: 22px !important; }
.grupo-header { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 2px 10px; margin-bottom: 12px; }
.grupo-nome { font-family: 'Inter', sans-serif; font-size: 17px; letter-spacing: -0.01em; }

.empresa-grupo-secao .expander,
.empresa-grupo-secao .expander[class*="expander-status-"] {
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: var(--glass-shadow);
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast), transform var(--trans-fast);
}
.empresa-grupo-secao .expander:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.empresa-grupo-secao .expander.open { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); }

.empresa-grupo-secao .expander[class*="expander-status-"] .expander-header {
    background: transparent;
    color: var(--color-text-main);
    padding: 14px 18px !important;
    gap: 10px 16px !important;
}
.empresa-grupo-secao .expander[class*="expander-status-"] .expander-header span { color: var(--color-text-main); }
.empresa-grupo-secao .expander[class*="expander-status-"] .expander-header > div:first-child span {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}
.empresa-grupo-secao .expander[class*="expander-status-"] .expander-header > div:last-child > span:not(.status-badge) {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--color-text-muted);
}
.empresa-grupo-secao .expander[class*="expander-status-"] .expander-header i.bx-chevron-down { color: var(--color-text-muted); }
.empresa-grupo-secao .expander[class*="expander-status-"] .status-badge { font-weight: 700; font-size: 11px; border-radius: 99px; padding: 4px 11px; }

.empresa-grupo-secao .expander[class*="expander-status-"] .expander-content {
    background: var(--bg-primary);
    border-top: 1px solid var(--line);
    padding: 18px;
}
.empresa-grupo-secao .expander-content h5 { font-size: 12px; letter-spacing: 0.06em; }
.empresa-grupo-secao .expander-content .form-group label { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }

/* aba "Retornos" e aviso de hoje */
.acomp-kpi { transition: border-color var(--trans-fast); }
.acomp-kpi:hover { border-color: var(--line-strong); }

@media (max-width: 700px) {
    .empresa-grupo-secao .expander[class*="expander-status-"] .expander-header { padding: 12px 14px !important; }
    .empresa-grupo-secao .expander[class*="expander-status-"] .expander-content { padding: 14px; }
}


/* ==========================================================================
   16. POLIMENTO — Noir: neutros em quantidade, coral para agir, dourado para destacar
   ========================================================================== */
/* Cartões de Empresas e Filtros: mesma altura, botões na base, chips calmos */
.ed-grade-empresas { align-items: stretch; }
.ed-emp-card { display: flex; flex-direction: column; height: 100%; }
.ed-emp-topo strong { font-family: 'Inter', sans-serif; font-size: 16px; letter-spacing: -0.01em; }
.ed-emp-resumo { flex: 1 1 auto; align-content: flex-start; min-height: 58px; }
.ed-emp-acoes { margin-top: auto; }
.ed-emp-resumo .ed-tag { background: var(--bg-tertiary); color: var(--color-text-main); font-weight: 600; padding: 3px 10px; }
.ed-emp-resumo .ed-tag-item { background: var(--bg-tertiary); color: var(--color-text-main); }
.ed-emp-resumo .ed-tag-neutro { background: transparent; border: 1px solid var(--line-strong); color: var(--color-text-muted); font-weight: 500; }
.ed-emp-resumo .ed-tag-ex { background: rgba(248, 113, 113, 0.14); color: var(--color-danger); border: 0; font-weight: 700; }
.ed-emp-resumo .ed-dica { font-size: 12.5px; line-height: 1.5; }

/* Dourado como assinatura: ícones de destaque, totais e indicadores */
.menu-item.active::after { box-shadow: 0 0 10px rgba(220, 174, 46, 0.45); }
.grupo-nome i, .acomp-kpi-icon { color: var(--accent-secondary); }
.table-master tfoot td:last-of-type, .table-master tfoot td[style*="font-weight:800"] { color: var(--accent-secondary); font-family: 'Inter', sans-serif; font-size: 15px; }
.metric-value, .acomp-kpi-value { letter-spacing: -0.02em; }
.header-left h2 { font-family: 'Inter', sans-serif; }

/* Estados vazios */
.ed-vazio { border-style: dashed; background: transparent; }
.ed-vazio > i { display: inline-flex; width: 72px; height: 72px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-glow); color: var(--accent-primary); font-size: 34px; }
.ed-vazio h4 { font-family: 'Inter', sans-serif; font-size: 20px; margin: 14px 0 6px; }
.ed-vazio p { max-width: 440px; margin: 0 auto; line-height: 1.55; }
.ed-vazio-acoes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Tema claro: sombras leves e dourado legível */
[data-theme="light"] .empresa-grupo-secao .expander:hover { box-shadow: 0 4px 14px rgba(20, 22, 31, 0.08); }
[data-theme="light"] .empresa-grupo-secao .expander.open { box-shadow: 0 6px 20px rgba(20, 22, 31, 0.1); }
[data-theme="light"] .ed-emp-resumo .ed-tag-ex { background: rgba(217, 67, 31, 0.1); color: #b8321a; }
[data-theme="light"] .ed-vazio { background: var(--bg-secondary); }

/* Acompanhamento: licitacoes com itens vencidos / sendo vencidos (vermelho para localizar rapido) */
.expander.expander-vencendo {
    background: #3a0f12;
    border: 1px solid #dc2626;
    border-left: 5px solid #ef4444;
}
.expander.expander-vencendo .expander-header { background: rgba(220, 38, 38, 0.22); color: #fecaca; }
.expander.expander-vencendo .expander-header span { color: #fecaca; }
.expander.expander-vencendo .expander-header i { color: #f87171; }
[data-theme="light"] .expander.expander-vencendo { background: #fef2f2; border-color: #dc2626; border-left-color: #dc2626; }
[data-theme="light"] .expander.expander-vencendo .expander-header { background: #fee2e2; color: #991b1b; }
[data-theme="light"] .expander.expander-vencendo .expander-header span { color: #991b1b; }
[data-theme="light"] .expander.expander-vencendo .expander-header i { color: #dc2626; }

/* Status "Revogado / Cancelado / Saiu da lista" (cinza, sem resultado) */
/* ⏸️ Suspensa / Aguardando abertura: roxo-acinzentado (não é disputa, não é encerrada) */
.expander-status-suspensa { background: #221f2e; border: 1px solid #6d5fa3; border-left: 5px solid #a78bfa; border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.expander-status-suspensa .expander-header { background: rgba(0,0,0,0.25); color: #ddd6fe; }
.expander-status-suspensa .expander-header span { color: #ddd6fe; }
.expander-status-suspensa .expander-header i { color: #a78bfa; }
.expander-status-suspensa .expander-content { background: rgba(0,0,0,0.15); }
.expander-status-suspensa .status-badge { background: rgba(167,139,250,0.18); color: #ddd6fe; border: 1px solid rgba(167,139,250,0.35); }
[data-theme="light"] .expander-status-suspensa { background: #f5f3ff; border-color: #c4b5fd; border-left-color: #7c3aed; }
[data-theme="light"] .expander-status-suspensa .expander-header { background: rgba(124,58,237,0.06); color: #4c1d95; }
[data-theme="light"] .expander-status-suspensa .expander-header span { color: #4c1d95; }
[data-theme="light"] .expander-status-suspensa .expander-header i { color: #7c3aed; }
[data-theme="light"] .expander-status-suspensa .expander-content { background: rgba(124,58,237,0.03); }
[data-theme="light"] .expander-status-suspensa .status-badge { background: rgba(124,58,237,0.10); color: #5b21b6; border-color: rgba(124,58,237,0.3); }
.expander-status-revogado {
    background: #1f232b;
    border: 1px solid #6b7280;
    border-left: 5px solid #9ca3af;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
}
.expander-status-revogado .expander-header { background: rgba(0,0,0,0.25); color: #d1d5db; }
.expander-status-revogado .expander-header span { color: #d1d5db; }
.expander-status-revogado .expander-header i { color: #9ca3af; }
.expander-status-revogado .expander-content { background: rgba(0,0,0,0.15); }
.expander-status-revogado .status-badge { background: rgba(156,163,175,0.2); color: #d1d5db; border: 1px solid rgba(156,163,175,0.3); }
[data-theme="light"] .expander-status-revogado { background: #f3f4f6; border-color: #9ca3af; border-left-color: #6b7280; }
[data-theme="light"] .expander-status-revogado .expander-header { background: rgba(107,114,128,0.1); color: #374151; }
[data-theme="light"] .expander-status-revogado .expander-header span { color: #374151; }
[data-theme="light"] .expander-status-revogado .expander-header i { color: #6b7280; }
[data-theme="light"] .expander-status-revogado .expander-content { background: rgba(107,114,128,0.05); }
[data-theme="light"] .expander-status-revogado .status-badge { background: rgba(107,114,128,0.12); color: #374151; border-color: rgba(107,114,128,0.3); }

/* Relatório do Edital (IA): tabela INFORMAÇÃO | ANÁLISE DETALHADA */
.ed-rel-tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.ed-rel-tabela th, .ed-rel-tabela td { border: 1px solid var(--line-strong); padding: 8px 10px; text-align: left; vertical-align: top; line-height: 1.5; }
.ed-rel-tabela th { background: var(--bg-secondary); font-size: 11.5px; letter-spacing: .06em; }
.ed-rel-tabela td:first-child { width: 22%; font-weight: 700; }


/* ==========================================================================
   20. VERSÃO CELULAR
   Cabeçalho compacto, alvos de toque, campos sem zoom no iOS, tabelas em cartões,
   menu "Designar para…" em folha inferior e áreas seguras (notch / barra do iPhone).
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, select, label, .menu-item, .ed-chip, .filter-chip { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@media (max-width: 768px) {
    /* ---- cabeçalho: uma linha só (menu · título · ações) ---- */
    .app-header, [data-theme="light"] .app-header {
        height: auto !important; min-height: 56px; flex-direction: row !important; align-items: center !important;
        justify-content: space-between !important; gap: 8px !important;
        padding: calc(6px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 6px calc(12px + env(safe-area-inset-left)) !important;
    }
    .header-left { width: auto !important; flex: 1 1 auto; min-width: 0; gap: 10px !important; }
    .header-title-container { min-width: 0; }
    .header-left h2 { font-size: 16px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-left p, #page-subtitle, .header-company-badge { display: none !important; }
    .header-right { width: auto !important; flex: 0 0 auto; justify-content: flex-end !important; gap: 6px !important; }
    #btn-notifications, #theme-toggle, .mobile-sidebar-toggle { width: 42px; height: 42px; min-width: 42px; padding: 0 !important; justify-content: center; border-radius: 12px !important; aspect-ratio: auto; }
    #notification-dropdown { top: calc(60px + env(safe-area-inset-top)) !important; width: calc(100vw - 24px) !important; right: 12px !important; margin: 0 !important; max-height: 70vh; overflow: auto; }

    /* ---- conteúdo ---- */
    .app-container { padding: 14px calc(12px + env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)) !important; overscroll-behavior: contain; }
    .sidebar { padding-bottom: env(safe-area-inset-bottom); }
    .sidebar-menu { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .menu-item { min-height: 44px; }

    /* ---- campos: 16px evita o zoom automático do Safari ao focar ---- */
    input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea,
    .form-group input, .form-group select, .form-group textarea { font-size: 16px !important; min-height: 44px; }
    input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }

    /* ---- alvos de toque ---- */
    .btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning, .btn-sm { min-height: 40px; }
    .ed-chip, .filter-chip, .ed-empresa-chip { min-height: 38px; display: inline-flex; align-items: center; }
    .ed-chip-sm { min-height: 34px; }
    .ed-card-acoes, .ed-topo-acoes, .ag-acoes, .ed-linha { gap: 8px; }

    /* ---- modais: quase tela cheia ---- */
    .modal-card { width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important; max-height: calc(100dvh - 16px) !important; }
    .modal-body { -webkit-overflow-scrolling: touch; }
    .modal-footer { flex-wrap: wrap; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    .modal-footer > button { flex: 1 1 auto; }

    /* ---- "Designar para…": folha inferior em vez de caixa que estoura a tela ---- */
    .ed-multi { position: static !important; }
    .ed-multi > .card {
        position: fixed !important; left: 12px !important; right: 12px !important; top: auto !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important; min-width: 0 !important; max-height: 60vh !important;
        z-index: 1600 !important; margin: 0 !important; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5) !important;
    }
    .ed-multi > .card label { min-height: 44px; font-size: 15px !important; }

    /* ---- toasts acima da barra do sistema ---- */
    .toast { max-width: calc(100vw - 24px); }
}

/* ---- tabelas viram cartões (os rótulos vêm do cabeçalho: data-label, ver app.js) ---- */
@media (max-width: 640px) {
    .table-responsive { overflow: visible !important; }
    .table-master, .table-master tbody, .table-master tfoot, .table-master tr, .table-master td, .tbl-cards, .tbl-cards tbody, .tbl-cards tfoot, .tbl-cards tr, .tbl-cards td { display: block; width: 100% !important; }
    .table-master thead, .tbl-cards thead { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
    .table-master tbody tr, .tbl-cards tbody tr { margin: 0 0 10px; padding: 4px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-secondary); overflow: hidden; }
    /* rótulo flutuando à esquerda; o conteúdo (mesmo com vários elementos) quebra normalmente à direita */
    .table-master td, .tbl-cards td { display: block; overflow: hidden; padding: 8px 14px !important; border: 0 !important; text-align: right !important; word-break: break-word; }
    .table-master td::before, .tbl-cards td::before { content: attr(data-label); float: left; width: 34%; margin-right: 10px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); padding-top: 2px; }
    .table-master td[data-label=""]::before, .tbl-cards td[data-label=""]::before { display: none; }
    .table-master td:empty, .tbl-cards td:empty { display: none; }
    .btn-edit-tbl, .btn-delete-tbl { min-width: 40px; min-height: 40px; }
    .table-master tfoot td, .tbl-cards tfoot td { margin-top: 4px; border-radius: 10px; }
    .ed-rel-tabela, .ed-rel-tabela tbody, .ed-rel-tabela tr, .ed-rel-tabela td { display: block; width: 100% !important; }
    .ed-rel-tabela thead { display: none; }
    .ed-rel-tabela tr { margin-bottom: 10px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
    .ed-rel-tabela td { border: 0 !important; }
    .ed-rel-tabela td:first-child { background: var(--bg-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
}

/* indicadores (KPIs) em 2 colunas, mais compactos: menos rolagem no celular */
@media (max-width: 560px) {
    .acomp-kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
    .acomp-kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; min-width: 0; }
    .acomp-kpi > div { min-width: 0; max-width: 100%; }
    .acomp-kpi-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
    .acomp-kpi-label { font-size: 10.5px; }
    .acomp-kpi-value { font-size: 18px !important; overflow-wrap: anywhere; }
    .acomp-kpi-extra { font-size: 11px; }
}

/* celular na horizontal: cabeçalho e rolagem mais baixos */
@media (max-width: 900px) and (max-height: 500px) {
    .app-header { min-height: 48px; }
    .modal-card { max-height: calc(100dvh - 8px) !important; }
}


/* ============================================================
   Acompanhamento: abas em "pílulas" com ícone e contador
   ============================================================ */
.acomp-tabs-barra { display: flex; align-items: stretch; gap: 12px; margin-bottom: 18px; }
.acomp-tabs {
    --ta-bg: var(--accent-primary); --ta-fg: #fff;
    flex: 1; min-width: 0;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 2px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16);
}
[data-theme="light"] .acomp-tabs { --ta-bg: #0f172a; box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08); }
.acomp-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; min-height: 42px;
    border: 0; border-radius: 14px;
    background: transparent; color: var(--color-text-muted, #94a3b8);
    font-family: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap;
    cursor: pointer; transition: background var(--trans-fast, .15s ease), color var(--trans-fast, .15s ease);
}
.acomp-tab i { font-size: 17px; }
.acomp-tab:hover { background: var(--bg-tertiary); color: var(--text-primary, inherit); }
.acomp-tab.active { background: var(--ta-bg); color: var(--ta-fg); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }
.acomp-tab-n {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 700; line-height: 1;
    background: var(--bg-tertiary); color: var(--text-primary, inherit);
}
.acomp-tab.vazia:not(.active) .acomp-tab-n { opacity: .55; font-weight: 600; }
.acomp-tab.active .acomp-tab-n { background: rgba(255, 255, 255, 0.25); color: #fff; }
[data-theme="light"] .acomp-tab.active .acomp-tab-n { background: #ef4a1f; }
/* aba só informativa (ex.: "Status e posição (hoje)"): o número não pede ação, fica neutro */
.acomp-tab.informativa.active .acomp-tab-n, [data-theme="light"] .acomp-tab.informativa.active .acomp-tab-n { background: rgba(255, 255, 255, 0.22); color: inherit; }
/* filtros rápidos por fase dentro da aba (Acompanhamento / Encerrados) */
.acomp-subs { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.acomp-sub {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--bg-secondary); color: var(--color-text-muted, #94a3b8);
    font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.acomp-sub i { font-size: 15px; }
.acomp-sub b { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-primary, inherit); }
.acomp-sub:hover { color: var(--text-primary, inherit); border-color: var(--accent-primary); }
.acomp-sub.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.acomp-sub.active b { background: rgba(255, 255, 255, 0.25); color: #fff; }
.acomp-sub.vazia:not(.active) { opacity: .6; }
.acomp-novo {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: center;
    height: 42px; padding: 0 16px; border-radius: 14px; white-space: nowrap;
    background: rgba(239, 90, 59, 0.12); border: 1px solid rgba(239, 90, 59, 0.28);
    color: var(--accent-primary); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.acomp-novo i { font-size: 18px; }
.acomp-novo:hover { background: rgba(239, 90, 59, 0.2); }
@media (max-width: 900px) {
    .acomp-tabs-barra { flex-direction: column; gap: 10px; }
    .acomp-novo { align-self: stretch; }
}
@media (max-width: 768px) {
    /* celular: uma linha só, rolando para o lado */
    .acomp-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; border-radius: 16px; padding: 6px; }
    .acomp-tabs::-webkit-scrollbar { display: none; }
    .acomp-tab { padding: 9px 13px; font-size: 13px; flex: 0 0 auto; }
}

/* ==========================================================================
   21. CELULAR — refinamentos (indicadores, abas e chips em uma linha, filtros, Agenda)
   ========================================================================== */
/* valores em dinheiro nunca estouram o cartão: a fonte acompanha a largura disponível */
.acomp-kpi-largo > div { min-width: 0; flex: 1 1 0; container-type: inline-size; }
.acomp-kpi-largo .acomp-kpi-value { font-size: clamp(12px, 8.5cqw, 24px) !important; white-space: nowrap; overflow: visible; }
.ed-chip { gap: 6px; }

@media (max-width: 560px) {
    /* indicadores compactos: ícone ao lado do texto; o de dinheiro ocupa a linha toda */
    .acomp-kpis { gap: 8px; }
    .acomp-kpi { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
    .acomp-kpi > div { flex: 1 1 0; min-width: 0; }
    .acomp-kpi-icon { width: 32px; height: 32px; font-size: 17px; }
    .acomp-kpi-label { line-height: 1.25; }
    .acomp-kpi-value { font-size: 19px !important; line-height: 1.2; }
    .acomp-kpi-largo { grid-column: 1 / -1; order: -1; padding: 12px 14px; }
    .acomp-kpi-largo .acomp-kpi-value { font-size: clamp(16px, 8.5cqw, 24px) !important; }
    .acomp-kpi:last-child:nth-child(odd), .dash-kpi:last-child { grid-column: 1 / -1; }

    /* abas e atalhos em uma linha só, deslizando com o dedo */
    .tabs-headers { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; }
    .tabs-headers::-webkit-scrollbar { display: none; }
    .tabs-headers .tab-btn { flex: none; white-space: nowrap; }
    .tabs-container { max-width: 100%; }
    .dash-atalhos, .ag-topo .ed-chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .dash-atalhos::-webkit-scrollbar, .ag-topo .ed-chips::-webkit-scrollbar { display: none; }
    .dash-atalhos .ed-chip, .ag-topo .ed-chips .ed-chip { flex: none; white-space: nowrap; }

    /* barras de filtro: um campo por linha (nada de texto cortado) */
    .acomp-toolbar, .ag-barra, .ed-barra, .ed-barra-dia, .ct-barra { grid-template-columns: 1fr !important; padding: 12px; }
    .acomp-toolbar > *, .ag-barra > * { min-width: 0; }
    .ag-visao { display: grid; grid-template-columns: 1fr 1fr; }
    .ag-visao .ed-chip { justify-content: center; }

    /* Agenda: topo, cartões e botões */
    .ag-topo { flex-direction: column; align-items: stretch; gap: 10px; }
    .ag-acoes { width: 100%; }
    .ag-acoes .btn-primary { flex: 1 1 auto; order: -1; justify-content: center; }
}

/* título da tela pode quebrar em 2 linhas em vez de cortar com "…" */
@media (max-width: 768px) {
    .header-left h2 { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; font-size: 15px !important; }
}

/* calendário mensal no celular: pontinhos coloridos + lista do dia tocado */
@media (max-width: 640px) {
    .ag-mes { padding: 10px; }
    .ag-semana, .ag-grade { gap: 3px; }
    .ag-dia { min-height: 52px; padding: 4px 3px; align-items: center; gap: 2px; border-radius: 8px; }
    .ag-dia-num { font-size: 12.5px; }
    .ag-dia .ag-chip { width: 6px; height: 6px; min-height: 0; padding: 0; border-radius: 50%; font-size: 0; background: var(--ag-cor); pointer-events: none; display: inline-block; margin: 0 1px; }
    .ag-dia .ag-chip i, .ag-dia .ag-chip b { display: none; }
    .ag-dia .ag-mais { font-size: 10px; pointer-events: none; }
    .ag-dia.sel { border-color: var(--accent-primary); background: var(--accent-glow); }
}
.ag-dia-painel { margin-top: 14px; }
.ag-dia-painel-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 2px 10px; font-size: 14px; font-weight: 700; }

@media (max-width: 640px) {
    .tbl-cards { table-layout: auto !important; }
    .tbl-cards td > div, .tbl-cards td > span { max-width: 100%; }
    .tbl-cards td { white-space: normal !important; text-overflow: clip !important; }
    .tbl-cards tr { overflow: visible; }
    div:has(> table.tbl-cards) { overflow: visible !important; }
}
@media (max-width: 560px) {
    .acomp-kpi-value { white-space: nowrap; overflow-wrap: normal !important; }
    select.ed-para { max-width: 100%; }
    .grupo-header { flex-wrap: wrap; gap: 8px; }
    .grupo-nome { font-size: 15px; line-height: 1.3; }
}

/* menu lateral fechado no celular não deixa sombra na borda da tela */
@media (max-width: 768px) {
    .sidebar:not(.open) { box-shadow: none !important; visibility: hidden; transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear .3s; }
    .sidebar.open { visibility: visible; transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s; }
}

/* Agenda: cancelada (riscada) e adiada sem data (tracejada, amarela) */
.ag-grupo-titulo.adiado { color: var(--color-warning); }

/* Agenda — linha compacta (empresa em destaque; pregão e UASG em etiquetas legíveis) */
.ag-card.ag-lin { display: grid; grid-template-columns: 24px 116px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 10px 14px; margin-bottom: 6px; border-left: 4px solid var(--ag-cor, var(--accent-primary)); }
.ag-card::before { display: none; }
.ag-card.concluido { opacity: 0.55; }
.ag-card.concluido .ag-empresa { text-decoration: line-through; }
.ag-card.suspenso { opacity: 0.7; border-left-style: dashed; }
.ag-card.cancelado .ag-empresa { text-decoration: line-through; }
.ag-slot { display: flex; align-items: center; justify-content: center; }
.ag-slot:empty { visibility: hidden; }
.ag-quando { display: flex; flex-direction: column; gap: 2px; color: var(--ag-cor, var(--accent-primary)); min-width: 0; }
.ag-hora-txt { font-size: 15px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.ag-tipo { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.ag-tipo i { font-size: 14px; }
.ag-main { min-width: 0; }
.ag-l1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ag-empresa { font-size: 16px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.ag-l2 { margin-top: 2px; font-size: 13.5px; line-height: 1.35; color: var(--color-text-muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-l2 i { vertical-align: -2px; }
.ag-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; margin-top: 6px; }
.ag-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--bg-tertiary); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--color-text-main); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ag-pill small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.ag-pill-link { color: var(--accent-primary); text-decoration: none; }
.ag-pill-link:hover { border-color: var(--accent-primary); }
.ag-acoes-lin { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.ag-ib { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: var(--bg-tertiary); border: 1px solid var(--line); color: var(--color-text-muted); cursor: pointer; transition: color var(--trans-fast), border-color var(--trans-fast); }
.ag-ib:hover { color: var(--color-text-main); border-color: var(--line-strong); }
.ag-ib-perigo:hover { color: var(--color-danger); border-color: var(--color-danger); }
.ag-check input { display: none; }
.ag-check span { display: inline-block; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); cursor: pointer; position: relative; }
.ag-check input:checked + span { background: var(--color-success); border-color: var(--color-success); }
.ag-check input:checked + span::after { content: '✔'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.ag-card.cancelado { opacity: 0.6; border-left-style: dashed; }
.ag-card.adiado { border-left-color: var(--color-warning); border-left-style: dashed; }

/* celular: tudo empilhado, ações numa linha só */
@media (max-width: 640px) {
    .ag-card.ag-lin { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; position: relative; }
    .ag-card.ag-lin > * { grid-column: 1 !important; grid-row: auto !important; }
    .ag-card.ag-lin .ag-slot { position: absolute; top: 10px; right: 10px; padding: 6px; z-index: 1; }
    .ag-card.ag-lin .ag-slot:empty { display: none; }
    .ag-card.ag-lin .ag-check span { width: 26px; height: 26px; }
    .ag-card.ag-lin .ag-quando { flex-direction: row; align-items: baseline; gap: 10px; padding-right: 40px; }
    .ag-empresa { font-size: 16.5px; }
    .ag-l2 { font-size: 14px; -webkit-line-clamp: 3; }
    .ag-acoes-lin { justify-content: stretch; gap: 8px; }
    .ag-acoes-lin .ag-principal { flex: 1 1 auto; justify-content: center; min-height: 42px; }
    .ag-acoes-lin .ag-ib { width: 42px; height: 42px; flex: none; }
    .ag-acoes-lin > .ag-ib:first-of-type:last-of-type { flex: 1; }
}

/* celular: reuniões, eventos e lembretes — hora, concluir e botões na mesma linha */
@media (max-width: 640px) {
    .ag-card.ag-lin:not(:has(.ag-principal)) { grid-template-columns: 1fr auto auto; column-gap: 10px; }
    .ag-card.ag-lin:not(:has(.ag-principal)) .ag-quando { grid-column: 1 !important; grid-row: 1 !important; padding-right: 0; }
    .ag-card.ag-lin:not(:has(.ag-principal)) .ag-slot { position: static; grid-column: 2 !important; grid-row: 1 !important; padding: 0; }
    .ag-card.ag-lin:not(:has(.ag-principal)) .ag-acoes-lin { grid-column: 3 !important; grid-row: 1 !important; }
    .ag-card.ag-lin:not(:has(.ag-principal)) .ag-acoes-lin .ag-ib { width: 38px; height: 38px; }
    .ag-card.ag-lin:not(:has(.ag-principal)) .ag-main { grid-column: 1 / -1 !important; grid-row: 2 !important; }
}

/* ==========================================================================
   22. ACOMPANHAMENTO — posição de cada item da licitação
   ========================================================================== */
.ac-itens { margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-secondary); }
.ac-itens-topo { display: flex; justify-content: space-between; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.ac-itens-resumo { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.ac-item-row { display: grid; grid-template-columns: 56px minmax(110px, 1fr) 100px 76px 118px 176px 150px 34px; gap: 8px; align-items: center; margin-bottom: 6px; padding: 4px 4px 4px 8px; border-left: 3px solid transparent; border-radius: 8px; }
.ac-item-row input, .ac-item-row select { height: 38px; width: 100%; min-width: 0; padding: 0 10px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); }
.ac-item-row input:focus, .ac-item-row select:focus { border-color: var(--accent-primary); outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.ac-item-n { text-align: center; font-weight: 700; }
/* descrição enxuta: uma linha, o texto completo aparece ao passar o mouse */
.ac-item-desc { text-overflow: ellipsis; }
.ac-item-u, .ac-item-q { text-align: right; }
.ac-item-tot { text-align: right; font-weight: 700; font-size: 13px; white-space: nowrap; padding-right: 4px; }
.ac-item-row.rk-fora .ac-item-tot { text-decoration: line-through; opacity: .55; }
.ac-item-cab { display: grid; grid-template-columns: 56px minmax(110px, 1fr) 100px 76px 118px 176px 150px 34px; gap: 8px; padding: 0 4px 6px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); }
.ac-item-cab span:nth-child(1), .ac-item-cab span:nth-child(7) { text-align: center; }
.ac-item-cab span:nth-child(3), .ac-item-cab span:nth-child(4), .ac-item-cab span:nth-child(5) { text-align: right; padding-right: 4px; }
.ac-itens-soma { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; }
.ac-itens-soma:empty { display: none; }
.ac-itens-soma i { margin-right: 3px; }
.ac-soma-v { color: var(--color-success); font-weight: 600; }
.ac-soma-x { color: var(--color-danger); font-weight: 600; }
.ac-soma-g { color: var(--color-text-muted); margin-left: auto; }
/* telas médias: a linha do item quebra em duas, sem rolagem lateral */
@media (min-width: 641px) and (max-width: 1180px) {
    .ac-item-cab { display: none; }
    .ac-item-row { display: flex; flex-wrap: wrap; }
    .ac-item-row .ac-item-n { flex: 0 0 56px; } .ac-item-row .ac-item-desc { flex: 1 1 220px; min-width: 0; }
    .ac-item-row .ac-item-u { flex: 0 0 110px; } .ac-item-row .ac-item-q { flex: 0 0 84px; }
    .ac-item-row .ac-item-tot { flex: 0 0 120px; } .ac-item-row .ac-item-sit { flex: 0 0 176px; }
    .ac-item-row .ac-pos-ctl { flex: 0 0 150px; } .ac-item-row .ac-item-rm { flex: 0 0 34px; margin-left: auto; }
}
@media (max-width: 640px) { .ac-item-cab { display: none; } .ac-itens-soma { flex-direction: column; } .ac-soma-g { margin-left: 0; } }
.ac-item-sit { font-weight: 600; }
.ac-item-sit.bom { color: var(--color-success); border-color: rgba(52, 211, 153, .5); }
.ac-item-sit.ruim { color: var(--color-danger); border-color: rgba(248, 113, 113, .5); }
.ac-item-sit.lances { color: var(--color-warning); border-color: rgba(251, 191, 36, .5); }
.ac-itens-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.ac-itens-todos { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.ac-itens-todos select { height: 34px; padding: 0 8px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 12.5px; color: var(--color-text-main); }
.ac-badge-itens { background: var(--bg-tertiary); color: var(--color-text-main); border: 1px solid var(--line); text-transform: none; font-weight: 600; max-width: 100%; white-space: normal; }
.ac-itens-ro { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ac-item-ro { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.ac-item-ro b { min-width: 28px; }
.ac-item-ro-desc { flex: 1 1 140px; color: var(--color-text-muted); }
.ac-item-ro-lugar { font-weight: 700; color: var(--accent-secondary); }
.ac-pos { padding: 2px 10px; border-radius: 99px; background: var(--bg-tertiary); font-size: 12px; font-weight: 700; }
.ac-pos.bom { color: var(--color-success); } .ac-pos.ruim { color: var(--color-danger); } .ac-pos.lances { color: var(--color-warning); }

@media (max-width: 640px) {
    .ac-itens { padding: 12px; }
    .ac-item-row { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; grid-template-areas: "n desc desc desc" "u u q q" "tot tot tot tot" "sit sit sit sit" "pos pos pos rm"; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-left-width: 4px; border-left-color: transparent; border-radius: 10px; background: var(--bg-primary); margin-bottom: 8px; }
    .ac-item-row .ac-item-n { grid-area: n; } .ac-item-row .ac-item-desc { grid-area: desc; }
    .ac-item-row .ac-item-u { grid-area: u; } .ac-item-row .ac-item-q { grid-area: q; } .ac-item-row .ac-item-tot { grid-area: tot; text-align: left; }
    .ac-item-row .ac-item-sit { grid-area: sit; } .ac-item-row .ac-pos-ctl { grid-area: pos; grid-template-columns: 44px minmax(0, 1fr) 44px; }
    .ac-item-row .ac-pos-btn { width: 44px; height: 44px; }
    .ac-item-row .ac-item-rm { grid-area: rm; width: 44px; height: 44px; justify-self: end; }
    .ac-item-row input, .ac-item-row select { height: 44px; }
    .ac-itens-todos { margin-left: 0; width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
    .ac-itens-todos select { width: 100%; min-width: 0; height: 44px; }
    .ac-itens-acoes .btn-secondary { flex: 1 1 calc(50% - 4px); justify-content: center; min-height: 44px; }
}
.ac-item-lugar { text-align: center; font-weight: 700; }

/* posição: botões ▲ ▼ ao lado do número, destaque por colocação e linha que acabou de mudar de lugar */
.ac-pos-ctl { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 4px; align-items: center; min-width: 0; }
.ac-pos-btn { width: 34px; height: 38px; font-size: 20px; }
.ac-item-lugar { -moz-appearance: textfield; appearance: textfield; }
.ac-item-lugar::-webkit-outer-spin-button, .ac-item-lugar::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* caixa inteira colorida: verde = 1º lugar / arrematado; vermelho = desclassificado (cancelado/fracassado fica só apagado) */
.ac-item-row.rk-1 { border-left-color: var(--color-success); background: rgba(52, 211, 153, 0.16); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.55); }
.ac-item-row.rk-top3 { border-left-color: var(--accent-secondary); background: rgba(220, 174, 46, 0.06); }
.ac-item-row.rk-fora { opacity: 0.6; }
.ac-item-row.rk-desc { opacity: 1; border-left-color: var(--color-danger, #f87171); background: rgba(248, 113, 113, 0.15); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.55); }
[data-theme="light"] .ac-item-row.rk-1 { background: rgba(16, 185, 129, 0.14); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.5); }
[data-theme="light"] .ac-item-row.rk-desc { background: rgba(239, 68, 68, 0.11); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45); border-left-color: #ef4444; }
.ac-item-row.ac-flash { animation: ac-flash 1.4s ease-out; }
@keyframes ac-flash { from { box-shadow: 0 0 0 2px var(--accent-primary); } to { box-shadow: 0 0 0 2px transparent; } }

.ac-item-lugar[readonly] { opacity: .75; cursor: not-allowed; }
.ac-pos-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ============================================================
   23. Envios (enviar arquivos por e-mail)
   ============================================================ */
.en-card { padding: 20px 22px; margin-bottom: 16px; }
.en-titulo { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.en-titulo i { color: var(--accent-primary); font-size: 20px; }
.en-linha { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.en-linha .form-group { flex: 1 1 180px; min-width: 0; margin-bottom: 0; }
.en-linha .en-grande { flex: 2 1 280px; }
.en-linha .btn-primary { height: 42px; }
.en-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.en-grade .form-group { margin-bottom: 0; min-width: 0; }
.en-grade textarea, .en-card textarea { width: 100%; resize: vertical; }
.en-dica { font-size: 11.5px; color: var(--color-text-muted); display: block; margin-top: 4px; }
.en-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.en-aviso { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid rgba(251, 191, 36, 0.45); font-size: 13px; color: var(--color-text-muted); }
.en-aviso strong { color: var(--color-text-main); }
.en-intro { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin-bottom: 16px; font-size: 13px; color: var(--color-text-muted); }
.en-intro i { font-size: 22px; color: var(--accent-primary); flex: none; }
.en-vazio { text-align: center; padding: 40px 20px; }
.en-vazio i { font-size: 44px; color: var(--color-text-muted); }

.en-cliente { padding: 16px 18px; margin-bottom: 12px; }
.en-cliente-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.en-cliente-topo h4 { font-size: 15px; margin-bottom: 6px; }
.en-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-muted); cursor: pointer; }

.en-chip { display: inline-block; padding: 3px 10px; margin: 2px 4px 2px 0; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg-tertiary); color: var(--color-text-muted); word-break: break-all; }
.en-chip.ok { background: rgba(52, 211, 153, 0.14); color: var(--color-success); }
.en-chip.aviso { background: rgba(251, 191, 36, 0.16); color: var(--color-warning); }
.en-chip a { color: inherit; text-decoration: underline; }
.en-resumo { margin-top: 14px; display: grid; gap: 6px; font-size: 13px; }

.en-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 18px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-secondary); }
.en-barra .en-acoes { margin: 0 0 0 auto; }
.en-pasta { border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 12px; background: var(--bg-secondary); margin-bottom: 8px; padding: 10px 14px; }
.en-pasta.on { border-left-color: var(--accent-primary); }
.en-pasta-topo { display: flex; align-items: center; gap: 12px; }
.en-pasta-ck { width: 20px; height: 20px; flex: none; }
.en-pasta-nome { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.en-pasta-nome b { font-size: 14px; overflow-wrap: anywhere; }
.en-pasta-nome span { font-size: 12px; color: var(--color-text-muted); }
.en-arqs { margin-top: 8px; }
.en-arqs summary { cursor: pointer; font-size: 12.5px; color: var(--accent-primary); }
.en-arq { display: flex; gap: 8px; align-items: center; padding: 5px 2px; font-size: 12.5px; border-top: 1px dashed var(--line); }
.en-arq span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.en-arq em { font-style: normal; color: var(--color-text-muted); white-space: nowrap; }
.en-arq.grande em { color: var(--color-danger); font-weight: 600; }

.en-log { padding: 14px 18px; margin-top: 14px; }
.en-log-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.en-log-l { font-size: 13px; padding: 2px 0; color: var(--color-text-muted); overflow-wrap: anywhere; }
.en-log-l.info { color: var(--color-text-main); font-weight: 600; margin-top: 6px; }
.en-log-l.ok { color: var(--color-success); }
.en-log-l.erro { color: var(--color-danger); font-weight: 600; }
.en-log-l.aviso { color: var(--color-warning); }

.en-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.en-previa { margin: 6px 0 4px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--bg-primary); }
.en-previa-t { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: 8px; }
.en-previa-assunto { font-weight: 700; margin-bottom: 8px; overflow-wrap: anywhere; }
.en-previa-corpo { font-size: 13px; }
.en-guia { margin-top: 12px; font-size: 13px; color: var(--color-text-muted); }
.en-guia summary { cursor: pointer; color: var(--accent-primary); font-weight: 600; }
.en-guia ol { margin: 8px 0 0 20px; display: grid; gap: 6px; }
.en-guia code { background: var(--bg-tertiary); padding: 1px 6px; border-radius: 5px; font-size: 12px; overflow-wrap: anywhere; }
.en-lista-conf { margin: 8px 0 0 18px; max-height: 220px; overflow: auto; font-size: 13px; }
.en-lista-conf em { color: var(--color-text-muted); font-style: normal; }

@media (max-width: 640px) {
    .en-card { padding: 16px 14px; }
    .en-linha .btn-primary, .en-acoes .btn-primary, .en-acoes .btn-secondary { width: 100%; justify-content: center; min-height: 44px; }
    .en-barra .en-acoes { margin-left: 0; width: 100%; }
    .en-pasta-topo { flex-wrap: wrap; }
    .en-pasta-topo .btn-sm { width: 100%; min-height: 44px; justify-content: center; }
    .en-pasta-ck { width: 24px; height: 24px; }
}
.en-conexao { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
/* Agenda: filtro "Dia" (PDF de um dia só) */
.ag-dia-filtro { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.ag-dia-filtro input { height: 38px; padding: 0 10px; border-radius: 9px; }
@media (max-width: 640px) { .ag-dia-filtro { width: 100%; } .ag-dia-filtro input { flex: 1; height: 44px; } }


/* Busca da data da sessão no PNCP (Agenda e Acompanhamento) */
.pncp-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 0 14px; }
.pncp-linha.pncp-mini { margin: 8px 0 0; }
.pncp-info { flex: 1 1 260px; min-width: 0; font-size: 12.5px; color: var(--color-text-muted); }
.pncp-achou { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid rgba(52, 211, 153, .4); border-radius: 10px; background: rgba(52, 211, 153, .07); color: var(--color-text-main); }
.pncp-achou > div { flex: 1 1 100%; font-size: 13px; }
.pncp-achou > div i { color: var(--color-success); }
.pncp-achou > small { flex: 1 1 100%; color: var(--color-text-muted); word-break: break-word; }

/* Menu lateral: seções que recolhem (botão discreto, seta à direita do título) */
.menu-section { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; border-radius: 8px; transition: color .15s ease; }
.menu-section:hover, .menu-section:focus-visible { color: rgba(148, 160, 184, 0.95); outline: none; }
.menu-section-seta { font-size: 16px; opacity: 0; transition: transform .2s ease, opacity .15s ease; }
.menu-section:hover .menu-section-seta, .menu-section:focus-visible .menu-section-seta, .menu-section.fechada .menu-section-seta { opacity: .75; }
.menu-section.fechada .menu-section-seta { transform: rotate(-90deg); }
@media (hover: none) { .menu-section-seta { opacity: .45; } }
.app-layout:not(.sidebar-collapsed) .sidebar-menu .menu-item.sec-oculto { display: none; }

/* ============================================================
   24. Agenda e Acompanhamento: topo mais enxuto, abas em uma linha, cartão fechado em duas linhas
   ============================================================ */
/* Agenda: números em faixa fina */
.ag-kpis { gap: 10px; margin-bottom: 12px; }
.ag-kpis .acomp-kpi { padding: 8px 14px; gap: 10px; }
.ag-kpis .acomp-kpi-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
.ag-kpis .acomp-kpi > div:last-child { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; min-width: 0; }
.ag-kpis .acomp-kpi-label { grid-column: 1 / -1; font-size: 10.5px; }
.ag-kpis .acomp-kpi-value { font-size: 20px; line-height: 1.1; }
.ag-kpis .acomp-kpi-extra { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-topo { margin-bottom: 8px; }
.ag-acoes .ag-visao { margin-right: 6px; padding-right: 10px; border-right: 1px solid var(--line); }
@media (min-width: 641px) {
    /* filtros numa linha só (quebra para a segunda só se faltar espaço) */
    .ag-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; }
    .ag-barra .acomp-search { flex: 1 1 110px; min-width: 100px; }
    .ag-barra > select { flex: 0 1 178px; min-width: 130px; width: auto; }
    .ag-barra .ag-dia-filtro { flex: 0 0 auto; }
    .ag-barra .acomp-toolbar-row { display: contents; }
    .ag-barra .acomp-chip { padding: 5px 11px; white-space: nowrap; }
}
@media (max-width: 640px) {
    .ag-kpis { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
    .ag-kpis .acomp-kpi { flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; }
    .ag-kpis .acomp-kpi-icon { width: 28px; height: 28px; font-size: 15px; }
    .ag-kpis .acomp-kpi-value { font-size: 18px; }
    .ag-acoes .ag-visao { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; flex: 1 1 100%; order: -2; }
}

/* Acompanhamento: abas numa linha só que rola de lado (o botão Novo fica ao lado) */
.acomp-tabs-barra { margin-bottom: 12px; align-items: center; }
.acomp-tabs { position: relative; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 2px; padding: 5px 6px; border-radius: 16px; box-shadow: none; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.acomp-tabs::-webkit-scrollbar { height: 6px; }
.acomp-tabs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.acomp-tab { flex: 0 0 auto; min-height: 36px; padding: 6px 12px; gap: 7px; font-size: 13px; border-radius: 12px; }
.acomp-tab i { font-size: 16px; }
.acomp-tab-n { min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; }
.acomp-novo { height: 38px; padding: 0 14px; border-radius: 12px; flex: none; }

/* Acompanhamento: cartão fechado — data à esquerda, título e informações no meio (na mesma linha quando cabe), situação à direita */
.empresa-grupo-secao .expander[class*="expander-status-"] .expander-header.ac-cab,
.expander-header.ac-cab { display: grid !important; grid-template-columns: 70px 124px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px !important; padding: 10px 16px !important; height: auto; }
.ac-cab-data { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; padding-right: 12px; border-right: 1px solid var(--line); line-height: 1.15; }
.ac-cab-data b { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.empresa-grupo-secao .expander .expander-header.ac-cab .ac-cab-data span { font-size: 12px !important; font-weight: 600 !important; color: var(--color-text-muted) !important; margin-top: 2px; }
.ac-cab-data.hoje b { color: var(--accent-primary); }
.ac-cab-meio { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.empresa-grupo-secao .expander .expander-header.ac-cab .ac-cab-titulo { font-size: 14px !important; font-weight: 700 !important; text-transform: uppercase; overflow-wrap: anywhere; min-width: 0; }
.ac-cab-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.ac-cab-chips .status-badge { max-width: 100%; }
.ac-cab-fim { display: flex; align-items: center; gap: 8px; justify-self: end; }
.ac-cab-fim i { font-size: 18px; color: var(--color-text-muted); }
.ac-cab-valor { font-size: 12.5px; font-weight: 700; color: var(--color-success) !important; white-space: nowrap; }
@media (max-width: 700px) {
    .empresa-grupo-secao .expander[class*="expander-status-"] .expander-header.ac-cab,
    .expander-header.ac-cab { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "d f" "m m"; gap: 8px 10px !important; padding: 10px 12px !important; }
    .ac-cab-data { grid-area: d; flex-direction: row; gap: 8px; align-self: center; padding: 0; border: 0; }
    .ac-cab-data b { font-size: 16px; }
    .empresa-grupo-secao .expander .expander-header.ac-cab .ac-cab-data span { margin: 0; }
    .ac-cab-meio { grid-area: m; }
    .ac-cab-fim { grid-area: f; min-width: 0; }
    .ac-cab-fim .status-badge { white-space: normal; text-align: center; }
}
@media (max-width: 900px) { .acomp-tabs-barra { align-items: stretch; } .acomp-tabs { max-width: 100%; } }

/* Pregão e UASG num bloco ao lado da data (mesmo estilo) */
.ac-cab-pregao { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; padding-right: 12px; border-right: 1px solid var(--line); line-height: 1.15; min-width: 0; text-align: center; }
.empresa-grupo-secao .expander .expander-header.ac-cab .ac-cab-pregao small { font-size: 9.5px !important; font-weight: 700 !important; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted) !important; }
.ac-cab-pregao b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; max-width: 100%; overflow-wrap: anywhere; }
.empresa-grupo-secao .expander .expander-header.ac-cab .ac-cab-pregao span { font-size: 11.5px !important; font-weight: 600 !important; color: var(--color-text-muted) !important; margin-top: 2px; white-space: nowrap; }
@media (max-width: 700px) {
    .empresa-grupo-secao .expander[class*="expander-status-"] .expander-header.ac-cab,
    .expander-header.ac-cab { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "d p" "m m" "f f"; }
    .ac-cab-pregao { grid-area: p; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 2px 8px; align-self: center; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); text-align: left; }
    .empresa-grupo-secao .expander .expander-header.ac-cab .ac-cab-pregao span { margin: 0; }
    .ac-cab-fim { grid-area: f; width: 100%; justify-content: space-between; justify-self: stretch; }
}

/* ============================================================
   25. Acompanhamento (cartão fechado): etiqueta de retorno e posições dos itens
   ============================================================ */
.ac-ret { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-primary); font-size: 12px; font-weight: 600; color: var(--color-text-main); white-space: nowrap; }
.ac-ret i { font-size: 15px; color: var(--color-text-muted); }
.ac-ret b { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.ac-ret em { font-style: normal; font-weight: 700; color: var(--color-text-muted); }
.ac-ret.urgente { border-color: rgba(245, 158, 11, .55); background: rgba(245, 158, 11, .12); }
.ac-ret.urgente i, .ac-ret.urgente em { color: #d97706; }
.ac-ret.atrasado { border-color: rgba(239, 68, 68, .55); background: rgba(239, 68, 68, .1); }
.ac-ret.atrasado i, .ac-ret.atrasado em { color: var(--color-danger); }

.ac-its { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.ac-it { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--bg-primary); font-size: 12px; line-height: 1; }
.ac-it b { display: inline-flex; align-items: center; padding: 5px 7px; font-weight: 800; background: var(--bg-tertiary); color: var(--color-text-main); }
.ac-it span { display: inline-flex; align-items: center; padding: 5px 8px; font-weight: 700; color: var(--color-text-muted); }
.ac-it.ok { border-color: rgba(16, 185, 129, .55); } .ac-it.ok span { background: rgba(16, 185, 129, .16); color: #059669; }
.ac-it.top { border-color: rgba(217, 164, 6, .55); } .ac-it.top span { background: rgba(217, 164, 6, .16); color: #b7791f; }
.ac-it.out { border-color: rgba(239, 68, 68, .45); } .ac-it.out span { background: rgba(239, 68, 68, .1); color: var(--color-danger); } .ac-it.out b { text-decoration: line-through; opacity: .7; }
[data-theme="dark"] .ac-it.ok span, :root:not([data-theme="light"]) .ac-it.ok span { color: var(--color-success); }
[data-theme="dark"] .ac-it.top span, :root:not([data-theme="light"]) .ac-it.top span { color: var(--accent-secondary); }

.ac-faixa { display: inline-flex; align-items: flex-end; gap: 2px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-primary); }
.ac-faixa i { width: 6px; height: 16px; border-radius: 2px; background: var(--line-strong); }
.ac-faixa i.ok { background: #10b981; } .ac-faixa i.top { background: #d9a406; } .ac-faixa i.out { background: rgba(239, 68, 68, .65); height: 9px; }
.ac-faixa-txt { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }

/* Valor de fechamento no cartão fechado */
.ac-val { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 8px; border: 1px solid rgba(16, 185, 129, .5); background: rgba(16, 185, 129, .1); font-size: 13px; font-weight: 800; color: #059669; white-space: nowrap; }
.ac-val i { font-size: 16px; }
.ac-val b { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
[data-theme="dark"] .ac-val, :root:not([data-theme="light"]) .ac-val { color: var(--color-success); }

/* Muitos itens: barra de proporções de tamanho fixo + contagem por grupo (substitui a faixa de barrinhas) */
.ac-resumo { gap: 8px 12px; }
.ac-total { font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.ac-barra { display: inline-flex; gap: 1px; width: 150px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line-strong); flex: none; }
.ac-barra i { min-width: 4px; height: 100%; background: var(--line-strong); }
.ac-barra i.ok, .ac-leg.ok i { background: #10b981; } .ac-barra i.top, .ac-leg.top i { background: #d9a406; }
.ac-barra i.mid, .ac-leg.mid i { background: #94a3b8; } .ac-barra i.none, .ac-leg.none i { background: var(--line-strong); }
.ac-barra i.out, .ac-leg.out i { background: #ef6b6b; }
.ac-legs { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.ac-leg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ac-leg i { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1px solid rgba(127, 127, 127, .3); }
.ac-leg-melhor { font-weight: 700; color: var(--color-text-main); }

/* Cores das etiquetas do cartão fechado: valem em qualquer situação (inclusive no cartão vermelho de vencido) */
.expander-header .ac-val, .expander-header .ac-val * { color: #047857 !important; }
.expander-header .ac-val b { opacity: .9; }
.expander-header .ac-ret b, .expander-header .ac-ret i { color: var(--color-text-muted) !important; }
.expander-header .ac-ret span { color: var(--color-text-main) !important; }
.expander-header .ac-ret.urgente i, .expander-header .ac-ret.urgente em { color: #b45309 !important; }
.expander-header .ac-ret.atrasado i, .expander-header .ac-ret.atrasado em { color: #dc2626 !important; }
.expander-header .ac-ret em { color: var(--color-text-muted) !important; }
.expander-header .ac-it b { color: var(--color-text-main) !important; }
.expander-header .ac-it span { color: var(--color-text-muted) !important; }
.expander-header .ac-it.ok span { color: #047857 !important; }
.expander-header .ac-it.top span { color: #92610a !important; }
.expander-header .ac-it.out span { color: #dc2626 !important; }
[data-theme="dark"] .expander-header .ac-val, [data-theme="dark"] .expander-header .ac-val *, :root:not([data-theme="light"]) .expander-header .ac-val, :root:not([data-theme="light"]) .expander-header .ac-val * { color: var(--color-success) !important; }
[data-theme="dark"] .expander-header .ac-it.ok span, :root:not([data-theme="light"]) .expander-header .ac-it.ok span { color: var(--color-success) !important; }
[data-theme="dark"] .expander-header .ac-it.top span, :root:not([data-theme="light"]) .expander-header .ac-it.top span { color: var(--accent-secondary) !important; }
[data-theme="dark"] .expander-header .ac-ret.urgente i, [data-theme="dark"] .expander-header .ac-ret.urgente em, :root:not([data-theme="light"]) .expander-header .ac-ret.urgente i, :root:not([data-theme="light"]) .expander-header .ac-ret.urgente em { color: #fbbf24 !important; }
[data-theme="dark"] .expander-header .ac-ret.atrasado i, [data-theme="dark"] .expander-header .ac-ret.atrasado em, :root:not([data-theme="light"]) .expander-header .ac-ret.atrasado i, :root:not([data-theme="light"]) .expander-header .ac-ret.atrasado em { color: #f87171 !important; }

/* ============================================================
   26. Acompanhamento: sinais no cartão inteiro (faixa lateral + fundo suave)
   ============================================================ */
.empresa-grupo-secao .expander.ac-sig { position: relative; border-left-width: 0; background-image: linear-gradient(90deg, var(--sig-tinta), transparent 55%); }
.empresa-grupo-secao .expander.ac-sig::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--sig-faixa); z-index: 1; }
.empresa-grupo-secao .expander.ac-sig .expander-header.ac-cab { padding-left: 22px !important; }
.empresa-grupo-secao .expander.ac-sig-todos-fora { border-color: rgba(239, 68, 68, .45); }
.empresa-grupo-secao .expander.ac-sig-todos-fora .ac-cab-meio .ac-cab-titulo { opacity: .75; }
.ac-legenda { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 2px 10px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.ac-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.ac-legenda i { width: 5px; height: 14px; border-radius: 3px; }
.ac-legenda i.ok { background: #10b981; } .ac-legenda i.out { background: #ef4444; } .ac-legenda i.gold { background: #d9a406; }
@media (max-width: 700px) { .empresa-grupo-secao .expander.ac-sig .expander-header.ac-cab { padding-left: 18px !important; } }

/* ============================================================
   27. Agenda: bloco da data (dia/mês + hora) e bloco do pregão/UASG, como no Acompanhamento
   ============================================================ */
.ag-card.ag-lin { grid-template-columns: 24px 96px minmax(0, 1fr) auto; }
.ag-card.ag-lin.ag-lin-lic { grid-template-columns: 24px 96px 128px minmax(0, 1fr) auto; }
.ag-card.ag-lin .ag-quando, .ag-pregao { align-self: stretch; align-items: center; justify-content: center; text-align: center; padding-right: 12px; border-right: 1px solid var(--line); line-height: 1.15; }
.ag-card.ag-lin .ag-quando { display: flex; flex-direction: column; gap: 2px; }
.ag-dia-txt { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--color-text-main); }
.ag-card.ag-lin .ag-hora-txt { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.ag-card.ag-lin .ag-tipo { margin-top: 1px; font-size: 9.5px; color: var(--ag-cor, var(--accent-primary)); }
.ag-pregao { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-pregao small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.ag-pregao b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; max-width: 100%; overflow-wrap: anywhere; }
.ag-pregao span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
@media (max-width: 640px) {
    .ag-card.ag-lin, .ag-card.ag-lin.ag-lin-lic { grid-template-columns: 1fr; }
    .ag-card.ag-lin .ag-quando { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px 10px; padding: 0 40px 0 0; border: 0; text-align: left; align-self: auto; }
    .ag-pregao { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 2px 10px; padding: 0; border: 0; text-align: left; align-self: auto; }
    .ag-pregao b { font-size: 15px; }
}

/* ============================================================
   28. Dashboard: indicadores numa linha, listas com bloco de data e painéis sem vazios
   ============================================================ */
@media (min-width: 1100px) {
    #dash-kpis.acomp-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
    #dash-kpis .dash-kpi { padding: 10px 12px; gap: 10px; }
    #dash-kpis .acomp-kpi > div { min-width: 0; }
    #dash-kpis .acomp-kpi-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
    #dash-kpis .acomp-kpi-label { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #dash-kpis .acomp-kpi-value { font-size: 20px; line-height: 1.15; }
    #dash-kpis .acomp-kpi-extra { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 700px) and (max-width: 1099px) { #dash-kpis.acomp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.dash-grade { display: block; column-count: 2; column-gap: 16px; }
.dash-grade > .dash-painel { break-inside: avoid; margin: 0 0 16px; }
.dash-painel-largo { column-span: all; }
@media (max-width: 900px) { .dash-grade { column-count: 1; } }

.dash-item { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; padding: 8px 10px; }
.dash-item.sem-bloco { grid-template-columns: minmax(0, 1fr) auto; }
.dash-bloco { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; padding-right: 10px; border-right: 1px solid var(--line); line-height: 1.15; text-align: center; min-width: 0; }
.dash-bloco b { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.dash-bloco span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; margin-top: 2px; }
.dash-bloco.red b { color: var(--color-danger); } .dash-bloco.amber b { color: #d97706; }
:root:not([data-theme="light"]) .dash-bloco.amber b, [data-theme="dark"] .dash-bloco.amber b { color: #fbbf24; }
.dash-item-main strong { font-size: 13.5px; }
.dash-pre { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; line-height: 1.15; text-align: right; flex: none; }
.dash-pre b { font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.dash-pre span { font-size: 11px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.dash-pre .dash-tipo { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--bg-tertiary); }
@media (max-width: 560px) {
    .dash-item { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; }
    .dash-item.sem-bloco { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ============================================================
   29. Contratos: lista com bloco da data e do pregão/UASG (igual à Agenda e ao Acompanhamento)
   ============================================================ */
.ct-lista { display: flex; flex-direction: column; gap: 6px; }
.ct-linha { display: grid; grid-template-columns: 66px 128px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--line); border-left: 4px solid var(--accent-primary); border-radius: 12px; transition: border-color var(--trans-fast), box-shadow var(--trans-fast); }
.ct-linha.auto { border-left-color: var(--color-success); }
.ct-linha:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.ct-data, .ct-pregao { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; padding-right: 12px; border-right: 1px solid var(--line); line-height: 1.15; text-align: center; min-width: 0; }
.ct-data b { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.ct-data span { font-size: 12px; font-weight: 600; color: var(--color-text-muted); margin-top: 2px; }
.ct-pregao small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.ct-pregao b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; max-width: 100%; overflow-wrap: anywhere; margin: 2px 0; }
.ct-pregao span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.ct-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-main strong { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.ct-orgao { font-size: 13px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.ct-itens { font-size: 12px; font-weight: 600; color: var(--color-success); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-fim { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.ct-valor { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; font-family: 'Inter', sans-serif; }
.ct-semvalor { font-size: 13px; font-weight: 600; color: var(--color-text-muted); font-style: italic; }
.ct-etq { white-space: nowrap; }
.ct-acoes { display: flex; gap: 6px; align-items: center; }
.ct-linha:not(:has(.ct-acoes)) { grid-template-columns: 66px 128px minmax(0, 1fr) auto; }
.ct-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; margin-top: 10px; padding: 12px 18px; border-radius: 12px; background: var(--bg-tertiary); }
.ct-total span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.ct-total b { font-size: 20px; font-weight: 800; color: var(--accent-secondary); font-family: 'Inter', sans-serif; }
@media (max-width: 760px) {
    .ct-linha, .ct-linha:not(:has(.ct-acoes)) { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "d p" "m m" "f f" "a a"; gap: 8px 10px; padding: 12px; }
    .ct-data { grid-area: d; flex-direction: row; gap: 8px; align-self: center; padding: 0; border: 0; }
    .ct-data span { margin: 0; }
    .ct-pregao { grid-area: p; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2px 8px; align-self: center; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); text-align: left; }
    .ct-pregao b { margin: 0; }
    .ct-main { grid-area: m; }
    .ct-fim { grid-area: f; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
    .ct-acoes { grid-area: a; justify-content: flex-end; }
}

/* ============================================================
   30. Habilitação: barra de filtros compacta e documentos em linhas (bloco do vencimento e do prazo + faixa por situação)
   ============================================================ */
.hab-barra { overflow: visible; margin: 8px 0 14px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 14px; border-left: 4px solid var(--accent-secondary); }
.hab-bloco, .hab-bloco > div, .hab-filtros, .hab-acoes-cli, .hab-acoes-lin { display: contents; }
.hab-barra .hab-f { margin: 0; min-width: 0; }
.hab-f-cli { flex: 1 1 240px; order: 1; } .hab-f-cert { flex: 1 1 220px; order: 2; } .hab-f-busca { flex: 1 1 220px; order: 3; } .hab-f-prazo { flex: 1 1 200px; order: 4; }
.hab-barra::after { content: ''; display: block; position: static; flex: 0 0 100%; width: auto; height: 0; margin: 0; padding: 0; border: 0; background: none; opacity: 0; transform: none; order: 5; }
.hab-f-status { flex: 1 1 auto; order: 6; }
.hab-f-status > div { gap: 12px !important; }
.hab-acoes-lin > .btn-secondary:first-child { order: 7; margin-left: auto; align-self: flex-end; min-height: 40px !important; padding: 8px 14px !important; flex: 0 0 auto !important; }
#delete-company-container { order: 8; align-self: flex-end; flex: 0 0 auto !important; min-width: 0 !important; }
.hab-resumo-btn { display: contents; }
.hab-resumo-btn > button { order: 9; align-self: flex-end; min-height: 40px; padding: 8px 16px; white-space: nowrap; }
@media (max-width: 700px) {
    .hab-barra { padding: 12px; }
    .hab-barra .hab-f { flex: 1 1 100%; }
    .hab-acoes-lin > .btn-secondary:first-child, .hab-resumo-btn > button { flex: 1 1 100% !important; margin-left: 0; }
}

.hab-lista { display: flex; flex-direction: column; gap: 6px; }
.hab-vazio { padding: 26px; text-align: center; color: var(--color-text-muted); font-style: italic; }
.hab-linha { display: grid; grid-template-columns: 66px 78px minmax(0, 1fr) 150px auto; align-items: center; gap: 4px 14px; padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 12px; transition: border-color var(--trans-fast), box-shadow var(--trans-fast); }
.hab-linha:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.hab-linha.st-vencido { border-left-color: #ef4444; background-image: linear-gradient(90deg, rgba(239, 68, 68, .10), transparent 45%); }
.hab-linha.st-alerta { border-left-color: #f59e0b; background-image: linear-gradient(90deg, rgba(245, 158, 11, .10), transparent 45%); }
.hab-linha.st-regular { border-left-color: #10b981; }
.hab-venc, .hab-prazo { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; padding-right: 12px; border-right: 1px solid var(--line); line-height: 1.15; text-align: center; min-width: 0; }
.hab-venc b { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.hab-venc span, .hab-prazo span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); margin-top: 2px; }
.hab-prazo b { font-size: 16px; font-weight: 800; }
.hab-linha.st-vencido .hab-prazo b { color: var(--color-danger); } .hab-linha.st-alerta .hab-prazo b { color: #d97706; } .hab-linha.st-regular .hab-prazo b { color: #059669; }
[data-theme="dark"] .hab-linha.st-alerta .hab-prazo b, :root:not([data-theme="light"]) .hab-linha.st-alerta .hab-prazo b { color: #fbbf24; }
[data-theme="dark"] .hab-linha.st-regular .hab-prazo b, :root:not([data-theme="light"]) .hab-linha.st-regular .hab-prazo b { color: var(--color-success); }
.hab-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hab-main strong { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.hab-main strong .cert-icon { margin-right: 6px; color: var(--accent-primary); }
.hab-emp { font-size: 12.5px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.hab-cnpj { cursor: pointer; white-space: nowrap; }
.hab-cnpj:hover { color: var(--accent-primary); }
.hab-vig { min-width: 0; }
.hab-prog { display: flex; align-items: center; gap: 8px; }
.hab-prog .progress-track { flex: 1; }
.hab-prog > span { font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.hab-regularizada { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--color-regular, #059669); }
.hab-acoes { display: flex; align-items: center; justify-content: flex-end; }
@media (max-width: 760px) {
    .hab-linha { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "v p" "m m" "g g" "a a"; gap: 8px 10px; padding: 12px; }
    .hab-venc { grid-area: v; flex-direction: row; gap: 8px; align-self: center; padding: 0; border: 0; }
    .hab-venc span, .hab-prazo span { margin: 0; }
    .hab-prazo { grid-area: p; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2px 8px; align-self: center; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); text-align: left; }
    .hab-main { grid-area: m; }
    .hab-vig { grid-area: g; }
    .hab-acoes { grid-area: a; justify-content: flex-end; }
}
.hab-prog .progress-track { flex: 1; height: 7px; border-radius: 99px; background: var(--line-strong); overflow: hidden; min-width: 40px; }
.hab-prog .progress-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* Campos de seleção pesquisáveis (empresa, tipo de certidão): legíveis nos dois temas, inclusive ao passar o mouse e com a lista aberta */
.custom-select-trigger { background: var(--bg-primary); border-color: var(--line-strong); box-shadow: none; }
.custom-select-trigger:hover, .custom-select-wrapper.open .custom-select-trigger { background: var(--bg-secondary); border-color: var(--accent-primary); }
.custom-select-search { background: var(--bg-tertiary); border-bottom-color: var(--line); }
.custom-select-option-title { color: var(--color-text-main); }

/* ============================================================
   31. Equipe: cadastros em janela, listas em largura total e contas em linhas
   ============================================================ */
.eq-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.eq-coluna { display: flex; flex-direction: column; gap: 14px; }
.eq-grade-empresas { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.eq-modal { position: fixed; inset: 0; z-index: 2600; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.eq-modal.hidden { display: none !important; }
.eq-modal-card { position: relative; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; margin: 0 !important; }
.eq-modal-x { position: absolute; top: 10px; right: 14px; z-index: 2; font-size: 26px; line-height: 1; color: var(--color-text-muted); background: none; border: 0; cursor: pointer; }
.eq-modal-x:hover { color: var(--color-text-main); }

.eq-lista { display: flex; flex-direction: column; gap: 6px; }
.eq-vazio { padding: 26px; text-align: center; color: var(--color-text-muted); }
.eq-linha { display: grid; grid-template-columns: 44px minmax(0, 1.3fr) minmax(0, 1fr) auto 112px auto; align-items: center; gap: 4px 14px; padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--line); border-left: 4px solid var(--color-success); border-radius: 12px; transition: border-color var(--trans-fast), box-shadow var(--trans-fast); }
.eq-linha:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.eq-linha.eq-master { border-left-color: var(--accent-primary); }
.eq-linha.eq-admin { border-left-color: #f59e0b; }
.eq-linha.eq-susp { border-left-color: #ef4444; background-image: linear-gradient(90deg, rgba(239, 68, 68, .10), transparent 45%); }
.eq-linha.eq-susp .eq-quem { opacity: .8; }
.eq-linha.eq-oculto { background-color: rgba(255, 200, 0, .04); }
.eq-avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; background: var(--color-success); }
.eq-master .eq-avatar { background: var(--accent-primary); } .eq-admin .eq-avatar { background: #f59e0b; } .eq-susp .eq-avatar { background: #94a3b8; }
.eq-quem { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eq-quem strong { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.eq-quem span { font-size: 12.5px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-empresa { font-size: 13px; font-weight: 600; color: var(--accent-secondary); overflow-wrap: anywhere; }
.eq-papel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eq-papel .status-badge { font-size: 9.5px; padding: 3px 9px; }
.eq-acesso { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; text-align: right; }
.eq-acesso small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.eq-acesso b { font-size: 13px; font-weight: 700; }
.eq-acoes { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
@media (max-width: 860px) {
    .eq-grade-empresas { grid-template-columns: 1fr; }
    .eq-linha { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "a q" "e e" "p c" "x x"; gap: 8px 12px; padding: 12px; }
    .eq-avatar { grid-area: a; } .eq-quem { grid-area: q; } .eq-empresa { grid-area: e; }
    .eq-papel { grid-area: p; } .eq-acesso { grid-area: c; text-align: right; } .eq-acoes { grid-area: x; justify-content: flex-start; flex-wrap: wrap; }
}

/* ============================================================
   32. Relatórios: seletor compacto e resultado em linhas (bloco da data, pregão/UASG e valor, faixa por situação)
   ============================================================ */
.rl-abas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rl-aba { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-secondary); color: var(--color-text-muted); font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: border-color var(--trans-fast), color var(--trans-fast), background var(--trans-fast); }
.rl-aba i { font-size: 18px; }
.rl-aba:hover { border-color: var(--accent-primary); color: var(--color-text-main); }
.rl-aba.on { background: var(--accent-glow); border-color: var(--accent-primary); color: var(--accent-primary); }
@media (max-width: 760px) {
    .rl-abas { flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .rl-abas::-webkit-scrollbar { display: none; }
    .rl-aba { flex: none; white-space: nowrap; min-height: 44px; }
}

.rl-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.rl-linha { --rl-cor: var(--line-strong); display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--line); border-left: 4px solid var(--rl-cor); border-radius: 12px; transition: border-color var(--trans-fast), box-shadow var(--trans-fast); }
.rl-linha.rl-com-b2 { grid-template-columns: 78px 126px minmax(0, 1fr) auto; }
.rl-linha:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.rl-linha.st-ok { --rl-cor: #10b981; } .rl-linha.st-info { --rl-cor: #38bdf8; } .rl-linha.st-alerta { --rl-cor: #f59e0b; } .rl-linha.st-erro { --rl-cor: #ef4444; } .rl-linha.st-neutro { --rl-cor: #94a3b8; }
.rl-linha.st-erro { background-image: linear-gradient(90deg, rgba(239, 68, 68, .10), transparent 45%); }
.rl-linha.st-alerta { background-image: linear-gradient(90deg, rgba(245, 158, 11, .10), transparent 45%); }
.rl-b1, .rl-b2 { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; padding-right: 12px; border-right: 1px solid var(--line); line-height: 1.15; text-align: center; min-width: 0; }
.rl-b1 b { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.rl-b1 span, .rl-b2 span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); margin-top: 2px; white-space: nowrap; }
.rl-b2 small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.rl-b2 b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin: 2px 0; max-width: 100%; overflow-wrap: anywhere; }
.rl-b2 b.rl-dias { font-size: 16px; margin: 0; }
.rl-linha.st-erro .rl-dias { color: var(--color-danger); } .rl-linha.st-alerta .rl-dias { color: #d97706; } .rl-linha.st-ok .rl-dias { color: #059669; }
.rl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rl-main strong { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.rl-main span { font-size: 13px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.rl-main span b { color: var(--color-text-main); font-weight: 700; }
.rl-main .rl-sub { font-size: 12px; }
.rl-hom { color: var(--text-primary, inherit); }
.rl-hom-ganho { color: var(--color-success, #10b981); font-weight: 700; }
.rl-fim { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.rl-fim > b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; font-family: 'Inter', sans-serif; }
.rl-sem { font-size: 13px; font-weight: 600; color: var(--color-text-muted); font-style: italic; }
.rl-leg { font-style: normal; font-size: 11px; font-weight: 600; color: var(--color-text-muted); }
.rl-etq { font-style: normal; display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--bg-tertiary); color: var(--color-text-muted); }
.rl-etq.rl-ok { background: rgba(16, 185, 129, .14); color: #059669; } .rl-etq.rl-info { background: rgba(56, 189, 248, .14); color: #0284c7; }
.rl-etq.rl-alerta { background: rgba(245, 158, 11, .16); color: #b45309; } .rl-etq.rl-erro { background: rgba(239, 68, 68, .13); color: #dc2626; }
.rl-etq.rl-tipo { background: color-mix(in srgb, var(--rl-cor) 16%, transparent); color: var(--rl-cor); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
:root:not([data-theme="light"]) .rl-etq.rl-ok { color: var(--color-success); } :root:not([data-theme="light"]) .rl-etq.rl-info { color: #7dd3fc; }
:root:not([data-theme="light"]) .rl-etq.rl-alerta { color: #fbbf24; } :root:not([data-theme="light"]) .rl-etq.rl-erro { color: #f87171; }
.rl-prop { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--line-strong); max-width: 320px; margin-bottom: 4px; }
.rl-prop i { height: 100%; min-width: 3px; } .rl-prop i.a { background: #10b981; } .rl-prop i.m { background: #38bdf8; }
@media (max-width: 760px) {
    .rl-linha, .rl-linha.rl-com-b2 { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "a b" "m m" "f f"; gap: 8px 10px; padding: 12px; }
    .rl-linha:not(.rl-com-b2) { grid-template-areas: "a a" "m m" "f f"; }
    .rl-b1 { grid-area: a; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px 8px; align-self: center; padding: 0; border: 0; text-align: left; }
    .rl-b1 span { margin: 0; }
    .rl-b2 { grid-area: b; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2px 8px; align-self: center; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); text-align: left; }
    .rl-b2 b { margin: 0; }
    .rl-main { grid-area: m; }
    .rl-fim { grid-area: f; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
}

/* ============================================================
   33. Acompanhamento (cartão aberto): campos em grupos e itens mais compactos
   ============================================================ */
.ac-grupos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.ac-grupo { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-secondary); min-width: 0; }
.ac-grupo h5 { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-primary); }
.ac-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.ac-g2 .form-group { min-width: 0; }
.ac-g2 .form-group label { font-size: 12px; }
.ac-marcas { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-marcas .checkbox-container { margin: 0 !important; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 12.5px !important; background: var(--bg-primary); cursor: pointer; }
.ac-grupo .pncp-linha { margin: 0; }
.ac-anexo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 8px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 12.5px; color: var(--color-text-muted); }
.ac-anexo > i { font-size: 18px; flex: none; }
.ac-anexo > div { flex: 1; min-width: 0; margin: 0 !important; flex-direction: row !important; align-items: center; gap: 10px !important; flex-wrap: wrap; }
.ac-anexo .text-secondary { font-size: 12px !important; font-weight: 600; }
@media (max-width: 1100px) { .ac-grupos { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .ac-grupos { grid-template-columns: 1fr; } .ac-ident { grid-template-columns: 1fr !important; } }

/* itens: linhas mais baixas e colunas de valor só quando usadas */
.ac-item-row input, .ac-item-row select { height: 34px; }
.ac-item-row { margin-bottom: 4px; padding-top: 2px; padding-bottom: 2px; }
.ac-btn-valores.on { background: var(--accent-glow); border-color: var(--accent-primary); color: var(--accent-primary); }
.ac-sem-valores .ac-item-row, .ac-sem-valores .ac-item-cab { grid-template-columns: 56px minmax(110px, 1fr) 176px 150px 34px; }
.ac-sem-valores .ac-item-u, .ac-sem-valores .ac-item-q, .ac-sem-valores .ac-item-tot,
.ac-sem-valores .ac-item-cab span:nth-child(3), .ac-sem-valores .ac-item-cab span:nth-child(4), .ac-sem-valores .ac-item-cab span:nth-child(5) { display: none; }
.ac-sem-valores .ac-item-cab span:nth-child(6) { text-align: left; }
@media (max-width: 640px) {
    .ac-sem-valores .ac-item-row { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; grid-template-areas: "n desc desc desc" "sit sit sit sit" "pos pos pos rm"; }
}

/* itens ainda mais compactos no computador */
@media (min-width: 641px) {
    .ac-item-row input, .ac-item-row select { height: 30px; font-size: 12.5px; padding: 0 8px; }
    .ac-item-row { margin-bottom: 2px; padding-top: 1px; padding-bottom: 1px; gap: 6px; }
    .ac-item-row .ac-pos-btn, .ac-item-row .ac-item-rm { width: 30px; height: 30px; font-size: 18px; }
    .ac-item-row .ac-pos-ctl { grid-template-columns: 30px minmax(0, 1fr) 30px; }
}
.ac-grupos .ac-grupo:first-child .ac-g2 { grid-template-columns: 1.7fr 1fr; }

/* ============================================================
   34. Habilitação › empresa: cabeçalho com resumo, grupos e linhas com blocos; janela de nova empresa
   ============================================================ */
.hab-empresa-card { padding: 16px 18px; }
.hab-empresa-topo { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 14px; }
.hab-empresa-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 280px; }
.hab-empresa-avatar { width: 48px; height: 48px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #fff; background: var(--accent-secondary); }
.hab-empresa-nome { min-width: 0; }
.hab-empresa-nome h3 { margin: 0; font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.hab-empresa-nome span { display: inline-block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); cursor: pointer; }
.hab-empresa-nome span:hover { color: var(--accent-primary); }
.hab-empresa-resumo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hab-empresa-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.hab-empresa-acoes .btn-primary, .hab-empresa-acoes .btn-secondary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; min-height: 38px; }
.hab-chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--bg-tertiary); color: var(--color-text-muted); }
.hab-chip.erro { background: rgba(239, 68, 68, .13); color: #dc2626; } .hab-chip.alerta { background: rgba(245, 158, 11, .16); color: #b45309; } .hab-chip.ok { background: rgba(16, 185, 129, .14); color: #059669; }
.hab-chip.vazio { font-style: italic; font-weight: 600; opacity: .8; }
:root:not([data-theme="light"]) .hab-chip.erro { color: #f87171; } :root:not([data-theme="light"]) .hab-chip.alerta { color: #fbbf24; } :root:not([data-theme="light"]) .hab-chip.ok { color: var(--color-success); }

.hab-grupo { margin-top: 12px; padding: 0; background: transparent; border: 0; }
.hab-grupo-topo.grupo-header { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 2px; margin: 0 0 6px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.hab-grupo-nome { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hab-grupo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.hab-grupo-topo .grupo-drag-handle { cursor: grab; color: var(--color-text-muted); padding: 2px 6px; display: inline-flex; align-items: center; }
.hab-grupo-topo .grupo-drag-handle i { font-size: 17px; }
table.hab-grupo-tabela, table.hab-grupo-tabela tbody { display: block; width: 100%; border: 0; }
table.hab-grupo-tabela tbody { display: flex; flex-direction: column; gap: 6px; min-height: 12px; }
.hab-linha-dnd { grid-template-columns: 30px 66px 78px minmax(0, 1fr) 150px auto; }
.hab-linha-dnd > td { padding: 0 !important; border: 0 !important; background: none !important; width: auto !important; text-align: left; }
.hab-linha-dnd > td.hab-venc, .hab-linha-dnd > td.hab-prazo { display: flex; }
.hab-linha-dnd > td.drag-handle-cell { display: flex; align-items: center; justify-content: center; cursor: grab; color: var(--color-text-muted); font-size: 18px; }
.hab-linha-dnd > td.hab-acoes { display: flex; }
.hab-linha-dnd.sortable-ghost { opacity: .45; }
.empty-placeholder-row { display: block; }
.empty-placeholder-row > td { display: block; padding: 12px !important; text-align: center; border: 1px dashed var(--line-strong) !important; border-radius: 10px; color: var(--color-text-muted); font-size: 12.5px; font-style: italic; }
@media (max-width: 760px) {
    .hab-linha-dnd { grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "h v" "h p" "m m" "g g" "a a"; }
    .hab-linha-dnd > td.drag-handle-cell { grid-area: h; align-self: start; padding-top: 4px !important; }
    .hab-linha-dnd > td.hab-venc { grid-area: v; } .hab-linha-dnd > td.hab-prazo { grid-area: p; }
    .hab-linha-dnd > td.hab-main { grid-area: m; } .hab-linha-dnd > td.hab-vig { grid-area: g; } .hab-linha-dnd > td.hab-acoes { grid-area: a; justify-content: flex-end; }
}

.hab-nova-titulo { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.hab-nova-titulo i { color: var(--accent-primary); font-size: 24px; }
.hab-nova-dica { margin: 0 0 16px; font-size: 12.5px; color: var(--color-text-muted); }
.hab-nova-ajuda { display: block; margin-top: 5px; font-size: 11.5px; color: var(--color-text-muted); }
.hab-nova-ajuda.erro { color: var(--color-danger); font-weight: 600; }
.hab-nova-acoes { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ============================================================
   35. Estatísticas: indicadores compactos, gráficos lado a lado com ranking, segmentos em cartões
   ============================================================ */
@media (min-width: 1100px) {
    .est-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
    .est-kpis .acomp-kpi:nth-child(4) { grid-column: span 2; }
}
@media (min-width: 700px) and (max-width: 1099px) { .est-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.est-kpis .acomp-kpi { padding: 10px 14px; gap: 10px; }
.est-kpis .acomp-kpi > div { min-width: 0; }
.est-kpis .acomp-kpi-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
.est-kpis .acomp-kpi-label { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-kpis .acomp-kpi-value { font-size: 20px !important; line-height: 1.15; white-space: nowrap; }

.est-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1250px) { .est-grade { grid-template-columns: 1fr 1fr; } .est-grade .est-card:last-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .est-grade { grid-template-columns: 1fr; } }
.est-card .ed-h4 { margin-bottom: 12px; }
.est-rank { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 11px; }
.est-pos { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--bg-tertiary); color: var(--color-text-muted); }
.est-rank:first-child .est-pos { background: var(--accent-glow); color: var(--accent-primary); }
.est-rank-topo { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 13px; }
.est-rank-topo span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.est-rank-topo b { font-weight: 800; white-space: nowrap; }
.est-bar { height: 8px; border-radius: 99px; background: var(--bg-tertiary); overflow: hidden; }
.est-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent-primary); }
.est-bar i.cor-ciano { background: #2dd4bf; } .est-bar i.cor-roxo { background: #8b7cf6; } .est-bar i.cor-azul { background: #38bdf8; }
.est-share { font-size: 12px; font-weight: 700; color: var(--color-text-muted); min-width: 34px; text-align: right; }

.est-rosca-box { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.est-rosca { width: 128px; height: 128px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; }
.est-rosca > div { width: 82px; height: 82px; border-radius: 50%; background: var(--bg-secondary); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.est-rosca b { font-size: 20px; font-weight: 800; } .est-rosca span { font-size: 10.5px; font-weight: 600; color: var(--color-text-muted); }
.est-legenda { list-style: none; margin: 0; padding: 0; flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.est-legenda li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 34px; align-items: center; gap: 8px; font-size: 12.5px; }
.est-legenda i { width: 10px; height: 10px; border-radius: 50%; }
.est-legenda span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-legenda b { font-weight: 800; } .est-legenda em { font-style: normal; color: var(--color-text-muted); font-weight: 600; text-align: right; }

.est-segs-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.est-segs { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.est-seg { margin: 0 !important; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-secondary); display: flex; flex-direction: column; gap: 8px; }
.est-seg-topo { display: flex; gap: 8px; align-items: center; }
.est-seg-topo input { font-weight: 700; flex: 1; min-width: 0; }
.est-seg-total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--color-text-muted); }
.est-seg-total b { font-size: 16px; font-weight: 800; color: var(--color-text-main); font-family: 'Inter', sans-serif; }
@media (max-width: 760px) { .est-segs { grid-template-columns: 1fr; } }
.est-kpis .acomp-kpi-label { letter-spacing: .03em; }
@media (max-width: 699px) { .est-kpis .acomp-kpi:nth-child(4) { grid-column: span 2; order: 6; } .est-kpis .acomp-kpi:nth-child(5) { grid-column: auto; } }

/* ============================================================
   36. Licitações do Dia: topo enxuto, barra de filtros com listas suspensas e cartão com bloco de data/pregão
   ============================================================ */
/* topo */
.ed-topo2 { padding: 12px 16px; }
.ed-t-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ed-t-campo { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); margin: 0; }
.ed-t-campo input { height: 36px; width: 148px; padding: 0 10px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); text-transform: none; letter-spacing: 0; }
.ed-t-status { flex: 1 1 220px; min-width: 0; margin: 0; min-height: 0; font-size: 12.5px; }
.ed-t-botoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ed-t-lote { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.ed-t-lote:empty { display: none; }
.ed-topo2 .ed-progresso { margin: 10px 0 0; }
.ed-topo2 .ed-abrangencia { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; margin: 12px 0 0; padding: 10px 0 0; }
.ed-topo2 .ed-abrangencia summary { align-items: center; flex-wrap: nowrap; gap: 8px; }
.ed-topo2 .ed-abrangencia summary i { font-size: 17px; color: var(--accent-primary); }
.ed-topo2 .ed-abrangencia summary .ed-dica { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-abr-alterar { font-size: 12px; font-weight: 700; color: var(--accent-primary); white-space: nowrap; }
.ed-abrangencia[open] .ed-abr-alterar { display: none; }

/* barra de filtros */
.ed-barra { padding: 10px 14px; overflow: visible; position: relative; z-index: 5; }
.ed-barra::after { display: none; }
.ed-b-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ed-b-linha + .ed-b-linha { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ed-b-busca { flex: 1 1 260px; min-width: 0; margin: 0; }
.ed-b-ordem { height: 36px; max-width: 170px; }
.ed-dd { position: relative; }
.ed-dd > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; user-select: none; white-space: nowrap; background: transparent; }
.ed-dd > summary::-webkit-details-marker { display: none; }
.ed-dd > summary:hover { color: var(--color-text-main); border-color: var(--accent-primary); }
.ed-dd > summary > i:first-child { font-size: 16px; }
.ed-dd-seta { font-size: 16px; transition: transform var(--trans-fast); }
.ed-dd[open] > summary { border-color: var(--accent-primary); color: var(--color-text-main); }
.ed-dd[open] .ed-dd-seta { transform: rotate(180deg); }
.ed-dd.ativo > summary { background: var(--accent-glow); border-color: var(--accent-primary); color: var(--accent-primary); }
.ed-dd-n { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 99px; background: var(--accent-primary); color: #fff; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.ed-dd-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(var(--ed-dd-larg, 340px), 86vw); max-height: 60vh; overflow: auto; padding: 12px; background: var(--bg-secondary); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.ed-dd-pop-dir { left: auto; right: 0; }
.ed-dd-rodape { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.ed-dd-valor { display: flex; align-items: center; gap: 8px; }
.ed-dd-ir-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-dd-pop .ed-input-solo { height: 36px; }
.ed-b-srp { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.ed-b-srp > span { font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-right: 2px; }
.ed-b-limpar { white-space: nowrap; }

/* cartão */
.ed-card2 { display: grid; grid-template-columns: 74px 112px minmax(0, 1fr) 250px; gap: 4px 16px; align-items: stretch; padding: 12px 16px 12px 20px; margin-bottom: 8px; overflow: visible; background-image: linear-gradient(90deg, rgba(var(--ed-cor), 0.12), transparent 55%); }
.ed-card.ed-card2::before, .ed-card.ed-card2:hover::before, .ed-card.ed-card2:nth-child(n)::before { display: block; content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; height: auto; opacity: 1; transition: none; border-radius: 12px 0 0 12px; background: rgb(var(--ed-cor)) !important; }
.ed-c-data, .ed-c-preg { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; line-height: 1.15; min-width: 0; padding-right: 14px; border-right: 1px solid var(--line); }
.ed-c-data small, .ed-c-preg small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.ed-c-data small { color: rgb(var(--ed-cor)); }
.ed-c-data b { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--color-text-main); }
.ed-c-data span { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.ed-c-preg b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; max-width: 100%; overflow-wrap: anywhere; }
.ed-c-preg span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.ed-c-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ed-c-orgao strong { font-size: 14.5px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.ed-c-local { font-size: 12.5px; color: var(--color-text-muted); line-height: 1.35; overflow-wrap: anywhere; }
.ed-card2 .ed-objeto { margin: 2px 0 4px; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ed-c-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.ed-c-valor { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px; font-size: 14px; font-weight: 800; color: var(--color-text-main); background: var(--bg-tertiary); border: 1px solid var(--line); white-space: nowrap; }
.ed-c-valor i { font-size: 16px; color: var(--color-success); }
.ed-c-valor.sem { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.ed-c-valor.sem i { color: var(--color-text-muted); }
.ed-c-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--color-text-main); border: 1px solid var(--line); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ed-c-pill small { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.ed-c-pill i { color: var(--color-text-muted); }
.ed-c-portal { color: var(--color-text-muted); }
.ed-card2 .ed-chips-des { margin: 6px 0 0; }
.ed-c-lado { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; min-width: 0; }
.ed-c-selos { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ed-c-selos .status-badge { max-width: 100%; }
.ed-c-acoes { border: 0; padding: 0; justify-content: flex-end; }
.ed-multi { position: relative; }
.ed-multi > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ed-multi > summary::-webkit-details-marker { display: none; }
.ed-multi-pop { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 240px; max-height: 260px; overflow: auto; padding: 10px; }
.ed-multi-pop label { display: flex; gap: 8px; align-items: center; padding: 4px 2px; font-size: 13px; cursor: pointer; }

@media (max-width: 900px) {
    .ed-card2 { grid-template-columns: 74px 112px minmax(0, 1fr); }
    .ed-c-lado { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
    .ed-c-selos { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .ed-t-campo { flex: 1 1 140px; }
    .ed-t-campo input { flex: 1; width: auto; min-width: 0; }
    .ed-t-botoes { width: 100%; margin-left: 0; }
    .ed-t-botoes .btn-primary { flex: 1; }
    .ed-b-ordem { max-width: none; flex: 1 1 100%; }
    .ed-dd { position: static; }
    .ed-barra { position: relative; }
    .ed-dd-pop, .ed-dd-pop-dir { left: 12px; right: 12px; width: auto; }
    .ed-card2 { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px 12px 18px; }
    .ed-c-data { grid-column: 1; padding-right: 12px; }
    .ed-c-preg { grid-column: 2; align-items: flex-start; text-align: left; border-right: 0; padding-right: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-content: center; gap: 2px 10px; }
    .ed-c-preg small { width: 100%; }
    .ed-c-main, .ed-c-lado { grid-column: 1 / -1; }
    .ed-c-main { padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
    .ed-multi-pop { right: auto; left: 0; }
}

/* ============================================================
   37. Busca por Objeto: busca + filtros + resumo numa barra só
   ============================================================ */
.ed-obj-barra { padding: 12px 16px; }
.ed-obj-barra form.ed-b-linha { margin: 0; }
.ed-obj-linha2 { align-items: center; }
.ed-obj-resumo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; flex: 1 1 320px; }
.ed-obj-resumo b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--color-text-main); }
.ed-obj-resumo span { font-size: 14px; font-weight: 600; color: var(--color-text-main); }
.ed-obj-resumo small { flex-basis: 100%; font-size: 12px; color: var(--color-text-muted); }
.ed-obj-filtros { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-obj-filtros .ed-para { height: 36px; }
.ed-obj-filtros .acomp-chip { height: 36px; display: inline-flex; align-items: center; margin: 0; }
@media (max-width: 640px) {
    .ed-obj-resumo b { font-size: 22px; }
    .ed-obj-filtros { width: 100%; }
    .ed-obj-filtros .acomp-chip { order: 3; flex: 1 1 100%; }
    .ed-obj-filtros .ed-para { flex: 1 1 130px; width: auto; min-width: 0; max-width: none !important; }
}

/* ============================================================
   38. Baixar licitação: formulário + andamento em duas colunas
   ============================================================ */
.bx-grade { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.bx-grade > .card { margin-bottom: 0; }
.bx-titulo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.bx-titulo i { font-size: 20px; color: var(--accent-primary); }
.bx-ajuda { margin: 0 0 14px; line-height: 1.45; }
.bx-form .form-group { margin-bottom: 12px; }
.bx-form textarea { width: 100%; font-family: inherit; min-height: 150px; resize: vertical; }
.bx-form .ed-para { max-width: 100%; width: 100%; height: 38px; }
.bx-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.bx-botoes .btn-primary { flex: 1; justify-content: center; }
.bx-rodape { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.45; }
.bx-lado { min-height: 220px; }
.bx-vazio { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 28px 12px; }
.bx-vazio i { font-size: 38px; color: var(--color-text-muted); }
.bx-vazio h4 { margin: 4px 0 0; font-size: 15px; }
.bx-vazio p { max-width: 380px; margin: 0; font-size: 13px; line-height: 1.5; }
.bx-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.bx-cab-t { font-size: 15px; }
.bx-cab-t strong { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.bx-barra { margin: 0 0 14px; }
.bx-linhas { display: flex; flex-direction: column; gap: 6px; }
.bx-linha { --bx-cor: 156, 163, 175; position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 9px 14px 9px 18px; background: var(--bg-secondary); background-image: linear-gradient(90deg, rgba(var(--bx-cor), 0.1), transparent 50%); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bx-linha::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: rgb(var(--bx-cor)); }
.bx-linha.buscando, .bx-linha.baixando, .bx-linha.relatorio { --bx-cor: 56, 189, 248; }
.bx-linha.pronto { --bx-cor: 52, 211, 153; }
.bx-linha.erro { --bx-cor: 248, 113, 113; }
.bx-preg { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; padding-right: 12px; border-right: 1px solid var(--line); min-width: 0; }
.bx-preg small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.bx-preg b { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.bx-preg span { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.bx-msg { font-size: 13px; line-height: 1.4; color: var(--color-text-muted); overflow-wrap: anywhere; min-width: 0; }
.bx-linha.erro .bx-msg { color: var(--color-danger); }
.bx-estado { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; background: rgba(var(--bx-cor), 0.16); color: rgb(var(--bx-cor)); }
.bx-resumo { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--bg-tertiary); font-size: 13.5px; font-weight: 700; }
@media (max-width: 900px) { .bx-grade { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .bx-linha { grid-template-columns: 1fr auto; padding: 10px 12px 10px 16px; }
    .bx-preg { border-right: 0; padding-right: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
    .bx-preg small { width: 100%; }
    .bx-msg { grid-column: 1 / -1; }
    .bx-estado { grid-row: 1; grid-column: 2; }
}

/* ============================================================
   39. Empresas: abas compactas, cabeçalho em cartão e "pego por" em chips
   ============================================================ */
.emp-barra { display: flex; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.emp-abas { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.emp-abas .emp-aba { flex: none; white-space: nowrap; padding: 6px 12px; font-size: 12.5px; gap: 7px; }
.emp-abas .emp-aba b { padding: 0 7px; font-size: 11.5px; }
.emp-barra-btns { display: flex; gap: 8px; flex: none; }
.emp-cab { padding: 14px 16px; }
.emp-cab-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.emp-cab-nome { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emp-avatar { width: 42px; height: 42px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ef5a3b, #e1407a); }
.emp-cab-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.emp-cab-txt h3 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.emp-cab-n { font-size: 12.5px; color: var(--color-text-muted); }
.emp-cab-n b { font-size: 14px; color: var(--color-text-main); }
.emp-cab-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.emp-cab-filtro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.emp-cab-pasta { margin-top: 10px; font-size: 12.5px; color: var(--color-text-muted); display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.emp-cab-pasta i { font-size: 16px; color: var(--color-warning); }
.emp-cab-pasta.sem { font-style: italic; }
.emp-cab .ed-status { margin-top: 0; min-height: 0; }
.emp-cab .ed-status:not(:empty) { margin-top: 8px; }
#des-painel .ed-aviso { margin: 0 0 12px; padding: 9px 14px; font-size: 12.5px; }
#des-painel .ed-resumo { margin: 4px 0 10px; }
/* "pego por": chips pequenos em vez de caixa colorida */
.ed-casou { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin: 2px 0 6px; padding: 0; background: transparent; font-size: 12px; }
.ed-casou-r { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.ed-casou-r i { font-size: 14px; color: var(--accent-primary); }
.ed-casou-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 9px; border-radius: 99px; background: var(--accent-glow); border: 1px solid var(--accent-primary); font-size: 12px; }
.ed-casou-chip b { font-weight: 800; color: var(--accent-primary); }
.ed-casou-chip small { font-size: 10.5px; color: var(--color-text-muted); font-weight: 600; }
.ed-casou-chip.item { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.55); }
.ed-casou-chip.item b { color: #38bdf8; }
[data-theme="light"] .ed-casou-chip.item b { color: #0284c7; }
@media (max-width: 760px) {
    .emp-barra { flex-direction: column; align-items: stretch; }
    .emp-barra-btns .btn-secondary { flex: 1; justify-content: center; }
    .emp-cab-acoes { width: 100%; }
    .emp-cab-acoes .btn-sm { flex: 1 1 calc(50% - 8px); justify-content: center; }
}
@media (max-width: 640px) {
    .ed-c-lado .ed-c-acoes { width: 100%; justify-content: stretch; }
    .ed-c-acoes > a, .ed-c-acoes > button, .ed-c-acoes > details { flex: 1 1 calc(50% - 8px); justify-content: center; text-align: center; }
    .ed-c-acoes .ed-multi > summary { width: 100%; justify-content: center; }
}


/* Acompanhamento: itens individuais dentro de um grupo (a soma deles é o total do grupo) */
.ac-sub { grid-column: 1 / -1; flex: 0 0 100%; margin: 2px 0 4px 28px; padding: 8px 10px; border-left: 2px dashed var(--line-strong); background: rgba(255, 255, 255, 0.02); border-radius: 8px; }
.ac-sub[hidden] { display: none; }
.ac-sub-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); }
.ac-sub-topo em { font-weight: 500; font-style: normal; opacity: .85; }
.ac-sub-topo .btn-sm:first-of-type { margin-left: auto; }
.ac-sub-row { display: grid; grid-template-columns: 44px minmax(110px, 1fr) 100px 76px 118px 34px; gap: 8px; align-items: center; margin-bottom: 4px; }
.ac-sub-row input { height: 34px; }
.ac-sub-n { text-align: center; font-weight: 700; }
.ac-sub-u, .ac-sub-q { text-align: right; }
.ac-sub-tot { text-align: right; font-weight: 700; font-size: 13px; white-space: nowrap; padding-right: 4px; }
.ac-sem-valores .ac-sub-row { grid-template-columns: 44px minmax(110px, 1fr) 34px; }
.ac-sem-valores .ac-sub-u, .ac-sem-valores .ac-sub-q, .ac-sem-valores .ac-sub-tot { display: none; }
.ac-item-row input:disabled { opacity: .55; cursor: not-allowed; }
.ac-item-ro-sub { opacity: .85; padding-left: 14px; }
@media (max-width: 640px) {
    .ac-sub { margin-left: 0; }
    .ac-sub-row { display: flex; flex-wrap: wrap; }
    .ac-sub-row .ac-sub-n { flex: 0 0 44px; } .ac-sub-row .ac-sub-desc { flex: 1 1 160px; min-width: 0; }
    .ac-sub-row .ac-sub-u { flex: 0 0 110px; } .ac-sub-row .ac-sub-q { flex: 0 0 84px; } .ac-sub-row .ac-sub-tot { flex: 1 1 100px; text-align: left; }
}

/* Acompanhamento: posição lida do ComprasNet ao lado de cada item (serviço de sincronização) */
.ac-cn { grid-column: 1 / -1; flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 2px 4px; padding: 3px 10px; font-size: 12px; border-radius: 7px; color: var(--color-text-muted); background: rgba(255, 255, 255, 0.03); }
.ac-cn:empty { display: none; }
.ac-cn i { font-size: 14px; }
.ac-cn em { font-style: normal; }
/* azul (informação do ComprasNet): verde é item ganho e vermelho é desclassificado */
.ac-cn.ok { color: var(--color-info, #60a5fa); background: rgba(96, 165, 250, 0.10); }
[data-theme="light"] .ac-cn.ok { color: #2563eb; background: rgba(37, 99, 235, 0.07); }
/* dentro da caixa verde (1º lugar) a faixa acompanha o verde; dentro da vermelha (desclassificado), o vermelho */
.ac-item-row.rk-1 .ac-cn.ok { color: var(--color-success); background: rgba(52, 211, 153, 0.14); }
.ac-item-row.rk-desc .ac-cn.ok { color: var(--color-danger, #f87171); background: rgba(248, 113, 113, 0.14); }
[data-theme="light"] .ac-item-row.rk-1 .ac-cn.ok { color: #047857; background: rgba(16, 185, 129, 0.14); }
[data-theme="light"] .ac-item-row.rk-desc .ac-cn.ok { color: #b91c1c; background: rgba(239, 68, 68, 0.10); }
.ac-cn.dif { color: var(--color-warning); background: rgba(245, 158, 11, 0.12); }
.ac-cn.dif b { color: var(--color-text-main); }
.ac-cn button { padding: 2px 10px; min-height: 0; height: 24px; font-size: 12px; }

/* Sincronização: andamento (0-100%) */
.sync-prog { background: var(--bg-secondary); border: 1px solid var(--line); border-radius: var(--border-radius-lg); padding: 14px 16px; margin: 0 0 12px; }
.sync-prog-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.sync-prog-topo strong { font-size: 15px; }
.sync-prog-topo span { font-size: 12.5px; color: var(--color-text-muted); }
.sync-barra { height: 10px; border-radius: 999px; background: rgba(148, 163, 184, 0.22); overflow: hidden; }
.sync-barra > i { display: block; height: 100%; border-radius: 999px; background: var(--color-success); transition: width .6s ease; }
.sync-barra.andando > i { background: var(--color-warning); }
.sync-prog-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; margin-top: 12px; }
.sync-prog-emp { font-size: 12px; }
.sync-prog-emp .linha { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.sync-prog-emp .linha b { white-space: nowrap; }
.sync-prog-emp .etapa { color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sync-prog-emp .sync-barra { height: 6px; }

/* ---- Monitoramento: licitações à esquerda, chat à direita ---- */
.mon-grade { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.mon-lista, .mon-chat { background: var(--bg-secondary); border: 1px solid var(--line); border-radius: var(--border-radius-lg); overflow: hidden; }
.mon-lista { max-height: calc(100vh - 280px); min-height: 320px; overflow-y: auto; }
.mon-lista-cab, .mon-lic { display: grid; grid-template-columns: 14px minmax(0, 1.3fr) 64px 92px 34px; gap: 8px; align-items: center; padding: 9px 12px; }
.mon-lista-cab { position: sticky; top: 0; z-index: 1; background: var(--bg-tertiary); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted); }
.mon-lic { cursor: pointer; border-top: 1px solid var(--line); font-size: 13px; }
.mon-lic:hover { background: var(--bg-tertiary); }
.mon-lic.on { background: var(--accent-glow); box-shadow: inset 3px 0 0 var(--accent-primary); }
.mon-lic-num { min-width: 0; } .mon-lic-num .ed-dica { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-lic-data { font-size: 12px; color: var(--color-text-muted); }
.mon-qtd { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--accent-primary); color: #fff; font-size: 11px; font-weight: 700; }
.mon-portal { color: var(--accent-primary); font-size: 18px; text-align: center; }
.mon-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--color-text-muted); box-sizing: border-box; }
.mon-dot.laranja { background: #f59e0b; border-color: #f59e0b; } .mon-dot.verde { background: var(--color-success); border-color: var(--color-success); }
.mon-chat { display: flex; flex-direction: column; max-height: calc(100vh - 280px); min-height: 320px; }
.mon-chat-topo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mon-abas { display: flex; gap: 18px; flex-wrap: wrap; flex: 1 1 auto; }
.mon-aba { background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 2px; font-size: 14px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; }
.mon-aba b { margin-left: 4px; font-weight: 600; }
.mon-aba.on { color: var(--color-text-main); border-bottom-color: var(--accent-primary); }
.mon-busca { flex: 0 1 260px; min-width: 160px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-primary); color: var(--color-text-main); font-size: 13px; }
.mon-chat-titulo { padding: 8px 14px; font-size: 13px; color: var(--color-text-muted); border-bottom: 1px solid var(--line); }
.mon-chat-corpo { overflow-y: auto; flex: 1 1 auto; }
.mon-msg { display: flex; justify-content: space-between; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.mon-msg.nova { border-left-color: var(--accent-primary); background: var(--bg-tertiary); }
.mon-msg.nova.ocorr { border-left-color: #f59e0b; }
.mon-msg-corpo { min-width: 0; flex: 1 1 auto; } .mon-msg-texto { font-size: 14px; line-height: 1.6; margin-bottom: 4px; overflow-wrap: anywhere; }
.mon-msg-lado { flex: 0 0 auto; text-align: right; font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.mon-link-lida { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--accent-primary); }
.mon-item { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--bg-tertiary); font-size: 11.5px; font-weight: 700; }
.mon-hl { background: #f97316; color: #fff; border-radius: 3px; padding: 0 3px; }
.mon-kw { background: rgba(251, 191, 36, 0.28); color: inherit; border-radius: 3px; padding: 0 2px; }
@media (max-width: 900px) {
    .mon-grade { grid-template-columns: 1fr; }
    .mon-lista { max-height: 260px; min-height: 0; } .mon-chat { max-height: none; min-height: 0; }
    .mon-msg { flex-direction: column; gap: 6px; } .mon-msg-lado { text-align: left; }
}

/* Monitoramento · Sincronização · Credenciais · Envios: barra de filtros, indicadores e detalhes */
.sy-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.sy-barra .sy-busca { flex: 1 1 240px; max-width: 380px; }
.sy-barra .sy-dica { flex: 1 1 320px; font-size: 13px; line-height: 1.45; }
.sy-barra-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.sy-select { height: 38px; min-width: 210px; max-width: 100%; padding: 0 12px; background: var(--bg-primary); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--color-text-main); }
.sy-select:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }
.sy-check { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; font-size: 13px; white-space: nowrap; cursor: pointer; }
.sy-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sy-kpi { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-secondary); }
.sy-kpi i { font-size: 22px; color: var(--color-text-muted); }
.sy-kpi b { display: block; font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sy-kpi span { font-size: 12px; color: var(--color-text-muted); }
.sy-kpi.azul i, .sy-kpi.azul b { color: var(--color-info); }
.sy-kpi.alerta { border-color: rgba(251, 191, 36, 0.45); }
.sy-kpi.alerta i, .sy-kpi.alerta b { color: var(--color-warning); }
.sy-alerta { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 13px; }
.sy-alerta > i { font-size: 20px; flex: none; margin-top: 1px; }
.sy-alerta a { color: inherit; text-decoration: underline; margin-left: 4px; }
/* avisos do robô (sessão caiu / sem sinal): selos pequenos no canto superior direito, só informativos */
.sy-selos { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin: -4px 0 8px; }
.sy-selo { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; text-decoration: none; border: 1px solid; white-space: nowrap; }
.sy-selo i { font-size: 14px; }
.sy-selo.sessao { color: #b45309; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .55); }
.sy-selo.parado { color: var(--color-text-muted); background: var(--bg-secondary); border-color: var(--line); }
.sy-selo:hover { filter: brightness(1.08); }
.table-master tr.sy-importante td { background: rgba(251, 191, 36, 0.13); }
.table-master tr.sy-importante td:first-child { box-shadow: inset 3px 0 0 var(--color-warning); }
.table-master tr.mon-nao-lida td:first-child { font-weight: 700; }
.sy-texto { line-height: 1.5; overflow-wrap: anywhere; min-width: 240px; }
.sy-acoes { white-space: nowrap; text-align: right; }
.sy-acoes .btn-sm + .btn-sm, .sy-acoes button + button { margin-left: 6px; }
.table-master tr.sy-grupo td { background: var(--bg-tertiary); padding: 9px 14px; font-size: 13px; }
.table-master tr.sy-grupo:hover td { background: var(--bg-tertiary) !important; }
.sy-item { padding-left: 24px !important; }
.sy-ponto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; background: var(--color-text-muted); }
.sy-ponto.ok { background: var(--color-success); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.sy-ponto.off { background: var(--color-danger); }
.sy-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.en-chip.erro { background: rgba(248, 113, 113, 0.14); color: var(--color-danger); }
.en-chip.azul { background: rgba(96, 165, 250, 0.14); color: var(--color-info); }
.sy-senha { position: relative; }
.sy-senha input { width: 100%; padding-right: 44px; }
.sy-olho { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--color-text-muted); font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sy-olho:hover { background: var(--bg-tertiary); color: var(--color-text-main); }
.en-dica.en-ok { color: var(--color-success); font-weight: 600; }
.en-dica.en-erro { color: var(--color-danger); font-weight: 600; }
@media (max-width: 640px) {
    .sy-barra .sy-busca, .sy-select { flex: 1 1 100%; max-width: none; min-width: 0; }
    .sy-barra-acoes { margin-left: 0; width: 100%; }
    .sy-barra-acoes .btn-sm { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .sy-kpis { grid-template-columns: 1fr 1fr; }
    .sy-texto { min-width: 0; text-align: left !important; }
    .sy-acoes { text-align: left !important; white-space: normal; display: flex !important; flex-wrap: wrap; gap: 6px; }
    .sy-acoes button + button { margin-left: 0; }
    .sy-item { padding-left: 14px !important; }
    .table-master tr.sy-grupo td { text-align: left !important; }
    .table-master tr.sy-importante td:first-child { box-shadow: none; }
    .table-master tbody tr.sy-importante { border-left: 3px solid var(--color-warning); }
}
/* o style.css esconde toda caixa de marcar fora de .checkbox-container; as do Envios precisam aparecer */
.en-switch input[type="checkbox"], input[type="checkbox"].en-pasta-ck, .en-arq input[type="checkbox"] { display: inline-block; accent-color: var(--accent-primary); cursor: pointer; flex: none; }
.en-switch input[type="checkbox"], .en-arq input[type="checkbox"] { width: 16px; height: 16px; }
.sy-acoes button:disabled, .sy-barra-acoes button:disabled { opacity: .45; cursor: not-allowed; }
#mon-corpo .status-badge { white-space: nowrap; }
.sy-item strong { white-space: nowrap; }
.sy-tabela .status-badge, .sy-tabela td:first-child .ed-dica { white-space: nowrap; }
.mon-dil { display: inline-block; padding: 1px 8px; border-radius: 99px; background: rgba(248, 113, 113, 0.16); color: var(--color-danger); font-size: 11px; font-weight: 700; vertical-align: middle; }
.mon-cita { display: inline-block; padding: 1px 8px; border-radius: 99px; background: rgba(96, 165, 250, 0.16); color: var(--color-info); font-size: 11px; font-weight: 700; }
.en-sujos { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid rgba(251, 191, 36, 0.55); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); font-size: 13px; }
.en-sujos i { color: var(--color-warning); font-size: 18px; }
.en-sujos .btn-sm { margin-left: auto; }
.en-cliente.en-sujo { box-shadow: inset 3px 0 0 var(--color-warning); }
.en-prog { margin: 4px 0 10px; }
.en-prog-txt { font-size: 12.5px; margin-bottom: 4px; color: var(--color-text-main); font-weight: 600; }
.en-conexao .btn-sm { margin: 2px 8px 2px 0; }
.cred-fazer { color: var(--color-text-main); margin-top: 3px; } .cred-fazer i { color: var(--accent-primary); vertical-align: middle; }
.rb-pre { margin: 6px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto; border-radius: 8px; background: var(--bg-primary); border: 1px solid var(--line); font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--color-text-main); }
.rb-console { max-height: 360px; }
.en-card button:disabled, .en-acoes button:disabled { opacity: .45; cursor: not-allowed; }
.rb-diag summary::-webkit-details-marker { color: var(--color-text-muted); } .rb-diag:not([open]) { padding-bottom: 16px; }

/* ---- barra de filtros compacta (Utils.filtroSeg / Utils.filtroSelect): período, empresa e tipo numa linha só ---- */
.fb-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; }
.fb-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--bg-secondary); overflow: hidden; }
.fb-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; background: transparent; color: var(--color-text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fb-seg button + button { border-left: 1px solid var(--line-strong); }
.fb-seg button:hover { color: var(--color-text-main); }
.fb-seg button.on { background: var(--accent-glow); color: var(--accent-primary); }
.fb-seg button b { padding: 0 7px; border-radius: 99px; background: var(--bg-tertiary); color: var(--color-text-main); font-size: 11.5px; }
.fb-seg button.on b { background: var(--accent-primary); color: #fff; }
.fb-seg button i { color: var(--color-warning); }
.fb-sel { height: 34px; max-width: 300px; padding: 0 30px 0 14px; border: 1px solid var(--line-strong); border-radius: 99px; background-color: var(--bg-secondary); color: var(--color-text-main); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fb-sel.on { border-color: var(--accent-primary); color: var(--accent-primary); background-color: var(--accent-glow); }
@media (max-width: 768px) { .fb-seg button { min-height: 38px; } .fb-sel { min-height: 40px; max-width: 100%; flex: 1 1 100%; } }

/* ---- Monitoramento: painel de palavras-chave (clientes com razão social e CNPJ + palavras de atenção) ---- */
.fb-kw { margin: 0 0 12px; border: 1px solid var(--line-strong); border-radius: var(--border-radius-lg, 12px); background: var(--bg-secondary); padding: 8px 14px; }
.fb-kw > summary { cursor: pointer; font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-kw > summary .ed-dica { font-weight: 400; margin: 0; }
.fb-kw-grupo { margin-top: 12px; display: grid; gap: 6px; }
.fb-kw-clientes { display: grid; gap: 4px; max-height: 280px; overflow: auto; }
.fb-kw-cli { display: grid; grid-template-columns: auto minmax(120px, 190px) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.fb-kw-cli span { color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-kw-cli span em { font-style: normal; opacity: .7; }
.fb-kw-cli code { font-size: 12px; }
.fb-kw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-kw-chip { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 99px; overflow: hidden; font-size: 12px; font-weight: 600; }
.fb-kw-chip button { border: 0; background: transparent; color: var(--color-text-muted); padding: 4px 10px; cursor: pointer; text-decoration: line-through; opacity: .7; }
.fb-kw-chip.on { border-color: var(--accent-primary); background: var(--accent-glow); }
.fb-kw-chip.on button { color: var(--accent-primary); text-decoration: none; opacity: 1; }
.fb-kw-chip .x { padding: 4px 8px; text-decoration: none; opacity: .8; }
.fb-kw-add { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-kw-add input { height: 32px; min-width: 220px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--bg-primary, transparent); color: var(--color-text-main); }
@media (max-width: 768px) { .fb-kw-cli { grid-template-columns: auto 1fr; } .fb-kw-cli span, .fb-kw-cli code { grid-column: 2; white-space: normal; } }

/* alarme "empresa chamada" (Monitoramento) */
.mon-alarme { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 0, 0, 0.72); animation: mon-pisca 1s ease-in-out infinite; }
.mon-alarme-card { width: min(640px, 100%); background: #b91c1c; color: #fff; border: 4px solid #fecaca; border-radius: 18px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.mon-alarme-titulo { font-size: 44px; font-weight: 900; letter-spacing: 2px; line-height: 1.1; margin-bottom: 14px; }
.mon-alarme-titulo i { vertical-align: -4px; margin-right: 6px; }
.mon-alarme-item { margin: 12px 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.35); }
.mon-alarme-item:first-of-type { border-top: 0; padding-top: 0; }
.mon-alarme-frase { font-size: 26px; font-weight: 800; line-height: 1.25; word-break: break-word; }
.mon-alarme-det { font-size: 13px; opacity: 0.9; margin-top: 6px; word-break: break-word; }
.mon-alarme-ok { margin-top: 18px; padding: 12px 22px; border: 0; border-radius: 10px; background: #fff; color: #b91c1c; font-size: 16px; font-weight: 800; cursor: pointer; }
@keyframes mon-pisca { 0%, 100% { background: rgba(20, 0, 0, 0.72); } 50% { background: rgba(120, 0, 0, 0.78); } }
@media (max-width: 600px) { .mon-alarme-titulo { font-size: 32px; } .mon-alarme-frase { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .mon-alarme { animation: none; } }

/* ---- Monitoramento: selo "robô conectado" no canto superior direito (fica visível ao rolar) ---- */
.mon-selo-linha { display: flex; justify-content: flex-end; position: sticky; top: 8px; z-index: 30; margin: 0 0 10px; pointer-events: none; }
.mon-selo { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 14px 6px 11px; border-radius: 99px; background: var(--bg-secondary); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .16); font-size: 12.5px; color: var(--color-text-muted); text-decoration: none; white-space: nowrap; }
.mon-selo b { color: var(--color-text-main); font-weight: 700; }
.mon-selo-det { overflow: hidden; text-overflow: ellipsis; }
.mon-selo-ponto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); animation: mon-pulso 2s infinite; }
.mon-selo.ok { border-color: rgba(52, 211, 153, .45); }
.mon-selo.sessao { border-color: rgba(251, 191, 36, .6); background: rgba(251, 191, 36, .12); }
.mon-selo.sessao .mon-selo-ponto { background: var(--color-warning); animation: none; }
.mon-selo.off { border-color: rgba(248, 113, 113, .6); background: rgba(248, 113, 113, .12); }
.mon-selo.off .mon-selo-ponto { background: var(--color-danger); animation: none; }
.mon-selo:hover { filter: brightness(1.08); }
@keyframes mon-pulso { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@media (max-width: 640px) { .mon-selo-linha { justify-content: stretch; } .mon-selo { width: 100%; justify-content: flex-start; font-size: 12px; } }

/* Acompanhamento: filtro "🏆 Venceu item" mostra só os itens arrematados (os outros ficam escondidos, continuam salvos) */
.ac-so-vencidos-aviso { display: none; }
.ac-so-vencidos .ac-nv { display: none !important; }
.ac-so-vencidos .ac-so-vencidos-aviso { display: block; margin: 6px 0 8px; padding: 6px 10px; border-radius: 8px; font-size: 12px;
  background: rgba(16, 185, 129, .10); border: 1px solid rgba(16, 185, 129, .35); }

/* Acompanhamento: botão "Só 1º lugar" dentro da licitação (esconde, não apaga; linhas novas nunca somem) */
.ac-so-1o .ac-item-row[data-salvo]:not(.rk-1) { display: none !important; }
.ac-btn-1o.on { background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .5); }

/* Relatórios: quadros do resumo que filtram a lista (Disputas / Em andamento / Vencidas) */
.acomp-kpi.rl-kpi-filtro { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.acomp-kpi.rl-kpi-filtro:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.acomp-kpi.rl-kpi-filtro.on { border-color: var(--accent-primary); box-shadow: inset 0 0 0 1px var(--accent-primary); }

/* aviso do robô no topo de qualquer tela (app.js checkRobo) */
.robo-alerta-global { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 16px 0; padding: 10px 14px;
    border-radius: 12px; border: 1px solid rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.1); font-size: 13px; }
.robo-alerta-global > i { font-size: 20px; color: #ef4444; }
.robo-alerta-global > span { flex: 1; min-width: 220px; }
.robo-alerta-global a { color: inherit; text-decoration: underline; font-weight: 600; }

/* botão "Robô" no topo: estado em tempo real */
.header-robo { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
    font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: var(--bg-secondary); color: inherit; max-width: 280px; }
.header-robo span { overflow: hidden; text-overflow: ellipsis; }
.header-robo i { font-size: 17px; }
.header-robo.ok i { color: #10b981; }
.header-robo.rodando { border-color: rgba(59, 130, 246, 0.45); } .header-robo.rodando i { color: #3b82f6; }
.header-robo.parado { border-color: rgba(245, 158, 11, 0.5); } .header-robo.parado i { color: #f59e0b; }
.header-robo.erro { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.1); } .header-robo.erro i { color: #ef4444; }
@media (max-width: 760px) { .header-robo span { display: none; } }
