* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f4f5f7;
  color: #1c1c1c;
}

/* ---- Login ---- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 380px;
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.subtitulo {
  margin: 0 0 24px;
  color: #666;
  font-size: 14px;
}
.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}
.login-card button {
  width: 100%;
  margin-top: 22px;
  padding: 11px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.login-card button:hover { background: #333; }
.alerta {
  background: #fdecea;
  color: #a31414;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 6px;
}

/* ---- Panel ---- */
.panel-body { min-height: 100vh; display: flex; flex-direction: column; }
.panel-header {
  background: #1a1a1a;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.panel-header .salir {
  color: #fff;
  text-decoration: underline;
}
.panel-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}
.lista-pdfs {
  width: 260px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 20px;
  overflow-y: auto;
}
.lista-pdfs h2 {
  font-size: 15px;
  margin: 0 0 14px;
  color: #444;
}
.lista-pdfs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.item-pdf {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: none;
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.item-pdf:hover { background: #e2e2e2; }
.visor { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sin-archivos { margin: auto; color: #777; }

.visor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #2a2a2a;
  color: #eee;
  font-size: 13px;
}
.visor-toolbar button {
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
}
.visor-toolbar button:hover { background: #555; }
.visor-sep {
  width: 1px;
  height: 18px;
  background: #555;
  margin: 0 4px;
}
.visor-canvas-wrap {
  flex: 1;
  overflow: auto;
  text-align: center;
  padding: 20px;
  background: #5c5c5c;
  cursor: grab;
}
.visor-canvas-wrap canvas {
  display: inline-block;
  vertical-align: top;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  height: auto;
}
.visor-canvas-wrap.arrastrando {
  cursor: grabbing;
}
.visor-mensaje { color: #eee; margin-top: 40px; text-align: center; }

@media (max-width: 700px) {
  .panel-layout { flex-direction: column; }
  .lista-pdfs { width: 100%; border-right: none; border-bottom: 1px solid #e0e0e0; }
  .visor-canvas-wrap { min-height: 60vh; padding: 10px; }
}