/* ============================================================
   styles.css — v2.0 — RESPONSIVE & POLISHED
   Identidade: Laranja #F58220 | Azul #2E3192 | Gold #FFB347
   Abordagem: Mobile-first, breakpoints unificados
   ============================================================ */

/* ── DESIGN TOKENS ────────────────────────────────────────── */
:root {
    /* Cores da marca */
    --bg:          #0D1126;
    --bg-sidebar:  #151B3D;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-hover:    rgba(245, 130, 32, 0.1);
    --accent:      #F58220;
    --accent-light:#FFB347;
    --blue-logo:   #2E3192;
    --gold:        #FFB347;

    /* Bordas & superfícies */
    --border:      rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Texto */
    --text-main:   #F8FAFC;
    --text-dim:    #94A3B8;
    --text-muted:  #6B6B80;

    /* Semânticas */
    --success:     #10b981;
    --success-bg:   rgba(16, 185, 129, 0.12);
    --warning:     #f59e0b;
    --warning-bg:   rgba(245, 158, 11, 0.12);
    --danger:      #ef4444;
    --danger-bg:    rgba(239, 68, 68, 0.12);

    /* Espaçamento (base 4px) */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-6:  24px;
    --sp-8:  32px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Tipografia */
    --font-base: 0.875rem;
    --font-xs:   0.6rem;
    --font-sm:   0.7rem;
    --font-md:   0.85rem;
    --font-lg:   1rem;
    --font-xl:   1.25rem;
    --font-2xl:  1.6rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-card: 0 12px 32px -12px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 16px 40px -16px rgba(245, 130, 32, 0.3);

    /* Transições */
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
    --fast: 200ms var(--ease);
    --base: 300ms var(--ease);
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    font-size: var(--font-base);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    overflow: auto;
}

body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(46, 49, 146, 0.15), transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(245, 130, 32, 0.1), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(255, 179, 71, 0.05), transparent 50%);
    z-index: -1;
    animation: meshFlow 30s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes meshFlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.05); }
}


html {
    scroll-behavior: smooth;
    overflow-x: visible;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

/* ── Scrollbars elegantes ─────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.35); }

/* ── Touch targets mínimos 44px ───────────────────────────── */
button, [role="button"], input[type="checkbox"], .select-header,
.option-item, .btn-secondary, .btn-logout, .btn-login,
.section-toggle-btn, .global-toggle-btn, .btn-chart-toggle {
    min-height: 44px;
    min-width: 44px;
}

/* ── Partículas ───────────────────────────────────────────── */
#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── Layout Principal ─────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */

.sidebar {
    width: 320px;
    background: rgba(21, 27, 61, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filtros */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* Custom Select */
.custom-select {
    position: relative;
    user-select: none;
}

.select-header {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    transition: all var(--fast);
}

.select-header:hover { border-color: var(--accent); }
.select-header.active { border-color: var(--accent); }

.select-header .status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-header .arrow {
    font-size: 0.6rem;
    transition: transform var(--base);
    flex-shrink: 0;
}

.custom-select.active .arrow { transform: rotate(180deg); color: var(--accent); }

.select-options {
    background: #1A1F37;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 2500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.custom-select.active .select-options {
    display: block;
    animation: fadeIn var(--fast) ease-out;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    color: var(--text-main);
    min-height: 28px;
}

.option-item:hover { background: var(--bg-hover); }
.option-item.loading-item { opacity: 0.4; }

.checkbox-box {
    width: 10px !important; height: 10px !important;
    min-width: 10px !important; min-height: 10px !important;
    max-width: 10px !important; max-height: 10px !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.option-item.selected {
    background: rgba(245, 130, 32, 0.1);
    color: var(--accent);
    font-weight: 600;
}

.option-item.selected .checkbox-box {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.option-item.selected .checkbox-box::after {
    content: '\2713';
    color: var(--bg);
    font-size: 7px;
    font-weight: bold;
    line-height: 1;
}

/* Campo de busca dentro do select */
.select-search-container {
    background: transparent;
    padding: 0;
    margin: 0;
}

.select-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    min-height: 44px;
    transition: all var(--fast);
}

.select-search-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.2);
}

.select-search-input::placeholder { color: var(--text-dim); opacity: 0.6; }

/* Botões */
.btn-secondary {
    width: 100%;
    margin-top: 0.8rem;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--base);
    text-align: center;
    display: block;
    text-decoration: none;
}

.btn-secondary:hover { border-color: var(--accent); background: var(--bg-hover); }

.btn-logout {
    margin-top: auto;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: var(--danger);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
    transition: all var(--base);
}

.btn-logout:hover { background: var(--danger-bg); }

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

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */

.main-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    min-width: 0;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.top-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

.header-info h1 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff, var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-logo-container {
    background: #fff;
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;

    box-shadow:
        inset 0 1px 3px rgba(255,255,255,0.7),
        0 4px 10px rgba(0,0,0,0.3),
        0 0 8px rgba(245, 130, 32, 0.15);
    border: 1px solid var(--border);
    transition: all var(--base);
    flex-shrink: 0;
}

.header-logo-container:hover { transform: scale(1.05); }

.header-logo { width: 100%; height: auto; display: block; }

/* ══════════════════════════════════════════════════════════
   GLOBAL TOGGLE BAR
   ══════════════════════════════════════════════════════════ */

.global-toggle-bar {
    display: flex;
}

.global-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--fast);
}

.global-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }

.toggle-all-icon { font-size: 1rem; line-height: 1; color: var(--accent); }
.toggle-all-text { white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   SECTIONS COLAPSÁVEIS — BASE
   ══════════════════════════════════════════════════════════ */

.section-collapsible {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.8rem;
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-card);
}

.section-toggle-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.section-toggle-header:hover { background: rgba(255,255,255,0.03); }

.section-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--fast);
    min-width: 36px;
    min-height: 36px;
}

.section-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }

.toggle-arrow {
    font-size: 1.1rem;
    transition: transform var(--base);
    display: inline-block;
}

.toggle-arrow.expanded { transform: rotate(180deg); }

