/* Tarjeta móvil de ticket */
.ticket-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px 0 rgba(37,117,252,0.08), 0 1.5px 4px 0 rgba(0,0,0,0.04);
  margin: 18px 0;
  padding: 0 0 10px 0;
  overflow: hidden;
  border: 1px solid #e6eaf1;
  transition: box-shadow 0.2s;
}
.ticket-card:hover {
  box-shadow: 0 4px 20px 0 rgba(37,117,252,0.13), 0 2px 8px 0 rgba(0,0,0,0.07);
}
.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f6f8fc;
  padding: 12px 18px 8px 18px;
  border-bottom: 1px solid #e6eaf1;
}
.ticket-card-id {
  font-size: 0.95em;
  color: #2575fc;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.ticket-card-date {
  font-size: 0.93em;
  color: #888;
  font-style: italic;
}
.ticket-card-body {
  padding: 12px 18px 0 18px;
}
.ticket-card-section-principal {
  margin-bottom: 10px;
}
.ticket-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 7px;
}
.ticket-card-label {
  font-weight: 700;
  color: #444;
  font-size: 1em;
  margin-right: 8px;
}
.ticket-card-value {
  font-weight: 400;
  color: #222;
  font-size: 1em;
  text-align: right;
  word-break: break-word;
}
.ticket-card-status {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.98em;
  font-weight: 700;
  display: inline-block;
}
.status-completado {
  background: #e6f7e6;
  color: #389e3d;
  border: 1px solid #b7e4b7;
}
.status-pendiente {
  background: #e6f0ff;
  color: #2575fc;
  border: 1px solid #b7d2ff;
}
.status-sin-asignar {
  background: #fff0f0;
  color: #ff4d4f;
  border: 1px solid #ffb3b3;
}
.ticket-card-details {
  background: #f9fbfd;
  border-radius: 12px;
  margin-top: 10px;
  padding: 10px 12px 8px 12px;
  border: 1px solid #e6eaf1;
  display: none;
  font-size: 0.98em;
  color: #333;
}
.ticket-card-details.expanded {
  display: block;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  border-bottom: 1px dashed #e6eaf1;
  padding-bottom: 3px;
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-label {
  font-weight: 600;
  color: #666;
  margin-right: 8px;
}
.detail-value {
  color: #222;
  text-align: right;
  word-break: break-word;
}
.ticket-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 0 18px;
}
.btn-action {
  background: #f6f8fc;
  border: 1px solid #e6eaf1;
  border-radius: 8px;
  padding: 0;
  width: 38px;
  height: 38px;
  font-size: 1em;
  color: #2575fc;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn-action:hover {
  background: #e6f0ff;
  box-shadow: 0 1px 4px 0 rgba(37,117,252,0.10);
}
.btn-action svg {
  vertical-align: middle;
  margin-right: 0;
  width: 100%;
  height: 100%;
}
.toggle-details-btn {
  background: none;
  border: none;
  color: #2575fc;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  margin: 0 0 5px 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.toggle-details-btn:hover {
  color: #174a96;
}
.arrow {
  font-size: 1.1em;
  margin-left: 2px;
}
.na {
  color: #bbb;
  font-style: italic;
}
/* Firma imagen */
.ticket-card-details img {
  max-width: 120px;
  max-height: 40px;
  border-radius: 4px;
  border: 1px solid #e6eaf1;
  background: #fff;
}
/* Responsive */
@media (max-width: 600px) {
  .ticket-card {
    margin: 12px 0;
    padding: 0 0 8px 0;
  }
  .ticket-card-header, .ticket-card-body, .ticket-card-actions {
    padding-left: 10px;
    padding-right: 10px;
  }
  .ticket-card-details {
    padding: 8px 6px 6px 6px;
  }
}

/* --- Botón PDF --- */
.btn-pdf {
  background-color: rgba(255, 140, 0, 0.1);
  border: 1px solid rgba(255, 140, 0, 0.3);
  color: #ff8c00;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.08);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.btn-pdf:hover {
  background-color: #ff8c00;
  color: #fff;
  transform: scale(1.05);
}

.btn-pdf svg {
  fill: currentColor;
  width: 60%;
  height: 60%;
  transition: transform 0.2s;
} 
.ticket-grid-container {
  overflow-x: auto;
  width: 100%;
}

