@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* === VARIÁVEIS (MÁGICA DO DARK/LIGHT MODE) === */
:root {
    /* Modo Claro (Padrão) */
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    
    /* Um azul-marinho mais suave e moderno para destacar a logo */
    --sidebar-bg: #1A365D; 
    
    --sidebar-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --border-color: #e0e0e0;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
    /* Modo Escuro */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    
    /* Um cinza médio, elegante e não tão "pesado" (pitch black) */
    --sidebar-bg: #2A2A2A; 
    
    --sidebar-text: #e0e0e0;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --border-color: #333333;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* === RESET E BASES === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden; /* Mantém o body sem scroll para não bugar o layout lateral */
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, p, span { color: var(--text-main); }

/* === LAYOUT PRINCIPAL (DASHBOARD) === */
.sidebar {
    width: 260px; background-color: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; transition: all 0.3s;
    height: 100vh; /* Garante que a barra lateral ocupe toda a altura */
    flex-shrink: 0; /* Impede a barra lateral de espremer */
}
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo-sidebar { max-height: 40px; }
.sidebar-nav { display: flex; flex-direction: column; padding: 20px 0; }
.nav-item {
    padding: 15px 25px; color: var(--sidebar-text); text-decoration: none;
    display: flex; align-items: center; gap: 15px; font-weight: 500; transition: 0.2s;
}
.nav-item:hover, .nav-item.active { background-color: var(--sidebar-hover); border-left: 4px solid var(--primary-color); }

.main-content {
    flex: 1; 
    display: flex; 
    flex-direction: column;
    height: 100vh; 
    overflow-y: auto !important; /* FORÇA A BARRA DE ROLAGEM AQUI */
    padding: 20px; 
    width: 100%;
    position: relative; 
}
/* MÁGICA: NADA DENTRO DA TELA PRINCIPAL PODE SER ESMAGADO PELO NAVEGADOR */
.main-content > * {
    flex-shrink: 0 !important;
}

/* Container do Header */
.dashboard-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 25px; margin-bottom: 20px; border-radius: 15px;
    flex-shrink: 0; /* Impede o header de espremer quando tem muito conteúdo */
}

/* === BOTÕES === */
.btn-primary {
    background-color: var(--primary-color); color: white; border: none;
    padding: 10px 20px; border-radius: 8px; cursor: pointer;
    font-weight: bold; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-main); display: flex; align-items: center; padding: 5px; border-radius: 50%; }
.btn-icon:hover { background-color: var(--border-color); }
.btn-outline { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); font-weight: bold; padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-outline:hover { background: var(--primary-color); color: white; }
.btn-logout { background: #ff4d4d; color: white; border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-logout:hover { background: #d32f2f; }
.full-width { width: 100%; margin-top: 10px; }

/* === ESTILO DO BOTÃO DE TEMA (COM FUNDO) === */
.theme-btn-landing, #theme-toggle-dash {
    background: var(--card-bg) !important; /* Fundo sólido para destaque */
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-btn-landing:hover, #theme-toggle-dash:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* === GLASSMORPHISM === */
.glass-card {
    background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border); border-radius: 15px; padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); color: var(--text-main);
}
.glass-card-mini {
    background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* === LANDING PAGE (INDEX) === */
.landing-body { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; position: relative; overflow-x: hidden; }
.landing-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('../assets/FabLab-Fundo.jpg') center/cover no-repeat; z-index: -2; }
.landing-bg::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: -1; }
.theme-btn-landing { position: absolute; top: 20px; right: 20px; z-index: 10; }
.landing-title { font-size: 2.2em; color: var(--primary-color); font-weight: 900; }
.landing-subtitle { color: var(--text-muted); font-size: 1.1em; }
.btn-large { padding: 16px; font-size: 1.1em; border-radius: 12px; text-decoration: none; }
.btn-large:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4); }

/* === AJUSTE DA LOGO NO INDEX === */
.landing-logos {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}

