:root {
  --bg: #f4efe6;
  --bg-soft: #faf7f1;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --text: #2f2b27;
  --muted: #756e66;
  --subtle: #9d958c;
  --line: #e6ded2;
  --line-strong: #d5c9b9;
  --accent: #a8783e;
  --accent-strong: #795328;
  --accent-soft: #efe2cd;
  --accent-pale: #f7efe2;
  --success: #466c57;
  --success-soft: #e4efe8;
  --warning: #a36a22;
  --warning-soft: #f5ead7;
  --danger: #a54f47;
  --danger-soft: #f7e5e1;
  --info: #4d697a;
  --info-soft: #e3edf1;
  --shadow-sm: 0 1px 2px rgba(47, 43, 39, 0.04), 0 5px 18px rgba(72, 58, 42, 0.04);
  --shadow-md: 0 18px 50px rgba(72, 58, 42, 0.12);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 270px;
  --topbar: 72px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 3px solid rgba(168, 120, 62, 0.34); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Icons */
.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background: #312e2a;
  color: #f6f1e9;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(215,180,122,0.55);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #d7b47a;
  background: rgba(255,255,255,0.025);
}
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.brand-subtitle { margin-top: 1px; font-size: 11px; color: #bfb7ad; letter-spacing: 0.1em; text-transform: uppercase; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 15px 13px 22px; }
.nav-group-label {
  margin: 17px 10px 7px;
  color: #8f8880;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.nav-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d5cfc7;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.055); color: #fff; }
.nav-link.active { background: #4a433b; color: #fff; box-shadow: inset 3px 0 0 #d7b47a; }
.nav-link.active .icon { color: #e2bd80; }
.nav-link .nav-label { flex: 1; min-width: 0; }
.nav-count {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #d9d1c7;
  font-size: 11px;
  text-align: center;
}
.sidebar-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer-card {
  padding: 12px;
  border: 1px solid rgba(215,180,122,0.22);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}
.sidebar-footer-title { font-size: 12px; font-weight: 650; }
.sidebar-footer-copy { margin-top: 3px; color: #a9a198; font-size: 11px; }
.sidebar-version { margin-top: 10px; color: #837c74; font-size: 10px; }

.main-shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: rgba(250,247,241,0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.mobile-menu-btn { display: none; }
.topbar-heading { min-width: 160px; }
.topbar-title { font-size: 18px; font-weight: 720; letter-spacing: -0.015em; }
.topbar-kicker { color: var(--muted); font-size: 11px; }
.topbar-spacer { flex: 1; }
.global-search { position: relative; width: min(360px, 30vw); }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search-input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 39px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,120,62,.10); outline: none; }
.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--subtle);
  background: var(--bg-soft);
  font-size: 10px;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
  max-height: 380px;
  overflow: auto;
}
.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-result:hover { background: var(--accent-pale); }
.search-result-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--bg); color: var(--accent-strong); }
.search-result-main { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { color: var(--muted); font-size: 11px; }
.search-empty { padding: 20px 14px; text-align: center; color: var(--muted); }

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.icon-button:hover { background: var(--accent-pale); border-color: var(--line-strong); }
.notification-dot { position: absolute; right: 8px; top: 7px; width: 7px; height: 7px; border-radius: 999px; background: var(--danger); border: 2px solid var(--surface); }
.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
}
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #3b3732; color: #f6e7ce; font-weight: 700; font-size: 12px; }
.profile-meta { max-width: 120px; text-align: left; }
.profile-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { color: var(--muted); font-size: 10px; white-space: nowrap; }

.content { padding: 26px 28px 42px; }
.page { max-width: 1560px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.page-title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.15; font-weight: 500; letter-spacing: -0.03em; }
.page-description { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.breadcrumbs a:hover { color: var(--accent-strong); }
.breadcrumbs .current { color: var(--text); }

/* Buttons */
.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { background: #1f1d1b; box-shadow: 0 8px 20px rgba(47,43,39,.16); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--accent-pale); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(168,120,62,.08); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #e9c7c1; }
.btn-danger:hover { background: #f1d7d2; }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 11px 20px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Cards and layouts */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 0; }
.card-title { margin: 0; font-size: 14px; font-weight: 730; }
.card-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; }
.card-body { padding: 18px 20px 20px; }
.card-footer { padding: 13px 20px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(310px, .8fr); gap: 18px; margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-strong); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-semibold { font-weight: 650; }
.font-bold { font-weight: 760; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 22px; }
.mb-0 { margin-bottom: 0; }

.metric-card { min-height: 126px; padding: 16px 17px; position: relative; overflow: hidden; }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-pale); color: var(--accent-strong); }
.metric-value { margin-top: 12px; font-size: 25px; line-height: 1; font-weight: 760; letter-spacing: -0.035em; }
.metric-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.metric-delta { color: var(--success); font-weight: 700; }
.metric-delta.down { color: var(--danger); }
.metric-mini-bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--accent-soft); }
.metric-mini-bar > span { display: block; height: 100%; background: var(--accent); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-neutral { background: #efebe5; color: #655f58; border-color: #e2dbd1; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #cfe0d5; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #ead7b6; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #ebcac4; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: #cddde3; }
.badge-accent { background: var(--accent-pale); color: var(--accent-strong); border-color: #ead7b9; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: var(--success); }

/* Filters and inputs */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,253,249,.75);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input, .select { height: 39px; padding: 0 11px; }
.textarea { min-height: 92px; padding: 10px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(168,120,62,.10); }
.input::placeholder, .textarea::placeholder { color: #aaa197; }
.input-sm, .select-sm { height: 34px; font-size: 12px; }
.inline-search { position: relative; width: min(300px, 100%); }
.inline-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.inline-search .input { padding-left: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { color: #4e4842; font-size: 11px; font-weight: 700; }
.field-help { margin-top: -2px; color: var(--muted); font-size: 10px; }
.field-error { color: var(--danger); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.form-section { padding-top: 6px; }
.form-section + .form-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section-title { margin-bottom: 12px; font-size: 12px; font-weight: 750; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.checkbox-row input { margin-top: 3px; accent-color: var(--accent); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); }
.segmented button { min-width: 35px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(47,43,39,.08); }

/* Tables */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .13s ease; }
.data-table tbody tr:hover { background: rgba(239,226,205,.28); }
.data-table .clickable-row { cursor: pointer; }
.table-primary { font-weight: 680; }
.table-secondary { margin-top: 2px; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.table-empty { padding: 48px 20px !important; text-align: center; color: var(--muted); }
.check-cell { width: 38px; }
.stock-cell { min-width: 160px; }
.stock-meter { width: 110px; height: 5px; margin-top: 5px; border-radius: 999px; overflow: hidden; background: #eae4dc; }
.stock-meter span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.stock-meter.low span { background: var(--danger); }

/* Progress */
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: #e9e2d9; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.progress.success > span { background: var(--success); }
.progress.danger > span { background: var(--danger); }
.progress.info > span { background: var(--info); }
.progress-lg { height: 10px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }

/* Dashboard */
.chart-bars { height: 220px; display: flex; align-items: flex-end; gap: 10px; padding: 14px 8px 0; border-bottom: 1px solid var(--line); }
.chart-bar-group { flex: 1; min-width: 20px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.chart-bar-wrap { width: min(28px, 65%); flex: 1; display: flex; align-items: flex-end; }
.chart-bar { width: 100%; min-height: 2px; border-radius: 5px 5px 0 0; background: var(--accent); transition: height .4s ease; }
.chart-bar-group:nth-child(2n) .chart-bar { background: #c19a65; }
.chart-label { color: var(--muted); font-size: 9px; white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
.legend-swatch.secondary { background: #d3c4b0; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 8px 0; }
.timeline-dot { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--accent-strong); }
.timeline-title { font-size: 12px; font-weight: 650; }
.timeline-meta { margin-top: 2px; color: var(--muted); font-size: 10px; }
.quick-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.quick-action { min-height: 84px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; text-align: left; }
.quick-action:hover { border-color: var(--line-strong); background: var(--accent-pale); }
.quick-action .icon { color: var(--accent-strong); }
.quick-action span { font-size: 11px; font-weight: 650; }

/* Product cards */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.product-card { overflow: hidden; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.product-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 14px 35px rgba(72,58,42,.10); }
.product-visual { height: 168px; position: relative; display: grid; place-items: center; overflow: hidden; background: #ece4d9; border-bottom: 1px solid var(--line); }
.product-visual.sachet { background: #e7e2d3; }
.product-visual.relief { background: #e4ddd3; }
.product-visual::after { content: ""; position: absolute; width: 180px; height: 28px; bottom: 14px; border-radius: 50%; background: rgba(55,47,39,.08); filter: blur(5px); }
.candle-art { position: relative; z-index: 1; width: 82px; height: 92px; border-radius: 10px 10px 15px 15px; background: #f5f0e8; border: 1px solid #d4c9bb; box-shadow: inset -10px -8px 18px rgba(98,82,62,.07), 0 12px 24px rgba(72,58,42,.14); }
.candle-art::before { content: ""; position: absolute; left: 49%; top: -22px; width: 15px; height: 27px; border-radius: 50% 50% 45% 45%; background: #d8ad66; transform: translateX(-50%); }
.candle-art::after { content: ""; position: absolute; left: 50%; top: -1px; width: 2px; height: 14px; background: #5d4a36; transform: translateX(-50%); }
.sachet-art { position: relative; z-index: 1; width: 76px; height: 104px; border-radius: 38px 38px 16px 16px; background: #f5f0e7; border: 1px solid #cfc5b8; box-shadow: 0 12px 24px rgba(72,58,42,.12); }
.sachet-art::before { content: ""; position: absolute; left: 50%; top: 12px; width: 10px; height: 10px; border: 2px solid #b5a797; border-radius: 50%; transform: translateX(-50%); }
.sachet-art::after { content: "✦"; position: absolute; inset: 34px 0 auto; color: #9b8d78; text-align: center; font-size: 28px; }
.relief-art { position: relative; z-index: 1; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; background: #eee7dd; border: 1px solid #cfc4b6; box-shadow: inset -9px -7px 18px rgba(84,70,54,.08), 0 12px 24px rgba(72,58,42,.12); color: #a69a8a; font-family: Georgia,serif; font-size: 38px; }
.product-card-content { padding: 16px; }
.product-code { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.product-name { margin-top: 5px; font-family: Georgia,serif; font-size: 19px; line-height: 1.2; }
.product-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.thumbnail { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #eee8df; color: var(--accent-strong); }

/* Tabs */
.tabs { display: flex; gap: 3px; margin-bottom: 17px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #ede7df; scrollbar-width: thin; }
.tab {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.tab-icon { flex: 0 0 auto; display: inline-flex; align-items: center; }
.tab-label { min-width: 0; }
.tab-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 7px rgba(47,43,39,.07); }
.detail-hero { display: grid; grid-template-columns: 190px 1fr auto; gap: 22px; align-items: center; padding: 20px; margin-bottom: 17px; }
.detail-hero .product-visual { height: 150px; border: 0; border-radius: 12px; }
.detail-title { font-family: Georgia,serif; font-size: 29px; line-height: 1.15; }
.detail-facts { display: grid; grid-template-columns: repeat(4, minmax(90px,1fr)); gap: 12px; margin-top: 17px; }
.fact { padding-right: 12px; border-right: 1px solid var(--line); }
.fact:last-child { border-right: 0; }
.fact-label { color: var(--muted); font-size: 10px; }
.fact-value { margin-top: 3px; font-size: 12px; font-weight: 700; }
.summary-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.summary-item { padding: 12px 14px; background: var(--surface); }
.summary-item-label { color: var(--muted); font-size: 10px; }
.summary-item-value { margin-top: 3px; font-size: 12px; font-weight: 650; }

/* Operation cards */
.operation-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.operation-card { padding: 15px; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.operation-card:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.operation-head { display: flex; align-items: flex-start; gap: 11px; }
.operation-number { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-pale); color: var(--accent-strong); font-size: 10px; font-weight: 800; }
.operation-title { font-size: 13px; font-weight: 720; }
.operation-result { margin-top: 4px; color: var(--muted); font-size: 11px; }
.operation-times { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 13px; }
.time-chip { padding: 7px; border-radius: 8px; background: var(--bg-soft); text-align: center; }
.time-value { font-size: 11px; font-weight: 750; }
.time-label { margin-top: 2px; color: var(--muted); font-size: 8px; text-transform: uppercase; }

/* Tooling */
.tooling-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.tooling-card { padding: 17px; }
.tooling-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tooling-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: #e9e1d6; color: var(--accent-strong); }
.tooling-name { margin-top: 12px; font-size: 14px; font-weight: 720; }
.tooling-code { color: var(--muted); font-size: 10px; }
.qr-demo { width: 54px; height: 54px; display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; padding: 4px; border: 1px solid var(--line); background: white; }
.qr-demo i { background: #37322e; }
.qr-demo i.off { background: transparent; }
.life-row { margin-top: 15px; }
.tooling-facts { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 13px; }
.tooling-fact { padding: 8px; border-radius: 9px; background: var(--bg-soft); }

/* Tech cards */
.tech-card-row { display: grid; grid-template-columns: minmax(200px,1.4fr) .65fr .65fr .8fr .8fr auto; gap: 15px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tech-card-row:last-child { border-bottom: 0; }
.tech-card-row:hover { background: var(--accent-pale); }
.tech-card-main { display: flex; align-items: center; gap: 11px; }
.document-icon { width: 38px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent-strong); }
.tech-card-name { font-size: 12px; font-weight: 700; }
.tech-card-code { margin-top: 2px; color: var(--muted); font-size: 10px; }
.card-detail-head { padding: 20px; margin-bottom: 17px; }
.card-detail-title { display: flex; align-items: center; gap: 12px; }
.card-version { min-width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--text); color: #f6ead6; font-family: Georgia,serif; font-size: 18px; }
.card-detail-name { font-family: Georgia,serif; font-size: 25px; }
.card-detail-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.card-stat-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-top: 18px; }
.card-stat { padding: 11px; border-radius: 10px; background: var(--bg-soft); }
.card-stat-label { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.card-stat-value { margin-top: 4px; font-size: 13px; font-weight: 750; }
.bom-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--accent-pale); }
.bom-total { font-family: Georgia,serif; font-size: 20px; }
.route-list { display: flex; flex-direction: column; }
.route-step { position: relative; display: grid; grid-template-columns: 48px minmax(0,1fr) 120px 115px auto; gap: 12px; align-items: center; min-height: 70px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.route-step:last-child { border-bottom: 0; }
.route-index { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--muted); font-size: 10px; font-weight: 800; }
.route-step.wait .route-index { background: var(--warning-soft); color: var(--warning); border-color: #ead7b6; }
.route-step.check .route-index { background: var(--info-soft); color: var(--info); border-color: #cddde3; }
.route-name { font-size: 12px; font-weight: 700; }
.route-result { margin-top: 3px; color: var(--muted); font-size: 10px; }
.route-time { color: var(--muted); font-size: 10px; }
.quality-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.quality-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--info-soft); color: var(--info); }
.quality-title { font-size: 12px; font-weight: 720; }
.quality-spec { margin-top: 4px; color: var(--muted); font-size: 10px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.diff-column { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.diff-title { padding: 11px 13px; background: var(--bg-soft); font-weight: 700; font-size: 12px; }
.diff-item { padding: 10px 13px; border-top: 1px solid var(--line); font-size: 11px; }
.diff-item.changed { background: var(--warning-soft); }
.diff-item.added { background: var(--success-soft); }
.diff-label { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.diff-value { margin-top: 3px; font-weight: 650; }

/* Batches */
.batch-list-card { overflow: hidden; }
.batch-row { display: grid; grid-template-columns: minmax(190px,1.3fr) minmax(150px,1fr) 100px 120px 150px 95px auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.batch-row:last-child { border-bottom: 0; }
.batch-row:hover { background: var(--accent-pale); }
.batch-code { font-size: 12px; font-weight: 750; }
.batch-product { margin-top: 3px; color: var(--muted); font-size: 10px; }
.batch-progress { min-width: 130px; }
.batch-qty { font-size: 12px; font-weight: 700; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(235px,1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-height: 420px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,249,.52); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 3px 11px; }
.kanban-title { font-size: 11px; font-weight: 750; }
.kanban-count { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--bg); color: var(--muted); font-size: 10px; }
.kanban-card { padding: 12px; margin-bottom: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 2px 8px rgba(72,58,42,.04); cursor: pointer; }
.kanban-card:hover { border-color: var(--line-strong); }
.kanban-code { font-size: 10px; font-weight: 800; }
.kanban-product { margin-top: 5px; font-size: 12px; font-weight: 680; }
.kanban-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.batch-hero { padding: 20px; }
.batch-hero-grid { display: grid; grid-template-columns: 1.4fr repeat(4,.55fr); gap: 16px; align-items: end; }
.batch-hero-code { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.batch-hero-title { margin-top: 4px; font-family: Georgia,serif; font-size: 27px; }
.batch-kpi-label { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.batch-kpi-value { margin-top: 4px; font-size: 14px; font-weight: 750; }
.batch-route-step { display: grid; grid-template-columns: 42px minmax(0,1fr) 120px 120px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.step-state { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--subtle); }
.batch-route-step.completed .step-state { background: var(--success-soft); color: var(--success); border-color: #cfe0d5; }
.batch-route-step.current { padding-left: 10px; padding-right: 10px; border: 1px solid #dfc69e; border-radius: 11px; background: var(--accent-pale); }
.batch-route-step.current .step-state { background: var(--accent); color: white; border-color: var(--accent); }
.wizard-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.wizard-step { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.wizard-step::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.wizard-step:last-child::after { display: none; }
.wizard-number { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 750; }
.wizard-step.active { color: var(--text); }
.wizard-step.active .wizard-number { background: var(--text); color: white; border-color: var(--text); }
.material-requirement { display: grid; grid-template-columns: 1fr 110px 105px 95px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.material-requirement:last-child { border-bottom: 0; }

/* Operator mode */
.operator-shell { min-height: 100vh; background: #eee8df; }
.operator-topbar { height: 70px; display: flex; align-items: center; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.operator-topbar .operator-batch { flex: 1; }
.operator-code { font-size: 11px; font-weight: 750; }
.operator-product { color: var(--muted); font-size: 10px; }
.operator-main { max-width: 1180px; margin: 0 auto; padding: 22px; }
.operator-progress { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; margin-bottom: 16px; }
.operator-step-count { color: var(--muted); font-size: 12px; font-weight: 650; }
.operator-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(310px,.75fr); gap: 18px; }
.operator-step-card { overflow: hidden; }
.operator-media { height: 280px; display: grid; place-items: center; background: #e8e0d5; border-bottom: 1px solid var(--line); position: relative; }
.operator-media-placeholder { width: 150px; height: 150px; display: grid; place-items: center; border: 1px solid #d0c4b4; border-radius: 24px; background: rgba(255,255,255,.45); color: var(--accent-strong); }
.operator-media-label { position: absolute; left: 15px; bottom: 13px; padding: 5px 9px; border-radius: 8px; background: rgba(47,43,39,.86); color: white; font-size: 9px; }
.operator-step-body { padding: 22px; }
.operator-step-title { font-family: Georgia,serif; font-size: clamp(25px,3vw,36px); line-height: 1.1; }
.operator-result { margin-top: 10px; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0; background: var(--accent-pale); color: #5c482f; font-size: 13px; }
.operator-instructions { margin-top: 18px; }
.operator-instructions ol { margin: 8px 0 0; padding-left: 20px; }
.operator-instructions li { margin: 6px 0; }
.operator-panel { padding: 18px; }
.timer-box { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); text-align: center; }
.timer-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.timer-value { margin-top: 5px; font-variant-numeric: tabular-nums; font-size: 36px; font-weight: 720; letter-spacing: .03em; }
.timer-actions { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.checklist { margin-top: 16px; }
.checklist-title { margin-bottom: 8px; font-size: 11px; font-weight: 750; }
.check-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; cursor: pointer; }
.check-item:last-child { border-bottom: 0; }
.check-item input { margin-top: 3px; accent-color: var(--success); }
.parameter-box { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.parameter-row { display: grid; grid-template-columns: 1fr 115px; gap: 10px; align-items: end; margin-top: 9px; }
.parameter-spec { color: var(--muted); font-size: 10px; }
.operator-footer-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; margin-top: 16px; }
.hold-panel { padding: 18px; border: 1px solid #e7cfaa; border-radius: 12px; background: var(--warning-soft); text-align: center; }
.hold-time { margin: 7px 0; font-size: 28px; font-weight: 760; }

/* Quality and defects */
.quality-queue { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.inspection-card { padding: 16px; }
.inspection-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.inspection-product { margin-top: 10px; font-family: Georgia,serif; font-size: 19px; }
.inspection-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.inspection-progress { margin-top: 14px; }
.quality-check-row { display: grid; grid-template-columns: 1.2fr .7fr .7fr 120px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.quality-check-row:last-child { border-bottom: 0; }
.quality-check-name { font-size: 12px; font-weight: 700; }
.quality-check-method { color: var(--muted); font-size: 10px; }
.decision-buttons { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 18px; }
.pareto { padding: 16px 18px 18px; }
.pareto-row { display: grid; grid-template-columns: minmax(125px,.8fr) minmax(180px,2fr) 55px 70px; gap: 10px; align-items: center; margin-top: 10px; }
.pareto-label { font-size: 11px; font-weight: 650; }
.pareto-track { height: 18px; border-radius: 5px; overflow: hidden; background: #ece6de; }
.pareto-bar { height: 100%; border-radius: 5px; background: var(--danger); }
.pareto-value, .pareto-cumulative { color: var(--muted); font-size: 10px; text-align: right; }
.defect-photo { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #e0cec8; border-radius: 9px; background: var(--danger-soft); color: var(--danger); }

/* Media */
.media-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.media-card { overflow: hidden; }
.media-preview { height: 150px; position: relative; display: grid; place-items: center; background: #e8e1d7; color: var(--accent-strong); }
.media-preview.defect { background: #eee0dd; color: var(--danger); }
.media-preview.safety { background: #e5e8e2; color: var(--success); }
.media-play { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.83); box-shadow: 0 7px 18px rgba(47,43,39,.12); }
.media-type { position: absolute; left: 10px; top: 10px; }
.media-info { padding: 13px; }
.media-name { font-size: 12px; font-weight: 700; }
.media-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }

/* Reports */
.report-chart { height: 270px; padding: 14px; }
.svg-chart { width: 100%; height: 100%; overflow: visible; }
.chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: rgba(168,120,62,.09); stroke: none; }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-text { fill: var(--muted); font-size: 9px; }
.donut-wrap { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 20px; }
.donut { width: 170px; height: 170px; }
.donut circle { fill: none; stroke-width: 20; transform: rotate(-90deg); transform-origin: 50% 50%; }
.donut .track { stroke: #ece6de; }
.donut .seg-a { stroke: var(--success); }
.donut .seg-b { stroke: var(--danger); }
.donut-center { font-size: 13px; font-weight: 700; fill: var(--text); text-anchor: middle; dominant-baseline: middle; }
.report-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.report-list-item:last-child { border-bottom: 0; }
.report-list-label { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.report-list-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.report-list-dot.danger { background: var(--danger); }
.report-list-value { font-size: 12px; font-weight: 750; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 17px; }
.settings-nav { padding: 8px; align-self: start; }
.settings-nav button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.settings-nav button:hover { background: var(--accent-pale); color: var(--text); }
.settings-nav button.active { background: var(--text); color: white; }
.settings-panel { padding: 20px; }
.setting-row { display: grid; grid-template-columns: 1fr minmax(200px,.8fr); gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-title { font-size: 12px; font-weight: 700; }
.setting-copy { margin-top: 3px; color: var(--muted); font-size: 10px; }
.danger-zone { margin-top: 20px; padding: 16px; border: 1px solid #e6c6c0; border-radius: 12px; background: var(--danger-soft); }

/* Empty/error states */
.empty-state { padding: 52px 20px; text-align: center; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px; background: var(--accent-pale); color: var(--accent-strong); }
.empty-title { font-family: Georgia,serif; font-size: 20px; }
.empty-copy { max-width: 430px; margin: 6px auto 15px; color: var(--muted); font-size: 12px; }
.error-state { padding: 40px; text-align: center; }
.loading-skeleton { overflow: hidden; position: relative; background: #ece6de; border-radius: 7px; }
.loading-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: rgba(255,255,255,.48); animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Modal, dropdown, toast */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(37,34,31,.56); animation: fadeIn .14s ease; }
.modal {
  width: min(620px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: 0 30px 90px rgba(28,25,22,.28);
  animation: modalIn .16s ease;
}
.modal.wide { width: min(920px,100%); }
.modal.xwide { width: min(1160px,100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-family: Georgia,serif; font-size: 22px; font-weight: 500; }
.modal-subtitle { margin-top: 4px; color: var(--muted); font-size: 11px; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-soft); border-radius: 0 0 18px 18px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.toast-stack { position: fixed; z-index: 150; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; width: min(370px, calc(100vw - 40px)); }
.toast { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); box-shadow: var(--shadow-md); animation: toastIn .2s ease; }
.toast-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--success-soft); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast-title { font-size: 11px; font-weight: 750; }
.toast-copy { margin-top: 2px; color: var(--muted); font-size: 10px; }
.toast-close { border: 0; background: transparent; color: var(--subtle); cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.dropdown { position: absolute; z-index: 65; min-width: 220px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); box-shadow: var(--shadow-md); }
.dropdown.right { right: 0; top: calc(100% + 8px); }
.dropdown-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font-size: 12px; }
.dropdown-item:hover { background: var(--accent-pale); }
.dropdown-separator { height: 1px; margin: 6px 4px; background: var(--line); }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px,1.15fr) minmax(380px,.85fr); background: var(--bg); }
.login-showcase { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(35px,6vw,80px); background: #302d29; color: white; }
.login-showcase::before { content: ""; position: absolute; width: 420px; height: 420px; right: -130px; top: 70px; border: 1px solid rgba(215,180,122,.20); border-radius: 50%; }
.login-showcase::after { content: ""; position: absolute; width: 250px; height: 250px; right: -50px; top: 155px; border: 1px solid rgba(215,180,122,.14); border-radius: 50%; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-mark { width: 48px; height: 48px; }
.login-brand-title { font-size: 16px; font-weight: 720; }
.login-brand-copy { color: #bfb6ac; font-size: 11px; }
.login-copy { position: relative; z-index: 1; max-width: 660px; }
.login-eyebrow { color: #d7b47a; font-size: 11px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.login-headline { margin: 14px 0 0; font-family: Georgia,serif; font-size: clamp(38px,5vw,68px); line-height: 1.02; font-weight: 400; letter-spacing: -.045em; }
.login-text { max-width: 540px; margin-top: 22px; color: #c8c1b9; font-size: 14px; }
.login-features { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 35px; }
.login-feature { padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.025); }
.login-feature .icon { color: #d7b47a; }
.login-feature-title { margin-top: 13px; font-size: 11px; font-weight: 700; }
.login-feature-copy { margin-top: 3px; color: #a9a198; font-size: 9px; }
.login-form-side { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(420px,100%); padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-md); }
.login-title { font-family: Georgia,serif; font-size: 28px; }
.login-subtitle { margin-top: 6px; color: var(--muted); font-size: 12px; }
.demo-note { display: flex; align-items: flex-start; gap: 10px; padding: 11px; margin: 17px 0; border: 1px solid #e4d1b1; border-radius: 10px; background: var(--accent-pale); color: #604a2f; font-size: 10px; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 17px 0; color: var(--muted); font-size: 10px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-footer { margin-top: 17px; color: var(--muted); font-size: 10px; text-align: center; }

/* Responsive */
.mobile-overlay { display: none; }
@media (max-width: 1240px) {
  :root { --sidebar: 235px; }
  .grid-6 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .product-grid, .operation-grid, .tooling-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .quality-queue { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-facts { grid-template-columns: repeat(2,1fr); }
  .fact:nth-child(2) { border-right: 0; }
  .card-stat-grid { grid-template-columns: repeat(3,1fr); }
  .batch-row { grid-template-columns: minmax(180px,1.3fr) minmax(140px,1fr) 100px 135px 90px auto; }
  .batch-row .hide-xl { display: none; }
  .tech-card-row { grid-template-columns: minmax(200px,1.4fr) .6fr .7fr .8fr auto; }
  .tech-card-row .hide-xl { display:none; }
}
@media (max-width: 980px) {
  :root { --sidebar: 270px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 45px rgba(47,43,39,.18); }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay { position: fixed; z-index: 35; inset: 0; display: block; background: rgba(47,43,39,.45); }
  .main-shell { margin-left: 0; }
  .mobile-menu-btn { display: inline-grid; }
  .topbar { padding: 0 18px; }
  .global-search { width: min(310px,36vw); }
  .profile-meta { display: none; }
  .content { padding: 22px 18px 36px; }
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 160px 1fr; }
  .detail-hero > :last-child { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .operator-layout { grid-template-columns: 1fr; }
  .operator-panel { order: -1; }
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { min-height: 430px; padding: 40px; }
  .login-form-side { padding: 28px 18px 45px; }
  .batch-hero-grid { grid-template-columns: repeat(4,1fr); }
  .batch-hero-grid > :first-child { grid-column: 1 / -1; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { width: auto; flex: 0 0 auto; }
}
@media (max-width: 720px) {
  .topbar-heading { display: none; }
  .topbar { gap: 9px; }
  .global-search { flex: 1; width: auto; }
  .topbar .btn-create span { display: none; }
  .topbar .btn-create { width: 40px; padding: 0; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .product-grid, .operation-grid, .tooling-grid, .media-grid, .quality-queue { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar .inline-search { width: 100%; }
  .toolbar .select { flex: 1; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero .product-visual { height: 200px; }
  .detail-hero > :last-child { grid-column: auto; justify-content: flex-start; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .summary-list { grid-template-columns: 1fr; }
  .card-stat-grid { grid-template-columns: repeat(2,1fr); }
  .route-step { grid-template-columns: 43px minmax(0,1fr) auto; }
  .route-step .route-time { grid-column: 2; }
  .route-step .hide-mobile { display: none; }
  .batch-row { grid-template-columns: minmax(180px,1fr) 105px auto; }
  .batch-row > :not(:first-child):not(.batch-progress):not(:last-child) { display: none; }
  .tech-card-row { grid-template-columns: 1fr auto; }
  .tech-card-row > :not(:first-child):not(:last-child) { display:none; }
  .batch-hero-grid { grid-template-columns: repeat(2,1fr); }
  .batch-route-step { grid-template-columns: 38px minmax(0,1fr); }
  .batch-route-step > :nth-child(n+3) { grid-column: 2; }
  .operator-main { padding: 13px; }
  .operator-topbar { padding: 0 13px; }
  .operator-media { height: 220px; }
  .operator-step-body { padding: 17px; }
  .operator-footer-actions { grid-template-columns: 1fr; }
  .decision-buttons { grid-template-columns: 1fr 1fr; }
  .quality-check-row { grid-template-columns: 1fr 1fr; }
  .quality-check-row > :last-child { grid-column: 1 / -1; }
  .diff-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .setting-row { grid-template-columns: 1fr; gap: 9px; }
  .login-showcase { min-height: 390px; padding: 30px 24px; }
  .login-features { display: none; }
  .login-headline { font-size: 42px; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-footer { border-radius: 0; }
  .wizard-steps { overflow-x: auto; }
  .wizard-step { flex: 0 0 120px; }
  .material-requirement { grid-template-columns: 1fr 90px; }
  .material-requirement > :nth-child(n+3) { grid-column: auto; }
}
@media (max-width: 460px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 0 11px; }
  .search-kbd, .topbar .notifications { display: none; }
  .page-title { font-size: 28px; }
  .metric-card { min-height: 112px; }
  .quick-actions { grid-template-columns: 1fr; }
  .tabs { margin-left: -3px; margin-right: -3px; }
  .detail-facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .card-stat-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 20px; }
  .pareto-row { grid-template-columns: 110px 1fr 35px; }
  .pareto-cumulative { display: none; }
}

/* Printing */
@media print {
  :root { --bg: white; --surface: white; --surface-strong: white; }
  body { background: white; font-size: 10pt; }
  .sidebar, .topbar, .page-actions, .toolbar, .tabs, .no-print, .toast-stack, .modal-backdrop { display: none !important; }
  .main-shell { margin: 0; }
  .content { padding: 0; }
  .page { max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  .data-table { min-width: 0; }
  .route-step { break-inside: avoid; }
  .print-header { display: block !important; }
}
.print-header { display: none; margin-bottom: 18px; border-bottom: 1px solid #999; padding-bottom: 10px; }

/* MVP integration refinements */
.modal.modal-lg { width: min(920px, 100%); }
.modal.modal-xl { width: min(1160px, 100%); }
.tag { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--muted); font-size:11px; }
.tag button { border:0; background:transparent; color:var(--subtle); cursor:pointer; padding:0; font-size:14px; line-height:1; }
.quick-action { min-height:64px; flex-direction:row; align-items:center; justify-content:flex-start; gap:11px; width:100%; }
.quick-action > span:nth-child(2) { flex:1; min-width:0; }
.quick-action small { display:block; margin-top:2px; color:var(--muted); font-size:10px; font-weight:400; }
.quick-action-icon { width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center; border-radius:10px; background:var(--accent-pale); color:var(--accent-strong); }
.quick-action-icon.success { background:var(--success-soft); color:var(--success); }
.quick-action-icon.warning { background:var(--warning-soft); color:var(--warning); }
.quick-action-icon.danger { background:var(--danger-soft); color:var(--danger); }
.metric-icon.success { background:var(--success-soft); color:var(--success); }
.metric-icon.warning { background:var(--warning-soft); color:var(--warning); }
.metric-icon.danger { background:var(--danger-soft); color:var(--danger); }
.metric-icon.info { background:var(--info-soft); color:var(--info); }
.route-index.done { background:var(--success-soft); color:var(--success); border-color:#c7ddcf; }
.route-index.current { background:var(--accent-soft); color:var(--accent-strong); border-color:#d7b47a; box-shadow:0 0 0 3px rgba(168,120,62,.1); }
.toast.danger .toast-icon { background:var(--danger-soft); color:var(--danger); }
.chart-bars { align-items:stretch; }
.chart-bar-wrap { width:auto; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; min-width:0; }
.chart-bar-group { width:100%; }
.chart-label { max-width:70px; overflow:hidden; text-overflow:ellipsis; }
.chart-text { font-size:10px; }
.stock-meter span.danger { background:var(--danger); }
.mobile-menu-btn { flex:0 0 auto; }
@media (max-width: 720px) { .modal-backdrop{padding:8px;align-items:end}.modal{max-height:96vh;border-radius:16px 16px 0 0}.modal-footer{flex-wrap:wrap}.modal-footer .btn{flex:1}.quick-action{min-height:60px}.tag{white-space:nowrap} }
.operator-product { flex:1; display:flex; flex-direction:column; gap:1px; }
.operator-product strong { color:var(--text); font-size:12px; }
.operator-step-card, .operator-panel { background:var(--surface); }
.operator-media-placeholder { width:min(320px,78%); height:170px; padding:20px; grid-template-rows:auto auto auto auto; gap:7px; text-align:center; }
.operator-media-placeholder span { color:var(--muted); font-size:11px; }
.operator-result { display:flex; align-items:flex-start; gap:10px; }
.operator-result p { margin:3px 0 0; }
.operator-instructions ol { color:var(--text); }
.operator-panel .checkbox-row { display:grid; grid-template-columns:20px 24px 1fr; gap:8px; align-items:start; padding:8px 0; border-bottom:1px solid var(--line); }
.operator-panel .check-cell { width:24px; color:var(--success); }
.operator-hold { max-width:720px; margin:80px auto; padding:48px; }
.hold-icon { width:64px; height:64px; display:grid; place-items:center; margin:0 auto 16px; border-radius:18px; background:rgba(255,255,255,.55); color:var(--warning); }
.tech-card-row { width:100%; grid-template-columns:42px minmax(0,1fr) auto 20px; gap:12px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--surface); text-align:left; }
.tech-card-row + .tech-card-row { margin-top:8px; }
.tech-card-main { min-width:0; display:block; }
.tech-card-name { white-space:normal; }
.batch-product { width:100%; display:flex; align-items:center; gap:10px; padding:8px; border:0; border-radius:10px; background:transparent; text-align:left; cursor:pointer; }
.batch-product:hover { background:var(--accent-pale); }
.batch-list-card { width:100%; display:grid; grid-template-columns:minmax(0,1fr) minmax(170px,240px) 24px; gap:14px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); text-align:left; cursor:pointer; }
.batch-list-card:hover { border-color:var(--line-strong); background:var(--accent-pale); }
.batch-list-card .batch-product { padding:0; }
.media-card { border:1px solid var(--line); border-radius:13px; background:var(--surface); box-shadow:var(--shadow-sm); }
.modal .defect-photo { width:auto; height:auto; min-height:190px; display:flex; flex-direction:column; gap:8px; justify-content:center; padding:22px; text-align:center; }
.route-index.wait { background:var(--warning-soft); color:var(--warning); border-color:#ead7b6; }
.route-index.check { background:var(--info-soft); color:var(--info); border-color:#cddde3; }
@media (max-width:720px){.batch-list-card{grid-template-columns:1fr 20px}.batch-list-card .batch-progress{grid-column:1/-1;order:3}.tech-card-row{grid-template-columns:38px minmax(0,1fr) 18px}.tech-card-row> :nth-child(3){display:none}}

/* Final responsive containment guards */
.card, .card-header, .card-body, .dashboard-grid, .dashboard-grid > *, .page, .content { min-width: 0; }
@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .card-header { padding-left: 14px; padding-right: 14px; }
  .card-body { padding-left: 14px; padding-right: 14px; }
  .card-header .btn { flex: 0 0 auto; }
}
.profile-meta { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.profile-name, .profile-role { display: block; }
@media (max-width: 980px) { .profile-meta { display: none; } }

/* Material accounting and procurement */
.table-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.table-link:hover .table-primary { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.inventory-table th:nth-child(1) { min-width: 230px; }
.inventory-table th:nth-child(6) { min-width: 180px; }
.forecast-head { gap: 18px; align-items: flex-end; }
.inventory-state {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.inventory-state > .icon { flex: 0 0 auto; width: 24px; height: 24px; }
.inventory-state > div { display: flex; flex-direction: column; gap: 3px; }
.inventory-state strong { font-size: 13px; }
.inventory-state span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.inventory-state.success { border-color: #c7ddcf; background: var(--success-soft); color: var(--success); }
.inventory-state.warning { border-color: #ead7b6; background: var(--warning-soft); color: var(--warning); }
.inventory-state.danger { border-color: #ecc9c4; background: var(--danger-soft); color: var(--danger); }
.inventory-state.success span, .inventory-state.warning span, .inventory-state.danger span { color: var(--text); opacity: .76; }
.stock-cell { min-width: 155px; }
.stock-cell small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.stock-meter { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.stock-meter span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.movement-list { display: flex; flex-direction: column; gap: 8px; }
.movement-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.movement-item:last-child { border-bottom: 0; }
.movement-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; }
.movement-icon.in { background: var(--success-soft); color: var(--success); }
.movement-icon.out { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 720px) {
  .forecast-head { align-items: stretch; flex-direction: column; }
  .forecast-head .segmented { align-self: stretch; }
  .forecast-head .segmented button { flex: 1; }
  .inventory-state { padding: 13px; }
}

/* ========================================================================== 
   UX/UI hardening v1.3.1
   Prevents label/value collisions, improves quality cards and restores
   discoverable icon controls without changing the Light Up visual language.
   ========================================================================== */

/* Search fields rendered without the generic .input class must still use the
   same geometry. The icon must never overlap the placeholder or typed text. */
.inline-search {
  min-width: min(260px, 100%);
}
.inline-search > .icon {
  z-index: 1;
  pointer-events: none;
}
.inline-search input {
  width: 100%;
  height: 39px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.inline-search input::placeholder { color: #aaa197; }
.inline-search input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(168,120,62,.10);
}

/* Labels and values were inline elements, so margin-top never created a real
   separation. Treat each fact as a vertical, shrink-safe unit. */
.fact,
.summary-item,
.product-card-content,
.product-card-footer,
.card-body,
.card-header > *,
.inspection-card,
.inspection-product > div,
.modal-heading {
  min-width: 0;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fact-label,
.fact-value,
.summary-item-label,
.summary-item-value,
.summary-item > strong {
  display: block;
}
.fact-value,
.summary-item-value,
.summary-item > strong {
  margin-top: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.summary-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}
.summary-item > .badge { align-self: flex-start; }
.product-name,
.product-meta,
.product-card-footer,
.card-title,
.card-subtitle,
.page-description,
.detail-title,
.table-primary,
.table-secondary,
.quality-check-name,
.quality-check-method,
.modal-title,
.modal-subtitle,
.field-label {
  overflow-wrap: anywhere;
}
.product-card-footer { flex-wrap: wrap; }

/* Quality queue: the original three-column grid was nested inside a half-width
   page column, making a single card only ~175px wide. */
.quality-queue {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}
.inspection-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.inspection-card-top {
  align-items: flex-start;
}
.inspection-product {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  font-family: inherit;
  font-size: inherit;
}
.inspection-product .thumbnail { flex: 0 0 42px; }
.inspection-product > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inspection-product strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.inspection-product span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.inspection-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 0;
}
.inspection-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.inspection-progress { margin-top: auto; }

/* Separate the list of quality checks from the explanatory quality cards. */
.quality-list {
  overflow: hidden;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.quality-card {
  display: block;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.quality-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.quality-title { font-size: 12px; font-weight: 750; }
.quality-check-row > * { min-width: 0; }
.quality-spec strong,
.quality-spec small { display: block; overflow-wrap: anywhere; }

/* Modal interaction and content containment. */
.modal-backdrop { overflow: auto; }
.modal { isolation: isolate; }
.modal-header { flex: 0 0 auto; }
.modal-heading { flex: 1; }
.modal-close {
  position: relative;
  flex: 0 0 34px;
}
.modal-body {
  min-height: 0;
  overscroll-behavior: contain;
}
.modal-body > form { min-width: 0; }
.modal-footer { flex: 0 0 auto; flex-wrap: wrap; }
.modal-footer .btn { max-width: 100%; }

/* Visible, keyboard-accessible tooltips for icon-only controls. A native title
   remains as a fallback on browsers that do not expose generated content. */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 3000;
  left: 50%;
  top: calc(100% + 8px);
  max-width: min(240px, calc(100vw - 24px));
  padding: 6px 8px;
  border-radius: 7px;
  background: #272421;
  color: #fff;
  box-shadow: 0 7px 20px rgba(28,25,22,.22);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.modal-close[data-tooltip]::after,
.toast-close[data-tooltip]::after {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}
.modal-close[data-tooltip]:hover::after,
.modal-close[data-tooltip]:focus-visible::after,
.toast-close[data-tooltip]:hover::after,
.toast-close[data-tooltip]:focus-visible::after {
  transform: translateY(0);
}

/* Consistent clickable affordances and button text wrapping. */
[data-nav][role="link"] { cursor: pointer; }
.btn { min-width: 0; line-height: 1.25; white-space: normal; }
.icon-button,
.modal-close,
.segmented button,
.toast-close { touch-action: manipulation; }

@media (max-width: 900px) {
  .quality-check-row {
    grid-template-columns: minmax(0,1.25fr) minmax(110px,.75fr) minmax(115px,.75fr);
  }
  .quality-check-row > :first-child { display: none; }
}

@media (max-width: 720px) {
  .quality-queue { grid-template-columns: minmax(0,1fr); }
  .quality-check-row {
    grid-template-columns: minmax(0,1fr);
    gap: 8px;
  }
  .quality-check-row > :last-child { grid-column: auto; }
  .summary-list { grid-template-columns: minmax(0,1fr); }
  .modal-footer .btn { flex: 1 1 150px; }
  [data-tooltip]::after { display: none; }
}

/* ========================================================================== 
   Layout system hardening v1.3.2
   Systematic label/value separation, shrink-safe grids and numeric rhythm.
   ========================================================================== */

.numeric-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Operation metrics: icon, label and value are independent layout cells. */
.operation-card,
.operation-card > * { min-width: 0; }
.operation-times {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.time-chip {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  text-align: left;
}
.time-chip-icon {
  display: grid;
  place-items: center;
  padding-top: 1px;
  color: var(--text);
}
.time-chip-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.time-chip-label,
.time-chip-value {
  display: block;
  margin: 0;
  line-height: 1.25;
}
.time-chip-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.time-chip-value {
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Tooling facts are a semantic definition list, never an inline sentence. */
.tooling-card,
.tooling-card > * { min-width: 0; }
.tooling-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block: 13px 0;
  padding: 0;
}
.tooling-fact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.tooling-fact dt,
.tooling-fact dd {
  display: block;
  max-width: 100%;
  margin: 0;
  line-height: 1.35;
}
.tooling-fact dt {
  color: var(--muted);
  font-size: 10px;
}
.tooling-fact dd {
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.life-row .row-between { align-items: baseline; }

/* Timeline content must remain in column two; dates may not collapse into the marker column. */
.timeline-item {
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px 0;
}
.timeline-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 3px;
}
.timeline-title,
.timeline-meta,
.timeline-note {
  display: block;
  margin: 0;
  min-width: 0;
}
.timeline-title {
  font-size: 12px;
  line-height: 1.4;
}
.timeline-meta {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.timeline-note {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Quality rows use explicit minimums instead of a 120 px action column. */
.quality-check-row {
  grid-template-columns: 48px minmax(260px, 1.45fr) minmax(135px, .62fr) minmax(190px, .78fr);
  gap: 16px;
  align-items: center;
  padding: 15px 0;
}
.quality-check-copy,
.quality-spec,
.quality-input-field { min-width: 0; }
.quality-check-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.quality-check-name { line-height: 1.35; }
.quality-check-method { line-height: 1.45; }
.quality-spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quality-spec strong,
.quality-spec small {
  display: block;
  margin: 0;
  line-height: 1.35;
}
.quality-input-field .input {
  min-width: 0;
  width: 100%;
}
.quality-input-field select.input { padding-right: 34px; }
.quality-decision-grid {
  grid-template-columns: minmax(250px, 1.2fr) repeat(2, minmax(160px, .72fr));
  align-items: end;
}

/* Pareto rows: cause, count, bar and share have separate columns and spacing. */
.pareto {
  min-width: 0;
  padding: 14px 0 4px;
}
.pareto-row {
  grid-template-columns: minmax(190px, .95fr) minmax(220px, 2.35fr) 54px;
  gap: 16px;
  margin-top: 12px;
}
.pareto-label {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  line-height: 1.35;
}
.pareto-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pareto-count {
  justify-self: end;
  color: var(--text);
}
.pareto-track { min-width: 0; }
.pareto-value {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Report rows use a grid so entity, plan/fact and chart never merge. */
.report-stack { gap: 0; }
.report-list-item {
  min-width: 0;
  display: grid;
  justify-content: initial;
  gap: 16px;
  padding: 13px 0;
}
.report-time-row {
  grid-template-columns: minmax(230px, 1.2fr) minmax(190px, .82fr) minmax(120px, 140px);
}
.report-cost-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.report-entity {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}
.report-list-dot { margin-top: 5px; }
.report-entity-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.report-entity-copy strong,
.report-entity-copy small {
  display: block;
  margin: 0;
  line-height: 1.35;
}
.report-entity-copy strong { overflow-wrap: anywhere; }
.report-entity-copy small {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.report-comparison {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 1fr));
  gap: 14px;
}
.report-metric {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.report-metric span {
  color: var(--muted);
  font-size: 10px;
}
.report-metric strong {
  font-size: 12px;
  line-height: 1.35;
}
.report-progress {
  width: 100%;
  min-width: 0;
}
.report-money {
  align-self: center;
  font-size: 13px;
}

@media (max-width: 1240px) {
  .operation-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-check-row {
    grid-template-columns: minmax(235px, 1.35fr) minmax(125px, .62fr) minmax(180px, .78fr);
  }
  .quality-check-row > .quality-icon { display: none; }
  .report-time-row {
    grid-template-columns: minmax(200px, 1.1fr) minmax(180px, .85fr) minmax(110px, 130px);
  }
}

@media (max-width: 980px) {
  .tooling-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-check-row {
    grid-template-columns: minmax(0, 1fr) minmax(150px, .62fr);
    gap: 10px 16px;
  }
  .quality-check-copy { grid-column: 1 / -1; }
  .quality-spec { grid-column: 1; }
  .quality-input-field { grid-column: 2; }
  .quality-decision-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-decision-grid > :first-child { grid-column: 1 / -1; }
  .report-time-row {
    grid-template-columns: minmax(0, 1fr) minmax(180px, .75fr);
  }
  .report-progress { grid-column: 1 / -1; }
  .pareto-row {
    grid-template-columns: minmax(165px, 1fr) minmax(160px, 1.65fr) 48px;
    gap: 12px;
  }
}

@media (max-width: 720px) {
  .operation-times { grid-template-columns: 1fr; }
  .time-chip { min-height: 0; }
  .tooling-facts { grid-template-columns: 1fr; }
  .quality-check-row { grid-template-columns: minmax(0, 1fr); }
  .quality-check-copy,
  .quality-spec,
  .quality-input-field { grid-column: auto; }
  .quality-decision-grid { grid-template-columns: minmax(0, 1fr); }
  .quality-decision-grid > :first-child { grid-column: auto; }
  .report-time-row,
  .report-cost-row { grid-template-columns: minmax(0, 1fr); }
  .report-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-money { justify-self: start; }
  .pareto-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-areas:
      "label value"
      "track track";
    gap: 7px 12px;
  }
  .pareto-label { grid-area: label; }
  .pareto-track { grid-area: track; }
  .pareto-value { grid-area: value; }
}

@media (max-width: 460px) {
  .report-comparison { grid-template-columns: 1fr; }
  .pareto-label { gap: 8px; }
  .numeric-value { white-space: normal; }
  .time-chip-value,
  .pareto-count,
  .pareto-value,
  .report-money { white-space: nowrap; }
}

/* Quality specification output uses the same semantic grid as the control form. */
.quality-result {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.quality-photo-rule {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
@media (max-width: 980px) {
  .quality-result { grid-column: 2; }
}
@media (max-width: 720px) {
  .quality-result { grid-column: auto; }
}

/* Donut KPI: the number and its caption are stacked with an explicit gap. */
.donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0 18px;
}
.donut {
  --pct: 0;
  position: relative;
  width: 170px;
  height: 170px;
  flex: 0 0 170px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--success) calc(var(--pct) * 1%), #ece6de 0);
}
.donut::after {
  content: "";
  position: absolute;
  inset: 21px;
  border-radius: 50%;
  background: var(--surface-strong);
}
.donut-center {
  position: relative;
  z-index: 1;
  max-width: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text);
  text-align: center;
}
.donut-center strong,
.donut-center span {
  display: block;
  margin: 0;
  line-height: 1.2;
}
.donut-center strong {
  font-size: 24px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.donut-center span {
  color: var(--muted);
  font-size: 10px;
}

/* ========================================================================== */
/* Smart Material Import v1.4.0                                               */
/* ========================================================================== */
.modal.modal-xxl { width: min(1460px, 100%); }
.smart-import-hero,
.smart-import-callout,
.imported-material-banner,
.import-loading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.smart-import-hero,
.smart-import-callout {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}
.smart-import-callout {
  align-items: center;
  background: rgba(181,129,55,.07);
}
.smart-import-hero strong,
.smart-import-callout h3,
.import-loading strong { display: block; margin: 0 0 5px; }
.smart-import-hero p,
.smart-import-callout p,
.import-loading p { margin: 0; color: var(--muted); line-height: 1.55; }
.smart-import-icon,
.loading-orbit {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(181,129,55,.22);
  border-radius: 16px;
  background: var(--surface-warm);
  color: var(--accent-strong);
}
.loading-orbit { animation: lightup-pulse 1.5s ease-in-out infinite; }
@keyframes lightup-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 9px rgba(181,129,55,.08); } }
.smart-import-input { position: relative; display: flex; align-items: center; }
.smart-import-input > .icon { position: absolute; left: 14px; z-index: 1; color: var(--muted); pointer-events: none; }
.smart-import-input .input { padding-left: 43px; font-size: 15px; min-height: 48px; }
.smart-import-examples { margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.tag-button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 7px 11px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.tag-button:hover { border-color: var(--accent); color: var(--accent-strong); }
.import-loading { padding: 52px 24px; justify-content: center; align-items: center; text-align: left; }
.confidence-score {
  min-width: 40px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.source-badge,
.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .01em;
}
.source-badge.high { background: var(--success-soft); color: var(--success); border-color: rgba(48,118,91,.18); }
.source-badge.medium { background: var(--warning-soft); color: var(--warning); }
.source-badge.missing { background: var(--surface-muted); color: var(--muted); }
.import-review-summary {
  display: grid;
  grid-template-columns: 116px minmax(0,1fr) minmax(130px,190px);
  align-items: center;
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}
.import-source-media {
  width: 116px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-warm);
  color: var(--accent-strong);
}
.import-source-media img { width: 100%; height: 100%; object-fit: cover; }
.import-source-media.empty { min-height: 92px; }
.import-source-copy { min-width: 0; }
.import-source-copy h3 { margin: 8px 0 5px; font-family: var(--font-display); font-size: clamp(24px,2.5vw,34px); line-height: 1.1; }
.import-source-copy p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 760px; }
.import-confidence {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 15px;
  border-left: 1px solid var(--border);
}
.import-confidence strong { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--accent-strong); }
.import-confidence span { font-size: 11px; font-weight: 700; }
.import-confidence small { margin-top: 5px; color: var(--muted); line-height: 1.35; }
.import-review-grid {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(360px,.8fr);
  gap: 16px;
  align-items: start;
}
.import-review-grid > .card { min-width: 0; }
.warning-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid rgba(178,116,33,.24);
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning-strong, #7b4b10);
  line-height: 1.45;
}
.technical-facts {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}
.technical-facts > div,
.fragrance-notes > div,
.source-provenance > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-warm);
}
.technical-facts span,
.fragrance-notes span,
.source-provenance span { color: var(--muted); font-size: 10px; }
.technical-facts strong,
.fragrance-notes strong,
.source-provenance strong { overflow-wrap: anywhere; line-height: 1.4; }
.fragrance-notes { display: grid; gap: 9px; }
.application-list { display: grid; gap: 8px; }
.application-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) minmax(82px,auto);
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.application-row:last-child { border-bottom: 0; }
.application-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.application-row small { color: var(--muted); }
.application-status { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; }
.application-status.safe { background: var(--success-soft); color: var(--success); }
.application-status.blocked { background: var(--danger-soft); color: var(--danger); }
.application-status.unknown { background: var(--surface-muted); color: var(--muted-strong); }
.application-row > span:nth-child(2) strong { line-height: 1.35; }
.application-row > span:nth-child(2) small { line-height: 1.45; }
.ifra-value {
  max-width: 210px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-warm);
  line-height: 1.35;
  white-space: normal;
  text-align: right;
}
.ifra-value { justify-self: end; color: var(--muted); font-size: 10px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 9px; }
.variant-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-warm);
}
.variant-card.preferred { border-color: rgba(181,129,55,.5); box-shadow: inset 0 0 0 1px rgba(181,129,55,.15); }
.variant-card span { color: var(--accent-strong); font-weight: 760; font-variant-numeric: tabular-nums; }
.variant-card small { color: var(--muted); line-height: 1.35; }
.document-list { display: grid; gap: 8px; }
.document-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0,1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.document-row:hover { border-color: var(--accent); }
.document-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.document-row strong,.document-row small { overflow-wrap: anywhere; }
.document-row small { color: var(--muted); }
.document-type { display: grid; place-items: center; min-height: 32px; border-radius: 8px; background: var(--surface-warm); color: var(--accent-strong); font-size: 10px; font-weight: 800; }
.text-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}
.imported-material-banner {
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid rgba(181,129,55,.24);
  border-radius: var(--radius-lg);
  background: rgba(181,129,55,.07);
}
.imported-material-banner > div { min-width: 0; display: flex; align-items: center; gap: 11px; color: var(--accent-strong); }
.imported-material-banner span { min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--text); }
.imported-material-banner small { color: var(--muted); font-weight: 450; }
.source-provenance { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.source-provenance .text-button { grid-column: 1/-1; }
.empty-state.compact { min-height: 220px; }

@media (max-width: 1120px) {
  .import-review-grid { grid-template-columns: 1fr; }
  .import-review-summary { grid-template-columns: 90px minmax(0,1fr); }
  .import-source-media { width: 90px; }
  .import-confidence { grid-column: 1/-1; border-left: 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr; align-items: baseline; }
  .import-confidence small { grid-column: 1/-1; }
}
@media (max-width: 720px) {
  .modal.modal-xxl { width: 100%; }
  .smart-import-hero,.smart-import-callout,.imported-material-banner,.import-loading { flex-direction: column; }
  .imported-material-banner { align-items: stretch; }
  .imported-material-banner > div { align-items: flex-start; }
  .import-review-summary { grid-template-columns: 1fr; }
  .import-source-media { width: 100%; max-height: 180px; aspect-ratio: 16/7; }
  .import-source-media.empty { min-height: 86px; max-height: 96px; aspect-ratio: auto; }
  .import-confidence { grid-column: auto; }
  .technical-facts { grid-template-columns: 1fr; }
  .application-row { grid-template-columns: 28px minmax(0,1fr); }
  .ifra-value { grid-column: 2; justify-self: start; }
  .source-provenance { grid-template-columns: 1fr; }
  .variant-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 460px) {
  .variant-grid { grid-template-columns: 1fr; }
  .document-row { grid-template-columns: 48px minmax(0,1fr) 18px; }
}

/* IFRA and universal import hardening v1.4.1 */

/* Reliable Smart Material Import persistence v1.4.2 */
.import-sync-notice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(181, 129, 55, .28);
  border-radius: var(--radius-lg);
  background: var(--warning-soft);
  color: var(--text);
}
.import-sync-notice.pending {
  border-color: rgba(83, 110, 129, .24);
  background: rgba(83, 110, 129, .08);
}
.import-sync-notice.danger {
  border-color: rgba(173, 72, 58, .26);
  background: var(--danger-soft);
}
.import-sync-notice-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--accent-strong);
}
.import-sync-notice.danger .import-sync-notice-icon { color: var(--danger); }
.import-sync-notice > div:nth-child(2) { min-width: 0; }
.import-sync-notice strong { display: block; line-height: 1.35; }
.import-sync-notice p { margin: 4px 0 0; color: var(--muted-strong); line-height: 1.45; }
.import-sync-notice small { display: block; margin-top: 5px; color: var(--muted); }
@media (max-width: 720px) {
  .import-sync-notice { grid-template-columns: 38px minmax(0, 1fr); align-items: start; }
  .import-sync-notice-icon { width: 38px; height: 38px; }
  .import-sync-notice .btn { grid-column: 1 / -1; width: 100%; }
}
