/* ============================================
   MAIN.CSS — DISC DASHBOARD
   Estrutura global, tema claro/escuro,
   header, sidebar, botões, animações.
============================================ */

/* FONTES */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700&family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   VARIÁVEIS DE TEMA
============================================ */
:root {
    --cor-fundo: #0a0a0a;
    --cor-fundo-claro: #FFFFFF;
    --cor-texto: #FFFFFF;
    --cor-texto-claro: #241E4E;
    --cor-sidebar: #000000;
    --cor-sidebar-claro: #F5F5F5;
    --cor-header: #000000;
    --cor-header-claro: #FFFFFF;
    --cor-primaria: #F98948;
    --cor-secundaria: #241E4E;
    --cor-hover: #B5CBB7;
    --cor-neon: #F98948;
    --borda-neon: 0 0 10px rgba(249,137,72,0.7);
    --trans: 0.25s ease;

    /* ✅ NOVO — Imagem de fundo tema escuro */
    --bg-imagem: url('../imagens/imgtemaescuro.png');
}

/* TEMA CLARO */
[data-theme="light"] {
    --cor-fundo: #FFFFFF;
    --cor-texto: #241E4E;
    --cor-sidebar: #EEE;
    --cor-header: #FFFFFF;

    /* ✅ NOVO — Imagem de fundo tema claro */
    --bg-imagem: url('../imagens/imgtemaclaro.png');
}

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

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    overflow-x: hidden;

    /* ✅ NOVO — Fundo com imagem + blur */
    position: relative;
}

/* Pseudo-elemento para o fundo com blur */
/* COLE */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;      /* maior que a tela para esconder borda branca do blur */
    height: 120%;
    z-index: -1;
    background-image: var(--bg-imagem);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(2px);
    opacity: 0.50;
    transition: opacity 0.5s ease, filter 0.5s ease;
    will-change: opacity;
}

/* Tema claro — um pouco mais visível */
[data-theme="light"] body::before {
    opacity: 0.90;
    filter: blur(2px);
}

/* Títulos usam Orbitron */
h1, h2, h3, h4, h5, h6,
.titulo,
.dashboard-title {
    font-family: 'Orbitron', sans-serif;
}

/* ============================================
   HEADER (Ponto 1 - CORRIGIDO)
============================================ */
.header {
    width: 100%;
    height: 86px;
    background: var(--cor-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    border-bottom: 2px solid rgba(249, 137, 72, 0.25);
    box-shadow: 0 0 12px rgba(249, 137, 72, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    gap: 20px;
}

/* Logo DISC + Títulos */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-left .logo-header {
    height: 28px;
}

.header-titles {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.header-titles .titulo {
    font-size: 20px;
    font-weight: 700;
    color: var(--cor-texto);
    letter-spacing: 0.5px;
}

.header-titles .subtitulo {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}

/* Barra de busca (ajustada) */
.search-box {
    width: 340px;
    height: 40px;
    background: rgba(255,255,255,0.07);
    border-radius: 25px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
    transition: var(--trans);
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--cor-texto);
    outline: none;
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
}

.search-box input::placeholder {
    color: var(--cor-texto);
    opacity: 0.6;
}

.search-box i {
    font-size: 16px;
    color: var(--cor-texto);
    opacity: 0.7;
    cursor: pointer;
    transition: var(--trans);
}

.search-box:hover {
    box-shadow: var(--borda-neon);
}

.search-box:hover i {
    opacity: 1;
}

/* ============================================
   TEMA CLARO - Busca com borda azul
============================================ */
[data-theme="light"] .search-box {
  background: rgba(36, 30, 78, 0.03);
  border: 2px solid #241E4E; /* Azul escuro igual botões */
}

[data-theme="light"] .search-box:hover {
  box-shadow: 0 0 8px rgba(36, 30, 78, 0.3);
  border-color: #241E4E;
}

[data-theme="light"] .search-box i {
  color: #241E4E;
  opacity: 0.8;
}

[data-theme="light"] .search-box:hover i {
  opacity: 1;
  color: #241E4E;
}

/* Área direita (ajustada) */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

/* Relógio */
.clock {
    font-size: 18px;
    font-weight: 700;
    color: var(--cor-texto);
    letter-spacing: 1.5px;
    font-family: 'Orbitron', sans-serif;
    min-width: 95px;
}

/* Clima (ajustado - ícone + temperatura juntos) */
.weather-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-icon {
    font-size: 26px;
    color: var(--cor-primaria);
    cursor: pointer;
    transition: var(--trans);
}

.weather-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--cor-primaria));
}

