/* ==========================
   🎨 Estilos base
========================== */

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.5;
}

/* ==========================
   📦 Contenedor general
========================== */

.container {
  display: flex;
  height: 100vh;
}

/* ==========================
   📚 Sidebar
========================== */

.sidebar {
  width: 60px;
  background: #2f3542;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  height: 100vh;
}

.nav-icons button {
  width: 40px;
  height: 40px;
  margin: 12px 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s;
}

.nav-icons button:hover {
  transform: scale(1.1);
}

/* ==========================
   🧾 Dashboard General
========================== */

.dashboard {
  flex: 1;
  padding: 30px;
}

header h1 {
  margin: 0;
  font-size: 28px;
}

header .fecha,
header .deposito {
  color: #666;
  font-size: 14px;
  margin: 4px 0;
}

/* ==========================
   🧱 Widgets
========================== */

main {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  flex: 3;
}

.widget {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.widget:hover {
  background-color: #f1f3f5;
}

.widget h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #555;
}

.widget .numero {
  font-size: 28px;
  font-weight: bold;
  color: #2f3542;
}

/* ==========================
   🛠 Acciones (Botones)
========================== */

.actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.actions button {
  padding: 12px 15px;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.actions button:hover {
  background: #f1f1f1;
}

/* ==========================
   📥 Formularios (Vistas)
========================== */

.vista {
  flex: 1;
  background: #ffffff;
  margin: 30px;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  max-width: 700px;
  overflow-y: auto;
}

.vista h2 {
  margin-top: 0;
  font-size: 22px;
  color: #2f3542;
  border-bottom: 2px solid #ccc;
  padding-bottom: 10px;
}

/* Inputs, selects y textareas */
.vista input[type="text"],
.vista input[type="number"],
.vista input[type="date"],
.vista select,
.vista textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.uppercase {
  text-transform: uppercase;
}

/* Botón de acción principal */
.vista button {
  padding: 10px 18px;
  background-color: #2f3542;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.vista button:hover {
  background-color: #57606f;
}

/* Feedback */
#feedback-entrada {
  font-weight: bold;
  margin-top: 10px;
}

/* ==========================
   📱 Responsive básico
========================== */

@media (max-width: 768px) {
  .widgets {
    grid-template-columns: 1fr;
  }

  .vista {
    margin: 20px;
    padding: 20px;
  }

  .dashboard {
    padding: 15px;
  }
}

/* ==========================
   🔝 Navbar superior (reemplaza sidebar lateral)
========================== */

.navbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #2f3542;
  padding: 10px 15px;
  height: 60px;
}

.navbar button {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s;
}

.navbar button:hover {
  transform: scale(1.1);
}

/* ==========================
   🔝 quitar subrayado de icono
========================== */

a.historial-link {
  text-decoration: none;
  color: inherit;
}
/* ==========================
   🎛️ Estilos para modal CSV
========================== */

#modal-csv {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5); /* Fondo semitransparente */
  display: none; /* Se muestra con JS */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#modal-csv .modal-content {
  background: white;
  border-radius: 8px;
  padding: 20px 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

/* Botones dentro del modal */
#modal-csv button.btn {
  margin: 8px 10px 0 10px;
  padding: 10px 18px;
  background-color: #2f3542;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

#modal-csv button.btn:hover {
  background-color: #57606f;
}

/* Área de drop */
#dropZone {
  cursor: pointer;
  transition: border-color 0.3s ease;
  user-select: none;
}

/* Contenedor principal */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9fafb;
  color: #333;
  margin: 20px;
  line-height: 1.5;
}

/* Títulos */
h1 {
  font-size: 2.2rem;
  color: #004080;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.5rem;
  color: #0066cc;
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 5px;
}

/* Formularios */
form {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  max-width: 600px;
}

/* Labels */
label {
  display: block;
  font-weight: 600;
  margin-top: 15px;
  margin-bottom: 6px;
  color: #222;
}

/* Inputs y selects */
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: #0066cc;
  outline: none;
}

