/* =============================================================================
   ComNexis UI v2 — White theme, rebuilt from scratch
   ============================================================================= */

:root {
    /* Superfícies — hierarquia suave (sem branco absoluto em tudo) */
    --white: #ffffff;
    --bg: #e4e9f0;
    --bg-surface: #eef2f7;
    --bg-elevated: #f7f9fc;
    --bg-subtle: #e8edf4;
    --bg-input: #ffffff;

    --border: #cdd5df;
    --border-strong: #b8c2ce;
    --border-soft: #dce3ec;

    --text: #1a2332;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-soft: #dbeafe;
    --brand-border: #93c5fd;
    --brand-muted: #eff6ff;

    --success: #059669;
    --success-soft: #d1fae5;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --canal-verde: #059669;
    --canal-amarelo: #d97706;
    --canal-vermelho: #dc2626;
    --canal-cinza: #64748b;

    --sidebar-w: 240px;
    --header-h: 56px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(26, 35, 50, 0.05);
    --shadow: 0 2px 8px rgba(26, 35, 50, 0.06), 0 1px 2px rgba(26, 35, 50, 0.04);
    --shadow-lg: 0 16px 48px rgba(26, 35, 50, 0.12);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'Consolas', 'Courier New', monospace;
    --ease: 150ms ease;

    /* aliases for JS */
    --bg-app: var(--bg);
    --bg-card: var(--bg-elevated);
    --bg-hover: var(--bg-subtle);
    --border-card: var(--border-soft);
    --text-primary: var(--text);
    --text-main: var(--text);
    --primary: var(--brand);
    --primary-light: var(--brand-muted);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

/* ── App shell ───────────────────────────────────────────────────────────── */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    overflow: hidden;
}

.sidebar-logo {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.sidebar-logo i {
    color: var(--brand);
    font-size: 20px;
}

.sidebar-logo em {
    font-style: normal;
    color: var(--brand);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 16px;
    min-height: 0;
}

.sidebar-help-foot {
    flex-shrink: 0;
    padding: 10px 10px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.sidebar-help-foot a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.sidebar-help-foot a:hover {
    background: var(--bg-subtle);
    color: var(--text);
}
.sidebar-help-foot a.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}
.sidebar-help-foot a i { width: 18px; text-align: center; }

.nav-group-label,
.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 14px 12px 6px;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--ease), color var(--ease);
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0.75;
}

.nav-link:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

.nav-link.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.nav-link.active i { opacity: 1; }

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-logout {
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    transition: background var(--ease);
}

.sidebar-logout:hover {
    background: var(--bg-subtle);
    color: var(--danger);
}

.main-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 12px;
}

.topbar-search i { color: var(--text-muted); font-size: 13px; }

.topbar-search input {
    flex: 1;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    outline: none;
}

.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sandbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--warning-soft);
    border: 1px solid #fde68a;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
}

.page-content {
    flex: 1;
    padding: 16px 20px 24px;
    max-width: none;
    width: 100%;
}

/* Legacy layout aliases — same shell, stable class names for templates */
.app-container { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.content-wrapper { padding: 16px 20px 24px; max-width: none; width: 100%; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin: 0; }
.user-info { display: flex; align-items: center; gap: 10px; width: 100%; }
.brand-icon { color: var(--brand); }
.brand-text em { font-style: normal; color: var(--brand); }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-left: none;
    transition: background var(--ease), color var(--ease);
}

.sidebar-nav a:hover { background: var(--bg-subtle); color: var(--text); }
.sidebar-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: none; }

.sidebar-brand {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.brand-text { font-size: 17px; font-weight: 700; color: var(--text); }

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}

.username { display: block; font-size: 13px; font-weight: 600; }
.role { display: block; font-size: 11px; color: var(--text-muted); }

.top-header {
    height: var(--header-h);
    min-height: var(--header-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: none;
}

.sandbox-banner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    white-space: nowrap;
}

.header-search {
    flex: 1;
    max-width: 420px;
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.header-company-switch {
    min-width: 160px;
    max-width: 240px;
}

.header-company-switch i {
    color: var(--brand);
    flex-shrink: 0;
}

.header-company-switch select {
    max-width: 180px;
    min-width: 120px;
}

.header-user-menu {
    position: relative;
}

.header-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.header-user-trigger:hover,
.header-user-menu.is-open .header-user-trigger {
    border-color: var(--brand-border);
    box-shadow: var(--shadow-sm);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}

.header-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: 140px;
    text-align: left;
}

.header-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.header-user-role {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.header-user-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--ease);
}

.header-user-menu.is-open .header-user-chevron {
    transform: rotate(180deg);
}

.header-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 200;
}

.header-user-menu.is-open .header-user-dropdown {
    display: block;
}

.header-user-dropdown-head {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
}

.header-user-dropdown-head strong {
    display: block;
    font-size: 13px;
}

.header-user-dropdown-head small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    word-break: break-all;
}

.header-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.header-user-dropdown-item:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

.header-user-dropdown-item--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Scrollbars — sidebar e áreas internas */
.sidebar-nav,
.worklist-table-scroll,
.drawer-content.is-scroll,
.table-responsive,
.tv-slide-plan,
.cadastro-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: #b8c2ce transparent;
}

.sidebar-nav::-webkit-scrollbar,
.worklist-table-scroll::-webkit-scrollbar,
.drawer-content.is-scroll::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.content-wrapper::-webkit-scrollbar,
.tv-slide-plan::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sidebar-nav::-webkit-scrollbar-track,
.worklist-table-scroll::-webkit-scrollbar-track,
.drawer-content.is-scroll::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.worklist-table-scroll::-webkit-scrollbar-thumb,
.drawer-content.is-scroll::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.content-wrapper::-webkit-scrollbar-thumb {
    background: #c5cdd8;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover,
.worklist-table-scroll::-webkit-scrollbar-thumb:hover,
.drawer-content.is-scroll::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
}

/* Perfil do usuário */
.profile-panel {
    max-width: 640px;
    padding: 24px;
}

.profile-form .profile-photo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}

.profile-photo-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--brand-border);
}

.profile-photo-initials {
    font-size: 28px;
    font-weight: 800;
}

.profile-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.profile-photo-hint {
    margin-top: 8px;
    font-size: 12px;
}

.current-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1;
}

.current-date i {
    color: var(--text-muted);
    font-size: 14px;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    border: 1px solid transparent;
    line-height: 1;
}

.notification-bell i {
    font-size: 16px;
    pointer-events: none;
}

.notification-bell:hover { background: var(--bg-subtle); color: var(--text); border-color: var(--border); }

.header-search input {
    flex: 1; border: none; background: transparent;
    font: inherit; font-size: 13px; outline: none;
}

.notification-bell .badge {
    display: none;
    position: absolute;
    top: 0; right: 0;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-bell .badge.visible { display: flex; }

.alert-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0;
    z-index: 200;
    overflow: hidden;
}

.alert-dropdown.open { display: block; }

.alert-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-subtle);
}

.alert-dropdown-all {
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
}

.alert-item--link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--ease);
}

.alert-item--link:hover { background: var(--bg-subtle); }
.alert-item--link.critical { border-left: 3px solid var(--danger); }
.alert-item--link.warning { border-left: 3px solid var(--warning); }
.alert-item-msg { flex: 1; line-height: 1.35; }
.alert-item--link i { color: var(--text-muted); font-size: 11px; }

.alert-item {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 4px;
    border-left: 3px solid var(--warning);
    background: var(--warning-soft);
}

.alert-item.critical { border-left-color: var(--danger); background: var(--danger-soft); }

/* ── Typography & page headers ─────────────────────────────────────────────── */

.page-header,
.page-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1,
.page-header-compact h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-header h1 i,
.page-header-compact h1 i {
    color: var(--brand);
    margin-right: 8px;
    font-size: 20px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.box-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.box-title i { color: var(--brand); margin-right: 6px; }

.box-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.view-all-link { font-size: 13px; font-weight: 500; }

/* ── Cards & panels ────────────────────────────────────────────────────────── */

.card,
.glass-panel,
.worklist-card,
.dashboard-box,
.form-container,
.table-container,
.integration-card,
.selector-bar {
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.glass-panel,
.form-container,
.table-container,
.dashboard-box,
.selector-bar,
.integration-card {
    padding: 20px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
    white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: white;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-secondary);
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-subtle);
    color: var(--text);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
}

.btn-icon:hover { background: var(--bg-subtle); color: var(--brand); border-color: var(--brand-border); }

/* ── Forms ─────────────────────────────────────────────────────────────────── */

.comnexis-form label,
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.comnexis-form input,
.comnexis-form select,
.comnexis-form textarea,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.comnexis-form input:focus,
.comnexis-form select:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.form-tip {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-divider {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 12px 0 8px;
    border-top: 1px solid var(--border);
    margin: 8px 0 12px;
}

.split-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}

.split-layout--single {
    grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
    .split-layout { grid-template-columns: 1fr; }
    .form-row, .form-row-three { grid-template-columns: 1fr; }
}

/* ── Cadastros (catálogo / parceiros) ─────────────────────────────────────── */

.cadastro-list-panel {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cadastro-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
}

.cadastro-list-header .box-title { margin: 0; }

.cadastro-list-meta {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.cadastro-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-soft);
}

.cadastro-filter-bar input[type="text"],
.cadastro-filter-bar input[type="search"],
.cadastro-filter-bar select {
    flex: 1;
    min-width: 160px;
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
}

.cadastro-filter-bar select {
    flex: 0 1 180px;
    cursor: pointer;
}

