/* ================================================================
   SNIPER DESIGN SYSTEM v2.1
   Direção: Precision & Density (Linear/Vercel)
   Fonte: Plus Jakarta Sans + JetBrains Mono
   Cor primária: #22FFA0 (laranja Jarbas)
   Layout: Sidebar fixa (desktop) + Bottom bar (mobile)
   Autor: Pedro + Claude · 2026-04-01
   Mudanças v2.1: polish pass — contraste, hover, transições, scroll
   ================================================================ */

/* ============================================
   FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   TOKENS
   ============================================ */
:root {
    /* --- Ink --- */
    --ink-primary: #e8ecf1;
    --ink-secondary: #b4bfcc;
    --ink-tertiary: #7e8d9f;
    --ink-muted: #536178;

    /* --- Surfaces --- */
    --surface-base: #07090e;
    --surface-raised: #0e1118;
    --surface-overlay: #141821;
    --surface-popover: #1a1f2b;
    --surface-inset: #050710;
    --surface-sidebar: #0a0d14;

    /* --- Borders --- */
    --border-default: rgba(148, 163, 184, 0.07);
    --border-subtle: rgba(148, 163, 184, 0.04);
    --border-strong: rgba(148, 163, 184, 0.12);
    --border-focus: rgba(34, 255, 160, 0.5);

    /* --- Brand --- */
    --brand: #22FFA0;
    --brand-light: #5FFFB8;
    --brand-deep: #00C97A;
    --brand-glow: rgba(34, 255, 160, 0.12);
    --brand-surface: rgba(34, 255, 160, 0.06);

    /* --- Accent --- */
    --accent-blue: #3b82f6;
    --accent-blue-surface: rgba(59, 130, 246, 0.1);

    /* --- Semantic --- */
    --semantic-success: #34d399;
    --semantic-success-surface: rgba(52, 211, 153, 0.08);
    --semantic-warning: #fbbf24;
    --semantic-warning-surface: rgba(251, 191, 36, 0.08);
    --semantic-danger: #f87171;
    --semantic-danger-surface: rgba(248, 113, 113, 0.07);

    /* --- Controls --- */
    --control-bg: rgba(7, 9, 14, 0.6);
    --control-border: rgba(148, 163, 184, 0.09);
    --control-focus-ring: rgba(34, 255, 160, 0.2);

    /* --- Spacing (4px grid) --- */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* --- Radius (sharp/técnico) --- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* --- Motion --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snappy: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 120ms;
    --duration-normal: 200ms;
    --duration-slow: 320ms;

    /* --- Layout --- */
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --topbar-height: 0px;
    --bottom-bar-height: 60px;
    --content-max-width: 1120px;

    /* --- Typography --- */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 22px;
    --text-3xl: 28px;
    --text-display: 36px;

    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;

    --tracking-tight: -0.8px;
    --tracking-normal: -0.2px;
    --tracking-wide: 0.3px;
    --tracking-wider: 0.8px;
    --tracking-caps: 1.2px;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 500;
    line-height: var(--leading-normal);
    color: var(--ink-secondary);
    background: var(--surface-base);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ATMOSPHERE
   ============================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 15% 0%, rgba(34, 255, 160, 0.035) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 85% 95%, rgba(59, 130, 246, 0.02) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ============================================
   APP LAYOUT — SIDEBAR + CONTENT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   SIDEBAR — DESKTOP
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface-sidebar);
    border-right: 0.5px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: width var(--duration-normal) var(--ease-out);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* --- Sidebar logo area --- */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-5) var(--sp-4);
    border-bottom: 0.5px solid var(--border-default);
    min-height: 64px;
    flex-shrink: 0;
}

.sidebar-logo-img {
    height: 50px;
    width: auto;
    display: block;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.sidebar.collapsed .sidebar-logo-img {
    height: 22px;
}

.login-logo-img {
    height: 120px;
    width: auto;
    display: block;
}

.sidebar.collapsed .sidebar-logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-logo-sub {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    margin-top: 2px;
    opacity: 0.85;
}

/* --- Sidebar navigation --- */
.sidebar-nav {
    flex: 1;
    padding: var(--sp-3) var(--sp-2);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    padding: var(--sp-4) var(--sp-3) var(--sp-2);
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--ink-tertiary);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    white-space: nowrap;
    overflow: hidden;
    border: 0.5px solid transparent;
    position: relative;
    text-decoration: none;
    user-select: none;
}

.sidebar-item i {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: var(--text-md);
    transition: color var(--duration-fast) var(--ease-snappy);
}

.sidebar-item span {
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.sidebar.collapsed .sidebar-item span {
    opacity: 0;
    width: 0;
}

.sidebar-item:hover {
    color: var(--ink-secondary);
    background: rgba(148, 163, 184, 0.04);
    border-color: var(--border-subtle);
}

.sidebar-item.active {
    color: var(--brand-light);
    background: rgba(34, 255, 160, 0.08);
    border-color: rgba(34, 255, 160, 0.15);
}

.sidebar-item.active i {
    color: var(--brand);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--brand);
    border-radius: 0 2px 2px 0;
}

/* --- Sidebar collapse toggle --- */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-3);
    margin: var(--sp-2);
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    border: 0.5px solid transparent;
    background: none;
    font-size: var(--text-md);
}

.sidebar-toggle:hover {
    color: var(--ink-secondary);
    background: rgba(148, 163, 184, 0.04);
    border-color: var(--border-subtle);
}

/* --- Sidebar footer (user) --- */
.sidebar-footer {
    padding: var(--sp-3) var(--sp-2);
    border-top: 0.5px solid var(--border-default);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface-overlay);
    border: 0.5px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: var(--text-sm);
}

.sidebar-user-info {
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
}

.sidebar-user-name {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--ink-primary);
    line-height: var(--leading-tight);
}

.sidebar-user-plan {
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.sidebar-user-plan.premium {
    color: var(--brand);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    margin-top: var(--sp-1);
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logout:hover {
    color: var(--semantic-danger);
    background: var(--semantic-danger-surface);
}

.sidebar-logout i {
    width: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-logout span {
    opacity: 1;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.sidebar.collapsed .sidebar-logout span {
    opacity: 0;
    width: 0;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--duration-normal) var(--ease-out);
    position: relative;
    z-index: 1;
}

.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
}

.content-area {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-6);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: var(--sp-6);
}

.page-header-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-1);
}

.page-header-line {
    width: 3px;
    height: 40px;
    background: linear-gradient(180deg, var(--brand) 0%, transparent 100%);
    border-radius: 2px;
}

.page-header-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ink-muted);
}

.page-title {
    font-family: var(--font-sans);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--sp-1);
    line-height: var(--leading-tight);
}

