/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a3a5c;
  --primary-light: #2557a7;
  --primary-dark: #0f2540;
  --accent: #c8a84b;
  --accent-light: #e0c070;
  --danger: #c0392b;
  --success: #27ae60;
  --bg: #f0f3f8;
  --surface: #ffffff;
  --border: #d0d9e8;
  --text: #1a2535;
  --text-muted: #5a6a80;
  --shadow: 0 4px 20px rgba(26,58,92,0.10);
  --shadow-lg: 0 8px 40px rgba(26,58,92,0.18);
  --radius: 8px;
  --radius-lg: 14px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── LOGO ── */
.sidebar-logo {
  width: 110px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 8px;
  display: block;
  filter: brightness(0) invert(1);
}

.login-logo-wrap {
  margin-bottom: 28px;
}

.login-logo {
  width: 200px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 80px;
  position: relative;
  z-index: 1;
}

.login-brand .logo-mark {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  box-shadow: 0 8px 24px rgba(200,168,75,0.4);
}

.login-brand .logo-mark svg { width: 36px; height: 36px; fill: white; }

.login-brand h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.login-brand p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.65);
  max-width: 380px;
  line-height: 1.7;
}

.login-brand .tagline {
  margin-top: 48px;
  display: flex;
  gap: 32px;
}

.login-brand .stat {
  text-align: center;
}

.login-brand .stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.login-brand .stat span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-form-wrap {
  width: 460px;
  min-height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 52px;
  position: relative;
  z-index: 1;
  box-shadow: -20px 0 60px rgba(0,0,0,0.2);
}

.login-form-wrap h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-form-wrap .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(37,87,167,0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 15px;
  margin-top: 8px;
}

.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,87,167,0.3); }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #a93226; }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.login-error {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-top: 16px;
  display: none;
}

.login-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

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