.cadastro-filter-bar input[type="text"]:focus,
.cadastro-filter-bar input[type="search"]:focus,
.cadastro-filter-bar select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.cadastro-filter-bar .btn {
    flex-shrink: 0;
    height: 38px;
}

.cadastro-filter-bar input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.catalog-search-status {
    font-size: 12px;
    padding: 0 20px 8px;
    margin: 0;
}

.audit-filter-bar {
    padding: 12px 16px;
    margin: 0;
    border: none;
    background: transparent;
}

.audit-filter-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.cadastro-table-wrap {
    overflow-x: auto;
}

.cadastro-table-wrap .data-table thead th {
    border-top: none;
}

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

/* ── Tables ────────────────────────────────────────────────────────────────── */

.table-responsive { overflow-x: auto; }

.comnexis-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.comnexis-table thead th,
.data-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

.comnexis-table tbody td,
.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.comnexis-table tbody tr:hover,
.data-table tbody tr:hover { background: var(--bg-subtle); }

.clickable-row { cursor: pointer; }
.row-critical { box-shadow: inset 3px 0 0 var(--danger); }

.no-data, .text-center { text-align: center; }

.ref-code {
    font-weight: 600;
    color: var(--brand);
    font-size: 13px;
}

.ncm-sub { font-size: 11px; display: block; margin-top: 2px; }

.comp-pair { display: flex; flex-direction: column; gap: 0; }
.arrow-sep { font-size: 10px; color: var(--text-muted); }

/* ── Status & badges ───────────────────────────────────────────────────────── */

.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.channel-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-verde { background: var(--success-soft); color: var(--success); }
.badge-amarelo { background: var(--warning-soft); color: var(--warning); }
.badge-vermelho { background: var(--danger-soft); color: var(--danger); }
.badge-cinza { background: var(--bg-subtle); color: var(--text-muted); }

.tax-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.tax-status-badge.pago { background: var(--success-soft); color: var(--success); }
.tax-status-badge.pendente { background: var(--warning-soft); color: var(--warning); }
.tax-status-badge.atrasado { background: var(--danger-soft); color: var(--danger); }

/* ── KPI cards ─────────────────────────────────────────────────────────────── */

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

.kpi-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--ease), border-color var(--ease);
}

.kpi-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.icon-green { background: var(--success-soft); color: var(--success); }
.icon-orange { background: var(--warning-soft); color: var(--warning); }
.icon-red { background: var(--danger-soft); color: var(--danger); }

.kpi-data { min-width: 0; }
.kpi-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-value { display: block; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-subtext { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.critical-pulse { border-color: #fca5a5; }

/* ── Dashboard ─────────────────────────────────────────────────────────────── */

.dashboard-columns {
    display: grid;
    gap: 20px;
}

.channels-list { display: flex; flex-direction: column; gap: 10px; }

.channel-row { display: flex; flex-direction: column; gap: 4px; }

.channel-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.progress-bar-bg {
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
    width: var(--pct, 0%);
}

.fill-verde { background: var(--canal-verde); }
.fill-amarelo { background: var(--canal-amarelo); }
.fill-vermelho { background: var(--canal-vermelho); }
.fill-cinza { background: var(--canal-cinza); }

.process-strip {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--ease);
}

.process-strip:last-child { border-bottom: none; }
.process-strip:hover { background: var(--bg-subtle); }
.process-strip--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.strip-critical { box-shadow: inset 3px 0 0 var(--danger); }

.process-strip-info .ref-code { display: block; }
.ship-details { font-size: 12px; color: var(--text-muted); }

.process-strip-status { display: flex; align-items: center; gap: 8px; }

.channel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}

.channel-dot-verde { background: var(--canal-verde); }
.channel-dot-amarelo { background: var(--canal-amarelo); }
.channel-dot-vermelho { background: var(--canal-vermelho); }
.channel-dot-pending { background: var(--border-strong); opacity: 0.55; }

.process-strip-time { text-align: right; font-size: 12px; }
.time-label { display: block; color: var(--text-muted); font-size: 11px; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { margin-bottom: 16px; }

/* ── Worklist / processes page ─────────────────────────────────────────────── */

.content-wrapper:has(.worklist-page--focused),
.content-wrapper:has(.integrations-page),
.content-wrapper:has(.cadastros-hub),
.content-wrapper:has(.help-page),
.content-wrapper:has(.my-work-page) {
    padding: 12px 16px 16px;
}

.worklist-page {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.worklist-page--focused {
    gap: 10px;
    min-height: calc(100vh - 100px);
}

.worklist-toolbar {
    padding: 10px 14px 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.worklist-toolbar-row--title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.worklist-toolbar-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.worklist-toolbar-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.worklist-toolbar-title h1 i {
    color: var(--brand);
    font-size: 16px;
}

.worklist-count-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    padding: 3px 10px;
    border-radius: 999px;
}

.worklist-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.worklist-kpi-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    transition: max-height 0.25s ease, opacity 0.25s ease, margin 0.25s ease;
    max-height: 48px;
}

.worklist-kpi-strip.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color var(--ease), background var(--ease);
}

button.kpi-pill {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.kpi-pill:hover {
    border-color: var(--brand);
    background: var(--brand-muted);
}

.kpi-pill strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.kpi-pill-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.kpi-pill--danger {
    border-color: #fca5a5;
    background: var(--danger-soft);
}

.kpi-pill--danger strong { color: var(--danger); }

.kpi-pill--warn {
    border-color: #fcd34d;
    background: var(--warning-soft);
}

.kpi-pill--accent {
    border-color: var(--brand);
    background: var(--brand-muted);
}

.kpi-pill--static {
    cursor: default;
    opacity: 0.85;
}

.worklist-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.worklist-filter-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.worklist-search-wrap {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 420px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--white);
    box-sizing: border-box;
    overflow: hidden;
}

.worklist-search-wrap i {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.worklist-search-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    height: 100%;
    min-height: 0;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.2;
    min-width: 0;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
}

.worklist-search-wrap input:focus {
    outline: none;
}

.worklist-search-wrap input[type="search"]::-webkit-search-decoration,
.worklist-search-wrap input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.worklist-filter-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.worklist-per-page-select {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    background: var(--white);
}

.filter-chips-row--inline {
    margin: 0;
    padding: 0;
    border: none;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-chip--sm {
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    padding: 0 12px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    line-height: 1;
    flex-shrink: 0;
}

.filter-active-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--brand);
    margin-left: 4px;
    vertical-align: middle;
}

.worklist-advanced-filters {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px dashed var(--border-soft);
}

.worklist-advanced-filters.is-open {
    display: flex;
}

.worklist-advanced-filters select {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    background: var(--white);
    min-width: 140px;
}

.worklist-clear-filters {
    font-size: 12px;
}

.worklist-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 1280px) {
    .worklist-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .worklist-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.worklist-kpi {
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--ease), border-color var(--ease);
}

.worklist-kpi:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.worklist-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.worklist-kpi-body { min-width: 0; }

.worklist-kpi-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.worklist-kpi-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.worklist-kpi--critical {
    border-color: #fcd34d;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--warning-soft) 100%);
}

.worklist-kpi--critical .worklist-kpi-value { color: var(--danger); }

.worklist-filters {
    padding: 16px 18px;
    margin-bottom: 16px;
}

.worklist-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.worklist-filters-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.filter-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.filter-fields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-fields-row select,
.filter-fields-row input[type="text"] {
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text);
    min-width: 0;
}

.filter-fields-row input[type="text"] {
    flex: 1;
    min-width: 160px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary);
    border: 1px solid var(--border-soft);
    background: var(--bg-input);
    text-decoration: none;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

button.filter-chip {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.filter-chip i { font-size: 10px; opacity: 0.7; }

.filter-chip:hover {
    border-color: var(--brand-border);
    color: var(--brand);
    background: var(--brand-muted);
}

.filter-chip.active {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    color: var(--brand);
    font-weight: 600;
}

.filter-chip--critical.active {
    background: var(--warning-soft);
    border-color: #fcd34d;
    color: #b45309;
}

.active-filters-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.active-filters-hint a { font-weight: 500; }

.worklist-card {
    overflow: hidden;
    padding: 0;
    box-shadow: var(--shadow);
}

.worklist-card--fill {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.worklist-card .table-card-header {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-soft);
}

.worklist-card .comnexis-table thead th {
    background: var(--bg-subtle);
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border-soft);
}

.worklist-card .table-responsive,
.worklist-table-scroll {
    max-height: calc(100vh - 420px);
    min-height: 280px;
    overflow: auto;
}

.worklist-page--focused .worklist-table-scroll {
    flex: 1;
    max-height: calc(100vh - 230px);
    min-height: 360px;
}

.worklist-page--focused .worklist-table {
    font-size: 12.5px;
}

.worklist-page--focused .worklist-table tbody td {
    padding: 8px 10px;
    vertical-align: middle;
}

.worklist-page--focused .worklist-table thead th {
    padding: 8px 10px;
    font-size: 10.5px;
}

.worklist-page--focused .ref-code {
    font-size: 12.5px;
}

.worklist-page--focused .comnexis-table tbody tr.clickable-row {
    cursor: pointer;
}

.worklist-page--focused .pagination-bar {
    flex-shrink: 0;
    border-top: 1px solid var(--border-soft);
}

@media (max-width: 900px) {
    .worklist-filter-primary {
        flex-direction: column;
        align-items: stretch;
    }

    .worklist-search-wrap {
        max-width: none;
    }

    .worklist-toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .worklist-page--focused .worklist-table-scroll {
        max-height: calc(100vh - 280px);
    }
}

