/* ===================================
   TEMA CORPORATE BLUE - Premium SaaS Professional
   Versão Refinada - Alto Nível Visual
   =================================== */

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
}

/* ===================================
   TEMA CLARO (LIGHT)
   =================================== */
.light-theme {
    background-color: #E7EDF6;
    color: #1F2A44;
}

.light-theme .content-section {
    background-color: #FFFFFF;
    color: #1F2A44;
    border-color: #E3E8F0;
}

.light-theme .main-content h1 {
    color: #1F2A44;
}

.light-theme .main-content p {
    color: #3A475E;
}

/* ===================================
   TEMA ESCURO (DARK)
   =================================== */
.dark-theme {
    background-color: #1A1F2E;
    color: #F0F4F8;
}

.dark-theme .content-section {
    background-color: #242B3D;
    color: #F0F4F8;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .main-content h1 {
    color: #F0F4F8;
}

.dark-theme .main-content p {
    color: #B8C5D6;
}

.dark-theme .secondary-menu {
    background: linear-gradient(180deg, #2D3548 0%, #1A1F2E 100%);
}

.dark-theme .menu-header {
    background-color: #242B3D;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .menu-button {
    background-color: rgba(45, 53, 72, 0.95);
    color: #F0F4F8;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.dark-theme .menu-button:hover {
    background-color: rgba(61, 69, 89, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .menu-button i {
    color: #7B9DD4;
}

.dark-theme .menu-button span {
    color: #A0B1C9;
}

.dark-theme .menu-button.highlight {
    background-color: rgba(45, 53, 72, 0.95);
    color: #F0F4F8;
}

.dark-theme .menu-button.highlight:hover {
    background-color: rgba(61, 69, 89, 0.95);
}

.dark-theme .menu-button.highlight i {
    color: #7B9DD4;
}

/* ===================================
   MENU PRINCIPAL FIXO
   =================================== */
.main-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 58px;
    background: linear-gradient(180deg, #2A4268 0%, #1E3250 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 1px 0 12px rgba(20, 35, 60, 0.15);
}

/* ===================================
   CABEÇALHO DO MENU PRINCIPAL
   =================================== */
.main-menu-header {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
    width: 34px;
    height: 34px;
    background-color: rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.logo:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
}

.logo i {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}

/* ===================================
   ITENS DO MENU PRINCIPAL
   =================================== */
.menu-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    gap: 2px;
}

.menu-item {
    width: 38px;
    height: 38px;
    margin: 4px 0;
    background-color: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-item i {
    color: rgba(160, 180, 210, 0.7);
    font-size: 16px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.04);
}

.menu-item:hover i {
    color: rgba(255, 255, 255, 0.9);
}

.menu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.06);
}

.menu-item.active i {
    color: #FFFFFF;
}

/* ===================================
   MENU SECUNDÁRIO
   =================================== */
.secondary-menu {
    position: fixed;
    left: -276px;
    top: 0;
    height: 100vh;
    width: 276px;
    background: linear-gradient(165deg, #3A5A85 0%, #2D4A72 50%, #274168 100%);
    z-index: 999;
    overflow-y: auto;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 20px rgba(20, 35, 60, 0.18);
}

.secondary-menu.show {
    left: 58px;
}

/* ===================================
   CABEÇALHO DO MENU SECUNDÁRIO
   =================================== */
.menu-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    padding: 0 24px;
    text-align: center;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-header h3 {
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2.5px;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
}

/* ===================================
   CONTEÚDO DO MENU SECUNDÁRIO
   =================================== */
.menu-content {
    padding: 24px 20px 28px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.menu-content.hidden {
    display: none;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
    max-width: 236px;
    justify-items: center;
}

/* ===================================
   BOTÕES/CARDS DO MENU SECUNDÁRIO
   =================================== */
.menu-button {
    background-color: rgba(253, 254, 255, 0.97);
    color: #1F2A44;
    text-decoration: none;
    padding: 18px 10px 16px 10px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    width: 100%;
    max-width: 108px;
    box-shadow: 0 1px 3px rgba(20, 40, 70, 0.06),
        0 4px 12px rgba(20, 40, 70, 0.05);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(20, 40, 70, 0.08),
        0 8px 20px rgba(20, 40, 70, 0.1);
    background-color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.9);
}

.menu-button i {
    font-size: 22px;
    margin-bottom: 10px;
    color: #4A6B94;
    transition: all 0.2s ease;
}

.menu-button:hover i {
    color: #3A5580;
    transform: scale(1.04);
}

.menu-button span {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.35;
    letter-spacing: 0.3px;
    color: #5A6B82;
    max-width: 88px;
}

.menu-button:hover span {
    color: #3D4E63;
}

/* Card highlight (ocupa 2 colunas) */
.menu-button.highlight {
    grid-column: span 2;
    max-width: 100%;
    min-height: 94px;
    background-color: rgba(253, 254, 255, 0.97);
    color: #1F2A44;
    padding: 20px 14px 18px 14px;
}

.menu-button.highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(20, 40, 70, 0.08),
        0 8px 20px rgba(20, 40, 70, 0.1);
    background-color: #FFFFFF;
}