.section-header-content { flex: 1; min-width: 0; }
.section-header-content h2,
.section-header-content .section-apt-title,
.section-header-content .section-goal-title,
.section-header-content .section-situation-title,
.section-header-content .section-atacar-title,
.section-header-content .section-projecao-title,
.section-header-content .section-detalhamento-title {
    margin: 0;
    padding: 0;
    border-bottom: none;
}

.section-collapsible .collapsible-content { padding-top: 0.5rem; }

/* ── Seção APT ────────────────────────────────────────────── */

.section-apt-to-compete .section-apt-title {
    font-size: var(--font-md);
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.apt-header-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.apt-status-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.8rem;
    transition: all var(--base);
}

.apt-status-card.status-apt {
    border-color: var(--success);
    background: var(--success-bg);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.apt-status-card.status-not-apt {
    border-color: var(--danger);
    background: var(--danger-bg);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4), inset 0 0 10px rgba(239, 68, 68, 0.1);
}

.apt-status-icon { font-size: 1.2rem; }
.apt-status-text {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-main);
    white-space: nowrap;
}

.status-apt .apt-status-text { color: var(--success); }
.status-not-apt .apt-status-text { color: var(--danger); }

.apt-rule-below {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0.8rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(245, 130, 32, 0.1);
}

/* Apt info grid */
.apt-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.apt-info-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    transition: all var(--base);
}

.apt-info-block:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.apt-block-label { font-size: 0.6rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.apt-block-value { font-size: 1.4rem; font-weight: 900; color: #fff; line-height: 1; }
.apt-block-detail { font-size: 0.6rem; color: var(--text-dim); font-style: italic; }

/* ── Seção GOAL (Meta) ────────────────────────────────────── */

.section-goal-analysis .section-goal-title {
    font-size: var(--font-md);
    font-weight: 800;
    background: linear-gradient(90deg, var(--gold), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.8rem;
}

.goal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

/* ── Goal Cards (botões clicáveis) ── */
.goal-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.8rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--base);
    font-family: inherit;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    overflow: hidden;

    background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.goal-card-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transform: scaleX(0);
    transition: transform var(--base);
}

.goal-card-btn:hover::before {
    transform: scaleX(1);
}


.goal-card-btn:hover {
    border-color: var(--accent);
    background: linear-gradient(145deg, rgba(245, 130, 32, 0.1) 0%, rgba(245, 130, 32, 0.02) 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px -10px rgba(245, 130, 32, 0.3);
}


.goal-card-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.goal-card-btn-icon {
    line-height: 1;
}

.goal-card-btn-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.goal-card-btn-desc {
    font-size: 0.55rem;
    color: var(--text-dim);
    line-height: 1.4;
    margin-top: 0.2rem;
}

/* ── Goal Table Modal ── */
#goal-table-modal {
    align-items: center;
    justify-content: center;
    z-index: 2500;
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    padding: 2rem;
}

#goal-table-modal:not(.hidden) {
    display: flex !important;
}

.goal-modal-wrapper {
    background: #0D1126;
    border: 1px solid rgba(245, 130, 32, 0.25);
    border-radius: 16px;
    width: 100%;
    max-width: 750px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.9), 0 0 60px rgba(245, 130, 32, 0.08);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.goal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, rgba(245, 130, 32, 0.1), rgba(46, 49, 146, 0.1));
    flex-shrink: 0;
}

.goal-modal-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #F58220;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goal-modal-close-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94A3B8;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.goal-modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.goal-modal-table-container {
    overflow: auto;
    padding: 1.2rem;
    flex: 1;
}

.goal-modal-table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.goal-modal-table-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 3px;
}

.goal-modal-table-container::-webkit-scrollbar-thumb {
    background: rgba(245, 130, 32, 0.3);
    border-radius: 3px;
}

.goal-modal-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 130, 32, 0.5);
}

/* ── Goal Modal Table (overrides .goal-mini-table for modal context) ── */
.goal-modal-table-container .goal-mini-table,
#goal-modal-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 0.85rem !important;
    table-layout: fixed !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.goal-modal-table-container .goal-mini-table thead th,
#goal-modal-table thead th {
    background: linear-gradient(180deg, rgba(245, 130, 32, 0.2), rgba(245, 130, 32, 0.12)) !important;
    color: #FFB347 !important;
    padding: 0.9rem 0.8rem !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid rgba(245, 130, 32, 0.25) !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
    text-align: center !important;
    white-space: nowrap !important;
    position: static !important;
}

.goal-modal-table-container .goal-mini-table thead th:first-child,
#goal-modal-table thead th:first-child {
    width: 40% !important;
    text-align: left !important;
    padding-left: 1rem !important;
    border-top-left-radius: 10px !important;
    color: #F58220 !important;
}

.goal-modal-table-container .goal-mini-table thead th:last-child,
#goal-modal-table thead th:last-child {
    border-top-right-radius: 10px !important;
    border-right: none !important;
}

.goal-modal-table-container .goal-mini-table tbody td,
#goal-modal-table tbody td {
    padding: 0.85rem 0.8rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    border-right: 1px solid rgba(255,255,255,0.03) !important;
    font-size: 0.85rem !important;
    color: #E2E8F0 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.goal-modal-table-container .goal-mini-table tbody td:first-child,
#goal-modal-table tbody td:first-child {
    text-align: left !important;
    padding-left: 1rem !important;
    font-weight: 700 !important;
    color: #F8FAFC !important;
}

.goal-modal-table-container .goal-mini-table tbody tr,
#goal-modal-table tbody tr {
    background: rgba(255,255,255,0.02);
    border-left: 3px solid transparent;
}

.goal-modal-table-container .goal-mini-table tbody tr:nth-child(odd),
#goal-modal-table tbody tr:nth-child(odd) {
    background: rgba(245, 130, 32, 0.04);
}

.goal-modal-table-container .goal-mini-table tbody tr:hover,
#goal-modal-table tbody tr:hover {
    background: rgba(245, 130, 32, 0.1) !important;
    border-left-color: #F58220 !important;
}

