/* ===========================================
   Saran Electronics — Admin Dashboard CSS
   =========================================== */

:root {
  --brand: #4C12A1;
  --brand-dark: #3A0E7A;
  --brand-light: #6B2CC9;
  --accent: #00D4C7;
  --warn: #FFD200;
  --danger: #E2231A;
  --success: #1A8754;
  --info: #0DCAF0;

  --text: #1B1B1B;
  --muted: #6C757D;
  --border: #E5E7EB;
  --bg: #F4F6FA;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1A1B2E;
  --bg-sidebar-hover: #252748;
  --text-sidebar: #C5C7DB;

  --bg-soft: #ECEEF2;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --radius: 8px;
}

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

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans Mongolian', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============ LAYOUT ============ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #2A2C46;
}
.sidebar-brand img {
  height: 38px;
  width: auto;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.sidebar-section-title {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6E7095;
  padding: 14px 18px 6px;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--bg-sidebar-hover);
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar-link .ico { font-size: 18px; width: 22px; text-align: center; }
.sidebar-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid #2A2C46;
  font-size: 12px;
  color: #6E7095;
}

/* ============ TOP BAR ============ */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
}
.sidebar-backdrop.show { display: block; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 999px;
  width: 380px;
  max-width: 50vw;
}
.topbar-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--muted);
  position: relative;
  cursor: pointer;
}
.topbar-icon:hover { background: var(--bg); }
.topbar-icon .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.topbar-user:hover { background: var(--bg); }
.topbar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.topbar-user .name { font-weight: 600; font-size: 13px; }
.topbar-user .role { font-size: 11px; color: var(--muted); }

