/* =============================================
   LANCE UK — ADMIN PANEL STYLESHEET
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --orange: #E8520A;
  --orange-dim: #C44308;
  --dark: #111110;
  --gray: #6B7280;
  --light-gray: #F3F4F6;
  --border: #E5E7EB;
  --white: #FFFFFF;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --sidebar-w: 260px;
}

body { font-family: 'Inter', sans-serif; background: #F9FAFB; color: var(--dark); overflow-x: hidden; }

/* SIDEBAR */
.admin-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--dark); color: white; display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; background: var(--orange); display: flex; align-items: center;
  justify-content: center; clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%); flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 16px; height: 16px; fill: white; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; letter-spacing: 2px; }
.sidebar-logo-sub { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.3); padding: 12px 8px 8px; margin-top: 8px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.65); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: all .2s; margin-bottom: 2px;
}
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; fill: currentColor; }
.sidebar-item:hover, .sidebar-item.active {
  background: rgba(255,255,255,0.08); color: white;
}
.sidebar-item.active { background: var(--orange); color: white; }

.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; color: rgba(255,255,255,0.3);
}
.view-site-btn {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: rgba(255,255,255,0.08); border-radius: 8px; color: white;
  text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 12px;
  transition: background .2s;
}
.view-site-btn:hover { background: rgba(255,255,255,0.15); }
.view-site-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* MAIN CONTENT */
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.admin-topbar {
  background: white; border-bottom: 1px solid var(--border); padding: 0 32px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 18px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.btn-save {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px;
  background: var(--orange); color: white; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
  transition: background .2s; cursor: pointer;
}
.btn-save:hover { background: var(--orange-dim); }
.btn-save svg { width: 16px; height: 16px; fill: white; }
.btn-secondary {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px;
  background: var(--light-gray); color: var(--dark); border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
  transition: background .2s; cursor: pointer;
}
.btn-secondary:hover { background: var(--border); }

/* PANEL CONTENT */
.admin-panel { padding: 32px; display: none; }
.admin-panel.active { display: block; }

/* CARDS */
.card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; margin-bottom: 24px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title-badge {
  font-size: 11px; background: rgba(232,82,10,0.1); color: var(--orange);
  padding: 3px 8px; border-radius: 4px; font-weight: 600;
}

/* FORM ELEMENTS */
.field-group { margin-bottom: 20px; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray); margin-bottom: 8px; }
.field-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--dark);
  transition: border-color .2s, box-shadow .2s; outline: none; background: white;
}
.field-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,82,10,0.1); }
textarea.field-input { resize: vertical; min-height: 80px; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* IMAGE UPLOAD */
.img-upload-area {
  border: 2px dashed var(--border); border-radius: 12px; padding: 32px;
  text-align: center; cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
  background: var(--light-gray);
}
.img-upload-area:hover { border-color: var(--orange); background: rgba(232,82,10,0.03); }
.img-upload-area.dragover { border-color: var(--orange); background: rgba(232,82,10,0.05); }
.img-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.img-upload-icon { width: 48px; height: 48px; background: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.img-upload-icon svg { width: 24px; height: 24px; fill: var(--gray); }
.img-upload-text { font-size: 14px; color: var(--gray); font-weight: 500; }
.img-upload-text span { color: var(--orange); font-weight: 600; }
.img-upload-hint { font-size: 12px; color: #9CA3AF; margin-top: 4px; }
.img-preview {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px;
  display: none; margin-bottom: 12px;
}
.img-preview.show { display: block; }
.img-preview-wrap { position: relative; }
.img-remove-btn {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  background: rgba(0,0,0,0.6); border: none; border-radius: 50%; color: white;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s; display: none;
}
.img-remove-btn.show { display: flex; }

/* LOGO PREVIEW */
.logo-preview-box {
  background: var(--dark); padding: 24px 32px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; min-height: 100px; gap: 12px; margin-bottom: 16px;
}
.logo-preview-img { max-height: 60px; width: auto; object-fit: contain; }
.logo-preview-text { text-align: left; }
.logo-preview-name { font-size: 22px; font-weight: 700; letter-spacing: 4px; color: white; font-family: 'Barlow Condensed', sans-serif; }
.logo-preview-sub { font-size: 9px; letter-spacing: 3px; color: var(--orange); font-weight: 600; text-transform: uppercase; }
.logo-preview-icon { width: 36px; height: 36px; background: var(--orange); display: flex; align-items: center; justify-content: center; clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%); }
.logo-preview-icon svg { width: 18px; height: 18px; fill: white; }

/* PRODUCT LIST */
.prod-list { display: flex; flex-direction: column; gap: 16px; }
.prod-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 20px;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; align-items: center;
  background: white; transition: box-shadow .2s;
}
.prod-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.prod-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; background: var(--light-gray); }
.prod-item-name { font-size: 15px; font-weight: 600; }
.prod-item-series { font-size: 12px; color: var(--orange); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.prod-item-power { font-size: 13px; color: var(--gray); }
.prod-item-actions { display: flex; gap: 8px; }
.btn-icon {
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px;
  background: white; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
}
.btn-icon svg { width: 16px; height: 16px; fill: var(--gray); }
.btn-icon:hover { border-color: var(--orange); background: rgba(232,82,10,0.05); }
.btn-icon:hover svg { fill: var(--orange); }
.btn-icon.danger:hover { border-color: var(--danger); background: rgba(239,68,68,0.05); }
.btn-icon.danger:hover svg { fill: var(--danger); }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; opacity: 0;
  pointer-events: none; transition: opacity .3s; backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: 16px; padding: 32px; width: 90%; max-width: 680px;
  max-height: 90vh; overflow-y: auto; transform: translateY(20px); transition: transform .3s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px; background: var(--light-gray); border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px;
  transition: background .2s; color: var(--gray);
}
.modal-close:hover { background: var(--border); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* TOAST */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--dark); color: white;
  padding: 14px 20px; border-radius: 10px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; z-index: 9999;
  transform: translateY(80px); opacity: 0; transition: all .3s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.admin-toast.success-toast { border-left: 4px solid var(--success); }
