:root {
  --color-bg: #f5f6fb;
  --color-surface: #ffffff;
  --color-border: #e6e8f2;
  --color-border-strong: #d7d9e8;
  --color-text: #14152b;
  --color-text-muted: #676b84;
  --color-text-faint: #9598ae;
  --color-accent: #0071e3;
  --color-accent-soft: #eaf3ff;
  --color-accent-strong: #0058b8;
  --color-stripe: #fafafd;

  --status-not_started-bg: #eef0f5;
  --status-not_started-fg: #676b84;
  --status-in_progress-bg: #fff3e0;
  --status-in_progress-fg: #b56a05;
  --status-in_review-bg: #eaf3ff;
  --status-in_review-fg: #0058b8;
  --status-approved-bg: #e5f7f3;
  --status-approved-fg: #0f8a75;
  --status-approved-row-bg: #f1fbf9;
  --status-completed-bg: #e7f7ed;
  --status-completed-fg: #1c8a4c;

  --color-toast-bg: var(--color-text);
  --color-toast-fg: #ffffff;
  --color-alert: #c23b3b;
  --color-alert-soft: #fdecec;
  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%239598ae' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #14151f;
  --color-surface: #1c1e2b;
  --color-border: #2c2e40;
  --color-border-strong: #3a3d54;
  --color-text: #eef0f7;
  --color-text-muted: #a7abc2;
  --color-text-faint: #767a92;
  --color-accent: #4f9bff;
  --color-accent-soft: rgba(79, 155, 255, 0.16);
  --color-accent-strong: #8ec0ff;
  --color-stripe: #20222f;

  --status-not_started-bg: rgba(167, 171, 194, 0.14);
  --status-not_started-fg: #a7abc2;
  --status-in_progress-bg: rgba(255, 181, 71, 0.16);
  --status-in_progress-fg: #ffb547;
  --status-in_review-bg: rgba(79, 155, 255, 0.16);
  --status-in_review-fg: #6badff;
  --status-approved-bg: rgba(45, 212, 175, 0.16);
  --status-approved-fg: #2dd4af;
  --status-approved-row-bg: rgba(45, 212, 175, 0.08);
  --status-completed-bg: rgba(74, 222, 128, 0.16);
  --status-completed-fg: #4ade80;

  --color-toast-bg: #2f3245;
  --color-toast-fg: #eef0f7;
  --color-alert: #ff6b6b;
  --color-alert-soft: rgba(255, 107, 107, 0.16);
  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%23767a92' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px; line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.dim { color: var(--color-text-faint); font-weight: 500; }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--color-surface); border-bottom: 1px solid var(--color-border);
}
.topbar-brand { font-weight: 700; font-size: 14.5px; }
.topbar-app { color: var(--color-text-muted); font-weight: 500; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-username { font-size: 12.5px; color: var(--color-text-muted); }
.role-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-accent-strong);
}
.role-badge.role-client { background: var(--status-in_progress-bg); color: var(--status-in_progress-fg); }

.btn-ghost {
  border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text);
  padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { background: var(--color-bg); }

/* ---- Dark mode switch ---- */

.theme-switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.theme-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-switch-icon { font-size: 12px; line-height: 1; color: var(--color-text-faint); }
.theme-switch-track {
  width: 34px; height: 19px; border-radius: 999px; background: var(--color-border-strong);
  position: relative; display: inline-block; flex-shrink: 0; transition: background 0.15s ease;
}
.theme-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(20, 21, 43, 0.35); transition: transform 0.15s ease;
}
.theme-switch input:checked ~ .theme-switch-track { background: var(--color-accent); }
.theme-switch input:checked ~ .theme-switch-track .theme-switch-thumb { transform: translateX(15px); }
.theme-switch input:focus-visible ~ .theme-switch-track { box-shadow: 0 0 0 3px var(--color-accent-soft); }

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

.page { max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; }

.toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-input, .select {
  border: 1px solid var(--color-border-strong); border-radius: 9px; padding: 8px 12px;
  font: inherit; font-size: 12.5px; background: var(--color-surface); color: var(--color-text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.search-input:focus, .select:focus {
  outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.search-input { flex: 1; min-width: 220px; }
.select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  padding-right: 30px; background-repeat: no-repeat; background-position: right 10px center;
  background-size: 12px; background-image: var(--select-chevron);
}
.select:hover { border-color: var(--color-border-strong); background-color: var(--color-stripe); }
.toolbar-summary { margin-left: auto; font-size: 12.5px; color: var(--color-text-muted); }
.toolbar-summary strong { color: var(--color-text); }

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

.product-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--color-border); }
.product-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-text-faint); padding: 10px 12px; border-bottom: 1px solid var(--color-border);
  background: var(--color-stripe);
}
.product-table td { padding: 8px 12px; border-bottom: 1px solid var(--color-border); font-size: 12.5px; vertical-align: middle; }
.product-row { cursor: pointer; }
.product-row:hover td { background: var(--color-accent-soft); }

/* Approved renderings get a clearly marked row - not just the status badge -
   so they're easy to spot while scanning the whole list. */
.product-row[data-status="approved"] td { background: var(--status-approved-row-bg); }
.product-row[data-status="approved"] td:first-child { border-left: 4px solid var(--status-approved-fg); padding-left: 8px; }
.product-row[data-status="approved"]:hover td { background: var(--status-approved-bg); }

tr.cat-row td {
  padding: 11px 12px 11px 16px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--color-text); background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.cat-row { cursor: pointer; }
.cat-row:hover td { background: var(--color-stripe); }
.cat-count {
  display: inline-block; margin-left: 7px; font-size: 10.5px; font-weight: 700;
  color: var(--color-text-muted); background: var(--color-bg);
  padding: 1px 8px; border-radius: 999px; vertical-align: middle;
}

/* ---- Category drag-to-reorder + collapse ---- */

.drag-col, .drag-cell { width: 20px; padding-left: 8px !important; padding-right: 0 !important; }
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  margin-right: 6px; cursor: grab; color: var(--color-text-faint); opacity: 0.7; border-radius: 4px;
  font-size: 13px; vertical-align: middle;
}
.drag-handle:hover { opacity: 1; color: var(--color-accent-strong); background: var(--color-accent-soft); }
.drag-handle:active { cursor: grabbing; }
.cat-group.dragging > .cat-row td { opacity: 0.5; }
.cat-group.drag-over > .cat-row td { box-shadow: inset 0 2px 0 var(--color-accent); }

.cat-toggle {
  border: none; background: none; cursor: pointer; color: var(--color-text-faint); font-size: 11px;
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  margin-right: 4px; vertical-align: middle; transition: transform 0.12s ease;
}
.cat-toggle[aria-expanded="false"] { transform: rotate(-90deg); }
.cat-row:hover .cat-toggle { color: var(--color-accent-strong); }
.cat-group.collapsed .product-row,
.cat-group.collapsed .expand-row { display: none; }

.expand-col, .expand-cell { width: 40px; padding-left: 8px !important; padding-right: 0 !important; white-space: nowrap; }