/* ── Goal Info Blocks (LEGACY — seções antigas mantidas) ── */
.goal-info-block {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all var(--base);
}

.goal-info-block:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.goal-block-label {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

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

.goal-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-xs);
    table-layout: fixed;
}

.goal-mini-table thead th {
    background: rgba(245, 130, 32, 0.12) !important;
    color: var(--accent) !important;
    font-size: 0.55rem !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 3px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
}

.goal-mini-table thead th:first-child {
    text-align: left;
    padding-left: 6px;
    width: 35%;
    color: var(--text-dim) !important;
}

/* Em mobile, coluna Família fica mais estreita */
@media (max-width: 560px) {
    .goal-mini-table thead th:first-child { width: 30%; }
}

.goal-mini-table tbody td {
    padding: 4px 3px;
    text-align: right;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}

.goal-mini-table tbody td:first-child {
    text-align: left;
    padding-left: 6px;
    color: var(--text-dim);
    font-weight: 500;
}

.goal-mini-table tbody tr:hover { background: rgba(245, 130, 32, 0.06); }

.goal-val-positive  { color: var(--success) !important; }
.goal-val-warning   { color: var(--warning) !important; }
.goal-val-negative   { color: var(--danger) !important; }
.goal-val-neutral    { color: var(--text-dim) !important; }

/* ── Seção SITUATION ─────────────────────────────────────── */

.section-situation .section-situation-title {
    font-size: var(--font-md);
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.8rem;
}

.sit-info-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.sit-info-block {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    transition: all var(--base);
}

.sit-info-block:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.sit-header { display: flex; align-items: center; gap: 0.3rem; }
.sit-icon { font-size: 1rem; }

.sit-block-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

.sit-big-value { font-size: 1.2rem; font-weight: 800; color: #fff; line-height: 1.2; }
.sit-detail { font-size: 0.55rem; color: var(--text-dim); }

.sit-val-positive  { color: var(--success) !important; }
.sit-val-warning   { color: var(--warning) !important; }
.sit-val-negative   { color: var(--danger) !important; }

/* ── Estilos Slim das Tabelas de Situação ── */
.sit-table-wrap {
    margin-top: 10px;
    width: 100%;
    max-height: 125px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sit-table-wrap::-webkit-scrollbar { width: 4px; }
.sit-table-wrap::-webkit-scrollbar-thumb { background: rgba(245, 130, 32, 0.3); border-radius: 2px; }

.sit-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6rem;
    line-height: 1.1;
    table-layout: auto;
}

.sit-mini-table th {
    background: rgba(0,0,0,0.4);
    color: var(--text-dim);
    padding: 6px 4px;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.55rem;
    text-align: left;
    position: sticky;
    top: 0;
    border-bottom: 1px solid rgba(245, 130, 32, 0.2);
    z-index: 2;
}

.sit-mini-table th:first-child { padding-left: 8px; }
.sit-mini-table th:last-child { text-align: right; padding-right: 8px; }

.sit-mini-table td {
    padding: 5px 4px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #fff;
    font-weight: 500;
}

.sit-mini-table td:first-child { padding-left: 8px; color: var(--text-dim); }
.sit-mini-table td:last-child { text-align: right; padding-right: 8px; }

.sit-mini-table tr:hover td { background: rgba(245, 130, 32, 0.05); }
.sit-mini-table tbody tr:last-child td { border-bottom: none; }

/* ── Seção ATACAR ─────────────────────────────────────────── */

/* ── Seção ATACAR (Onde Atacar Primeiro) ───────────────────── */

.section-atacar .section-atacar-title {
    font-size: var(--font-md);
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.8rem;
}

.atacar-triple-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.atacar-info-block {
    background: rgba(30, 27, 75, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    transition: all var(--base);
}

.atacar-info-block:hover {
    border-color: rgba(245, 130, 32, 0.4);
    box-shadow: 0 8px 32px rgba(245, 130, 32, 0.08);
    transform: translateY(-2px);
}

.atacar-header { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    justify-content: center; 
}
.atacar-icon { 
    font-size: 1.2rem; 
    color: var(--accent);
}
.atacar-block-label { 
    font-size: 0.85rem; 
    font-weight: 800; 
    color: var(--gold); 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}
.atacar-subtitle { 
    font-size: 0.68rem; 
    color: var(--text-dim); 
    text-align: center; 
    font-style: italic;
    margin-bottom: 0.4rem;
}

/* Novo cabeçalho tipo tabela */
.atacar-table-header {
    display: grid;
    grid-template-columns: 24px 1fr 100px;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 6px;
}

.atacar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar premium customizada */
.atacar-list::-webkit-scrollbar {
    width: 4px;
}
.atacar-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.atacar-list::-webkit-scrollbar-thumb {
    background: rgba(245, 130, 32, 0.3);
    border-radius: 4px;
}
.atacar-list::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 130, 32, 0.6);
}