/* Botones */
button[type="submit"],
button[type="button"] {
  margin-top: 20px;
  background-color: #0066cc;
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button[type="submit"]:hover,
button[type="button"]:hover {
  background-color: #004a99;
}

/* Botón Buscar al lado del input */
#internoInput {
  width: calc(100% - 90px);
  display: inline-block;
}

#buscarInternoBtn {
  width: 80px;
  display: inline-block;
  vertical-align: top;
  margin-left: 10px;
  padding: 8px;
  font-size: 1rem;
}

/* Div para mostrar datos interno */
#datosInterno {
  background: #e6f0ff;
  border: 1px solid #99c2ff;
  padding: 10px;
  border-radius: 5px;
  margin-top: 8px;
  font-style: normal;
}

/* Pedidos container */
#pedidosContainer {
  margin-top: 20px;
  max-width: 800px;
}

/* Pedidos como tabla */
#pedidosContainer table {
  font-size: 0.85rem;
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  border-radius: 8px;
  overflow: hidden;
}

#pedidosContainer th,
#pedidosContainer td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

#pedidosContainer th {
  background-color: #0066cc;
  color: white;
}

#pedidosContainer tr:hover {
  background-color: #f1f8ff;
}
#dependenciaInput {
  width: 100%;      /* Ocupa todo el ancho del contenedor */
  max-width: 400px; /* O el ancho que quieras */
  padding: 8px;     /* Un poco de espacio interno para que no quede chiquito */
  font-size: 1rem;  /* Texto legible */
  box-sizing: border-box; /* Para que el padding no aumente el ancho total */
}
#filtrosFila input {
  font-size: 0.8rem;  /* Igual que la tabla */
  padding: 2px 4px;
  box-sizing: border-box;
}
#insumoInput {
  width: 100%;
  max-width: 400px;
  padding: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}
#pedidosContainer table td:nth-child(9) input {
  font-size: inherit;
  line-height: normal;
  padding: 1px 3px;
  width: 100px; /* más angosto */
  box-sizing: border-box;
}
#modalAjuste {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}
#modalContenido {
  background: white;
  padding: 20px;
  border-radius: 5px;
  max-width: 500px;
  width: 90%;
}
/* Botón Cerrar sesión en header */
#btn-logout {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 0.9rem;
}

#btn-logout:hover {
  background-color: #c0392b;
}
.navbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #2f3542;
  padding: 10px 15px;
  height: 60px;
}

.navbar button {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.navbar button:hover {
  transform: scale(1.1);
}

.navbar button i {
  font-size: 22px;
  pointer-events: none;
}

#btn-logout {
  margin-left: auto;
  background-color: #e74c3c;
  font-size: 16px;
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

#btn-logout:hover {
  background-color: #c0392b;
}
/* Ajuste de posición del escudo en el header del dashboard */
.dashboard > header {
  padding: 0 20px;
}

.escudo {
  margin-right: 100px; /* Ajusta este valor para mover más o menos a la izquierda */
}

.password-link {
  margin-top: 10px;
  text-align: center;
}

.password-link a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.9em;
}

.password-link a:hover {
  text-decoration: underline;
  color: #fff;
}

#btnCambiarPass {
  font-size: 14px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* ====== HOME REFINEMENTS (append-only) ====== */
:root{
  --bg:#f7f9fb; --card:#fff; --line:#dfe3e8; --line2:#c6cdd5;
  --text:#1a1f36; --muted:#5b6b7d; --accent:#2d7ff9; --ok:#2e8b57;
}
html, body { background: var(--bg); color: var(--text); }
.wrap{ max-width:1200px; margin:24px auto; padding:0 16px; }

/* Navbar tweaks */
.navbar{ box-shadow: 0 1px 2px rgba(16,24,40,.08); position:sticky; top:0; z-index:20; }
.navbar button{ border-radius:10px; padding:6px 10px; }
.navbar button:hover{ background: rgba(255,255,255,.08); transform: none; }
.hide-sm{ display:inline }
@media (max-width: 640px){ .hide-sm{ display:none } }

