/* ==========================================================================
   SyncEight Dashboard — base styles
   Brand: Synceight Blue #19298E · Sync Yellow #FEBC3D · Ink Navy #1F2732
          Sky #DCF5FF · Steel Blue #224C7C (body) · Electric Blue #0021A2 (links)
   Fonts: Josefin Sans (titles) · Jost (subheadings, buttons)
          Sora (small headings, labels) · Abel (body)
   ========================================================================== */

:root {
  --blue: #19298E;
  --blue-600: #142273;
  --yellow: #FEBC3D;
  --yellow-600: #F2AB1F;
  --ink: #1F2732;
  --ink-700: #2A3442;
  --ink-600: #3A4555;
  --sky: #DCF5FF;
  --steel: #224C7C;
  --link: #0021A2;

  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --border: #E1E6EE;
  --border-strong: #CDD5E1;
  --muted: #6B7A90;

  --success: #1D7A4F;
  --success-bg: #E3F5EC;
  --warning-bg: #FFF4DC;
  --danger: #B42318;

  --font-title: "Josefin Sans", system-ui, sans-serif;
  --font-sub: "Jost", system-ui, sans-serif;
  --font-label: "Sora", system-ui, sans-serif;
  --font-body: "Abel", system-ui, sans-serif;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(31, 39, 50, .06), 0 1px 3px rgba(31, 39, 50, .08);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--steel);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--font-title); color: var(--ink); margin: 0; font-weight: 600; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-family: var(--font-sub); font-size: 16px; font-weight: 500; }

.label, th {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sub); font-size: 15px; font-weight: 500;
  height: 40px; padding: 0 18px;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-accent { background: var(--yellow); color: var(--ink); }   /* navy on yellow — never white */
.btn-accent:hover { background: var(--yellow-600); }
.btn-ghost { background: var(--surface); color: var(--steel); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--steel); }
.btn:focus-visible, .nav-link:focus-visible, .icon-btn:focus-visible,
input:focus-visible, select:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* ---------- Form controls ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--font-label); font-size: 12px; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 14px; }

.input, .select {
  height: 40px; padding: 0 12px;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  width: 100%;
}
.input:focus, .select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(25, 41, 142, .12); }

.search { position: relative; }
.search .input { padding-right: 38px; }
.search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }

/* Segmented On/Off */
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented button {
  font-family: var(--font-sub); font-size: 14px; height: 38px; padding: 0 16px;
  border: 0; background: transparent; color: var(--steel); cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button[aria-pressed="true"] { background: var(--sky); color: var(--blue); font-weight: 500; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; transition: background .15s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: var(--shadow); }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--yellow); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .45; cursor: not-allowed; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; transition: grid-template-columns .2s; }
.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--ink); color: #C9D2DF;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: #fff; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px; background: var(--yellow); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-title); font-weight: 700; font-size: 18px; padding-top: 3px;
}
.brand-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; }
.brand-wordmark { height: 20px; width: auto; display: block; }
.login-logo { display: block; width: 146px; height: auto; }
.brand-name { font-family: var(--font-title); font-weight: 600; font-size: 19px; letter-spacing: .01em; white-space: nowrap; padding-top: 3px; }
.brand-name span { color: var(--yellow); }

.nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-section { font-family: var(--font-label); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #7D8BA0; padding: 16px 12px 6px; white-space: nowrap; }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 40px; padding: 0 12px;
  font-family: var(--font-sub); font-size: 15px; color: #C9D2DF;
  background: none; border: 0; border-radius: var(--radius);
  cursor: pointer; text-align: left; white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover { background: var(--ink-700); color: #fff; text-decoration: none; }
.nav-link svg.icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; opacity: .7; }
.nav-group.is-open > .nav-link .chev { transform: rotate(90deg); }
.nav-link.is-active { background: var(--blue); color: #fff; }
.nav-group.has-active > .nav-link { color: #fff; }
.nav-group.has-active > .nav-link svg.icon { color: var(--yellow); }

.nav-badge { margin-left: auto; font-family: var(--font-label); font-size: 10px; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; background: var(--ink-600); color: #C9D2DF; }

.subnav { display: none; padding: 2px 0 6px 32px; }
.nav-group.is-open .subnav { display: block; }
.subnav .nav-link { height: 34px; font-size: 14px; padding-left: 12px; position: relative; }
.subnav .nav-link::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: transparent; }
.subnav .nav-link.is-active { background: transparent; color: #fff; }
.subnav .nav-link.is-active::before { background: var(--yellow); }

.sidebar-foot { padding: 8px; border-top: 1px solid rgba(255, 255, 255, .06); }

/* Collapsed rail */
.app.is-collapsed .brand-name,
.app.is-collapsed .brand-wordmark,
.app.is-collapsed .nav-label,
.app.is-collapsed .nav-section,
.app.is-collapsed .chev,
.app.is-collapsed .nav-badge,
.app.is-collapsed .subnav { display: none !important; }
.app.is-collapsed .nav-link { justify-content: center; padding: 0; }
.app.is-collapsed .brand { justify-content: center; padding: 0; }
.app.is-collapsed .sidebar-foot .nav-link svg.icon { transform: rotate(180deg); }

/* ---------- Topbar ---------- */

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: flex-end;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-item {
  display: flex; align-items: center; gap: 8px;
  height: 100%; padding: 0 18px;
  border-left: 1px solid var(--border);
  font-family: var(--font-sub); font-size: 15px; color: var(--ink);
  background: none; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer;
}
.topbar-item:hover { background: var(--bg); }
.topbar-item svg { width: 18px; height: 18px; color: var(--steel); }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; border-left: 0; border-right: 1px solid var(--border); }

.store-switch { position: relative; }
.store-switch select {
  appearance: none; -webkit-appearance: none;
  height: 100%; padding: 0 40px 0 18px; min-width: 200px;
  border: 0; border-left: 1px solid var(--border); background: transparent;
  font-family: var(--font-sub); font-size: 15px; color: var(--ink); cursor: pointer;
}
.store-switch svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; color: var(--steel); }

.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sky); color: var(--blue); display: grid; place-items: center; font-family: var(--font-label); font-size: 12px; font-weight: 600; }

/* ---------- Page ---------- */

.page { padding: 28px 32px 48px; max-width: 1400px; width: 100%; }
.page:focus { outline: none; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-family: var(--font-sub); font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb svg { width: 16px; height: 16px; }
.breadcrumb a { color: var(--muted); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--steel); }
/* Settings pages: title + Save/Discard stay visible while scrolling */
.page-head--sticky { position: sticky; top: var(--topbar-h); z-index: 6; background: var(--bg); margin: -12px -4px 12px; padding: 12px 4px; }
.page-head--sticky.is-stuck { box-shadow: 0 8px 12px -12px rgba(16, 24, 40, .35); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar .select { width: 200px; }
.toolbar .search { width: 240px; }
.toolbar .spacer { flex: 1; }
.toolbar-label { font-family: var(--font-sub); font-size: 15px; color: var(--ink); }

/* ---------- Cards ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.stat { padding: 18px 20px; }
.stat .value { font-family: var(--font-title); font-size: 30px; font-weight: 600; color: var(--ink); margin-top: 8px; line-height: 1.1; }
.stat .hint { font-size: 14px; color: var(--muted); margin-top: 4px; }

.module-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.module-card .icon-wrap { width: 40px; height: 40px; border-radius: 10px; background: var(--sky); color: var(--blue); display: grid; place-items: center; }
.module-card .icon-wrap svg { width: 22px; height: 22px; }
.module-card p { margin: 0; flex: 1; }
.module-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-label); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-on { background: var(--success-bg); color: var(--success); }
.pill-off { background: #EEF1F5; color: var(--muted); }
.pill-soon { background: var(--warning-bg); color: #8A5A00; }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 14px 16px; background: #F7F9FB; border-bottom: 1px solid var(--border); white-space: nowrap; }
th.sortable { cursor: pointer; }
th.sortable svg { width: 12px; height: 12px; vertical-align: -1px; margin-left: 6px; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--ink); }

.muted { color: var(--muted); }
.item { display: flex; align-items: center; gap: 12px; }
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; }
[hidden] { display: none !important; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.notice.notice-error { background: #FDECEA; color: var(--danger); }
.safe-badge { align-self: center; margin-right: 12px; font-family: var(--font-label); font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 5px 10px; border-radius: 6px; background: var(--yellow); color: var(--ink); white-space: nowrap; }

/* ---------- Empty state ---------- */

.empty { text-align: center; padding: 64px 24px; }
.empty svg.illus { width: 180px; height: 140px; margin-bottom: 16px; }
.empty h3 { font-family: var(--font-sub); font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto; color: var(--steel); }

/* ---------- Settings rows ---------- */

.setting { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting h3 { margin-bottom: 2px; }
.setting p { margin: 0; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* ---------- Tabs (used by sub-sections) ---------- */

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--sky); color: var(--blue); font-size: 15px; margin-bottom: 16px; }
.notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }


/* ==========================================================================
   Wishlist: tabs, customers, settings
   ========================================================================== */

.small { font-size: 14px; }

/* Pill tabs (Products / Articles) */
.tabs { display: inline-flex; gap: 6px; padding: 4px; background: #E9EDF3; border-radius: 999px; }
.tabs button {
  font-family: var(--font-sub); font-size: 15px; color: var(--steel);
  height: 34px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--blue); font-weight: 500; border-color: var(--border-strong); box-shadow: var(--shadow); }
.tabs button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* Clickable stat card */
a.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat-link:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(25, 41, 142, .12); text-decoration: none; transform: translateY(-1px); }
a.stat-link .label { display: flex; align-items: center; justify-content: space-between; }
.stat-arrow { width: 16px; height: 16px; color: var(--blue); }

/* Sidebar: nested settings items */
.subnav-label { font-family: var(--font-label); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #7D8BA0; padding: 10px 12px 4px; }
.subnav .nav-link.nav-sub2 { padding-left: 24px; height: 32px; font-size: 13.5px; }
.subnav .nav-link.nav-sub2::before { left: 12px; }

/* Customers table */
.person { display: flex; flex-direction: column; line-height: 1.3; }
.person a { font-family: var(--font-sub); font-weight: 500; }

/* Settings layout */
.settings { display: flex; flex-direction: column; gap: 28px; }
.settings-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-intro h2 { font-size: 18px; margin-bottom: 6px; }
.settings-intro p { margin: 0; font-size: 15px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 6; }
.span-1 { grid-column: span 3; }
.span-third { grid-column: span 2; }
.field > span em.saved-tag { font-style: normal; font-weight: 600; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; background: var(--success-bg); color: var(--success); padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.textarea { height: auto; padding: 10px 12px; line-height: 1.4; resize: vertical; }
.field > .segmented { align-self: flex-start; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; font-family: var(--font-sub); font-size: 15px; color: var(--ink); cursor: pointer; }

.color-input { display: flex; gap: 8px; }
.color-input input[type=color] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.color-input .input { font-family: var(--font-label); font-size: 13px; text-transform: lowercase; }

.save-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.save-status { font-size: 15px; color: #8A5A00; }
.notice.notice-success { background: var(--success-bg); color: var(--success); }

/* Icon upload */
.icons-field { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 14px; background: var(--bg); border-radius: var(--radius); }
.icon-slot { display: flex; align-items: center; gap: 12px; }
.icon-box { width: 48px; height: 48px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--ink); }
.icon-box svg { width: 22px; height: 22px; }
.link-btn { font-family: var(--font-sub); font-size: 14px; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icons-field .btn { margin-left: auto; }

/* Live previews */
.preview { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.preview-stage { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.pv-img { position: relative; width: 120px; height: 120px; border-radius: var(--radius); background: linear-gradient(135deg, #C9D6E3, #9FB3C8); }
.pv-cap { position: absolute; left: 8px; bottom: 6px; font-family: var(--font-label); font-size: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ov-btn { position: absolute; top: 8px; display: flex; align-items: center; justify-content: center; }
.ov-btn svg { width: 18px; height: 18px; }
.preview-cart button { border: 0; padding: 12px 22px; font-family: inherit; cursor: default; }

/* Integration code blocks */
.code-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #F7F9FB; border-bottom: 1px solid var(--border); }
.code-head code, .tag-copy code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--ink); }
textarea.code { display: block; width: 100%; height: 200px; border: 0; padding: 12px 14px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; color: var(--ink); background: var(--surface); }
.tag-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.tag-row:first-child { padding-top: 0; }
.tag-row:last-child { border-bottom: 0; padding-bottom: 0; }
.tag-row p { margin: 2px 0 0; }
.tag-copy { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--bg); padding: 8px 8px 8px 12px; border-radius: var(--radius); }
.tag-copy code { overflow-wrap: anywhere; }
.steps { margin: 8px 0 0; padding-left: 20px; }
.steps li { margin: 4px 0; }
.card-body.stack { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1000px) {
  .settings-section { grid-template-columns: 1fr; gap: 12px; }
  .tag-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .span-2, .span-1, .span-third { grid-column: auto; }
}


/* ==========================================================================
   Image Hotspots + shared modal
   ========================================================================== */

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { border-color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; flex-shrink: 0; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* List */
.thumb-lg { width: 56px; height: 56px; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #F9FBFD; }
.row-title { font-family: var(--font-sub); font-weight: 500; font-size: 16px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--sky); color: var(--blue); }
.chip-more { background: #EEF1F5; color: var(--muted); }

/* Products */
.product-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px; padding-right: 2px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 15px; color: var(--ink); }
.pchip img, .pchip-ph { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.pchip button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 26px; height: 26px; border-radius: 50%; }
.pchip button:hover { background: var(--bg); color: var(--danger); }

/* Image cards + canvas */
.hs-image .card-head h3 { margin: 0; }
.hs-stage { min-height: 120px; position: relative; line-height: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg); cursor: crosshair; user-select: none; touch-action: none; }
.hs-stage img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hs-marker {
  position: absolute; width: 28px; height: 28px; transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid #fff; background: var(--blue); color: #fff;
  font-family: var(--font-label); font-size: 11px; font-weight: 600; line-height: 1;
  display: grid; place-items: center; cursor: grab; padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); touch-action: none;
}
.hs-marker:hover, .hs-marker.is-selected { background: var(--yellow); color: var(--ink); }
.hs-marker.is-dragging { cursor: grabbing; transform: translate(-50%, -50%) scale(1.15); }
.hs-marker:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.hs-points { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hs-points li { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: var(--radius); }
.hs-points li.is-selected { background: var(--sky); }
.hs-num { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-family: var(--font-label); font-size: 11px; font-weight: 600; flex-shrink: 0; }
.hs-points li.is-selected .hs-num { background: var(--yellow); color: var(--ink); }
.input.is-invalid { border-color: #E8A39B; background: #FFF8F7; }
.add-image { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 32px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: transparent; color: var(--blue); font-family: var(--font-sub); font-size: 16px; cursor: pointer; }
.add-image:hover { border-color: var(--blue); background: #F7F9FF; }
.add-image svg { width: 24px; height: 24px; }
.add-image small { color: var(--muted); font-size: 13px; }

/* Modal */
dialog.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(31, 39, 50, .3); color: var(--steel); display: flex; flex-direction: column; }
dialog.modal:not([open]) { display: none; }
dialog.modal-wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(31, 39, 50, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body ul { padding-left: 20px; }
.modal-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-foot .spacer { flex: 1; }

.picker-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.picker-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--ink); }
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: var(--bg); }
.picker-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.picker-row img, .picker-row .pchip-ph { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.picker-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge { font-family: var(--font-label); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: #EEF1F5; color: var(--muted); }
.badge-warn { background: var(--warning-bg); color: #8A5A00; text-transform: none; letter-spacing: 0; font-size: 12px; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; }
.file-tile { aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: var(--radius); background: var(--bg); cursor: pointer; overflow: hidden; }
.file-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-tile:hover, .file-tile:focus-visible { border-color: var(--blue); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 48px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); text-align: center; cursor: pointer; color: var(--blue); font-family: var(--font-sub); }
.dropzone.is-over, .dropzone:hover { border-color: var(--blue); background: #F7F9FF; }
.dropzone + div { margin-top: 12px; }

/* ==========================================================================
   Login
   ========================================================================== */

.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-brand {
  background: var(--blue); color: #fff;
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand .brand { border: 0; padding: 0; height: auto; }
.login-brand h2 { color: #fff; font-size: 40px; line-height: 1.15; max-width: 440px; }
.login-brand h2 em { font-style: normal; color: var(--yellow); }
.login-brand p { color: var(--sky); max-width: 420px; font-size: 18px; margin: 16px 0 0; }
.login-brand .deco { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 56px solid rgba(254, 188, 61, .14); }
.login-brand .foot { font-size: 14px; color: rgba(220, 245, 255, .7); }

.login-form-wrap { display: grid; place-items: center; padding: 48px 24px; background: var(--surface); }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login-form h1 { font-size: 30px; }
.login-form .sub { margin: -10px 0 8px; }
.login-form .btn { justify-content: center; height: 44px; }
.login-form .row { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.login-form label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.login-form .error { display: none; color: var(--danger); font-size: 15px; }
.login-form .error.is-visible { display: block; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app, .app.is-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; }
  .app.is-mobile-open .sidebar { transform: none; }
  .app.is-mobile-open::after { content: ""; position: fixed; inset: 0; background: rgba(31, 39, 50, .45); z-index: 20; }
  .sidebar-foot { display: none; }
  .menu-toggle { display: flex; }
  .topbar { justify-content: flex-start; }
  .topbar .hide-sm { display: none; }
  .store-switch select { min-width: 0; }
  .page { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; }
  .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .toolbar .select, .toolbar .search { width: 100%; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 24px; min-height: 0; }
  .login-brand h2 { font-size: 28px; margin-top: 32px; }
  .login-brand .foot { display: none; }
}