.page-subtitle {
    color: var(--brand);
    font-size: var(--text-base);
    font-weight: 600;
    opacity: 0.75;
    letter-spacing: var(--tracking-normal);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--surface-raised);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    margin-bottom: var(--sp-5);
    position: relative;
    overflow: hidden;
    transition: border-color var(--duration-fast) var(--ease-snappy);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.06) 50%, transparent 100%);
}

/* ============================================
   FORM CONTROLS
   ============================================ */
label {
    font-weight: 700;
    color: var(--ink-tertiary);
    font-size: var(--text-xs);
    display: block;
    margin-bottom: var(--sp-2);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    background: var(--control-bg);
    border: 0.5px solid var(--control-border);
    border-radius: var(--radius-md);
    color: var(--ink-primary);
    font-size: var(--text-md);
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-snappy);
    line-height: var(--leading-normal);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--control-focus-ring), 0 0 12px rgba(34, 255, 160, 0.04);
}

input::placeholder,
textarea::placeholder {
    color: var(--ink-muted);
    font-weight: 500;
}

select option {
    background: var(--surface-popover);
    color: #fff;
}

textarea {
    min-height: 68px;
    resize: vertical;
}

/* v2.1: textarea de busca principal — parecer input, não textarea */
textarea#termo {
    min-height: 44px;
    max-height: 44px;
    resize: none;
    overflow: hidden;
    line-height: 20px;
    padding-top: 11px;
    padding-bottom: 11px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.form-group {
    margin-bottom: var(--sp-4);
}

/* ============================================
   UF GRID
   ============================================ */
.uf-box {
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    background: var(--surface-inset);
    margin-bottom: var(--sp-4);
}

.uf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-3);
}

.uf-header label {
    margin-bottom: 0;
}

.uf-actions {
    display: flex;
    gap: var(--sp-2);
}

.uf-actions button {
    padding: var(--sp-1) var(--sp-3);
    font-size: 10px;
    font-weight: 700;
    background: transparent;
    color: var(--brand);
    border: 0.5px solid rgba(34, 255, 160, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--duration-fast) var(--ease-snappy);
    letter-spacing: var(--tracking-wide);
}

.uf-actions button:hover {
    background: var(--brand-surface);
    border-color: rgba(34, 255, 160, 0.5);
}

.uf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    gap: var(--sp-1);
}

.uf-item {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-2);
    background: var(--surface-raised);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--ink-tertiary);
    transition: all var(--duration-fast) var(--ease-snappy);
    letter-spacing: var(--tracking-wide);
}

.uf-item:hover {
    border-color: var(--border-strong);
    color: var(--ink-secondary);
}

.uf-item.checked {
    border-color: rgba(34, 255, 160, 0.35);
    background: var(--brand-surface);
    color: var(--brand-light);
}

.uf-item input {
    display: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    height: 44px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(34, 255, 160, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 8px 20px rgba(34, 255, 160, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-sm {
    padding: var(--sp-2) var(--sp-3);
    height: 32px;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    font-family: var(--font-sans);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

.btn-outline {
    background: transparent;
    border: 0.5px solid rgba(34, 255, 160, 0.3);
    color: var(--brand);
}

.btn-outline:hover {
    background: var(--brand-surface);
    border-color: rgba(34, 255, 160, 0.5);
}

.btn-ghost {
    background: var(--surface-overlay);
    color: var(--ink-secondary);
    border: 0.5px solid var(--border-default);
}

.btn-ghost:hover {
    background: var(--surface-popover);
    color: var(--ink-primary);
    border-color: var(--border-strong);
}

/* ============================================
   TOOLBAR
   ============================================ */
.toolbar {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-4);
}

.toolbar .btn-sm {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: var(--sp-2) var(--sp-4);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 2px 8px rgba(34,255,160,0.12);
}

.toolbar .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 4px 12px rgba(34,255,160,0.2);
}

.toolbar .btn-sm i {
    color: #fff;
}


/* ============================================
   MODO BUTTONS
   ============================================ */
.btn-modo {
    flex: 1;
    padding: var(--sp-3);
    background: var(--surface-overlay);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--ink-muted);
    font-size: var(--text-xs);
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    position: relative;
    letter-spacing: var(--tracking-wide);
}

.btn-modo:hover:not(:disabled) {
    color: var(--ink-secondary);
    border-color: var(--border-strong);
    background: var(--surface-popover);
}

.btn-modo.active {
    background: rgba(34, 255, 160, 0.08);
    border-color: rgba(34, 255, 160, 0.35);
    color: var(--brand-light);
    box-shadow: 0 0 0 1px rgba(34, 255, 160, 0.06);
}

.btn-modo:disabled {
    cursor: not-allowed;
    opacity: 0.25;
}

.esfera-hint {
    font-size: 10px;
    color: var(--ink-muted);
    margin-top: var(--sp-1);
    letter-spacing: var(--tracking-normal);
}

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 14, 0.88);
    backdrop-filter: blur(12px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: var(--sp-4);
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid var(--border-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--ink-tertiary);
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
}

/* ============================================
   STAT GRID
   ============================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.stat-card {
    background: var(--surface-raised);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-3);
    text-align: center;
    transition: all var(--duration-fast) var(--ease-snappy);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.05), transparent);
}

.stat-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.stat-card .number {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    font-variant-numeric: tabular-nums;
}

.stat-card .label {
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-top: var(--sp-1);
}

.stat-grid .stat-card:nth-child(1),
.stat-grid .stat-card:nth-child(2) {
    background: linear-gradient(145deg, var(--surface-overlay) 0%, var(--surface-raised) 100%);
    border-color: var(--border-strong);
}

.stat-grid .stat-card:nth-child(1) .number,
.stat-grid .stat-card:nth-child(2) .number {
    font-size: var(--text-2xl);
    background: linear-gradient(135deg, #fff 0%, var(--ink-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   ITEM GROUP
   ============================================ */
.item-group {
    background: var(--surface-raised);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--sp-5);
    animation: fadeIn 0.3s var(--ease-out) both;
}

.item-header {
    background: linear-gradient(135deg, rgba(34, 255, 160, 0.05) 0%, rgba(59, 130, 246, 0.015) 100%);
    padding: var(--sp-5);
    border-bottom: 0.5px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-header-left {
    flex: 1;
}

.item-header-right {
    display: flex;
    gap: var(--sp-2);
    flex-shrink: 0;
    margin-left: var(--sp-3);
}

.item-title {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-normal);
    margin-bottom: var(--sp-1);
}

.item-subtitle {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    letter-spacing: var(--tracking-normal);
}

/* v2.1: indicador de scroll no item-body */
.item-body {
    max-height: 600px;
    overflow-y: auto;
    position: relative;
}

