/* ============================================================
   RELOJ.SHOP — Panel de Administración Luxury UI
   ============================================================ */

:root {
  --primary: #E80C11;
  --primary-dark: #8F080C;
  --primary-glow: rgba(232, 12, 17, 0.35);
  --crimson-glow: #FF2E4C;
  --gold-accent: #E5C158;
  
  --bg: #0A090B;
  --surface: rgba(18, 16, 20, 0.82);
  --surface-hover: rgba(30, 26, 34, 0.9);
  --surface-card: rgba(22, 20, 26, 0.85);
  
  --text: #F7F5F6;
  --text-secondary: #9E98A0;
  --text-muted: #6B656E;
  --border: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(232, 12, 17, 0.5);
  --silver: #D5D0D3;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-main: 'Manrope', -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Playfair Display', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 9, 11, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body.admin-body {
  margin: 0;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(232, 12, 17, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(229, 193, 88, 0.04) 0%, transparent 40%);
  color: var(--text);
  font-family: var(--font-main);
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

body.login-body {
  margin: 0;
  background: radial-gradient(circle at 50% 30%, rgba(232, 12, 17, 0.18), transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

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

/* ============================================================
   Sidebar Navigation
   ============================================================ */
.admin-sidebar {
  background: rgba(14, 12, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-logo-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 12, 17, 0.2), rgba(20, 18, 22, 0.8));
  border: 1px solid rgba(232, 12, 17, 0.3);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(232, 12, 17, 0.2);
}

.admin-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

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

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  color: #FFF;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--gold-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0;
  gap: 0.3rem;
  flex: 1;
}

.admin-nav a {
  padding: 0.9rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  margin: 0 0.5rem;
  border-radius: 0 8px 8px 0;
}

.admin-nav a:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.04);
  border-left-color: rgba(232, 12, 17, 0.5);
}

.admin-nav a.active {
  color: #FFF;
  background: linear-gradient(90deg, rgba(232, 12, 17, 0.2), rgba(232, 12, 17, 0.03));
  border-left-color: var(--primary);
  box-shadow: 0 4px 15px rgba(232, 12, 17, 0.15);
}

.admin-nav a i {
  width: 22px;
  font-size: 1.05rem;
  text-align: center;
  transition: transform 0.2s ease;
}

.admin-nav a:hover i, .admin-nav a.active i {
  color: var(--crimson-glow);
  transform: scale(1.1);
}

.admin-nav a.logout {
  margin-top: auto;
  color: #FF4D4D;
}
.admin-nav a.logout:hover {
  background: rgba(232, 12, 17, 0.15);
}

/* ============================================================
   Main Layout & Header
   ============================================================ */
.admin-main {
  padding: 2.2rem 2.5rem;
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.admin-topbar h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #FFF 60%, var(--silver));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-content {
  max-width: 1300px;
}

/* ============================================================
   Stats Cards Grid
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.3rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.4rem;
  display: flex;
  gap: 1.1rem;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232, 12, 17, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(232, 12, 17, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(232, 12, 17, 0.15);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card i {
  font-size: 1.4rem;
  color: var(--crimson-glow);
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(232, 12, 17, 0.2), rgba(232, 12, 17, 0.05));
  border: 1px solid rgba(232, 12, 17, 0.25);
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 2px;
}

.stat-card strong {
  font-size: 1.7rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #FFF;
}

/* ============================================================
   Panels
   ============================================================ */
.panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.panel h2, .panel h3 {
  margin: 0 0 1.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #FFF;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   Form Grid Layout System
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
}

.checkbox-inline {
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem !important;
  color: var(--text) !important;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin: 0;
  background: rgba(0, 0, 0, 0.2);
}

fieldset legend {
  padding: 0 0.6rem;
  color: var(--gold-accent);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}

/* ============================================================
   Dark Luxury Form Controls
   ============================================================ */