.ticket-grid {
  min-width: 1800px;
  border-collapse: collapse;
  background-color: #ffffff;
  border: none;
  margin-bottom: 20px;
}

  .ticket-grid th:first-child {
      border-top-left-radius: 16px;
  }

  .ticket-grid th:last-child {
      border-top-right-radius: 16px;
  }

  .ticket-grid tr:last-child td:first-child {
      border-bottom-left-radius: 12px;
  }

  .ticket-grid tr:last-child td:last-child {
      border-bottom-right-radius: 12px;
  }

  .ticket-grid tr {
      border-bottom: 1.5px solid #ece6fa;
  }

  .ticket-grid th, .ticket-grid td {
      font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
      font-size: 1em;
      padding: 12px 16px;
      vertical-align: middle;
      border-radius: 0 !important;
  }

      .ticket-grid th:last-child,
      .ticket-grid td:last-child {
          border-top-right-radius: 0 !important;
          border-bottom-right-radius: 0 !important;
      }

      .ticket-grid th:first-child,
      .ticket-grid td:first-child {
          border-top-left-radius: 0 !important;
          border-bottom-left-radius: 0 !important;
      }

  .ticket-grid tr:hover td {
      background-color: #e6e6fa;
      color: #333;
      transition: background 0.18s;
  }

  .ticket-grid th {
      background-color: #6a11cb;
      color: #ffffff;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 10px 12px;
      text-align: left;
      position: sticky;
      top: 0;
      z-index: 2;
      font-size: 0.97em;
  }

      .ticket-grid th.sticky-actions {
          position: sticky;
          right: 0;
          background: #6a11cb;
          color: #fff;
          z-index: 11;
          min-width: 120px;
          box-shadow: -2px 0 6px -2px rgba(37,117,252,0.08);
          border-left: 2px solid #e0e7ff;
          text-align: center;
      }

  .ticket-grid td.sticky-actions {
      position: sticky;
      right: 0;
      z-index: 10;
      min-width: 120px;
      box-shadow: -2px 0 6px -2px rgba(37,117,252,0.08);
      border-left: 2px solid #e0e7ff;
      padding: 8px 10px;
      text-align: center;
      background: #fff;
  }

  .ticket-grid tr:nth-child(even) td.sticky-actions {
      background: #f7faff;
  }

th.sticky-actions > :last-child,
td.sticky-actions > :last-child {
  position: static !important;
  right: auto !important;
}

.ticket-grid td {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.97em;
  color: #333;
  background-color: #ffffff;
  white-space: nowrap;
}

  .ticket-grid td.ticket-id, .ticket-grid td.ticket-asignado {
      white-space: pre-line;
      word-break: break-all;
      max-width: 180px;
  }

.ticket-grid thead {
  border-top: 4px solid #2575fc;
}

.ticket-grid tr {
  cursor: default;
}

.ticket-grid .status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6a11cb;
  box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
  vertical-align: middle;
  margin-right: 8px;
}