/* ============================================
   CONFIABILIDADE
   ============================================ */
.badge-conf {
    display: inline-block;
    padding: 2px var(--sp-2);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    margin-left: var(--sp-2);
    letter-spacing: var(--tracking-wide);
}

.conf-alta {
    background: var(--semantic-success-surface);
    color: var(--semantic-success);
    border: 0.5px solid rgba(52, 211, 153, 0.15);
}

.conf-media {
    background: var(--semantic-warning-surface);
    color: var(--semantic-warning);
    border: 0.5px solid rgba(251, 191, 36, 0.15);
}

.conf-baixa {
    background: var(--semantic-danger-surface);
    color: var(--semantic-danger);
    border: 0.5px solid rgba(248, 113, 113, 0.15);
}

/* ============================================
   ITEM STATS ROW
   ============================================ */
.stats-row {
    display: flex;
    align-items: stretch;
    border-bottom: 0.5px solid var(--border-default);
}

.stats-main {
    flex: 0 0 200px;
    background: linear-gradient(135deg, rgba(34, 255, 160, 0.06) 0%, rgba(34, 255, 160, 0.02) 100%);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 0.5px solid var(--border-default);
}

.stats-secondary {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-5);
}

.item-stat {
    text-align: center;
}

.item-stat .val {
    font-family: var(--font-mono);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-normal);
    font-variant-numeric: tabular-nums;
}

.item-stat .lbl {
    font-size: 9px;
    color: var(--ink-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: var(--tracking-wider);
}

.item-stat.destaque .val {
    color: var(--brand);
}

/* ============================================
   TABS
   ============================================ */
.item-tabs {
    display: flex;
    border-bottom: 0.5px solid var(--border-strong);
    background: var(--surface-inset);
    overflow-x: auto;
}

.item-tab {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--ink-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--duration-fast) var(--ease-snappy);
    white-space: nowrap;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.item-tab:hover {
    color: var(--ink-secondary);
    background: rgba(148, 163, 184, 0.03);
}

.item-tab.active {
    color: var(--brand-light);
    border-bottom-color: var(--brand);
    background: rgba(34, 255, 160, 0.03);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--surface-inset);
    color: var(--ink-muted);
    padding: var(--sp-3);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: left;
    letter-spacing: var(--tracking-caps);
    white-space: nowrap;
    border-bottom: 0.5px solid var(--border-strong);
    position: sticky;
    z-index: 2;
    top: 0;
}

tbody td {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-base);
    border-bottom: 0.5px solid var(--border-subtle);
    color: var(--ink-secondary);
    transition: color var(--duration-fast) var(--ease-snappy);
}

tbody tr {
    transition: background var(--duration-fast) var(--ease-snappy);
}

/* v2.1: hover mais visível */
tbody tr:hover {
    background: rgba(34, 255, 160, 0.06);
}

tbody tr:hover td {
    color: var(--ink-primary);
}

.valor-cell {
    font-weight: 700;
    color: var(--ink-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-normal);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
}

.badge-uf { background: var(--accent-blue-surface); color: #60a5fa; }
.badge-federal { background: var(--brand-surface); color: var(--brand-light); }
.badge-estadual { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.badge-municipal { background: var(--semantic-success-surface); color: var(--semantic-success); }

.badge-limpo {
    background: var(--semantic-success-surface);
    color: var(--semantic-success);
    padding: 3px var(--sp-3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    border: 0.5px solid rgba(52, 211, 153, 0.15);
}

.badge-sancionado {
    background: var(--semantic-danger-surface);
    color: var(--semantic-danger);
    padding: 3px var(--sp-3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    border: 0.5px solid rgba(248, 113, 113, 0.15);
}

.badge-cepim {
    background: var(--semantic-warning-surface);
    color: var(--semantic-warning);
    padding: 3px var(--sp-3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    border: 0.5px solid rgba(251, 191, 36, 0.15);
}

.obj-row td {
    padding: var(--sp-1) var(--sp-3) var(--sp-3) !important;
    font-size: var(--text-xs) !important;
    color: var(--ink-muted) !important;
    border-bottom: 0.5px solid var(--border-strong) !important;
    background: rgba(0, 0, 0, 0.15) !important;
}

.link-pncp {
    color: var(--accent-blue);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    opacity: 0.5;
}

.link-pncp:hover {
    color: var(--brand-light);
    opacity: 1;
}

/* ============================================
   COMPARE BAR
   ============================================ */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: rgba(14, 17, 24, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--brand);
    padding: var(--sp-4) var(--sp-5);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    transition: left var(--duration-normal) var(--ease-out);
}

.compare-bar.active {
    display: flex;
}

body.sidebar-collapsed .compare-bar {
    left: var(--sidebar-collapsed);
}

.compare-bar span {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--ink-secondary);
}

.compare-bar .count {
    color: var(--brand);
    font-weight: 800;
    font-family: var(--font-mono);
}

.compare-cb {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
    cursor: pointer;
}

/* ============================================
   CHART
   ============================================ */
.chart-container {
    padding: var(--sp-4) var(--sp-5);
    height: 250px;
    position: relative;
}

/* ============================================
   MINI LOADER
   ============================================ */
.mini-loader {
    text-align: center;
    padding: var(--sp-8);
    color: var(--ink-muted);
    font-size: var(--text-base);
}

.mini-loader i {
    margin-right: var(--sp-2);
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ============================================
   VER MAIS
   ============================================ */
.ver-mais-row {
    text-align: center;
    padding: var(--sp-3);
}

.ver-mais-row button {
    background: transparent;
    border: 0.5px solid var(--border-default);
    color: var(--ink-muted);
    padding: var(--sp-2) var(--sp-5);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    font-family: var(--font-sans);
    letter-spacing: var(--tracking-wide);
}

.ver-mais-row button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.no-results {
    text-align: center;
    padding: var(--sp-12) var(--sp-5);
}

.no-results i {
    font-size: 36px;
    color: var(--ink-muted);
    margin-bottom: var(--sp-4);
    opacity: 0.3;
}

.no-results h3 {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--ink-primary);
    margin-bottom: var(--sp-2);
    letter-spacing: var(--tracking-normal);
}

.no-results p {
    color: var(--ink-muted);
    font-size: var(--text-base);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: var(--sp-5);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface-overlay);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* v2.1: transição de entrada nos modais */
.modal-overlay.active .modal-content {
    animation: modalIn 0.2s var(--ease-out) both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 0.5px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-normal);
}

.modal-close {
    background: none;
    border: none;
    color: var(--ink-muted);
    font-size: var(--text-xl);
    cursor: pointer;
    transition: color var(--duration-fast);
    padding: var(--sp-1);
}

.modal-close:hover {
    color: var(--ink-primary);
}

.modal-body {
    padding: var(--sp-6);
}

/* ============================================
   COMPARE MODAL
   ============================================ */
.compare-grid {
    display: grid;
    gap: var(--sp-4);
}

.compare-card {
    background: var(--surface-raised);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
}

.compare-card h4 {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--ink-primary);
    margin-bottom: var(--sp-3);
    letter-spacing: var(--tracking-normal);
}

.compare-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
}

