/* ==========================================================================
   EZPZ Bazar — Storefront design system
   ========================================================================== */

:root {
  --brand: #FF6713;
  --brand-dark: #D9480F;
  --brand-deep: #B8360A;
  --brand-light: #FFF1E7;
  --ink: #15171C;
  --ink-soft: #6B7280;
  --ink-faint: #9CA3AF;
  --border: #E7E7E4;
  --surface: #FFFFFF;
  --surface-alt: #F7F6F3;
  --success: #16A34A;
  --success-bg: #ECFDF3;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --warning-bg: #FFF7ED;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(21,23,28,.06), 0 1px 1px rgba(21,23,28,.04);
  --shadow-md: 0 8px 24px rgba(21,23,28,.08);
  --shadow-lg: 0 18px 48px rgba(21,23,28,.14);
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container { max-width: 1220px; margin: 0 auto; padding: 0 20px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none;
  padding: 13px 26px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 1px 2px rgba(21,23,28,.08);
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); box-shadow: none; }
.btn-outline:hover { background: var(--surface-alt); border-color: var(--ink); }
.link-danger { color: var(--danger); font-weight: 600; font-size: 14px; }
.link-danger:hover { text-decoration: underline; }

/* ---------------- Announcement bar ---------------- */
.announce-bar {
  background: var(--ink); color: #fff; overflow: hidden; white-space: nowrap;
  font-size: 13px; font-weight: 500; padding: 9px 0;
}
.announce-track {
  display: inline-flex; gap: 48px; padding-left: 48px;
  animation: marquee 26s linear infinite;
}
.announce-track span { color: #F2E7DE; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .announce-track { animation: none; }
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
}
.logo img { height: 34px; width: auto; }
.hamburger { display: none; background: none; border: none; padding: 8px; margin-left: -8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

.main-nav { display: flex; align-items: center; gap: 26px; flex-shrink: 0; }
.nav-item { font-weight: 600; font-size: 14.5px; color: var(--ink); display: flex; align-items: center; gap: 5px; padding: 8px 0; }
.nav-item:hover { color: var(--brand); }
.has-dropdown { position: relative; cursor: default; }
.has-dropdown svg { transition: transform .15s ease; }
.has-dropdown:hover svg { transform: rotate(180deg); }
.dropdown-panel {
  position: absolute; top: 100%; left: -14px; margin-top: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 8px; min-width: 200px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .15s ease;
}
.has-dropdown:hover .dropdown-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-panel a { display: block; padding: 9px 12px; border-radius: 7px; font-weight: 500; font-size: 14px; }
.dropdown-panel a:hover { background: var(--surface-alt); color: var(--brand); }

.header-search {
  flex: 1; display: flex; align-items: center; background: var(--surface-alt);
  border: 1px solid transparent; border-radius: 999px; padding: 0 6px 0 16px;
  max-width: 380px; margin-left: auto; transition: border-color .15s ease;
}
.header-search:focus-within { border-color: var(--brand); background: #fff; }
.header-search input { flex: 1; border: none; background: none; padding: 10px 0; font-size: 14px; font-family: inherit; }
.header-search input:focus { outline: none; }
.header-search button { background: var(--ink); color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.header-search-mobile { display: none; margin: 0 20px 12px; max-width: none; }

.header-icons { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink); }
.icon-btn:hover { background: var(--surface-alt); }
.icon-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--success); border-radius: 50%; border: 1.5px solid #fff; }
.cart-badge {
  position: absolute; top: 2px; right: 0; background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 1.5px solid #fff;
}

/* Mobile slide-out menu */
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(21,23,28,.5); z-index: 199; opacity: 0; visibility: hidden; transition: opacity .2s ease; }
.mobile-menu-overlay.open { opacity: 1; visibility: visible; }
.mobile-menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px;
  background: #fff; z-index: 200; padding: 18px 10px 30px;
  transform: translateX(-100%); transition: transform .25s ease;
  overflow-y: auto; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.mobile-menu-head button { background: none; border: none; font-size: 26px; line-height: 1; color: var(--ink-soft); }
