@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,400&display=swap');

:root {
  --olive: #051E7C;
  --olive-light: #12B90A;
  --olive-dark: #031352;
  --black: #0A1030;
  --off-white: #F5F8FD;
  --sand: #DFE6F5;
  --warm-mid: #BBC9EA;
  --accent: #051E7C;
  --text-muted: #5A6480;
  --text-dark: #2D2D2D;
  --sidebar-w: 240px;
  --danger: #c0392b;
  --success: #27ae60;
}

/* CLIENTS TAB PANELS */
.clients-tab-panel { display: none; }
.clients-tab-panel.active { display: block; }
.clients-tab-btn { transition: all 0.2s ease; }
.clients-tab-btn:hover { background: rgba(0,0,0,0.02); }
.clients-tab-btn.active { border-bottom-color: var(--olive) !important; color: var(--text-dark) !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #F0EDE8; color: var(--black); min-height: 100vh; }

/* LOGIN */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
}

.login-box {
  background: var(--off-white);
  padding: 3rem 2.5rem;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-logo { height: 90px; display: block; margin: 0 auto 0.5rem; }

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  color: var(--black);
}

.login-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -0.75rem;
}

.form-field { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input {
  border: 1px solid var(--sand);
  background: var(--white, #fff);
  padding: 0.75rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--black);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--olive); }

.login-error {
  font-size: 0.78rem;
  color: var(--danger);
  text-align: center;
  min-height: 1.2em;
}

.btn-login {
  background: var(--olive);
  color: #fff;
  border: none;
  padding: 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-login:hover { background: var(--olive-light); }

/* ADMIN LAYOUT */
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--black);
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 1.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo img {
  height: 52px;
  background: #fff;
  padding: 5px 10px;
  border-radius: 8px;
}

.sidebar-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 1.5rem 1.5rem 0.5rem;
}

.sidebar-nav { list-style: none; padding: 0.25rem 0; }

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: #fff;
  background: rgba(255,255,255,0.05);
  border-left-color: var(--olive-light);
}

.sidebar-nav li a svg { flex-shrink: 0; opacity: 0.7; }

.sidebar-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  padding: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.7);
}

/* MAIN CONTENT */
.admin-main { overflow-x: hidden; }

.admin-topbar {
  background: var(--off-white);
  border-bottom: 1px solid var(--sand);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
}

.admin-content { padding: 2rem; }

/* STATS ROW */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--off-white);
  padding: 1.5rem;
  border-left: 3px solid var(--olive);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 600;
}

/* PANEL */
.panel {
  background: var(--off-white);
  margin-bottom: 1.5rem;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-body { padding: 1.5rem; }

/* FORM LAYOUT */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-field-full { grid-column: 1 / -1; }

.form-textarea {
  border: 1px solid var(--sand);
  background: #fff;
  padding: 0.75rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--black);
  outline: none;
  resize: vertical;
  min-height: 90px;
  width: 100%;
  transition: border-color 0.2s;
}

.form-textarea:focus { border-color: var(--olive); }

.form-select {
  border: 1px solid var(--sand);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.9rem center;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--black);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  transition: border-color 0.2s;
}

.form-select:focus { border-color: var(--olive); }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.btn-save {
  background: var(--olive);
  color: #fff;
  border: none;
  padding: 0.8rem 1.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover { background: var(--olive-light); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.8rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-outline {
  background: transparent;
  color: var(--black);
  border: 1px solid var(--sand);
  padding: 0.8rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* PRODUCT TABLE */
.products-table { width: 100%; border-collapse: collapse; }

.products-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--sand);
}

.products-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--sand);
  font-size: 0.85rem;
  vertical-align: middle;
}

.products-table tr:last-child td { border-bottom: none; }

.products-table tr:hover td { background: rgba(0,0,0,0.02); }

.table-img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-mid);
}

.table-tag {
  display: inline-block;
  background: var(--sand);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  color: var(--text-muted);
}

