/* ============================================
   ShopZone Admin Dashboard Theme
   Dark Ink, Red Accent & Gold (matches ShopZone brand)
   ============================================ */

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

:root {
  --navy: #0F0E17;
  --navy-light: #1a0f2e;
  --navy-darker: #08070d;
  --gold: #FFCB47;
  --gold-dark: #e6ad1f;
  --accent: #E63946;
  --accent-dark: #c1121f;
  --white: #FFFFFF;
  --light: #F5F4F8;
  --gray: #E8E6EE;
  --text: #0F0E17;
  --text-muted: #5C5B6E;
  --text-light: #9998AB;
  --red: #E63946;
  --green: #22c55e;
  --blue: #3b82f6;
  --shadow: 0 2px 16px rgba(15,14,23,0.08);
  --shadow-lg: 0 8px 32px rgba(15,14,23,0.16);
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar-width: 260px;
  --transition: all 0.2s ease;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--light);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-darker) 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  text-align: center;
}
.login-card img { height: 90px; margin: 0 auto 12px; }
.login-card h1 { font-family: 'Syne', sans-serif; color: var(--navy); font-size: 22px; margin-bottom: 4px; }
.login-card p.sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.login-card .form-group { text-align: left; margin-bottom: 16px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.login-card input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--gray);
  border-radius: 8px; outline: none; transition: var(--transition);
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,57,70,0.1); }
.login-card .btn-login {
  width: 100%; padding: 12px; background: var(--accent); color: white;
  border-radius: 8px; font-weight: 700; font-size: 14px; margin-top: 6px; transition: var(--transition);
}
.login-card .btn-login:hover { background: var(--accent-dark); }
.login-error {
  background: #fef2f2; color: var(--red); border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; text-align: left;
}

/* ===== LAYOUT ===== */
.app-wrap { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: white;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img { height: 42px; width: 42px; object-fit: contain; }
.sidebar-brand .brand-text { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px; color: white; }
.sidebar-brand .brand-text span { color: var(--accent); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 0; }
.sidebar-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.35); padding: 14px 20px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; color: rgba(255,255,255,0.75);
  font-size: 13.5px; font-weight: 500; transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link .icon { font-size: 17px; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active {
  background: rgba(255,203,71,0.12); color: var(--gold);
  border-left-color: var(--gold); font-weight: 700;
}
.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: rgba(255,255,255,0.5);
}

/* Main content */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: white; box-shadow: var(--shadow);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-family: 'Syne', sans-serif; font-size: 19px; color: var(--navy); font-weight: 700; }
.menu-toggle { display: none; font-size: 22px; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-chip { display: flex; align-items: center; gap: 10px; }
.admin-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gold);
  color: var(--navy); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.admin-chip .name { font-weight: 600; font-size: 13px; color: var(--text); }
.admin-chip .role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1.5px solid var(--gray); border-radius: 8px; font-size: 13px;
  font-weight: 600; color: var(--text-muted); transition: var(--transition);
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

.content { padding: 26px 28px; flex: 1; }

/* ===== CARDS / STATS ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.stat-icon.navy { background: rgba(15,14,23,0.08); color: var(--navy); }
.stat-icon.gold { background: rgba(255,203,71,0.2); color: var(--gold-dark); }
.stat-icon.green { background: rgba(34,197,94,0.12); color: var(--green); }
.stat-icon.red { background: rgba(230,57,70,0.1); color: var(--red); }
.stat-info .stat-value { font-size: 24px; font-weight: 800; color: var(--navy); font-family: 'Syne', sans-serif; }
.stat-info .stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.card {
  background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 22px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.card-header h2 { font-family: 'Syne', sans-serif; font-size: 17px; color: var(--navy); font-weight: 700; }
.card-header p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; font-size: 13px; transition: var(--transition);
  cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { border: 1.5px solid var(--navy); color: var(--navy); background: white; }
.btn-outline:hover { background: var(--navy); color: white; }
.btn-danger { background: #fef2f2; color: var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 12px 14px; background: var(--light);
  color: var(--text-muted); font-weight: 700; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.5px; white-space: nowrap;
}
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--light); vertical-align: middle; }
tbody tr:hover { background: #fafbfc; }
.table-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.table-actions { display: flex; gap: 8px; }
.empty-row { text-align: center; padding: 40px; color: var(--text-light); }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.badge-gold { background: rgba(255,203,71,0.2); color: var(--gold-dark); }
.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-red { background: rgba(230,57,70,0.1); color: var(--red); }
.badge-navy { background: rgba(15,14,23,0.08); color: var(--navy); }
.badge-gray { background: var(--gray); color: var(--text-muted); }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-group { margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.form-group .hint { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray);
  border-radius: 8px; outline: none; transition: var(--transition); background: white;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,57,70,0.08); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--light); }
.current-image { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.current-image img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--gray); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.alert-success { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }

/* ===== PAGE HEADER ===== */
.page-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title-row h1 { font-family: 'Syne', sans-serif; font-size: 22px; color: var(--navy); font-weight: 800; }
.page-title-row p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ===== TABS (settings) ===== */
.tab-nav { display: flex; gap: 6px; border-bottom: 2px solid var(--light); margin-bottom: 20px; flex-wrap: wrap; }
.tab-link {
  padding: 10px 18px; font-weight: 600; font-size: 13px; color: var(--text-muted);
  border-bottom: 3px solid transparent; transition: var(--transition); cursor: pointer;
}
.tab-link.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-link:hover { color: var(--navy); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== Repeatable row box (trust badges, side cards, variants, specs) ===== */
.repeat-box {
  border: 1.5px solid var(--gray); border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.repeat-box .col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.repeat-box .col-head input { font-weight: 700; font-size: 14px; max-width: 260px; }
.link-row { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; }
.link-row input { flex: 1; }

/* ===== Toggle switch ===== */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray); border-radius: 24px; transition: var(--transition); }
.slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: var(--transition); }
input:checked + .slider { background: var(--green); }
input:checked + .slider::before { transform: translateX(20px); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,14,23,0.5);
  display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: white; border-radius: var(--radius-lg); padding: 28px; max-width: 420px;
  width: 100%; text-align: center; box-shadow: var(--shadow-lg);
}
.modal-box .modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal-box h3 { font-family: 'Syne', sans-serif; color: var(--navy); margin-bottom: 8px; font-size: 18px; }
.modal-box p { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 14px; }
  .topbar { padding: 12px 16px; }
}