.atacar-list li {
    display: grid;
    grid-template-columns: 24px 1fr 100px;
    align-items: center;
    gap: 12px;
    padding: 7px 8px;
    min-height: 38px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.atacar-list li:hover { 
    background: rgba(245, 130, 32, 0.06); 
    border-color: rgba(245, 130, 32, 0.2);
    transform: translateX(3px);
}

.atacar-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 850;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.atcar-rank-1 { 
    background: linear-gradient(135deg, #FFD700, #FFA500); 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}
.atcar-rank-2 { 
    background: linear-gradient(135deg, #E2E8F0, #94A3B8); 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px rgba(226, 232, 240, 0.25);
}
.atcar-rank-3 { 
    background: linear-gradient(135deg, #CD7F32, #A0522D); 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.25);
}
.atcar-rank-other {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim);
    box-shadow: none;
}

.atacar-list .atacar-item-label {
    color: #E2E8F0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atacar-list .atacar-item-value { 
    font-weight: 750; 
    font-family: 'Inter', monospace;
    white-space: nowrap; 
    text-align: right;
}

#lst-pendencias .atacar-item-value { color: #f87171; } /* Vermelho suave */
#lst-gaps .atacar-item-value { color: #fbbf24; } /* Laranja/Amarelo suave */
#lst-faceis .atacar-item-value { color: #34d399; } /* Verde suave */

.atacar-list .atacar-empty {
    display: flex;
    background: none !important;
    border: none !important;
    color: var(--text-dim);
    font-style: italic;
    text-align: center;
    justify-content: center;
    grid-column: 1 / -1;
}

/* ── Seção PROJEÇÃO ───────────────────────────────────────── */

.section-projecao .section-projecao-title {
    font-size: var(--font-md);
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.8rem;
}

.proj-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.proj-info-block {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: all var(--base);
}

.proj-info-block:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.proj-header { display: flex; align-items: center; gap: 0.3rem; justify-content: center; }
.proj-icon { font-size: 1rem; }
.proj-block-label { font-size: 0.6rem; font-weight: 800; color: var(--gold); text-transform: uppercase; }
.proj-subtitle { font-size: 0.55rem; color: var(--text-dim); text-align: center; font-style: italic; }

.proj-table-wrap { overflow-x: auto; max-height: 180px; }

.proj-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-xs);
    table-layout: fixed;
}

.proj-mini-table thead th {
    background: rgba(245, 130, 32, 0.12) !important;
    color: var(--accent) !important;
    font-size: 0.55rem !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 3px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
}
.proj-mini-table thead th:first-child { width: 40%; padding-left: 6px; }

.proj-mini-table tbody td {
    padding: 4px 3px;
    text-align: right;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}
.proj-mini-table tbody td:first-child { text-align: left; padding-left: 6px; color: var(--text-dim); }

.proj-val-positive  { color: var(--success) !important; }
.proj-val-warning   { color: var(--warning) !important; }
.proj-val-negative   { color: var(--danger) !important; }

/* ── Seção DETALHAMENTO ────────────────────────────────────── */

.section-detalhamento .section-detalhamento-title {
    font-size: var(--font-md);
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.8rem;
}

.detal-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.detal-info-block {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: all var(--base);
}

.detal-info-block:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.detal-header { display: flex; align-items: center; gap: 0.3rem; justify-content: center; }
.detal-icon { font-size: 1rem; }
.detal-block-label { font-size: 0.6rem; font-weight: 800; color: var(--gold); text-transform: uppercase; }
.detal-subtitle { font-size: 0.55rem; color: var(--text-dim); text-align: center; font-style: italic; }

.detal-table-wrap { overflow-x: auto; max-height: 220px; }

/* Detalhamento clicável */
.detal-table-clickable {
    cursor: pointer;
    position: relative;
}

.detal-table-clickable::after {
    content: '⛶';
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    font-size: 0.9rem;
    color: var(--text-dim);
    opacity: 0.5;
    transition: all 0.2s;
}

.detal-table-clickable:hover::after {
    opacity: 1;
    color: var(--gold);
}

.detal-table-clickable:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(245, 130, 32, 0.3);
}

.detal-click-hint {
    font-size: 0.5rem;
    color: var(--text-dim);
    text-align: center;
    opacity: 0.7;
    font-style: italic;
}

.detal-table-clickable:hover .detal-click-hint {
    opacity: 1;
    color: var(--gold);
}

.detal-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-xs);
    table-layout: fixed;
}

.detal-mini-table thead th {
    background: rgba(245, 130, 32, 0.12) !important;
    color: var(--accent) !important;
    font-size: 0.55rem !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 3px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
}
.detal-mini-table thead th:first-child { width: 40%; padding-left: 6px; }

.detal-mini-table tbody td {
    padding: 4px 3px;
    text-align: right;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}
.detal-mini-table tbody td:first-child { text-align: left; padding-left: 6px; color: var(--text-dim); }

.detal-val-positive  { color: var(--success) !important; }
.detal-val-warning   { color: var(--warning) !important; }

/* ══════════════════════════════════════════════════════════
   CARDS DE MÉTRICAS
   ══════════════════════════════════════════════════════════ */

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    cursor: pointer;
    transition: all var(--base);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-card);
}

<<<<<<< HEAD
#card-volume { border-left: 3px solid var(--blue-logo); }
#card-mix    { border-left: 3px solid var(--accent); }
#card-clientes { border-left: 3px solid var(--gold); }

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.metric-card.active {
    border: 2px solid var(--accent) !important;
    border-left-color: var(--accent) !important;
    box-shadow: 0 4px 20px rgba(245, 130, 32, 0.2);
    background: rgba(245, 130, 32, 0.05);
=======
/* Cards Principais e Interativos (Botões) */
#card-faturamento,
#card-volume,
#card-mix,
#card-sem-compras {
    background: linear-gradient(135deg, rgba(245, 130, 32, 0.1) 0%, rgba(255, 179, 71, 0.03) 100%);
    border: 1px solid rgba(245, 130, 32, 0.3) !important;
    box-shadow: 0 0 15px rgba(245, 130, 32, 0.08), inset 0 1px 0 rgba(245, 130, 32, 0.1);
}

#card-faturamento:hover,
#card-volume:hover,
#card-mix:hover,
#card-sem-compras:hover {
    box-shadow: 0 0 25px rgba(245, 130, 32, 0.2);
}

#card-faturamento.active,
#card-volume.active,
#card-mix.active {
    background: linear-gradient(135deg, var(--accent) 0%, #e07010 100%);
    box-shadow: 0 0 25px rgba(245, 130, 32, 0.35);
>>>>>>> 99f71d570438c22d1d49f7ecd7c96df98ebb7e22
}

.card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-circle {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(245, 130, 32, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.card-icon { width: 16px; height: 16px; color: var(--accent); }

.metric-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.metric-body { display: flex; flex-direction: column; gap: 4px; }

body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(46, 49, 146, 0.15), transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(245, 130, 32, 0.1), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(255, 179, 71, 0.05), transparent 50%);
    z-index: -1;
    animation: meshFlow 30s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes meshFlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.05); }
}


.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-sub-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
}

.metric-sub-value {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width var(--base);
}