.compare-stat {
    text-align: center;
}

.compare-stat .val {
    font-family: var(--font-mono);
    font-size: var(--text-base);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.compare-stat .lbl {
    font-size: 9px;
    color: var(--ink-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

/* ============================================
   HELP OVERLAY
   ============================================ */
.help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 14, 0.88);
    backdrop-filter: blur(8px);
    z-index: 300;
    justify-content: center;
    align-items: flex-start;
    padding: var(--sp-10) var(--sp-5);
    overflow-y: auto;
}

.help-overlay.active {
    display: flex;
}

.help-content {
    background: var(--surface-overlay);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* v2.1: transição de entrada no help */
.help-overlay.active .help-content {
    animation: modalIn 0.2s var(--ease-out) both;
}

.help-header {
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 0.5px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--surface-overlay);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 2;
}

.help-header h2 {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-normal);
}

.help-close {
    background: none;
    border: none;
    color: var(--ink-muted);
    font-size: var(--text-xl);
    cursor: pointer;
    transition: color var(--duration-fast);
}

.help-close:hover {
    color: var(--ink-primary);
}

.help-body {
    padding: var(--sp-6);
}

.help-section {
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-6);
    border-bottom: 0.5px solid var(--border-default);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section-title {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--brand);
    margin-bottom: var(--sp-3);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    letter-spacing: var(--tracking-wide);
}

.help-section-title i {
    width: 20px;
    text-align: center;
}

.help-text {
    font-size: var(--text-base);
    color: var(--ink-secondary);
    line-height: var(--leading-relaxed);
}

.help-text strong {
    color: var(--ink-primary);
}

.help-badge {
    display: inline-block;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    margin: 0 2px;
}

.help-badge-green { background: var(--semantic-success-surface); color: var(--semantic-success); }
.help-badge-yellow { background: var(--semantic-warning-surface); color: var(--semantic-warning); }
.help-badge-red { background: var(--semantic-danger-surface); color: var(--semantic-danger); }

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    position: fixed;
    bottom: var(--sp-5);
    right: 80px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-overlay);
    border: 0.5px solid var(--border-default);
    color: var(--ink-muted);
    font-size: var(--text-md);
    cursor: pointer;
    z-index: 40;
    transition: all var(--duration-fast) var(--ease-snappy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--surface-popover);
    color: var(--ink-primary);
    border-color: var(--border-strong);
    transform: scale(1.05);
}

/* ============================================
   HELP BUTTON
   ============================================ */
.btn-help {
    position: fixed;
    bottom: var(--sp-5);
    right: var(--sp-5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    border: none;
    font-size: var(--text-lg);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 255, 160, 0.2), 0 0 0 0.5px rgba(34, 255, 160, 0.1);
    z-index: 40;
    transition: all var(--duration-normal) var(--ease-out);
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-help:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(34, 255, 160, 0.3);
}

/* ============================================
   FORNECEDOR COMPONENTS
   ============================================ */
.forn-search-result {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 0.5px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-sm);
    margin: 0 calc(var(--sp-1) * -1);
}

.forn-search-result:hover {
    background: var(--brand-surface);
    border-color: rgba(34, 255, 160, 0.08);
}

.forn-search-result .forn-name {
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--ink-primary);
}

.forn-search-result .forn-meta {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    margin-top: 2px;
}

.forn-search-result .forn-badges {
    display: flex;
    gap: var(--sp-1);
    flex-shrink: 0;
    margin-left: var(--sp-3);
}

.forn-header-card {
    background: linear-gradient(145deg, rgba(34, 255, 160, 0.04) 0%, var(--surface-raised) 60%, rgba(59, 130, 246, 0.015) 100%);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    margin-bottom: var(--sp-5);
    position: relative;
    overflow: hidden;
}

.forn-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(34, 255, 160, 0.12), transparent 50%);
}

.forn-empresa {
    font-family: var(--font-sans);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--ink-primary);
    margin-bottom: var(--sp-1);
    letter-spacing: var(--tracking-tight);
}

.forn-cnpj {
    font-size: var(--text-md);
    color: var(--brand);
    font-weight: 700;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

.forn-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    margin-top: var(--sp-3);
}

.forn-detail {
    font-size: var(--text-sm);
    color: var(--ink-tertiary);
}

.forn-detail strong {
    color: var(--ink-secondary);
    font-weight: 700;
}

.forn-tabs {
    display: flex;
    border-bottom: 0.5px solid var(--border-strong);
    background: var(--surface-inset);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow-x: auto;
}

.forn-tab {
    padding: var(--sp-3) var(--sp-5);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--ink-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--duration-fast) var(--ease-snappy);
    white-space: nowrap;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.forn-tab:hover {
    color: var(--ink-secondary);
    background: rgba(148, 163, 184, 0.03);
}

.forn-tab.active {
    color: var(--brand-light);
    border-bottom-color: var(--brand);
    background: rgba(34, 255, 160, 0.03);
}

.forn-tab-content {
    display: none;
}

.forn-tab-content.active {
    display: block;
}

.forn-tab-panel {
    background: var(--surface-raised);
    border: 0.5px solid var(--border-default);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: var(--sp-5);
    margin-bottom: var(--sp-5);
}

.forn-voltar {
    background: transparent;
    border: 0.5px solid var(--border-default);
    color: var(--ink-muted);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--duration-fast) var(--ease-snappy);
    margin-bottom: var(--sp-4);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    letter-spacing: var(--tracking-wide);
}

.forn-voltar:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-surface);
}

.sancao-card {
    background: var(--semantic-danger-surface);
    border: 0.5px solid rgba(248, 113, 113, 0.15);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
}

.sancao-card .sancao-fonte {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--semantic-danger);
    margin-bottom: var(--sp-2);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.sancao-card .sancao-detail {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    margin-bottom: var(--sp-1);
}

.sancao-card .sancao-detail strong {
    color: var(--ink-primary);
}

/* ============================================
   SECTION DIVIDER
   ============================================ */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-strong) 50%, transparent 100%);
    margin: var(--sp-5) 0;
}

/* ============================================
   UTILITY
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    color: var(--ink-muted);
    font-size: 10px;
    margin-top: var(--sp-12);
    padding: var(--sp-5);
    letter-spacing: var(--tracking-wider);
    opacity: 0.6;
}

/* ============================================
   BATCH IMPORT
   ============================================ */