.col-pipeline { min-width: 15rem; width: 15rem; }
.col-ref { width: 1%; white-space: nowrap; max-width: 10.5rem; }
.col-parties { min-width: 160px; }
.col-status { width: 110px; }
.col-channel { width: 90px; }
.col-deadline { width: 110px; text-align: right; }
.col-action { width: 44px; text-align: center; }

.comnexis-table tbody tr.clickable-row {
    transition: background var(--ease);
}

.comnexis-table tbody tr.row-critical {
    background: linear-gradient(90deg, var(--danger-soft) 0%, var(--bg-elevated) 12%);
    box-shadow: inset 3px 0 0 var(--danger);
}

.comnexis-table tbody tr.row-critical:hover {
    background: linear-gradient(90deg, #fecaca 0%, var(--bg-subtle) 15%);
}

.parties-main {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.parties-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.direction-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.direction-badge--imp { background: var(--brand-muted); color: var(--brand); }
.direction-badge--exp { background: #d1fae5; color: #047857; }

.deadline-cell { text-align: right; }
.deadline-date { display: block; font-size: 13px; font-weight: 500; }
.deadline-days { display: block; font-size: 11px; color: var(--text-muted); }
.deadline-days.is-critical { color: var(--danger); font-weight: 700; }

.channel-pending {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.worklist-empty {
    padding: 48px 24px;
    text-align: center;
}

.worklist-empty i {
    font-size: 36px;
    color: var(--border-strong);
    margin-bottom: 12px;
}

.worklist-empty p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 14px;
}

/* Status operacionais */
.status-em-trânsito { background: var(--brand-muted); color: var(--brand); }
.status-atracado { background: #e0e7ff; color: #4338ca; }
.status-parametrizado { background: var(--warning-soft); color: #b45309; }
.status-desembaraçado { background: #d1fae5; color: #047857; }
.status-concluído { background: var(--bg-subtle); color: var(--text-muted); }

.process-pipeline.mini .step-dot {
    border-color: var(--bg-elevated);
}

.pipeline-cell { padding-top: 8px !important; padding-bottom: 8px !important; }

/* Worklist — colunas operador / referência / pipeline */
.worklist-table {
    table-layout: auto;
}

.worklist-table .col-operator {
    width: auto;
    min-width: 9.5rem;
    max-width: 14rem;
}

.worklist-table .col-ref {
    width: 1%;
    white-space: nowrap;
    max-width: 10.5rem;
}

.worklist-table .col-ref .ref-code {
    font-size: 12px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.worklist-table .col-ref .ncm-sub {
    display: block;
    max-width: 10.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.worklist-table .col-pipeline {
    min-width: 16rem;
    width: 16rem;
}

.worklist-table .operator-name {
    max-width: 9.5rem;
}

.worklist-table .pipeline-cell {
    padding: 8px 10px !important;
    vertical-align: middle;
}

.worklist-table .process-pipeline.mini.worklist-pipeline,
.worklist-table .process-pipeline.mini {
    padding: 8px 10px 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 83, 134, 0.1), rgba(226, 151, 46, 0.06));
    border: 1.5px solid rgba(0, 83, 134, 0.28);
    gap: 0;
}

.worklist-table .process-pipeline.mini .step-dot {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.worklist-table .process-pipeline.mini .pipeline-step:not(:last-child)::after {
    top: 6px;
    height: 3px;
    background: rgba(0, 83, 134, 0.22);
}

.worklist-table .process-pipeline.mini .pipeline-step.completed:not(:last-child)::after {
    background: var(--brand);
}

.worklist-table .process-pipeline.mini .step-label {
    font-size: 10px;
    font-weight: 600;
    margin-top: 5px;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
}

.worklist-table .process-pipeline.mini .pipeline-step.active .step-dot {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.worklist-table .process-pipeline.mini .pipeline-step.active .step-label {
    color: var(--brand);
    font-weight: 800;
}

.worklist-table .process-pipeline.mini .pipeline-step.completed .step-label {
    color: var(--text-secondary);
}

/* Legacy aliases */
.worklist-stats { display: none; }
.stat-chip { display: none; }
.filter-bar { display: none; }

.process-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-form-section {
    margin-bottom: 8px;
}

@media (max-width: 1024px) {
    .worklist-card .table-responsive {
        max-height: none;
    }

    .col-pipeline { min-width: 13rem; width: 13rem; }

    .worklist-table .col-pipeline {
        min-width: 14rem;
        width: 14rem;
    }

    .worklist-table .col-operator {
        min-width: 8rem;
        max-width: 11rem;
    }

    .worklist-table .operator-name {
        max-width: 7rem;
    }
}

/* ── Pipeline ──────────────────────────────────────────────────────────────── */

.process-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
}

.process-pipeline.mini { gap: 0; }

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 0;
}

.pipeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.pipeline-step.completed:not(:last-child)::after { background: var(--brand); }

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
    border: 2px solid var(--white);
    position: relative;
    z-index: 1;
}

.pipeline-step.completed .step-dot { background: var(--brand); }
.pipeline-step.active .step-dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.step-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pipeline-step.active .step-label { color: var(--brand); font-weight: 600; }
.pipeline-step.completed .step-label { color: var(--text-secondary); }

.process-pipeline:not(.mini) { padding: 12px 0; }

/* Pipeline em destaque na ficha (hero) — compacto para liberar abas */
.drawer-pipeline-panel {
    margin: 8px 0 10px;
    padding: 10px 12px 8px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(0, 83, 134, 0.12), rgba(226, 151, 46, 0.08)),
        var(--surface, #fff);
    border: 1.5px solid rgba(0, 83, 134, 0.32);
}
.drawer-pipeline-panel.is-alert {
    border-color: rgba(185, 28, 28, 0.4);
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.07), rgba(226, 151, 46, 0.07));
}
.drawer-pipeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.drawer-pipeline-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--brand, #005386);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.drawer-pipeline-title i { margin-right: 5px; }
.drawer-pipeline-next {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 62%;
    text-align: right;
    line-height: 1.3;
}
.drawer-pipeline-next i {
    color: var(--accent, #e2972e);
    margin-right: 4px;
}
.drawer-pipeline-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.drawer-pipeline-meta {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
}
.drawer-pipeline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.drawer-stage-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 83, 134, 0.18);
}
.drawer-stage-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-secondary);
    background: rgba(0, 83, 134, 0.06);
    border: 1px solid rgba(0, 83, 134, 0.12);
}
.drawer-pipeline-panel .process-pipeline {
    padding: 4px 2px 2px;
}
.drawer-pipeline-panel .process-pipeline.mini .step-dot,
.drawer-pipeline-panel .step-dot {
    width: 12px;
    height: 12px;
}
.drawer-pipeline-panel .pipeline-step:not(:last-child)::after {
    top: 5px;
    height: 2px;
}
.drawer-pipeline-panel .step-label {
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
}
.drawer-pipeline-panel .pipeline-step.active .step-dot {
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.drawer-next-action-card {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-soft, #e5e7eb);
    background: var(--bg-subtle, #f8fafc);
}
.drawer-next-action-card.is-alert {
    border-color: #fca5a5;
    background: #fef2f2;
}
.drawer-next-action-text {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.next-action-cell {
    max-width: 11rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.next-action-cell.is-alert .next-action-text { color: #b91c1c; font-weight: 600; }
.next-action-text {
    font-size: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.next-action-sla { font-size: 10px; color: var(--text-muted); }

/* ── Drawer ────────────────────────────────────────────────────────────────── */

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 350;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.detail-drawer {
    position: fixed;
    top: 0;
    right: -1000px;
    width: min(960px, 96vw);
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 360;
    display: flex;
    flex-direction: column;
    transition: right 0.28s ease, width 0.28s ease;
}

.detail-drawer.is-wide {
    width: min(1100px, 98vw);
    right: -1140px;
}

.detail-drawer.is-wide.open,
.detail-drawer.open { right: 0; }

.drawer-breadcrumb {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 0 2px;
    line-height: 1.35;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.drawer-breadcrumb a {
    color: var(--brand);
    text-decoration: none;
}

.drawer-breadcrumb a:hover { text-decoration: underline; }

.drawer-title-block { min-width: 0; flex: 1; }

.panel-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.panel-identity-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--brand-muted);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.panel-identity-body {
    min-width: 0;
    flex: 1;
}

.panel-identity-kicker {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand);
}

.drawer-title-ref {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.drawer-subtitle-ref {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.drawer-hero {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.drawer-hero.is-visible { display: block; }

.drawer-hero-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.drawer-hero-badges .status-tag,
.drawer-hero-badges .direction-badge,
.drawer-hero-badges .channel-badge,
.drawer-hero-badges .badge-vermelho,
.drawer-hero-badges .badge-amarelo,
.drawer-hero-badges .operator-hero-badge {
    font-size: 11px;
    line-height: 1.3;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.drawer-hero-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-soft);
}

@media (max-width: 720px) {
    .drawer-hero-grid { grid-template-columns: 1fr 1fr; }
}

.drawer-hero-item label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 1px;
}

.drawer-hero-item span {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-footer {
    display: none;
    padding: 12px 20px;
    border-top: 1px solid var(--border-soft);
    background: var(--bg-subtle);
    gap: 8px;
    flex-wrap: wrap;
}

.drawer-footer.is-visible {
    display: flex;
    align-items: center;
}

.drawer-footer .drawer-footer-spacer { flex: 1; }

.header-cta-btn {
    white-space: nowrap;
    text-decoration: none;
}

.sidebar-nav a {
    position: relative;
}

.nav-badge {
    display: none;
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.nav-badge.visible { display: inline-block; }

.drawer-header h3 { font-size: 15px; font-weight: 600; }

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.drawer-tabs {
    display: flex;
    width: 100%;
    margin-top: 8px;
    border-bottom: 1px solid var(--border-soft);
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 0;
    scrollbar-width: none;
    position: sticky;
    bottom: 0;
    background: var(--bg-subtle);
    z-index: 2;
}

.drawer-tabs::-webkit-scrollbar { display: none; }

.drawer-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 10px;
    margin-right: 2px;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.drawer-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.detail-section { margin-bottom: 20px; }

.detail-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.detail-field { font-size: 13px; }
.detail-field.span-2 { grid-column: span 2; }
.detail-field .lbl { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.detail-field .val { color: var(--text); }

.process-timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-step {
    padding: 10px 0 10px 16px;
    border-left: 2px solid var(--border);
    margin-left: 6px;
    position: relative;
}

.timeline-step.done { border-left-color: var(--brand); }
.timeline-step.current { border-left-color: var(--brand); background: var(--brand-soft); margin-left: 0; padding-left: 22px; border-radius: 0 6px 6px 0; }

.step-title { display: block; font-weight: 600; font-size: 13px; }
.step-desc { display: block; font-size: 12px; color: var(--text-muted); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    z-index: 400;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal-panel {
    width: 100%;
    max-width: 720px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header--identity {
    align-items: flex-start;
    gap: 12px;
}

.modal-header--identity .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.modal-header--identity .panel-identity {
    flex: 1;
    min-width: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

/* ── Integrations ──────────────────────────────────────────────────────────── */

.integrations-container { display: flex; flex-direction: column; gap: 20px; }

/* Integrations page — layout worklist + painel lateral */
.integrations-page .integrations-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 42%);
    gap: 10px;
    min-height: calc(100vh - 220px);
    align-items: stretch;
}

.integrations-table-panel {
    min-height: 0;
}

.integrations-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.integration-detail-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
}

.integration-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.integration-detail-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    font-family: var(--mono);
}

.integration-detail-actions {
    flex-shrink: 0;
}

.integrations-mode-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.integrations-filter-bar {
    margin-top: 0;
}
.integrations-filter-bar .worklist-filter-primary {
    align-items: center;
    flex-wrap: nowrap;
}
.integrations-filter-bar .worklist-search-wrap {
    flex: 1 1 auto;
    max-width: 420px;
}
.integrations-filter-bar .filter-chips-row--inline {
    flex: 0 0 auto;
    overflow: hidden;
}

.integration-select-all-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.integration-filter-chip {
    cursor: pointer;
    border: 1px solid var(--border-soft);
    background: var(--white);
    font-family: var(--font);
}

.integration-filter-chip.active {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.integrations-page .integration-row.is-selected {
    background: var(--brand-soft);
    box-shadow: inset 3px 0 0 var(--brand);
}

.integrations-page .row-pending-integration {
    --row-tint: rgba(239, 68, 68, 0.04);
}

.integrations-page .row-partial {
    --row-tint: rgba(245, 158, 11, 0.06);
}

.integrations-page .row-integrated {
    --row-tint: rgba(34, 197, 94, 0.05);
}

.integrations-page .integration-row {
    background: linear-gradient(90deg, var(--row-tint, transparent), transparent 120px);
}

.col-check { width: 36px; text-align: center; }
.col-integration { min-width: 130px; }
.col-steps { width: 100px; }

.integration-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.integration-badge--pending {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.integration-badge--partial {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.integration-badge--integrated {
    background: rgba(34, 197, 94, 0.14);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.integration-steps {
    display: flex;
    gap: 4px;
}

.integration-step {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    opacity: 0.45;
}

.integration-step.is-done {
    opacity: 1;
    color: var(--success);
    background: var(--success-soft);
    border-color: #a7f3d0;
}

.integrations-page #integration-dashboard-panel:not(.panel-hidden) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.integrations-page #integration-dashboard-panel .card-wide {
    grid-column: 1 / -1;
}

.integrations-page .console-panel {
    min-height: 160px;
    max-height: 220px;
    display: flex;
    flex-direction: column;
}

.integrations-page .console-body {
    flex: 1;
    overflow-y: auto;
    max-height: 160px;
}

@media (max-width: 1100px) {
    .integrations-page .integrations-split {
        grid-template-columns: 1fr;
    }
    .integrations-detail-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .integrations-page #integration-dashboard-panel:not(.panel-hidden) {
        grid-template-columns: 1fr;
    }
}

/* ── Cadastros hub (Parceiros · Catálogo · NCM · Simulador) ───────────────── */

.cadastros-hub {
    min-height: calc(100vh - 100px);
}

.cadastros-tab-bar {
    margin-top: 0;
}

.cadastros-tabs .cadastros-tab {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cadastros-tab-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

.filter-chip.active .cadastros-tab-count {
    background: rgba(0, 83, 134, 0.15);
    color: var(--brand);
}

.cadastros-tab-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.cadastros-purpose-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 10px;
}
@media (max-width: 1100px) {
    .cadastros-purpose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .cadastros-purpose-grid { grid-template-columns: 1fr; }
}
.cadastros-purpose-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 14px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-soft, #e5e7eb);
    background: var(--bg-subtle, #f8fafc);
    text-decoration: none;
    color: inherit;
    min-height: 118px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.cadastros-purpose-card:hover {
    border-color: var(--brand, #005386);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}
.cadastros-purpose-card.is-active {
    border-color: var(--brand, #005386);
    background: rgba(0, 83, 134, 0.06);
    box-shadow: inset 0 0 0 1px rgba(0, 83, 134, 0.15);
}
.cadastros-purpose-card i {
    color: var(--brand, #005386);
    font-size: 16px;
}
.cadastros-purpose-card--sim i { color: #b45309; }
.cadastros-purpose-card strong {
    font-size: 14px;
    font-weight: 650;
}
.cadastros-purpose-card span {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    flex: 1;
}
.cadastros-purpose-card em {
    position: absolute;
    top: 12px;
    right: 12px;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

/* ── Ajuda / fluxo ─────────────────────────────────────────────────────────── */
.help-page { max-width: none; width: 100%; }
.help-kicker {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}
.help-lead {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}
.help-hero {
    padding: 22px 24px 18px;
    margin-bottom: 16px;
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(37, 99, 235, 0.08), transparent 55%),
        var(--bg-elevated, #f7f9fc);
}
.help-hero-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.help-hero-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    max-width: 320px;
    text-align: right;
}
.help-flowchart {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 6px 2px 10px;
}
.hf-node {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--brand-border);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.hf-node:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--brand);
    color: inherit;
}
.hf-node--accent {
    background: linear-gradient(160deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    color: #fff;
}
.hf-node--accent .hf-num,
.hf-node--accent .hf-desc { color: rgba(255,255,255,0.78); }
.hf-node--accent .hf-icon { background: rgba(255,255,255,0.18); color: #fff; }
.hf-node--finance {
    border-color: #6ee7b7;
    background: #ecfdf5;
}
.hf-node--finance .hf-icon { background: #d1fae5; color: #047857; }
.hf-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    margin-bottom: 4px;
}
.hf-num {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.hf-node strong { font-size: 14px; line-height: 1.25; }
.hf-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
}
.hf-arrow {
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 13px;
    animation: hf-pulse 1.8s ease-in-out infinite;
}
@keyframes hf-pulse {
    0%, 100% { opacity: 0.45; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(2px); }
}
.help-flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.help-flow-legend i { font-size: 8px; margin-right: 4px; vertical-align: middle; }
.help-pipeline-section {
    padding: 20px 22px;
    margin-bottom: 16px;
}
.help-pipe {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 8px 0 4px;
}
.help-pipe-step {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0 8px;
}
.help-pipe-dot {
    width: 16px;
    height: 16px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.help-pipe-step--end .help-pipe-dot {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 0 4px var(--success-soft);
}
.help-pipe-step strong { display: block; font-size: 13px; margin-bottom: 2px; }
.help-pipe-step span { font-size: 12px; color: var(--text-muted); }
.help-pipe-line {
    flex: 0 0 clamp(20px, 3vw, 48px);
    height: 3px;
    margin-top: 6px;
    background: linear-gradient(90deg, var(--brand-border), #cbd5e1);
    border-radius: 2px;
    align-self: flex-start;
}
.help-pipe-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: 13px;
    color: #92400e;
    line-height: 1.45;
}
.help-pipe-note i { color: #d97706; margin-top: 2px; }
.help-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 900px) {
    .help-grid { grid-template-columns: 1fr; }
    .help-flowchart {
        overflow-x: auto;
    }
    .hf-node {
        flex: 1 0 130px;
    }
}
.help-card { padding: 18px 20px; }
.help-imp-exp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 700px) {
    .help-imp-exp { grid-template-columns: 1fr; }
}
.help-dir {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-soft, #e5e7eb);
    background: var(--bg-subtle, #f8fafc);
}
.help-dir header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 8px;
}
.help-dir ul {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}
.help-dir--imp { border-left: 3px solid #1d4ed8; }
.help-dir--exp { border-left: 3px solid #047857; }
.help-quick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.help-quick {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.help-quick:hover {
    border-color: var(--brand-border);
    background: var(--brand-muted);
    color: inherit;
}
.help-quick i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    flex-shrink: 0;
    margin-top: 1px;
}
.help-quick strong { display: block; font-size: 13px; }
.help-quick span { font-size: 11px; color: var(--text-muted); }
.help-map { padding: 18px 20px; margin-bottom: 16px; }
.help-map-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 800px) {
    .help-map-cards { grid-template-columns: 1fr; }
}
.help-map-card {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--bg-subtle);
}
.help-map-card header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--brand);
}
.help-map-card ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.55;
}
.help-map-muted { list-style: none; margin-left: -16px; font-style: italic; }
.help-svg-wrap { padding: 18px 20px; margin-bottom: 8px; }
.help-svg-scroll { overflow-x: auto; }
.help-svg {
    width: 100%;
    min-width: 0;
    height: auto;
    display: block;
}
@media (prefers-reduced-motion: reduce) {
    .hf-arrow { animation: none; }
    .hf-node:hover { transform: none; }
}

.nav-link-dir--imp.active { box-shadow: inset 3px 0 0 #1d4ed8; }
.nav-link-dir--exp.active { box-shadow: inset 3px 0 0 #047857; }

.filter-chip-sep {
    width: 1px;
    height: 22px;
    background: var(--border-soft, #e5e7eb);
    margin: 0 4px;
    align-self: center;
}
.filter-chip--imp {
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.filter-chip--imp.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.filter-chip--exp {
    border-color: #a7f3d0;
    color: #047857;
}
.filter-chip--exp.active {
    background: #047857;
    border-color: #047857;
    color: #fff;
}

.btn-danger-ghost {
    background: transparent;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.btn-danger-ghost:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}
.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.admin-row-actions .form-inline { margin: 0; }

.followup-board-page #followup-kpi-strip {
    align-items: center;
    max-height: none;
}

.followup-filter-chip {
    cursor: pointer;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    font-family: var(--font);
}

.followup-filter-chip:hover {
    border-color: var(--brand);
    background: var(--brand-muted);
}

.followup-filter-chip.active {
    border-color: var(--brand);
    background: var(--brand-muted);
    outline: none;
}

.cadastros-panels {
    flex: 1;
    min-height: 0;
}

.cadastros-panel {
    display: none;
    animation: cadastros-fade-in 0.2s ease;
}

.cadastros-panel.is-active {
    display: block;
}

@keyframes cadastros-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ncm-ref-browser {
    margin-bottom: 16px;
    padding: 14px 16px;
}
.ncm-ref-browser .cadastro-table-wrap {
    max-height: 280px;
    overflow: auto;
}
.catalog-ncm-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.catalog-import-btn {
    margin-left: auto;
}

.cadastros-ncm-info {
    margin-top: 16px;
    font-size: 13px;
}

.ncm-req-cell {
    max-width: 320px;
    font-size: 13px;
}

.ncm-actions-cell {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.selector-bar label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.select-wrapper select,
.selector-bar select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font: inherit;
    background: var(--white);
}

.empty-integration-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--white);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.empty-integration-state i { font-size: 40px; margin-bottom: 16px; opacity: 0.35; }
.empty-integration-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }

.integration-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.integration-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-brand { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.icon-brand { color: var(--brand); }

.card-description { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.info-field {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.info-field .label { color: var(--text-muted); }

.dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.dot-green { background: var(--success); }
.dot-orange { background: var(--warning); }
.dot-red { background: var(--danger); }
.dot-gray { background: var(--text-muted); }

.status-dot-indicator { font-size: 12px; color: var(--text-muted); }

.integration-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.taxes-breakdown-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.taxes-breakdown-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.taxes-breakdown-table .total-row { font-weight: 700; border-top: 2px solid var(--border); }

/* ── Flash messages ────────────────────────────────────────────────────────── */

.flash-messages { margin-bottom: 16px; }

.flash-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 8px;
}

.alert-success { background: var(--success-soft); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-soft); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--brand-soft); color: #1e40af; border: 1px solid var(--brand-border); }

.close-alert-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--mono); }
.error-line { color: var(--danger); font-size: 13px; padding: 12px; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-muted);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ─────────────────────────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.login-brand-panel {
    background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-brand-inner { max-width: 380px; }

.login-brand-logo {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 24px;
}

.login-brand-panel h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.02em; }
.login-brand-panel p { font-size: 15px; opacity: 0.9; line-height: 1.6; margin-bottom: 28px; }

.login-features { list-style: none; }
.login-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.95;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--white);
}

.login-form-wrap { width: 100%; max-width: 360px; }

.login-form-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-form-header p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

.login-input-wrap { position: relative; }
.login-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.login-input-wrap input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.login-form .form-group { margin-bottom: 16px; }
.login-submit { margin-top: 8px; padding: 11px !important; }

.login-flash-list { list-style: none; margin-bottom: 16px; }
.login-flash {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--danger-soft);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.login-sandbox-note {
    margin-top: 24px;
    padding: 14px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.login-sandbox-note strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); }
.login-sandbox-note span { font-size: 12px; color: var(--text-secondary); }

@media (max-width: 900px) {
    .login-layout { grid-template-columns: 1fr; }
    .login-brand-panel { display: none; }
}

/* ── Integrations extras ───────────────────────────────────────────────────── */

.card-wide { grid-column: 1 / -1; }

.tax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 12px 0;
}

.tax-table th,
.tax-table td {
    padding: 10px 8px;
    border: 1px solid var(--border);
    text-align: center;
}

.tax-table thead th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
}

.tax-exempt-notice {
    background: var(--success-soft) !important;
    border: 1px solid #a7f3d0 !important;
    color: var(--success) !important;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.recent-processes-list {
    margin: 0 -20px -20px;
}

.recent-processes-list .process-strip:first-child { border-top: 1px solid var(--border-soft); }

.split-layout--start { align-items: flex-start; }

.simulator-form-panel { flex: 1; max-width: 480px; }
.simulator-result-panel { flex: 2; padding: 24px; }

.form-inline { display: inline; }

.info-field-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
    background: var(--bg-subtle) !important;
    padding: 12px;
    border-radius: var(--radius) !important;
    border: 1px solid var(--border-soft) !important;
}

@media (max-width: 768px) {
    .info-field-row { grid-template-columns: 1fr 1fr; }
}

.console-panel { margin-top: 20px; }

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.console-title { font-weight: 600; font-size: 13px; }
.console-controls { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }

.console-clear-btn {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}

.console-body {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 12px;
    font-family: var(--mono);
    font-size: 12px;
    max-height: 240px;
    overflow-y: auto;
}

.console-line { margin-bottom: 4px; }
.console-line.system-line { color: #94a3b8; }
.console-line.success-line { color: #86efac; }
.console-line.error-line { color: #fca5a5; }

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

.btn-success:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
    color: white;
}

.tax-exempt-notice i { margin-right: 8px; }


.panel-hidden { display: none; }

#integration-dashboard-panel:not(.panel-hidden) { display: grid; }

.simulator-placeholder { font-size: 14px; }
.simulator-result-grid { margin-top: 16px; }
.landed-cost-total { font-size: 18px; }
.compliance-alert {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--warning);
    background: var(--warning-soft);
}


.pagination-container { font-size: 13px; }

.sidebar-logout {
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
}

.sidebar-logout:hover { background: var(--bg-subtle); color: var(--danger); }

/* ── Layout utilities ──────────────────────────────────────────────────────── */

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.panel-card {
    padding: 20px;
    margin-bottom: 20px;
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.table-card-header .title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.table-card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 0;
}

.table-card-toolbar .box-title { margin: 0; }

.cadastro-filter-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.cadastro-filter-panel input[type="text"],
.cadastro-filter-panel select {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    min-width: 0;
}

.cadastro-filter-panel input[type="text"] {
    flex: 1;
    min-width: 140px;
}

.cadastro-filter-panel input[type="text"]:focus,
.cadastro-filter-panel select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.cadastro-filter-panel select {
    min-width: 150px;
    cursor: pointer;
}

.cadastro-filter-panel .btn {
    height: 36px;
    padding: 0 14px;
    white-space: nowrap;
}

.inline-filter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid var(--border-soft);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 6px; align-items: center; }
.pagination-page { font-size: 13px; padding: 0 8px; color: var(--text-secondary); }

.flex-2 { flex: 2; }
.text-center-muted { text-align: center; color: var(--text-muted); }

.link-btn { text-decoration: none; }

/* ── Dashboard (refined) ───────────────────────────────────────────────────── */

.admin-page,
.dashboard-page,
.tv-settings-page,
.alerts-page,
.finance-page,
.reports-page,
.audit-page,
.email-settings-page,
.backup-page {
    width: 100%;
    max-width: none;
}

.dashboard-page { display: flex; flex-direction: column; gap: 4px; }

.kpi-section { margin-bottom: 20px; }

.kpi-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 2px;
}

.kpi-grid--5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }

.kpi-grid--6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1280px) {
    .kpi-grid--5 { grid-template-columns: repeat(3, 1fr); }
    .kpi-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid--6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .kpi-grid--5,
    .kpi-grid--4,
    .kpi-grid--3,
    .kpi-grid--6 { grid-template-columns: 1fr; }
}

.kpi-value--currency { font-size: 16px; }
.kpi-value--money { font-size: 15px; }
.kpi-value--pct { font-size: 18px; }
.kpi-unit { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.kpi-card--positive { border-color: #86efac; background: linear-gradient(135deg, var(--bg-elevated) 0%, #f0fdf4 100%); }
.kpi-card--negative { border-color: #fca5a5; background: linear-gradient(135deg, var(--bg-elevated) 0%, #fef2f2 100%); }
.critical-pulse { border-color: #fcd34d; background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--warning-soft) 100%); }

.dashboard-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

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

.dashboard-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashboard-panel--chart { min-height: 340px; }

.box-caption {
    font-size: 11px;
    color: var(--text-muted);
}

.box-title--sm {
    font-size: 12px;
    margin-bottom: 10px;
}

.chart-wrap {
    position: relative;
    flex: 1;
    min-height: 260px;
}

.chart-wrap--donut {
    position: relative;
    flex: 1;
    min-height: 160px;
    max-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrap--tall {
    min-height: 320px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot--import { background: #3b82f6; }
.legend-dot--export { background: #8b5cf6; }

.panel-divider {
    border-top: 1px solid var(--border-soft);
    margin: 14px 0;
}

.dashboard-panel--recent { margin-top: 16px; }

.comnexis-table thead th,
.data-table thead th {
    background: var(--bg-subtle);
}

.header-search {
    background: var(--bg-elevated);
    border-color: var(--border-soft);
}

.login-form-panel { background: var(--bg-surface); }

.modal-title { margin: 0; font-size: 18px; }
.modal-header-actions { display: flex; gap: 8px; align-items: center; }

.modal-panel--wide { max-width: 760px; }

.drawer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 16px 0;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
    max-height: 52vh;
    overflow-y: auto;
}

.drawer-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    gap: 10px;
}

.drawer-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.drawer-content {
    padding: 14px 16px 20px;
    font-size: 13px;
    line-height: 1.45;
}
.drawer-content.is-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.drawer-content .drawer-section-title,
.drawer-content h3,
.drawer-content h4 {
    font-size: 13px;
}
.drawer-content p,
.drawer-content li,
.drawer-content td,
.drawer-content label {
    font-size: 13px;
}
.drawer-content small,
.drawer-content .text-muted,
.drawer-content .ncm-sub {
    font-size: 12px;
}
#drawer-content-loading {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
#drawer-content-loading.is-active { display: flex; }

.form-input-stack { margin-top: 6px; }
.btn-fetch-row { margin-top: 6px; display: inline-flex; text-decoration: none; }

.filter-panel {
    padding: 16px;
    margin-bottom: 16px;
}

.search-form-wide {
    display: flex;
    gap: 8px;
}

.search-form-wide input { flex: 1; }

.audit-value-cell {
    font-size: 12px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-blue { background: var(--brand-muted); color: var(--brand); }

/* ── Multi-empresa header ─────────────────────────────────────────────────── */
.company-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}
.company-switcher select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    max-width: 180px;
}
.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: nowrap;
}

/* ── Financeiro ───────────────────────────────────────────────────────────── */
.finance-company-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin: -8px 0 16px;
}
.finance-table .col-money { font-variant-numeric: tabular-nums; font-weight: 600; }
.page-header--split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── OCR review modal ─────────────────────────────────────────────────────── */
.ocr-review-content { max-width: 520px; width: 100%; }
.ocr-review-hint { margin-bottom: 16px; font-size: 13px; }
.ocr-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ocr-field-row {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.ocr-field-row input[type="checkbox"] { grid-row: span 2; }
.ocr-field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.ocr-field-input {
    grid-column: 2;
    padding: 6px 8px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, monospace;
    font-size: 13px;
}
.ocr-confidence {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 6px;
}
.ocr-conf-high { background: #dcfce7; color: #166534; }
.ocr-conf-med { background: #fef9c3; color: #854d0e; }
.ocr-conf-low { background: #fee2e2; color: #991b1b; }
.ocr-raw-preview { font-size: 12px; margin-bottom: 16px; }
.ocr-raw-preview pre {
    max-height: 120px;
    overflow: auto;
    padding: 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    font-size: 11px;
    white-space: pre-wrap;
}

/* ── Polish telas secundárias ─────────────────────────────────────────────── */
.kpi-value--sm { font-size: 14px; }
.integrations-kpi-grid,
.alerts-kpi-grid,
.finance-kpi-grid { margin-bottom: 20px; }
.reports-preview-panel { margin-top: 20px; }
.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.panel-card-header h2 { font-size: 15px; font-weight: 600; margin: 0; }
.table-scroll { overflow-x: auto; }
.reports-preview-table .col-money { font-weight: 600; }
.empty-state-cell { padding: 32px !important; }
.empty-state-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
}
.empty-state-inline i { color: var(--success); font-size: 18px; }
.alert-dropdown-empty { padding: 12px; font-size: 12px; }

.badge-verde { background: #dcfce7; color: #166534; }

/* ── KPI clicáveis ─────────────────────────────────────────────────────────── */
a.kpi-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
a.kpi-card--link:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ── Sidebar — troca de empresa ───────────────────────────────────────────── */
.sidebar-company-switch {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}
.sidebar-company-switch label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.sidebar-company-switch select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

/* ── Financeiro aprimorado ─────────────────────────────────────────────────── */
.finance-summary-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) { .finance-summary-row { grid-template-columns: 1fr; } }

.finance-position-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.finance-position-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.finance-position-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.finance-position-meta { font-size: 12px; color: var(--text-muted); }

.finance-aging-card { padding: 16px 20px; }
.finance-aging-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}
@media (max-width: 768px) { .finance-aging-grid { grid-template-columns: repeat(2, 1fr); } }
.finance-aging-item {
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-radius: 6px;
    border: 1px solid var(--border-soft);
}
.finance-aging-item .lbl { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.finance-aging-item .val { font-size: 14px; font-weight: 600; }
.finance-aging--overdue { border-color: #fca5a5; background: #fef2f2; }

.finance-list-panel { margin-top: 0; }
.finance-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-soft);
}
.finance-filter-bar select {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    min-width: 160px;
}
.row-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.overdue-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 4px;
}
.ref-link { text-decoration: none; }
.ref-link:hover code { color: var(--brand-hover); }

.channel-row--link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 6px;
    transition: background var(--ease);
}
.channel-row--link:hover { background: var(--bg-subtle); }

.input-with-action { display: flex; gap: 8px; align-items: center; }
.input-with-action input { flex: 1; }
.simulator-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); display: flex; flex-wrap: wrap; gap: 10px; }

.proposal-meta-details {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius);
    font-size: 13px;
}

.proposal-meta-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
}

.proposal-meta-details textarea {
    width: 100%;
    resize: vertical;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    font-family: inherit;
    font-size: 13px;
}

.catalog-ncm-hint { font-size: 13px; margin: -8px 0 16px; }
.catalog-search-status { font-size: 12px; white-space: nowrap; }
.ncm-suggest-panel {
    position: absolute;
    z-index: 20;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    margin-top: 4px;
}
.form-group { position: relative; }
.ncm-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: none;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-soft);
}
.ncm-suggest-item:hover { background: var(--bg-subtle); }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.user-screens-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 12px 0;
}
@media (max-width: 768px) { .user-screens-grid { grid-template-columns: 1fr; } }
.user-screen-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    padding: 6px 8px;
    background: var(--bg-subtle);
    border-radius: 6px;
}
.user-screen-row select { max-width: 120px; height: 32px; font-size: 12px; }
.user-edit-cell { background: var(--bg-subtle); padding: 16px !important; }
.user-screens-details { margin: 12px 0; font-size: 13px; }
.sidebar-profile-link {
    display: block;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
}
.panel-card--narrow { max-width: 520px; }
.login-forgot-link { text-align: center; margin-top: 12px; font-size: 13px; }

