/* ==========================================================================
   BARRETOS INTELIGENTE - HUB CENTRAL PMO & CCO
   Launchpad Executivo Direto: Painel de Ofícios & Monitor Exati
   ========================================================================== */

:root {
    /* Color Palette - Light Theme (Default Corporativo) */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-header: #ffffff;

    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;
    --border-card-hover: #10a37f;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-emerald: #10a37f;
    --accent-emerald-hover: #0e8c6d;
    --accent-emerald-glow: rgba(16, 163, 127, 0.14);
    --accent-emerald-subtle: rgba(16, 163, 127, 0.08);
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-blue-glow: rgba(37, 99, 235, 0.14);
    --accent-blue-subtle: rgba(37, 99, 235, 0.08);

    --badge-bg: #f1f5f9;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-hover-emerald: 0 20px 40px -8px rgba(16, 163, 127, 0.28), 0 8px 16px rgba(16, 163, 127, 0.12);
    --shadow-hover-blue: 0 20px 40px -8px rgba(37, 99, 235, 0.28), 0 8px 16px rgba(37, 99, 235, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    /* Color Palette - Dark Theme (Modo CCO / Noturno) */
    --bg-main: #0b0f19;
    --bg-card: #131b2e;
    --bg-card-hover: #18223a;
    --bg-header: #0f172a;

    --border-color: #1e293b;
    --border-subtle: #1e293b;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --badge-bg: #1e293b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 14px 35px -5px rgba(0, 0, 0, 0.5);
    --shadow-hover-emerald: 0 22px 45px -5px rgba(16, 163, 127, 0.38);
    --shadow-hover-blue: 0 22px 45px -5px rgba(37, 99, 235, 0.38);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.hub-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.navbar {
    height: 64px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.nav-left {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.brand-logo-img {
    height: 34px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

[data-theme="dark"] .brand-logo-img {
    filter: brightness(1.05);
}

.brand-divider {
    height: 26px;
    width: 1px;
    background-color: var(--border-color);
    margin: 0 16px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-title .hub-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--accent-emerald-glow);
    color: var(--accent-emerald);
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--badge-bg);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .nav-pill:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-pill.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.system-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--badge-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.7);
    animation: pulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 163, 127, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0);
    }
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* ==========================================================================
   Central Launchpad Main Section (100% de Foco e Destaque nos 2 Portais)
   ========================================================================== */
.hub-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.hub-container {
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.hub-header {
    margin-bottom: 38px;
}

.hub-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    background: var(--badge-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

.hub-header-badge i {
    color: var(--accent-emerald);
}

.hub-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hub-title span {
    color: var(--accent-emerald);
}

.hub-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 580px;
    margin: 0 auto;
}

/* ==========================================================================
   Portal Cards Grid (Os 2 Destaques Centrais)
   ========================================================================== */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.portal-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 44px 36px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Accent Top Glow Line */
.portal-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--accent-emerald);
    transition: var(--transition);
}

.portal-card.exati-card .portal-card-glow {
    background: var(--accent-blue);
}

.portal-card:hover {
    transform: translateY(-8px);
    background: var(--bg-card-hover);
}

.portal-card.oficios-card:hover {
    border-color: var(--accent-emerald);
    box-shadow: var(--shadow-hover-emerald);
}

.portal-card.exati-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-hover-blue);
}

/* Icon Box (Grande e Imponente) */
.portal-icon-box {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: var(--accent-emerald-glow);
    border: 1px solid rgba(16, 163, 127, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--accent-emerald);
    margin-bottom: 24px;
    transition: var(--transition);
}

.portal-card.exati-card .portal-icon-box {
    background: var(--accent-blue-glow);
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--accent-blue);
}

.portal-card:hover .portal-icon-box {
    transform: scale(1.1);
}

/* Info Tags & Text */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--accent-emerald-subtle);
    border: 1px solid rgba(16, 163, 127, 0.2);
    color: var(--accent-emerald);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.portal-badge i {
    font-size: 6px;
}

.portal-badge.blue {
    background: var(--accent-blue-subtle);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--accent-blue);
}

.portal-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.portal-metric {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.portal-metric .metric-tag {
    color: var(--text-primary);
    font-weight: 700;
}

/* Action Button (Largo, Destaque Máximo) */
.portal-action-btn {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--accent-emerald);
    color: #ffffff;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(16, 163, 127, 0.3);
}

.portal-action-btn.blue {
    background: var(--accent-blue);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.portal-card:hover .portal-action-btn {
    transform: translateY(-2px);
}

.portal-card.oficios-card:hover .portal-action-btn {
    background: var(--accent-emerald-hover);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.45);
}

.portal-card.exati-card:hover .portal-action-btn {
    background: var(--accent-blue-hover);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.portal-card:hover .portal-action-btn i {
    transform: translateX(5px);
    transition: transform 0.2s ease;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.hub-footer {
    height: 54px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-header);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-emerald);
}

/* ==========================================================================
   Mobile & Responsive Adaptability (100% Fluido em Celulares e Tablets)
   ========================================================================== */
@media (max-width: 860px) {
    .portal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .navbar {
        padding: 0 16px;
    }
    .nav-center {
        display: none !important;
    }
    .hub-title {
        font-size: 26px;
    }
    .portal-card {
        padding: 32px 24px 28px;
    }
    .portal-icon-box {
        width: 76px;
        height: 76px;
        font-size: 34px;
        margin-bottom: 18px;
    }
    .portal-action-btn {
        height: 48px;
        font-size: 14.5px;
    }
}

/* Telas Mobile Smartphones (iPhone & Android <= 600px) */
@media (max-width: 600px) {
    .navbar {
        height: 56px;
        padding: 0 12px;
    }
    .brand-logo-img {
        height: 28px;
    }
    .brand-title {
        font-size: 13.5px;
    }
    .brand-title .hub-tag {
        font-size: 9px;
        padding: 1px 5px;
    }
    .brand-divider,
    .brand-subtitle {
        display: none !important;
    }
    #systemStatusText {
        display: none !important;
    }
    .system-status-pill {
        padding: 6px;
        border-radius: 50%;
    }
    .pulse-dot {
        margin: 0;
    }
    .nav-btn {
        width: 32px;
        height: 32px;
    }

    .hub-main {
        padding: 20px 14px 28px 14px;
    }
    .hub-header {
        margin-bottom: 22px;
    }
    .hub-header-badge {
        font-size: 10px;
        padding: 4px 10px;
        margin-bottom: 10px;
    }
    .hub-title {
        font-size: 22px;
        letter-spacing: -0.4px;
        margin-bottom: 6px;
    }
    .hub-subtitle {
        font-size: 13px;
        line-height: 1.4;
    }

    .portal-grid {
        gap: 16px;
    }
    .portal-card {
        padding: 24px 18px 20px 18px;
        border-radius: var(--radius-lg);
    }
    .portal-icon-box {
        width: 60px;
        height: 60px;
        font-size: 26px;
        border-radius: 16px;
        margin-bottom: 14px;
    }
    .portal-badge {
        font-size: 10.5px;
        padding: 3px 10px;
        margin-bottom: 8px;
    }
    .portal-name {
        font-size: 20px;
        margin-bottom: 4px;
    }
    .portal-metric {
        font-size: 13px;
        margin-bottom: 18px;
    }
    .portal-action-btn {
        height: 44px;
        font-size: 14px;
        border-radius: var(--radius-md);
    }

    .hub-footer {
        height: auto;
        padding: 16px 12px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
        font-size: 11px;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
}