.ticket-grid .actions {
  white-space: nowrap;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.btn-action {
  box-shadow: 0 2px 8px #2575fc18;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.15s;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
}

  .btn-action svg {
      vertical-align: middle;
      fill: currentColor;
      width: 60%;
      height: 60%;
  }

.btn-edit {
  background-color: rgba(37, 117, 252, 0.1);
  border: 1px solid rgba(37, 117, 252, 0.3);
  color: #2575fc;
}

  .btn-edit:hover {
      background-color: #2575fc;
      color: #fff;
  }

.btn-delete {
  background-color: rgba(255, 77, 79, 0.1);
  border: 1px solid rgba(255, 77, 79, 0.3);
  color: #ff4d4f;
}

  .btn-delete:hover {
      background-color: #ff4d4f;
      color: #fff;
  }

.btn-assign {
  background-color: rgba(40, 167, 69, 0.15);
  border: 1px solid rgba(40, 167, 69, 0.3);
  color: #28a745;
}

  .btn-assign:hover {
      background-color: #28a745;
      color: white;
  }

.btn-sign {
  background-color: rgba(162, 89, 230, 0.08);
  border: 1px solid #a259e6;
  color: #a259e6;
}

  .btn-sign:hover {
      background-color: #a259e6;
      color: #fff;
  }

.btn-pdf {
  background-color: rgba(255, 140, 0, 0.1);
  border: 1px solid rgba(255, 140, 0, 0.3);
  color: #ff8c00;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.08);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.15s;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

  .btn-pdf:hover {
      background-color: #ff8c00;
      color: #fff;
      transform: scale(1.05);
  }

  .btn-pdf svg {
      vertical-align: middle;
      fill: currentColor;
      width: 60%;
      height: 60%;
  }

@media (max-width: 900px) {
  .ticket-grid {
      min-width: 1200px;
  }

      .ticket-grid th, .ticket-grid td {
          font-size: 0.92em;
          padding: 6px 6px;
      }
}

/* --- Modal de edición: look "wow" azul, inspirado en el de asignación --- */
.ticket-modal-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: rgba(255,255,255,0.92);
    border-radius: 20px;
    box-shadow: 0 16px 48px 0 rgba(37,117,252,0.18), 0 2px 16px 0 rgba(106,17,203,0.10);
    padding: 44px 56px 36px 56px;
    min-width: 340px;
    max-width: 540px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    position: relative;
    border: 1.5px solid #e0e7ff;
    backdrop-filter: blur(8px);
    animation: fadeInModal 0.25s;
    box-sizing: border-box;
}
.ticket-modal-form::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: 0 0 0 2px #e0e7ff inset;
    pointer-events: none;
    opacity: 0.5;
}
@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
.ticket-modal-form h3 {
    color: #2575fc;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 900;
    font-size: 2em;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 18px;
    background: linear-gradient(90deg, #2575fc 0%, #00d2ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.ticket-modal-form h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #00d2ff 0%, #2575fc 100%);
    border-radius: 3px;
}
.ticket-id-display {
    text-align: center;
    margin: -10px 0 18px 0;
    color: #2575fc;
    font-size: 1.12em;
    font-weight: 700;
    background: #f7faff;
    padding: 10px 0;
    border-radius: 8px;
    border-left: 5px solid #2575fc;
    box-shadow: 0 1px 8px #e0e7ff33;
    letter-spacing: 0.2px;
}
.ticket-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 28px;
}
.form-section-title {
    margin: 12px 0 -5px 0;
    font-weight: 800;
    color: #2575fc;
    font-size: 1.13em;
    padding-bottom: 7px;
    border-bottom: 2px dashed #b7d2ff;
    letter-spacing: 0.2px;
    background: #f7faff;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 1px 4px #e0e7ff22;
}
.form-section-title span {
    display: inline-block;
    padding-right: 10px;
    background: #f7faff;
}
.ticket-modal-form label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: #195bbf;
    font-size: 1em;
    margin-bottom: 2px;
    letter-spacing: 0.1px;
}
.ticket-modal-form input[type="text"],
.ticket-modal-form input[type="datetime-local"],
.ticket-modal-form select,
.ticket-modal-form textarea {
    margin-top: 7px;
    padding: 13px 16px;
    border: 1.7px solid #b7d2ff;
    border-radius: 9px;
    font-size: 1.04em;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
    background: #f7faff;
    width: 100%;
    box-sizing: border-box;
    color: #222;
    box-shadow: 0 1px 6px #e0e7ff22;
}
.ticket-modal-form textarea {
    resize: vertical;
    min-height: 60px;
}
.ticket-modal-form input[type="text"]:focus,
.ticket-modal-form input[type="datetime-local"]:focus,
.ticket-modal-form select:focus,
.ticket-modal-form textarea:focus {
    border: 2px solid #2575fc;
    box-shadow: 0 0 0 3px #b7d2ff;
    background: #fff;
}
.ticket-modal-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
.assign-input-container {
    display: flex;
    gap: 10px;
}
.assign-input-container input {
    flex-grow: 1;
    cursor: pointer;
}
.assign-btn {
    background: linear-gradient(135deg, #2575fc 0%, #00d2ff 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37,117,252,0.13);
}
.assign-btn:hover {
    background: linear-gradient(135deg, #195bbf 0%, #2575fc 100%);
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 12px rgba(37,117,252,0.18);
}
.ticket-form-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
}
.ticket-form-actions button {
    min-width: 180px;
    padding: 15px 28px;
    font-size: 1.08em;
    font-weight: 800;
    text-align: center;
    border-radius: 9px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 2px 12px #2575fc18;
}
.btn-save {
    background: linear-gradient(135deg, #2575fc 0%, #00d2ff 100%);
    color: #fff;
    border: none;
}
.btn-save:hover {
    background: linear-gradient(135deg, #195bbf 0%, #2575fc 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px #2575fc33;
}
.btn-cancel {
    background: #fff;
    color: #2575fc;
    border: 2px solid #2575fc;
}
.btn-cancel:hover {
    background: #f7faff;
    color: #195bbf;
    border-color: #195bbf;
}
.btn-icon {
    font-weight: bold;
    font-size: 1.15em;
}
.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 2em;
    color: #718096;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.modal-close-btn:hover {
    color: #e53e3e;
    background: #fff5f5;
    transform: rotate(90deg);
}
@media (max-width: 900px) {
    .ticket-modal-form {
        max-width: 98vw;
        padding: 24px 4vw 18px 4vw;
    }
}
@media (max-width: 768px) {
    .ticket-modal-form {
        padding: 10px 4vw;
        max-width: 99vw;
        width: 99vw;
        font-size: 0.97em;
    }
    .ticket-modal-form h3 {
        font-size: 1.15em;
        padding-bottom: 10px;
    }
    .ticket-form-grid {
        grid-template-columns: 1fr;
        gap: 12px 0;
    }
    .ticket-form-actions {
        flex-direction: column;
        gap: 12px;
    }
    .ticket-form-actions button {
        width: 100%;
        font-size: 1em;
        padding: 13px 0;
    }
    .assign-input-container {
        flex-direction: column;
        gap: 8px;
    }
    .assign-btn {
        width: 100%;
        padding: 11px 0;
        font-size: 1em;
    }
}
@media (max-width: 480px) {
    .ticket-modal-form {
        padding: 4vw 2vw;
        max-width: 100vw;
        width: 100vw;
        font-size: 0.95em;
    }
    .ticket-modal-form h3 {
        font-size: 1em;
    }
    .ticket-form-actions button {
        font-size: 0.95em;
        padding: 10px 0;
    }
}

/* Mejoras a las tarjetas móviles */
.ticket-card {
  position: relative;
  overflow: hidden;
  border: 1.5px solid #e0e7ff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(106, 17, 203, 0.13);
  margin-bottom: 22px;
  background: #fff;
  transition: box-shadow 0.2s;
}

.ticket-card-header {
  background: #f7faff;
  color: #333;
  padding: 12px 12px 8px 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px solid #e0e7ff;
  position: relative;
  min-height: 44px;
  gap: 8px;
}

.ticket-card-title {
  font-size: 1em;
  font-weight: 700;
  color: #2575fc;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-card-id {
  font-family: monospace;
  font-size: 0.98em;
  color: #444;
  background: #f0f4ff;
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 2px;
  border: 1px solid #e0e7ff;
}

.ticket-card-date {
  font-size: 0.97em;
  color: #888;
  font-weight: 500;
  text-align: right;
  min-width: 110px;
  white-space: nowrap;
}

.ticket-card-section {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f4ff;
}

  .ticket-card-section:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
  }

.ticket-card-status {
  display: none;
}

  .ticket-card-status.unassigned {
      background: #bbb;
      box-shadow: 0 0 0 2px #eee;
  }

  .ticket-card-status.pendiente {
      background: #ff4d4f;
      box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.18);
  }

  .ticket-card-status.completado {
      background: #28a745;
      box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.18);
  }

  .ticket-card-status .estado-icon {
      font-size: 1.1em;
      margin: 0 auto;
  }