.landing-logo-large {
    max-height: 85px;
    width: auto; /* Permite que o SVG calcule a largura proporcional à altura */
    min-width: 150px; /* Garante que ela não fique invisível */
    display: block;
    margin: 0 auto 15px auto;
}

.landing-logo-large:hover {
    transform: scale(1.05);
}

/* --- RODAPÉ AMPLIADO (INDEX) --- */
.large-footer { position: absolute; bottom: 0; left: 0; width: 100%; background: var(--card-bg); border-top: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; z-index: 10; }
.footer-main-content { padding: 12px 20px; width: 100%; max-width: 800px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 auto; }
.footer-logos-container { display: flex; align-items: center; justify-content: center; gap: 30px; width: 100%; }
.footer-logos-container .logo-footer { filter: grayscale(100%); opacity: 0.8; transition: 0.3s; }
.footer-logos-container .logo-footer:hover { filter: grayscale(0%); opacity: 1; }
.logo-gbx { max-height: 45px; } .logo-uniara { max-height: 30px; }
.footer-links { display: flex; align-items: center; gap: 15px; }
.btn-text { color: var(--primary-color); text-decoration: none; font-weight: bold; font-size: 0.95em; }
.btn-text:hover { text-decoration: underline; }
.dot-divider { color: var(--text-muted); }
.footer-copy { text-align: center; color: var(--text-muted); font-size: 0.85em; }
.footer-copy p { margin: 2px 0; }

/* --- LINHA DE COOKIES INDEPENDENTE --- */
.cookie-line { position: absolute; bottom: 0px; width: 100%; background-color: var(--sidebar-bg); color: white; display: flex; justify-content: center; align-items: center; gap: 20px; padding: 8px 20px; font-size: 0.85em; z-index: 20; transition: all 0.4s ease; border-bottom: 1px solid rgba(255,255,255,0.1); }
.cookie-line.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
.cookie-content { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; }
.cookie-content p { margin: 0; }
.cookie-content .material-symbols-outlined { display: flex; align-items: center; font-size: 1.2em; }
.btn-small { padding: 6px 15px; font-size: 0.85em; border-radius: 20px; }

/* === RODAPÉ FINO DO DASHBOARD === */
.dashboard-footer-slim { margin-top: auto; padding: 15px 30px; background: var(--glass-bg); border-top: 1px solid var(--glass-border); backdrop-filter: blur(10px); border-radius: 15px 15px 0 0; }
.footer-content-slim { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; font-size: 0.85em; color: var(--text-muted); width: 100%; }
.footer-logos-slim { display: flex; align-items: center; gap: 20px; }
.footer-logos-slim img.logo-gbx { max-height: 38px; opacity: 0.8; }
.footer-logos-slim img.logo-uniara { max-height: 28px; opacity: 0.8; }
.footer-logos-slim img:hover { opacity: 1; }
.footer-links-slim { display: flex; align-items: center; gap: 35px; }
.footer-links-slim a { color: var(--text-muted); text-decoration: none; transition: 0.2s; font-weight: 500; }
.footer-links-slim a:hover { color: var(--primary-color); }
.footer-copy-slim { display: flex; align-items: center; gap: 40px; }
.footer-copy-slim p, .footer-copy-slim span { font-size: 1.1em; }
.version { font-size: 1.1em; font-weight: bold; color: var(--primary-color); }
#device-badge { background: var(--primary-color); color: white; padding: 2px 6px; border-radius: 5px; font-size: 0.8em; margin-left: 5px; }

