/* Styles for Tramite Panel Layout */
.gsl-tramite-panel-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin: 32px 0;
}
.gsl-tramite-sidebar {
  min-width: 320px;
  max-width: 380px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 1rem;
}

.gsl-tramite-field {
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e6ea;
}
.gsl-tramite-hitos {
  margin-top: 18px;
}
.gsl-tramite-hitos h4 {
  margin-bottom: 8px;
  font-size: 1.1em;
  color: #3a4a5a;
}
.gsl-tramite-hitos ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.gsl-tramite-hitos li {
  margin-bottom: 8px;
}
.gsl-hito-link {
  color: #0073aa;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}
.gsl-hito-link:hover {
  color: #005177;
  text-decoration: underline;
}
.gsl-tramite-main {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 32px 24px;
  min-height: 320px;
}
.gsl-hito-field-row {
  margin-bottom: 18px;
}
.gsl-hito-field-row label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}
.gsl-hito-fields-save {
  align-self: flex-end;
  background: #0073aa;
  border: 1.5px solid #0073aa;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.12s ease, background 0.12s ease;
  margin-top: 6px;
}
.gsl-hito-fields-save:hover {
  background: #fff;
  color: #0073aa;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 115, 170, 0.12);
}
.gsl-hito-loading,
.gsl-hito-success,
.gsl-hito-error {
  font-size: 1.1em;
  margin-bottom: 18px;
}
.gsl-hito-success {
  color: #2e7d32;
}
.gsl-hito-error {
  color: #c62828;
}
/* Hitos*/
.gsl-hito-builder-ui {
  background: #f8fafc;
  border-radius: 8px;
  padding: 18px 16px 12px 16px;
  border: 1px solid #e3e7ee;
}
.gsl-hito-builder-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.gsl-hito-fields-list {
  min-height: 60px;
  list-style: none;
  padding: 0;
  border: 1px solid #e3e7ee;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-bottom: 12px;
}
.gsl-field-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f2f7;
  cursor: grab;
  transition: background 0.18s;
  font-size: 15px;
  border-radius: 5px;
}
.gsl-field-item:last-child {
  border-bottom: none;
}
.gsl-field-item:hover {
  background: #e7f7ff;
}
.gsl-field-handle {
  font-size: 18px;
  margin-right: 10px;
  color: #888;
  cursor: grab;
}
.gsl-field-summary {
  flex: 1;
  font-size: 15px;
  color: #333;
}
.gsl-field-actions {
  white-space: nowrap;
}
.gsl-field-actions .button {
  margin-left: 6px;
}
.gsl-field-actions .gsl-remove-field {
  color: #a00;
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
}
.gsl-field-placeholder {
  background: #dbeafe !important;
  height: 38px;
  border-radius: 4px;
}
.gsl-field-editor {
  border: 1px solid #e3e7ee;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
#gsl-clear-fields {
  margin-left: 16px;
}

/* Tipo de trámite */
.gsl-metabox-ui {
  background: #f8fafc;
  border-radius: 8px;
  padding: 18px 16px 12px 16px;
  border: 1px solid #e3e7ee;
}
.gsl-metabox-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.gsl-search-input {
  width: 100%;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 5px;
  border: 1px solid #d0d7e1;
}
.gsl-hitos-columns {
  display: flex;
  gap: 32px;
}
.gsl-hitos-list-col,
.gsl-hitos-flow-col {
  flex: 1;
}
.gsl-hitos-list,
.gsl-hitos-flow {
  min-height: 120px;
  list-style: none;
  padding: 0;
  border: 1px solid #e3e7ee;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.gsl-hitos-list-col h4,
.gsl-hitos-flow-col h4 {
  margin-top: 0;
  font-weight: 600;
}
.gsl-hito-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f2f7;
  cursor: grab;
  transition: background 0.18s;
  font-size: 15px;
}
.gsl-hito-item:last-child {
  border-bottom: none;
}
.gsl-hito-item:hover {
  background: #e7f7ff;
}
.gsl-hito-icon {
  font-size: 18px;
  margin-right: 8px;
}
.gsl-remove-hito {
  margin-left: auto;
  color: #a00;
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
}
.gsl-hitos-flow .gsl-hito-item {
  background: #f0f8ff;
}
.gsl-hito-placeholder {
  background: #dbeafe !important;
  height: 38px;
  border-radius: 4px;
}
#gsl-clear-flow {
  margin-left: 16px;
}
/* =========================
   Panel de Usuario
   ========================= */