/* ── Drawer: logística / contêineres ─────────────────────────────────────── */
.drawer-section-title {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand);
}

.drawer-subsection-title {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.compliance-alert-card {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid var(--border);
}

.compliance-alert-card.danger {
    background: var(--danger-soft);
    border-color: #fca5a5;
    color: var(--danger);
}

.compliance-alert-card.success {
    background: var(--success-soft);
    border-color: #6ee7b7;
    color: var(--success);
}

.logistics-summary-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    margin-bottom: 20px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.logistics-stat .stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.logistics-stat .stat-value {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.logistics-stat .stat-value.danger { color: var(--danger); }

.logistics-stat--wide {
    grid-column: span 2;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px dashed var(--border);
}

.badge-returned,
.badge-pending {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-returned {
    background: var(--success-soft);
    color: var(--success);
}

.badge-pending {
    background: var(--warning-soft);
    color: var(--warning);
}

.containers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.container-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

.container-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-soft);
}

.container-card-number {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

.container-card-number i { color: var(--brand); margin-right: 6px; }

.container-card-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--white);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
}

.container-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px;
}

.container-card-info .info-lbl {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.container-card-info .info-val {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-top: 2px;
}

.container-card-info--wide {
    grid-column: span 2;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed var(--border-soft);
}

.container-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.container-card-actions .btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.return-form-inline {
    display: none;
    padding: 0 12px 12px;
    border-top: 1px solid var(--border-soft);
    margin-top: 4px;
    padding-top: 10px;
}

.return-form-inline.is-open { display: block; }

.return-form-inline label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.return-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.return-form-row input[type="date"] {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.containers-empty {
    font-size: 13px;
    text-align: center;
    padding: 20px 12px;
    margin-bottom: 20px;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.drawer-form-card {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.drawer-form-card .drawer-form-title {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.drawer-form-card .drawer-form-title i { color: var(--brand); margin-right: 6px; }

.drawer-inline-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-inline-form .form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.drawer-inline-form input[type="text"],
.drawer-inline-form input[type="number"],
.drawer-inline-form input[type="date"],
.drawer-inline-form select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.drawer-inline-form input:focus,
.drawer-inline-form select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.drawer-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ── Follow-up importador (portal público) ───────────────────────────────── */
.followup-page {
    min-height: 100vh;
    background: var(--bg);
}

.followup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.followup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--brand);
    font-size: 18px;
}

.followup-brand small {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
}

.followup-updated { font-size: 12px; color: var(--text-muted); margin: 0; }

.followup-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.followup-hero { padding: 24px; }

.followup-kicker {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.followup-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.followup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.followup-critical {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--danger-soft);
    color: var(--danger);
}

.followup-subtitle { color: var(--text-secondary); font-size: 14px; }

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

@media (max-width: 768px) {
    .followup-grid { grid-template-columns: 1fr; }
}

.followup-card { padding: 20px; }

.followup-card h2 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.followup-card h2 i { color: var(--brand); margin-right: 8px; }

.followup-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.followup-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--text-muted);
}

.followup-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    margin-top: 5px;
    flex-shrink: 0;
}