.table-tag.new { background: var(--olive); color: #fff; }
.table-tag.sale { background: var(--accent); color: #fff; }

.table-actions { display: flex; gap: 0.5rem; }

.btn-table {
  background: transparent;
  border: 1px solid var(--sand);
  padding: 0.35rem 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-table:hover { border-color: var(--black); }
.btn-table.delete:hover { border-color: var(--danger); color: var(--danger); }

/* IMAGE UPLOAD */
.image-upload-area {
  border: 2px dashed var(--sand);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: rgba(0,0,0,0.02);
}

.image-upload-area:hover,
.image-upload-area.dragging { border-color: var(--olive); }

.image-upload-area p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.image-upload-area small {
  font-size: 0.7rem;
  color: var(--warm-mid);
}

.image-preview {
  display: none;
  margin-top: 1rem;
  position: relative;
}

.image-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: var(--sand);
}

.image-preview .remove-image {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--black);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SIZES BUILDER */
.size-preset-btn {
  border: 1px solid var(--sand);
  background: #fff;
  padding: 0.35rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  color: var(--black);
}

.size-preset-btn:hover {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

.size-row {
  border-radius: 0;
}

#sizes-list {
  max-height: 220px;
  overflow-y: auto;
}

/* PAYFAST SETTINGS */
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* TOAST */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--black);
  color: #fff;
  padding: 0.85rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 1000;
  min-width: 240px;
}

.admin-toast.show { opacity: 1; }
.admin-toast.success { border-left: 3px solid var(--success); }
.admin-toast.error { border-left: 3px solid var(--danger); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* PAGE SECTIONS */
.page-section { display: none; }
.page-section.active { display: block; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* =============================================
   ADDITIONAL ADMIN STYLES
   ============================================= */

/* CHAR COUNT */
.char-count {
  float: right;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--warm-mid);
  letter-spacing: 0;
  text-transform: none;
}
.char-count.warn { color: #e67e22; }
.char-count.over { color: var(--danger); }

/* FORM HINT */
.form-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
  line-height: 1.5;
}

/* MULTI TAG SELECT */
.multi-tag-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--sand);
  background: #fff;
  min-height: 44px;
  cursor: pointer;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  color: #fff;
  user-select: none;
  opacity: 0.45;
}
.tag-chip.selected { opacity: 1; border-color: rgba(0,0,0,0.2); }
.tag-chip .chip-x { font-size: 0.8rem; line-height: 1; opacity: 0.7; }

/* MULTI IMAGE GRID */
.multi-image-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}
.img-slot {
  aspect-ratio: 3/4;
  border: 2px dashed var(--sand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,0.02);
  transition: border-color 0.2s;
}
.img-slot:hover { border-color: var(--olive); }
.img-slot.has-image { border-style: solid; border-color: var(--sand); }
.img-slot.is-cover { border-color: var(--olive); }
.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-slot-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-mid);
  margin-top: 0.4rem;
}
.img-slot.is-cover .img-slot-label { color: var(--olive); }
.img-slot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.img-slot:hover .img-slot-remove { opacity: 1; }
.cover-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--olive);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.2rem;
}

/* TAG MANAGE LIST */
.tag-manage-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
}
.tag-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--off-white);
  border: 1px solid var(--sand);
  font-size: 0.82rem;
}
.tag-manage-item .tag-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tag-manage-item .item-label {
  flex: 1;
  padding: 0 0.6rem;
  font-weight: 500;
}
.tag-manage-item .item-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
}
.tag-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 0.2rem;
  transition: color 0.15s;
  line-height: 1;
}
.tag-delete-btn:hover { color: var(--danger); }

/* ── ADMIN SELECT ARROW ─────────────────────── */
.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6560' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-color: #fff !important;
  padding-right: 2.5rem !important;
}