.progress-bar.critical { background: linear-gradient(90deg, var(--danger), #f87171); }
.progress-bar.warning  { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar.success  { background: linear-gradient(90deg, var(--success), #34d399); }

.metric-pct {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent);
}

.info-card-split {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem;
    flex: 1;
}

.info-divider { width: 1px; background: var(--border); margin: 0.5rem 0; }

/* ══════════════════════════════════════════════════════════
   GRÁFICOS
   ══════════════════════════════════════════════════════════ */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 0.8rem;
    box-shadow: var(--shadow-card);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.chart-header h2 {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 700;
}

.btn-chart-toggle, .btn-chart-export {
    background: rgba(245, 130, 32, 0.12);
    color: var(--accent);
    border: 1px solid rgba(245, 130, 32, 0.3);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--fast);
    text-align: center;
}

.btn-chart-toggle:hover, .btn-chart-export:hover {
    background: var(--accent);
    color: var(--bg);
}

.side-analysis #ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
}

.ranking-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ranking-item .rank-name { font-size: 0.72rem; font-weight: 600; color: #fff; }
.ranking-item .rank-pct { font-size: 0.78rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
.ranking-item .rank-pct.critical { background: var(--danger-bg); color: var(--danger); }
.ranking-item .rank-pct.warning  { background: var(--warning-bg); color: var(--warning); }
.ranking-item .rank-pct.success  { background: var(--success-bg); color: var(--success); }

/* ══════════════════════════════════════════════════════════
   TABELA PRINCIPAL
   ══════════════════════════════════════════════════════════ */

.table-container {
    width: 100%;
<<<<<<< HEAD
    overflow-x: auto;
    overflow-y: visible;
    background: rgba(21, 27, 61, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.8rem;
    box-shadow: var(--shadow-card);
=======
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
>>>>>>> 99f71d570438c22d1d49f7ecd7c96df98ebb7e22
}

.table-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

/* Container com scroll horizontal para mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.15);
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.15);
}

/* Global table: auto width para expandir ao conteúdo */
table {
    width: auto;
    min-width: max-content;
    border-collapse: collapse;
    font-size: 0.78rem;
}

/* Table-responsive: wrapper explícito com block + max-width 100% */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.15);
    display: block;
    max-width: 100%;
    contain: layout style;
}

/* Table dentro de table-responsive usa max-content para forçar scroll */
.table-responsive > table,
.premium-table {
    width: max-content;
    min-width: 100%;
    display: table;
    table-layout: auto;
}

<<<<<<< HEAD
=======
/* Headers CONGELADOS no topo da tabela */
thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

>>>>>>> 99f71d570438c22d1d49f7ecd7c96df98ebb7e22
thead th {
    background-color: var(--bg-sidebar) !important;
    color: var(--accent);
    text-align: center;
    font-weight: 700;
<<<<<<< HEAD
    padding: 10px 8px;
=======
    padding: 12px 15px;
>>>>>>> 99f71d570438c22d1d49f7ecd7c96df98ebb7e22
    border-bottom: 1px solid var(--border);
}

thead tr:nth-child(2) th {
    background-color: #1a1f37 !important;
    font-size: 0.65rem;
    color: var(--text-dim);
    border-bottom: 2px solid var(--border);
}

th, td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background-color: transparent;
    color: #fff;
    font-weight: 600;
}

tbody tr:hover { background: rgba(245, 130, 32, 0.08); }

.premium-table tbody tr.table-total-row {
    background: rgba(255,255,255,0.04);
    font-weight: 800;
}

.premium-table tbody tr.table-total-row td { color: var(--gold); }

.premium-metas-table tbody tr:last-child {
    background: transparent;
    font-weight: normal;
}
.premium-metas-table tbody tr:last-child td {
    color: #e2e8f0;
}

/* ══════════════════════════════════════════════════════════
   ORDENAÇÃO DE TABELAS
   ══════════════════════════════════════════════════════════ */
.sortable-table thead th[data-sortable] { cursor: pointer; user-select: none; position: relative; padding-right: 22px; }
.sortable-table thead th[data-sortable]:hover { background-color: rgba(245,130,32,0.15) !important; }
.sortable-table thead th[data-sortable]::after {
    content: ' ';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    color: var(--text-dim);
    opacity: 0.4;
    pointer-events: none;
    line-height: 1;
}
.sortable-table thead th[data-sortable].sort-asc::after { content: '▲'; opacity: 1; color: var(--gold); }
.sortable-table thead th[data-sortable].sort-desc::after { content: '▼'; opacity: 1; color: var(--gold); }
.sortable-table thead th.sort-active {
    background-color: rgba(245,130,32,0.12) !important;
    color: var(--gold) !important;
    box-shadow: inset 0 -2px 0 var(--gold);
}

/* ══════════════════════════════════════════════════════════
   MODAIS
   ══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-overlay:not(.hidden) { display: flex; }

.modal-content {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    overflow: hidden;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 8px;
    transition: color var(--fast);
}

.modal-close-btn:hover { color: #fff; }

.modal-table-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
}

.modal-table-scroll table {
    min-width: 480px;
    font-size: 0.72rem;
}

/* ══════════════════════════════════════════════════════════
   BOTÃO MOBILE + OVERLAY
   ══════════════════════════════════════════════════════════ */

.btn-mobile-menu, .mobile-only-btn {
    display: flex;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-family: inherit;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(245, 130, 32, 0.35);
    z-index: 1001;
    cursor: pointer;
}

.sidebar-overlay, .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(3px);
    z-index: 999;
}

.sidebar-overlay.active, .overlay.active { display: block; }

/* ══════════════════════════════════════════════════════════
   LOADING OVERLAY
   ══════════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-overlay p { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 0.75rem; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ══════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--base);
    max-width: 320px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.info { border-left: 3px solid var(--accent); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.toast-close:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════
   METAS PAGE — Gestão de Metas
   ══════════════════════════════════════════════════════════ */

.metas-stats-sidebar {
    padding: 0.8rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.metas-stats-sidebar > div { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }

.table-responsive-metas {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive-metas table { min-width: 700px; }


/* Linhas novas (ainda não salvas) */
tr.row-new { border-left: 3px solid var(--accent) !important; }
tr.row-new td { background: rgba(245, 130, 32, 0.04) !important; }

/* Linhas selecionadas para exclusão */
tr.selected-row { background: rgba(239, 68, 68, 0.08) !important; }
tr.selected-row td { color: var(--danger) !important; }

tr.row-new.selected-row td { color: var(--accent) !important; }

.metas-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; text-align: center; gap: 0.8rem; }
.metas-empty h3 { color: var(--text-dim); font-size: 1rem; }
.metas-empty p { color: var(--text-muted); font-size: 0.8rem; }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(46, 49, 146, 0.15), transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(245, 130, 32, 0.1), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(255, 179, 71, 0.05), transparent 50%);
    z-index: -1;
    animation: meshFlow 30s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes meshFlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.05); }
}