.gsl-panel-usuario {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 24px;
  max-width: 80%;
  margin: 40px auto;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
}

.gsl-panel-usuario h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #0073aa;
  border-left: 4px solid #0073aa;
  padding-left: 10px;
}

.gsl-tramites-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.gsl-tramites-sheet thead th {
  text-align: left;
  background: #f8f9fb;
  color: #444;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid #e0e3e7;
}

.gsl-tramites-sheet tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #e8eaed;
  color: #333;
  font-size: 0.95rem;
}

.gsl-tramites-sheet tbody tr:hover {
  background-color: #f3f7ff;
  transition: background 0.2s ease;
}

.gsl-tramite-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0073aa;
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.25s ease;
}

.gsl-tramite-arrow:hover {
  color: #fff;
  transform: translateX(3px);
}

/* =========================
   Panel Trámite (layout)
   ========================= */
.gsl-tramite-panel-layout {
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 24px;
  max-width: 85%;
  margin: auto;
}

/* --- Sidebar --- */
.gsl-tramite-sidebar {
  background: #f8f9fb;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e3e7eb;
}

.gsl-tramite-sidebar h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #0073aa;
  border-left: 4px solid #0073aa;
  padding-left: 10px;
}

.gsl-tramite-field {
  font-size: 0.95rem;
  margin-bottom: 15px;
  color: #333;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e6e8eb;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gsl-tramite-field strong {
  display: block;
  color: #222;
  margin-bottom: 4px;
}

.gsl-tramite-cliente-id,
.gsl-tramite-producto-id,
.gsl-tramite-certificadora-id,
.gsl-tramite-laboratorio-id {
  color: #777;
  font-size: 0.85em;
}

.gsl-tramite-field ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.gsl-tramite-field li {
  margin-bottom: 6px;
  padding-left: 12px;
  position: relative;
}

.gsl-tramite-field li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #0073aa;
  font-weight: bold;
}

/* --- Hitos Selection --- */
.gsl-tramite-hitos {
  margin-top: 20px;
}

.gsl-tramite-hitos h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 10px;
}

.gsl-tramite-hitos ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gsl-hito-link {
  display: block;
  padding: 8px 12px;
  background: #eef5fb;
  border: 1px solid #d0e3f0;
  border-radius: 8px;
  text-decoration: none;
  color: #005f8d;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.gsl-hito-link:hover {
  background: #0073aa;
  color: #fff;
  transform: translateX(3px);
}

.gsl-hito-id {
  color: #999;
  font-size: 0.85em;
  margin-left: 4px;
}

/* --- Main panel --- */
.gsl-tramite-main {
  position: sticky;
  top: 50px;
  background: #fdfdfd;
  border: 1px solid #e3e7eb;
  border-radius: 10px;
  padding: 20px 10%;
  font-size: 0.95rem;
  color: #444;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
}

/* =========================
   Form — campos e inputs
   ========================= */

/* --- Field rows / labels --- */
.gsl-hito-field-row {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 18px;
}