.followup-step.is-active .followup-step-dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.followup-step.is-active strong { color: var(--brand); }
.followup-step.is-done .followup-step-dot { background: var(--success); }
.followup-step.is-done strong { color: var(--text); }

.followup-dl { display: grid; gap: 10px; }

.followup-dl div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    font-size: 13px;
}

.followup-dl dt { color: var(--text-muted); font-weight: 600; }
.followup-dl dd { color: var(--text); margin: 0; }

.followup-milestone-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.followup-milestone-list li {
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    font-size: 13px;
}

.followup-footer {
    text-align: center;
    font-size: 12px;
    padding-top: 8px;
}

.followup-expired-panel { max-width: 440px; margin: 80px auto; text-align: center; }

.followup-action-box {
    width: 100%;
    padding: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.followup-action-hint { font-size: 12px; margin: 6px 0 10px; }

.followup-message-input {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
}

.followup-demo-link { margin-top: 16px; word-break: break-all; font-size: 12px; }

/* ── Follow-up Premier Despachos ─────────────────────────────────────────── */
.followup-page--premier {
    font-family: "IBM Plex Sans", var(--font-sans);
    background: #F0F4F7;
    --premier-primary: #005386;
    --premier-secondary: #005C5A;
    --premier-accent: #E2972E;
    --premier-text: #002237;
    --premier-muted: #47657A;
    --premier-border: #C5D9E4;
}

.followup-header--premier {
    background: linear-gradient(135deg, #005386 0%, #004670 100%);
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0, 35, 55, 0.15);
    padding: 18px 28px;
}

.followup-brand--premier {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.followup-logo-box {
    display: inline-block;
    background: #ffffff;
    border: 2px solid #E2972E;
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: 0 2px 10px rgba(0, 35, 55, 0.25);
    line-height: 0;
}

.followup-logo {
    height: 44px;
    width: auto;
    max-width: 220px;
    display: block;
}

.followup-header-meta {
    text-align: right;
}

.followup-tagline {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

.followup-header--premier .followup-updated {
    color: #E2972E;
    font-weight: 600;
    margin-top: 4px;
}

.followup-hero--premier {
    border-top: 4px solid var(--premier-accent);
}

.followup-page--premier .followup-kicker {
    color: var(--premier-accent);
    letter-spacing: 0.06em;
}

.followup-page--premier .followup-hero h1 {
    color: var(--premier-text);
}

.followup-card--premier h2 {
    color: var(--premier-primary);
}

.followup-card--premier h2 i {
    color: var(--premier-accent);
}

.followup-page--premier .followup-step.is-active .followup-step-dot {
    background: var(--premier-primary);
    box-shadow: 0 0 0 3px rgba(0, 83, 134, 0.2);
}

.followup-page--premier .followup-step.is-active strong {
    color: var(--premier-primary);
}

.followup-page--premier .followup-step.is-done .followup-step-dot {
    background: var(--premier-secondary);
}

.followup-page--premier .followup-milestone-list li {
    background: #F0F4F7;
    border: 1px solid var(--premier-border);
}

.followup-footer--premier {
    padding: 20px;
    background: var(--premier-secondary);
    color: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-lg);
    font-size: 13px;
}

.followup-footer--premier small {
    color: rgba(255, 255, 255, 0.75);
}

.followup-footer-contact a {
    color: #E2972E;
    font-weight: 600;
    text-decoration: none;
}

.followup-footer-contact a:hover {
    text-decoration: underline;
}

.followup-expired-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.followup-expired-panel--premier {
    max-width: 440px;
    margin: 48px auto;
    text-align: center;
    border-top: 4px solid var(--premier-accent);
}

.followup-expired-panel--premier h2 {
    color: var(--premier-primary);
}

/* ── Painel e-mail / notificações ─────────────────────────────────────────── */
.email-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 20px;
    align-items: start;
    width: 100%;
}

@media (max-width: 960px) {
    .email-settings-layout { grid-template-columns: 1fr; }
}

.email-settings-panel,
.email-test-panel {
    padding: 24px;
}

.email-settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.email-settings-panel-header .box-title { margin: 0; }

.email-hint-box {
    padding: 14px 16px;
    margin-bottom: 20px;
    background: var(--brand-muted);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
}

.email-hint-box ol {
    margin: 8px 0 0 18px;
    line-height: 1.55;
}

.email-hint-box code {
    font-size: 12px;
    background: var(--white);
    padding: 1px 5px;
    border-radius: 4px;
}

.form-group--checkbox { margin-top: 8px; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.email-status-card {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

.email-status-card h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.email-status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-status-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.email-status-list span { color: var(--text-muted); }

.inline-form { display: inline; }

/* ── Busca global + checklist documental (Fase 1) ─────────────────────────── */

.header-search-wrap {
    position: relative;
    flex: 1;
    max-width: 420px;
    min-width: 160px;
}

.global-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 360px;
    overflow-y: auto;
    z-index: 120;
}

.global-search-dropdown.is-open { display: block; }

.global-search-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}

.global-search-section:last-child { border-bottom: none; }

.global-search-section-label {
    padding: 4px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.global-search-item {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
}

.global-search-item:hover,
.global-search-item.is-active { background: var(--brand-soft); }

.global-search-item-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.global-search-empty {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.doc-checklist-panel {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.doc-checklist-panel.is-complete {
    border-color: var(--success);
    background: var(--success-soft);
}

.doc-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.doc-checklist-title {
    font-size: 14px;
    font-weight: 700;
}

.doc-checklist-progress {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.doc-checklist-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--border-soft);
    font-size: 13px;
}

.doc-checklist-item:first-child { border-top: none; padding-top: 0; }

.doc-checklist-icon.is-done { color: var(--success); }
.doc-checklist-icon.is-pending { color: var(--warning); }
.doc-checklist-icon.is-waiting { color: var(--brand); }
.doc-checklist-item.is-waiting-external .doc-checklist-body span { color: var(--text-secondary); }

.doc-checklist-body span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.drawer-doc-pending-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--warning-soft);
    color: var(--warning);
}

.kpi-overdue {
    font-size: 12px;
    font-weight: 600;
    color: var(--danger);
}

.worklist-kpi--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.worklist-kpi--link:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.worklist-tasks-hint {
    margin: 12px 0 0;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--primary-soft, rgba(59, 130, 246, 0.08));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.worklist-tasks-hint i {
    color: var(--primary);
    margin-right: 6px;
}

.task-empty-state {
    padding: 12px 0 8px;
}

.task-empty-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

.task-form-label {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-primary);
}