.temperature {
    font-size: 16px;
    font-weight: 600;
    color: var(--cor-texto);
}

/* Botão tema (ajustado com ícone) */
.btn-tema {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cor-primaria);
    color: #FFF;
    font-size: 18px;
    cursor: pointer;
    border: none;
    transition: var(--trans);
    box-shadow: 0 0 12px rgba(249,137,72,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-tema:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 18px rgba(249,137,72,0.7);
    transform: rotate(15deg);
}

/* Usuário */
.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-box img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--cor-primaria);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    opacity: 0.75;
}

/* ============================================
   SIDEBAR (Pontos 2, 4, 5 - CORRIGIDOS)
============================================ */
.sidebar {
    position: fixed;
    top: 86px;
    left: 0;
    width: 250px;
    height: calc(100vh - 86px);
    background: var(--cor-sidebar);
    padding-top: 25px;
    overflow-y: auto;
    overflow-x: hidden; /* PONTO 5: Remove scroll horizontal */
    transition: var(--trans);
    box-shadow: 4px 0 14px rgba(0,0,0,0.35);
}

/* Recolhida */
.sidebar.closed {
    width: 70px;
}

.sidebar.closed .menu-item span {
    display: none;
}

.sidebar.closed .sidebar-logo {
    opacity: 0;
}

/* PONTO 5: Scrollbar personalizada estilo neon */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--cor-primaria);
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(249,137,72,0.6);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #ff9f5e;
    box-shadow: 0 0 14px rgba(249,137,72,0.9);
}

/* ============================================
   SIDEBAR - ESTRUTURA GERAL
============================================ */
.sidebar {
    position: fixed;
    top: 86px;
    left: 0;
    width: 250px;
    height: calc(100vh - 86px);
    background: var(--cor-sidebar);
    padding-top: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--trans);
    box-shadow: 4px 0 14px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
}

/* Recolhida */
.sidebar.closed {
    width: 70px;
}

.sidebar.closed .menu-item span {
    display: none;
}

.sidebar.closed .sidebar-logo {
    opacity: 0;
}

/* Scrollbar personalizada */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--cor-primaria);
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(249,137,72,0.6);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #ff9f5e;
    box-shadow: 0 0 14px rgba(249,137,72,0.9);
}

/* ============================================
   SIDEBAR - MENU ITEMS (ESTILO ERP)
============================================ */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* BOTÕES DO MENU - RAJDHANI NEGRITO */
.menu-item {
    margin: 8px 16px;
    padding: 12px 18px;
    background: rgba(255,255,255,0.05);
    border-radius: 25px;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--cor-texto);

    /* RAJDHANI NEGRITO */
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 700; /* Negrito/Bold */
    letter-spacing: 0.5px;

    text-align: left;
    position: relative;
    overflow: hidden;
}


/* EFEITO SHINE/SHIMMER DESLIZANTE */
.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(249, 137, 72, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.menu-item:hover::before {
    left: 100%;
}

/* ÍCONES FONTAWESOME */
.menu-item i {
    font-size: 19px;
    transition: all 0.3s ease;
    z-index: 1;
}

/* ============================================
   TEMA ESCURO - MENU
============================================ */
[data-theme="dark"] .menu-item i,
:root .menu-item i {
    color: var(--cor-primaria);
}

[data-theme="dark"] .menu-item:hover i,
:root .menu-item:hover i {
    color: #FFFFFF;
}

[data-theme="dark"] .menu-item span,
:root .menu-item span {
    color: var(--cor-primaria);
    z-index: 1;
}

[data-theme="dark"] .menu-item:hover span,
:root .menu-item:hover span {
    color: #FFFFFF;
}

/* HOVER TEMA ESCURO */
[data-theme="dark"] .menu-item:hover,
:root .menu-item:hover {
    background: rgba(249,137,72,0.15);
    border-color: rgba(249,137,72,0.6);
    box-shadow:
        0 0 14px rgba(249,137,72,0.45),
        inset 0 0 10px rgba(249,137,72,0.2);
    transform: translateX(4px);
}

[data-theme="dark"] .menu-item:hover i,
:root .menu-item:hover i {
    filter: drop-shadow(0 0 6px currentColor);
    transform: scale(1.15);
}

/* ITEM ATIVO TEMA ESCURO — BORDA ANIMADA CONIC */

/* Propriedade animada */
@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to { --angle: 360deg; }
}