.menu-button.highlight i {
    font-size: 24px;
    margin-bottom: 11px;
    color: #4A6B94;
}

.menu-button.highlight:hover i {
    color: #3A5580;
}

.menu-button.highlight span {
    font-size: 10px;
    color: #5A6B82;
}

.menu-button.highlight:hover span {
    color: #3D4E63;
}

/* Compatibilidade com links JSF */
.menu-button.ui-link,
.menu-button a {
    background-color: rgba(253, 254, 255, 0.97);
    color: #1F2A44;
    text-decoration: none;
    padding: 18px 10px 16px 10px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    width: 100%;
    max-width: 108px;
    box-shadow: 0 1px 3px rgba(20, 40, 70, 0.06),
        0 4px 12px rgba(20, 40, 70, 0.05);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

/* ===================================
   CONTEÚDO PRINCIPAL
   =================================== */
.main-content {
    margin-left: 58px;
    padding: 32px 40px;
    min-height: 100vh;
    overflow-y: auto;
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, #E7EDF6 0%, #E1E9F3 100%);
}

.main-content.with-secondary {
    margin-left: 334px;
}

.content-wrapper {
    width: 100%;
   
    margin: 0 auto;
}

.main-content h1 {
    color: #1F2A44;
    margin-bottom: 8px;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.main-content p {
    color: #4A5A70;
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 0.925rem;
}

/* ===================================
   SEÇÕES DE CONTEÚDO (CARDS)
   =================================== */
.content-section {
    background-color: #FFFFFF;
    padding: 24px 28px;
    margin-bottom: 24px;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(20, 40, 70, 0.04),
        0 4px 16px rgba(20, 40, 70, 0.06),
        0 8px 32px rgba(20, 40, 70, 0.04);
    border: 1px solid rgba(220, 228, 240, 0.6);
    transition: box-shadow 0.25s ease;
}

.content-section:hover {
    box-shadow: 0 2px 4px rgba(20, 40, 70, 0.05),
        0 8px 24px rgba(20, 40, 70, 0.08),
        0 16px 48px rgba(20, 40, 70, 0.05);
}

.content-section h2 {
    color: #1F2A44;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.content-section p {
    color: #4A5A70;
    line-height: 1.7;
}

/* ===================================
   SCROLLBAR PERSONALIZADA
   =================================== */
.secondary-menu::-webkit-scrollbar {
    width: 5px;
}

.secondary-menu::-webkit-scrollbar-track {
    background: transparent;
}

.secondary-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.secondary-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* ===================================
   COMPONENTES PRIMEFACES
   =================================== */
.ui-panel .ui-panel-content,
.ui-datatable .ui-datatable-data {
    background-color: transparent;
}

.ui-button {
    background-color: #3A5580;
    border-color: #3A5580;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ui-button:hover {
    background-color: #4A6B94;
    border-color: #4A6B94;
}

.ui-datatable .ui-datatable-thead > tr > th {
    background-color: #F5F8FC;
    color: #2D3E52;
    border-color: #E3E8F0;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ui-datatable .ui-datatable-data > tr:hover {
    background-color: #F5F9FD;
}

.ui-paginator {
    background-color: #E7EDF6;
    border-color: #E3E8F0;
}

.ui-inputfield {
    border-color: #D8E0EC;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ui-inputfield:focus {
    border-color: #4A6B94;
    box-shadow: 0 0 0 3px rgba(74, 107, 148, 0.1);
}

.ui-inputfield::placeholder {
    color: #94A3B8;
}

/* ===================================
   SELETOR DE TEMA
   =================================== */
.theme-selector {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    background: rgba(247, 250, 253, 0.95);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(20, 40, 70, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(220, 228, 240, 0.6);
}

.theme-selector .ui-selectonemenu {
    border-radius: 8px !important;
    border: 1px solid #D8E0EC !important;
    font-size: 12px !important;
}

.theme-selector .ui-selectonemenu .ui-selectonemenu-trigger {
    border-radius: 0 8px 8px 0 !important;
}

.dark-theme .theme-selector {
    background: rgba(26, 31, 46, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .theme-selector .ui-selectonemenu {
    background-color: #2D3548 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #F0F4F8 !important;
}

/* ===================================
   RESPONSIVIDADE - TABLET
   =================================== */
@media (max-width: 768px) {
    .main-menu {
        width: 50px;
    }

    .main-menu-header {
        height: 50px;
    }

    .menu-header {
        height: 50px;
        padding: 0 16px;
    }

    .menu-header h3 {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .logo {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .logo i {
        font-size: 13px;
    }

    .menu-item {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .menu-item i {
        font-size: 14px;
    }

    .secondary-menu {
        width: 256px;
        left: -256px;
    }

    .secondary-menu.show {
        left: 50px;
    }

    .main-content {
        margin-left: 50px;
        padding: 24px 20px;
    }

    .main-content.with-secondary {
        margin-left: 306px;
    }

    .menu-content {
        padding: 20px 16px;
    }

    .menu-grid {
        max-width: 216px;
        gap: 12px;
    }

    .menu-button {
        padding: 16px 8px 14px 8px;
        min-height: 82px;
        max-width: 100px;
        border-radius: 10px;
    }

    .menu-button.highlight {
        min-height: 88px;
    }

    .menu-button i {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .menu-button span {
        font-size: 8.5px;
    }
}

/* ===================================
   RESPONSIVIDADE - MOBILE
   =================================== */
@media (max-width: 600px) {
    .main-menu {
        width: 46px;
    }

    .main-menu-header {
        height: 46px;
    }

    .menu-header {
        height: 46px;
        padding: 0 12px;
    }

    .menu-header h3 {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .logo {
        width: 26px;
        height: 26px;
        border-radius: 7px;
    }

    .logo i {
        font-size: 11px;
    }

    .menu-item {
        width: 30px;
        height: 30px;
        border-radius: 7px;
    }

    .menu-item i {
        font-size: 13px;
    }

    .secondary-menu {
        width: 236px;
        left: -236px;
    }

    .secondary-menu.show {
        left: 46px;
    }

    .main-content {
        margin-left: 46px;
        padding: 16px;
    }

    .main-content.with-secondary {
        margin-left: 282px;
    }

    .menu-content {
        padding: 18px 14px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 160px;
    }

    .menu-button {
        max-width: 100%;
        min-height: 72px;
        padding: 14px 10px 12px 10px;
        border-radius: 10px;
    }

    .menu-button i {
        font-size: 20px;
        margin-bottom: 7px;
    }

    .menu-button span {
        font-size: 8.5px;
    }

    .menu-button.highlight {
        grid-column: span 1;
        max-width: 100%;
        min-height: 76px;
    }
}
/* ===================================
   Usability Enhancements (2026)
   =================================== */
.main-menu {
    z-index: 1250;
}

.secondary-menu {
    z-index: 1200;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 28, 45, 0.4);
    backdrop-filter: blur(1px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1150;
}

.menu-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.menu-header-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: rgba(233, 240, 250, 0.66);
    letter-spacing: 0.3px;
}

.menu-button small {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.35;
    font-weight: 500;
    color: #6f7d92;
    text-transform: none;
    letter-spacing: 0;
}

.menu-button.highlight small {
    color: #5d6f89;
}

.menu-button.locked-button {
    background-color: rgba(245, 247, 251, 0.95);
    border-color: rgba(188, 198, 214, 0.85);
}

.menu-button.locked-button i {
    color: #8997ad;
}

.menu-button.locked-button span {
    color: #5f6d82;
}

.menu-button.locked-button small {
    color: #7d8aa1;
}

.menu-grid > span {
    display: contents;
}

@media (max-width: 1024px) {
    .main-content.with-secondary {
        margin-left: 58px;
    }
}

@media (max-width: 768px) {
    .main-content.with-secondary {
        margin-left: 50px;
    }
}

@media (max-width: 600px) {
    .main-content.with-secondary {
        margin-left: 46px;
    }

    .menu-button small {
        font-size: 9.5px;
    }
}

@media (min-width: 1025px) {
    .menu-overlay {
        display: none !important;
    }
}