/* === COMPONENTES DO DASHBOARD === */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi-card { text-align: center; padding: 25px; }
.kpi-value { font-size: 2.5em; font-weight: bold; color: var(--primary-color); }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; margin-bottom: 30px; width: 100%; }
.status-pendente { background: #f1c40f; color: #000; }
.status-ativo { background: #3498db; color: #fff; }
.status-concluido { background: #2ecc71; color: #fff; }
.status-cancelado { background: #e74c3c; color: #fff; }

/* Container das Views (Telas) */
.view-content { 
    display: none; 
    animation: fadeIn 0.4s ease; 
    flex: 1 0 auto; /* Faz a view crescer para ocupar o espaço disponível e não encolher */
}
.view-content.active { 
    display: block; 
}
.hidden { display: none !important; }

/* === FORMULÁRIOS LARGOS E GRIDS === */
/* Container do Formulário */
.form-container-wide { 
    max-width: 900px; 
    margin: 0 auto 40px auto; /* Adiciona uma margem inferior para desgrudar do rodapé */
    width: 100%; 
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.col-full { grid-column: 1 / -1; }
.section-title { margin-top: 10px; border-bottom: 1px solid var(--glass-border); padding-bottom: 5px; color: var(--primary-color); }
.label-modern { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9em; color: var(--primary-color); }
.input-modern { width: 100%; padding: 10px; margin-bottom: 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-main); }
.input-modern:focus { outline: none; border-color: var(--primary-color); }

.locked-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; background: rgba(0, 0, 0, 0.03); border: 1px dashed var(--glass-border); border-radius: 15px; gap: 15px; }
[data-theme="dark"] .locked-overlay { background: rgba(255, 255, 255, 0.05); }
.locked-overlay .material-symbols-outlined { font-size: 3em; color: var(--text-muted); }

.consent-group { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; padding: 10px; background: rgba(0,0,0,0.05); border-radius: 8px; }
.consent-group label { font-size: 0.85em; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.consent-group a { color: var(--primary-color); text-decoration: underline; }

/* Imagens de fundo para os formulários */
.form-bg-visita, .form-bg-projeto { 
    position: relative; 
    overflow: visible !important; 
}
.form-bg-visita::before, .form-bg-projeto::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0.05; z-index: -1; }

/* === LISTAS DINÂMICAS E CHECKBOXES === */
.dynamic-input-row { display: flex; gap: 10px; align-items: flex-start; }
.dynamic-input-row input { margin-bottom: 0 !important; }
.btn-icon-green { background: #2ecc71; color: white; border: none; border-radius: 8px; padding: 10px 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.btn-icon-green:hover { background: #27ae60; }
.badges-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.badge-item { background: var(--sidebar-bg); color: white; padding: 5px 12px; border-radius: 15px; font-size: 0.85em; display: flex; align-items: center; gap: 8px; }
.badge-item .close-badge { cursor: pointer; font-size: 1.1em; color: #ff4d4d; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; background: rgba(0,0,0,0.03); padding: 15px; border-radius: 8px; border: 1px solid var(--glass-border); }
[data-theme="dark"] .checkbox-grid { background: rgba(255,255,255,0.05); }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9em; }

/* === MODAIS DE TEXTO (TERMOS/LGPD) === */
.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 2000; opacity: 1; transition: opacity 0.3s ease; }
.modal.hidden { opacity: 0; pointer-events: none; }
.modal-content { background-color: var(--card-bg); padding: 40px; border-radius: 15px; width: 90%; max-width: 400px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.2); border: 1px solid var(--border-color); }
.close-btn { position: absolute; top: 15px; right: 15px; }
.modal-header { text-align: center; margin-bottom: 25px; }

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

/* === FORÇAR ÍCONES BRANCOS EM COMPONENTES ESCUROS === */

/* Ícones do Menu Lateral (Sidebar) */
.nav-item .material-symbols-outlined {
    color: #ffffff !important; /* Sempre branco, independente do tema */
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Ícones dentro de botões azuis (Primary) */
.btn-primary .material-symbols-outlined {
    color: #ffffff !important;
}

/* Garante que o texto do menu também seja branco no modo claro */
.nav-item {
    color: #ffffff !important;
}

.nav-item:hover {
    color: var(--primary-color) !important; /* Destaque ao passar o mouse */
}

/* === CORREÇÕES DE CONTRASTE (SEMPRE BRANCO) === */

/* 1. Título "Portal FabLab" no Menu Lateral */
.sidebar-header h2,
.sidebar-header a {
    color: #ffffff !important;
}

/* 2. Texto e Ícone da Linha de Cookies */
.cookie-line,
.cookie-content p,
.cookie-content .material-symbols-outlined {
    color: #ffffff !important;
}

/* === MÁQUINAS E ESTOQUE === */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.machine-card {
    text-align: center;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px; 
}
.machine-img {
    width: 100%;
    height: 130px; /* Reduzimos a altura para a imagem não ficar gigante */
    object-fit: contain; /* ISSO impede a imagem de esticar ou cortar */
    margin-bottom: 10px;
    background-color: transparent; 
}
.machine-card h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
}
/* === BADGES DE STATUS PROFISSIONAIS === */
.machine-card .badge {
    padding: 8px 18px; /* Espaço interno para não "esmagar" o texto */
    border-radius: 30px; /* Cantos totalmente arredondados (pílula) */
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12); /* Sombra 3D elegante */
    margin: 0 auto;
}

/* Mantemos as suas cores exatas, mas aplicamos à nova forma */
.status-verde { background-color: #27ae60; color: white; }
.status-amarelo { background-color: #f1c40f; color: #333; }
.status-laranja { background-color: #e67e22; color: white; }
.status-vermelho { background-color: #c0392b; color: white; }

/* === PAINEL ADMIN: KPIs Secundários e Botões === */
.kpi-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.kpi-grid-small .kpi-card { padding: 15px; }
.kpi-grid-small h3 { font-size: 0.9em; color: var(--text-muted); }
.kpi-grid-small .kpi-value { font-size: 1.6em; }

hr.divider {
    border: 0; height: 1px;
    background: var(--glass-border);
    margin: 30px 0;
}

/* === BADGES ESTILO PÍLULA (ARREDONDADOS) === */
.badge, .status-badge { 
    padding: 6px 14px; 
    border-radius: 30px !important; /* Força o formato pílula */
    font-size: 0.85em; 
    font-weight: 700; 
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

/* Botões de Ação nas Tabelas */
.action-group { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; /* Evita quebrar layout em telas menores */
}
.btn-action {
    background: transparent; 
    border: 1px solid var(--glass-border);
    border-radius: 6px; 
    padding: 6px 12px; /* Mais espaço para o texto */
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    color: var(--text-color); 
    display: flex; 
    align-items: center; 
    gap: 6px; /* Espaço entre ícone e texto */
    transition: all 0.2s;
}
.btn-action .material-symbols-outlined { font-size: 1.3em; }
.btn-action:hover { background: var(--bg-hover); }
.btn-action.view { color: #3498db; border-color: #3498db; }
.btn-action.edit { color: #f39c12; border-color: #f39c12; }
.btn-action.delete { color: #e74c3c; border-color: #e74c3c; }

/* === MODAIS DO SISTEMA === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-box {
    background: var(--bg-color); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 25px; width: 90%; max-width: 500px;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { margin: 0; color: var(--primary-color); }
.modal-close { background: none; border: none; font-size: 1.5em; cursor: pointer; color: var(--text-muted); }

/* Filtros Grid */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 15px; }

/* === BOTÃO DE CANCELAR MODAL === */
.btn-cancelar {
    background: transparent; 
    border: 2px solid var(--text-muted); 
    color: var(--text-muted); 
    font-weight: bold; 
    padding: 10px 20px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.3s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
}
.btn-cancelar:hover { 
    background: var(--text-muted); 
    color: white; 
}

/* === TABELAS ADMIN COM BORDAS === */
.admin-table { 
    width: 100%; 
    border-collapse: separate; /* Necessário para border-radius funcionar em tabelas */
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 20px; 
    overflow: hidden;
}
.admin-table th { 
    text-align: left; 
    padding: 15px; 
    background-color: rgba(0,0,0,0.03);
    border-bottom: 2px solid var(--border-color); 
}
[data-theme="dark"] .admin-table th { background-color: rgba(255,255,255,0.03); }
.admin-table td { 
    padding: 15px; 
    border-bottom: 1px solid var(--border-color); 
}
.admin-table tr:last-child td { border-bottom: none; } /* Remove a borda da última linha */

/* === CONTAINER DE TABELAS (O "CARD" QUE ENVOLVE A TABELA) === */
.admin-table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); /* Sombra bem sutil */
    overflow-x: auto; /* Garante que a tabela não quebre em telas pequenas */
}

/* === LINHA DIVISÓRIA ELEGANTE === */
.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 40px 0;
    opacity: 0.6;
}

/* Ajuste fino nos títulos das seções para combinar com a divisória */
.admin-content h2, .admin-content h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

/* === DESTAQUES DO MONITOR (TELÃO) === */
.row-monitor-ativo {
    background-color: rgba(52, 152, 219, 0.08) !important;
    border-left: 5px solid #3498db;
}
.row-monitor-ativo td {
    font-weight: 600;
    color: var(--primary-color);
}
[data-theme="dark"] .row-monitor-ativo {
    background-color: rgba(52, 152, 219, 0.15) !important;
}

/* Cores específicas da Agenda no Monitor */
.status-agenda-breve { background-color: #f1c40f; color: #000; }
.status-agenda-ativo { background-color: #2ecc71; color: #fff; }
.row-agenda-fablab { border-left: 5px solid #f57c00; background-color: rgba(245, 124, 0, 0.08) !important; }
.row-agenda-nite { border-left: 5px solid #3498db; background-color: rgba(52, 152, 219, 0.08) !important; }

/* === HOTFIX: CORREÇÃO DE SCROLL E SOBREPOSIÇÃO DO RODAPÉ === */

.main-content {
    overflow-y: auto !important;
    padding-bottom: 0px !important;
}

.view-content.active {
    display: flex;
    flex-direction: column;
    flex: 1; /* Faz a tela expandir e empurrar o rodapé pro fundo */
}

.form-container-wide {
    margin-bottom: 60px; /* Dá um respiro generoso no final do formulário */
}

/* === RODAPÉ FINO DO DASHBOARD === */
.dashboard-footer-slim { 
    margin-top: auto; /* Empurra o rodapé para o final do espaço flexível */
    padding: 15px 30px; 
    background: var(--glass-bg); 
    border-top: 1px solid var(--glass-border); 
    backdrop-filter: blur(10px); 
    border-radius: 15px 15px 0 0; 
    flex-shrink: 0; /* Garante que o rodapé não vai ser esmagado */
}

/* === CORREÇÃO DAS TABELAS NO CELULAR === */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Deixa rolar pro lado com o dedo */
    -webkit-overflow-scrolling: touch; /* Rolagem suave no iPhone/iOS */
    margin-bottom: 15px;
}

.admin-table {
    min-width: 800px; /* 🌟 O SEGREDO: A tabela nunca vai se espremer mais que isso, ativando a rolagem! */
}

/* === RESPONSIVIDADE (MOBILE & TABLET) === */
@media (max-width: 768px) { 
    
    /* Evita que a tela inteira balance pro lado */
    .main-content {
        max-width: 100vw;
        overflow-x: hidden;
        padding: 15px;
    }

    /* Empilha os botões do cabeçalho */
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    .user-area {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    #btn-login-trigger, #btn-logout {
        width: 100%;
        justify-content: center;
    }

    /* Formulários em 1 coluna */
    .form-grid { grid-template-columns: 1fr; } 
    
    /* Grids de KPI e Informações em 1 coluna */
    .kpi-grid, .welcome-grid, .kpi-grid-small, .machine-grid {
        grid-template-columns: 1fr;
    }

    /* === MÁGICA DA BARRA LATERAL (OFF-CANVAS) === */
    .sidebar {
        position: fixed;
        left: -300px; 
        top: 0;
        z-index: 1000;
        box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    }
    
    .sidebar.active {
        left: 0; 
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        backdrop-filter: blur(3px);
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Esconde o E-mail (Texto) no celular para não espremer os botões */
    #user-email-display {
        display: none !important;
    }
    
    .footer-content-slim {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}