.admin-toast.error-toast { border-left: 4px solid var(--danger); }
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast svg { width: 20px; height: 20px; fill: var(--success); flex-shrink: 0; }

/* STAT CARDS */
.stats-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-card-num { font-size: 28px; font-weight: 700; color: var(--dark); }
.stat-card-label { font-size: 13px; color: var(--gray); margin-top: 4px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-card-icon svg { width: 20px; height: 20px; }
.stat-card.orange .stat-card-icon { background: rgba(232,82,10,0.1); }
.stat-card.orange .stat-card-icon svg { fill: var(--orange); }
.stat-card.green .stat-card-icon { background: rgba(16,185,129,0.1); }
.stat-card.green .stat-card-icon svg { fill: var(--success); }
.stat-card.blue .stat-card-icon { background: rgba(59,130,246,0.1); }
.stat-card.blue .stat-card-icon svg { fill: #3B82F6; }
.stat-card.purple .stat-card-icon { background: rgba(139,92,246,0.1); }
.stat-card.purple .stat-card-icon svg { fill: #8B5CF6; }

/* TICKER EDITOR */
.ticker-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--light-gray); border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-weight: 500; margin: 4px;
}
.ticker-tag button { background: none; border: none; color: var(--gray); font-size: 14px; cursor: pointer; padding: 0 0 0 4px; line-height: 1; }
.ticker-tag button:hover { color: var(--danger); }
.ticker-input-row { display: flex; gap: 8px; margin-top: 12px; }
.ticker-input-row .field-input { flex: 1; }
.btn-add-small { padding: 10px 16px; background: var(--orange); color: white; border: none; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* SECTION TOGGLE */
.section-toggle { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--light-gray); border-radius: 8px; margin-bottom: 8px; }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #ccc; border-radius: 24px; cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--orange); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 14px; font-weight: 500; }

/* COLOR PICKER SWATCH */
.color-field { display: flex; align-items: center; gap: 10px; }
.color-swatch { width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; overflow: hidden; }
.color-swatch input[type="color"] { width: 100%; height: 100%; border: none; padding: 0; cursor: pointer; }
.color-hex { font-size: 13px; font-family: monospace; color: var(--gray); }

/* SPECS EDITOR */
.spec-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.btn-remove-spec { width: 32px; height: 32px; background: var(--light-gray); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gray); font-size: 16px; flex-shrink: 0; }
.btn-remove-spec:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); color: var(--danger); }
.btn-add-spec { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--light-gray); border: 1px dashed var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--gray); cursor: pointer; transition: all .2s; margin-top: 8px; }
.btn-add-spec:hover { border-color: var(--orange); color: var(--orange); background: rgba(232,82,10,0.05); }

/* TESTIMONIALS */
.testimonial-card { border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; background: white; }
.testimonial-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.testimonial-num { font-size: 12px; font-weight: 600; color: var(--gray); background: var(--light-gray); padding: 4px 10px; border-radius: 4px; }

/* WHY CARDS */
.why-card-item { border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 12px; background: white; }
.why-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.why-card-num-badge { width: 32px; height: 32px; background: var(--orange); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* RESPONSIVE ADMIN */
@media(max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-overview { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .admin-topbar { padding: 0 16px; }
  .admin-panel { padding: 16px; }
}