.task-form-label i {
    color: var(--primary);
    margin-right: 6px;
}

.drawer-tab-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--primary-soft);
    color: var(--primary);
}

.drawer-tab-badge.is-overdue {
    background: var(--danger-soft, rgba(239, 68, 68, 0.15));
    color: var(--danger);
}

.task-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.task-item {
    position: relative;
    padding: 12px 36px 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.task-item:first-child { border-top: 1px solid var(--border-soft); }
.task-item.is-done { opacity: 0.65; }
.task-item.is-done .task-title { text-decoration: line-through; }
.task-item.is-overdue { border-left: 3px solid var(--danger); padding-left: 10px; }

.task-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.task-title { font-weight: 600; }

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    margin-left: 26px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-notes {
    margin: 6px 0 0 26px;
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-del-task {
    position: absolute;
    top: 12px;
    right: 0;
    border: none;
    background: none;
    color: var(--danger);
    cursor: pointer;
    opacity: 0.6;
}

.btn-del-task:hover { opacity: 1; }

.task-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.task-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.task-form-row .form-group { flex: 1; min-width: 140px; }

.operator-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.operator-badge--large {
    font-size: 14px;
}

.operator-badge--empty {
    color: var(--text-muted);
}

.operator-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--primary-soft, rgba(59, 130, 246, 0.12));
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
}