[data-theme="dark"] .menu-item.active,
:root .menu-item.active {
    background: rgba(249,137,72,0.18);
    border: none;
    position: relative;
    overflow: visible;
    box-shadow: none;
}

/* Borda animada */
[data-theme="dark"] .menu-item.active::after,
:root .menu-item.active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 25px;
    padding: 2px;

    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 200deg,
        #F98948,
        transparent 360deg
    );

    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;

    animation: rotateBorder 3s linear infinite;
    z-index: 0;
}

/* Glow externo */
[data-theme="dark"] .menu-item.active::before,
:root .menu-item.active::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 25px;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 200deg,
        #F98948,
        transparent 360deg
    );
    filter: blur(12px);
    opacity: 0.5;
    animation: rotateBorder 3s linear infinite;
    z-index: 0;
}

[data-theme="dark"] .menu-item.active i,
:root .menu-item.active i {
    color: #FFFFFF !important;
    filter: drop-shadow(0 0 8px var(--cor-primaria));
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .menu-item.active span,
:root .menu-item.active span {
    color: #FFFFFF !important;
    position: relative;
    z-index: 1;
}

/* ============================================
   TEMA CLARO - MENU
============================================ */
[data-theme="light"] .menu-item {
    background: rgba(36, 30, 78, 0.05);
    border: 2px solid rgba(36, 30, 78, 0.25);
}

[data-theme="light"] .menu-item i {
    color: var(--cor-secundaria);
}

[data-theme="light"] .menu-item span {
    color: var(--cor-secundaria);
    z-index: 1;
}

/* HOVER TEMA CLARO */
[data-theme="light"] .menu-item:hover {
    background: rgba(249, 137, 72, 0.15);
    border-color: rgba(249, 137, 72, 0.6);
    box-shadow:
        0 0 14px rgba(249, 137, 72, 0.35),
        inset 0 0 10px rgba(249, 137, 72, 0.15);
    transform: translateX(4px);
}

[data-theme="light"] .menu-item:hover i {
    color: var(--cor-primaria);
    filter: drop-shadow(0 0 6px currentColor);
    transform: scale(1.15);
}

[data-theme="light"] .menu-item:hover span {
    color: var(--cor-primaria);
}

/* EFEITO SHINE NO TEMA CLARO */
[data-theme="light"] .menu-item::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(249, 137, 72, 0.25),
        transparent
    );
}

/* ITEM ATIVO TEMA CLARO — BORDA ANIMADA CONIC */
[data-theme="light"] .menu-item.active {
    background: rgba(36, 30, 78, 0.10);
    border: none;
    position: relative;
    overflow: visible;
    box-shadow: none;
}

/* Borda animada roxo/azul no tema claro */
[data-theme="light"] .menu-item.active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 25px;
    padding: 2px;

    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 200deg,
        #241E4E,
        transparent 360deg
    );

    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;

    animation: rotateBorder 3s linear infinite;
    z-index: 0;
}

/* Glow azul no tema claro */
[data-theme="light"] .menu-item.active::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 25px;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 200deg,
        #241E4E,
        transparent 360deg
    );
    filter: blur(12px);
    opacity: 0.35;
    animation: rotateBorder 3s linear infinite;
    z-index: 0;
}