.batch-progress-bar {
    height: 6px;
    background: var(--surface-inset);
    border-radius: 3px;
    overflow: hidden;
    margin: var(--sp-3) 0;
}

.batch-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    border-radius: 3px;
    transition: width 0.4s var(--ease-out);
}

.batch-item-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 0.5px solid var(--border-subtle);
    font-size: var(--text-sm);
    transition: background var(--duration-fast);
}

.batch-item-row:hover {
    background: rgba(34, 255, 160, 0.03);
}

.batch-item-row .seq {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--text-xs);
    color: var(--ink-muted);
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.batch-item-row .desc {
    flex: 1;
    color: var(--ink-primary);
    font-weight: 600;
}

.batch-item-row .val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--brand);
    min-width: 100px;
    text-align: right;
}

.batch-item-row .status-icon {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.batch-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-xs);
    margin: var(--sp-3) 0;
}

.batch-preview-table th {
    background: var(--surface-inset);
    padding: var(--sp-2) var(--sp-3);
    text-align: left;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink-muted);
    letter-spacing: var(--tracking-wider);
}

.batch-preview-table td {
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 0.5px solid var(--border-subtle);
    color: var(--ink-secondary);
}

.batch-col-select {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--text-xs);
    background: var(--control-bg);
    border: 0.5px solid var(--control-border);
    border-radius: var(--radius-sm);
    color: var(--ink-primary);
    font-family: var(--font-sans);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

/* ============================================
   AUTOCOMPLETE DROPDOWN
   ============================================ */
/* v2.1: estilização do dropdown de autocomplete CATMAT */
#autocompleteDropdown > div {
    padding: var(--sp-2) var(--sp-4);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    border-bottom: 0.5px solid var(--border-subtle);
    transition: background var(--duration-fast) var(--ease-snappy), color var(--duration-fast) var(--ease-snappy);
}

#autocompleteDropdown > div:last-child {
    border-bottom: none;
}

#autocompleteDropdown > div:hover {
    background: var(--brand-surface);
    color: var(--ink-primary);
}

/* ============================================
   BOTTOM BAR — MOBILE
   ============================================ */
.bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-bar-height);
    background: rgba(10, 13, 20, 0.96);
    backdrop-filter: blur(16px);
    border-top: 0.5px solid var(--border-default);
    z-index: 30;
    padding: 0 var(--sp-2);
    align-items: center;
    justify-content: space-around;
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--sp-2) var(--sp-3);
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-snappy);
    border: none;
    background: none;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
    min-width: 56px;
}

.bottom-bar-item i {
    font-size: var(--text-lg);
    transition: color var(--duration-fast) var(--ease-snappy);
}

.bottom-bar-item.active {
    color: var(--brand);
}

.bottom-bar-item.active i {
    color: var(--brand);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--sp-5);
    position: relative;
    z-index: 1;
}

.login-container {
    max-width: 420px;
    width: 100%;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    justify-content: center;
    margin-bottom: var(--sp-6);
}

.login-brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(34, 255, 160, 0.25), 0 0 0 1px rgba(34, 255, 160, 0.1);
}

.login-brand-icon i {
    font-size: 22px;
    color: #fff;
}

.login-brand-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-brand-name {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 800;
    color: var(--ink-primary);
    line-height: 1;
    letter-spacing: -1px;
}

.login-brand-sub {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: -4px;
    opacity: 0.85;
    text-align: center;
    width: 100%;
    padding-right: 3px;
}

.login-description {
    color: var(--ink-muted);
    font-size: var(--text-base);
    max-width: 420px;
    margin: 0 auto var(--sp-2);
    line-height: var(--leading-relaxed);
    text-align: center;
}

.login-stats {
    display: flex;
    justify-content: center;
    gap: var(--sp-8);
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-8);
}

.login-stat {
    text-align: center;
}

.login-stat-number {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: var(--tracking-tight);
}

.login-stat-number .accent {
    font-size: var(--text-sm);
    color: var(--brand);
    font-weight: 700;
}

.login-stat-label {
    font-size: 9px;
    color: var(--ink-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    margin-top: 2px;
}

.login-divider {
    width: 0.5px;
    background: var(--border-strong);
    align-self: stretch;
}

.login-footer {
    text-align: center;
    margin-top: var(--sp-6);
    font-size: 10px;
    color: var(--ink-muted);
    letter-spacing: var(--tracking-wider);
    opacity: 0.5;
}

/* ============================================
   LIGHT THEME
   ============================================ */
body.light {
    --ink-primary: #0c1222;
    --ink-secondary: #374151;
    --ink-tertiary: #6b7280;
    /* v2.1: escurecido de #9ca3af para #6b7280 — WCAG AA em fundo claro */
    --ink-muted: #6b7280;

    --surface-base: #f7f8fa;
    --surface-raised: rgba(255, 255, 255, 0.92);
    --surface-overlay: rgba(255, 255, 255, 0.95);
    --surface-popover: #ffffff;
    --surface-inset: #f1f3f5;
    --surface-sidebar: #f0f1f4;

    --border-default: rgba(15, 23, 42, 0.06);
    --border-subtle: rgba(15, 23, 42, 0.03);
    --border-strong: rgba(15, 23, 42, 0.1);

    --control-bg: #fff;
    --control-border: rgba(15, 23, 42, 0.08);
    --control-focus-ring: rgba(34, 255, 160, 0.12);

    --brand-surface: rgba(34, 255, 160, 0.04);
    --brand-glow: rgba(34, 255, 160, 0.08);
    --brand-light: var(--brand);
}

body.light::before {
    opacity: 0.4;
}

body.light::after {
    opacity: 0;
}

body.light .card,
body.light .item-group {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 0.5px rgba(15, 23, 42, 0.03);
}

body.light .card::before {
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.03), transparent);
}