.mobile-menu a { padding: 13px 12px; font-weight: 600; font-size: 15px; border-radius: 8px; }
.mobile-menu a:hover, .mobile-menu a:active { background: var(--surface-alt); color: var(--brand); }
.mobile-menu-label { padding: 14px 12px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.mobile-menu-divider { height: 1px; background: var(--border); margin: 10px 4px; }

.whatsapp-fab {
  position: fixed; bottom: 22px; right: 22px; width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); z-index: 90; transition: transform .15s ease;
}
.whatsapp-fab:hover { transform: scale(1.08); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #FF9152 0%, var(--brand) 42%, var(--brand-deep) 100%);
  padding: 84px 0 96px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14);
}
.hero::before { width: 420px; height: 420px; top: -180px; right: -120px; }
.hero::after { width: 220px; height: 220px; bottom: -100px; right: 22%; background: rgba(255,255,255,.10); }
.hero-inner { position: relative; z-index: 1; max-width: 620px; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px); line-height: 1.06; color: #fff; margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.hero p { color: rgba(255,255,255,.92); font-size: clamp(15px, 1.7vw, 18px); max-width: 460px; margin-bottom: 30px; }
.hero .btn { margin-right: 12px; }
.hero .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; }

/* ---------------- Sections ---------------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); }
.section-head > a { font-weight: 600; font-size: 14px; color: var(--brand); flex-shrink: 0; }
.section-head > a:hover { text-decoration: underline; }

/* ---------------- Category grid ---------------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.category-card {
  position: relative; aspect-ratio: 1/1; border-radius: var(--radius);
  background: linear-gradient(150deg, #FFE7D6, #FFD3B0);
  display: flex; align-items: flex-end; padding: 16px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
  background-size: cover; background-position: center;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.category-card.has-img::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(15,16,20,.62) 0%, rgba(15,16,20,0) 55%);
}
.category-card span { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: var(--ink); }
.category-card.has-img span { color: #fff; }

/* ---------------- Product grid / cards ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card { display: block; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--border); transition: box-shadow .18s ease, transform .18s ease; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.pc-image { position: relative; aspect-ratio: 1/1; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pc-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .pc-image img { transform: scale(1.06); }
.ph { color: var(--ink-faint); font-size: 13px; text-align: center; padding: 0 12px; font-weight: 600; }
.pc-badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 999px; }
.pc-badge-sale { background: var(--ink); color: #fff; }
.pc-badge-out { background: rgba(255,255,255,.92); color: var(--danger); left: auto; right: 10px; }
.pc-body { padding: 14px 14px 16px; }
.pc-name { font-size: 14.5px; font-weight: 600; font-family: var(--font-body); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 38px; }
.pc-price-row { display: flex; align-items: center; gap: 8px; }
.pc-price { font-weight: 700; font-size: 15.5px; color: var(--brand-dark); }
.pc-compare { font-size: 13px; color: var(--ink-faint); text-decoration: line-through; }

/* ---------------- Empty state ---------------- */
.empty-state { text-align: center; padding: 64px 24px; background: var(--surface-alt); border-radius: var(--radius-lg); }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--ink-soft); }