[data-theme="light"] .menu-item.active i {
    color: #241E4E !important;
    filter: drop-shadow(0 0 6px #241E4E);
    position: relative;
    z-index: 1;
}

[data-theme="light"] .menu-item.active span {
    color: #241E4E !important;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

/* Animação de pulso no ícone ativo */
@keyframes pulseIcon {
    0%, 100% {
        filter: drop-shadow(0 0 6px var(--cor-primaria));
    }
    50% {
        filter: drop-shadow(0 0 12px var(--cor-primaria));
    }
}

/* Quando sidebar está recolhida */
.sidebar.closed .menu-item {
    justify-content: center;
    padding: 12px;
}

/* ============================================
   RODAPÉ DA SIDEBAR (Logo + Botão Recolher)
============================================ */
.sidebar-logo {
    width: 100%;
    text-align: center;
    margin-top: auto;
    padding: 15px 20px 20px;
    transition: var(--trans);
    position: relative; /* Para posicionar o botão */
}

.dev-label {
    display: block;
    font-size: 10px;
    opacity: 0.75;
    margin-bottom: 8px;
    color: var(--cor-texto);
}

.sidebar-logo img {
    width: 110px;
    max-width: 100%;
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(249,137,72,0.35));
    transition: var(--trans);
}

.sidebar-logo img:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Logo mais visível no tema claro */
[data-theme="light"] .sidebar-logo img {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(36, 30, 78, 0.3));
}

[data-theme="light"] .dev-label {
    opacity: 0.85;
}

/* ============================================
   BOTÃO RECOLHER (PREMIUM - POSIÇÃO CORRIGIDA)
============================================ */
.sidebar-toggle {
    position: absolute;
    bottom: 25px;
    right: -18px; /* SAI PRA FORA DA BORDA quando aberto */
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #F98948 0%, #ff7b34 100%);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 4px 12px rgba(249,137,72,0.5),
        0 0 20px rgba(249,137,72,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

/* Efeito de brilho interno */
.sidebar-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.sidebar-toggle:hover::before {
    left: 100%;
}

/* Ícone */
.sidebar-toggle i {
    font-size: 18px;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 1;
}

/* Hover */
.sidebar-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(249,137,72,0.7),
        0 0 30px rgba(249,137,72,0.5),
        inset 0 1px 0 rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.4);
}

.sidebar-toggle:hover i {
    transform: translateX(-3px);
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.8));
}

/* Active (ao clicar) */
.sidebar-toggle:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 2px 8px rgba(249,137,72,0.6),
        inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Quando sidebar FECHA (ícones sumiram) */
.sidebar.closed .sidebar-toggle {
    right: 50%;
    transform: translateX(50%); /* Centraliza quando fechado */
}

.sidebar.closed .sidebar-toggle:hover {
    transform: translateX(50%) translateY(-2px) scale(1.05);
}

.sidebar.closed .sidebar-toggle i {
    transform: rotate(180deg); /* Seta vira pra direita */
}

.sidebar.closed .sidebar-toggle:hover i {
    transform: rotate(180deg) translateX(-3px);
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.8));
}

