:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --line: #dfe6f0;
  --text: #182334;
  --muted: #66758a;
  --blue: #1f5a96;
  --blue-strong: #174a7d;
  --orange: #ff8617;
  --green: #16805a;
  --yellow: #a66a00;
  --red: #b42318;
  --shadow: 0 16px 40px rgba(24, 35, 52, .08);
  --radius: 8px;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 120; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.app-toast { transform: translateY(-8px); opacity: 0; padding: 13px 16px; border: 1px solid #bde8d7; border-radius: 8px; background: #eefaf5; color: #126c4c; box-shadow: 0 10px 28px rgba(20, 42, 66, .16); font-size: 14px; font-weight: 700; line-height: 1.5; transition: .18s ease; }
.app-toast.is-visible { transform: translateY(0); opacity: 1; }
.app-toast-error { border-color: #f0caca; background: #fff8f7; color: #b42318; }
.app-toast-warning { border-color: #f1d59b; background: #fff8e8; color: #8a5a08; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

.app-footer {
  margin-left: 260px;
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.app-footer a { color: var(--blue); font-weight: 800; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.auth-body > .app-footer { flex: 0 0 auto; width: 100%; margin: 0; padding: 14px 20px 20px; }

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }

select {
  outline: none;
  box-shadow: none;
  transition: border-color .16s ease, background-color .16s ease;
}

select:focus,
select:focus-visible {
  outline: none;
  border-color: #91a0b2 !important;
  box-shadow: none !important;
  background-color: #fff;
}

select option:checked {
  background-color: #e8f1fb;
  color: #173b61;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: #0f1d2d;
  color: #e8eef7;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 8px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 5px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: #93a4ba; margin-top: 2px; }

.nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 4px;
}


.nav-link {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  min-height: 42px;
  color: #bdc9d8;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0 10px;
}

.nav-link:hover, .nav-link.active {
  background: #172a40;
  color: #fff;
}

.nav-link.active { box-shadow: inset 3px 0 0 var(--orange); }
.nav-link b {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 134, 23, .16);
  color: #ffb56d;
  text-align: center;
  font-size: 12px;
  padding: 2px 7px;
}

.nav-icon { color: #88a2bf; text-align: center; }

.mobile-sidebar-logout {
  display: none;
  width: 100%;
  margin: 8px 0 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  text-align: left;
}
.mobile-sidebar-logout:hover { border-color: rgba(255,255,255,.2); }

.sidebar-card {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  border-radius: var(--radius);
  padding: 14px;
}

.sidebar-card span, .sidebar-card p {
  color: #9aacbf;
  font-size: 12px;
}

.sidebar-card strong {
  display: block;
  margin: 4px 0 6px;
}

.sidebar-card small {
  display: block;
  color: #9aacbf;
  margin-bottom: 12px;
}

.sidebar-role-label {
  display: block;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-card p { display: none; margin: 0; line-height: 1.5; }

.app {
  margin-left: 260px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  padding: 12px 28px;
  background: rgba(245, 247, 251, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 230, 240, .82);
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  flex: 1;
  color: var(--muted);
  font-weight: 800;
}

.search {
  flex: 1;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 13px;
}

.search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  color: var(--text);
}

.topbar-actions, .head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-switch {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-weight: 700;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.avatar {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-weight: 700;
}

.view {
  display: none;
  padding: 28px;
}

.view.active { display: block; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; }
h2 { margin-bottom: 0; font-size: 17px; }
h3 { margin-bottom: 12px; font-size: 15px; }

.primary-button, .ghost-button, .text-button, .icon-button, .row-button {
  border-radius: var(--radius);
  min-height: 40px;
  border: 1px solid transparent;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

.primary-button {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 700;
}

.primary-button:hover { background: var(--blue-strong); }

.ghost-button {
  border-color: var(--line);
  color: #314154;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.icon-button {
  width: 38px;
  padding: 0;
  border-color: var(--line);
}

.mobile-menu { display: none; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric, .panel, .data-panel, .code-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(24, 35, 52, .04);
}

.metric {
  padding: 18px;
  border-top: 3px solid #c5d0dd;
}

.metric.accent { border-top-color: var(--orange); }
.metric span, .metric small { color: var(--muted); }
.metric strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 30px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.settings-grid > .form-panel {
  align-content: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.admin-overview-panel {
  align-content: start;
  grid-auto-rows: max-content;
}

.admin-user-summary > .panel-head {
  margin: 0;
  padding: 18px 18px 14px;
}

.panel { padding: 18px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-list { display: grid; gap: 10px; }

.compact-list article {
  display: grid;
  grid-template-columns: 78px 1fr 38px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.compact-list small, .product-table small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-progress { background: #e8f1fb; color: var(--blue); }
.status-draft { background: #fff4df; color: var(--yellow); }
.status-done { background: #e6f6ef; color: var(--green); }

.todo-stack { display: grid; gap: 10px; }

.todo-stack label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.todo-stack small {
  grid-column: 2;
  color: var(--muted);
}

.toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.product-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-search {
  flex: 2 1 340px;
  min-width: min(300px, 100%);
  max-width: 560px;
}

.toolbar .product-search input {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  outline: 0;
  background: transparent;
}

.product-filter-row > select {
  flex: 1 1 180px;
  min-width: 160px;
}

.product-filter-row .sort-select {
  flex: 0 1 230px;
  width: min(230px, 100%);
  min-width: 180px;
}

.filter-submit { min-height: 42px; padding-inline: 22px; }

.segmented {
  display: inline-flex;
  padding: 4px;
  background: #eaf0f7;
  border-radius: var(--radius);
}

.segmented button, .segmented a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.segmented button.active, .segmented a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(24, 35, 52, .1);
}

.toolbar select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 12px;
  color: var(--text);
}

.log-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.log-toolbar label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.log-toolbar input, .log-toolbar select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; background: #fff; color: var(--text); box-sizing: border-box; }
.log-toolbar .log-search { flex: 1 1 320px; min-width: min(320px, 100%); max-width: 520px; }
.log-toolbar > label:not(.log-search) { flex: 0 0 150px; }
.log-toolbar .log-search-submit { min-height: 42px; margin-bottom: 0; }
.danger-button { color: #b42318; border-color: #f0caca; background: #fff8f7; }
.danger-button:hover { color: #9e1d14; border-color: #d92d20; background: #fff0ee; }
.logs-page .view { visibility: hidden; }
.logs-page.is-ready .view { visibility: visible; }
/* Logged-in static pages contain fallback demo HTML. Do not reveal it before session hydration. */
body[data-account] .sidebar, body[data-account] .app { visibility: hidden; }
body[data-account].session-ready .sidebar, body[data-account].session-ready .app { visibility: visible; }
@media (min-width: 901px) {
  body[data-account]:not(.session-ready) {
    background: linear-gradient(to right, #0f1d2d 0 260px, var(--bg) 260px 100%);
  }
}

.data-panel { overflow: auto; }

.product-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.product-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.product-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.product-table tr:last-child td { border-bottom: 0; }

.file-pill {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  border: 1px solid #cbd6e3;
  border-radius: 999px;
  padding: 3px 8px;
  color: #435369;
  font-size: 12px;
  font-weight: 700;
}

.row-button {
  min-height: 32px;
  margin-right: 6px;
  border-color: var(--line);
  font-size: 13px;
}

.row-button.primary {
  background: #eef5fc;
  color: var(--blue);
  border-color: #cfe1f3;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline article {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding-bottom: 18px;
}

.timeline article > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px #fff0e1;
}

.timeline p { color: var(--muted); margin: 6px 0; }
.timeline small { color: var(--muted); }

.role {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.role-admin { background: #e6f6ef; color: var(--green); }
.role-manager { background: #fff4df; color: var(--yellow); }
.role-user { background: #e8f1fb; color: var(--blue); }
.role-auditor { background: #eef0f5; color: #46566c; }

.permission-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #cfe1f3;
  border-radius: var(--radius);
  background: #f2f8ff;
  color: #314154;
}

.permission-note strong {
  flex: 0 0 auto;
  color: var(--blue);
}

.permission-note span {
  color: var(--muted);
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef0f5;
  color: #46566c;
  font-size: 12px;
  font-weight: 800;
}

.compact-table {
  min-width: 680px;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.code-grid article { padding: 18px; }
.code-grid strong { display: block; font-size: 20px; margin-bottom: 10px; }
.code-grid span, .code-grid small { display: block; color: var(--muted); }
.code-grid small { margin-top: 8px; }

.invite-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.invite-modal[hidden] { display: none; }
.invite-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 29, 50, .42); }
.invite-modal-panel { position: relative; width: min(460px, 100%); padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 48px rgba(11, 31, 53, .2); }
.invite-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.invite-modal-head h2 { margin: 0; font-size: 20px; }
.invite-form-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.invite-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.manager-modal-panel { width: min(500px, 100%); padding: 24px; }
.manager-modal-head { align-items: flex-start; margin-bottom: 22px; }
.manager-modal-head h2 { max-width: calc(100% - 52px); color: var(--text); font-size: 18px; line-height: 1.55; }
.manager-modal-head h2 strong { color: var(--blue); font-size: 20px; overflow-wrap: anywhere; }
.manager-assign-form { display: grid; gap: 12px; }
.manager-assign-form label { display: grid; gap: 8px; color: var(--text); font-size: 14px; font-weight: 700; }
.manager-assign-form select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.manager-assign-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 90, 150, .12); }
.manager-form-note { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.manager-assign-form .invite-modal-actions { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }

.notification-read-all { margin-left: auto; }
.timeline .notification-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.timeline .notification-row:last-child { border-bottom: 0; }
.timeline .notification-row > span { grid-column: 1; margin-top: 7px; }
.timeline .notification-row > div { grid-column: 2; min-width: 0; }
.timeline .notification-row > .row-button,
.timeline .notification-row > em { grid-column: 3; align-self: center; margin: 0; white-space: nowrap; }
.timeline .notification-row > em { color: var(--muted); font-style: normal; font-size: 13px; }
.timeline .notification-row.is-read { opacity: .6; }
.row-actions {
  white-space: nowrap;
}
.row-actions .row-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  margin: 0;
  padding: 0 16px;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.row-actions .row-button + .row-button { margin-left: 10px; }
.row-actions .row-button:hover {
  border-color: #b9c9da;
  background: #f7f9fc;
  box-shadow: 0 1px 2px rgba(24, 35, 52, .08);
}
.row-actions .row-button.primary,
.row-actions [data-edit-company],
.row-actions [data-edit-line] {
  background: #eef5fc;
  color: var(--blue);
  border-color: #cfe1f3;
}
.row-actions .row-button.primary:hover,
.row-actions [data-edit-company]:hover,
.row-actions [data-edit-line]:hover {
  background: #dfeefb;
  border-color: #b9d5ee;
}
.row-actions .file-delete,
.row-actions .user-delete-button {
  color: #b42318;
  border-color: #f0caca;
  background: #fff8f7;
}
.row-actions .file-delete:hover,
.row-actions .user-delete-button:hover {
  color: #9e1d14;
  border-color: #e6a8a3;
  background: #fff0ee;
}
.row-actions .user-edit-button { background: #eef5fc; color: var(--blue); border-color: #cfe1f3; }
.row-actions .user-edit-button:hover { background: #dfeefb; }
.user-edit-page .settings-grid { visibility: hidden; }
.user-edit-page.is-ready .settings-grid { visibility: visible; }
.switch-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 9px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; font-weight: 700; }
.switch-toggle i { width: 18px; height: 18px; border-radius: 50%; background: #a3b0bf; transition: .18s ease; }
.switch-toggle.is-on { border-color: #bde8d7; background: #eefaf5; color: #16845d; }
.switch-toggle.is-on i { background: #1aa776; }

.form-panel {
  display: grid;
  gap: 12px;
}

.form-panel label, .detail-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-panel input, .form-panel select, .form-panel textarea,
.detail-grid input, .detail-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}

.form-panel textarea {
  min-height: 104px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

.category-form-stack { display: grid; gap: 16px; }
.form-hint { margin: -2px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.category-workspace { display: grid; gap: 18px; }
.category-top-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.category-list-panel { overflow: auto; }
.category-line-panel { width: 100%; }
.category-list-panel .panel-head { min-width: 460px; padding: 16px 16px 10px; }
.category-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.category-filter select { min-height: 34px; max-width: 180px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0 9px; color: var(--text); }

.form-panel input[type="checkbox"], .detail-grid input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 12px;
}

.category-list strong,
.category-list span {
  display: block;
}

.category-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62px, auto);
  align-items: center;
  width: 100%;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.unit-input input {
  height: 40px;
  min-height: 40px;
  min-width: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
}

.unit-input input:focus {
  outline: 0;
}

.unit-input em {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 0 11px;
  background: var(--surface-soft);
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.unit-input input[type="number"] {
  appearance: textfield;
}

.unit-input input[type="number"]::-webkit-outer-spin-button,
.unit-input input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 17, 28, .42);
}

.drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(780px, 100%);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow: auto;
  transform: translateX(100%);
  transition: transform .22s ease;
}

.drawer.open .drawer-panel { transform: translateX(0); }

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.readonly-grid span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.readonly-grid b {
  min-width: 76px;
  color: var(--text);
}

.readonly-grid em { font-style: normal; }

.attachments, .history {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.file-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  margin-bottom: 12px;
  background: #eaf0f7;
  border-radius: var(--radius);
}

.file-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 700;
}

.file-tabs button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 3px rgba(24, 35, 52, .1);
}

.file-page { display: none; }
.file-page.active { display: block; }

.file-list { display: grid; gap: 10px; }

.file-list article {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.file-list article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: var(--radius);
  background: #eef5fc;
  color: var(--blue);
  font-weight: 800;
}

.file-list small { display: block; color: var(--muted); margin-top: 3px; }
.file-list button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 12px;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-list .file-delete {
  border-color: #f0caca;
  color: #b42318;
  background: #fff8f7;
}

.file-list .file-delete:hover {
  border-color: #d92d20;
  background: #fff0ee;
}
.history-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.history-pagination > div { display: flex; gap: 6px; }
.history-pagination .icon-button { width: 32px; min-width: 32px; height: 32px; }
.history-pagination .icon-button:disabled { opacity: .4; cursor: not-allowed; }
.overview-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.overview-pagination > div { display: flex; gap: 6px; }
.overview-pagination .icon-button { width: 32px; min-width: 32px; height: 32px; }
.overview-pagination .icon-button:disabled { opacity: .4; cursor: not-allowed; }
.category-list .overview-pagination { margin: 8px -18px -18px; }

.history ol {
  margin: 0;
  padding-left: 20px;
}

.history li { margin-bottom: 10px; }
.history span { display: block; color: var(--muted); margin-top: 3px; }

.drawer-actions {
  position: sticky;
  bottom: -24px;
  margin: 22px -24px -24px;
  padding: 14px 24px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notify-check {
  margin-right: auto;
  color: var(--muted);
}

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 90, 150, .08), transparent 42%),
    linear-gradient(315deg, rgba(255, 134, 23, .1), transparent 45%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 32px 0;
}

.auth-shell {
  flex: 0 0 auto;
  width: min(1060px, 100%);
  min-height: 680px;
  margin: auto 0;
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.62);
  box-shadow: var(--shadow);
}

.auth-panel {
  background: #fff;
  padding: 42px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 48px;
}

.auth-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand small {
  color: var(--muted);
  margin-top: 2px;
}

.auth-title {
  margin-bottom: 22px;
}

.auth-title h1 {
  font-size: 30px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.inline-check {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px !important;
}

.inline-check input {
  min-height: auto;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-form .auth-submit { min-height: 44px; }

.auth-footer {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.auth-side {
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-side {
  position: relative;
  min-height: 100%;
  background: #e9f0f7 url('/banner.png') center / cover no-repeat;
}
.auth-side > * { display: none; }

/* Authentication banner: image-only panel, always shown in full. */
.auth-shell .auth-side {
  padding: 0 !important;
  background-color: #e9f0f7 !important;
  background-image: url('/banner.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
}
.auth-shell .auth-side > div,
.auth-shell .auth-side > ul { display: none !important; }

.auth-side h2 {
  max-width: 620px;
  font-size: 28px;
  line-height: 1.35;
  margin-bottom: 26px;
}

.auth-side ul {
  display: grid;
  gap: 12px;
  max-width: 680px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-side li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  padding: 14px 16px;
}

.auth-side strong,
.auth-side span {
  display: block;
}

.auth-side span {
  color: var(--muted);
  margin-top: 4px;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.captcha-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 8px;
  align-items: center;
}

.captcha-image {
  width: 150px;
  height: 46px;
  box-sizing: border-box;
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(31, 90, 150, .12), transparent),
    repeating-linear-gradient(45deg, #fff, #fff 6px, #eef5fc 6px, #eef5fc 12px);
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 2px;
  user-select: none;
}

.invite-result.is-valid { border-color: #bde8d7; background: #eefaf5; }
.invite-result.is-valid strong { color: #16845d; }
.invite-result.is-invalid { border-color: #f0caca; background: #fff8f7; }
.invite-result.is-invalid strong { color: #b42318; }

.field-state {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-state.success { color: #177245; }
.field-state.error { color: #b42318; }

.login-message {
  min-height: 18px;
  margin-top: 0;
}

.row-button.auth-submit,
.primary-button.auth-submit {
  text-decoration: none;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.form-card + .form-card {
  margin-top: 18px;
}

.form-card h2,
.form-card h3 {
  margin-bottom: 14px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.upload-box {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px dashed #bfd2e6;
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 16px;
}

.upload-box strong {
  color: var(--text);
}

.upload-box.has-file {
  border-color: var(--green);
  background: #f2fbf7;
  box-shadow: inset 0 0 0 1px rgba(20, 160, 110, .12);
}

.upload-box.has-file::after {
  content: "已选择";
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.upload-box span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-box input[type="file"] {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.upload-box span,
.upload-status-list small,
.empty-state span,
.error-state span,
.empty-state p,
.error-state p {
  color: var(--muted);
}

.upload-status-list {
  display: grid;
  gap: 10px;
}

.upload-status-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.persistent-upload-status {
  margin: 0 18px 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.persistent-upload-status.is-loading { border-color: #9fc4ea; background: #eef6ff; color: var(--blue); }
.persistent-upload-status.is-success { border-color: #9edfc6; background: #effaf5; color: var(--green); }
.persistent-upload-status.is-error { border-color: #f0b6af; background: #fff3f1; color: #b42318; }
.persistent-upload-status progress { display: block; width: 100%; height: 12px; margin-top: 9px; }
.persistent-upload-status .text-button { margin-left: 8px; }
.edit-upload-grid { margin: 14px 18px 18px; }

.edit-lock-notice {
  position: sticky;
  top: -24px;
  z-index: 4;
  margin: -24px -24px 18px;
  padding: 13px 24px;
  border-bottom: 1px solid #efc06d;
  background: #fff7e6;
  color: #8a5700;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.detail-grid input:disabled,
.detail-grid select:disabled,
.detail-grid textarea:disabled {
  background: #eef1f5;
  color: #667085;
  cursor: not-allowed;
  opacity: 1;
}

.upload-progress-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 29, 50, .5);
}

.upload-progress-modal[hidden] { display: none; }

.upload-progress-panel {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 20px 48px rgba(11, 31, 53, .22);
}

.upload-progress-panel h2 { margin: 0 0 10px; font-size: 20px; }
.upload-progress-panel p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.upload-progress-panel strong { display: block; margin-bottom: 10px; overflow-wrap: anywhere; }
.upload-progress-panel progress { width: 100%; height: 14px; }
.upload-progress-percent { margin-top: 8px; color: var(--blue); font-weight: 800; text-align: right; }

.upload-success {
  color: #177245;
  font-weight: 800;
}

.upload-failed {
  color: #b42318;
  font-weight: 800;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-panel .drawer-actions.inline-actions {
  position: static;
  bottom: auto;
  margin: 8px 0 0;
  padding: 16px 0 0;
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.empty-state,
.error-state {
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 28px;
}

.empty-state .state-icon,
.error-state .state-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: #eef5fc;
  color: var(--blue);
  font-weight: 900;
}

.error-state .state-icon {
  background: #fff1f0;
  color: #b42318;
}

.invite-result {
  border: 1px solid #cfe1f3;
  border-radius: var(--radius);
  background: #f2f8ff;
  padding: 12px;
}

.invite-result strong,
.invite-result span {
  display: block;
}

.invite-result span {
  color: var(--muted);
  margin-top: 4px;
}

.error-shell {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 42px;
}

.error-panel {
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.error-panel h1 {
  font-size: 34px;
  margin-bottom: 12px;
}

.error-panel p {
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 60;
  }

  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(10, 23, 38, .38);
  }
  .app { margin-left: 0; }
  .app-footer { margin-left: 0; }
  .mobile-menu { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-sidebar-logout { display: grid; flex: 0 0 auto; }
  .metrics, .split-layout, .settings-grid, .admin-grid, .code-grid, .form-layout, .state-grid, .category-top-grid { grid-template-columns: 1fr; }
  .detail-grid, .readonly-grid { grid-template-columns: 1fr; }
  .auth-body { padding: 20px 20px 0; }
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-panel { border-right: 0; }
  .auth-side { padding: 32px; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .topbar-actions .ghost-button,
  .topbar-actions .auth-link { display: none; }
  .role-switch { max-width: 138px; }
  .view { padding: 18px 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-direction: column; }
  .product-filter-row { align-items: stretch; flex-direction: column; }
  .product-search { flex: none; width: 100%; max-width: none; min-width: 0; height: 42px; }
  .product-filter-row > select,
  .product-filter-row .sort-select { flex: none; width: 100%; min-width: 0; min-height: 42px; }
  .filter-submit { width: 100%; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-status-item { grid-template-columns: 1fr; }
  .segmented { overflow: auto; }
  .drawer-panel { padding: 18px; }
  .drawer-actions { margin: 22px -18px -18px; padding: 12px 18px; }
  .auth-body { padding: 0; place-items: stretch; }
  .auth-shell {
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .auth-panel { min-height: 100dvh; padding: 24px 20px; border: 0; }
  .auth-brand { margin-bottom: 28px; }
  .auth-side { display: none !important; }
  .captcha-field {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
  .captcha-field .ghost-button {
    grid-column: 1 / -1;
  }
}

/* Functional PHP application */
.functional-content { padding: 28px; }
.functional-content .data-panel { margin-top: 18px; }
.flash { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.flash-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.flash-error { color: #b42318; background: #fff5f4; border-color: #fecaca; }
.functional-form { display: grid; gap: 18px; }
.functional-form label, .toolbar label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.functional-form input, .functional-form select, .toolbar input, .toolbar select, .upload-inline input, .upload-inline select, .inline-form select {
  width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0 12px; color: var(--ink);
}
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.check-field { display: flex !important; align-items: center; align-self: end; min-height: 40px; }
.check-field input { width: auto; min-height: auto; }
.form-actions, .head-actions, .upload-inline, .inline-form { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.simple-list { display: grid; gap: 8px; margin-top: 16px; }
.simple-list article { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.simple-list span, .simple-list small, table small { display: block; color: var(--muted); margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.functional-content .detail-grid > span { padding: 10px 0; }
.detail-grid b { display: block; margin-bottom: 5px; color: var(--muted); }
.upload-inline { justify-content: flex-start; margin: 14px 0; }
.upload-inline select { max-width: 190px; }
.functional-tabs { overflow-x: auto; display: flex; }
.functional-tabs a { white-space: nowrap; color: var(--muted); padding: 10px 13px; text-decoration: none; }
.functional-tabs small { color: inherit; }
.attachment-group { padding-top: 16px; scroll-margin-top: 80px; }
.attachment-group + .attachment-group { border-top: 1px solid var(--line); margin-top: 18px; }
.history-list { display: grid; gap: 12px; }
.history-list span { display: block; color: var(--muted); margin-top: 4px; }
.notification-item.is-read { opacity: .65; }
.notification-item p { margin: 5px 0; }
.notification-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dashboard-notification { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.dashboard-notification strong, .dashboard-notification span, .dashboard-notification small { display: block; }
.dashboard-notification span, .dashboard-notification small { margin-top: 4px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 820px; }
.status-danger { color: #b42318; background: #fff0ee; }
.table-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.table-pagination label, .table-pagination div { display: flex; align-items: center; gap: 6px; }
.table-pagination select { min-height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0 8px; color: var(--ink); }
.table-pagination .icon-button { width: 32px; min-width: 32px; height: 32px; }
.table-pagination .icon-button:disabled { opacity: .4; cursor: not-allowed; }
.category-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.category-sort-button { white-space: nowrap; }
.muted-copy { color: var(--muted); }
.auth-form-separated { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.captcha-row { display: grid; grid-template-columns: 1fr 150px; gap: 8px; }
.captcha-row img { width: 150px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; }
.auth-links a { color: var(--blue); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-page .auth-shell > .auth-brand { margin-bottom: 0; padding: 48px; flex-direction: column; align-items: flex-start; justify-content: center; background: #0d2033; color: #fff; }
.auth-page .auth-shell > .auth-brand img { width: 72px; height: 72px; }
.auth-page .auth-shell > .auth-brand h1 { margin: 22px 0 8px; font-size: 30px; }
.auth-page .auth-shell > .auth-brand p { color: #a9bfd4; }
.drawer-fields label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.drawer-fields input, .drawer-fields select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0 12px; color: var(--ink); }
.drawer-fields input[readonly] { background: #fbfcfe; }
.drawer-action-spacer { flex: 1; }
.product-route-drawer .drawer-panel { width: min(780px, 100%); }
.compact-status-select { min-height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0 8px; }
.product-route-drawer .notify-check { margin: 10px 0 0; }
.recent-product-row { display: grid; grid-template-columns: 72px 1fr 24px; align-items: center; gap: 10px; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.recent-product-row + .recent-product-row { margin-top: 8px; }
.recent-product-row small, .todo-row small { display: block; color: var(--muted); margin-top: 3px; }
.recent-product-row > b { color: var(--muted); font-size: 18px; text-align: center; }
.todo-row { display: grid !important; grid-template-columns: 18px 1fr; align-items: start; gap: 10px; min-height: 62px; }
.todo-row input { margin-top: 4px; }
.manager-metrics .metric { border-top: 3px solid #c7d4e2; }
.manager-metrics .metric.accent { border-top-color: var(--orange); }
.product-table-panel { margin-top: 14px !important; }
.product-list-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.filter-details { position: relative; }
.filter-details summary { list-style: none; cursor: pointer; }
.filter-details summary::-webkit-details-marker { display: none; }
.filter-details[open] .product-filter-row { position: absolute; z-index: 8; top: 46px; right: 0; width: min(980px, calc(100vw - 300px)); padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.file-badges { display: grid; grid-template-columns: repeat(4, minmax(38px, auto)); gap: 5px; align-content: center; }
.file-badges span { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 7px; border: 1px solid #cbd8e6; border-radius: 999px; color: #526b85; font-size: 12px; font-weight: 700; white-space: nowrap; }
#products-view .product-table { table-layout: fixed; min-width: 1080px; }
#products-view .product-table th:nth-child(1) { width: 20%; }
#products-view .product-table th:nth-child(2) { width: 9%; }
#products-view .product-table th:nth-child(3) { width: 8%; }
#products-view .product-table th:nth-child(4) { width: 8%; }
#products-view .product-table th:nth-child(5) { width: 15%; }
#products-view .product-table th:nth-child(6) { width: 22%; }
#products-view .product-table th:nth-child(7) { width: 18%; }
#products-view .product-table td.file-badges { padding-right: 28px; }
#products-view .product-table td.row-actions { padding-left: 24px; white-space: nowrap; }
#products-view .file-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.invite-create-form { margin-bottom: 16px; }
.invite-card-grid article { min-height: 160px; }
.invite-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.invite-card-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.invite-card-actions .inline-form { flex-direction: row; }
.invite-card-actions input { width: 80px; min-height: 34px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 8px; }
.row-edit-details { position: relative; }
.row-edit-details summary { list-style: none; cursor: pointer; }
.row-edit-details summary::-webkit-details-marker { display: none; }
.row-edit-form { position: absolute; z-index: 12; top: 42px; right: 0; width: 280px; display: grid; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.row-edit-form label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.row-edit-form select { min-height: 38px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 10px; background: #fff; }

@media (max-width: 900px) {
  .functional-content { padding: 20px; }
  .form-grid, .detail-grid, .two-column { grid-template-columns: 1fr; }
  .upload-inline, .inline-form { align-items: stretch; flex-direction: column; }
  .upload-inline select { max-width: none; }
}

@media (max-width: 640px) {
  .timeline .notification-row { grid-template-columns: 18px minmax(0, 1fr); }
  .timeline .notification-row > .row-button,
  .timeline .notification-row > em { grid-column: 2; justify-self: start; margin-top: 2px; }
}