.ticket-card-estado {
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.98em;
  display: inline-block;
  margin-left: 4px;
  border: none;
  background: #e6f9ed;
  color: #28a745;
}

  .ticket-card-estado.completado {
      background: #e6f9ed;
      color: #28a745;
      border: none;
  }

  .ticket-card-estado.pendiente {
      background: #fff0f0;
      color: #ff4d4f;
  }

.ticket-card-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  background: #f7faff;
  border-top: 1px solid #e0e7ff;
}

.ticket-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 12px 12px 8px 12px;
  background: #f7faff;
  border-top: 1px solid #e0e7ff;
}

.ticket-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
  opacity: 0;
  background: #f7faff;
  border-radius: 8px;
  margin-top: -8px;
  box-shadow: 0 1px 6px #e0e7ff44;
  padding: 0 8px;
  border: 1px solid #e0e7ff;
  margin-bottom: 8px;
  font-size: 0.97em;
  overflow-x: auto;
}

  .ticket-card-details.expanded {
      max-height: 600px;
      opacity: 1;
      padding: 12px 8px 12px 8px;
      margin-bottom: 8px;
  }

.toggle-details-btn {
  background: transparent;
  border: none;
  color: #2575fc;
  font-weight: 600;
  font-size: 0.97em;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 0;
  outline: none;
  transition: color 0.2s;
  margin-left: 2px;
}

  .toggle-details-btn svg {
      transition: transform 0.3s;
  }

  .toggle-details-btn.expanded svg {
      transform: rotate(180deg);
  }