.gsl-hito-field-row label {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

/* --- Inputs (text, email, number, date, phone, file, select, textarea) --- */
.gsl-hito-field-row input[type="text"],
.gsl-hito-field-row input[type="email"],
.gsl-hito-field-row input[type="number"],
.gsl-hito-field-row input[type="date"],
.gsl-hito-field-row input[type="phone"],
.gsl-hito-field-row input[type="file"],
.gsl-hito-field-row select,
.gsl-hito-field-row textarea {
  background: #f9fafb;
  border: 1px solid #d4d7db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease;
  color: #333;
}

/* Focus states */
.gsl-hito-field-row input[type="text"]:focus,
.gsl-hito-field-row input[type="file"]:focus {
  outline: none;
  border-color: #0073aa;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* --- Custom file input --- */
.gsl-hito-field-row input[type="file"] {
  padding: 8px;
  cursor: pointer;
}

.gsl-hito-field-row input[type="file"]::-webkit-file-upload-button {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gsl-hito-field-row input[type="file"]::-webkit-file-upload-button:hover {
  background: #005f8d;
}

/* --- Textarea specific --- */
.gsl-hito-field-row textarea {
  resize: vertical;
  min-height: 100px;
}

/* --- Checkbox & radio --- */
.gsl-hito-field-row input[type="checkbox"],
.gsl-hito-field-row input[type="radio"] {
  width: auto;
  accent-color: #0073aa;
  transform: scale(1.2);
  cursor: pointer;
}

/* =========================
   Tramite edit — controls & lists
   ========================= */

/* Edit button */
.gsl-tramite-editar-btn {
  background: #0073aa;
  color: #ffffff;
  border: 1.5px solid #0073aa;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
}

.gsl-tramite-editar-btn:hover {
  background: #fff;
  color: #0073aa;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 115, 170, 0.12);
}

.gsl-tramite-editar-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Row wrapper */
.gsl-tramite-edit-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

/* Labels inside edit rows */
.gsl-tramite-edit-row > label,
.gsl-tramite-edit-row label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
}

/* Selects */
.gsl-tramite-edit-row select,
.gsl-tramite-tramite-select,
.gsl-tramite-select-cliente,
.gsl-tramite-select-certificadora,
.gsl-tramite-select-laboratorio {
  appearance: none;
  -webkit-appearance: none;
  background: #fafbfd;
  border: 1px solid #d6d9dd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

/* Add a small chevron using background */
.gsl-tramite-edit-row select {
  background-image: linear-gradient(45deg, transparent 50%, #7b8a93 50%),
    linear-gradient(135deg, #7b8a93 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px),
    calc(100% - 13px) calc(1em + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

/* Focus for selects / search */
.gsl-tramite-edit-row select:focus,
.gsl-tramite-edit-row input[type="text"]:focus,
.gsl-tramite-edit-row .gsl-tramite-producto-search:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.08);
  background: #fff;
}

/* Product search input */
.gsl-tramite-producto-search {
  border: 1px solid #d6d9dd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
  transition: box-shadow 0.15s ease;
}

/* Product list container */
.gsl-tramite-productos-list {
  border-radius: 8px;
  border: 1px solid #e2e5e8;
  background: #fbfcfd;
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 6px;
}

/* Product list item (merged & ordered) */
.gsl-tramite-producto-list-item {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px;
  border-radius: 8px;
  font-size: 0.9rem;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6),
    rgba(250, 252, 253, 0.6)
  );
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.12s ease,
    border-color 0.12s ease;
}

.gsl-tramite-producto-list-item:hover {
  background: #eef7ff;
  transform: translateX(4px);
  border-color: #d7eefc;
}

/* Product ID style */
.gsl-tramite-producto-id {
  color: #7d8a93;
  font-size: 0.85rem;
  margin-left: 8px;
}

/* Add button (+) */
.gsl-agregar-producto {
  appearance: none;
  border: none;
  background: #0073aa;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.gsl-agregar-producto:hover {
  background: #005f8d;
  transform: translateY(-2px);
}

/* Selected products area */
.gsl-tramite-productos-seleccionados {
  text-align: left;
  border-radius: 8px;
  border: 1px solid #e3e7eb;
  padding: 10px !important;
  background: #fff;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
}

/* Individual selected product item */
.gsl-tramite-producto-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px;
  background: #fbfbfc;
  border-radius: 8px;
  border: 1px solid #f0f2f4;
  font-size: 0.9rem;
}

.gsl-tramite-producto-item .gsl-tramite-producto-id {
  color: #888;
  font-size: 0.85rem;
  margin-left: 8px;
}

/* Remove button (-) */
.gsl-remove-producto {
  border: none;
  background: #ff5757;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
  transition: background 0.12s ease, transform 0.12s ease;
}

.gsl-remove-producto:hover {
  background: #cc4545;
  transform: translateY(-2px);
}

/* Save button */
.gsl-tramite-edit-save {
  align-self: flex-end;
  background: #0073aa;
  border: 1.5px solid #0073aa;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.12s ease, background 0.12s ease;
  margin-top: 6px;
}

.gsl-tramite-edit-save:hover {
  background: #fff;
  color: #0073aa;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 115, 170, 0.12);
}

/* Tiny helpers */
.gsl-tramite-producto-list-item button,
.gsl-tramite-producto-item button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Scrollbar (WebKit) */
.gsl-tramite-productos-list::-webkit-scrollbar,
.gsl-tramite-productos-seleccionados::-webkit-scrollbar {
  width: 8px;
}

.gsl-tramite-productos-list::-webkit-scrollbar-thumb,
.gsl-tramite-productos-seleccionados::-webkit-scrollbar-thumb {
  background: #d6d9dd;
  border-radius: 8px;
}