/* ============ PAGE CONTENT ============ */
.page {
  padding: 24px 32px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 24px;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.page-subtitle {
  color: var(--muted);
  font-size: 14px;
}
.breadcrumb-admin {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
}
.card-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ============ KPI GRID ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi-card .ico-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 12px;
}
.kpi-card.brand .ico-wrap { background: rgba(76,18,161,.1); color: var(--brand); }
.kpi-card.success .ico-wrap { background: rgba(26,135,84,.1); color: var(--success); }
.kpi-card.info .ico-wrap { background: rgba(13,202,240,.1); color: var(--info); }
.kpi-card.warn .ico-wrap { background: rgba(255,210,0,.18); color: #B89400; }
.kpi-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
}
.kpi-trend {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 600;
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ============ GRID HELPERS ============ */
.row-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.row-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ============ TABLE ============ */
.table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.table-toolbar .left {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}
.input,
.select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  outline: none;
}
.input:focus,
.select:focus { border-color: var(--brand); }
.input.full { width: 100%; }
.input.sm { padding: 6px 10px; font-size: 13px; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th,
.table td {
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th {
  background: var(--bg);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.table tbody tr:hover { background: rgba(76,18,161,.03); }
.table .num { text-align: right; }
.table .actions {
  display: flex;
  gap: 6px;
}
.table-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.table-empty .big { font-size: 60px; margin-bottom: 8px; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.pagination .pages {
  display: flex;
  gap: 4px;
}
.pagination .pg-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  color: var(--text);
}
.pagination .pg-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.pagination .pg-btn:hover:not(.active) { background: var(--bg); }

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.success { background: rgba(26,135,84,.12); color: var(--success); }
.badge.warn { background: rgba(255,193,7,.18); color: #997404; }
.badge.danger { background: rgba(226,35,26,.12); color: var(--danger); }
.badge.info { background: rgba(13,202,240,.15); color: #0989a8; }
.badge.brand { background: rgba(76,18,161,.12); color: var(--brand); }
.badge.muted { background: var(--bg); color: var(--muted); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #146443; color: #fff; }
.btn-warn { background: var(--warn); color: #000; }
.btn-warn:hover { background: #FFE14D; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B81C14; color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-icon:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-icon.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ============ FORM ============ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--brand); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-help { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.modal.lg { max-width: 800px; }
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============ CHARTS ============ */
.chart-wrap {
  position: relative;
  height: 300px;
}
.chart-wrap.sm { height: 200px; }
.chart-wrap.lg { height: 360px; }

/* ============ AVATAR / USER ROW ============ */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-cell .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.user-cell .name { font-weight: 600; }
.user-cell .meta { font-size: 12px; color: var(--muted); }

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-cell .img {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

/* ============ LOGIN ============ */
body.login-page { margin: 0; background: #f4f5fb; }

.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left */
.login-left {
  background: linear-gradient(145deg, #4C12A1 0%, #6c2bd9 60%, #0092d5 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}
.login-logo { width: 200px; height: auto; position: relative; z-index: 1; }
.login-tagline {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.deco-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.deco-circle.c1 { width: 320px; height: 320px; bottom: -80px; left: -80px; }
.deco-circle.c2 { width: 180px; height: 180px; top: -40px; right: -40px; }

/* Right */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: #fff;
}
.login-form-wrap { width: 100%; max-width: 340px; }
.login-form-wrap h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.login-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,212,199,.08);
  border: 1px solid rgba(0,212,199,.25);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #0a7873;
  margin-bottom: 20px;
}
.login-hint code { background: rgba(0,0,0,.06); border-radius: 4px; padding: 1px 5px; }

.lf-group { margin-bottom: 14px; }
.lf-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.lf-group input {
  width: 100%; box-sizing: border-box;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.lf-group input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(76,18,161,.1); }

.lf-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; font-size: 13px; }
.lf-check { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }

.lf-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #4C12A1, #6c2bd9);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.lf-btn:hover { opacity: .92; transform: translateY(-1px); }
.lf-btn:active { transform: none; }

.login-back {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}
.login-back:hover { color: var(--brand); }

@media (max-width: 700px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { min-height: 160px; padding: 32px 24px; }
  .login-logo { width: 150px; }
}

/* ============ PAGE BUILDER — BG ============ */
.bg-mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.bg-mode-btn {
  flex: 1;
  padding: 7px 0;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
}
.bg-mode-btn.active {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(76,18,161,.06);
}
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s, background .2s;
}
.upload-area.drag-over {
  border-color: var(--brand);
  background: rgba(76,18,161,.04);
}
.upload-area #upload-prompt:hover { background: var(--bg-soft); }

/* ============ SETTINGS ============ */
.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.settings-tab {
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
}
.settings-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.settings-tab:hover:not(.active) { color: var(--text); }
.settings-section { display: none; }
.settings-section.active { display: block; }

/* ============ SPEC EDITOR ============ */
.spec-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spec-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 8px;
  align-items: center;
}
.spec-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.spec-row input:focus { border-color: var(--brand); }
.spec-row .btn-icon {
  width: 36px;
  height: 36px;
}
.spec-empty {
  text-align: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* ============ IMAGE PREVIEW ============ */
.img-preview {
  width: 100%;
  height: 140px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 60px;
  color: var(--muted);
  overflow: hidden;
  margin-bottom: 8px;
}
.img-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============ STOCK BADGE ============ */
.stock-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.stock-num { font-weight: 700; }
.stock-bar {
  width: 60px;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.stock-bar > span {
  display: block;
  height: 100%;
  background: var(--success);
}
.stock-bar.warn > span { background: var(--warn); }
.stock-bar.danger > span { background: var(--danger); }

/* ============ BULK BAR ============ */
.bulk-bar {
  display: none;
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bulk-bar.show { display: flex; }
.bulk-bar .count { font-weight: 700; }
.bulk-bar .actions { display: flex; gap: 8px; }
.bulk-bar .btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.bulk-bar .btn-outline:hover {
  background: rgba(255,255,255,.15);
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all .25s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--brand); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: -260px;
    width: 240px; height: 100vh;
    transition: left .25s ease;
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0,0,0,.18);
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2, .row-3, .row-1-1 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-search { width: 200px; }
  .topbar-user .name, .topbar-user .role { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .form-grid { grid-templ
/* ===== Gift Group Admin Editor ===== */
.gift-group-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-soft);
  position: relative;
}
.gift-group-card .gift-group-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.gift-group-card .gift-group-head input[type=text] {
  flex: 1; font-size: 14px;
}
/* Gift picker */
.gift-selected-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 24px; margin: 8px 0 6px;
}
.gift-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand); color: #fff;
  border-radius: 20px; padding: 3px 10px 3px 8px;
  font-size: 12px; font-weight: 500;
}
.gift-tag button {
  background: none; border: none; color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
  padding: 0 0 0 2px; opacity: .75;
}
.gift-tag button:hover { opacity: 1; }
.gift-search-wrap {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; overflow: hidden;
}
.gift-search-wrap:focus-within { border-color: var(--brand); }
.gift-search-input {
  flex: 1; padding: 12px 16px; font-size: 15px;
  border: none; outline: none; background: transparent;
  color: var(--text);
}
.gift-search-input::placeholder { color: #aaa; }
.gift-search-btn {
  padding: 0 16px; border: none; background: none;
  color: #e07b00; font-size: 18px; cursor: pointer;
  border-left: 1px solid var(--border); height: 46px;
  display: flex; align-items: center;
}
.gift-dropdown {
  display: none;
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 6px 6px;
  background: #fff;
  max-height: 220px; overflow-y: auto;
  margin-top: -1px;
}
.gift-dropdown.open { display: block; }
.gift-dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.gift-dropdown-item:last-child { border-bottom: none; }
.gift-dropdown-item:hover { background: var(--bg-soft); }
.gift-dropdown-item.selected { background: #4a90d9; color: #fff; }
.gift-dropdown-item.selected .gift-item-sku,
.gift-dropdown-item.selected .gift-item-price,
.gift-dropdown-item.selected .gift-item-stock { color: rgba(255,255,255,.8) !important; }
.gift-item-icon {
  width: 40px; height: 40px; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gift-item-icon img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; }
.gift-item-info { flex: 1; min-width: 0; }
.gift-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift-item-sku  { font-size: 11px; color: var(--muted); }
.gift-item-price { font-size: 12px; font-weight: 600; white-space: nowrap; }
.gift-item-stock { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gift-group-options {
  display: flex; gap: 14px; margin-top: 8px;
  align-items: center; flex-wrap: wrap;
}
.gift-group-options label {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
  font-weight: normal;
}