body.light .stat-card {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

body.light .stat-grid .stat-card:nth-child(1) .number,
body.light .stat-grid .stat-card:nth-child(2) .number {
    background: linear-gradient(135deg, var(--ink-primary) 0%, var(--ink-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light .forn-header-card {
    background: linear-gradient(145deg, rgba(34, 255, 160, 0.03) 0%, var(--surface-raised) 60%, rgba(59, 130, 246, 0.015) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light .forn-header-card::before {
    background: linear-gradient(90deg, rgba(34, 255, 160, 0.08), transparent 50%);
}

body.light .loading-overlay {
    background: rgba(247, 248, 250, 0.92);
}

body.light .item-header {
    background: linear-gradient(135deg, rgba(34, 255, 160, 0.03) 0%, rgba(59, 130, 246, 0.01) 100%);
}

body.light .stats-main {
    background: linear-gradient(135deg, rgba(34, 255, 160, 0.04) 0%, rgba(34, 255, 160, 0.01) 100%);
}

body.light .obj-row td {
    background: rgba(249, 250, 251, 0.8) !important;
}

body.light .compare-bar {
    background: rgba(255, 255, 255, 0.95);
}

body.light .uf-box {
    background: var(--surface-inset);
}

body.light select option {
    background: #fff;
    color: #1a1a2e;
}

body.light .modal-content,
body.light .modal-header,
body.light .help-content,
body.light .help-header {
    background: #f8f9fb;
}

body.light .batch-col-select {
    background: #fff;
    color: #1a1a2e;
}

body.light input,
body.light select,
body.light textarea {
    color: #1a1a2e;
}

body.light .sidebar {
    background: var(--surface-sidebar);
}

body.light .sidebar-item.active {
    background: rgba(34, 255, 160, 0.06);
}

body.light .bottom-bar {
    background: rgba(240, 241, 244, 0.96);
}

/* v2.1: hover de tabelas no tema claro — mais visível */
body.light tbody tr:hover {
    background: rgba(34, 255, 160, 0.04);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-muted);
}

::selection {
    background: rgba(34, 255, 160, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.forn-header-card {
    animation: fadeIn 0.3s var(--ease-out) both;
}

.stat-card {
    animation: fadeIn 0.25s var(--ease-out) both;
}

.stat-grid .stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-grid .stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-grid .stat-card:nth-child(3) { animation-delay: 0.09s; }
.stat-grid .stat-card:nth-child(4) { animation-delay: 0.12s; }
.stat-grid .stat-card:nth-child(5) { animation-delay: 0.15s; }
.stat-grid .stat-card:nth-child(6) { animation-delay: 0.18s; }
.stat-grid .stat-card:nth-child(7) { animation-delay: 0.21s; }
.stat-grid .stat-card:nth-child(8) { animation-delay: 0.24s; }

/* ============================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 64px;
    }

    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .sidebar-logo-text,
    .sidebar .sidebar-section-label,
    .sidebar .sidebar-item span,
    .sidebar .sidebar-user-info,
    .sidebar .sidebar-logout span {
        opacity: 0;
        width: 0;
    }

    .sidebar .sidebar-section-label {
        height: 0;
        padding: 0;
        margin: 0;
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .compare-bar {
        left: var(--sidebar-collapsed);
    }

    .content-area {
        padding: var(--sp-6) var(--sp-4);
    }
}

/* ============================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .bottom-bar {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-bar-height) + var(--sp-4));
    }

    .compare-bar {
        left: 0;
        bottom: var(--bottom-bar-height);
    }

    .content-area {
        padding: var(--sp-5) var(--sp-3);
    }

    .page-title {
        font-size: var(--text-2xl);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card .number {
        font-size: var(--text-md);
    }

    .stat-grid .stat-card:nth-child(1) .number,
    .stat-grid .stat-card:nth-child(2) .number {
        font-size: var(--text-lg);
    }

    .forn-empresa {
        font-size: var(--text-xl);
    }

    .item-header {
        flex-direction: column;
    }

    .item-header-right {
        margin-left: 0;
        margin-top: var(--sp-3);
    }

    .stats-row {
        flex-direction: column;
    }

    .stats-main {
        flex: unset;
        width: 100%;
        border-right: none;
        border-bottom: 0.5px solid var(--border-default);
    }

    .stats-secondary {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-tabs,
    .forn-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .compare-stats {
        grid-template-columns: 1fr 1fr;
    }

    thead th,
    tbody td {
        padding: var(--sp-2);
        font-size: var(--text-xs);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .login-stats {
        gap: var(--sp-4);
    }

    .login-stat-number {
        font-size: var(--text-xl);
    }

    .theme-toggle,
    .btn-help {
        bottom: calc(var(--bottom-bar-height) + var(--sp-3));
    }

    .modal-content {
        max-height: 85vh;
        margin: auto var(--sp-2);
    }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .content-area {
        padding: var(--sp-4) var(--sp-2);
    }

    .card {
        padding: var(--sp-4);
        border-radius: var(--radius-md);
    }

    .page-title {
        font-size: var(--text-xl);
    }

    .login-stats {
        flex-wrap: wrap;
        gap: var(--sp-4);
    }

    .login-divider {
        display: none;
    }

    .bottom-bar-item {
        min-width: 48px;
        padding: var(--sp-2) var(--sp-1);
        font-size: 8px;
    }

    .forn-tabs {
        gap: 0;
    }

    .forn-tab {
        padding: var(--sp-3) var(--sp-3);
        font-size: 10px;
    }
}

/* ============================================
   SKELETON PULSE — v2.1
   ============================================ */
.skeleton-pulse {
    background: linear-gradient(90deg, var(--border-default) 25%, var(--border-strong) 50%, var(--border-default) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    display: block;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.light .skeleton-pulse {
    background: linear-gradient(90deg, rgba(15,23,42,0.04) 25%, rgba(15,23,42,0.08) 50%, rgba(15,23,42,0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}


/* ============================================
   CATMAT CATEGORY BAR
   ============================================ */
.cat-bar {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-overlay);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-md);
}

.cat-filter {
    padding: var(--sp-1) var(--sp-3) !important;
    height: 26px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: var(--tracking-wide) !important;
    text-transform: uppercase !important;
    border-radius: 20px !important;
    background: var(--surface-inset) !important;
    color: var(--ink-muted) !important;
    border: 0.5px solid var(--border-default) !important;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-snappy) !important;
    white-space: nowrap;
    line-height: 1 !important;
}

.cat-filter:hover {
    color: var(--ink-secondary) !important;
    border-color: var(--border-strong) !important;
    background: var(--surface-popover) !important;
}

.cat-filter.active {
    background: rgba(34, 255, 160, 0.1) !important;
    color: var(--brand-light) !important;
    border-color: rgba(34, 255, 160, 0.3) !important;
}

/* ============================================
   CATMAT HIERARCHY LINE (inside item-header)
   ============================================ */
.item-hierarquia {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: 10px;
    color: var(--ink-muted);
    margin-top: var(--sp-1);
    line-height: var(--leading-tight);
    max-width: 100%;
    overflow: hidden;
}

.item-hierarquia i {
    color: var(--brand);
    font-size: 9px;
    flex-shrink: 0;
    opacity: 0.7;
}

.item-hierarquia span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   COMPOSICAO LINE (Federal · Estadual · Municipal)
   ============================================ */
.item-composicao {
    font-size: 10px;
    color: var(--ink-muted);
    margin-top: var(--sp-1);
    opacity: 0.7;
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
body.light .cat-bar {
    background: var(--surface-raised);
}

body.light .cat-filter {
    background: var(--surface-inset) !important;
    color: var(--ink-tertiary) !important;
}

body.light .cat-filter.active {
    background: rgba(34, 255, 160, 0.08) !important;
    color: var(--brand) !important;
}

body.light .item-hierarquia {
    color: var(--ink-tertiary);
}

/* ============================================
   ITEM CONSOLIDADO
   ============================================ */
.item-consolidado {
    border: 2.5px solid var(--brand) !important;
    background: rgba(34,255,160,0.04) !important;
    box-shadow: 0 0 0 4px rgba(34,255,160,0.1), 0 4px 24px rgba(34,255,160,0.18) !important;
}

.item-consolidado .item-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%) !important;
    border-bottom-color: rgba(34,255,160,0.3) !important;
}

.item-consolidado .item-header .item-title,
.item-consolidado .item-header .item-title span {
    color: #fff !important;
}

.item-consolidado .item-header .item-subtitle {
    color: rgba(255,255,255,0.7) !important;
}

.item-consolidado .item-header .item-composicao {
    color: rgba(255,255,255,0.5) !important;
}

.item-consolidado .item-header .item-chevron {
    color: rgba(255,255,255,0.6) !important;
}

.item-consolidado .item-header .badge-conf {
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: #fff !important;
}

.item-consolidado .item-header .btn-outline {
    border-color: rgba(255,255,255,0.3) !important;
    color: #fff !important;
}

.item-consolidado .item-header .btn-outline:hover {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.5) !important;
}

body.light .item-consolidado {
    border-color: var(--brand) !important;
    background: rgba(34,255,160,0.03) !important;
    box-shadow: 0 0 0 4px rgba(34,255,160,0.08), 0 4px 24px rgba(34,255,160,0.12) !important;
}

/* ================================================================
   BANNER TRIAL — E10.5
   ================================================================ */

.banner-trial {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-radius: 8px;
  margin: 0 0 20px 0;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  border: 0.5px solid transparent;
}

.banner-trial-trial {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.banner-trial-vencido {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.banner-trial-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.banner-trial-msg i {
  font-size: 16px;
  flex-shrink: 0;
}

.banner-trial-msg span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-trial-msg strong {
  font-weight: 700;
  color: inherit;
}

.banner-trial-actions {
  position: relative;
  flex-shrink: 0;
}

.banner-trial-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
  transition: filter 0.15s, transform 0.15s;
}

.banner-trial-vencido .banner-trial-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.banner-trial-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.banner-trial-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface-overlay, #1a1a1a);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}

.banner-trial-dropdown.open {
  display: block;
  animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.banner-trial-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink-primary, #e5e5e5);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.12s;
}

.banner-trial-dropdown a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.banner-trial-dropdown a i {
  width: 16px;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 768px) {
  .banner-trial {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    font-size: 12px;
  }
  .banner-trial-actions {
    width: 100%;
  }
  .banner-trial-btn {
    width: 100%;
    justify-content: center;
  }
  .banner-trial-dropdown {
    right: 0;
    left: 0;
    min-width: 0;
  }
}

/* ================================================================
   MODAL EMAIL (banner trial)
   ================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.15s ease-out;
}

.modal-box {
  background: var(--surface-overlay, #1a1a1a);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary, #e5e5e5);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: #22c55e;
}

.modal-close {
  background: none;
  border: none;
  color: var(--ink-muted, #888);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-primary, #e5e5e5);
}

.modal-body {
  padding: 20px;
}

.modal-text {
  margin: 0 0 14px 0;
  font-size: 13px;
  color: var(--ink-secondary, #b5b5b5);
}

.modal-copybox {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-copybox input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink-primary, #e5e5e5);
  font-size: 13px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  outline: none;
}

.modal-copybox input:focus {
  border-color: rgba(34, 197, 94, 0.5);
}

.modal-copybtn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #000;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: filter 0.15s;
}

.modal-copybtn:hover {
  filter: brightness(1.1);
}

.modal-copybtn.copied {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.modal-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted, #888);
}

.modal-hint strong {
  color: var(--ink-secondary, #b5b5b5);
  font-weight: 600;
}

@media (max-width: 480px) {
  .modal-copybox {
    flex-direction: column;
  }
  .modal-copybtn {
    width: 100%;
    justify-content: center;
  }
}

/* Banner trial atenção (<48h restantes) — laranja, mais leve que vencido */
.banner-trial-atencao {
  background: linear-gradient(135deg, rgba(255,182,39,0.12), rgba(255,138,0,0.08));
  border: 0.5px solid rgba(255,182,39,0.35);
  color: #FFB627;
}
.banner-trial-atencao .banner-trial-msg i { color: #FFB627; }

/* ============================================================================
   E13 — HUNTING DE EDITAIS
   ============================================================================ */

.hunting-search-card { padding: var(--sp-4); margin-bottom: var(--sp-4); }

.hunting-search-row {
  display: flex; gap: var(--sp-3); align-items: stretch;
}

.hunting-search-input {
  flex: 1; position: relative;
  display: flex; align-items: center;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 var(--sp-3);
  transition: border-color 0.15s;
}
.hunting-search-input:focus-within { border-color: var(--brand); }
.hunting-search-input i.fa-magnifying-glass {
  color: var(--text-muted); margin-right: var(--sp-2);
}
.hunting-search-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: var(--text-md);
  padding: var(--sp-3) 0; font-family: inherit;
}
.hunting-clear {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: var(--sp-1); border-radius: var(--radius-sm);
}
.hunting-clear:hover { background: var(--surface-overlay); color: var(--text-primary); }

.filtros-badge {
  display: inline-block;
  background: var(--brand); color: #000;
  border-radius: 999px; padding: 0 6px;
  font-size: 11px; font-weight: 700;
  margin-left: 4px;
}

.hunting-filtros {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-default);
}
.hunting-filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.hunting-filtros-acoes {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.chip-group {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--text-sm);
  user-select: none;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand); }
.chip input { margin: 0; cursor: pointer; }
.chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #000;
  font-weight: 600;
}

.hunting-stats {
  padding: var(--sp-2) var(--sp-1);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.hunting-stats-label strong { color: var(--text-primary); }

.hunting-resultados {
  display: flex; flex-direction: column; gap: var(--sp-3);
}

.hunting-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: border-color 0.15s, transform 0.15s;
}
.hunting-card:hover { border-color: var(--brand); }

.hunting-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-3); margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}
.hunting-card-badges {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.hunting-card-valor {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

.hunting-card-titulo {
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 var(--sp-3) 0;
  color: var(--text-primary);
}

.hunting-card-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}
.hunting-card-meta i { color: var(--text-muted); margin-right: 4px; }

.hunting-card-acoes {
  display: flex; gap: var(--sp-2);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--sp-3);
}

.hunting-paginacao {
  display: flex; justify-content: center; align-items: center;
  gap: var(--sp-3); margin-top: var(--sp-5);
  font-size: var(--text-sm); color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: var(--sp-3); display: block; }
.empty-state h3 { margin: 0 0 var(--sp-2) 0; color: var(--text-primary); }
.empty-state p { margin: 0; }

.loading-inline {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  color: var(--text-muted);
}
.loading-inline i { margin-right: var(--sp-2); }

/* Badges (caso não existam — adicionar tons faltantes) */
.badge-muted { background: var(--surface-overlay); color: var(--text-muted); }
.badge-outline { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); }

@media (max-width: 768px) {
  .hunting-card-head { flex-direction: column; }
  .hunting-card-valor { align-self: flex-start; }
  .hunting-filtros-grid { grid-template-columns: 1fr; }
}


/* ==== LOGO SIDEBAR (PATCH #16.2) ==== */
.sidebar-brand {
  display: block;
  padding: 12px 8px;
  text-decoration: none;
  margin-bottom: 8px;
}
.sidebar-brand img {
  max-width: 140px;
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 768px) {
  .sidebar-brand img { max-width: 110px; }
}



/* ==== LOGO LOGIN (PATCH #16.2) ==== */
.login-logo-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto 24px;
}
@media (max-width: 480px) {
  .login-logo-img { max-width: 220px; }
}