.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.login-brand {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 160px;
    height: auto;
    filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.8))
            drop-shadow(6px 6px 12px rgba(0,0,0,0.8))
            drop-shadow(0 0 5px rgba(245, 130, 32, 0.4));
    transform: rotateX(10deg) rotateY(-5deg);
    animation: loginFloating 3s ease-in-out infinite;
}

@keyframes loginFloating {
    0%, 100% { transform: translateY(0) rotateX(10deg) rotateY(-5deg); }
    50% { transform: translateY(-10px) rotateX(12deg) rotateY(-2deg); }
}

.login-logo:hover { transform: scale(1.05) rotateX(0) rotateY(0); }

.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header p { color: var(--accent); font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }

.input-group { margin-bottom: 0.6rem; }
.input-group label { display: block; font-size: 0.7rem; color: var(--text-dim); margin-bottom: 0.3rem; text-transform: uppercase; }

.input-group input {
    width: 100%;
    padding: 0.7rem 0.8rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    min-height: 44px;
    transition: all var(--fast);
}

.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.2); }

.btn-login {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 48px;
    transition: all var(--base);
}

.btn-login:hover { background: var(--gold); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(245, 130, 32, 0.3); }

.login-error {
    color: var(--danger);
    background: var(--danger-bg);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    text-align: center;
    margin-bottom: 0.8rem;
}

.hidden { display: none !important; }

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

/* ══════════════════════════════════════════════════════════
   DETALHE NINHO (Nested rows)
   ══════════════════════════════════════════════════════════ */

.nested-table-row { background-color: rgba(0,0,0,0.15) !important; }

.nested-wrapper {
    padding: 0.8rem 0.5rem 1.2rem 2rem;
    border-left: 3px solid var(--accent);
}

.product-item-row {
    background-color: rgba(0,0,0,0.1) !important;
    transition: background 0.2s;
}
.product-item-row:hover { background: rgba(255,255,255,0.04) !important; }

.product-total-row {
    background-color: rgba(0,0,0,0.2) !important;
    font-weight: 800;
}
.product-total-row td { color: var(--gold); }

.product-label {
    color: #fff;
    font-weight: 600;
    text-align: left;
}

/* ══════════════════════════════════════════════════════════
   MODAL FILTER BUTTONS
   ══════════════════════════════════════════════════════════ */

.btn-modal-filter {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--fast);
    font-family: inherit;
    text-transform: uppercase;
}

.btn-modal-filter.active { border-color: var(--accent); color: var(--accent); background: var(--bg-hover); }
.btn-modal-filter:hover { border-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════ */

/* Mobile: ≤ 560px — CORREÇÕES COMPLETAS DE OVERFLOW */
@media (max-width: 560px) {
    .main-content {
        padding: 0.5rem;
        gap: 0.8rem;
    }

    /* Header: logo absolute protegido com padding no parent */
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 50px !important;
    }
    .header-logo-container {
        position: absolute;
        top: 0; right: 0;
        width: 42px; height: 42px;
        padding: 6px;
    }
    .header-info h1 {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }

    /* Sidebar drawer: usa largura relativa em telas muito pequenas */
    .sidebar {
        width: 88vw !important;
        max-width: 320px;
        left: -88vw !important;
    }
    .sidebar.active { left: 0 !important; }

    /* SEÇÃO APT: header empilha, status card centralizado */
    .apt-header-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    .apt-status-card {
        align-self: flex-start;
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* GRIDS: 1 coluna em telas <= 560px para evitar corte */
    .apt-info-grid { grid-template-columns: 1fr !important; }
    .goal-info-grid { grid-template-columns: 1fr !important; }
    .goal-card-btn:not(:last-child) { margin-bottom: 0.5rem; }
    .sit-info-inline-grid { grid-template-columns: 1fr !important; }
    .atacar-triple-grid { grid-template-columns: 1fr !important; }
    .proj-info-grid { grid-template-columns: 1fr !important; }
    .detal-info-grid { grid-template-columns: 1fr !important; }
    .charts-grid { grid-template-columns: 1fr !important; }
    .metrics-grid { grid-template-columns: 1fr !important; }
    .info-card-split { flex-wrap: wrap !important; }

    /* Toggle button: texto pode quebrar */
    .toggle-all-text {
        white-space: normal;
        font-size: 0.6rem;
    }

    /* Tabelas menores */
    table { font-size: 0.65rem; }
    th, td { padding: 6px 3px; }

    /* Toast adaptado para telas estreitas */
    .toast-container {
        right: 0.5rem;
        left: 0.5rem;
    }
    .toast { max-width: 100% !important; }

    /* Botão mobile fixed não cobre conteúdo final */
    .mobile-only-btn {
        bottom: 1rem;
        right: 1rem;
    }

    /* Padding extra no final do main-content para o botão fixed não sobrepor */
    .main-content {
        padding-bottom: 5rem !important;
    }
}

/* Extra small screens: ≤ 400px — redução de padding para maximizar espaço */
@media (max-width: 400px) {
    .main-content { 
        padding: 0.35rem !important;
        padding-bottom: 5rem !important;
    }
    .section-collapsible { padding: 0.5rem !important; }
    .chart-container { padding: 0.5rem !important; }
    .table-container { padding: 0.5rem !important; }
    .login-container { padding: 0.6rem !important; }
    .login-logo { width: 120px !important; }
    .modal-content { padding: 0.8rem !important; }
}

/* Tablet small: 561px–768px */
@media (min-width: 561px) {
    .apt-info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet: 769px–992px */
@media (min-width: 769px) {
    .main-content {
        padding: 1.5rem 2rem;
        gap: 1.5rem;
    }
    .header-info h1 {
        font-size: 1.1rem;
    }
    .header-logo-container {
        width: 56px; height: 56px;
    }
    .apt-info-grid { grid-template-columns: repeat(2, 1fr); }
    .goal-info-grid { grid-template-columns: repeat(2, 1fr); }
    .sit-info-inline-grid { grid-template-columns: repeat(2, 1fr); }
    .atacar-triple-grid { grid-template-columns: repeat(2, 1fr); }
    .proj-info-grid { grid-template-columns: repeat(2, 1fr); }
    .detal-info-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: 993px–1240px */
@media (min-width: 993px) {
    .app-container { flex-direction: row; }
    .btn-mobile-menu, .mobile-only-btn { display: none !important; }
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
    .main-content {
        padding: 2rem 2.5rem;
        gap: 2rem;
    }
    .header-info h1 { font-size: 1.4rem; }
    .header-logo-container {
        width: 60px; height: 60px;
    }
    .apt-info-grid { grid-template-columns: repeat(4, 1fr); }
    .apt-info-group { grid-template-columns: repeat(4, 1fr); }
    .goal-info-grid { grid-template-columns: repeat(4, 1fr); }
    .sit-info-inline-grid { grid-template-columns: repeat(4, 1fr); }
    .atacar-triple-grid { grid-template-columns: repeat(3, 1fr); }
    .proj-info-grid { grid-template-columns: repeat(3, 1fr); }
    .detal-info-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 2fr 1fr; }
    .metrics-grid { grid-template-columns: repeat(3, 1fr); }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-sm);
        border: 1px solid rgba(255,255,255,0.05);
        background: rgba(0,0,0,0.15);
    }
}

