/* ==========================================================================
   🌟 Estilos base para Triton Chip Manager
   Inspirado en interfaz moderna, limpio y responsivo
   ========================================================================== */

/* ===================================
   📝 Tipografía y Reset General
   =================================== */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    background-color: #f5f7fa;
    color: #333;
  }
  
  /* ===================================
     📌 Contenedor Principal
     =================================== */
  body {
    max-width: 1200px;
    margin: auto;
    padding: 2rem;
    margin-left: 210px !important;
  }
  
  /* ===================================
     🛍️ Navbar
     =================================== */
  .navbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: #0d47a1;
    padding: 1rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    justify-content: center;
    display: none !important;
  }
  
  .navbar a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 6px;
    background-color: #1565c0;
    transition: background-color 0.3s ease;
  }
  
  .navbar a:hover {
    background-color: #0d47a1;
  }
  
  /* ===================================
     📝 Formularios y Campos
     =================================== */
  form {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
  }
  
  label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
  }
  
  input,
  select,
  textarea {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fafafa;
    transition: border-color 0.3s ease;
  }
  
  input:focus,
  select:focus,
  textarea:focus {
    border-color: #1976d2;
    outline: none;
  }
  
  /* ===================================
     🔘 Botones
     =================================== */
  button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  button:hover {
    background-color: #0d47a1;
  }
  
  /* ===================================
     🔺 Estilos Especiales de Formularios
     =================================== */
  .fila-empresa {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
  }
  
  .fila-empresa input[type="text"] {
    flex: 1;
  }
  
  .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
  }
  
  /* ===================================
     📊 Modales
     =================================== */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modal-contenido {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease; /* Mejora: transición suave en modal */
  }
  
  .oculto {
    display: none;
  }
  
  /* ===================================
     🗂️ Tablas
     =================================== */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  }
  
  th, td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
  }
  
  th {
    background-color: #e3f2fd;
    font-weight: 600;
    color: #0d47a1;
  }
  
  tr:hover {
    background-color: #f1f8ff;
  }
  
  /* ===================================
     📱 Responsividad
     =================================== */
  @media (max-width: 768px) {
    body {
      padding: 1rem;
    }
  
    .navbar {
      flex-direction: column;
      align-items: center;
    }
  }
  
  @media (max-width: 480px) {
    .modal-contenido {
      width: 90%; /* Mejora: Modal mejor adaptado a pantallas pequeñas */
    }
    
    .navbar-lateral {
      padding: 0.5rem;
    }
    
    .navbar-lateral a {
      padding: 0.6rem 0.8rem;
      font-size: 0.9rem;
      max-width: 180px;
    }
  }
  
  /* ===================================
     Instrucciones
     =================================== */
  .instrucciones {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #007bff;
  }
  
  .instrucciones h3 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 10px;
  }
  
  .instrucciones p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
  }
  
  .instrucciones ol {
    color: #495057;
    line-height: 1.8;
  }
  
  .instrucciones ul {
    margin: 10px 0;
    padding-left: 20px;
  }
  
  .instrucciones code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #495057;
  }
  
  .formulario-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
  }
  
  .opcion-grupo {
    margin-bottom: 25px;
  }
  
  .opcion-grupo h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
  }
  
  .opcion-grupo label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
  }
  
  .opcion-grupo input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ced4da;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.2s;
  }
  
  .opcion-grupo input[type="file"]:hover {
    border-color: #007bff;
  }
  
  .opcion-grupo textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
  }
  
  .opcion-grupo textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  }
  
  .opcion-grupo small {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
  }
  
  .separador {
    text-align: center;
    margin: 25px 0;
    position: relative;
  }
  
  .separador::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
  }
  
  .separador span {
    background: white;
    padding: 0 15px;
    color: #6c757d;
    font-weight: 600;
  }
  
  .botones-formulario {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
  }
  
  .resultados {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  .estadisticas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .estadistica-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
  }
  
  .estadistica-numero {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    display: block;
  }
  
  .estadistica-label {
    color: #6c757d;
    font-size: 14px;
    margin-top: 5px;
  }
  
  .errores {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
  }
  
  .errores h4 {
    color: #721c24;
    margin-top: 0;
    margin-bottom: 10px;
  }
  
  .errores ul {
    color: #721c24;
    margin: 0;
    padding-left: 20px;
  }
  
  .errores li {
    margin-bottom: 5px;
  }
  
  /* ===================================
     Botones del Modal
     =================================== */
  .botones-modal {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
  }
  
  .botones-modal button {
    flex: 1;
    margin-top: 0;
  }
  
  .botones-modal button[type="button"] {
    background-color: #6c757d;
  }
  
  .botones-modal button[type="button"]:hover {
    background-color: #5a6268;
  }
  
  /* ===================================
     Mejoras del Modal
     =================================== */
  .modal-contenido h2 {
    color: #0d47a1;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  
  /* Botones de acción en tablas */
  .btn-accion {
    padding: 4px 8px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
  }
  
  .btn-retornar {
    background-color: #28a745;
    color: white;
  }
  
  .btn-retornar:hover {
    background-color: #218838;
  }
  
  .btn-cancelar {
    background-color: #dc3545;
    color: white;
  }
  
  .btn-cancelar:hover {
    background-color: #c82333;
  }
  
  .btn-generar {
    background-color: #007bff;
    color: white;
  }
  
  .btn-generar:hover {
    background-color: #0056b3;
  }
  
  .btn-editar {
    background-color: #ffc107;
    color: #212529;
  }
  
  .btn-editar:hover {
    background-color: #e0a800;
  }
  
  /* Filtros */
  .filtros-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
  }
  
  .filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .filtro-grupo label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
  }
  
  .filtro-grupo select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
  }
  
  .filtro-grupo select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  }
  
  .btn-secundario {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
  }
  
  .btn-secundario:hover {
    background-color: #5a6268;
  }
  
  .acciones {
    margin-bottom: 20px;
  }
  
  .btn-principal {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
  }
  
  .btn-principal:hover {
    background-color: #0056b3;
  }
  
  /* ===============================
     Barra de navegación lateral
     =============================== */
  .navbar-lateral {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 210px;
    background: #0d47a1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 2rem 0 2rem 0;
    gap: 0.5rem;
    z-index: 1000;
    box-shadow: 2px 0 12px rgba(0,0,0,0.07);
  }
  
  .navbar-lateral a {
    color: #fff;
    text-decoration: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0 20px 20px 0;
    background: none;
    transition: background 0.2s, color 0.2s;
    margin: 0 0.5rem;
  }
  
  .navbar-lateral a:hover, .navbar-lateral a.active {
    background: #1565c0;
    color: #fff;
  }
  
  @media (max-width: 900px) {
    .navbar-lateral {
      position: static;
      width: 100%;
      height: auto;
      flex-direction: row;
      flex-wrap: wrap;
      padding: 1rem;
      box-shadow: none;
      justify-content: center;
      gap: 0.5rem;
    }
    .navbar-lateral a {
      border-radius: 6px;
      padding: 0.5rem 1rem;
      margin: 0;
      flex: 0 1 auto;
      min-width: fit-content;
      text-align: center;
      font-size: 0.9rem;
    }
    body {
      margin-left: 0 !important;
    }
  }
  
  @media (max-width: 600px) {
    .navbar-lateral {
      flex-direction: column;
      align-items: center;
      padding: 0.5rem;
    }
    .navbar-lateral a {
      width: 100%;
      max-width: 200px;
      margin: 0.2rem 0;
      padding: 0.75rem 1rem;
      font-size: 1rem;
    }
  }
  
  /* ===============================
     Dashboard Triton
     =============================== */
  .dashboard-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }
  .dashboard-panel {
    flex: 1 1 220px;
    min-width: 220px;
    background: #1565c0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(13,71,161,0.13);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    position: relative;
  }
  .dashboard-panel .panel-icon {
    font-size: 2.2rem;
    margin-bottom: 0.7rem;
    color: #1976d2;
  }
  .dashboard-panel .panel-title {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.3rem;
  }
  .dashboard-panel .panel-value {
    font-size: 2.1rem;
    font-weight: 700;
    color: #fff;
  }
  .dashboard-panel .panel-sub {
    font-size: 0.95rem;
    color: #e3f2fd;
    margin-top: 0.2rem;
  }

  .dashboard-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: flex-start;
    margin-top: 1.5rem;
  }
  .dashboard-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #1976d2;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 1.2rem 2.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13,71,161,0.08);
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none;
  }
  .dashboard-btn:hover {
    background: #0d47a1;
    color: #fff;
    box-shadow: 0 4px 16px rgba(13,71,161,0.13);
  }
  @media (max-width: 900px) {
    .dashboard-panels {
      flex-direction: column;
      gap: 1.2rem;
    }
    .dashboard-buttons {
      flex-direction: column;
      gap: 1rem;
    }
  }
  