/* ==========================================================================
   COMERCIAL ESTUARDO - PANEL DE ADMINISTRACIÓN (CSS ESTILO VOLVO MINIMALISTA)
   ========================================================================== */

.admin-body {
  background-color: #f4f6f8;
  color: #111827;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* 1. LOGIN SCREEN */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, #ffffff 0%, #eef2f6 100%);
}

.login-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.login-brand {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  height: 52px;
  width: auto;
  margin-bottom: 0.8rem;
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #111827;
}

.login-subtitle {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 2px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.input-group input,
.input-group select,
.input-group textarea {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #111827;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: #111827;
  background: #ffffff;
}

.input-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.login-error {
  display: none;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  text-align: center;
}

.login-error.show {
  display: block;
}

.back-to-site-link {
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
  margin-top: 0.5rem;
}

.back-to-site-link:hover {
  color: #111827;
}

.login-credentials-hint {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.login-credentials-hint code {
  background: #f3f4f6;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  color: #374151;
  font-family: monospace;
}

/* 2. ADMIN TOPBAR */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-topbar-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.admin-logo-img {
  height: 38px;
  width: auto;
}

.admin-logo-text {
  display: flex;
  flex-direction: column;
}

.admin-logo-text .a-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.admin-logo-text .a-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: #009639;
  letter-spacing: 1px;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* 3. ADMIN STATS */
.admin-main-content {
  padding: 2.5rem 1.5rem 4rem;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-card.highlight {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.stat-card.highlight .stat-lbl {
  color: #9ca3af;
}

.stat-card.highlight .stat-val {
  color: #ffffff;
}

.stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #111827;
}

/* 4. ACTION BAR */
.admin-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 0.5rem 1.2rem;
  min-width: 320px;
}

.admin-search-wrap svg {
  color: #9ca3af;
}

.admin-search-wrap input {
  background: transparent;
  font-size: 0.9rem;
  color: #111827;
  width: 100%;
}

.admin-btn-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.text-danger {
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

.text-danger:hover {
  background: #fee2e2 !important;
}

/* 5. ADMIN TABLE */
.admin-table-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  padding: 0.9rem 1.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
  padding: 1rem 1.2rem;
  font-size: 0.88rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f9fafb;
}

.table-moto-thumb {
  width: 75px;
  height: 52px;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.table-moto-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.table-model-name {
  font-weight: 700;
  color: #111827;
  display: block;
}

.table-brand-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 3px;
}

.tag-freedom {
  background: #fee2e2;
  color: #b91c1c;
}

.tag-movesa {
  background: #e0f2fe;
  color: #0369a1;
}

.table-price-input {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #111827;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  width: 120px;
}

.table-price-input:focus {
  border-color: #111827;
  background: #ffffff;
}

.table-downpayment {
  color: #009639;
  font-weight: 700;
}

.table-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.action-icon-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  transition: all 0.15s ease;
  margin-left: 0.3rem;
}

.action-icon-btn:hover {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.action-icon-btn.btn-delete:hover {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
}

/* 6. ADMIN MODAL (AGREGAR / EDITAR) */
.admin-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.admin-modal-wrapper.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
}

.admin-modal-card {
  position: relative;
  z-index: 2001;
  background: #ffffff;
  border-radius: 16px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid #e5e7eb;
}

.admin-modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #111827;
}

.admin-modal-close {
  background: transparent;
  font-size: 1.8rem;
  color: #6b7280;
  line-height: 1;
  cursor: pointer;
}

.admin-modal-close:hover {
  color: #111827;
}

.admin-modal-body {
  padding: 1.8rem;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.8rem;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.image-uploader-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.image-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

/* Lista de Galería en Admin */
.admin-gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.4rem 0.2rem;
}

.admin-gallery-item {
  position: relative;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  aspect-ratio: 16 / 11;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  transition: all 0.15s ease;
}

.admin-gallery-item.is-cover {
  border-color: #009639;
  box-shadow: 0 0 0 2px rgba(0, 150, 57, 0.2);
}

.admin-gallery-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-cover-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: #009639;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 5;
}

.admin-gallery-actions {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 6;
}

.admin-gallery-item:hover .admin-gallery-actions {
  opacity: 1;
}

.gallery-action-btn {
  background: #ffffff;
  color: #111827;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.gallery-action-btn:hover {
  transform: scale(1.06);
}

.gallery-action-btn.delete {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-add-photo-block {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .modal-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-search-wrap {
    min-width: auto;
    width: 100%;
  }

  .admin-btn-group {
    width: 100%;
  }

  .admin-btn-group .btn {
    flex-grow: 1;
  }
}