/* Tema claro */
[data-theme="light"] .sidebar-toggle {
    background: linear-gradient(135deg, #F98948 0%, #ff9f5e 100%);
    border-color: rgba(36, 30, 78, 0.15);
    box-shadow:
        0 4px 12px rgba(249,137,72,0.4),
        0 0 20px rgba(249,137,72,0.25),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

[data-theme="light"] .sidebar-toggle:hover {
    box-shadow:
        0 6px 20px rgba(249,137,72,0.6),
        0 0 30px rgba(249,137,72,0.4),
        inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Animação de pulso sutil */
@keyframes pulseToggle {
    0%, 100% {
        box-shadow:
            0 4px 12px rgba(249,137,72,0.5),
            0 0 20px rgba(249,137,72,0.3),
            inset 0 1px 0 rgba(255,255,255,0.3);
    }
    50% {
        box-shadow:
            0 4px 12px rgba(249,137,72,0.6),
            0 0 25px rgba(249,137,72,0.4),
            inset 0 1px 0 rgba(255,255,255,0.3);
    }
}

.sidebar-toggle {
    animation: pulseToggle 3s infinite;
}

.sidebar-toggle:hover {
    animation: none;
}

/* ============================================
   CONTEÚDO PRINCIPAL
============================================ */
.main-content {
    margin-left: 250px;
    margin-top: 100px;
    padding: 30px;
    transition: var(--trans);
    min-height: calc(100vh - 100px);
}

.sidebar.closed ~ .main-content {
    margin-left: 70px;
}

/* ============================================
   SCROLLBAR GLOBAL (PONTO 5: melhorado)
============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--cor-primaria);
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(249,137,72,0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: #ff9f5e;
    box-shadow: 0 0 14px rgba(249,137,72,0.8);
}

/* ============================================
   ANIMAÇÕES
============================================ */
@keyframes pulseNeon {
    0%, 100% {
        box-shadow: 0 0 8px rgba(249,137,72,0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(249,137,72,0.8);
    }
}

@keyframes pulseIcon {
    0%, 100% {
        filter: drop-shadow(0 0 6px var(--cor-primaria));
    }
    50% {
        filter: drop-shadow(0 0 12px var(--cor-primaria));
    }
}

@keyframes iconPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* pulseNeon substituído pela borda animada — sem animation aqui */
.menu-item.active {
    animation: none;
}

/* ============================================
   BOTÕES GERAIS
============================================ */
.btn-primary {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: var(--cor-primaria);
    color: #FFF;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    transition: var(--trans);
    box-shadow: 0 0 10px rgba(249,137,72,0.45);
}

.btn-primary:hover {
    filter: brightness(1.12);
    box-shadow: 0 0 18px rgba(249,137,72,0.75);
    transform: translateY(-2px);
}

.foto-tema {
    font-weight: 600;
    margin-bottom: 6px;
}

.foto-legenda {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* ============================================
   RESPONSIVIDADE
============================================ */
@media (max-width: 1200px) {
    .search-box {
        width: 280px;
    }

    .header-right {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
        gap: 12px;
    }

    .sidebar {
        left: -260px;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        right: -45px !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 20px;
    }

    .user-info {
        display: none;
    }
}

/* ============================================
   UTILIDADES
============================================ */
.text-muted {
    opacity: 0.75;
}

.bold {
    font-weight: 600;
}

.center {
    text-align: center;
}

/* MODAL CLIMA */
.modal-clima {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-clima.ativo {
  display: flex;
}

.modal-clima-content {
  background: var(--fundo-card, #1a1d2e);
  border-radius: 12px;
  border: 2px solid var(--laranja, #FF6B35);
  padding: 0;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideDown 0.3s ease;
}

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

.modal-clima-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--borda, rgba(255,255,255,0.1));
  background: var(--fundo-secundario, #0f1117);
  border-radius: 12px 12px 0 0;
}

.modal-clima-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--laranja, #FF6B35);
}

.modal-clima-close {
  background: transparent;
  border: none;
  color: var(--texto-primario, #fff);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.modal-clima-close:hover {
  color: var(--laranja, #FF6B35);
}

.modal-clima-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.previsao-dia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--fundo-secundario, #0f1117);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s;
}

.previsao-dia:hover {
  border-color: var(--laranja, #FF6B35);
  transform: translateX(4px);
}

.previsao-dia .dia-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--texto-primario, #fff);
  margin: 0;
  min-width: 40px;
}

.previsao-dia .temperaturas {
  font-size: 16px;
  font-weight: 600;
  color: var(--laranja, #FF6B35);
  margin: 0;
  flex: 1;
  text-align: center;
}

.previsao-dia .emoji-clima {
  font-size: 28px;
  margin: 0;
  min-width: 40px;
  text-align: right;
}

/* Weather box clicável */
.weather-box:hover {
  opacity: 0.8;
  transform: scale(1.05);
  transition: all 0.2s;
}

.icone-clima-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* ============================================
   DROPDOWN CLIMA - WEATHER BOX
   Adicionado em 20/11/2025 - V2 Corrigida
============================================ */

/* Weather box clicável */
.weather-box {
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.weather-box:hover {
  opacity: 0.9;
}

.icone-clima-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* DROPDOWN MODAL */
.modal-clima {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 9999;
  animation: dropdownSlide 0.2s ease;
}

.modal-clima.ativo {
  display: block;
}

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

/* TEMA ESCURO - Contorno laranja */
.modal-clima-content {
  background: var(--cor-sidebar);
  border-radius: 8px;
  border: 2px solid var(--cor-primaria); /* Laranja #F98948 */
  padding: 0;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.modal-clima-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(249, 137, 72, 0.3); /* Laranja */
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-clima-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--cor-primaria); /* Laranja */
  letter-spacing: 0.5px;
}

.modal-clima-close {
  background: transparent;
  border: none;
  color: var(--cor-texto); /* Branco no escuro */
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.2s;
  line-height: 1;
}

.modal-clima-close:hover {
  color: var(--cor-primaria); /* Laranja */
}

.modal-clima-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.previsao-dia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(249, 137, 72, 0.05); /* Laranja fraco */
  border-radius: 6px;
  border: 1px solid rgba(249, 137, 72, 0.2); /* Laranja */
  transition: all 0.2s;
}

.previsao-dia:hover {
  background: rgba(249, 137, 72, 0.1);
  border-color: var(--cor-primaria); /* Laranja */
}

.previsao-dia .dia-nome {
  font-size: 12px;
  font-weight: 600;
  color: var(--cor-texto); /* Branco no escuro */
  margin: 0;
  min-width: 32px;
  text-transform: lowercase;
}

.previsao-dia .temperaturas {
  font-size: 13px;
  font-weight: 600;
  color: var(--cor-primaria); /* Laranja */
  margin: 0;
  flex: 1;
  text-align: center;
}

.previsao-dia .emoji-clima {
  font-size: 20px;
  margin: 0;
  min-width: 30px;
  text-align: right;
  line-height: 1;
}

/* ============================================
   TEMA CLARO - Contorno azul (#241E4E)
============================================ */
[data-theme="light"] .modal-clima-content {
  background: #FFFFFF;
  border-color: #241E4E; /* Azul escuro */
  box-shadow: 0 8px 24px rgba(36, 30, 78, 0.2);
}

[data-theme="light"] .modal-clima-header {
  background: rgba(36, 30, 78, 0.05);
  border-bottom-color: rgba(36, 30, 78, 0.2);
}

[data-theme="light"] .modal-clima-header h3 {
  color: #241E4E; /* Azul escuro */
}

[data-theme="light"] .modal-clima-close {
  color: #241E4E;
}

[data-theme="light"] .modal-clima-close:hover {
  color: var(--cor-primaria); /* Laranja */
}

[data-theme="light"] .previsao-dia {
  background: rgba(0, 0, 0, 0.30);
  border-color: rgba(36, 30, 78, 0.15);
}

[data-theme="light"] .previsao-dia:hover {
  background: rgba(36, 30, 78, 0.08);
  border-color: #241E4E;
}

[data-theme="light"] .previsao-dia .dia-nome {
  color: #241E4E; /* Azul escuro */
}

[data-theme="light"] .previsao-dia .temperaturas {
  color: #241E4E; /* Azul escuro */
}
.highlight-busca {
    background: #f98948;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
}



/* ============================================================
   HEADER MOBILE GLOBAL
   ============================================================ */
@media (max-width: 768px) {

    /* Header geral */
    .header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 0 14px 0;
        gap: 6px;
        height: auto !important;
        text-align: center;
        position: relative;
        z-index: 999;
    }

    /* Linha superior: menu + logo + dashboard */
    .header-left {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 4px;
        padding: 0 12px;
        position: relative;
    }

    /* Botão hamburger */
    #btnMenuMobile {
        display: flex !important;
        width: 38px;
        height: 38px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #222;
        border: 2px solid #ff7a33;
        margin-right: auto;
        position: relative;
        z-index: 100;
        cursor: pointer;
    }

    #btnMenuMobile i {
        font-size: 18px;
        color: #ff7a33;
        pointer-events: none;
    }

    /* Logo DISC */
    .logo-header {
        width: 75px;
        height: auto;
    }

    /* Dashboard title */
    .header-titles {
        margin-left: 8px;
        text-align: left;
    }
    .titulo {
        font-size: 22px;
    }
    .subtitulo {
        font-size: 11px;
    }

    /* Barra de busca */
    .search-box {
        width: 90%;
        margin: 4px auto 0 auto;
        height: 42px;
    }

    /* Linha inferior: relógio + clima + tema + perfil */
    .header-right {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 16px;
        margin-top: 6px;
    }

    .clock {
        font-size: 18px;
    }

    .weather-box {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .btn-tema {
        width: 42px;
        height: 42px;
    }

    .user-box img {
        width: 42px;
        height: 42px;
    }

    /* Main content ajuste */
    .main-content {
        margin-left: 0 !important;
        margin-top: 180px;
        padding: 16px;
        width: 100%;
    }

    /* Esconde botão desktop */
    #btnMenu {
        display: none !important;
    }

    /* Mostrar botão fechar sidebar */
    .sidebar-fechar {
        display: flex !important;
    }
}

/* ============================================
ESCONDER BOTÕES MOBILE NO DESKTOP
============================================ */

/* Hambúrguer e X ficam escondidos no DESKTOP */
#btnMenuMobile,
.sidebar-fechar {
  display: none;
}

/* ============================================
ESTADOS DA SIDEBAR (JS CONTROL)
============================================ */

/* DESKTOP: Sidebar fechada (.closed) */
.sidebar.closed {
  width: 80px;
}

.sidebar.closed .sidebar-logo-text,
.sidebar.closed .user-name,
.sidebar.closed .user-role,
.sidebar.closed .menu-text {
  display: none;
}

.sidebar.closed .sidebar-logo {
  padding: 16px 10px;
  justify-content: center;
}

.sidebar.closed .user-box {
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
}

.sidebar.closed .user-avatar {
  width: 40px;
  height: 40px;
}

.sidebar.closed .menu-item {
  justify-content: center;
  padding: 12px;
}

.sidebar.closed .menu-icon {
  margin-right: 0;
}

/* MOBILE: Sidebar aberta (.aberta) */
.sidebar.aberta {
  transform: translateX(0) !important;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  z-index: 10000 !important;
}

/* Overlay ativo (.mostrar) */
.sidebar-overlay.mostrar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Body com menu aberto */
body.menu-aberto {
  overflow: hidden;
}

/* ============================================================
SIDEBAR MOBILE — VERSÃO FINAL GLOBAL
============================================================ */

@media (max-width: 768px) {
  /* MOSTRAR botões mobile */
  #btnMenuMobile {
    display: flex !important;
  }

  .sidebar-fechar {
    display: flex !important;
  }

  /* Menu desktop some */
  #btnMenu {
    display: none !important;
  }

  /* Sidebar vira painel lateral */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--cor-sidebar);
    padding-top: 60px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.35s ease-in-out;
    z-index: 10000;
    border-right: 2px solid var(--cor-primaria);
  }

  /* Sidebar aberta */
  .sidebar.aberta {
    left: 0 !important;
  }

  /* Botão X DENTRO da sidebar */
  .sidebar-fechar {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 28px;
    color: var(--cor-primaria);
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s ease;
  }

  .sidebar-fechar:hover {
    transform: rotate(90deg);
    filter: drop-shadow(0 0 8px var(--cor-primaria));
  }

  /* Overlay escurecido */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9998;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.mostrar {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Congela scroll do body quando menu abre */
  body.menu-aberto {
    overflow: hidden !important;
  }

  /* Esconde botão desktop de recolher */
  .sidebar-toggle {
    display: none !important;
  }

  /* Main content sem margem lateral */
  .main-content {
    margin-left: 0 !important;
    margin-top: 160px;
    padding: 20px;
    width: 100%;
  }

  /* Botão hamburguer no header */
  #btnMenuMobile {
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(249,137,72,0.15);
    border: 2px solid var(--cor-primaria);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
  }

  #btnMenuMobile:hover {
    background: rgba(249,137,72,0.25);
    transform: scale(1.05);
  }

  #btnMenuMobile i {
    font-size: 20px;
    color: var(--cor-primaria);
  }

  /* Todas as páginas começam após header mobile */
  body {
    padding-top: 0;
  }

  .main-content > *:first-child {
    margin-top: 0 !important;
  }
}