.operator-badge--empty .operator-avatar,
.operator-badge--empty .operator-avatar {
    background: var(--warning-soft);
    color: var(--warning);
}

.operator-name {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operator-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--primary-soft, rgba(0, 83, 134, 0.12));
    color: var(--primary);
}

.operator-hero-badge--empty {
    background: var(--warning-soft);
    color: var(--warning);
}

.drawer-operator-panel {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--white);
}

.drawer-operator-panel.is-unassigned {
    border-color: var(--warning);
    background: var(--warning-soft, rgba(245, 158, 11, 0.08));
}

.drawer-operator-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.drawer-operator-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.drawer-assignee-select {
    flex: 1;
    min-width: 180px;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    font-size: 13px;
}

.operator-unassigned-label {
    font-size: 13px;
    color: var(--warning);
    font-weight: 600;
}

tr.row-mine {
    box-shadow: inset 3px 0 0 var(--primary);
}

tr.row-unassigned td.col-operator .operator-badge--empty {
    animation: none;
}

.my-work-layout {
    gap: 20px;
}

.my-work-page .worklist-table-scroll {
    max-height: calc(100vh - 220px);
    min-height: 360px;
}

.my-work-panel-view.is-hidden {
    display: none;
}

.my-work-view-bar {
    padding-top: 0;
}