/* PATCH #17 — links externos no item de alerta do dashboard */
.alerta-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.alerta-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.alerta-links a:hover { text-decoration: underline; }



/* ============== ÓRGÃO (E19) ============== */
.orgao-card-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.orgao-card-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-overlay); border: 0.5px solid var(--border-default);
  border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4);
  cursor: pointer; transition: border-color 120ms, transform 120ms;
}
.orgao-card-row:hover { border-color: var(--brand); transform: translateY(-1px); }
.orgao-card-nome { color: var(--ink-primary); font-weight: 600; font-size: 13px; }
.orgao-card-meta { color: var(--ink-muted); font-size: 11px; margin-top: 2px; }
.orgao-card-total { text-align: right; }
.orgao-card-num { color: var(--brand); font-weight: 700; font-size: 13px; }
.orgao-card-lbl { color: var(--ink-muted); font-size: 10px; }

.orgao-header-card { padding: var(--sp-4) var(--sp-5); }
.orgao-header-nome { font-size: 20px; font-weight: 700; color: var(--ink-primary); }
.orgao-header-meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-2); font-size: 12px; color: var(--ink-secondary); }
.orgao-header-meta strong { color: var(--ink-muted); font-weight: 500; }

.capag-card { padding: var(--sp-4); }
.capag-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.capag-title { font-size: 13px; font-weight: 700; color: var(--ink-primary); }
.capag-letra {
  font-weight: 800; font-size: 22px; padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-sm); min-width: 48px; text-align: center;
}
.capag-letra-success { background: var(--semantic-success-surface); color: var(--semantic-success); }
.capag-letra-warning { background: var(--semantic-warning-surface); color: var(--semantic-warning); }
.capag-letra-danger  { background: var(--semantic-danger-surface);  color: var(--semantic-danger);  }
.capag-success { border-color: rgba(34,197,94,0.18); }
.capag-warning { border-color: rgba(234,179,8,0.18); }
.capag-danger  { border-color: rgba(239,68,68,0.18); }
.capag-info    { border-color: rgba(99,102,241,0.18); }
.capag-notas { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: 12px; color: var(--ink-secondary); }
.capag-notas strong { color: var(--ink-muted); font-weight: 500; }
.capag-obs { margin-top: var(--sp-3); font-size: 11px; color: var(--ink-muted); line-height: 1.5; }
.capag-mensagem { font-size: 12px; color: var(--ink-secondary); }

