/* --- Reseteo y Fuentes --- */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
  background-color: #f0f4f9;
  overflow: hidden;
}

/* --- Barra Lateral --- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 260px;
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  z-index: 10;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 20px;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
}

.menu-toggle-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #5f6368;
}

.lista-menu {
  list-style: none;
  padding: 15px 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.lista-menu li a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  margin: 4px 10px;
  text-decoration: none;
  color: #3c4043;
  font-size: 15px;
  border-radius: 25px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link-icon {
  margin-right: 15px;
  font-size: 18px;
}

.lista-menu li a:hover {
  background-color: #f1f3f4;
}

.lista-menu li a.activo {
  background-color: #e8f0fe;
  color: #1967d2;
  font-weight: 500;
}

/* --- TOPBAR --- */
.topbar{
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(240, 244, 249, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e6e9ee;
  z-index: 1000; /* ✅ SIEMPRE ARRIBA DEL OVERLAY */
}

.topbar-left{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-title{
  font-size: 16px;
  color: #202124;
  font-weight: 500;
}

.topbar-subtitle{
  font-size: 12px;
  color: #5f6368;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Login en topbar */
.topbar-login{
  display:flex;
  align-items:flex-end;
  gap:10px;
  flex-wrap: wrap;
}

.tl-field{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.tl-field label{
  font-size: 11px;
  color:#5f6368;
}

.tl-field input{
  width: 170px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  outline:none;
  background:#fff;
}

.tl-field input:focus{
  border-color:#c7d2fe;
  box-shadow:0 0 0 4px rgba(26,115,232,.12);
}

.tl-btn{
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background:#1a73e8;
  color:#fff;
  cursor:pointer;
  font-weight:600;
}

.tl-btn:hover{ background:#1558c0; }

.tl-error{
  font-size: 12px;
  color:#b91c1c;
  margin-left: 6px;
  align-self:center;
}

/* Chip usuario */
.user-chip{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1967d2;
  background: #e8f0fe;
  flex: 0 0 auto;
}

.user-info{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-info .name{
  font-size: 13px;
  color: #202124;
  font-weight: 500;
}

.user-info .role{
  font-size: 11px;
  color: #5f6368;
}

.tl-logout{
  text-decoration:none;
  color:#1967d2;
  font-weight:600;
  padding: 8px 10px;
  border-radius: 10px;
}
.tl-logout:hover{ background:#e8f0fe; }

/* --- Contenido principal --- */
.contenido-principal {
  margin-left: 260px;
  width: calc(100% - 260px);
  height: 100vh;
  padding-top: 64px;
  transition: margin-left 0.3s ease, width 0.3s ease;
  position: relative; /* ✅ overlay absoluto aquí */
  z-index: 1;         /* ✅ por debajo de topbar */
}

.frame-contenido {
  display: none;
  width: 100%;
  height: calc(100vh - 64px);
  border: none;
}

.frame-contenido.activo { display: block; }

/* --- Minimizando --- */
html.sidebar-minimized .sidebar { width: 80px; }
html.sidebar-minimized .sidebar-header h3 { display: none; }
html.sidebar-minimized .sidebar-header { justify-content: center; }
html.sidebar-minimized .nav-link-text { display: none; }
html.sidebar-minimized .lista-menu li a { justify-content: center; }
html.sidebar-minimized .nav-link-icon { margin-right: 0; font-size: 22px; }
html.sidebar-minimized .contenido-principal { margin-left: 80px; width: calc(100% - 80px); }
html.sidebar-minimized .topbar{ left: 80px; }
html.sidebar-minimized .user-info{ display: none; }

/* --- Overlay censura --- */
.lock-overlay{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background: rgba(15, 23, 42, .62);
  z-index: 40; /* ✅ debajo de topbar (1000) */
}

.lock-card{
  background: rgba(255,255,255,.94);
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  text-align:center;
  max-width: 420px;
}

.lock-title{
  font-size: 14px;
  font-weight: 700;
  color:#111827;
}

.lock-sub{
  margin-top: 6px;
  font-size: 12px;
  color:#4b5563;
}

html.locked .lock-overlay{ display:flex; }
html.locked .frame-contenido.activo{
  filter: blur(10px);
  pointer-events:none;
  user-select:none;
}
/* Avatar con logo */
.avatar-logo{
  padding:0;
  background:#fff;
}

.avatar-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  border-radius:50%;
}
