/* ============================================================
   MOTO SHOP W&M — Premium Dark Theme CSS
   ============================================================ */

:root {
  --bg:          #0f1011;
  --bg2:         #16181a;
  --surface:     #1d1f22;
  --surface2:    #26292c;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.13);
  --text:        #f0f0f0;
  --muted:       #88929c;
  --accent:      #a58c74;
  --accent2:     #bfa48b;
  --blue:        #3b82f6;
  --green:       #22c55e;
  --red:         #ef4444;
  --radius:      16px;
  --radius-lg:   24px;
  --shadow:      0 20px 60px rgba(0,0,0,0.5);
  --shadow-sm:   0 4px 16px rgba(0,0,0,0.3);
  --transition:  0.22s cubic-bezier(0.4,0,0.2,1);
  --font:        'Inter', system-ui, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(15,16,17,0.88);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.brand-logo {
  height: 48px;
  width: auto;
  border-radius: 8px;
}
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-btn {
  position: relative;
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-btn.active {
  color: var(--text);
  background: rgba(165,140,116,0.15);
  border: 1px solid rgba(165,140,116,0.3);
}
.cart-badge {
  position: absolute;
  top: 2px; right: 6px;
  min-width: 18px; height: 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.nav-cart-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.nav-cart-btn:hover { background: rgba(255,255,255,0.1); }
.btn-login {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all var(--transition);
}
.btn-login:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.btn-logout {
  padding: 8px 18px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 999px;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.25); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 60px 24px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(165,140,116,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 30%, rgba(59,130,246,0.07) 0%, transparent 60%),
    linear-gradient(180deg, #16181a 0%, #0f1011 100%);
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-title {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 1;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.hero-title .accent {
  color: var(--accent);
  -webkit-text-stroke: 1px var(--accent);
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 28px;
}
.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero-stats {
  display: flex;
  gap: 32px;
}
.hero-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stats .stat span {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}
.hero-stats .stat small {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-card-float {
  background: linear-gradient(135deg, rgba(26,34,52,0.95), rgba(17,24,39,0.95));
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 260px;
  box-shadow: var(--shadow), 0 0 60px rgba(165,140,116,0.1);
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.float-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(165,140,116,0.2);
  border: 1px solid rgba(165,140,116,0.4);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.float-img {
  font-size: 5rem;
  text-align: center;
  margin-bottom: 12px;
}
.float-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.float-info span { font-size: 0.9rem; color: var(--muted); }
.float-info strong { font-size: 1.1rem; color: var(--accent); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), #7d6550);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(165,140,116,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(165,140,116,0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,0.10); }
.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost-sm:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.btn-outline {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover { background: rgba(255,255,255,0.06); }
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,211,102,0.4);
}
.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.btn-icon.danger:hover { background: rgba(239,68,68,0.15); color: var(--red); border-color: rgba(239,68,68,0.3); }

/* ============================================================
   MAIN APP
   ============================================================ */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  min-height: 60vh;
}
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   SECTION BAR
   ============================================================ */
.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-sub { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.catalog-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
}
.search-wrap input[type="search"],
input[type="search"] {
  padding-left: 36px;
}
.filter-select {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  min-width: 150px;
}
.filter-select:focus { border-color: var(--accent); }

/* ============================================================
   INPUTS
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.93rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
textarea { resize: vertical; min-height: 72px; }
.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================================
   CATALOG GRID
   ============================================================ */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.product-card {
  background: linear-gradient(160deg, var(--surface), var(--bg2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(249,115,22,0.1);
}
.product-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.product-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-size: 3.5rem;
  border-bottom: 1px solid var(--border);
}
.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.product-code {
  font-family: monospace;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 4px;
}
.stock-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.stock-ok { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.stock-low { background: rgba(249,115,22,0.15); color: var(--accent); border: 1px solid rgba(249,115,22,0.25); }
.stock-out { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.product-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}
.product-desc {
  font-size: 0.83rem;
  color: var(--muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-prices {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-top: 4px;
}
.price-detal {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}
.price-mayor-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.price-mayor {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.product-card .btn-add {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: rgba(249,115,22,0.12);
  border: 1px solid rgba(249,115,22,0.3);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.product-card .btn-add:hover {
  background: rgba(249,115,22,0.2);
  box-shadow: 0 4px 16px rgba(249,115,22,0.2);
}
.product-card .btn-add:active { transform: scale(0.98); }
.product-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.2);
}

/* ============================================================
   LOADING / EMPTY STATES
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 0;
  color: var(--muted);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state span { font-size: 3rem; }
.empty-state p { font-size: 1rem; color: var(--text); font-weight: 600; }
.empty-state small { font-size: 0.85rem; }

/* ============================================================
   CART
   ============================================================ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.empty-cart {
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.empty-cart span { font-size: 3rem; margin-bottom: 8px; }
.empty-cart p { font-size: 1rem; font-weight: 600; color: var(--text); }
.empty-cart small { font-size: 0.85rem; margin-bottom: 16px; }
.cart-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.cart-item:hover { border-color: var(--border2); }
.cart-item-img {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface2);
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 0.95rem; }
.cart-item-code { font-size: 0.78rem; color: var(--muted); font-family: monospace; }
.cart-item-price { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.cart-item-price strong { color: var(--accent); }
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  transition: all var(--transition);
}
.qty-btn:hover { background: rgba(255,255,255,0.12); }
.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.cart-item-subtotal {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}
.cart-summary-col { position: sticky; top: 90px; }
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.summary-card h3 { font-size: 1.1rem; font-weight: 700; }
.summary-rows { display: flex; flex-direction: column; gap: 8px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row.total {
  border: none;
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 700;
  padding-top: 4px;
}
.summary-row.total strong { font-size: 1.3rem; color: var(--accent); }
.order-form { display: flex; flex-direction: column; gap: 10px; }
.info-card {
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.info-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.info-card ol {
  list-style: decimal;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.83rem;
  color: var(--muted);
}
.info-note {
  font-size: 0.78rem;
  color: #60a5fa;
  margin-top: 8px;
  font-weight: 500;
}
.cart-price-mode { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
}
.toggle-track {
  position: relative;
  width: 44px; height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  border: 1px solid var(--border2);
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
}
input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
input[type="checkbox"]:checked + .toggle-track {
  background: rgba(249,115,22,0.4);
  border-color: var(--accent);
}
input[type="checkbox"]:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}
.cart-mode-toggle { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 24px;
}
.admin-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-align: center;
}
.admin-tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.admin-tab.active { background: var(--surface2); color: var(--text); box-shadow: var(--shadow-sm); }
.admin-panel { display: none; animation: fadeIn 0.25s ease; }
.admin-panel.active { display: block; }
.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-panel-header h3 { font-size: 1.3rem; font-weight: 700; }
.admin-form-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.25s ease;
}
.admin-form-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.admin-form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- DATA TABLE ---- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.table-toolbar input { max-width: 280px; }
.badge {
  display: inline-flex;
  padding: 4px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.table-empty { text-align: center; color: var(--muted); padding: 40px; }
.table-img {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface2);
}
.table-img-placeholder {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--surface2);
  border-radius: 8px;
}
.edit-price-input {
  width: 110px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
}
.edit-price-input:focus { border-color: var(--accent); }
.margin-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.margin-pos { background: rgba(34,197,94,0.12); color: var(--green); }
.margin-neg { background: rgba(239,68,68,0.12); color: var(--red); }

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon { font-size: 2rem; }
.stat-card strong { display: block; font-size: 1.4rem; font-weight: 800; }
.stat-card small { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }

/* ---- POS LAYOUT ---- */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.pos-product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.pos-product-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pos-product-item:hover { border-color: var(--accent); background: rgba(249,115,22,0.05); }
.pos-product-item .name { font-weight: 700; font-size: 0.88rem; line-height: 1.3; }
.pos-product-item .code { font-size: 0.72rem; color: var(--muted); font-family: monospace; }
.pos-product-item .price { font-size: 0.95rem; font-weight: 800; color: var(--accent); margin-top: 4px; }

/* ============================================================
   PRINT AREA
   ============================================================ */
.print-area {
  background: #fff;
  color: #111;
  border-radius: var(--radius);
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.print-area h2, .print-area p { margin: 0; }
.print-line { display: flex; justify-content: space-between; padding: 2px 0; }
.print-divider { border-top: 1px dashed #aaa; margin: 6px 0; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: linear-gradient(160deg, var(--surface), var(--bg2));
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow), 0 0 80px rgba(249,115,22,0.1);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.modal-header { text-align: center; margin-bottom: 24px; }
.modal-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.modal-header h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.modal-header p { font-size: 0.88rem; color: var(--muted); }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.login-error {
  padding: 10px 14px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  padding: 14px 20px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  max-width: 340px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.success { border-color: rgba(34,197,94,0.4); color: var(--green); }
.toast.error { border-color: rgba(239,68,68,0.4); color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-sub { margin-top: 4px; font-size: 0.78rem; opacity: 0.7; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary-col { position: static; }
  .pos-layout { grid-template-columns: 1fr; }
  .hero-content { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
@media (max-width: 768px) {
  .hero { min-height: auto; padding: 48px 20px; }
  .hero-title { font-size: clamp(2.8rem,10vw,4rem); }
  .form-row { grid-template-columns: 1fr; }
  .admin-tabs { gap: 3px; }
  .admin-tab { font-size: 0.8rem; padding: 8px 10px; }
  .nav-links { gap: 2px; }
  .nav-btn { padding: 7px 12px; font-size: 0.85rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; gap: 8px; }
  .catalog-filters { flex-direction: column; width: 100%; }
  .section-bar { flex-direction: column; }
  .hero-stats { gap: 16px; }
  .nav-cart-btn span { display: none; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area {
    position: fixed !important;
    left: 0 !important; top: 0 !important;
    width: 58mm !important;
    max-width: 58mm !important;
    padding: 4mm !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    border-radius: 0 !important;
    font-size: 10px !important;
    color: #000 !important;
  }
  body { width: 58mm !important; }
}
