@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
body { font-family: 'Inter', sans-serif; }
.required::after { content: ' *'; color: #ef4444; font-weight: 700; margin-left: 2px; }
.step-content { display: none; }
.step-content:not(.hidden) { display: block; }
/* small helpers */
.table-radio-row:hover { background-color: #f8fafc; cursor: pointer; }
.selected-row { background-color: #e6f0ff; border-left: 4px solid #3b82f6; }
/* Centrar el contenido vertical y horizontal */
body, html {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Evitar que el paso 4 se salga de pantalla */
#app {
  max-height: 100vh;
  overflow: hidden;
}

#app.app-control-mode {
  max-width: min(1400px, 96vw) !important;
  width: min(1400px, 96vw) !important;
  max-height: none !important;
  overflow: visible !important;
}

body.control-screen-active {
  align-items: flex-start !important;
  justify-content: center !important;
}

/* Paso 4: contenedor scrollable dentro del app */
#step4-new-product {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

/* Paso 2: asegurar alineación y tamaños consistentes en selects */
#step2-identification .form-control,
#step2-identification select,
#step2-identification .btn,
#step2-identification .row .col select {
  width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}

#step2-identification .row.g-2 > .col {
  min-width: 0;
}

#step2-identification .form-label,
#step2-identification label {
  margin-bottom: 0.25rem;
  display: block;
}

#step2-identification .btn.border {
  min-height: 44px;
}

/* Tablas: evitar saltos y deformaciones a muy bajo ancho */
#step3-lookup-results .table {
  width: 100%;
  table-layout: fixed;
  word-wrap: break-word;
}

#step3-lookup-results .table td,
#step3-lookup-results .table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Botón rojo oscuro personalizado */
.btn-rojo {
  background-color: #7b1c1c !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-rojo:hover, .btn-rojo:focus {
  background-color: #5a1414 !important;
  color: #fff !important;
}

/* Botón "Atrás" estilo neutro */
#backToStartBtn, #backToIdentificationBtn {
  background-color: #fff !important;
  color: #7b1c1c !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  font-weight: 500;
  transition: background 0.2s;
}

#backToStartBtn:hover, #backToIdentificationBtn:hover {
  background-color: #f3f3f3 !important;
  color: #7b1c1c !important;
}

.star-rating {
  display: inline-flex;
  gap: 0.2rem;
}

.star-btn {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #c5c5c5;
  cursor: pointer;
  padding: 0;
}

.star-btn.active {
  color: #f5b301;
}

.star-btn:focus {
  outline: 2px solid #7b1c1c;
  outline-offset: 2px;
  border-radius: 4px;
}

#control-app {
  position: relative;
  width: 100%;
}

.control-readonly-section {
  background-color: #fafafa;
}

.control-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-filter-level-title {
  font-size: 0.75rem;
  font-weight: bold;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.control-table-header {
  font-size: 0.75rem;
  font-weight: bold;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: #f8f9fa;
  white-space: nowrap;
}

.control-detail-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6c757d;
  text-transform: uppercase;
}

.control-detail-value {
  font-size: 0.9rem;
  color: #212529;
  margin-top: 0.25rem;
}

.control-link {
  color: #7b1c1c !important;
}

.control-link:hover {
  color: #5a1414 !important;
}

.control-spinner {
  color: #7b1c1c !important;
}

.control-loading-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.75);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}


.control-table-scroll {
  max-height: min(56vh, 520px);
  overflow: auto;
}

.control-table-scroll .control-table-header {
  position: sticky;
  top: 0;
  z-index: 1;
}

.control-badge-disponible {
  background-color: #d1e7dd;
  color: #0f5132;
}

.control-badge-revision {
  background-color: #fff3cd;
  color: #664d03;
}

.control-badge-vendido {
  background-color: #f8d7da;
  color: #842029;
}

#control-app .page-link {
  color: #7b1c1c;
}

#control-app .page-link:hover {
  color: #5a1414;
}

#control-app .page-item.disabled .page-link {
  color: #6c757d;
}

@media (max-width: 576px) {
  #app.app-control-mode {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0.75rem !important;
  }

  body.control-screen-active {
    padding: 0.5rem !important;
  }
}

/* --- Login y barra de sesión (JWT) --- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 1.75rem;
}

.auth-bar {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.auth-bar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.auth-bar-title {
  font-weight: 700;
  color: #1f2937;
}

.auth-bar-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-bar-link {
  color: #7b1c1c;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-bar-link:hover {
  text-decoration: underline;
}

.auth-bar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-bar-name {
  font-size: 0.9rem;
  color: #4b5563;
}

.app-page-body {
  width: 100%;
}

/* Select con barra de búsqueda (paso 2) */
.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.searchable-select-control {
  position: relative;
  display: flex;
  align-items: stretch;
}

.searchable-select-input {
  width: 100%;
  min-height: 44px;
  padding-right: 2.5rem !important;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

.searchable-select-input:focus {
  border-color: #7b1c1c;
  box-shadow: 0 0 0 0.2rem rgba(123, 28, 28, 0.15);
  outline: none;
}

.searchable-select-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2.5rem;
  border: 0;
  background: transparent;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.searchable-select-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.searchable-select-dropdown {
  position: fixed;
  z-index: 1050;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.searchable-select-dropdown li {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: #1f2937;
}

.searchable-select-dropdown li:hover,
.searchable-select-dropdown li.is-active {
  background-color: #f3f4f6;
}

.searchable-select-dropdown li.is-selected {
  background-color: #fde8e8;
  color: #7b1c1c;
  font-weight: 500;
}

.searchable-select-empty {
  color: #6b7280;
  cursor: default !important;
  font-style: italic;
}

.searchable-select.is-disabled .searchable-select-input {
  background-color: #f3f4f6;
  cursor: not-allowed;
}
