/* ===== Admin Styles ===== */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --blue: #1f6fe0;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --navy: #0e2236;
  --navy-dark: #091522;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px -4px rgba(14,34,54,0.08);
  --shadow-lg: 0 12px 32px -8px rgba(14,34,54,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--text-main);
}

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }

/* ===== LOGIN SCREEN ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 20% 20%, rgba(31,111,224,0.08), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(22,163,74,0.08), transparent 40%),
              #f1f5f9;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 40px -15px rgba(14,34,54,0.15);
  border: 1px solid var(--border);
  text-align: center;
}
.login-logo img {
  height: 64px;
  width: auto;
  border-radius: 12px;
  margin: 0 auto 1.2rem;
  box-shadow: var(--shadow-sm);
}
.login-card h2 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.login-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.8rem; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 1.1rem; }
.login-error {
  background: var(--danger-light);
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}
.login-hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-head {
  padding: 1.4rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  height: 42px;
  width: 42px;
  border-radius: 10px;
  object-fit: cover;
}
.sidebar-brand b { display: block; font-size: 1.05rem; color: #fff; }
.sidebar-brand span { font-size: 0.75rem; color: var(--primary-light); opacity: 0.8; }

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(135deg, var(--blue), var(--primary));
  color: #fff;
  box-shadow: 0 4px 12px rgba(31,111,224,0.3);
}
.nav-ic { font-size: 1.15rem; }
.nav-label { flex: 1; }

.sidebar-foot {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Main Body */
.main-body {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-main);
}
.topbar h1 { font-size: 1.35rem; }
.topbar-right { display: flex; align-items: center; gap: 1.2rem; }
.topbar-clock {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-page);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem;
  background: var(--bg-page);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
}
.user-name { font-size: 0.85rem; font-weight: 700; }

/* Content Container */
.content-container {
  padding: 1.8rem;
  flex: 1;
}

/* Tab Panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Cards & Grid */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  gap: 1rem;
}
.card-head h2 { font-size: 1.25rem; }
.card-head h3 { font-size: 1.15rem; }
.card-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Hero Notification Alert */
.hero-alert {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.4rem 1.8rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,0.1);
}
.hero-alert-icon { font-size: 2.2rem; }
.hero-alert-content { flex: 1; }
.hero-alert-content h3 { color: #fef08a; font-size: 1.1rem; margin-bottom: 0.25rem; }
.hero-alert-content p { font-size: 0.88rem; color: #cbd5e1; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-highlight {
  background: linear-gradient(135deg, #fef2f2, #fff);
  border-color: #fca5a5;
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex: none;
}
.stat-icon-blue { background: var(--blue-light); color: var(--blue-dark); }
.stat-icon-green { background: var(--primary-light); color: var(--primary-dark); }
.stat-icon-purple { background: #f3e8ff; color: #7e22ce; }
.stat-icon-amber { background: #fef3c7; color: #b45309; }
.stat-icon-red { background: #fee2e2; color: #b91c1c; }
.stat-title { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.stat-num { font-size: 1.6rem; font-weight: 800; font-family: 'Plus Jakarta Sans'; line-height: 1.1; }

/* Dashboard Rows */
.dash-row { display: flex; gap: 1.5rem; }
.dash-col-8 { flex: 2; }
.dash-col-4 { flex: 1; }

.quick-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.quick-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  color: var(--text-main);
  width: 100%;
}
.quick-btn:hover { background: #fff; border-color: var(--blue); transform: translateX(3px); }
.quick-btn-ic { font-size: 1.5rem; }
.quick-btn-text b { display: block; font-size: 0.92rem; }
.quick-btn-text span { font-size: 0.78rem; color: var(--text-muted); }

/* Toolbar (Search + Filters) */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.search-ic {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-box input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: var(--bg-page);
}
.filter-group { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.filter-group select {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.4rem;
}
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.prod-card-thumb {
  position: relative;
  height: 190px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.prod-card-thumb img {
  max-height: 170px;
  max-width: 90%;
  object-fit: contain;
  transition: transform 0.3s;
}
.product-card:hover .prod-card-thumb img { transform: scale(1.05); }
.prod-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
}
.prod-badge-chayon {
  background: #b91c1c;
  color: #fff;
}
.prod-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.prod-category {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.prod-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.prod-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.prod-price { font-size: 1.15rem; font-weight: 800; color: var(--blue-dark); }
.prod-volume { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.prod-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

/* Videos Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.4rem;
}
.video-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.video-player-wrap {
  position: relative;
  background: #000;
  aspect-ratio: 16/9;
}
.video-player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.video-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  margin-bottom: 0.5rem;
}
.video-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}
.video-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}
.gallery-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gallery-thumb {
  height: 160px;
  width: 100%;
  overflow: hidden;
  background: #000;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-body {
  padding: 0.8rem 1rem;
}
.gallery-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 0.3rem; }
.gallery-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
}

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.data-table th {
  padding: 0.75rem 1rem;
  background: var(--bg-page);
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: #f8fafc; }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-accent { background: #b91c1c; color: #fff; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-muted { background: #f1f5f9; color: #475569; }

.status-select {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
}
.status-select.new { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.status-select.contacted { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.status-select.completed { background: #dcfce7; color: #166534; border-color: #86efac; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover { background: var(--bg-page); border-color: #cbd5e1; }
.btn-light {
  background: #fff;
  color: var(--text-main);
}
.btn-light:hover { background: #f1f5f9; }
.btn-danger-soft {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}
.btn-danger-soft:hover { background: rgba(239,68,68,0.22); color: #fff; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Forms & Dropzones */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,111,224,0.1);
}
.form-row {
  display: flex;
  gap: 1rem;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-center-y { display: flex; align-items: center; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.checkbox-label input { width: auto; }

.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.dropzone-preview {
  width: 90px;
  height: 90px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
.dropzone-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.dropzone-text { text-align: left; }
.dropzone-text p { font-size: 0.9rem; margin-bottom: 0.2rem; }
.dropzone-text span { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.6rem; }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: all 0.25s;
}
.modal.open {
  visibility: visible;
  opacity: 1;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14,34,54,0.65);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.modal-lg { width: min(720px, 100%); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 300;
}
.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Status tabs */
.leads-status-tabs {
  display: flex;
  background: var(--bg-page);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
}
.status-tab {
  border: none;
  background: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}
.status-tab.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Responsive */
@media(max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-row { flex-direction: column; }
}
@media(max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-body { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media(max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .content-container { padding: 1rem; }
}