.detail-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 0.97em;
  align-items: flex-start;
}

.detail-label {
  font-weight: 700;
  color: #6a11cb;
  min-width: 120px;
  flex-shrink: 0;
}

.detail-value {
  flex: 1;
  word-break: break-word;
  color: #333;
}

  .detail-value.na {
      color: #bbb;
      font-style: italic;
  }

@media (max-width: 480px) {
  .ticket-card-header, .ticket-card-body, .ticket-card-actions {
      padding-left: 4vw;
      padding-right: 4vw;
  }

  .ticket-card-label {
      min-width: 80px;
  }
}

.ticket-card-section-principal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px #e0e7ff33;
  padding: 14px 14px 10px 14px;
  margin-bottom: 12px;
  border-left: 4px solid #2575fc;
}

.ticket-card-row {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
}

.ticket-card-label {
  font-weight: 700;
  color: #6a11cb;
  min-width: 90px;
  font-size: 1em;
  margin-right: 8px;
  flex-shrink: 0;
}

.ticket-card-value {
  flex: 1;
  word-break: break-word;
  color: #333;
  font-size: 1em;
}
/* ----- Mejoras específicas para tarjetas móviles ----- */
.ticket-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(106, 17, 203, 0.08);
  margin-bottom: 20px;
  border: 1px solid #e0e7ff;
  transition: transform 0.2s, box-shadow 0.2s;
}

  .ticket-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(106, 17, 203, 0.12);
  }

.ticket-card-header {
  padding: 16px;
  border-bottom: 1px solid #f0f4ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7faff;
  border-radius: 12px 12px 0 0;
}

.ticket-card-id {
  font-family: monospace;
  font-weight: 600;
  color: #2575fc;
  font-size: 1.1em;
}

.ticket-card-date {
  color: #666;
  font-size: 0.9em;
  font-weight: 500;
}

.ticket-card-body {
  padding: 16px;
}

.ticket-card-section {
  margin-bottom: 16px;
}

.ticket-card-section-principal {
  background: #f7faff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border-left: 3px solid #6a11cb;
}

.ticket-card-row {
  display: flex;
  margin-bottom: 10px;
  align-items: flex-start;
}

.ticket-card-label {
  font-weight: 600;
  color: #6a11cb;
  min-width: 100px;
  font-size: 0.95em;
}

.ticket-card-value {
  flex: 1;
  color: #333;
  font-size: 0.95em;
  word-break: break-word;
}

.ticket-card-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: 600;
  margin-left: 8px;
}

.status-completado {
  background: #e6f9ed;
  color: #28a745;
}

.status-pendiente {
  background: #fff0f0;
  color: #ff4d4f;
}

.status-sin-asignar {
  background: #f0f0f0;
  color: #666;
}

.ticket-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #f0f4ff;
  background: #f7faff;
  border-radius: 0 0 12px 12px;
}

.toggle-details-btn {
  background: none;
  border: none;
  color: #2575fc;
  font-weight: 600;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 0;
  margin: 8px 0;
}

