/* =====================================================
   TURENA - Estilos del Panel de Administración
   ===================================================== */

:root {
  --admin-sidebar-w:   240px;
  --admin-primary:     #1a3a5c;
  --admin-accent:      #e63946;
  --admin-bg:          #f1f5f9;
  --admin-card-bg:     #fff;
  --admin-topbar-h:    56px;
  --admin-sidebar-bg:  #0f2640;
  --admin-sidebar-txt: rgba(255,255,255,.78);
}

/* ---- Login page ---- */
.admin-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--admin-primary), #2d6a9f);
  display: flex; align-items: center; justify-content: center;
}
.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }
.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-header    { text-align: center; margin-bottom: 1.75rem; }
.login-brand     { font-size: 1.8rem; font-weight: 800; color: var(--admin-primary); margin: 0; }
.login-subtitle  { color: #6c757d; font-size: .9rem; margin: .25rem 0 0; }
.btn-admin-primary {
  background: var(--admin-primary) !important;
  border-color: var(--admin-primary) !important;
  color: #fff !important;
}
.btn-admin-primary:hover {
  background: #122b47 !important;
  border-color: #122b47 !important;
}

/* ---- Admin layout ---- */
.admin-body   { background: var(--admin-bg); margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-main   { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- Sidebar ---- */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width .25s ease;
}
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo-link { text-decoration: none; display: block; }
.sidebar-logo-text { display: block; font-size: 1.2rem; font-weight: 800; color: #fff; }
.sidebar-logo-sub  { display: block; font-size: .72rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .08em; }
.sidebar-nav  { flex: 1; padding: .75rem 0; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-item { margin: 1px 0; }
.sidebar-separator {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: .85rem 1.25rem .35rem;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .52rem 1.25rem;
  color: var(--admin-sidebar-txt);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all .2s;
}
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: var(--admin-primary); color: #fff; }
.sidebar-icon { font-size: 1rem; flex-shrink: 0; }
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .75rem 0;
}

/* ---- Topbar ---- */
.admin-topbar {
  height: var(--admin-topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  flex: 1;
}
.admin-topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.sidebar-toggle { color: #64748b !important; padding: 0 !important; }
.sidebar-toggle:hover { color: var(--admin-primary) !important; }

/* ---- Content area ---- */
.admin-content {
  flex: 1;
  padding: 1.5rem;
}

/* ---- Cards del admin ---- */
.admin-card {
  background: var(--admin-card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.admin-card-header {
  padding: .875rem 1.25rem;
  font-weight: 600;
  font-size: .9rem;
  border-bottom: 1px solid #e2e8f0;
  color: #374151;
  background: #f8fafc;
}
.admin-card-body { padding: 1.25rem; }

/* ---- Stat cards ---- */
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.1rem;
  text-decoration: none;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  display: block;
  transition: all .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,.12); color: #1e293b; }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: .6rem;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; margin-bottom: .2rem; }
.stat-label { font-size: .78rem; color: #64748b; font-weight: 500; }

/* ---- Tables ---- */
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; }
.table td { font-size: .875rem; color: #374151; }

/* ---- Forms ---- */
.form-label { font-size: .875rem; font-weight: 500; color: #374151; margin-bottom: .3rem; }
.form-control, .form-select {
  border-color: #d1d5db;
  border-radius: 6px;
  font-size: .875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}

/* ---- Editor textarea ---- */
.admin-editor { font-family: 'Courier New', monospace; font-size: .85rem; }

/* ---- Responsive sidebar ---- */
@media (max-width: 991px) {
  .admin-sidebar {
    position: fixed;
    left: calc(-1 * var(--admin-sidebar-w));
    top: 0; bottom: 0;
    z-index: 1040;
    transition: left .3s ease;
  }
  .admin-sidebar.open { left: 0; }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
  }
  .sidebar-backdrop.show { display: block; }
}

/* ====================================================
   GALERÍA DE PRODUCTO (grilla de imágenes en editar.php)
   ==================================================== */

.galeria-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
}
.galeria-admin-item {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}
.galeria-admin-item img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  display: block;
  padding: 6px;
}
.galeria-admin-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: var(--admin-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: .8rem;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background .15s;
}
.galeria-admin-del:hover { background: #b02030; color: #fff; }