/* Large desktop: ≥1241px */
@media (min-width: 1241px) {
    .main-content { padding: 2rem 3rem; }
}

/* ── Ajustes específicos por seção em telas grandes ───────── */
@media (min-width: 769px) {
    .section-collapsible { padding: 1.2rem 1.5rem; }

    /* APT */
    .apt-info-grid { grid-template-columns: repeat(4, 1fr); }
    .apt-block-value { font-size: 1.6rem; }

    /* Section headers */
    .section-apt-to-compete .section-apt-title,
    .section-goal-analysis .section-goal-title,
    .section-situation .section-situation-title,
    .section-atacar .section-atacar-title,
    .section-projecao .section-projecao-title,
    .section-detalhamento .section-detalhamento-title {
        text-align: left;
    }

    /* Goal tables maiores */
    .goal-mini-table { font-size: 0.58rem; }
    .proj-mini-table { font-size: 0.58rem; }
    .detal-mini-table { font-size: 0.58rem; }
}

@media (min-width: 993px) {
    .section-collapsible { padding: 1.5rem 2rem; }

    .header-info h1 { font-size: 1.6rem; }

    .apt-status-card {
        min-width: 200px;
    }

    .card-icon { width: 18px; height: 18px; }
    .icon-circle { width: 38px; height: 38px; }
    .metric-label { font-size: 0.8rem; }
    .metric-sub-value { font-size: 1.2rem; }
    .metric-pct { font-size: 1.3rem; }

    .chart-container { padding: 1.5rem; }
    .table-container { padding: 1.5rem; }

    .table-scroll {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-sm);
        border: 1px solid rgba(255,255,255,0.05);
        background: rgba(0,0,0,0.15);
    }
}

/* ── Ajustes de tabela para mobile ────────────────────────── */
@media (max-width: 560px) {
    table { font-size: 0.7rem; }
    th, td { padding: 6px 4px; }
    .chart-container { padding: 0.6rem; }
    .chart-header h2 { font-size: 0.75rem; }

    /* Tabelas premium com scroll horizontal em mobile */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-sm);
        border: 1px solid rgba(255,255,255,0.05);
        background: rgba(0,0,0,0.15);
    }

    .premium-table {
        min-width: max-content;
        font-size: 0.65rem;
    }

    .premium-table th, .premium-table td {
        padding: 5px 3px;
    }

    .premium-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    /* Títulos das seções de metas com fonte menor */
    .section-goal-title, .section-goal-analysis h2,
    .section-goal-cobertura h2 { font-size: 0.9rem !important; }

    h3 { font-size: 0.85rem !important; }
}

