/* -------------------------
   RESET & BASE
------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  overflow-x: hidden;
  overflow-y: auto;
}

/* -------------------------
   HEADER SUPERIOR
------------------------- */
.header-bar {
  background-color: #1877f2;
  padding: 10px;
  text-align: center;
}

.header-title {
  color: #fff;
  font-size: 1.3rem;
  margin: 0;
}

/* -------------------------
   CONTENEDOR PRINCIPAL
------------------------- */
.container {
  width: 94%;
  margin: 0.5rem auto 0.5rem 1rem; /* Ajuste el margen izquierdo */
}

/* -------------------------
   SECCIÓN TOPE: SUBIR EXCEL + BOTONES
------------------------- */
.top-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.upload-section {
  background: #fff;
  border-radius: 6px;
  padding: 0.8rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  font-size: 0.85rem;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.upload-label {
  font-weight: bold;
}

.upload-input {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px;
  font-size: 0.85rem;
}

.btn-upload {
  background: #42b72a;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-upload:hover {
  background: #36a420;
}

/* Botones de navegación */
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-nav {
  background: #ffa640;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  border: none;
}

.btn-nav:hover {
  background: #ff9000;
}

/* -------------------------
   PRIMERA FILA (HORIZONTAL)
------------------------- */
.horizontal-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 2rem;
}

.state-wrapper {
  display: flex;
  align-items: center;
}

/* Flecha a la derecha */
.arrow-right {
  width: 0;
  height: 0;
  margin: 0 4px; /* Reduce el margen entre estados */
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #1877f2;
}

/* Ajuste para los estados (tarjetas kanban) */
.top-row-status {
  width: 220px;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-left: -10px; /* Ajuste para mover los estados un poco a la izquierda */
}

.top-row-cards {
  flex: 1;
  overflow-y: auto;
  margin-top: 4px;
  border: 2px dashed transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.top-row-cards.drag-over {
  background-color: #e3f7ff;
  border-color: #1ca0dd;
}

/* -------------------------
   SEGUNDA FILA (BLOQUES GRANDES)
------------------------- */
.second-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 2rem;
}

/* Bloques grandes */
.big-block {
  flex: 1;
  min-height: 600px;
  margin-left: -5px; /* Ajuste para mover los bloques grandes */
}

.big-status {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.big-container {
  min-height: 550px;
  max-height: none;
  border: 2px dashed transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.big-container.drag-over {
  background-color: #e3f7ff;
  border-color: #1ca0dd;
}

/* -------------------------
   CAJA DE ESTADO (GENÉRICA)
------------------------- */
.snake-status {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 10px;
  font-size: 0.80rem;
  position: relative;
}

.status-header {
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin-bottom: 6px;
  display: block;
  position: relative;
}

.title-wrapper {
  margin-right: 25px;
}

.status-header h3 {
  font-size: 0.95rem;
  margin: 0 0 4px 0;
  color: #333;
}

.status-header small a {
  color: #999;
  text-decoration: none;
  font-size: 0.7rem;
}

.status-header small a:hover {
  text-decoration: underline;
}

.expand-icon {
  font-size: 1.2rem;
  cursor: pointer;
  color: #666;
  position: absolute;
  top: 0;
  right: 0;
}

.expand-icon:hover {
  color: #000;
}

/* -------------------------
   TARJETAS (PEDIDOS)
------------------------- */
.card {
  background: #f8f8f8;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #e2e2e2;
  font-size: 0.75rem;
  color: #333;
  line-height: 1.1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  cursor: grab;
  word-wrap: break-word;
  margin-bottom: 6px;
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  border-color: #999;
}

.card a {
  font-size: 0.7rem;
  color: #1877f2;
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

/* -------------------------
   TABLAS EN MODALES
------------------------- */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.items-table th,
.items-table td {
  border: 1px solid #ccc;
  padding: 4px;
  text-align: left;
}

.items-table th {
  background: #f0f0f0;
}

/* -------------------------
   LISTA EXPANDIDA (MODAL)
------------------------- */
.expanded-cards-list {
  list-style-type: none;
  padding-left: 0;
}

.expanded-card-item {
  background: #f9f9f9;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* -------------------------
   BOTÓN CONFIRM
------------------------- */
.btn-confirm {
  background: #1877f2;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 4px;
  font-size: 0.8rem;
}

.btn-confirm:hover {
  background: #145db5;
}

/* -------------------------
   MENÚ CONTEXTUAL (Eliminar)
------------------------- */
.context-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  z-index: 9999;
  display: none;
  border-radius: 4px;
}

.context-menu button {
  background: none;
  border: none;
  width: 100%;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
}

.context-menu button:hover {
  background: #f4f4f4;
}

.btn-delete {
  color: #d00;
  font-weight: 600;
}

/* -------------------------
   MODALES GENERALES
------------------------- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: #fff;
  padding: 16px;
  border-radius: 6px;
  max-width: 600px;
  margin: 5% auto;
  position: relative;
  text-align: center;
}

.close-btn {
  font-size: 16px;
  cursor: pointer;
  position: absolute;
  top: 6px;
  right: 12px;
  color: #888;
}

.close-btn:hover {
  color: #333;
}