.feedback-indicator {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; background: var(--color-stripe);
  color: var(--color-text-muted); cursor: pointer; vertical-align: middle;
  border: 1px solid var(--color-border); transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.feedback-indicator:hover { background: var(--color-accent-soft); color: var(--color-accent-strong); border-color: var(--color-accent); }
.feedback-indicator[hidden] { display: none; }
.feedback-indicator svg { display: block; }
.feedback-indicator .feedback-count {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; background: var(--color-text-faint); color: #fff; font-size: 9.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  border: 2px solid var(--color-surface); box-sizing: content-box;
}
.feedback-indicator.has-unread {
  background: var(--color-alert-soft); color: var(--color-alert); border-color: var(--color-alert);
}
.feedback-indicator.has-unread .feedback-count {
  background: var(--color-alert); animation: feedback-pulse 1.6s ease-in-out infinite;
}
@keyframes feedback-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.thumb-col { width: 52px; }
.thumb-cell { width: 52px; padding-left: 12px; padding-right: 4px; }
.thumb-img {
  width: 42px; height: 42px; object-fit: contain; border-radius: 6px;
  background: var(--color-stripe); border: 1px solid var(--color-border); display: block; cursor: zoom-in;
}
.thumb-preview {
  position: fixed; pointer-events: none; z-index: 500; display: none;
  width: 380px; height: 380px; object-fit: contain;
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: 12px; box-shadow: 0 16px 40px -10px rgba(20, 21, 43, 0.4); padding: 14px;
}
.thumb-preview.visible { display: block; }
.thumb-placeholder {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--color-stripe); border: 1px solid var(--color-border);
  color: var(--color-text-faint); font-size: 12px;
}
.code-cell { font-weight: 600; white-space: nowrap; }
.weblink-icon { margin-left: 4px; color: var(--color-text-faint); text-decoration: none; }
.weblink-icon:hover { color: var(--color-accent); }
.dim-cell { color: var(--color-text-muted); white-space: nowrap; }

.preview-input {
  border: 1px solid var(--color-border-strong); border-radius: 7px; padding: 5px 8px;
  font: inherit; font-size: 12px; background: var(--color-surface); color: var(--color-text); width: 100%; max-width: 200px;
}

/* ---- Status icon row (mirrors the main shy collective app's .set-status-icon pattern) ---- */

.set-status { display: flex; align-items: center; gap: 4px; }
.set-status-icon {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--color-border-strong);
  background: var(--color-surface); color: var(--color-text-faint); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; padding: 0; line-height: 0; transition: transform 0.1s ease, border-color 0.1s ease;
}
.set-status-icon svg { display: block; flex-shrink: 0; }
.set-status-icon:hover:not(:disabled) { transform: scale(1.12); border-color: var(--color-accent); color: var(--color-accent); }
.set-status-icon:disabled { cursor: default; }
.set-status-icon.current[data-status-value="not_started"] { border-color: var(--status-not_started-fg); color: var(--status-not_started-fg); background: var(--status-not_started-bg); }
.set-status-icon.current[data-status-value="in_progress"] { border-color: var(--status-in_progress-fg); color: var(--status-in_progress-fg); background: var(--status-in_progress-bg); }
.set-status-icon.current[data-status-value="in_review"] { border-color: var(--status-in_review-fg); color: var(--status-in_review-fg); background: var(--status-in_review-bg); }
.set-status-icon.current[data-status-value="approved"] { border-color: var(--status-approved-fg); color: var(--status-approved-fg); background: var(--status-approved-bg); }
.set-status-icon.current[data-status-value="completed"] { border-color: var(--status-completed-fg); color: var(--status-completed-fg); background: var(--status-completed-bg); }

.status-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 600; font-size: 11px;
}
.status-badge.status-not_started { background: var(--status-not_started-bg); color: var(--status-not_started-fg); }
.status-badge.status-in_progress { background: var(--status-in_progress-bg); color: var(--status-in_progress-fg); }
.status-badge.status-in_review { background: var(--status-in_review-bg); color: var(--status-in_review-fg); }
.status-badge.status-approved { background: var(--status-approved-bg); color: var(--status-approved-fg); }
.status-badge.status-completed { background: var(--status-completed-bg); color: var(--status-completed-fg); }

.btn-link { color: var(--color-accent); font-weight: 600; text-decoration: none; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }

.files-cell { min-width: 280px; }
.files-row { display: flex; gap: 8px; }
.btn-files {
  position: relative; overflow: hidden; flex: 1 1 0; min-width: 80px; height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1.5px dashed var(--color-border-strong); border-radius: 10px; background: var(--color-stripe);
  font: inherit; padding: 4px 4px; cursor: pointer; text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease, border-style 0.12s ease;
}
.btn-files:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.btn-files:hover .btn-files-text { color: var(--color-accent-strong); }
.btn-files-text {
  position: relative; z-index: 1; font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em;
  color: var(--color-text-muted); line-height: 1.15;
}
.file-count {
  position: relative; z-index: 1; color: var(--color-text-faint); font-weight: 700; font-size: 10.5px;
  background: var(--color-surface); border-radius: 999px; padding: 0 7px; line-height: 1.5;
}
.btn-files-bar {
  position: absolute; left: 0; bottom: 0; height: 100%; width: 0%; z-index: 0;
  background: var(--color-accent-soft); transition: width 0.12s ease;
}
.btn-files-drag {
  border-color: var(--color-accent); border-style: solid; background: var(--color-accent-soft);
  box-shadow: 0 0 0 2px var(--color-accent-soft);
}
.btn-files-uploading .btn-files-bar { background: var(--color-accent-soft); }
.btn-files-uploading .file-count { color: var(--color-accent-strong); }
.btn-files-done { border-color: var(--status-completed-fg); border-style: solid; }
.btn-files-done .btn-files-bar { width: 100% !important; background: var(--status-completed-bg); }
.btn-files-done .file-count { color: var(--status-completed-fg); }

/* ---- Expandable per-product file gallery ---- */

