:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel2: #f7f9fc;
  --line: #e3e8ef;
  --text: #1f2a37;
  --muted: #6b7a90;
  --accent: #2f7cf6;
  --accent2: #1f6ae0;
  --sidebar-w: 200px;
  --topbar-h: 56px;
  --nav-active-bg: #eaf2ff;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #202020;
  color: var(--text);
}

.app {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar content";
  background: #0e0e0e;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

/* --- top bar --- */
.topbar {
  grid-area: topbar;
  background:
    linear-gradient(
      270deg,
      #3a3a3a 0%,
      #242424 22%,
      #161616 52%,
      #0e0e0e 100%
    );
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  z-index: 10;
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      270deg,
      #ffffff2e 0%,
      #ffffff16 14%,
      #ffffff08 32%,
      transparent 55%
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 1px,
      #ffffff06 1px 2px
    );
  mix-blend-mode: soft-light;
}
.topbar::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -6%;
  width: 55%;
  height: 180%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 85% 45%,
    #ffffff28 0%,
    #ffffff12 30%,
    #ffffff06 50%,
    transparent 72%
  );
}
.topbar > * {
  position: relative;
  z-index: 1;
}

.brand-slot {
  width: var(--sidebar-w);
  height: 100%;
  flex: none;
  border-right: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
}
.brand-logo {
  max-width: 100%;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transform: translateX(10px) scale(0.9);
  transform-origin: center center;
}
.brand-tagline {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-left: 4px;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.window-controls {
  display: none;
  align-self: stretch;
  align-items: stretch;
  margin-left: 8px;
  flex: none;
}
.window-control-btn {
  width: 46px;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #d7d7d7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.window-control-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  shape-rendering: geometricPrecision;
}
.window-control-btn:hover {
  color: #fff;
  background: #ffffff18;
}
.window-control-btn:active {
  background: #ffffff24;
}
.window-control-btn:focus-visible {
  outline: 2px solid #79a9ff;
  outline-offset: -3px;
}
.window-close-btn:hover {
  background: #c42b1c;
}
.window-close-btn:active {
  background: #a92317;
}
.window-icon-restore {
  display: none;
}
.window-control-btn.is-maximized .window-icon-maximize {
  display: none;
}
.window-control-btn.is-maximized .window-icon-restore {
  display: block;
}

html.electron-shell .topbar {
  padding-right: 0;
  -webkit-app-region: drag;
  -webkit-user-select: none;
  user-select: none;
}
html.electron-shell .window-controls {
  display: flex;
}
html.electron-shell .topbar button,
html.electron-shell .topbar a,
html.electron-shell .topbar input,
html.electron-shell .topbar select,
html.electron-shell .topbar-right,
html.electron-shell .window-controls {
  -webkit-app-region: no-drag;
}

/* Keep scrolling inside the app content instead of allowing a native Windows
   page scrollbar to appear outside the layout. The narrow inset thumb has no
   arrows or visible track. */
.app,
.app * {
  scrollbar-width: thin;
  scrollbar-color: #98a2b3 transparent;
}
.app::-webkit-scrollbar,
.app *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.app::-webkit-scrollbar-track,
.app *::-webkit-scrollbar-track {
  background: transparent;
}
.app::-webkit-scrollbar-thumb,
.app *::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #98a2b3;
  background-clip: padding-box;
}
.app::-webkit-scrollbar-thumb:hover,
.app *::-webkit-scrollbar-thumb:hover {
  background: #667085;
  background-clip: padding-box;
}
.app::-webkit-scrollbar-thumb:active,
.app *::-webkit-scrollbar-thumb:active {
  background: #475467;
  background-clip: padding-box;
}
.app::-webkit-scrollbar-button,
.app *::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}
.app::-webkit-scrollbar-corner,
.app *::-webkit-scrollbar-corner {
  background: transparent;
}

.announce-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  background: transparent;
  color: #e8e8e8;
  cursor: pointer;
  padding: 0;
}
.announce-btn:hover {
  background: #2a2a2a;
  border-color: #555;
}
.announce-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e85d04;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* Message inbox page */
.msg-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 8px 32px;
}
.msg-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.msg-page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #222;
}
.msg-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #555;
}
.msg-delete-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.msg-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8e8e8;
}
.msg-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #666;
}
.msg-filter select,
.msg-filter input[type="date"] {
  min-width: 140px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: #333;
}
.msg-list {
  display: flex;
  flex-direction: column;
}
.msg-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 4px;
  border-bottom: 1px dashed #d8d8d8;
}
.msg-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 3px;
  cursor: pointer;
}
.msg-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.msg-row-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  width: 100%;
}
.msg-row-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.35;
}
.msg-row.unread .msg-row-title {
  color: #0b0b0b;
}
.msg-row-preview {
  font-size: 13px;
  color: #8a8a8a;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.msg-row-date {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  padding-top: 2px;
}
.msg-row-main:hover .msg-row-title {
  color: var(--accent, #2563eb);
}
.msg-empty,
.msg-loading {
  text-align: center;
  color: #888;
  padding: 40px 12px;
  font-size: 14px;
}
.msg-detail-toolbar {
  margin-bottom: 16px;
}
.msg-detail-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}
.msg-detail-meta {
  margin: 0 0 20px;
  font-size: 13px;
  color: #888;
}
.msg-detail-body {
  font-size: 15px;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
}
.msg-detail-attachments {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
}
.msg-detail-attachments h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}
.msg-att-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-att-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent2, #2563eb);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.msg-att-list a:hover { text-decoration: underline; }
.msg-att-size {
  color: #888;
  font-weight: 400;
  font-size: 12px;
}
.msg-row-att {
  display: inline-block;
  margin-left: 6px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
}
.ann-file-hint {
  display: block;
  font-size: 12px;
  color: var(--muted, #888);
  font-weight: 400;
}
.ann-attach-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ann-attach-label {
  font-size: 13px;
  color: var(--muted);
}
.ann-attach-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ann-files-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ann-attach-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line, #d0d5dd);
  background: #fff;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.ann-attach-btn:hover {
  background: #f8fafc;
  border-color: var(--accent2, #2563eb);
  color: var(--accent2, #2563eb);
}
.ann-attach-btn:active {
  transform: scale(0.96);
}
.ann-files-input:focus-visible + .ann-attach-btn {
  outline: 2px solid var(--accent2, #2563eb);
  outline-offset: 2px;
}
.ann-attach-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ann-files-status {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}

.announce-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 10px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.announce-item.unread {
  border-color: #f0c9a8;
  background: #fff8f2;
}
.announce-item h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.announce-item .ann-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.announce-item .ann-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}
.announce-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 14px;
}

.admin-announce-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-announce-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.admin-announce-form input[type="text"],
.admin-announce-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.ann-audience {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.ann-default-check {
  margin-top: -4px;
}
.ann-user-pick {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}
.ann-user-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 12px;
}
.ann-user-list label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin: 0;
}
.admin-ann-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-ann-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-ann-row strong { display: block; font-size: 14px; }
.admin-ann-row .ann-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.report-modal-card { max-width: 480px; }
.report-form { display: flex; flex-direction: column; gap: 12px; }
.report-intro {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #666);
  line-height: 1.45;
}
.report-color-summary {
  margin: 0;
  padding: 10px 12px;
  background: #f5f6f8;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #222;
}
.report-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d0d5dd);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}
.report-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  border: 0;
  margin-top: 4px;
}
.settings-sub {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--muted, #666);
}
.admin-report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.admin-report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-report-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: #fafbfc;
}
.admin-report-row.is-done {
  opacity: 0.72;
}
.admin-report-main { min-width: 0; flex: 1; }
.admin-report-main strong {
  display: block;
  font-size: 14px;
}
.admin-report-comment {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}
.admin-report-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.current-user {
  font-size: 13px;
  color: #e8e8e8;
  font-weight: 600;
}
.logout-btn {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #b0b0b0;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.logout-btn:hover {
  border-color: #6a6a6a;
  color: #fff;
  background: #1f1f1f;
}