/* ── Meta-specific responsive ─────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -320px;
        top: 0; bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .sidebar.active { left: 0; }
    .btn-mobile-menu, .mobile-only-btn { display: flex !important; }
    .sidebar-overlay.active { display: block; }
}

/* ── Print-friendly ───────────────────────────────────────── */
@media print {
    #particles-canvas, .btn-mobile-menu, .mobile-only-btn, .sidebar-overlay,
    .loading-overlay, .global-toggle-bar { display: none !important; }
    .app-container { flex-direction: column !important; }
    .sidebar { position: relative !important; width: 100% !important; height: auto !important; }
    .section-collapsible { break-inside: avoid; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-collapsible {
    animation: fadeUp 0.6s var(--ease) both;
}
.section-collapsible:nth-child(1) { animation-delay: 0.1s; }
.section-collapsible:nth-child(2) { animation-delay: 0.2s; }
.section-collapsible:nth-child(3) { animation-delay: 0.3s; }
.section-collapsible:nth-child(4) { animation-delay: 0.4s; }
.section-collapsible:nth-child(5) { animation-delay: 0.5s; }

/* Phosphor Icons Base Style */
.ph {
    font-size: 1.2em;
    vertical-align: middle;
}
.sit-icon .ph, .atacar-icon .ph, .proj-icon .ph, .detal-icon .ph {
    font-size: 1.4rem;
    color: var(--accent);
}
.goal-card-btn-icon .ph {
    font-size: 1.8rem;
    color: var(--accent-light);
    filter: drop-shadow(0 2px 8px rgba(245, 130, 32, 0.4));
}
.apt-status-icon .ph {
    font-size: 1.5rem;
}

/* ========================================= */
/* ESTILO PREMIUM PARA GESTÃO DE METAS       */
/* ========================================= */
.premium-metas-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.premium-metas-table thead {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}

.premium-metas-table th {
    padding: 1.2rem 1rem;
    color: var(--accent, #f59e0b);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    border-bottom: 2px solid rgba(245, 158, 11, 0.3);
    text-align: left;
}

.premium-metas-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.premium-metas-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px) scale(1.001);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.premium-metas-table td {
    padding: 1rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    vertical-align: middle;
}



.premium-metas-table td[data-editable="1"] {
    position: relative;
    cursor: pointer;
    font-weight: 600;
}

.premium-metas-table td[data-editable="1"]:hover {
    background: rgba(139, 92, 246, 0.08);
    box-shadow: inset 0 -2px 0 0 rgba(139, 92, 246, 0.5);
}

/* Linha Selecionada */
.premium-metas-table tr.selected-row {
    background: rgba(245, 158, 11, 0.1) !important;
    border-left: 3px solid var(--accent, #f59e0b);
}

/* Linha Nova (Nâo Salva) */
.premium-metas-table tr.row-new {
    background: rgba(16, 185, 129, 0.05) !important;
    border-left: 3px solid #10b981;
}

/* ══════════════════════════════════════════════════════════
   MODAL PREMIAÇÃO
   ══════════════════════════════════════════════════════════ */

#premiacao-modal:not(.hidden) {
    display: flex !important;
}

.premiacao-modal-wrapper {
    background: #0D1126;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 750px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.9), 0 0 60px rgba(16, 185, 129, 0.1);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}

.premiacao-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(46, 49, 146, 0.1));
    flex-shrink: 0;
}

.premiacao-modal-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #10b981, #14cc9e);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.premiacao-modal-content {
    overflow: auto;
    padding: 1.5rem;
    flex: 1;
}

.premiacao-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.premiacao-info-block {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
}

.premiacao-block-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premiacao-block-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.premiacao-block-detail {
    font-size: 0.6rem;
    color: var(--text-dim);
    font-style: italic;
}

.premiacao-info-block.premiacao-highlight {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.premiacao-info-block.premiacao-highlight .premiacao-block-value {
    font-size: 1.6rem;
    color: var(--success);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.premiacao-info-block.premiacao-highlight .premiacao-block-detail {
    color: var(--success);
}

#comissao-aviso {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 1rem;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 0.8rem;
    display: block;
}

@media (max-width: 600px) {
    .premiacao-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════
   HORIZONTAL CAROUSELS - Full-width slides
   ══════════════════════════════════════════════════════════ */
.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.horizontal-carousel {
    display: flex !important;
    flex-direction: row !important;
    overflow: hidden;
    width: 100%;
}

.carousel-slide {
    min-width: 100% !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-btn {
    position: absolute;
    top: 45px; /* Fixo na parte superior (alinhado com o valor) */
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(245, 130, 32, 0.15);
    border: 1px solid rgba(245, 130, 32, 0.4);
    color: var(--accent);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.carousel-btn:hover {
    background: rgba(245, 130, 32, 0.35);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(245, 130, 32, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev { left: 6px; }
.carousel-btn-next { right: 6px; }

.carousel-btn.disabled {
    opacity: 0.25;
    pointer-events: none;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 12px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(245, 130, 32, 0.4);
    border-color: rgba(245, 130, 32, 0.6);
}

.carousel-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(245, 130, 32, 0.5);
    transform: scale(1.2);
}

/* ── Comparativo Histórico (Últimos 5 Meses) ── */
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}
.trend-badge.positive {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.1);
}
.trend-badge.negative {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.1);
}
.trend-badge.neutral {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.btn-filter-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #94a3b8);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-filter-pill:hover {
    background: rgba(245, 130, 32, 0.1);
    border-color: rgba(245, 130, 32, 0.3);
    color: var(--text, #f8fafc);
}
.btn-filter-pill.active {
    background: linear-gradient(135deg, rgba(245, 130, 32, 0.25), rgba(245, 130, 32, 0.1));
    border-color: var(--accent, #f58220);
    color: var(--accent, #f58220);
    box-shadow: 0 0 12px rgba(245, 130, 32, 0.2);
}

/* ============================================================
   ADDONS DE MELHORIA VISUAL E SIMULAÇÃO
   ============================================================ */
.comparativo-layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    margin-top: 15px;
}

.comparativo-chart-card {
    background: rgba(13, 17, 38, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
}

.comparativo-chart-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-main);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.comparativo-chart-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Sliders do simulador */
.simulator-slider-row {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.01);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.simulator-slider-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(245, 130, 32, 0.15);
}

.simulator-slider-row .family-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.simulator-slider-row .slider-input {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.simulator-slider-row .slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.simulator-slider-row .slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.simulator-slider-row .slider-value {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent);
    text-align: right;
}

/* Responsividade */
@media (max-width: 992px) {
    .comparativo-layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Linhas selecionáveis na tabela comparativa */
#tbl-comparativo-historico tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}
#tbl-comparativo-historico tbody tr:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}
.selected-family-row {
    background: rgba(245, 130, 32, 0.15) !important;
    border-left: 3px solid var(--accent, #f58220) !important;
}
.selected-family-row td {
    color: var(--accent, #f58220) !important;
    font-weight: 700 !important;
}

/* Drill Down details row styling */
.detail-row {
    background: rgba(0, 0, 0, 0.25) !important;
}
.detail-row:hover {
    background: rgba(0, 0, 0, 0.25) !important;
}
.detail-row td {
    border-bottom: none !important;
    padding: 0 !important;
    white-space: normal !important;
}