.expand-row td { padding: 0; border-bottom: 1px solid var(--color-border); }
.expand-panel { padding: 14px 20px 16px 46px; background: var(--color-stripe); }
.expand-panel-loading { color: var(--color-text-faint); font-size: 12px; }
.gallery-group { margin-bottom: 14px; }
.gallery-group:last-child { margin-bottom: 0; }
.gallery-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-faint); margin-bottom: 6px; }
.gallery-note { font-size: 10.5px; color: var(--color-text-faint); font-style: italic; margin: 0 0 8px; }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-empty { font-size: 11.5px; color: var(--color-text-faint); }
.gallery-item { display: flex; flex-direction: column; align-items: center; width: 78px; gap: 4px; }
.gallery-thumb-wrap { position: relative; width: 72px; height: 72px; }
.gallery-item-link { display: block; width: 72px; height: 72px; text-decoration: none; color: var(--color-text); }
.gallery-thumb {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--color-border);
  background: var(--color-surface); display: block; cursor: zoom-in;
}
.gallery-file-icon {
  width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-surface);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
  color: var(--color-text-faint); text-transform: uppercase;
}
.gallery-item-name { font-size: 9.5px; color: var(--color-text-muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.gallery-item-link:hover .gallery-item-name { color: var(--color-accent); }
.gallery-item-delete {
  position: absolute; top: -6px; right: -6px; border: none; background: rgba(20,21,43,0.6); color: #fff;
  font-size: 10px; line-height: 1; cursor: pointer; border-radius: 999px; width: 16px; height: 16px;
}
.gallery-item-delete:hover { background: #c23b3b; }

/* ---- Feedback / questions thread (inside the expand panel) ---- */

.comments-group { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.comments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 260px; overflow-y: auto; }
.comment-item {
  border: 1px solid var(--color-border); border-radius: 10px; padding: 8px 10px; background: var(--color-surface);
  max-width: 480px;
}
.comment-item.role-staff { border-left: 3px solid var(--color-accent); }
.comment-item.role-client { border-left: 3px solid var(--status-in_progress-fg); }
.comment-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 10.5px; color: var(--color-text-faint); }
.comment-author { font-weight: 700; color: var(--color-text); }
.comment-role-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 6px; border-radius: 999px; background: var(--color-stripe); color: var(--color-text-faint);
}
.comment-item.role-client .comment-role-badge { background: var(--status-in_progress-bg); color: var(--status-in_progress-fg); }
.comment-item.role-staff .comment-role-badge { background: var(--color-accent-soft); color: var(--color-accent-strong); }
.comment-body { font-size: 12px; color: var(--color-text); white-space: pre-wrap; word-break: break-word; }
.comments-empty { font-size: 11.5px; color: var(--color-text-faint); padding: 4px 0 10px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; max-width: 480px; }
.comment-form textarea {
  flex: 1; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 7px 9px;
  font: inherit; font-size: 12px; resize: vertical; min-height: 36px;
}
.comment-form textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.comment-form .btn-secondary { flex-shrink: 0; }

.empty-state { text-align: center; padding: 40px 0; color: var(--color-text-faint); }

/* ---- Modal ---- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 21, 43, 0.45); display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--color-surface); border-radius: 14px; width: 100%; max-width: 480px; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px -12px rgba(20, 21, 43, 0.35);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.modal-header h2 { margin: 0; font-size: 15px; }
.modal-close { border: none; background: none; font-size: 20px; line-height: 1; color: var(--color-text-faint); cursor: pointer; padding: 2px 6px; }
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: 18px 20px 20px; overflow-y: auto; }

.files-modal-hint {
  font-size: 11px; color: var(--color-text-faint); font-style: italic; background: var(--color-stripe);
  border-radius: 8px; padding: 8px 10px; margin: 0 0 12px;
}

.dropzone {
  border: 1.5px dashed var(--color-border-strong); border-radius: 10px; padding: 22px 14px; text-align: center;
  color: var(--color-text-muted); font-size: 12.5px; cursor: pointer; margin-bottom: 14px;
}
.dropzone:hover, .dropzone-active { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent-strong); }
.dropzone p { margin: 0; }

.labels-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.label-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--color-border); border-radius: 9px; padding: 8px 10px;
}
.label-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.label-name { color: var(--color-accent); font-weight: 600; font-size: 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-name:hover { text-decoration: underline; }
.label-meta { font-size: 10.5px; color: var(--color-text-faint); }
.labels-empty { color: var(--color-text-faint); font-size: 12px; padding: 6px 2px; }
.btn-icon-delete {
  border: none; background: none; color: var(--color-text-faint); font-size: 17px; line-height: 1; cursor: pointer;
  padding: 2px 6px; flex-shrink: 0;
}
.btn-icon-delete:hover { color: #c23b3b; }

.notes-field { border-top: 1px solid var(--color-border); padding-top: 14px; margin-top: 4px; }
.notes-field label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-faint); margin-bottom: 6px; }
.notes-field textarea {
  width: 100%; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 8px 10px;
  font: inherit; font-size: 12.5px; resize: vertical; margin-bottom: 8px;
}
.btn-secondary {
  border: 1px solid var(--color-accent); background: var(--color-surface); color: var(--color-accent);
  padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { background: var(--color-accent-soft); }

/* ---- Toast ---- */

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--color-toast-bg); color: var(--color-toast-fg); padding: 10px 18px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; box-shadow: 0 10px 30px -8px rgba(20, 21, 43, 0.4); z-index: 200;
}
.toast-error { background: #c23b3b; color: #fff; }

/* ---- Login page ---- */

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
  padding: 32px 30px; width: 100%; max-width: 340px; box-shadow: 0 8px 24px -6px rgba(25,25,60,0.10);
}
.login-brand { font-weight: 700; font-size: 13px; text-align: center; margin-bottom: 18px; }
.login-title { font-size: 18px; margin: 0 0 4px; text-align: center; }
.login-sub { font-size: 12px; color: var(--color-text-muted); text-align: center; margin: 0 0 20px; }
.login-error {
  background: #fdecec; color: #a83232; border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 14px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--color-text-muted); font-weight: 600; }
.field input {
  border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 13px; color: var(--color-text);
}
.btn-primary {
  background: var(--color-accent); color: #fff; border: none; border-radius: 9px; padding: 10px 16px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.btn-primary:hover { opacity: 0.92; }

@media (max-width: 720px) {
  .product-table thead { display: none; }
  .product-table, .product-table tbody { display: block; }
  tr.cat-row { display: block; }
  .drag-handle { display: none; } /* reordering is a desktop convenience; drag-drop doesn't translate well to touch here */
  .product-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
  .product-row td { display: block; border: none; padding: 2px 0; }
  .product-row td.drag-cell { display: none; }
  .expand-row td { padding: 0 12px 10px; }
  .expand-panel { padding: 10px 0 0; }
  .files-cell { flex-wrap: wrap; }
  .btn-files { min-width: 90px; }
  input, select, textarea { font-size: 16px !important; }
}