/* ---------------- Alerts / forms ---------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.alert-error { background: var(--danger-bg); color: #B91C1C; border: 1px solid #FCA5A5; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; background: #fff; transition: border-color .15s ease;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--brand); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------------- Auth (account.php) ---------------- */
.auth-wrap { max-width: 420px; margin: 60px auto; padding: 0 20px; }
.tabs { display: flex; gap: 4px; background: var(--surface-alt); padding: 4px; border-radius: 10px; margin-bottom: 24px; }
.tab-btn { flex: 1; background: none; border: none; padding: 10px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.tab-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* Order history */
.order-history-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.order-history-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; flex-wrap: wrap; gap: 8px; }
.status-pill { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; text-transform: capitalize; }
.status-processing { background: var(--warning-bg); color: #C2410C; }
.status-shipped { background: #EFF6FF; color: #1D4ED8; }
.status-delivered { background: var(--success-bg); color: #15803D; }
.status-cancelled { background: var(--danger-bg); color: #B91C1C; }
.status-pending, .status-awaiting_payment { background: var(--surface-alt); color: var(--ink-soft); }

/* ---------------- Cart page ---------------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.cart-table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); padding: 0 8px 12px; border-bottom: 1px solid var(--border); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-item-info { display: flex; align-items: center; gap: 14px; }
.cart-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--surface-alt); overflow: hidden; flex-shrink: 0; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-variant { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.remove-link { color: var(--danger); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.remove-link:hover { text-decoration: underline; }

.cart-summary { max-width: 380px; margin-left: auto; background: var(--surface-alt); border-radius: var(--radius-lg); padding: 24px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14.5px; color: var(--ink-soft); padding: 7px 0; }
.summary-row.total { font-size: 17px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--border); margin-top: 6px; padding-top: 14px; }
.shipping-note { font-size: 13px; color: var(--brand-dark); background: var(--brand-light); padding: 9px 12px; border-radius: 8px; margin: 6px 0; }
.cart-summary .btn { margin-top: 14px; }

/* ---------------- Checkout ---------------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding: 44px 0 80px; align-items: start; }
.order-summary-box { background: var(--surface-alt); border-radius: var(--radius-lg); padding: 24px; position: sticky; top: calc(var(--header-h) + 20px); }
.mini-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.pay-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.pay-option { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-weight: 600; font-size: 14.5px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.pay-option input { accent-color: var(--brand); }
.pay-option.active { border-color: var(--brand); background: var(--brand-light); }

/* ---------------- Product detail ---------------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 40px 0 70px; }
.pd-gallery-main { aspect-ratio: 1/1; background: var(--surface-alt); border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pd-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-thumb { width: 68px; height: 68px; border-radius: 9px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--surface-alt); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb.active { border-color: var(--brand); }
.product-cat { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.pd-info h1 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 6px; }
.pd-price { font-size: 26px; font-weight: 700; color: var(--brand-dark); margin: 14px 0; display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); }
.price-was { font-size: 16px; color: var(--ink-faint); text-decoration: line-through; font-weight: 500; }
.pd-desc { color: var(--ink-soft); font-size: 15px; line-height: 1.7; margin-bottom: 22px; }
.option-group { margin-bottom: 18px; }
.option-group label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 9px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: all .12s ease; }
.swatch:hover { border-color: var(--ink); }
.swatch.selected { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.stock-note { font-size: 13.5px; font-weight: 600; color: var(--success); margin-bottom: 18px; }
.qty-row { margin-bottom: 18px; }
.qty-box { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qty-box button { background: var(--surface-alt); border: none; width: 40px; height: 42px; font-size: 18px; font-weight: 600; }
.qty-box button:hover { background: var(--brand-light); color: var(--brand-dark); }
.qty-box input { width: 52px; height: 42px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font-size: 15px; font-weight: 600; font-family: inherit; }
.qty-box input:focus { outline: none; }

/* ---------------- Admin-style summary card (reused on order-success) ---------------- */
.admin-card { background: var(--surface-alt); border-radius: var(--radius-lg); padding: 24px; margin-top: 28px; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--ink); color: #C9CAD1; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; padding: 56px 20px 40px; }
.footer-brand img { filter: brightness(0) invert(1); margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; line-height: 1.7; color: #9A9CA6; margin-bottom: 16px; max-width: 280px; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.footer-socials a:hover { background: var(--brand); color: #fff; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 13.5px; color: #9A9CA6; padding: 6px 0; }
.footer-col a:hover { color: #fff; }
.footer-newsletter p { font-size: 13.5px; color: #9A9CA6; margin-bottom: 14px; }
.newsletter-form { display: flex; gap: 8px; margin-bottom: 18px; }
.newsletter-form input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: 13.5px; }
.newsletter-form input::placeholder { color: #7C7E88; }
.newsletter-form button { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 0 16px; font-weight: 600; font-size: 13.5px; }
.footer-contact { font-size: 13px; color: #9A9CA6; line-height: 1.8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom-inner { display: flex; justify-content: space-between; padding: 18px 20px; font-size: 12.5px; color: #7C7E88; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .main-nav, .header-search { display: none; }
  .header-search-mobile { display: flex; }
  .hamburger { display: block; }
  .header-inner { gap: 14px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .order-summary-box { position: static; }
  .product-detail { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: 56px 0 68px; text-align: left; }
  .hero::before { width: 260px; height: 260px; top: -120px; right: -100px; }
  .section { padding: 40px 0; }
  .form-row { grid-template-columns: 1fr; }
  .cart-table thead { display: none; }
  .cart-table tr { display: flex; flex-wrap: wrap; padding: 14px 0; }
  .cart-table td { padding: 6px 4px; border: none; }
  .cart-table td:first-child { flex: 0 0 100%; }
  .footer-grid { grid-template-columns: 1fr; padding: 40px 20px 30px; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .cart-summary { max-width: none; }
}

/* ==========================================================================
   EZPZ Bazar — Admin Panel
   ========================================================================== */

.admin-body { background: var(--surface-alt); font-family: var(--font-body); }
.alert-success { background: var(--success-bg); color: #15803D; border: 1px solid #86EFAC; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; margin-bottom: 18px; }

/* ---- Shell layout ---- */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 246px; flex-shrink: 0; background: #17181C; color: #C9CAD1;
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-logo { display: block; padding: 10px 10px 22px; }
.admin-logo img { height: 30px; filter: brightness(0) invert(1); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px;
  font-weight: 600; font-size: 14px; color: #B7B8C2; transition: background .12s ease, color .12s ease;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; }
.admin-nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.admin-nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 12px 6px; }
.admin-sidebar-overlay { display: none; }

.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 68px; flex-shrink: 0; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { font-size: 19px; }
.admin-topbar-right { margin-left: auto; }
.admin-hamburger { display: none; background: none; border: none; padding: 6px; margin-left: -6px; }
.admin-hamburger span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }
.admin-user-chip { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; }
.admin-user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.admin-main { padding: 26px 28px 60px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card.warn { border-color: #FDBA74; background: var(--warning-bg); }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 10px; }
.stat-icon { font-size: 16px; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.stat-sub { font-size: 12.5px; color: var(--ink-faint); }
/* legacy stat markup (index.php variant) */
.stat-card .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat-card .label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* ---- Panels ---- */
.admin-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.admin-panel-head h3 { font-size: 15.5px; }
.admin-panel-body { }
.admin-panel-body.pad { padding: 20px; }
.admin-empty { padding: 40px 20px; text-align: center; color: var(--ink-soft); font-size: 14px; }

/* ---- Tables ---- */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-faint); padding: 12px 20px; background: var(--surface-alt); border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-alt); }
.admin-row-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--surface-alt); }
.row-actions { display: flex; gap: 14px; align-items: center; }
.row-actions a { font-weight: 600; font-size: 13.5px; color: var(--brand-dark); }
.row-actions a:hover { text-decoration: underline; }
.row-actions .danger { background: none; border: none; font-weight: 600; font-size: 13.5px; color: var(--danger); padding: 0; }
.row-actions .danger:hover { text-decoration: underline; }

/* ---- Forms ---- */
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-checkbox-row { display: flex; align-items: center; gap: 9px; }
.admin-checkbox-row input { width: 17px; height: 17px; accent-color: var(--brand); }
.admin-search-bar { display: flex; align-items: center; gap: 10px; }
.admin-search-bar input[type="text"] { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 999px; font-size: 13.5px; font-family: inherit; width: 220px; }
.admin-search-bar select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit; background: #fff; }

/* Variant + gallery rows inside product form */
.variant-table { width: 100%; border-collapse: collapse; }
.variant-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; color: var(--ink-faint); padding: 8px 8px; }
.variant-table td { padding: 6px 8px; }
.variant-table input { width: 100%; padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 7px; font-family: inherit; font-size: 13.5px; }
.remove-row-btn { background: var(--danger-bg); color: var(--danger); border: none; width: 30px; height: 30px; border-radius: 7px; font-weight: 700; }
.gallery-row { display: flex; gap: 8px; margin-bottom: 8px; }
.gallery-row input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 7px; font-family: inherit; font-size: 13.5px; }
.gallery-row button { background: var(--danger-bg); color: var(--danger); border: none; width: 38px; border-radius: 7px; font-weight: 700; }

/* ---- Low stock list ---- */
.low-stock-list { padding: 6px 20px 16px; }
.low-stock-item { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.low-stock-item:last-child { border-bottom: none; }
.stock-count { font-weight: 700; color: #C2410C; background: var(--warning-bg); padding: 3px 10px; border-radius: 999px; font-size: 12px; }

/* ---- Admin login ---- */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(120% 140% at 100% 0%, #FF9152 0%, var(--brand) 42%, var(--brand-deep) 100%); }
.admin-login-card { background: #fff; border-radius: var(--radius-lg); padding: 40px 34px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); text-align: center; }
.admin-login-logo { height: 34px; margin: 0 auto 6px; }
.admin-login-card .subtitle { color: var(--ink-soft); font-size: 14px; margin-bottom: 26px; }
.admin-login-card form { text-align: left; }

/* ---- Responsive admin ---- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed; z-index: 300; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar-overlay {
    display: block; position: fixed; inset: 0; background: rgba(21,23,28,.5); z-index: 290;
    opacity: 0; visibility: hidden; transition: opacity .2s ease;
  }
  .admin-sidebar-overlay.open { opacity: 1; visibility: visible; }
  .admin-hamburger { display: block; }
  .admin-main { padding: 20px 16px 50px; }
  .admin-topbar { padding: 0 16px; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-panel-head { flex-direction: column; align-items: flex-start; }
  .admin-search-bar { width: 100%; }
  .admin-search-bar input[type="text"] { flex: 1; width: auto; }
}