.sidebar {
  width: 260px;
  background: var(--primary-dark);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-brand .brand-logo {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.sidebar-brand .brand-logo svg { width: 22px; height: 22px; fill: white; }

.sidebar-brand h2 { font-size: 1.1rem; font-weight: 700; color: white; }
.sidebar-brand span { font-size: 0.75rem; color: rgba(255,255,255,0.4); }

.sidebar-user {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.user-info strong { display: block; font-size: 0.9rem; color: white; }
.user-info span { font-size: 0.75rem; color: rgba(255,255,255,0.45); }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.3);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: var(--primary-light); color: white; }
.nav-item svg { width: 18px; height: 18px; opacity: 0.8; flex-shrink: 0; }

.sidebar-bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-title h1 { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.topbar-title p { font-size: 0.8rem; color: var(--text-muted); }

.page-content { padding: 32px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.card-body { padding: 24px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--primary);
  color: white;
  padding: 13px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child { border-radius: 0 8px 0 0; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: #f5f8ff; }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 13px 16px; vertical-align: middle; }

.code-cell {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--primary-light);
  font-size: 0.92rem;
  position: relative;
  cursor: default;
  white-space: nowrap;
}

.code-cell .code-text {
  border-bottom: 1px dashed var(--primary-light);
  display: inline-block;
  padding-bottom: 1px;
}

/* Image tooltip */
.img-tooltip {
  position: fixed;
  z-index: 9999;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  pointer-events: none;
  max-width: 240px;
}

.img-tooltip img {
  width: 220px;
  height: 180px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.img-tooltip .img-no-image {
  width: 220px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.price-cell {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.special-price-cell {
  font-weight: 700;
  color: var(--success);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-admin { background: rgba(200,168,75,0.15); color: #8a6800; }
.badge-user { background: rgba(37,87,167,0.1); color: var(--primary-light); }

/* ── FORMS IN MODAL/PANEL ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary-light);
  background: white;
}

.field input[type="file"] { padding: 8px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 20px;
  display: none;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); }

.modal-close {
  width: 32px; height: 32px;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--border); }

.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── ADMIN TABS ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 5px;
  border-radius: 10px;
  margin-bottom: 28px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── PRICE EDITOR ── */
.price-editor-table input[type="number"] {
  width: 110px;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  text-align: right;
}

.price-editor-table input[type="number"]:focus {
  border-color: var(--primary-light);
  outline: none;
}

/* ── ALERTS ── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 18px;
  display: none;
}

.alert.show { display: block; }
.alert-success { background: #eafaf0; color: var(--success); border: 1px solid #a8e6be; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2; }

/* ── SEARCH ── */
.search-box {
  position: relative;
}

.search-box input {
  padding: 9px 14px 9px 38px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  background: var(--bg);
  width: 240px;
  transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--primary-light); background: white; }

.search-box svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
}

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 26px; height: 26px; }
.stat-icon.blue { background: rgba(37,87,167,0.12); color: var(--primary-light); }
.stat-icon.gold { background: rgba(200,168,75,0.15); color: var(--accent); }
.stat-icon.green { background: rgba(39,174,96,0.12); color: var(--success); }

.stat-info strong { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-info span { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; display: block; }

/* ── IMAGE PREVIEW ── */
.img-preview-wrap {
  margin-top: 10px;
  display: none;
}

.img-preview-wrap.show { display: block; }

.img-preview-wrap img {
  max-width: 120px;
  max-height: 90px;
  object-fit: contain;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}

/* ── HAMBURGER BUTTON (mobile only) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  color: var(--primary);
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.25s;
}

/* Sidebar overlay backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}
.sidebar-backdrop.open { display: block; }

/* ── RESPONSIVE — TABLET (≤900px) ── */
@media (max-width: 900px) {
  /* Login */
  .login-brand { display: none; }
  .login-form-wrap { width: 100%; padding: 48px 40px; }

  /* Sidebar */
  .sidebar { width: 260px; transform: translateX(-100%); transition: transform 0.28s ease; z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }

  /* Hamburger */
  .hamburger { display: flex; }

  /* Topbar */
  .topbar { padding: 0 16px; gap: 12px; }
  .topbar-title h1 { font-size: 1rem; }
  .topbar-title p { display: none; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr 1fr; }

  /* Page content */
  .page-content { padding: 20px 16px; }
}

/* ── RESPONSIVE — MOBILE (≤600px) ── */
@media (max-width: 600px) {
  /* Login */
  .login-form-wrap { padding: 36px 24px; }
  .login-form-wrap h2 { font-size: 1.4rem; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr; gap: 12px; }

  /* Tables: make them scroll horizontally */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; font-size: 0.82rem; }
  thead th, tbody td { padding: 10px 12px; }

  /* Card header: stack on small screens */
  .card-header { flex-wrap: wrap; gap: 10px; }
  .card-header > div { flex-wrap: wrap; gap: 8px; }

  /* Modals: full-width, bottom-anchored feel */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }
  .modal-body { padding: 16px 20px; }
  .modal-header { padding: 16px 20px 14px; }
  .modal-footer { padding: 12px 20px 28px; }

  /* Form rows: single column */
  .form-row { grid-template-columns: 1fr; }

  /* Topbar search: smaller */
  .search-box input { width: 160px; font-size: 0.85rem; }

  /* Price editor inputs */
  .price-editor-table input[type="number"] { width: 90px; }

  /* Page content */
  .page-content { padding: 14px 12px; }

  /* Stat cards: compact */
  .stat-card { padding: 16px 18px; gap: 14px; }
  .stat-icon { width: 44px; height: 44px; }
  .stat-info strong { font-size: 1.4rem; }

  /* Buttons: stack in card header */
  .card-header { flex-direction: column; align-items: flex-start; }

  /* Hide less-important table columns on very small screens */
  .hide-mobile { display: none; }

  /* Topbar */
  .topbar { height: 56px; }
}

/* ── RESPONSIVE — VERY SMALL (≤380px) ── */
@media (max-width: 380px) {
  .login-form-wrap { padding: 28px 18px; }
  .search-box input { width: 130px; }
  table { min-width: 460px; }
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg { width: 56px; height: 56px; margin: 0 auto 16px; opacity: 0.35; display: block; }
.empty-state p { font-size: 0.95rem; }

/* ── LOADING ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── CART ── */
.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--primary);
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.cart-btn:hover { background: var(--border); }
.cart-btn svg { width: 26px; height: 26px; }
.cart-badge {
  position: absolute;
  top: -2px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.cart-badge.show { display: flex; }

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  box-shadow: -4px 0 30px rgba(26,58,92,0.18);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  z-index: 1099;
  display: none;
}
.cart-drawer-backdrop.open { display: block; }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-drawer-header h3 { font-size: 1.05rem; color: var(--primary); }
.cart-close-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text-muted);
  padding: 4px 8px; border-radius: 6px;
}
.cart-close-btn:hover { background: var(--bg); color: var(--text); }

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-item-info strong { font-size: 0.88rem; color: var(--primary); display: block; }
.cart-item-info span  { font-size: 0.78rem; color: var(--text-muted); }
.cart-item-price { font-size: 0.85rem; font-weight: 600; color: var(--primary); }

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.cart-qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--primary);
}
.cart-qty-btn:hover { background: var(--border); }
.cart-qty-val { min-width: 24px; text-align: center; font-size: 0.88rem; font-weight: 600; }
.cart-remove-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.75rem; color: var(--danger);
  padding: 2px 6px; border-radius: 4px;
  margin-left: 4px;
}
.cart-remove-btn:hover { background: #fff5f5; }

.cart-drawer-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.cart-notes-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; display: block; }
.cart-notes { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-size: 0.88rem; resize: none; height: 60px; margin-bottom: 12px; font-family: inherit; }
.cart-notes:focus { outline: none; border-color: var(--primary-light); }
.cart-actions { display: flex; gap: 10px; }
.cart-empty-msg { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 0.92rem; }

/* Add-to-cart button in table */
.add-cart-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.add-cart-btn:hover { background: var(--primary-light); transform: scale(1.1); }
.add-cart-btn.added { background: var(--success); }

/* ── ORDER STATUS BADGES ── */
.badge-pending   { background: rgba(200,168,75,0.18); color: #7a5e00;  border: 1px solid rgba(200,168,75,0.45); }
.badge-confirmed { background: rgba(39,174,96,0.15);  color: #1a7a45;  border: 1px solid rgba(39,174,96,0.40); }
.badge-cancelled { background: rgba(150,150,150,0.15); color: #555;    border: 1px solid rgba(150,150,150,0.40); }

/* Special price currency select in price editor */
.sp-cur-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 4px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  width: 46px;
}

/* Orders table */
.orders-table .status-col { white-space: nowrap; }
.order-items-preview { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Order edit modal items */
.order-edit-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.order-edit-item:last-child { border-bottom: none; }
.order-edit-qty { width: 70px; border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; text-align: center; font-size: 0.88rem; }

@media (max-width: 600px) {
  .cart-drawer { width: 100vw; }
}