.ticket-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #f7faff;
  border-radius: 8px;
}

  .ticket-card-details.expanded {
      max-height: 1000px;
      padding: 12px;
      margin-top: 8px;
  }

.detail-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.detail-label {
  font-weight: 600;
  color: #6a11cb;
  min-width: 120px;
}

.detail-value {
  flex: 1;
  color: #333;
}

.na {
  color: #999;
  font-style: italic;
}

.btn-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  margin: 0;
  border: none;
  background: #f0f4ff;
}

  .btn-action svg {
      width: 60%;
      height: 60%;
      max-width: 20px;
      max-height: 20px;
      transition: transform 0.2s;
      display: block;
  }

  .btn-action:hover svg {
      transform: scale(1.1);
  }

@media (max-width: 768px) {
  .btn-action {
      width: 44px;
      height: 44px;
  }

      .btn-action svg {
          max-width: 24px;
          max-height: 24px;
      }
}

.btn-edit {
  background: rgba(37, 117, 252, 0.1);
  color: #2575fc;
  border: 1px solid rgba(37, 117, 252, 0.3);
}

  .btn-edit:hover {
      background: #2575fc;
      color: white;
  }

.btn-delete {
  background: rgba(255, 77, 79, 0.1);
  color: #ff4d4f;
  border: 1px solid rgba(255, 77, 79, 0.3);
}

  .btn-delete:hover {
      background: #ff4d4f;
      color: white;
  }

.btn-assign {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

  .btn-assign:hover {
      background: #28a745;
      color: white;
  }

#firma-modal {
  padding: 0;
}

  #firma-modal > div {
      max-width: 96vw;
      max-height: 90vh;
      width: 96vw;
      box-sizing: border-box;
      padding: 6vw 2vw 4vw 2vw;
  }

  #firma-modal img {
      max-width: 90vw;
      max-height: 40vh;
      width: 100%;
      height: auto;
      display: block;
      margin: 0 auto;
  }

  #firma-modal button {
      width: 100%;
      max-width: 320px;
      font-size: 1.1em;
      margin: 24px auto 0 auto;
      padding: 12px 0;
      border-radius: 8px;
  }

@media (max-width: 600px) {
  #firma-modal > div {
      padding: 4vw 2vw 4vw 2vw;
      max-width: 98vw;
  }

  #firma-modal img {
      max-width: 96vw;
      max-height: 36vh;
  }
}

/* --- Botón PDF (escritorio y móvil, sobrescribe btn-action) --- */
.btn-action.btn-pdf {
  background-color: #fff7ec !important;
  border: 2px solid #ff8c00 !important;
  color: #ff8c00 !important;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.08) !important;
}
.btn-action.btn-pdf:hover {
  background-color: #ff8c00 !important;
  color: #fff !important;
  transform: scale(1.05);
}

/* --- Botón Editar --- */
.btn-action.btn-edit {
  border: 1px solid #2575fc !important;
}

/* --- Botón Asignar --- */
.btn-action.btn-assign {
  border: 1px solid #28a745 !important;
}

/* --- Botón Eliminar --- */
.btn-action.btn-delete {
  border: 1px solid #ff4d4f !important;
}

/* --- Botón Firmar --- */
.btn-action.btn-sign {
  border: 1px solid #a259e6 !important;
}

/* --- Bordes uniformes para todos los botones de acción --- */
.btn-action.btn-edit,
.btn-action.btn-assign,
.btn-action.btn-delete,
.btn-action.btn-sign,
.btn-action.btn-pdf {
  border-width: 2px !important;
}

/* --- Visibilidad de tabla y tarjetas según tamaño de pantalla --- */
@media (max-width: 768px) {
  .ticket-grid {
    display: none !important;
  }
  .ticket-cards {
    display: block !important;
  }
}
@media (min-width: 769px) {
  .ticket-cards {
    display: none !important;
  }
  .ticket-grid {
    display: table !important;
  }
}