/* Hero header */
.hero{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
}
.hero h1{ margin:0 0 4px; font-size: 24px; font-weight: 800; letter-spacing:.2px; }
.hero h2{ margin:0 0 6px; font-size: 14px; color:#475467; font-weight: 600; }
.hero .fecha{ margin:0; color:#5b6b7d }
.hero-badge img{ height: 88px; width:auto; display:block; }

/* Layout main grid */
.grid{ display:grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 960px){ .grid{ grid-template-columns: 1fr } }

/* Widgets */
.widgets{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 12px;
}
.widget{
  display:grid; grid-template-columns: auto 1fr auto; align-items:center; gap:12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; text-align:left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}
.widget:focus-visible{ outline: 2px solid #bcd2ff; outline-offset: 2px; }
.widget:hover{ transform: translateY(-1px); border-color: var(--line2);
  box-shadow: 0 2px 6px rgba(16,24,40,.08); }
.w-ico{ width:42px; height:42px; display:grid; place-items:center; border-radius:10px; background:#eef2ff; border:1px solid var(--line) }
.w-ico i{ font-size:18px; color:#2746cc }
.w-title{ font-weight:700; color:#111827 }
.w-sub{ font-size:12px; color:#6b7280; margin-top:2px }
.w-arrow i{ color:#98a2b3 }

/* Actions as a card */
.actions{
  background: var(--card); border:1px solid var(--line); border-radius:12px; padding:12px;
  display:flex; flex-direction:column; gap:10px; height:fit-content;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.actions button{
  background:#fff; border:1px solid var(--line); border-radius:10px; color:#111;
  display:flex; align-items:center; gap:8px; padding:10px 12px; font-size:14px; cursor:pointer;
}
.actions button:hover{ border-color: var(--line2); background:#f8fafc }
.actions i{ color:#2746cc }

.actions-title{
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 4px 4px 8px 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line, #E5E7EB);
}

/* Dynamic screen area when visible */
#pantalla{ margin: 16px auto; max-width:1200px; padding: 0 16px; }

/* Small improvements for links in buttons */
.historial-link button{ width:100%; text-align:left }
/* --- Modal genérico --- */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
}
.modal-content {
  position: relative;
  margin: 4vh auto;
  max-width: min(1200px, 95vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header, .modal-footer {
  padding: 12px 16px;
  background: #f6f6f6;
  border-bottom: 1px solid #e5e5e5;
}
.modal-footer { border-top: 1px solid #e5e5e5; border-bottom: none; }
.modal-body {
  padding: 12px 16px;
  overflow: auto;
}

/* Botón cerrar */
.modal-close {
  appearance: none; border: none; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer;
}

/* Tabla grande dentro del modal: que no se desborde */
.modal-body table { width: 100%; }

/* ===== Modificadores wide para vistas especiales (OLPA, etc.) ===== */

/* El contenedor superior puede crecer casi a todo el viewport */
.wrap-wide{
  max-width: none;
  width: min(98vw, 2000px);
}

/* El panel blanco (vista) sin límite de 700px */
.vista-wide{
  max-width: none;
  width: 100%;
}

/* Un poco más de padding en pantallas grandes (opcional) */
@media (min-width: 1280px){
  .vista-wide{ padding: 28px 36px; }
}

/* Columna ACCIONES pegajosa a la derecha */
#tabla-olpa thead th:last-child,
#tabla-olpa tbody td:last-child{
  position: sticky;
  right: 0;
  z-index: 3;
  background: #fff;                 /* igual que la fila normal */
  box-shadow: -6px 0 8px rgba(16,24,40,.06); /* separador visual */
}

/* Mantener zebra/hover también en la celda pegajosa */
#tabla-olpa tbody tr:nth-child(even) td:last-child{ background:#fafafa; }
#tabla-olpa tbody tr:hover td:last-child{ background:#f1f5f9; }

/* Compactar la columna de acciones */
#tabla-olpa td:last-child{
  white-space: nowrap;
  min-width: 170px;   /* ajusta según tus botones */
}

.table-wrap{
  padding-right: 12px;   /* espacio para que la sticky no quede cortada */
  -webkit-overflow-scrolling: touch;
}

.btn-accion{
  padding: 8px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.btn-accion:hover{ background:#f8fafc }