.my-work-view-chips .filter-chip {
    cursor: pointer;
}

.my-work-task-title {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.my-work-panel {
    flex: 1;
    min-width: 320px;
    padding: 16px 18px;
}

.my-work-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.my-work-task-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.my-work-task-item.is-overdue {
    border-left: 3px solid var(--danger);
    padding-left: 10px;
}

.my-work-task-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.my-work-task-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-size: 12px;
}

.my-work-empty {
    padding: 16px 0;
}

/* ── Painel TV · configuração ─────────────────────────────────────────────── */

.tv-settings-page .tv-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .tv-settings-page .tv-settings-grid { grid-template-columns: 1fr; }
}

.tv-settings-panel {
    padding: 20px 22px;
}

.tv-settings-hint {
    margin: -4px 0 16px;
    font-size: 13px;
}

.tv-settings-form fieldset.tv-slide-types {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px 14px 8px;
    margin: 0 0 16px;
}

.tv-settings-form legend {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0 6px;
}

.tv-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    cursor: pointer;
    font-size: 14px;
}

.tv-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.tv-preview-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.tv-preview-stat {
    flex: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
}

.tv-preview-stat .val {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.1;
}

.tv-preview-stat .lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.tv-slide-plan {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.tv-slide-plan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
}

.tv-slide-plan-num {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--brand-muted);
    color: var(--brand);
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tv-slide-plan-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tv-link-box {
    border-top: 1px dashed var(--border-soft);
    padding-top: 16px;
}

.tv-link-box h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.tv-link-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tv-link-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    background: var(--white);
}

.tv-token-hint {
    margin-top: 10px;
    font-size: 12px;
}

@media (max-width: 900px) {
    .header-user-meta,
    .header-user-chevron {
        display: none;
    }

    .header-user-trigger {
        padding: 4px;
        border-radius: 50%;
    }
}

/* ── Follow-up board ─────────────────────────────────────────────────────── */

.followup-board-page .followup-table .col-fu-status { width: 9.5rem; }
.followup-board-page .followup-table .col-fu-when { min-width: 10rem; }
.followup-board-page .followup-table .col-action { width: 1%; white-space: nowrap; }

.fu-ref-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.fu-ref-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fu-ref-line .ref-code {
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}
.fu-pipeline-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.fu-pipeline-stack .status-tag,
.fu-pipeline-stack .channel-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    line-height: 1;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    box-sizing: border-box;
    margin: 0;
}

.fu-status-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.fu-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    line-height: 1;
    box-sizing: border-box;
    white-space: nowrap;
}

.fu-status-sent {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.fu-status-scheduled {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.fu-status-never_sent {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.fu-link-expired,
.fu-no-email {
    font-size: 10px;
    color: var(--danger, #dc2626);
}

.fu-when-primary {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.fu-when-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.fu-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.followup-smtp-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.followup-smtp-hint code {
    font-size: 11px;
    background: var(--bg-subtle, #f3f4f6);
    padding: 1px 5px;
    border-radius: 4px;
}

.followup-row.is-hidden { display: none; }

.fu-modal-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    margin: 2px 0 0;
    color: var(--brand, #1d4ed8);
}

.fu-modal-header-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.fu-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 78, 216, 0.1);
    color: #1d4ed8;
    flex-shrink: 0;
}

.fu-email-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-subtle, #f8fafc);
}

.fu-email-chip i { color: var(--text-muted, #64748b); }

.fu-email-chip input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0 !important;
}

.fu-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.fu-modal-result {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border, #e5e7eb);
    word-break: break-all;
}

.fu-modal-result.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.fu-modal-result.is-err {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.modal-panel--narrow {
    max-width: 420px;
    width: 100%;
}

@keyframes fu-pulse-sent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(4, 120, 87, 0); }
}

.followup-row.fu-just-sent .fu-status-badge {
    animation: fu-pulse-sent 1.2s ease-out 2;
}

@media (prefers-reduced-motion: reduce) {
    .followup-row.fu-just-sent .fu-status-badge { animation: none; }
}

/* ── Admin: usuários & empresas ────────────────────────────────────────────── */
.admin-hint-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
@media (max-width: 900px) {
    .admin-hint-strip { grid-template-columns: 1fr; }
}
.admin-hint-item {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}
.admin-hint-item strong { color: var(--text-primary); font-weight: 600; }

.split-layout--admin {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    align-items: start;
    width: 100%;
}
@media (max-width: 1100px) {
    .split-layout--admin { grid-template-columns: 1fr; }
}

.admin-create-card,
.admin-list-card { padding: 0; overflow: hidden; }
.admin-card-head {
    padding: 18px 20px 8px;
}
.admin-card-kicker {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand, #1d4ed8);
    margin-bottom: 4px;
}
.admin-create-card .comnexis-form { padding: 8px 20px 20px; }
.admin-list-card .cadastro-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft, #e5e7eb);
}
.admin-list-search { max-width: 280px; }

.user-cell-id {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #005386, #003052);
    color: #fff;
    flex-shrink: 0;
}

.cnpj-lookup-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.cnpj-lookup-row input { flex: 1; min-width: 0; }
.cnpj-meta {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.company-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px 20px;
}
.company-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-soft, #e5e7eb);
    border-radius: 12px;
    background: var(--bg-subtle, #f8fafc);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.company-card:hover {
    border-color: var(--brand, #1d4ed8);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.company-card.is-inactive { opacity: 0.65; }
.company-card-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}
.company-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #005386, #003052);
    color: #E2972E;
    flex-shrink: 0;
}
.company-card-main h3 {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 650;
}
.company-card-main p {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-muted);
}
.company-card-main code {
    font-size: 12px;
    color: var(--text-secondary, #475569);
}
.company-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.plan-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(15, 76, 129, 0.12);
    color: #0f4c81;
}
.plan-badge--starter { background: rgba(100, 116, 139, 0.15); color: #475569; }
.plan-badge--pro { background: rgba(15, 76, 129, 0.12); color: #0f4c81; }
.plan-badge--enterprise { background: rgba(5, 150, 105, 0.14); color: #047857; }
.company-usage {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

/* ── Financeiro: guia de fluxo ─────────────────────────────────────────────── */
.finance-flow-guide {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 20px;
    padding: 0;
    overflow: hidden;
}
@media (max-width: 1000px) {
    .finance-flow-guide { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .finance-flow-guide { grid-template-columns: 1fr; }
}
.finance-flow-step {
    position: relative;
    padding: 16px 18px 16px 52px;
    border-right: 1px solid var(--border-soft, #e5e7eb);
}
.finance-flow-step:last-child { border-right: none; }
.finance-flow-num {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    background: #005386;
    color: #fff;
}
.finance-flow-step strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.finance-flow-step p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.finance-sync-toast {
    display: none;
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.finance-sync-toast.is-visible { display: block; }
.finance-sync-toast.is-err {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.finance-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 10px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft, #e5e7eb);
}
.finance-legend span i { margin-right: 4px; }
.finance-legend .lg-ap { color: #b91c1c; }
.finance-legend .lg-ar { color: #047857; }

/* ── Diálogos / toasts ComNexis ───────────────────────────────────────────── */
body.cnx-dialog-open { overflow: hidden; }

.cnx-toast-host {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 520;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.cnx-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border-soft, #e5e7eb);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    font-size: 13px;
    line-height: 1.4;
    color: var(--text, #111827);
    animation: cnx-toast-in 0.22s ease;
}
.cnx-toast.is-leaving {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.cnx-toast i { margin-top: 1px; flex-shrink: 0; }
.cnx-toast span { flex: 1; min-width: 0; }
.cnx-toast-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
}
.cnx-toast--success { border-color: #a7f3d0; background: #ecfdf5; }
.cnx-toast--success i { color: #059669; }
.cnx-toast--error { border-color: #fecaca; background: #fef2f2; }
.cnx-toast--error i { color: #dc2626; }
.cnx-toast--warn { border-color: #fde68a; background: #fffbeb; }
.cnx-toast--warn i { color: #d97706; }
.cnx-toast--info i { color: var(--brand, #005386); }

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

.cnx-dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(15, 23, 42, 0.48);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cnx-dialog-overlay.is-open { display: flex; }

.cnx-dialog {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-soft, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    padding: 22px 22px 18px;
    text-align: center;
    animation: cnx-dialog-in 0.2s ease;
}
@keyframes cnx-dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cnx-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-muted, rgba(0, 83, 134, 0.12));
    color: var(--brand, #005386);
    font-size: 20px;
}
.cnx-dialog--danger .cnx-dialog-icon {
    background: #fef2f2;
    color: #dc2626;
}
.cnx-dialog--warn .cnx-dialog-icon {
    background: #fffbeb;
    color: #d97706;
}

.cnx-dialog-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text, #111827);
}
.cnx-dialog-message {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary, #4b5563);
}
.cnx-dialog-field { margin: 0 0 16px; text-align: left; }
.cnx-dialog-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border, #d1d5db);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}
.cnx-dialog-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft, rgba(0, 83, 134, 0.15));
}
.cnx-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.cnx-dialog-actions .btn { min-width: 96px; }

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