/* Escritorio grande */
.ticket-modal-form {
    max-width: 540px;
    padding-left: 56px;
    padding-right: 56px;
}
@media (max-width: 900px) {
    .ticket-modal-form {
        max-width: 98vw;
        padding-left: 4vw;
        padding-right: 4vw;
    }
}
@media (max-width: 768px) {
    .ticket-modal-form {
        max-width: 99vw;
        width: 99vw;
        padding-left: 2vw;
        padding-right: 2vw;
    }
}
@media (max-width: 480px) {
    .ticket-modal-form {
        max-width: 100vw;
        width: 100vw;
        padding-left: 1vw;
        padding-right: 1vw;
    }
}

/* --- MODAL DE EDICIÓN DE TICKETS (mejorado, antes en el HTML) --- */
.ticket-modal-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37,117,252,0.18), 0 4px 16px rgba(106,17,203,0.10);
    padding: 32px;
    min-width: 340px;
    max-width: 800px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    border: 1px solid #e0e7ff;
    animation: fadeInEditModal 0.2s ease-out;
}
@keyframes fadeInEditModal {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.ticket-modal-form h3 {
    color: #2575fc;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1.8em;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 12px;
}
.ticket-modal-form h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2575fc 0%, #6a11cb 100%);
    border-radius: 3px;
}
.ticket-id-display {
    text-align: center;
    margin: -10px 0 20px 0;
    color: #6a11cb;
    font-size: 1.1em;
    font-weight: 600;
    background: #f7faff;
    padding: 8px;
    border-radius: 6px;
    border-left: 4px solid #2575fc;
}
.ticket-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}
.ticket-modal-form label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: #6a11cb;
    font-size: 0.95em;
    margin-bottom: 2px;
}
.ticket-modal-form input[type="text"],
.ticket-modal-form input[type="datetime-local"],
.ticket-modal-form select,
.ticket-modal-form textarea {
    margin-top: 6px;
    padding: 10px 14px;
    border: 1.5px solid #b7d2ff;
    border-radius: 8px;
    font-size: 0.95em;
    outline: none;
    transition: all 0.3s ease;
    background: #f7faff;
    width: 100%;
    box-sizing: border-box;
}
.ticket-modal-form textarea {
    resize: vertical;
    min-height: 60px;
}
.ticket-modal-form input[type="text"]:focus,
.ticket-modal-form input[type="datetime-local"]:focus,
.ticket-modal-form select:focus,
.ticket-modal-form textarea:focus {
    border: 1.5px solid #6a11cb;
    box-shadow: 0 0 0 3px rgba(106,17,203,0.1);
    background: #fff;
}
.ticket-modal-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
.assign-input-container {
    display: flex;
    gap: 8px;
}
.assign-input-container input {
    flex-grow: 1;
    cursor: pointer;
}
.assign-btn {
    background: #2575fc;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 16px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.assign-btn:hover {
    background: #195bbf;
    transform: translateY(-1px);
}
.ticket-form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.ticket-form-actions button {
    min-width: 160px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.btn-save {
    background: #2575fc;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(37,117,252,0.2);
}
.btn-save:hover {
    background: #195bbf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,117,252,0.3);
}
.btn-cancel {
    background: #fff;
    color: #2575fc;
    border: 2px solid #2575fc;
}
.btn-cancel:hover {
    background: #f7faff;
    color: #195bbf;
    border-color: #195bbf;
}
.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.8em;
    color: #718096;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.modal-close-btn:hover {
    color: #e53e3e;
    background: #fff5f5;
    transform: rotate(90deg);
}
@media (max-width: 768px) {
    .ticket-modal-form {
        padding: 24px 16px;
        width: 95vw;
    }
    .ticket-form-grid {
        grid-template-columns: 1fr;
    }
    .ticket-form-grid > div[style*="grid-column"] {
        grid-column: 1/2 !important;
    }
    .ticket-form-actions {
        flex-direction: column;
        gap: 12px;
    }
    .ticket-form-actions button {
        width: 100%;
    }
    .assign-input-container {
        flex-direction: column;
    }
    .assign-btn {
        width: 100%;
        padding: 8px;
    }
    .ticket-modal-form h3 {
        font-size: 1.5em;
    }
}
@media (max-width: 480px) {
    .ticket-modal-form {
        padding: 20px 12px;
        width: 98vw;
    }
    .ticket-modal-form h3 {
        font-size: 1.3em;
    }
    .ticket-id-display {
        font-size: 1em;
    }
}