.form-control,
input[type=text],
input[type=url],
input[type=email],
input[type=tel],
input[type=password],
input[type=number],
input[type=file],
select,
textarea {
  background: rgba(10, 9, 12, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #F7F5F6 !important;
  padding: 0.7rem 1rem !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-main) !important;
  font-size: 0.92rem !important;
  transition: all 0.25s ease !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.form-control:focus,
input[type=text]:focus,
input[type=url]:focus,
input[type=email]:focus,
input[type=tel]:focus,
input[type=password]:focus,
input[type=number]:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 15px rgba(232, 12, 17, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

select option {
  background: #141216 !important;
  color: #FFF !important;
  padding: 8px !important;
}

/* ============================================================
   Tables
   ============================================================ */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 1rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
  vertical-align: middle;
}

.admin-table th {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-table tr {
  transition: background 0.2s ease;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.admin-table a {
  text-decoration: none;
}

.th-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pct-off {
  color: var(--crimson-glow);
  font-weight: 700;
  font-size: 0.8rem;
}

/* Code Chips */
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(232, 12, 17, 0.1);
  border: 1px solid rgba(232, 12, 17, 0.25);
  border-radius: 6px;
  color: #FFF !important;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none !important;
}
.code-chip:hover {
  background: rgba(232, 12, 17, 0.25);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(232, 12, 17, 0.2);
  transform: translateY(-1px);
}

/* Status Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tag-gold {
  background: rgba(229, 193, 88, 0.15);
  color: var(--gold-accent);
  border: 1px solid rgba(229, 193, 88, 0.35);
}

.tag-warning {
  background: rgba(255, 183, 3, 0.12);
  color: #FFB703;
  border: 1px solid rgba(255, 183, 3, 0.35);
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.12);
}

.tag-info {
  background: rgba(0, 180, 216, 0.12);
  color: #00B4D8;
  border: 1px solid rgba(0, 180, 216, 0.35);
  box-shadow: 0 0 10px rgba(0, 180, 216, 0.12);
}

.tag-success {
  background: rgba(46, 196, 182, 0.12);
  color: #2EC4B6;
  border: 1px solid rgba(46, 196, 182, 0.35);
  box-shadow: 0 0 10px rgba(46, 196, 182, 0.12);
}

.tag-danger {
  background: rgba(232, 12, 17, 0.12);
  color: #FF4D4D;
  border: 1px solid rgba(232, 12, 17, 0.35);
  box-shadow: 0 0 10px rgba(232, 12, 17, 0.12);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FF1E24, var(--primary));
  box-shadow: 0 6px 20px rgba(232, 12, 17, 0.4);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: #FFF;
  background: rgba(232, 12, 17, 0.1);
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
}

.btn-ghost:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
  background: linear-gradient(135deg, #A80A0E, #610406);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--primary), #A80A0E);
  box-shadow: 0 6px 18px rgba(232, 12, 17, 0.35);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* Flash Messages */
.flash {
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.flash-ok {
  background: rgba(46, 196, 182, 0.15);
  color: #4ADE80;
  border: 1px solid rgba(46, 196, 182, 0.35);
}

.flash-error {
  background: rgba(232, 12, 17, 0.18);
  color: #FF9195;
  border: 1px solid rgba(232, 12, 17, 0.4);
}

/* ============================================================
   Login Card & Login Page
   ============================================================ */
.login-card {
  background: rgba(18, 16, 20, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2.8rem 2.4rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(232, 12, 17, 0.12);
  position: relative;
  z-index: 2;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-brand h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFF;
}

.login-brand p {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.login-card form label {
  display: flex !important;
  flex-direction: column !important;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
  gap: 0.5rem;
  width: 100%;
}

.login-card form input {
  width: 100%;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.back-link {
  display: inline-block;
  text-align: center;
  margin-top: 1.2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--crimson-glow);
}

/* Chrome / Safari / Edge Autofill Fix */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #F7F5F6 !important;
  -webkit-box-shadow: 0 0 0px 1000px #12100F inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ============================================================
   Particles Background
   ============================================================ */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.particles-js-canvas-el {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 960px) {
  body.admin-body {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: relative;
    height: auto;
  }
  .admin-main {
    padding: 1.2rem;
  }
}
