:root { 
    --sidebar-bg: #1e293b; 
    --sidebar-hover: #334155; 
    --topbar-bg: #ffffff; 
    --bg-color: #f1f5f9; 
    --accent-color: #3b82f6; 
    --card-bg: #ffffff; 
    --border-color: #e2e8f0; 
}

* { box-sizing: border-box; }

body { font-family: 'Segoe UI', system-ui, sans-serif; background-color: var(--bg-color); margin: 0; }
body:has(.sidebar) { display: flex; height: 100vh; overflow: hidden; }

/* LOGIN */
.login-wrapper { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 100vh; background-color: var(--sidebar-bg); padding: 20px; }
.login-box { background: var(--card-bg); padding: 40px; border-radius: 12px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.login-box h2 { color: #1e293b; margin-bottom: 20px; }
.login-box input { width: 100%; padding: 14px 12px; margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 15px; }
.login-box button { width: 100%; background: var(--accent-color); color: white; border: none; padding: 14px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 15px; }
.alert-erro { background: #fef2f2; color: #b91c1c; padding: 10px; border-radius: 6px; margin-bottom: 15px; font-size: 13px; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; padding: 10px; border-radius: 6px; margin-bottom: 15px; font-size: 13px; border: 1px solid #bfdbfe; }

/* SIDEBAR */
.sidebar { width: 240px; background: var(--sidebar-bg); color: white; display: flex; flex-direction: column; flex-shrink: 0; z-index: 1001; transition: width 0.3s ease, transform 0.3s ease; position: relative; }
.sidebar-header { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: center; display: flex; align-items: center; justify-content: center; min-height: 60px; position: relative; }
.sidebar-logo { width: 100%; max-width: 150px; height: auto; max-height: 34px; object-fit: contain; }
.nav-menu { list-style: none; padding: 10px 10px; margin: 0; }
.nav-menu li a { display: flex; align-items: center; padding: 9px 12px; color: #94a3b8; text-decoration: none; border-left: none; cursor: pointer; transition: all 0.2s; white-space: nowrap; font-size: 16px; border-radius: 8px; margin-bottom: 2px; }
.nav-menu li a span { font-size: 13px; font-weight: 500; margin-left: 10px; letter-spacing: 0.01em; }
.nav-menu li a:hover { background: rgba(255,255,255,0.07); color: #e2e8f0; }
.nav-menu li a.active { background: var(--accent-color); color: white; }

.main { flex-grow: 1; display: flex; flex-direction: column; width: 100%; min-width: 0; }

/* TOPBAR */
.topbar { background: var(--topbar-bg); height: 65px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h2 { font-size: 15px; margin: 0; color: #1e293b; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.user-info { font-size: 12px; color: #64748b; }
.btn-sair { color: #ef4444; text-decoration: none; font-size: 13px; padding: 8px 12px; border-radius: 6px; background: #fef2f2; font-weight: bold; }

/* SINO */
.notif-container { position: relative; display: flex; align-items: center; }
.notif-btn { background: none; border: none; font-size: 22px; cursor: pointer; position: relative; padding: 5px; color: #1e293b; transition: 0.2s; line-height: 1; }
.notif-btn:hover { transform: scale(1.1); }
.notif-badge { position: absolute; top: 0px; right: -2px; background: #ef4444; color: white; font-size: 10px; font-weight: bold; padding: 2px 5px; border-radius: 10px; line-height: 1; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.notif-dropdown { display: none; position: absolute; top: 100%; right: 0; background: white; width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-radius: 8px; border: 1px solid var(--border-color); z-index: 1001; margin-top: 10px; overflow: hidden; }
.notif-dropdown.show { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.notif-header { background: #f8fafc; padding: 12px 15px; font-weight: bold; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; font-size: 13px; color: #1e293b; }
.notif-clear-all { color: #3b82f6; font-size: 11px; text-decoration: none; font-weight: normal; }
.notif-body { max-height: 350px; overflow-y: auto; }
.notif-item { display: flex; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid #f1f5f9; transition: opacity 0.2s, background 0.2s; align-items: flex-start; }
.notif-item:hover { background: #f8fafc; }
.notif-link { text-decoration: none; color: #334155; font-size: 13px; line-height: 1.4; flex-grow: 1; margin-right: 10px; display: flex; flex-direction: column; cursor: pointer; }
.notif-time { font-size: 10px; color: #94a3b8; margin-top: 4px; font-weight: 600; }
.notif-close { color: #cbd5e1; text-decoration: none; font-size: 14px; padding: 2px; }
.notif-close:hover { color: #ef4444; }
.notif-empty { padding: 30px; text-align: center; color: #94a3b8; font-size: 13px; font-style: italic; }

.content { flex-grow: 1; position: relative; overflow-y: auto; width: 100%; }
iframe { width: 100%; height: 100%; border: none; display: none; position: absolute; top:0; left:0; }

/* DASHBOARD */
#dashboard { padding: 30px; }
.bloco-titulo { color: #334155; margin: 30px 0 20px 0; font-weight: 500; }

/* CARDS DE ESTATÍSTICA */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { background: white; padding: 20px; border-radius: 10px; border-left: 4px solid; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stat-num { font-size: 32px; font-weight: 700; color: #1e293b; line-height: 1; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-orange { border-left-color: #f97316; }
.stat-blue { border-left-color: #3b82f6; }
.stat-green { border-left-color: #10b981; }
.stat-purple { border-left-color: #8b5cf6; }
.stat-teal   { border-left-color: #06b6d4; }

/* GALERIAS RECENTES */
.bloco-galerias { background: white; border-radius: 10px; padding: 20px; margin-bottom: 25px; border: 1px solid var(--border-color); }
.bloco-galerias h3 { margin: 0 0 15px 0; color: #334155; font-size: 16px; }
.galerias-lista { display: flex; flex-direction: column; gap: 8px; }
.galeria-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #f8fafc; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.galeria-item:hover { background: #f1f5f9; }
.galeria-info { display: flex; flex-direction: column; gap: 2px; }
.galeria-info strong { color: #1e293b; font-size: 14px; }
.galeria-data { font-size: 11px; color: #94a3b8; }
.galeria-status { font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: 600; text-transform: uppercase; }
.status-pendente { background: #fef3c7; color: #92400e; }
.status-aprovado, .status-finalizado { background: #d1fae5; color: #065f46; }
.status-em_andamento { background: #dbeafe; color: #1e40af; }

/* GRID DE ACESSO RÁPIDO */
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.dash-card-link { cursor: pointer; text-align: center; padding: 30px 15px; transition: transform 0.2s ease, box-shadow 0.2s ease; text-decoration: none; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px solid var(--border-color); border-radius: 10px; background: white; color: inherit; }
.dash-card-link:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: #cbd5e1; }
.dash-card-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.dash-card-title { color: #1e293b; margin: 0 0 5px 0; font-size: 15px; font-weight: 600; }
.dash-card-desc { color: #64748b; font-size: 11px; margin: 0; }

/* CONTROLES SIDEBAR */
.btn-toggle-collapse { position: absolute; right: 10px; background: rgba(255,255,255,0.08); border: none; color: #94a3b8; width: 22px; height: 22px; border-radius: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: right 0.3s ease, background 0.2s, color 0.2s; }
.btn-toggle-collapse:hover { background: var(--accent-color); color: white; }
.btn-close-mobile { display: none; background: none; border: none; color: #94a3b8; font-size: 18px; position: absolute; right: 14px; cursor: pointer; }

.sidebar.collapsed { width: 62px; }
.sidebar.collapsed .sidebar-logo, .sidebar.collapsed .nav-menu li a span { display: none; }
.sidebar.collapsed .nav-menu { padding: 10px 6px; }
.sidebar.collapsed .nav-menu li a { justify-content: center; padding: 10px; font-size: 18px; }
.sidebar.collapsed .btn-toggle-collapse { right: 19px; }

.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: #1e293b; padding: 0; line-height: 1; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; }

/* MOBILE */
@media (max-width: 768px) {
    .sidebar { position: fixed; top: 0; left: 0; height: 100%; transform: translateX(-100%); width: 280px !important; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open .sidebar-logo { display: block !important; }
    .sidebar.open .nav-menu li a span { display: inline !important; }
    .sidebar.open .nav-menu li a { text-align: left !important; padding: 9px 14px !important; font-size: 16px !important; }
    .menu-toggle { display: block; }
    .sidebar-overlay.open { display: block; }
    .btn-toggle-collapse { display: none !important; }
    .btn-close-mobile { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    #dashboard { padding: 15px 15px 80px; }
    .topbar { padding: 0 15px; }
    .user-info { display: none; }
}