/* ── DRAG-AND-DROP IMAGE GRID ───────────────── */
.multi-image-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  user-select: none;
}
.img-slot {
  aspect-ratio: 3/4;
  border: 2px dashed var(--sand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,0.02);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.img-slot:hover { border-color: var(--olive); }
.img-slot.has-image { border-style: solid; border-color: var(--sand); cursor: grab; }
.img-slot.has-image:active { cursor: grabbing; }
.img-slot.is-cover { border-color: var(--olive) !important; }
.img-slot.drag-over { border-color: var(--olive) !important; background: rgba(74,92,47,0.06); transform: scale(1.02); }
.img-slot.dragging { opacity: 0.35; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.img-slot img { width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.img-slot-label { font-size:0.6rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--warm-mid); margin-top:0.4rem; }
.img-slot.is-cover .img-slot-label { color:var(--olive); }
.img-slot-remove { position:absolute; top:4px; right:4px; background:rgba(0,0,0,0.7); color:#fff; border:none; width:22px; height:22px; font-size:0.9rem; cursor:pointer; display:flex; align-items:center; justify-content:center; border-radius:2px; opacity:0; transition:opacity 0.15s; z-index:2; }
.img-slot:hover .img-slot-remove { opacity:1; }
.cover-badge { position:absolute; bottom:0; left:0; right:0; background:var(--olive); color:#fff; font-size:0.55rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; text-align:center; padding:0.2rem; }
.drag-handle { position:absolute; top:4px; left:4px; color:rgba(255,255,255,0.8); cursor:grab; opacity:0; transition:opacity 0.15s; z-index:2; background:rgba(0,0,0,0.4); padding:2px; border-radius:2px; }
.img-slot:hover .drag-handle { opacity:1; }

/* ── PAYFAST INFO BOX ────────────────────────── */
.pf-info-box {
  background: #F5F8FD;
  border: 1px solid var(--sand);
  border-left: 4px solid var(--olive);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
}
.pf-info-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--olive-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.pf-steps {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.9;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.pf-steps li { margin-bottom: 0.1rem; }
.pf-steps a { color: var(--olive); }
.pf-steps code { background: var(--sand); padding: 0.1rem 0.35rem; font-size: 0.75rem; }
.pf-steps strong { color: var(--black); }
.pf-url-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.pf-url-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
  border: 1px solid var(--sand);
  background: #fff;
}
.pf-url-chip code { font-size: 0.72rem; color: var(--text-muted); }
.pf-url-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
}
.pf-url-chip.live .pf-url-label   { background: var(--olive);  color: #fff; }
.pf-url-chip.sandbox .pf-url-label { background: #e67e22; color: #fff; }
.required-star { color: var(--danger); margin-left: 2px; }

/* ── STOCK TABLE ─────────────────────────────── */
.stock-qty-input {
  width: 70px;
  border: 1px solid var(--sand);
  background: #fff;
  padding: 0.35rem 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--black);
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}
.stock-qty-input:focus { border-color: var(--olive); }
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
}
.stock-badge.in-stock    { background: rgba(74,92,47,0.12); color: var(--olive-dark); }
.stock-badge.low-stock   { background: rgba(230,126,34,0.12); color: #b7590d; }
.stock-badge.out-of-stock { background: rgba(192,57,43,0.1); color: #c0392b; }
.stock-badge.backorder   { background: rgba(52,152,219,0.12); color: #1a6fa0; }
.stock-badge.untracked   { background: var(--sand); color: var(--text-muted); }

/* ── STATS GRID 4-col ────────────────────────── */
.stats-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }

/* ── BULK EDIT ──────────────────────────────── */
.bulk-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.bulk-action-card {
  border: 1px solid var(--sand);
  padding: 1.1rem 1.25rem;
  background: #faf9f6;
}
.bulk-action-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.bulk-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s;
  user-select: none;
}
.bulk-tag-chip.selected { opacity: 1; outline: 2px solid rgba(0,0,0,0.25); outline-offset: 1px; }

/* Bulk product table checkbox column */
.bulk-check {
  accent-color: var(--olive);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
tr.bulk-row-selected td { background: rgba(74,92,47,0.04); }

/* ── SUBCATEGORY INDENT ─────────────────────── */
.subcat-item { padding-left: 1.5rem !important; font-size: 0.8rem; }
.subcat-item .tag-swatch { background: var(--warm-mid) !important; width: 8px !important; height: 8px !important; }
.subcat-parent-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

@media (max-width: 700px) {
  .bulk-actions-grid { grid-template-columns: 1fr; }
}

/* ── ORDERS ──────────────────────────────────── */
.order-filter-btn {
  background: transparent;
  border: 1px solid var(--sand);
  padding: 0.4rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}
.order-filter-btn:hover,
.order-filter-btn.active { background: var(--black); color: #fff; border-color: var(--black); }

.order-status-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
}
.order-status-badge.pending      { background: #fef3cd; color: #856404; }
.order-status-badge.pending_eft  { background: #fff3cd; color: #b8860b; border: 1px solid #e8a020; }
.order-status-badge.confirmed    { background: #d1ecf1; color: #0c5460; }
.order-status-badge.shipped      { background: #cce5ff; color: #004085; }
.order-status-badge.completed    { background: #d4edda; color: #155724; }
.order-status-badge.cancelled    { background: #f8d7da; color: #721c24; }
.order-status-badge.on_hold      { background: #e2e3e5; color: #383d41; }
.order-status-badge.processing   { background: #e8f5e9; color: #051E7C; }
.order-status-badge.refunded     { background: #fce4ec; color: #880e4f; }

/* ORDER MODAL SECTIONS */
.order-modal-section { margin-bottom: 1.5rem; }
.order-modal-section h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--sand);
}
.order-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.order-info-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.2rem; }
.order-info-value { font-size: 0.85rem; color: var(--black); }

.email-compose-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.email-compose-area input,
.email-compose-area textarea {
  border: 1px solid var(--sand);
  background: #fff;
  padding: 0.65rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--black);
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.email-compose-area input:focus,
.email-compose-area textarea:focus { border-color: var(--olive); }
.email-compose-area textarea { min-height: 100px; resize: vertical; }

.order-action-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-status {
  border: none;
  padding: 0.6rem 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-status.confirm   { background: #d1ecf1; color: #0c5460; }
.btn-status.ship      { background: #cce5ff; color: #004085; }
.btn-status.complete  { background: #d4edda; color: #155724; }
.btn-status.cancel    { background: #f8d7da; color: #721c24; }
.btn-status:hover     { filter: brightness(0.9); }

/* ── BULK EDIT TABS ───────────────────────────── */
.bulk-action-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border: 1px solid var(--sand);
  border-bottom: none;
}
.bulk-tab-btn {
  flex: 1;
  background: var(--sand);
  border: none;
  border-right: 1px solid rgba(0,0,0,0.08);
  padding: 0.7rem 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s;
}
.bulk-tab-btn:last-child { border-right: none; }
.bulk-tab-btn.active { background: var(--off-white); color: var(--black); }
.bulk-tab-btn:hover:not(.active) { background: #e4ddd0; }

.bulk-panel { display: none; border: 1px solid var(--sand); padding: 1.25rem; background: var(--off-white); }
.bulk-panel.active { display: block; }
.bulk-panel-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.bulk-panel-row .form-select,
.bulk-panel-row .form-input { margin-bottom: 0; }

/* Stats grid 5-col */
.stats-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }

/* ── NOTIFICATIONS ───────────────────────────── */
.notif-info-box {
  background: rgba(74,92,47,0.07);
  border-left: 3px solid var(--olive);
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.notif-info-box svg { flex-shrink: 0; margin-top: 2px; color: var(--olive); }
.notif-info-box strong { color: var(--black); }

.notif-trigger-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--sand); }

.notif-trigger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sand);
  gap: 1rem;
  background: #fff;
  transition: background 0.15s;
}
.notif-trigger-item:last-child { border-bottom: none; }
.notif-trigger-item:hover { background: #faf9f6; }

.notif-trigger-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}
.notif-trigger-right { flex-shrink: 0; }

.notif-trigger-info { display: flex; flex-direction: column; gap: 0.15rem; }
.notif-trigger-title { font-size: 0.85rem; font-weight: 600; color: var(--black); }
.notif-trigger-desc  { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

.notif-priority-sel {
  font-size: 0.72rem !important;
  padding: 0.35rem 2rem 0.35rem 0.5rem !important;
  min-width: 130px;
}

/* TOGGLE SWITCH */
.notif-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.notif-check { opacity: 0; width: 0; height: 0; position: absolute; }
.notif-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--sand);
  border-radius: 22px;
  transition: background 0.2s;
  cursor: pointer;
}
.notif-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.notif-check:checked + .notif-toggle-slider { background: var(--olive); }
.notif-check:checked + .notif-toggle-slider::before { transform: translateX(18px); }

/* NOTIFICATION LOG */
.notif-log {
  border: 1px solid var(--sand);
  background: #fafaf8;
  min-height: 80px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.notif-log-empty {
  padding: 1.5rem;
  text-align: center;
  font-style: italic;
  color: var(--warm-mid);
}
.notif-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--sand);
  line-height: 1.5;
}
.notif-log-entry:last-child { border-bottom: none; }
.notif-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.notif-log-dot.order   { background: #2980b9; }
.notif-log-dot.status  { background: var(--olive); }
.notif-log-dot.stock   { background: #e67e22; }
.notif-log-dot.oos     { background: var(--danger); }
.notif-log-time { color: var(--warm-mid); white-space: nowrap; font-size: 0.68rem; margin-left: auto; padding-left: 0.5rem; }

/* Completed order — lock status buttons */
.status-btn-locked {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}
.completed-lock-msg {
  font-size: 0.75rem;
  color: var(--success, #27ae60);
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── SMTP INFO BOX ────────────────────────────── */
.smtp-info-box {
  background: #f0f4ff;
  border-left: 3px solid #2980b9;
  padding: 0.9rem 1rem;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.smtp-info-box svg  { flex-shrink:0; margin-top:2px; color:#2980b9; }
.smtp-info-box strong { color: var(--black); }
.smtp-info-box code { background: var(--sand); padding: 0.1rem 0.35rem; font-size: 0.75rem; }
.smtp-info-box a    { color: #2980b9; }

/* ── PRINT STYLES ─────────────────────────────── */
.print-btn {
  background: transparent;
  border: 1px solid var(--sand);
  padding: 0.55rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--black);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}
.print-btn:hover { border-color: var(--black); background: var(--black); color: #fff; }

/* EMAIL LOG IN ORDER MODAL */
.order-email-log {
  border: 1px solid var(--sand);
  background: #fafaf8;
  max-height: 180px;
  overflow-y: auto;
}
.order-email-log-empty {
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--warm-mid);
  font-style: italic;
  text-align: center;
}
.order-email-log-entry {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--sand);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.order-email-log-entry:last-child { border-bottom: none; }
.oel-subject { font-size: 0.8rem; font-weight: 600; color: var(--black); }
.oel-meta    { font-size: 0.68rem; color: var(--text-muted); display: flex; gap: 0.75rem; }

/* STOCK TRACKING TOGGLE DIMMING */
.stock-fields-hidden { opacity: 0.4; pointer-events: none; }

/* PRINT PAGE */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area {
    position: fixed;
    inset: 0;
    background: #fff;
    padding: 2cm;
    font-family: 'Inter', sans-serif;
    font-size: 10pt;
    color: #000;
  }
}

/* ── SETTINGS TABS ──────────────────────────────── */
.settings-tabs-bar {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border: 1px solid var(--sand);
  border-bottom: none;
  background: var(--sand);
}
.settings-tab-btn {
  flex: 1;
  background: var(--sand);
  border: none;
  border-right: 1px solid rgba(0,0,0,0.08);
  padding: 0.8rem 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s;
}
.settings-tab-btn:last-child { border-right: none; }
.settings-tab-btn.active { background: var(--off-white); color: var(--black); border-bottom: 2px solid var(--olive); }
.settings-tab-btn:hover:not(.active) { background: #ddd8cc; color: var(--black); }

.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }

/* ── SHIPPING OPTIONS LIST (inline-editable) ─────── */
.shipping-option-item {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  background: var(--off-white);
  border: 1px solid var(--sand);
  gap: 0.75rem;
}
.shipping-option-item.is-default { border-left: 3px solid var(--olive); background: #fbfaf6; }

.default-toggle-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.3rem;
}
.default-toggle-wrap input { opacity: 0; position: absolute; width: 1px; height: 1px; }
.default-toggle-slider {
  width: 34px;
  height: 18px;
  background: var(--sand);
  border-radius: 10px;
  position: relative;
  transition: background 0.15s;
}
.default-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.default-toggle-wrap input:checked + .default-toggle-slider { background: var(--olive); }
.default-toggle-wrap input:checked + .default-toggle-slider::after { transform: translateX(16px); }
.default-toggle-wrap::after {
  content: 'Default';
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.shipping-option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.shipping-option-main .ship-edit-name {
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--black);
  padding: 0.15rem 0;
  width: 100%;
  transition: border-color 0.15s;
}
.shipping-option-main .ship-edit-name:hover,
.shipping-option-main .ship-edit-name:focus { border-bottom-color: var(--sand); outline: none; }

.shipping-option-edit-row { display: flex; gap: 0.6rem; }
.shipping-option-edit-row input {
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.1rem 0;
  flex: 1;
  min-width: 0;
  transition: border-color 0.15s;
}
.shipping-option-edit-row input:hover,
.shipping-option-edit-row input:focus { border-bottom-color: var(--sand); outline: none; }

.shipping-option-rate-wrap {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.shipping-option-rate-wrap:hover,
.shipping-option-rate-wrap:focus-within { border-bottom-color: var(--sand); }
.shipping-rate-prefix { font-size: 0.85rem; color: var(--text-muted); }
.ship-edit-rate {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--olive-dark);
  width: 70px;
  padding: 0.15rem 0;
}
.ship-edit-rate:focus { outline: none; }

.default-badge {
  display: inline-block;
  background: var(--olive);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
}

/* ── PRODUCT FORM: SHIPPING OVERRIDE CHIPS ───────── */
.shipping-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--sand);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin: 0.2rem 0.3rem 0.2rem 0;
}
.shipping-chip:hover { border-color: var(--olive); }
.shipping-chip.selected { background: var(--olive); border-color: var(--olive); color: #fff; }
.shipping-chip.is-default-chip:not(.selected) { border-style: dashed; }
.shipping-chip small { opacity: 0.75; font-size: 0.68rem; }

/* ── SAVE CONFIRMATION FLASH ──────────────────────── */
.btn-save-flash {
  background: var(--success, #2e7d32) !important;
  transition: background 0.2s;
}


/* ── Category tree admin ─────────────────────── */
.cat-admin-tree { list-style:none; padding:0; margin:0; }
.cat-admin-item { border:1px solid var(--border); border-radius:4px; margin-bottom:4px; background:var(--surface); }
.cat-admin-item.dragging  { opacity:0.4; }
.cat-admin-item.drag-over { box-shadow:0 0 0 2px var(--olive); }
.cat-admin-row { display:flex; align-items:center; gap:0.5rem; padding:0.55rem 0.75rem; }
.cat-admin-drag { cursor:grab; color:var(--text-muted); font-size:0.9rem; flex-shrink:0; user-select:none; padding:2px 4px; }
.cat-admin-drag:active { cursor:grabbing; }
.cat-admin-expand { cursor:pointer; font-size:0.6rem; color:var(--text-muted); width:16px; flex-shrink:0; text-align:center; transition:color 0.15s; }
.cat-admin-expand:hover { color:var(--olive); }
.cat-admin-expand-hidden { visibility:hidden; }
.cat-admin-name { flex:1; font-size:0.85rem; font-weight:500; cursor:pointer; padding:2px 4px; border-radius:3px; transition:background 0.15s; }
.cat-admin-name:hover { background:var(--hover-bg); color:var(--olive); }
.cat-admin-count { font-size:0.7rem; color:var(--text-muted); background:var(--bg); padding:1px 7px; border-radius:10px; flex-shrink:0; }
.cat-admin-btn { background:none; border:none; cursor:pointer; font-size:1rem; line-height:1; color:var(--text-muted); padding:2px 6px; border-radius:3px; transition:background 0.15s, color 0.15s; flex-shrink:0; }
.cat-admin-delete:hover { background:#fde8e8; color:#c0392b; }
.cat-admin-subs { display:none; list-style:none; padding:0 0 4px 2.2rem; margin:0; border-top:1px solid var(--border); }
.cat-admin-subs.open { display:block; }
.cat-admin-sub-item { display:flex; align-items:center; gap:0.5rem; padding:0.4rem 0.5rem; border-radius:3px; margin-bottom:2px; transition:background 0.12s; }
.cat-admin-sub-item:hover { background:var(--hover-bg); }
.cat-admin-sub-item.dragging  { opacity:0.4; }
.cat-admin-sub-item.drag-over { box-shadow:0 0 0 2px var(--olive-light); }
.cat-admin-sub-arrow { font-size:0.75rem; color:var(--text-muted); flex-shrink:0; }
.cat-rename-input { flex:1; border:1.5px solid var(--olive); background:#fff; padding:2px 6px; font-family:inherit; font-size:0.85rem; font-weight:500; border-radius:3px; outline:none; min-width:80px; }