/* --- sidebar --- */
.sidebar {
  grid-area: sidebar;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-top-left-radius: 0;
  padding: 10px 0;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  position: relative;
}

.nav-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  background: #e8f4f3;
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
  transition:
    transform .32s cubic-bezier(.4, 0, .2, 1),
    width .32s cubic-bezier(.4, 0, .2, 1),
    height .32s cubic-bezier(.4, 0, .2, 1);
}
.nav-pill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #0d7a78;
}
.nav-pill.is-ready { opacity: 1; }
.nav-pill:not(.is-ready) { transition: none; opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  position: relative;
  z-index: 1;
  transition: color .2s ease;
}

.nav-item[hidden] { display: none; }
.nav-item:hover { background: #f2f5f9; }
.nav-item.active {
  background: transparent;
  color: #0d7a78;
  font-weight: 600;
}
.nav-item.active:hover { background: transparent; }

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group[hidden] { display: none; }
.nav-group-toggle .nav-chevron {
  margin-left: auto;
  display: inline-flex;
  transition: transform .2s ease;
}
.nav-group.is-open .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}
.nav-group.is-open .nav-group-toggle {
  color: #0d7a78;
  font-weight: 600;
}
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 8px;
}
.nav-sub[hidden] { display: none; }
.nav-sub-item {
  font-size: 12.5px;
  padding-left: 14px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex: none;
}

/* --- main content --- */
.content {
  grid-area: content;
  background: var(--bg);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: 18px 22px 28px;
  overflow: auto;
  min-width: 0;
  min-height: 0;
  overscroll-behavior: contain;
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.view-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.placeholder {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

/* --- Fleet Formula search grid --- */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}
.fleet-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}
.fleet-grid input,
.fleet-grid select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
}
.fleet-grid input:focus,
.fleet-grid select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.fleet-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 1px;
}
.fleet-more-btn {
  border: none;
  background: transparent;
  color: var(--accent2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  justify-self: start;
}
.fleet-more-btn:hover { color: var(--accent); }
.fleet-more-chevron { font-size: 11px; }
.fleet-more-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
}
.fleet-more-grid.collapsed { display: none; }
@media (max-width: 1100px) {
  .fleet-grid,
  .fleet-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fleet-grid,
  .fleet-more-grid { grid-template-columns: 1fr; }
  .fleet-actions { flex-wrap: wrap; }
}

.search-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.search-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 140px;
}
.search-fields input,
.search-fields select {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
}
.search-fields input:focus,
.search-fields select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.search-fields select:disabled { opacity: .45; }

/* OEM Search — 3-column result grid */
.oem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}
.oem-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.oem-grid input,
.oem-grid select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 400;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.oem-grid input:focus,
.oem-grid select:focus {
  outline: none;
  border-color: var(--accent);
}
.oem-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  padding-bottom: 1px;
}
@media (max-width: 860px) {
  .oem-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .oem-grid { grid-template-columns: 1fr; }
  .oem-actions { flex-wrap: wrap; }
}

