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

body, html { 
  height: 100%; 
  font-family: Arial, sans-serif; 
}

/* -------- HEADER -------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #054a9b;
  padding: 10px 20px;
  color: white;
  height: 80px; /* Altura fija */
}

header img {
  height: 45px; /* Logo un poco más pequeño */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  background: #033a78;
  border: none;
  color: white;
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.menu-btn:hover {
  background: #022b57;
}

/* -------- USER INFO + BOTÓN CERRAR SESIÓN -------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

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

.user-name {
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.user-role {
  font-size: 12px;
  color: #ddd;
}

.logout-btn-header {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.3s ease;
  display: inline-block;
}

.logout-btn-header:hover {
  background: #b52a38;
}

/* -------- CONTAINER -------- */
.container {
  display: flex;
  flex-direction: row;
  height: calc(100% - 80px); /* Resta el header */
}

/* -------- SIDEBAR -------- */
.sidebar {
  width: 250px;
  background-color: #f0f0f0;
  border-right: 1px solid #ccc;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s ease;

  height: calc(100vh - 80px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar-content {
  overflow-y: auto;
}

.sidebar h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #003366;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  color: #003366;
  transition: background 0.3s ease;
}

.sidebar li:hover {
  background-color: #d0d0d0;
}

.sidebar .icon {
  margin-right: 10px;
  font-size: 18px;
}

.sidebar.collapsed .text {
  display: none;
}

.sidebar-footer {
  font-size: 12px;
  color: #555;
  text-align: center;
}

.sidebar-footer a {
  color: #054a9b;
  text-decoration: none;
}

/* -------- VIEWER -------- */
.viewer {
  width: 100%;
  padding: 0;
  position: relative;
  overflow-y: auto;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#loader-overlay img {
  width: 80px;
  height: auto;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 10px;
    height: auto;
  }

  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 250px;
    border-bottom: 1px solid #ccc;
    position: relative;
    top: 0;
  }

  .sidebar.collapsed {
    width: 100%;
  }

  .viewer {
    height: calc(100% - 250px);
  }
}
/* -------- LOGIN -------- */
.login-body {
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-container {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 350px;
  text-align: center;
}

.login-container h2 {
  margin-bottom: 20px;
  color: #054a9b;
}

.login-container input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.login-btn {
  width: 100%;
  background: #054a9b;
  color: white;
  border: none;
  padding: 10px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.login-btn:hover {
  background: #033a78;
}

.login-error {
  color: red;
  font-size: 14px;
  margin-bottom: 10px;
}