.pca-card { padding: var(--sp-4); border-color: rgba(99,102,241,0.18); }
.pca-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.pca-row i { font-size: 18px; color: var(--accent-blue, #6366f1); }
.pca-title { font-size: 13px; font-weight: 700; color: var(--ink-primary); }
.pca-corpo { font-size: 13px; color: var(--ink-secondary); line-height: 1.6; }
.pca-corpo strong { color: var(--accent-blue, #6366f1); }

.table-dense { width: 100%; border-collapse: collapse; font-size: 12px; }
.table-dense thead th { text-align: left; padding: var(--sp-2) var(--sp-3); color: var(--ink-muted); font-weight: 600; border-bottom: 0.5px solid var(--border-strong); background: var(--surface-raised); position: sticky; top: 0; z-index: 1; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.table-dense tbody td { padding: var(--sp-2) var(--sp-3); border-bottom: 0.5px solid var(--border-default); vertical-align: top; }
.table-dense tbody tr:hover { background: var(--surface-overlay); }
.td-center { text-align: center; }
.td-val { text-align: right; font-variant-numeric: tabular-nums; }
.td-min { color: var(--semantic-success); }
.td-max { color: var(--semantic-danger); }
.td-total { color: var(--brand); font-weight: 600; }
.td-desc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-desc-multi { max-width: 320px; white-space: normal; line-height: 1.4; font-size: 11px; }
.td-codigo { color: var(--ink-muted); font-size: 11px; }
.td-sub { color: var(--ink-muted); font-size: 10px; }
.table-meta { font-size: 11px; color: var(--ink-muted); padding: var(--sp-2) var(--sp-4); }
.row-clickable { cursor: pointer; }
.row-detalhe td { background: var(--surface-inset); padding: var(--sp-3) var(--sp-4); }
.detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-6); font-size: 12px; color: var(--ink-secondary); }
.detalhe-grid strong { color: var(--ink-muted); font-weight: 500; }
.detalhe-info { margin-top: var(--sp-2); font-size: 11px; color: var(--ink-muted); line-height: 1.5; }
.link-pncp { color: var(--brand); }
.pager { display: flex; justify-content: center; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); }
.pager-info { color: var(--ink-muted); font-size: 11px; }
.empty-tab { text-align: center; padding: var(--sp-6); color: var(--ink-muted); }
.empty-tab i { font-size: 20px; opacity: 0.5; margin-bottom: var(--sp-2); display: block; }
.upgrade-cta { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-3); background: var(--surface-overlay); border: 0.5px dashed var(--brand); border-radius: var(--radius-sm); color: var(--ink-secondary); font-size: 12px; }
.upgrade-cta i { color: var(--brand); }
.upgrade-cta a { color: var(--brand); margin-left: var(--sp-1); }