.hint { color: var(--muted); font-size: 12px; margin: 8px 2px 0; }
.hint code {
  background: var(--panel2);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.results { margin-top: 16px; }
.result-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.result-list { min-width: 0; }

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

.result-table thead th {
  background: #dceafc;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid #c5d8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.result-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-table tbody tr:nth-child(even) { background: #f5f7fa; }
.result-table tbody tr:nth-child(odd) { background: #fff; }
.result-row { cursor: pointer; }
.result-row:hover td { background: #eaf2ff; }

.col-no { width: 48px; text-align: center; color: var(--muted); }
.col-color { width: 88px; }
.col-year { color: #c4702a; font-weight: 500; }

.color-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: 1px solid #0000001a;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

.color-cell .swatch {
  width: 28px;
  height: 28px;
}

.variant-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
  background:
    conic-gradient(
      #7eb8e8 0deg 60deg,
      #b0b0b0 60deg 120deg,
      #e8d56b 120deg 180deg,
      #e07a6a 180deg 240deg,
      #8a9aa8 240deg 300deg,
      #c5ccd4 300deg 360deg
    );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

.badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-block;
}
.badge.yes { background: #e4f7ec; color: #1d7a45; }
.badge.no { background: #fff1e4; color: #a35b12; }

.pager { display: flex; justify-content: center; gap: 10px; margin: 18px 0; }
.pager button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: default; }

.detail-overlay {
  position: fixed;
  inset: 0;
  background: #0007;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.detail-overlay.hidden { display: none; }
.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 1080px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 22px 22px 18px;
  position: relative;
}
.detail-card--combo {
  max-width: 864px; /* 1080 * 0.8 */
}
.close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}
.detail-top-actions {
  position: absolute;
  top: 10px;
  right: 46px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.detail-correct {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}
.detail-correct:hover { color: var(--accent2, #2563eb); }
.detail-star {
  position: static;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  color: #c7ccd3;
}
.detail-star svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.detail-star:hover { color: #f0b429; }
.detail-star.saved { color: #f0b429; }
.detail-star.saved svg { fill: #f0b429; stroke: #f0b429; }
.detail-card h2 { margin: 0 0 4px; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 0;
  min-height: 420px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 12px;
  color: var(--text);
}
.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent2);
  flex: none;
}

.detail-left {
  padding-right: 18px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.detail-mid {
  padding-left: 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ci-swatch {
  width: 100%;
  height: 141px; /* 94 * 1.5 */
  border-radius: 8px;
  border: 1px solid #00000014;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

/* Shared CSS material overlays (detail chip + hover preview) */
.material-chip,
.chip-preview-face {
  position: relative;
  overflow: hidden;
  background-size: cover;
}
.material-chip::before,
.material-chip::after,
.chip-preview-face::before,
.chip-preview-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.material-chip.coat-solid::before,
.chip-preview-face.coat-solid::before {
  background: linear-gradient(
    135deg,
    #ffffff55 0%,
    #ffffff14 28%,
    transparent 48%,
    #00000012 100%
  );
}

.material-chip.coat-metallic::before,
.chip-preview-face.coat-metallic::before {
  background:
    radial-gradient(circle at 22% 30%, #ffffffaa 0 1px, transparent 1.6px),
    radial-gradient(circle at 58% 48%, #ffffff88 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 22%, #ffffffcc 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 40% 70%, #ffffff66 0 1px, transparent 1.5px),
    radial-gradient(circle at 85% 65%, #ffffff99 0 0.9px, transparent 1.4px),
    radial-gradient(circle at 12% 78%, #ffffff77 0 1px, transparent 1.5px),
    linear-gradient(120deg, #ffffff40 0%, transparent 35%, #ffffff18 55%, transparent 75%);
  opacity: .95;
}
.material-chip.coat-metallic::after,
.chip-preview-face.coat-metallic::after {
  background: repeating-linear-gradient(
    100deg,
    transparent 0 2px,
    #ffffff0d 2px 3px
  );
  mix-blend-mode: soft-light;
}

.material-chip.coat-pearl::before,
.chip-preview-face.coat-pearl::before {
  background: linear-gradient(
    125deg,
    #ffffff66 0%,
    #a8d8ff44 22%,
    #ffb8e644 48%,
    #ffe9a844 72%,
    #ffffff22 100%
  );
  mix-blend-mode: soft-light;
}
.material-chip.coat-pearl::after,
.chip-preview-face.coat-pearl::after {
  background: radial-gradient(ellipse at 30% 20%, #ffffff88 0%, transparent 45%);
}

.material-chip.coat-effect::before,
.chip-preview-face.coat-effect::before {
  background: linear-gradient(
    140deg,
    #66e0ff55 0%,
    #b066ff44 35%,
    #ff66b044 65%,
    #ffe06644 100%
  );
  mix-blend-mode: soft-light;
}
.material-chip.coat-effect::after,
.chip-preview-face.coat-effect::after {
  background: radial-gradient(circle at 70% 30%, #ffffff77 0%, transparent 40%);
}
.ci-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.ci-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px;
  align-items: start;
}
.ci-k { color: var(--muted); }
.ci-v {
  color: var(--text);
  word-break: break-word;
}

.formula-wrap {
  flex: 1;
  min-height: 0;
  max-height: 52vh;
  width: 100%;
}
.detail-mid .batch { margin-top: 4px; }
.detail-mid .hint { margin-top: 10px; }

table.formula.result-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
table.formula.result-table .col-toner-color {
  width: 40px;
  padding-left: 10px;
  padding-right: 4px;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}
td.wt-cell {
  cursor: text;
  border-bottom: 1px dashed #b7c0cc;
  outline: none;
  border-radius: 2px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
td.wt-cell:hover { background-color: #eef2f7; }
td.wt-cell:focus {
  background-color: #fff;
  box-shadow: 0 0 0 2px #0d7a78 inset;
  border-bottom-color: transparent;
}
table.formula.result-table th:nth-child(2),
table.formula.result-table td:nth-child(2) { width: 56px; }   /* Layer */
table.formula.result-table th:nth-child(3),
table.formula.result-table td:nth-child(3) { width: 96px; }   /* Toner code */
table.formula.result-table th:nth-child(5),
table.formula.result-table td:nth-child(5),
table.formula.result-table th:nth-child(6),
table.formula.result-table td:nth-child(6) { width: 96px; }   /* Weight / ACUM */
table.formula.result-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
}
table.formula.result-table th.num,
table.formula.result-table td.num {
  padding-left: 8px;
  padding-right: 12px;
}
.toner-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid #00000022;
  display: inline-block;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px #ffffff33;
}

.toner-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.toner-toolbar input[type="search"] {
  flex: 1;
  max-width: 360px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.toner-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}
.toner-count {
  color: var(--muted);
  font-size: 13px;
}
.toner-batch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}
.toner-batch[hidden] { display: none; }
.toner-batch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.toner-check-col {
  width: 36px;
  text-align: center;
  padding-left: 10px !important;
  padding-right: 4px !important;
}
.toner-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent, #0d7a78);
}
.toner-price {
  font-weight: 600;
  white-space: nowrap;
}
.print-btn { margin-left: auto; }

.mf-toner-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mf-toner-select select { flex: 1; min-width: 0; }
.mf-toner-swatch { flex: 0 0 auto; }
.mf-toner-table .col-toner-color {
  width: 40px;
  padding-left: 10px;
  padding-right: 4px;
  text-align: center;
}
.toner-size-edit {
  width: 84px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}
.toner-size-edit:focus { outline: none; border-color: var(--accent); }
.toner-size-edit.saved { border-color: #1d7a45; background: #e4f7ec; }

/* Admin user management */
.admin-users-header {
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.view-header.admin-users-header h1 { margin-bottom: 0; }
.admin-installer-download {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #b9d0f2;
  border-radius: 7px;
  background: #edf5ff;
  color: #1e5cab;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.admin-installer-download:hover {
  border-color: #7ca8e7;
  background: #e1eeff;
  color: #164988;
}
.admin-installer-download:focus-visible {
  outline: 3px solid #2563eb3d;
  outline-offset: 2px;
}
.admin-installer-download-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 5px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
}
.admin-installer-download-url {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.admin-create-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
}
.admin-create-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.admin-create-fields input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
.admin-create-fields input:focus { outline: none; border-color: var(--accent); }
.admin-check {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  align-self: end;
}
.admin-create-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
@media (max-width: 720px) {
  .admin-create-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .admin-create-fields { grid-template-columns: 1fr; }
}
.admin-users-table-wrap {
  position: relative;
}
.admin-users-table {
  min-width: 1800px;
}
.admin-actions-head,
.admin-actions-cell {
  position: sticky !important;
  right: 0;
  width: 112px;
  min-width: 112px;
  max-width: 112px !important;
  box-shadow: -10px 0 16px -16px #26364d;
}
.admin-actions-head {
  z-index: 3 !important;
  background: #dceafc !important;
}
.admin-actions-cell {
  z-index: 2;
  overflow: visible !important;
  text-overflow: clip !important;
}
.admin-users-table tbody tr:nth-child(odd) .admin-actions-cell { background: #fff; }
.admin-users-table tbody tr:nth-child(even) .admin-actions-cell { background: #f5f7fa; }
.admin-users-table tbody tr:hover .admin-actions-cell { background: #eaf2ff; }
.admin-actions-menu {
  width: 100%;
}
.admin-actions-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  font-weight: 600;
  user-select: none;
}
.admin-actions-trigger::-webkit-details-marker { display: none; }
.admin-actions-trigger::marker { content: ""; }
.admin-actions-trigger:focus-visible {
  outline: 3px solid #2563eb3d;
  outline-offset: 2px;
}
.admin-actions-caret {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.admin-actions-menu[open] .admin-actions-caret {
  transform: rotate(180deg);
}
.admin-actions {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  white-space: normal;
}
.admin-actions .btn-sm {
  width: 100%;
  min-height: 31px;
  padding-right: 6px;
  padding-left: 6px;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger {
  border: 1px solid #d92d20;
  border-radius: 6px;
  padding: 8px 14px;
  background: #d92d20;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #b42318; border-color: #b42318; }
.btn-danger:active { background: #912018; border-color: #912018; }
.btn-danger:disabled { opacity: 0.6; cursor: default; }
.badge-admin, .badge-banned, .badge-active {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-admin { background: #e8f4f3; color: #0d7a78; }
.badge-active { background: #e4f7ec; color: #1d7a45; }
.badge-banned { background: #fef3f2; color: #b42318; }

.admin-web-login-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: #344054;
  cursor: pointer;
}

.admin-web-login-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #0d7a78;
}

.admin-web-login-toggle:has(input:not(:checked)) span { color: #b42318; }
.admin-web-login-toggle:has(input:checked) span { color: #1d7a45; }
.admin-web-login-toggle:has(input:disabled) { cursor: not-allowed; opacity: 0.65; }

/* Admin Formula data management */
.formula-data-header {
  align-items: flex-end;
  gap: 18px;
}
.formula-data-header h1 { margin-bottom: 5px; }
.formula-data-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.formula-publish-status {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.4fr);
  gap: 12px 24px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid #a9d8cf;
  border-radius: 8px;
  background: linear-gradient(135deg, #effbf8, #f7fbff);
}
.formula-status-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.formula-status-label {
  color: #47605c;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.formula-status-copy strong {
  color: #086b64;
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
}
.formula-status-copy > span:last-child {
  color: var(--muted);
  font-size: 12px;
}
.formula-status-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  gap: 8px 14px;
}
.formula-status-counts span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #47605c;
  font-size: 12px;
}
.formula-status-counts strong {
  color: var(--text);
  font-size: 15px;
}
.formula-status-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid #cce5df;
  color: #42635e;
  font-size: 12px;
  line-height: 1.5;
}
.formula-data-toolbar {
  display: grid;
  grid-template-columns: 200px minmax(280px, 620px) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}
.formula-data-toolbar label,
.formula-editor-id-grid label,
.formula-editor-field-grid label,
.formula-variant-fields label,
.formula-toner-row label,
.formula-combination-row label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}
.formula-data-toolbar input,
.formula-data-toolbar select,
.formula-editor-id-grid input,
.formula-editor-id-grid select,
.formula-editor-field-grid input,
.formula-variant-fields input,
.formula-toner-row input,
.formula-combination-row input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
.formula-data-toolbar input:focus,
.formula-data-toolbar select:focus,
.formula-editor-card input:focus,
.formula-editor-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #0d7a7817;
}
.formula-data-results { margin-bottom: 14px; }
.formula-data-table { min-width: 1120px; }
.formula-data-table th:last-child,
.formula-data-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -10px 0 16px -16px #26364d;
}
.formula-data-table th:last-child {
  z-index: 3;
  background: #dceafc;
}
.formula-data-table tbody tr:nth-child(odd) td:last-child { background: #fff; }
.formula-data-table tbody tr:nth-child(even) td:last-child { background: #f5f7fa; }
.formula-data-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}
.formula-data-pager > div {
  display: flex;
  gap: 8px;
}
.formula-data-error { color: #b42318; }
.formula-change-panel { margin-bottom: 20px; }
.formula-change-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}
.formula-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 2px;
  border-top: 1px solid var(--line);
}
.formula-change-row:first-child { border-top: 0; }
.formula-change-row > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.formula-change-row strong { font-size: 13px; }
.formula-change-row span {
  color: var(--muted);
  font-size: 12px;
}
.formula-change-meta {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.formula-change-meta code {
  color: #0d7a78;
  font-size: 11px;
}

.formula-editor-overlay {
  align-items: stretch;
  padding: 18px;
}
.formula-editor-card {
  display: flex;
  max-width: 1380px;
  max-height: calc(100vh - 36px);
  flex-direction: column;
  margin: auto;
}
.formula-editor-card > .modal-header {
  flex: 0 0 auto;
  padding: 14px 20px;
}
.formula-editor-card > .modal-header > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.formula-editor-card > .modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
#admin-formula-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.formula-editor-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 18px 20px 26px;
}
.formula-editor-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.formula-editor-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.formula-editor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.formula-editor-section-head h4 {
  margin: 0 0 3px;
  font-size: 14px;
}
.formula-editor-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.formula-editor-id-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cfe1f8;
  border-radius: 7px;
  background: #f5f9ff;
}
.formula-editor-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.formula-editor-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 7px !important;
  align-self: end;
  min-height: 38px;
}
.formula-editor-checkbox input {
  width: 16px !important;
  height: 16px;
}
.formula-row-list,
.formula-variant-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.formula-toner-row {
  position: relative;
  display: grid;
  grid-template-columns: 0.65fr 1fr 1.5fr 0.75fr 0.75fr 30px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}
.formula-row-prefix { display: none; }
.formula-row-remove {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #f2c2be;
  border-radius: 5px;
  background: #fff6f5;
  color: #b42318;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.formula-row-remove:hover { background: #fee4e2; }
.formula-row-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.formula-variant-card {
  padding: 12px;
  border: 1px solid #bcd3ef;
  border-radius: 8px;
  background: #f8fbff;
}
.formula-variant-head,
.formula-variant-toner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.formula-variant-head { margin-bottom: 10px; }
.formula-variant-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.formula-variant-toner-head {
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid #dbe8f7;
  font-size: 12px;
  font-weight: 700;
}
.formula-variant-toners {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.formula-combination-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) 30px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dfd5f2;
  border-radius: 7px;
  background: #fcfaff;
}
.formula-combination-row .formula-row-remove {
  grid-column: 6;
  grid-row: 1;
}
.formula-editor-footer {
  display: flex;
  min-height: 68px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.formula-editor-footer > div {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
}
.formula-editor-footer .login-error {
  margin: 0;
  text-align: left;
}

.detail-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.detail-head .swatch { width: 64px; height: 64px; }
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}
.kv dt { color: var(--muted); }

@media (max-width: 860px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-left {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .detail-mid { padding-left: 0; }
  .formula-wrap { max-height: none; }
}

table.formula {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.formula th,
table.formula td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
table.formula th { color: var(--muted); font-weight: 600; }
table.formula th.num,
table.formula td.num,
.result-table th.num,
.result-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.batch {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.batch label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.batch input,
.batch select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
}
.batch input { width: 84px; }
#btotal { color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }
.batch-price {
  color: #1d7a45;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.binder-ctl input { width: 54px; }
.binder-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px 2px;
}
.binder-footer .binder-ctl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.binder-footer .binder-ctl input {
  width: 64px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.binder-footer .binder-ctl input:focus {
  border-color: var(--accent, #0d7a78);
  box-shadow: 0 0 0 3px rgba(13, 122, 120, 0.15);
}
.binder-msg {
  font-size: 13px;
  font-weight: 600;
  color: #b42318;
}
tr.binder-row { background: #f0f7ff; }
tr.binder-row td { font-weight: 600; color: var(--accent2); }

.notice {
  background: var(--panel2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.empty { color: var(--muted); text-align: center; padding: 40px; }

/* Mobile chrome helpers (hidden on desktop) */
.nav-toggle,
.mobile-page-title,
.sidebar-mobile-head,
.nav-backdrop {
  display: none;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }
  .brand-slot { display: none; }
  .brand-tagline { display: none; }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    margin-left: 10px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: #ffffff14;
    cursor: pointer;
    flex: none;
  }
  .nav-toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: #fff;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .nav-toggle-bar { transition: transform 0.2s ease, opacity 0.2s ease; }

  .mobile-page-title {
    display: block;
    flex: 1;
    min-width: 0;
    margin: 0 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar {
    padding: 0 10px 0 0;
    gap: 4px;
  }
  .topbar-right { margin-left: auto; }
  .current-user {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .logout-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #0e0e0ecc;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .nav-backdrop[hidden] { display: none; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 45;
    background: var(--panel);
    border-right: none;
    border-radius: 0 18px 18px 0;
    box-shadow: 12px 0 40px #00000040;
    padding: 0;
    transform: translateX(-105%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open { overflow: hidden; }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(270deg, #242424 0%, #0e0e0e 100%);
    flex: none;
  }
  .sidebar-mobile-logo {
    height: 28px;
    width: auto;
    display: block;
  }
  .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #ffffff18;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .side-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px 24px;
    flex-direction: column;
  }
  .nav-item {
    min-height: 48px;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
  }
  .nav-pill { border-radius: 12px; }

  .content {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: 14px 14px 28px;
    min-height: 0;
  }
  .view-header h1 {
    font-size: 22px;
    margin-bottom: 12px;
  }
  .panel {
    padding: 14px;
    border-radius: 14px;
  }
}

/* --- login page --- */
.login-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-window-close {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3;
  width: 48px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0 0 0 8px;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #596575;
  cursor: default;
  -webkit-app-region: no-drag;
}
.login-window-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
}
html.electron-shell .login-window-close {
  display: inline-flex;
}
.login-window-close:hover {
  color: #fff;
  background: #c42b1c;
}
.login-window-close:active {
  background: #a92317;
}
.login-window-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -3px;
}
.login-page::before {
  content: "";
  position: absolute;
  inset: -20% -50%;
  z-index: 0;
  background: linear-gradient(
    90deg,
    #eef3f8 0%,
    #dceafc 18%,
    #e8f4f3 36%,
    #eef2f7 54%,
    #d4e4f7 72%,
    #e8edf4 86%,
    #eef3f8 100%
  );
  background-size: 200% 100%;
  animation: login-bg-drift 36s linear infinite;
  pointer-events: none;
}
.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 18% 12%, #ffffffaa 0%, transparent 42%),
    radial-gradient(ellipse at 82% 88%, #ffffff66 0%, transparent 40%);
  pointer-events: none;
}
@keyframes login-bg-drift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .login-page::before { animation: none; background-position: 40% 50%; }
}
.login-shell {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 16px 48px #1f2a3718;
}
.login-brand {
  display: flex;
  justify-content: center;
  margin: 2px 0 6px;
}
.login-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}
.login-panel h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  text-align: center;
  color: var(--text);
}
.login-sub {
  margin: -4px 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.login-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.login-panel input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.login-panel input:focus {
  outline: none;
  border-color: #0d7a78;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13, 122, 120, 0.14);
}
.login-btn {
  margin-top: 8px;
  padding: 13px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 45%, #141414 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 1px 0 #ffffff22 inset,
    0 8px 20px #0e0e0e33;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.login-btn:hover {
  filter: brightness(1.08);
  box-shadow:
    0 1px 0 #ffffff28 inset,
    0 10px 24px #0e0e0e44;
  transform: translateY(-1px);
}
.login-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}
.login-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  filter: none;
}
.login-activate-btn {
  padding: 11px 16px;
  border: 1px solid #b9c7d8;
  border-radius: 999px;
  background: #fff;
  color: #27364a;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.login-activate-btn:hover {
  border-color: #6e849f;
  background: #f5f8fb;
  color: #142337;
}
.login-activate-btn:active {
  background: #ebf0f5;
}
.login-activate-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.login-error {
  margin: 0;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.login-error.hidden,
.hidden { display: none !important; }

/* --- My Formula --- */
.link-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #4a5568;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
}
.link-add:hover { color: var(--accent2); }
.link-add-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.btn-primary,
.btn-secondary {
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary {
  border: none;
  background: var(--accent2);
  color: #fff;
}
.btn-primary:hover { background: var(--accent); }
.btn-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover {
  background: #f3f4f6;
  color: #222;
}

.mf-list { display: flex; flex-direction: column; gap: 8px; }
.mf-list-empty {
  color: var(--muted);
  padding: 36px 12px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.mf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
}
.mf-item:hover { border-color: var(--accent); }
.mf-item .meta { flex: 1; min-width: 0; }
.mf-item .title { font-weight: 600; }
.mf-item .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.mf-item-edit,
.mf-item-del {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
}
.mf-item-edit:hover { color: var(--accent); border-color: var(--accent); }
.mf-item-del:hover { color: #b42318; border-color: #fecdca; }

.mf-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.mf-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.mf-editor-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.mf-editor-actions { display: flex; gap: 8px; }

.mf-editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mf-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}
.mf-meta-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mf-meta label,
.mf-toner-bar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.req-mark { color: #e03131; margin-right: 2px; }

.mf-meta input,
.mf-meta select,
.mf-toner-bar select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
.mf-meta input:focus,
.mf-meta select:focus,
.mf-toner-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

.field-with-add {
  display: flex;
  gap: 6px;
  align-items: center;
}
.field-with-add > input,
.field-with-add > select { flex: 1; min-width: 0; }
.icon-add {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.icon-add:hover { color: var(--accent2); border-color: var(--accent); }

#mf-rgb-pick {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.year-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.year-range input { flex: 1; min-width: 0; }
.year-range span { color: var(--muted); }

.mf-toners {
  padding-left: 18px;
  min-width: 0;
}
.mf-layer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mf-layer-toolbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.mf-layer {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  padding: 14px;
  margin-bottom: 14px;
}
.mf-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.mf-layer-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.mf-toner-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.mf-toner-bar label { flex: 1; min-width: 180px; }
.mf-toner-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mf-toner-table { min-width: 480px; }
.mf-toner-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
}
.mf-op-del {
  border: none;
  background: transparent;
  color: #c2410c;
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .mf-editor-body {
    grid-template-columns: 1fr;
  }
  .mf-meta {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .mf-toners { padding-left: 0; }
}

/* --- Add Customer modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #0007;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}
.modal-card {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 12px 40px #0003;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.modal-x {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-body {
  padding: 18px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.modal-row > span { text-align: right; }
.modal-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
}
.modal-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.modal-row input.short { max-width: 200px; }
.modal-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-inline em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: #f5f7fa;
  border-top: 1px solid var(--line);
}

/* --- Desktop first-use onboarding ---------------------------------------- */
.onboarding-welcome {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 15, 27, 0.68);
  backdrop-filter: blur(5px);
}
.onboarding-welcome-card {
  width: min(480px, 100%);
  padding: 32px;
  border: 1px solid #ffffff80;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, #dceaff 0, transparent 40%),
    #fff;
  box-shadow: 0 24px 70px rgba(6, 18, 39, 0.3);
  text-align: center;
}
.onboarding-welcome-icon {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0d7a78, #2563eb);
  color: #fff;
  box-shadow: 0 10px 24px #2563eb33;
  font-size: 25px;
  font-weight: 800;
}
.onboarding-kicker {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.onboarding-welcome-card h2 {
  margin: 0;
  color: #132238;
  font-size: 25px;
}
.onboarding-welcome-card > p:not(.onboarding-kicker) {
  margin: 12px auto 24px;
  max-width: 380px;
  color: #5b687a;
  font-size: 14px;
  line-height: 1.6;
}
.onboarding-welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.onboarding-tour {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}
.onboarding-shade {
  position: fixed;
  background: rgba(7, 13, 24, 0.7);
  pointer-events: auto;
}
.onboarding-spotlight {
  position: fixed;
  border: 2px solid #63a3ff;
  border-radius: 10px;
  box-shadow:
    0 0 0 3px #ffffffcc,
    0 0 0 7px #2563eb66,
    0 12px 34px #07132666;
  pointer-events: none;
}
.onboarding-tip {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid #d7e3f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(4, 18, 42, 0.3);
  color: #172033;
  pointer-events: auto;
}
.onboarding-tip-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.onboarding-tip-dots {
  display: inline-flex;
  gap: 4px;
}
.onboarding-tip-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #d6deea;
}
.onboarding-tip-dots i.done { background: #2563eb; }
.onboarding-tip h3 {
  margin: 0 0 7px;
  color: #132238;
  font-size: 18px;
}
.onboarding-tip > p {
  margin: 0;
  color: #44536a;
  font-size: 13px;
  line-height: 1.5;
}
.onboarding-tip .onboarding-tip-hint {
  margin-top: 8px;
  color: #7b8798;
  font-size: 12px;
}
.onboarding-tip strong {
  color: #163f80;
  font-weight: 850;
}
.onboarding-tip .onboarding-code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: #e7f0ff;
  color: #174ea6;
  font-size: 1.14em;
  letter-spacing: .04em;
}
.onboarding-tip .onboarding-tip-hint-emphasis {
  margin-top: 11px;
  padding: 10px 11px;
  border-left: 4px solid #2563eb;
  border-radius: 7px;
  background: #eef5ff;
  color: #173f79;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}
.onboarding-tip-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.onboarding-skip {
  border: 0;
  background: transparent;
  color: #66758a;
  padding: 7px 2px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.onboarding-skip:hover { color: #b42318; }

/* --- Legal consent and document viewer ----------------------------------- */
.legal-consent {
  position: fixed;
  inset: 0;
  z-index: 125;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 14, 26, .75);
  backdrop-filter: blur(7px);
}
.legal-consent-card {
  width: min(560px, 100%);
  padding: 30px 32px;
  border: 1px solid #ffffff7a;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, #dceaff 0, transparent 42%),
    #fff;
  box-shadow: 0 26px 75px rgba(4, 15, 35, .36);
}
.legal-consent-mark {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 15px;
  background: linear-gradient(145deg, #0d7a78, #2563eb);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 10px 24px #2563eb35;
}
.legal-consent-card h2 {
  margin: 0;
  color: #132238;
  font-size: 25px;
}
.legal-consent-card > p:not(.onboarding-kicker, .legal-consent-error) {
  margin: 11px 0 16px;
  color: #526176;
  font-size: 14px;
  line-height: 1.58;
}
.legal-consent-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 17px;
}
.legal-consent-links button {
  border: 1px solid #cdddf3;
  border-radius: 999px;
  background: #f4f8ff;
  color: #1f5fbd;
  padding: 7px 11px;
  cursor: pointer;
  font: 650 12px inherit;
}
.legal-consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid #d8e1ed;
  border-radius: 10px;
  background: #f7f9fc;
  color: #34445b;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}
.legal-consent-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #2563eb;
  flex: 0 0 auto;
}
.legal-consent-card > .btn-primary { width: 100%; }
.legal-consent-card > .btn-primary:disabled {
  border-color: #aeb9c7;
  background: #aeb9c7;
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
}
.legal-consent-error {
  margin: 11px 0 0;
  color: #b42318;
  font-size: 12px;
}
.legal-viewer {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(7, 14, 26, .74);
}
.legal-viewer-card {
  display: flex;
  width: min(960px, 100%);
  height: min(780px, calc(100vh - 44px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d5deea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 75px rgba(4, 15, 35, .4);
}
.legal-viewer-card header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid #dbe3ee;
  background: #fff;
}
.legal-viewer-card h2 { margin: 0; font-size: 16px; }
.legal-viewer-card header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #536176;
  cursor: pointer;
  font-size: 22px;
}
.legal-viewer-card header button:hover { background: #eef2f7; }
.legal-viewer-content {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 28px 34px 44px;
  background: #eef3f8;
  color: #172033;
  line-height: 1.62;
}
.legal-viewer-content > .eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.legal-viewer-content > h1 {
  margin: 0;
  color: #0f1e33;
  font-size: 28px;
  line-height: 1.2;
}
.legal-viewer-content .meta {
  margin: 8px 0 24px;
  color: #66758a;
  font-size: 12px;
}
.legal-viewer-content h2 {
  margin: 27px 0 7px;
  color: #173156;
  font-size: 17px;
}
.legal-viewer-content h3 {
  margin: 20px 0 6px;
  color: #24466f;
  font-size: 14px;
}
.legal-viewer-content p,
.legal-viewer-content li { font-size: 13px; }
.legal-viewer-content ul,
.legal-viewer-content ol { padding-left: 22px; }
.legal-viewer-content li + li { margin-top: 5px; }
.legal-viewer-content a { color: #1f63d6; }
.legal-viewer-content .notice {
  margin: 18px 0;
  padding: 13px 15px;
  border: 1px solid #bed4f5;
  border-radius: 9px;
  background: #f1f6ff;
  color: #24466f;
}
.legal-viewer-content .warning {
  border-color: #f5d28a;
  background: #fff8e8;
  color: #6e4911;
}
.legal-viewer-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.legal-viewer-content th,
.legal-viewer-content td {
  padding: 9px 10px;
  border: 1px solid #d3dde9;
  text-align: left;
  vertical-align: top;
}
.legal-viewer-content th { background: #e7edf5; }
.legal-viewer-content .document-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #cbd6e4;
  font-size: 12px;
}
.legal-viewer-error {
  display: grid;
  gap: 7px;
  max-width: 480px;
  margin: 60px auto;
  padding: 18px;
  border: 1px solid #fecdca;
  border-radius: 10px;
  background: #fef3f2;
  color: #7a271a;
}
.legal-settings-intro { margin-top: -5px; }
.legal-document-list {
  display: grid;
  gap: 9px;
}
.legal-document-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.legal-document-button:hover {
  border-color: #9dbcf0;
  background: #f7faff;
}
.legal-document-button span { display: grid; gap: 3px; }
.legal-document-button strong { font-size: 13px; }
.legal-document-button small { color: var(--muted); font-size: 12px; }
.legal-document-button b { color: var(--accent); font-size: 12px; }
.legal-version-line {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.formula-reference-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 9px 12px;
  border: 1px solid #efd59d;
  border-radius: 8px;
  background: #fff9ec;
  color: #65491b;
}
.formula-reference-notice > span {
  display: flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f4c85c;
  color: #503407;
  font-weight: 800;
}
.formula-reference-notice p {
  flex: 1;
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}
.formula-reference-notice button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #965d06;
  padding: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .onboarding-welcome-card { padding: 26px 20px; }
  .onboarding-welcome-actions { flex-direction: column-reverse; }
  .onboarding-welcome-actions button { width: 100%; }
  .onboarding-tip { padding: 15px; }
  .legal-consent-card { padding: 25px 20px; }
  .legal-viewer { padding: 0; }
  .legal-viewer-card { height: 100%; border: 0; border-radius: 0; }
  .formula-reference-notice { align-items: flex-start; flex-wrap: wrap; }
}

.admin-delete-card { max-width: 460px; }
.admin-delete-warning {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fef3f2;
  color: #7a271a;
  font-size: 13px;
  line-height: 1.5;
}
.admin-delete-password {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.admin-delete-password input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
.admin-delete-password input:focus {
  outline: none;
  border-color: #d92d20;
  box-shadow: 0 0 0 3px #d92d201a;
}

/* --- Settings --- */
.settings-panel { max-width: 640px; }
.settings-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}
.settings-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.settings-tab {
  background: none;
  border: none;
  padding: 8px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.settings-grid input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
.settings-grid input:focus {
  outline: none;
  border-color: var(--accent);
}
.settings-grid input[readonly] {
  background: var(--panel2);
  color: var(--muted);
  cursor: not-allowed;
}
.settings-grid-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.settings-form { max-width: 420px; }
.settings-form.is-disabled { opacity: 0.6; }
.settings-form.is-disabled input { cursor: not-allowed; }
@media (max-width: 560px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.settings-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
}
.settings-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.settings-form .btn-primary {
  align-self: flex-start;
  margin-top: 4px;
}
.settings-msg {
  margin: 0;
  font-size: 13px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 6px;
  padding: 8px 10px;
}
.settings-msg.ok {
  color: #1d7a45;
  background: #e4f7ec;
  border-color: #a6e4c0;
}
.sys-update-msg {
  flex: 1 1 420px;
  min-width: 240px;
}
.sys-update-progress {
  width: 100%;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #b7ddc7;
}
.sys-update-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d9b5f, #34b878);
  transition: width 180ms ease-out;
}

/* variant (DerivateColors) switcher in the detail modal */
.variant-switch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 10px;
}
.variant-switch .vs-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.variant-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.vchip {
  font: inherit;
  cursor: pointer;
  width: 88px;
  padding: 6px;
  border: 1px solid #d6dbe4;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.vchip:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px #2f7cf614;
}
.vchip.active {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px #2f7cf633;
}
.vchip-swatch {
  width: 100%;
  height: 44px;
  border-radius: 6px;
  border: 1px solid #00000018;
  display: block;
}
.vchip-label {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vchip-code {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: -2px;
}

/* --- combination color view --------------------------------------------- */
.badge.combo { background: #eee6ff; color: #6b3fd0; }

.combo-layout { display: flex; flex-direction: column; gap: 18px; }
.combo-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.combo-header .ci-swatch {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  margin: 0;
}
.combo-title { font-size: 17px; font-weight: 600; margin: 2px 0 6px; }
.combo-sub { color: var(--muted); font-size: 13px; max-width: 640px; }

.combo-parts {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
}
.combo-part {
  flex: 1 1 240px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.combo-part.clickable {
  cursor: pointer;
}
.combo-part.clickable:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px #2f7cf61f;
  transform: translateY(-1px);
}
.combo-part.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.combo-part.disabled {
  opacity: .7;
  cursor: default;
}
.combo-swatch {
  width: 100%;
  height: 62px !important; /* 48 * 1.3 */
  margin: 0 !important;
  border-radius: 6px;
}
.combo-plus {
  align-self: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  flex: 0 0 auto;
}

.combo-back {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent2);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  margin-bottom: 14px;
  font-size: 13px;
}
.combo-back:hover { border-color: var(--accent); }

@media (max-width: 620px) {
  .combo-parts { flex-direction: column; }
  .combo-plus { transform: rotate(0deg); }
}

/* --- material color chip preview --------------------------------------- */
.chip-hover { cursor: zoom-in; }

.chip-preview {
  position: fixed;
  z-index: 200;
  width: 252px; /* 168 * 1.5 */
  pointer-events: none;
  filter: drop-shadow(0 10px 24px #1f2a3728);
}
.chip-preview.hidden { display: none; }

.chip-preview-face {
  width: 252px;
  height: 162px;
  border-radius: 12px;
  border: 1px solid #00000022;
  position: relative;
  overflow: hidden;
  background-size: cover;
}

/* Solid / metallic / pearl / effect overlays are shared with .material-chip above */

.chip-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 0 2px;
  font-size: 11px;
  color: #4a5568;
  text-transform: capitalize;
}
.chip-preview-rgb {
  font-variant-numeric: tabular-nums;
  color: #6b7a90;
}

/* ========== Mobile layout polish ========== */
@media (max-width: 860px) {
  .oem-grid,
  .fleet-grid,
  .fleet-more-grid,
  .settings-grid,
  .admin-create-fields,
  .mf-meta {
    grid-template-columns: 1fr !important;
  }

  .formula-data-header {
    align-items: stretch;
    flex-direction: column;
  }
  .formula-data-header .btn-primary { align-self: flex-start; }
  .formula-publish-status { grid-template-columns: 1fr; }
  .formula-status-note { grid-column: 1; }
  .formula-data-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .formula-data-toolbar .btn-primary { min-height: 44px; }
  .formula-change-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .formula-change-meta { align-items: flex-start; }
  .formula-editor-overlay { padding: 0; }
  .formula-editor-card {
    width: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  .formula-editor-id-grid,
  .formula-editor-field-grid,
  .formula-variant-fields {
    grid-template-columns: 1fr 1fr;
  }
  .formula-toner-row {
    grid-template-columns: 1fr 1fr;
    padding-right: 42px;
  }
  .formula-toner-row .formula-row-remove {
    position: absolute;
    top: 10px;
    right: 8px;
  }
  .formula-combination-row {
    position: relative;
    grid-template-columns: 1fr 1fr;
    padding-right: 42px;
  }
  .formula-combination-row .formula-row-remove {
    position: absolute;
    top: 10px;
    right: 8px;
  }

  .oem-actions,
  .fleet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .oem-actions .btn-primary,
  .oem-actions .btn-secondary,
  .fleet-actions .btn-primary,
  .fleet-actions .btn-secondary {
    flex: 1 1 140px;
    min-height: 44px;
  }

  label > input,
  label > select,
  .field-with-add input[type="text"],
  .field-with-add input[type="search"],
  .toner-toolbar input[type="search"] {
    min-height: 44px;
    font-size: 16px; /* avoid iOS zoom */
    border-radius: 10px;
  }

  .result-table { min-width: 640px; font-size: 13px; }
  .table-wrap {
    margin: 0 -4px;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .mf-item {
    border-radius: 14px;
    padding: 14px;
    gap: 10px;
  }
  .mf-item .title { font-size: 15px; }
  .mf-item-edit,
  .mf-item-del {
    min-height: 36px;
    padding: 6px 12px;
  }

  .mf-editor {
    border-radius: 14px;
    padding: 14px;
  }
  .mf-editor-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .mf-layer {
    border-radius: 14px;
  }

  .settings-tabs {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .settings-tab {
    flex: none;
    min-height: 40px;
    border-radius: 999px;
    padding: 8px 14px;
  }

  .toner-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toner-toolbar input[type="search"] {
    max-width: none;
    width: 100%;
  }
  .toner-batch {
    margin-left: 0;
    width: 100%;
  }

  /* Detail: near-fullscreen sheet */
  .detail-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .detail-card {
    max-width: none;
    width: 100%;
    max-height: 96vh;
    border-radius: 18px 18px 0 0;
    padding: 18px 14px 24px;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .detail-card--combo {
    max-width: none;
  }
  .batch {
    gap: 10px;
  }
  .batch input,
  .batch select {
    min-height: 40px;
    font-size: 16px;
  }
  .print-btn { margin-left: 0; }
  .ci-swatch {
    width: 100%;
    max-width: none;
    height: 120px;
    border-radius: 12px;
  }

  .modal-card {
    width: calc(100% - 24px);
    max-width: none;
    margin: 12px;
    border-radius: 16px;
  }
  .modal-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .modal-row label {
    text-align: left;
  }

  .login-panel {
    border-radius: 16px;
    padding: 24px 20px;
  }
  .login-panel input {
    min-height: 46px;
    font-size: 16px;
    border-radius: 10px;
  }
  .login-btn {
    min-height: 48px;
    border-radius: 999px;
    font-size: 16px;
  }
  .login-logo {
    height: 38px;
  }
}

@media (max-width: 520px) {
  .content { padding: 12px 12px 32px; }
  .view-header h1 { font-size: 20px; }
  .user-menu { gap: 6px; }
  .current-user { display: none; }
  .result-table { min-width: 560px; }
  .mf-toner-table { min-width: 420px; }
  .detail-top-actions { right: 42px; }
  .formula-status-counts,
  .formula-editor-id-grid,
  .formula-editor-field-grid,
  .formula-variant-fields,
  .formula-toner-row,
  .formula-combination-row {
    grid-template-columns: 1fr;
  }
  .formula-editor-scroll { padding: 14px 12px 22px; }
  .formula-editor-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px;
  }
  .formula-editor-footer > div {
    width: 100%;
    margin-left: 0;
  }
  .formula-editor-footer button { flex: 1; }
}
