/* ==========================================================================
   1CLIC - Estilos del Panel de Administración
   Diseño amigable, limpio, pensado para personas sin experiencia técnica
   ========================================================================== */

:root {
  --primary: #25D366;
  --primary-hover: #1eb956;
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --bg-dark: #0b0f19;
  --bg-card: #131b2e;
  --bg-input: #1a2236;
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10B981;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
}

/* Pantalla de Login Simple */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 30%, rgba(79, 70, 229, 0.15), rgba(11, 15, 25, 1));
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 36px 28px;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.login-logo {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

/* Panel Principal de Admin */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 270px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-icon {
  background: var(--primary);
  color: #0b0f19;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  width: 100%;
}

.nav-item:hover, .nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: rgba(37, 211, 102, 0.15);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-view-store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #0b0f19;
  text-decoration: none;
  font-weight: 700;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--danger);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

/* Contenido Principal */
.admin-main {
  flex: 1;
  padding: 30px 24px;
  max-width: 1100px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.btn-primary {
  background: var(--primary);
  color: #0b0f19;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Tarjetas y Formularios */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
}

/* Selector de Paleta de Millones de Colores */
.color-picker-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.input-color-circle {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border: none;
  cursor: pointer;
  background: none;
  border-radius: 50%;
  overflow: hidden;
}

.input-color-circle::-webkit-color-swatch-wrapper {
  padding: 0;
}

.input-color-circle::-webkit-color-swatch {
  border: 2px solid #fff;
  border-radius: 50%;
}

.color-swatches-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.color-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-swatch-btn:hover {
  transform: scale(1.15);
  border-color: #fff;
}

/* Modos de Tienda (Tarjetas de Selección) */
.store-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.store-mode-card {
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-mode-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.store-mode-card.active {
  border-color: var(--primary);
  background: rgba(37, 211, 102, 0.08);
}

.store-mode-card strong {
  color: #fff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-mode-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

/* Zona de Carga Directa de Fotos */
.photo-uploader-box {
  border: 2px dashed rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.04);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.photo-uploader-box:hover, .photo-uploader-box.dragover {
  border-color: var(--primary);
  background: rgba(37, 211, 102, 0.08);
}

.upload-preview-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--primary);
  margin-top: 10px;
}

.upload-preview-wrap.circle {
  border-radius: 50%;
  width: 100px;
  height: 100px;
}

.upload-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tabla de Productos */
.table-responsive {
  overflow-x: auto;
}

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

.admin-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.table-product-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.badge-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-status.active {
  background: rgba(37, 211, 102, 0.15);
  color: var(--primary);
}

.badge-status.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-icon.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Modal Emergente */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.admin-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
