:root {
  --bg: #f5f6f8;
  --app-bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #1f2937;
  --text-main: #1f2937;
  --muted: #697386;
  --text-muted: #697386;
  --text-soft: #94a3b8;
  --line: #dde3ea;
  --border-color: #dde3ea;
  --primary: #b91c2c;
  --primary-dark: #931827;
  --dark: #202938;
  --primary-button: #202938;
  --button-bg: #202938;
  --button-text: #ffffff;
  --green: #16734a;
  --amber: #9a5b00;
  --red: #b42318;
  --shadow: 0 10px 28px rgba(20, 32, 50, 0.08);
  --card-bg: #ffffff;
  --panel-bg: #ffffff;
  --input-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --table-header-bg: #f6f8fb;
  --table-row-hover: rgba(148, 163, 184, .08);
  --modal-bg: #ffffff;
  --tag-bg: #eef2f6;
  --header-divider: linear-gradient(90deg, transparent, rgba(148, 163, 184, .42), transparent);
  --header-sweep: linear-gradient(90deg, transparent, rgba(56, 189, 248, .72), rgba(168, 85, 247, .58), rgba(244, 114, 182, .5), transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--app-bg, var(--bg));
  color: var(--text-main, var(--text));
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  transition: grid-template-columns 0.2s ease;
  overflow: hidden;
}

body.theme-aurora {
  --bg: #eef8ff;
  --app-bg: #eef8ff;
  --surface: rgba(255, 255, 255, 0.9);
  --panel-bg: rgba(255, 255, 255, 0.92);
  --card-bg: rgba(255, 255, 255, 0.9);
  --input-bg: rgba(255, 255, 255, 0.96);
  --sidebar-bg: rgba(255, 255, 255, 0.88);
  --line: rgba(167, 191, 228, .52);
  --border-color: rgba(167, 191, 228, .52);
  --modal-bg: rgba(255, 255, 255, .92);
  --table-header-bg: rgba(248, 250, 252, .92);
  --table-row-hover: rgba(125, 168, 231, .12);
  --shadow: 0 16px 42px rgba(78, 101, 148, .12);
  --header-divider: linear-gradient(90deg, transparent, rgba(154, 184, 229, .5), transparent);
  --header-sweep: linear-gradient(90deg, transparent, rgba(125, 211, 252, .82), rgba(216, 180, 254, .86), rgba(251, 207, 232, .72), transparent);
  background: radial-gradient(circle at 12% 18%, rgba(255, 248, 235, 0.95), transparent 32%),
    radial-gradient(circle at 82% 20%, rgba(196, 239, 255, 0.88), transparent 34%),
    radial-gradient(circle at 78% 82%, rgba(232, 211, 255, 0.88), transparent 36%),
    linear-gradient(120deg, #dff6ff, #f3efff, #ffeaf3, #e7fff8, #fffaf0);
  background-size: 180% 180%;
  animation: loginGradient 15s ease-in-out infinite;
}

body.theme-zen {
  --bg: #f7f4ee;
  --app-bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-soft: #f4f1ea;
  --panel-bg: #fffdf8;
  --card-bg: #fffdf8;
  --input-bg: #fffefa;
  --sidebar-bg: #fbf8f1;
  --line: #ddd6c9;
  --border-color: #ddd6c9;
  --text: #2f2a25;
  --text-main: #2f2a25;
  --muted: #756d62;
  --text-muted: #756d62;
  --text-soft: #998f82;
  --primary-button: #3f3a34;
  --button-bg: #3f3a34;
  --button-text: #fffdf8;
  --table-header-bg: #f1ede4;
  --table-row-hover: rgba(128, 105, 78, .1);
  --modal-bg: #fffdf8;
  --tag-bg: #eee8dc;
  --shadow: 0 8px 24px rgba(78, 67, 53, .06);
  --header-divider: linear-gradient(90deg, transparent, rgba(156, 136, 106, .38), transparent);
  --header-sweep: linear-gradient(90deg, transparent, rgba(255, 253, 248, .94), rgba(217, 180, 118, .72), transparent);
}

body.theme-midnight {
  --bg: #0f141b;
  --app-bg: #0f141b;
  --surface: #1b2330;
  --surface-soft: #243041;
  --panel-bg: #1b2330;
  --card-bg: #1b2330;
  --input-bg: #243041;
  --sidebar-bg: #111821;
  --text: #f8fafc;
  --text-main: #f8fafc;
  --muted: #cbd5e1;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --line: #334155;
  --border-color: #334155;
  --primary-button: #26354a;
  --button-bg: #26354a;
  --button-text: #f8fafc;
  --table-header-bg: #202a38;
  --table-row-hover: rgba(148, 163, 184, .12);
  --modal-bg: #1b2330;
  --tag-bg: #243041;
  --shadow: none;
  --header-divider: linear-gradient(90deg, transparent, rgba(148, 163, 184, .42), transparent);
  --header-sweep: linear-gradient(90deg, transparent, rgba(125, 211, 252, .9), transparent);
}

body.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--dark);
}

th {
  position: relative;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  opacity: 0;
  transition: opacity .16s ease;
  z-index: 2;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: rgba(100, 116, 139, .45);
  transform: translateX(-50%);
}

th:hover > .col-resizer,
th.resizing-col > .col-resizer {
  opacity: 1;
}

th.resized-col,
td.resized-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-col-standard {
  width: 12em;
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button,
.button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary-button, var(--button-bg));
  color: var(--button-text);
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  filter: brightness(0.92);
}

.secondary {
  background: var(--surface-soft);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.secondary:hover {
  background: var(--table-row-hover);
}

.danger {
  background: var(--red);
}

.danger-outline {
  background: #fff1f0;
  color: var(--red);
  border: 1px solid #ffd0cc;
}

.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-btn {
  width: 38px;
  padding: 0;
  background: var(--primary);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar {
  height: 100vh;
  padding: 18px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: padding 0.2s ease;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
}

body.theme-aurora .sidebar,
body.theme-aurora .panel,
body.theme-aurora .dash-card,
body.theme-aurora .table-scroll,
body.theme-aurora .inventory-table-wrap {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-color: rgba(255,255,255,.32);
}

.sidebar.collapsed {
  padding: 18px;
}

.sidebar.collapsed .brand {
  justify-content: center;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-user {
  display: none;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 10px 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--panel-bg);
}

.sidebar-user strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.sidebar-user small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-soft);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 34px;
  height: 34px;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.avatar-xl {
  width: 118px;
  height: 118px;
  font-size: 42px;
}

.settings-user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.account-settings-panel {
  max-width: 860px;
  padding: 42px 56px;
}

.account-settings-title {
  font-size: 22px;
  margin-bottom: 28px;
}

.account-settings-hero {
  align-items: center;
  gap: 28px;
  padding: 0 0 28px;
  border-bottom: 0;
}

.account-settings-hero h3 {
  font-size: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-settings-hero p {
  margin-top: 6px;
  color: var(--text-main);
}

.account-settings-form {
  gap: 18px;
}

.account-settings-form h4 {
  margin-top: 12px;
  font-size: 16px;
}

.avatar-upload-row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  margin: 8px 0 18px;
}

.avatar-upload-preview {
  width: 110px;
  height: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border-color);
}

.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-user-card h3 {
  margin-bottom: 4px;
}

.created-account-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-soft);
}

.account-center-card {
  width: min(980px, calc(100vw - 40px));
  display: grid;
  gap: 18px;
}

#account-center-password-form {
  grid-template-columns: 1fr;
}

.account-center-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.account-center-head h3 {
  margin-bottom: 4px;
}

.account-center-head p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
}

.system-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.system-stats div,
.system-panel {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--panel-bg);
}

.system-stats strong {
  display: block;
  font-size: 26px;
}

.system-stats span {
  color: var(--text-muted);
  font-size: 13px;
}

.system-grid {
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(520px, 1.15fr);
  gap: 16px;
}

.user-admin-view {
  --user-admin-blue: #5275f4;
  --user-admin-purple: #765ee9;
  --user-admin-green: #35a76f;
  --user-admin-red: #dc5966;
  --user-admin-text: #182230;
  --user-admin-muted: #667085;
  --user-admin-border: #e2e8f0;
  min-width: 0;
}

.user-admin-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.user-admin-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 0 0;
}

.user-admin-intro p {
  margin: 0;
  color: var(--user-admin-muted);
  font-size: 14px;
  line-height: 1.7;
}

.user-admin-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #416ff2, #6b5cf0);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}

.user-admin-add:hover {
  background: linear-gradient(135deg, #3766e8, #604fdf);
  box-shadow: none;
}

.user-admin-add svg,
.user-summary-icon svg,
.user-directory-toolbar svg,
.user-more-button svg,
.user-pagination svg,
.user-aside-heading svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.user-admin-primary {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.user-summary-card {
  --summary-accent: #5275f4;
  --summary-soft: rgba(82, 117, 244, .12);
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 110px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--summary-accent) 20%, #e4e9f1);
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 105%, color-mix(in srgb, var(--summary-accent) 13%, transparent) 0 28%, transparent 29%),
    linear-gradient(135deg, color-mix(in srgb, var(--summary-accent) 7%, #fff) 0%, #fff 70%);
  box-shadow: none;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out;
}

.user-summary-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--summary-soft);
  pointer-events: none;
}

.user-summary-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--summary-accent) 48%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--summary-accent) 8%, transparent);
}

.user-summary-card.admin {
  --summary-accent: #8a68df;
  --summary-soft: rgba(138, 104, 223, .11);
}

.user-summary-card.operator {
  --summary-accent: #38aa72;
  --summary-soft: rgba(56, 170, 114, .11);
}

.user-summary-card.assistant {
  --summary-accent: #2b9fb1;
  --summary-soft: rgba(43, 159, 177, .11);
}

.user-summary-card.boss {
  --summary-accent: #c48b32;
  --summary-soft: rgba(196, 139, 50, .11);
}

.user-summary-card.viewer {
  --summary-accent: #668ad2;
  --summary-soft: rgba(102, 138, 210, .11);
}

.user-summary-card.inactive {
  --summary-accent: #db6470;
  --summary-soft: rgba(219, 100, 112, .10);
}

.user-summary-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--summary-accent) 13%, #fff);
  color: var(--summary-accent);
}

.user-summary-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.user-summary-copy {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
}

.user-summary-copy strong {
  color: var(--user-admin-text);
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.user-summary-copy span {
  margin-top: 5px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.user-summary-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--user-admin-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-directory {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.user-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(145px, .54fr) minmax(145px, .54fr) auto auto;
  gap: 10px;
  align-items: center;
}

.user-search-field,
.user-filter-field {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  border: 1px solid var(--user-admin-border);
  border-radius: 10px;
  background: #fff;
  color: #64748b;
}

.user-search-field {
  gap: 9px;
  padding: 0 13px;
}

.user-search-field svg {
  flex: 0 0 19px;
}

.user-search-field input,
.user-filter-field select,
.user-pagination select {
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--user-admin-text);
  box-shadow: none;
}

.user-search-field input {
  width: 100%;
}

.user-filter-field {
  padding-left: 12px;
}

.user-filter-field span {
  flex: 0 0 auto;
  padding-right: 10px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}

.user-filter-field select {
  width: 100%;
  padding-right: 28px;
  font-weight: 700;
}

.user-search-field:focus-within,
.user-filter-field:focus-within {
  border-color: rgba(82, 117, 244, .48);
  box-shadow: 0 0 0 3px rgba(82, 117, 244, .08);
}

.user-bulk-menu {
  position: relative;
  min-width: 132px;
}

.user-bulk-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--user-admin-border);
  border-radius: 10px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.user-bulk-menu summary::-webkit-details-marker {
  display: none;
}

.user-bulk-menu.is-disabled {
  pointer-events: none;
  opacity: .52;
}

.user-bulk-menu[open] summary {
  border-color: rgba(82, 117, 244, .42);
}

.user-bulk-menu-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--user-admin-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}

.user-bulk-menu-panel button {
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: #344054;
  font-size: 13px;
}

.user-bulk-menu-panel button:hover {
  background: #f4f6fa;
}

.user-bulk-menu-panel button.danger {
  color: #d1434f;
}

.user-bulk-menu-panel button.danger:hover {
  background: rgba(220, 53, 69, .08);
}

.user-clear-filters {
  min-height: 42px;
  padding: 0 8px;
  background: transparent;
  color: #667085;
  font-size: 13px;
}

.user-clear-filters:hover {
  background: transparent;
  color: #315fcf;
}

.user-table-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--user-admin-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.user-table-shell:hover {
  border-color: #d6deea;
  box-shadow: 0 0 0 3px rgba(82, 117, 244, .035);
}

.user-table-scroll {
  min-width: 0;
  overflow-x: auto;
}

.user-admin-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #344054;
  font-size: 13px;
}

.user-admin-table th:nth-child(1) { width: 38px; }
.user-admin-table th:nth-child(2) { width: 58px; }
.user-admin-table th:nth-child(3) { width: 135px; }
.user-admin-table th:nth-child(4) { width: 115px; }
.user-admin-table th:nth-child(5) { width: 145px; }
.user-admin-table th:nth-child(6) { width: 105px; }
.user-admin-table th:nth-child(7) { width: 86px; }
.user-admin-table th:nth-child(8) { width: 150px; }
.user-admin-table th:nth-child(9) { width: 225px; }

.user-admin-table th {
  height: 48px;
  padding: 0 11px;
  border-bottom: 1px solid var(--user-admin-border);
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.user-admin-table td {
  height: 72px;
  padding: 9px 11px;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  vertical-align: middle;
  white-space: nowrap;
}

.user-admin-table td:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.user-admin-table tbody tr:hover td {
  background: #fbfcff;
}

.user-admin-table tbody tr.is-selected td {
  background: #f7f9ff;
}

.user-select-cell {
  width: 38px;
  text-align: center !important;
}

.user-select-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--user-admin-blue);
}

.user-list-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(82, 117, 244, .12);
  color: #4c5fc7;
  font-size: 15px;
  font-weight: 850;
}

.user-list-avatar.tone-0 { background: #eef0ff; color: #665bd6; }
.user-list-avatar.tone-1 { background: #eaf4ff; color: #3e70c5; }
.user-list-avatar.tone-2 { background: #e9f7ef; color: #31885d; }
.user-list-avatar.tone-3 { background: #fff3e8; color: #ba6b31; }
.user-list-avatar.tone-4 { background: #f8edff; color: #8552bd; }
.user-list-avatar.tone-5 { background: #eef3f8; color: #536c89; }

.user-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-identity {
  display: grid;
  gap: 4px;
  min-width: 135px;
}

.user-identity strong {
  overflow: hidden;
  color: var(--user-admin-text);
  font-size: 13px;
  text-overflow: ellipsis;
}

.user-identity small {
  color: #7b8799;
  font-size: 11px;
}

.user-account-id {
  padding: 0;
  background: transparent;
  color: #344054;
  font-family: inherit;
  font-size: 13px;
}

.user-role-badge,
.user-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.user-role-badge.admin {
  background: #f0ebff;
  color: #6941c6;
}

.user-role-badge.operator {
  background: #e8f7ef;
  color: #218257;
}

.user-role-badge.viewer {
  background: #edf3fb;
  color: #4b6b91;
}

.user-status-badge.active {
  background: #e9f8ef;
  color: #238457;
}

.user-status-badge.inactive {
  background: #fff0f1;
  color: #cb3f4c;
}

.user-status-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.user-login-time {
  color: #526174;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.user-actions-heading {
  text-align: right !important;
}

.user-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.user-action-button,
.user-more-button {
  min-height: 32px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  box-shadow: none;
  font-size: 12px;
  font-weight: 750;
}

.user-action-button {
  padding: 0 10px;
}

.user-action-button:hover,
.user-more-button:hover {
  border-color: #cbd5e1;
  background: #f7f9fc;
}

.user-action-button.warning {
  border-color: rgba(220, 53, 69, .22);
  color: #d1434f;
}

.user-action-button.warning:hover {
  background: rgba(220, 53, 69, .06);
}

.user-action-button.success {
  border-color: rgba(53, 167, 111, .24);
  color: #26865a;
}

.user-action-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.user-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  padding: 0;
}

.user-more-button svg {
  width: 17px;
  height: 17px;
}

.user-empty-state {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 190px;
  color: var(--user-admin-muted);
}

.user-empty-state strong {
  color: var(--user-admin-text);
  font-size: 14px;
}

.user-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 15px;
  border-top: 1px solid var(--user-admin-border);
  color: #667085;
  font-size: 12px;
}

.user-pagination {
  display: flex;
  align-items: center;
  gap: 7px;
}

.user-pagination button,
.user-pagination strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  color: #53657c;
}

.user-pagination strong {
  border-color: #7c91ff;
  color: #315fcf;
}

.user-pagination button:disabled {
  opacity: .4;
}

.user-pagination svg {
  width: 16px;
  height: 16px;
}

.user-pagination label {
  margin: 0 0 0 8px;
  padding: 0 10px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
}

.user-pagination select {
  width: 84px;
  height: 32px;
  font-size: 12px;
}

.user-admin-aside {
  display: grid;
  gap: 16px;
}

.user-aside-card {
  padding: 18px;
  border: 1px solid var(--user-admin-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.user-aside-card:hover {
  border-color: #d4dce8;
  box-shadow: 0 0 0 3px rgba(82, 117, 244, .035);
}

.user-aside-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.user-aside-heading h3 {
  margin: 0;
  color: var(--user-admin-text);
  font-size: 15px;
}

.user-aside-heading > span {
  color: #3e6ddd;
  font-size: 11px;
  font-weight: 800;
}

.user-aside-heading svg {
  color: #44536a;
}

.permission-note {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #eff2f6;
}

.permission-note:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.permission-note > i {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #668ad2;
}

.permission-note.admin > i { background: #8065df; }
.permission-note.operator > i { background: #39aa72; }

.permission-note strong {
  color: #344054;
  font-size: 12px;
}

.permission-note p {
  margin: 4px 0 0;
  color: #7b8799;
  font-size: 11px;
  line-height: 1.65;
}

.recent-user-list {
  display: grid;
  gap: 4px;
}

.recent-user-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 5px 0;
}

.recent-user-item .user-list-avatar {
  width: 36px;
  height: 36px;
}

.recent-user-item > div:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recent-user-item strong {
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-user-item small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #7b8799;
  font-size: 10px;
}

.recent-user-item small i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #35a76f;
}

.recent-user-item time {
  color: #7b8799;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.user-aside-empty {
  padding: 20px 0;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.user-action-menu {
  position: fixed;
  z-index: 5000;
  display: grid;
  width: 176px;
  padding: 6px;
  border: 1px solid var(--user-admin-border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, .14);
}

.user-action-menu.hidden {
  display: none;
}

.user-action-menu button {
  justify-content: flex-start;
  min-height: 35px;
  padding: 0 10px;
  background: transparent;
  color: #344054;
  font-size: 12px;
  text-align: left;
}

.user-action-menu button:hover {
  background: #f5f7fa;
}

.user-action-menu button.danger {
  color: #d1434f;
}

.user-action-menu button.danger:hover {
  background: rgba(220, 53, 69, .08);
}

.user-action-menu-separator {
  height: 1px;
  margin: 4px 5px;
  background: #edf1f5;
}

.user-access-dialog {
  width: min(720px, calc(100vw - 40px));
  max-width: none;
  overflow: hidden;
}

.user-access-dialog > .user-access-dialog-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  max-height: min(80vh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 26px 20px;
}

.user-dialog-kicker {
  color: #6f65d8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.user-access-dialog-card h3 {
  margin: 4px 0 18px;
}

.user-dialog-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
}

.user-dialog-identity > div:last-child {
  display: grid;
  gap: 3px;
}

.user-dialog-identity strong {
  color: var(--user-admin-text);
}

.user-dialog-identity small {
  color: #7b8799;
}

.user-dialog-details {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
}

.user-dialog-details > div {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #edf1f5;
}

.user-dialog-details dt {
  color: #7b8799;
  font-size: 12px;
}

.user-dialog-details dd {
  margin: 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.6;
}

body.square-cards .user-summary-card,
body.square-cards .user-search-field,
body.square-cards .user-filter-field,
body.square-cards .user-table-shell,
body.square-cards .user-aside-card,
body.square-cards .user-admin-add {
  border-radius: 0;
}

body.card-shadow-enabled .user-summary-card,
body.card-shadow-enabled .user-table-shell,
body.card-shadow-enabled .user-aside-card {
  box-shadow: 0 5px 18px rgba(15, 23, 42, .06);
}

@media (max-width: 1439px) {
  .user-admin-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-admin-aside {
    display: none;
  }
}

@media (min-width: 1440px) {
  .user-table-scroll {
    overflow-x: hidden;
  }
}

@media (max-width: 1080px) {
  .user-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user-directory-toolbar {
    grid-template-columns: minmax(240px, 1fr) minmax(150px, .6fr) minmax(150px, .6fr);
  }

  .user-bulk-menu,
  .user-clear-filters {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .user-admin-intro {
    align-items: flex-start;
  }

  .user-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-directory-toolbar {
    display: flex;
    flex-wrap: wrap;
  }

  .user-search-field {
    flex: 1 0 100%;
  }

  .user-filter-field {
    flex: 1 1 180px;
  }

  .user-table-footer {
    align-items: flex-start;
    gap: 12px;
    padding-block: 12px;
  }
}

@media (max-width: 520px) {
  .user-admin-intro {
    display: grid;
  }

  .user-admin-add {
    justify-self: start;
  }

  .user-summary-grid {
    grid-template-columns: 1fr;
  }

  .user-summary-card {
    min-height: 100px;
  }

  .user-filter-field {
    flex-basis: 100%;
  }

  .user-table-footer {
    display: grid;
  }

  .user-pagination label {
    display: none;
  }
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.editor-toolbar label {
  width: auto;
  min-height: 34px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--input-bg);
}

.editor-toolbar button,
.editor-toolbar select,
.editor-toolbar input[type="color"] {
  width: auto;
  min-height: 34px;
  height: 34px;
}

.editor-toolbar button {
  min-width: 42px;
  justify-content: center;
}

.editor-toolbar button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-toolbar input[type="color"] {
  width: 42px;
  min-width: 42px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  cursor: pointer;
}

.editor-toolbar input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.editor-toolbar input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}

.editor-toolbar input[type="file"] {
  width: 160px;
  height: auto;
  min-height: 0;
}

.rich-editor {
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-main);
  overflow: auto;
}

.rich-editor img,
.login-popup-card img,
.notification-body img {
  max-width: 100%;
  border-radius: 8px;
}

.notification-card {
  width: min(1120px, calc(100vw - 48px));
  height: min(76vh, 760px);
  padding: 24px 28px;
  gap: 16px;
  overflow: hidden;
}

.notification-card h3 {
  margin: 0;
  font-size: 24px;
}

.notification-list {
  display: block;
  height: 100%;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--panel-bg);
}

.notification-item {
  border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 100px 64px minmax(0, 1fr) 168px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
}

.notification-row:hover {
  background: var(--table-row-hover);
  transform: none;
  filter: none;
}

.notification-row strong {
  display: block;
  min-width: 0;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-row time {
  color: var(--text-muted);
  text-align: right;
  font-size: 13px;
  white-space: nowrap;
}

.notice-type,
.notice-read-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.notice-type {
  color: #1d4ed8;
  background: #dbeafe;
}

.notice-read-state {
  color: #4c5b70;
  background: #eef2f6;
}

.notification-item.unread .notice-read-state {
  color: #9a3412;
  background: #fed7aa;
}

.notification-item.unread .notification-row strong::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: #dc2626;
}

.notification-body {
  margin: 0 16px 14px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-main);
}

.notification-collapse {
  width: 34px;
  height: 28px;
  min-height: 28px;
  margin: 12px auto 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text-muted);
}

.notification-collapse:hover {
  color: var(--text-main);
  background: var(--table-row-hover);
  transform: translateY(-1px);
}

.notification-body h4 {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 18px;
}

.login-popup-card {
  width: min(680px, calc(100vw - 40px));
  animation: popupEnter .22s ease;
}

@keyframes popupEnter {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.avatar-crop-card {
  width: min(440px, calc(100vw - 40px));
}

#avatar-crop-canvas {
  width: 320px;
  height: 320px;
  max-width: 100%;
  border-radius: 12px;
  cursor: grab;
  justify-self: center;
}

#batch-crop-canvas {
  width: 320px;
  height: 320px;
  max-width: 100%;
  border-radius: 12px;
  cursor: grab;
  justify-self: center;
  background: #f4f7fb;
  border: 1px solid var(--line);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

button:disabled {
  background: #e5e7eb;
  color: #7b8494;
  border-color: #d1d5db;
  filter: none;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
}

.brand p,
.eyebrow,
.muted,
small,
.panel-head p,
.list-head p {
  color: var(--muted);
  font-size: 13px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.menu::-webkit-scrollbar {
  width: 6px;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .32);
  border-radius: 999px;
}

.menu::-webkit-scrollbar-track {
  background: transparent;
}

.menu-group {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.menu-title,
.menu-group-head {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px 4px;
}

.menu-group-head {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
  background: transparent;
  color: var(--text-main);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0;
  padding: 6px 8px;
}

.menu-group-head:hover {
  background: var(--table-row-hover);
  filter: none;
}

.menu-group-head svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

.menu-group.collapsed .menu-group-head .menu-chevron {
  transform: rotate(-90deg);
}

.menu-group.collapsed .menu-group-items {
  display: none;
}

.menu-group-items {
  display: grid;
  gap: 4px;
}

.menu-item {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  color: var(--text-muted);
}

.menu-group-items .menu-item {
  padding-left: 18px;
}

.menu-item.active {
  background: var(--table-row-hover);
  color: var(--primary);
  font-weight: 700;
}

.menu-item:hover {
  background: var(--table-row-hover);
  filter: none;
}

.settings-menu {
  gap: 8px;
  color: var(--text-main);
  font-weight: 800;
}

.settings-menu svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-menu-wrap {
  position: relative;
  flex: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.settings-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  z-index: 30;
}

.settings-popover-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.settings-popover-user strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.settings-popover-user small {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 11px;
}

.settings-popover button {
  justify-content: flex-start;
  gap: 8px;
  background: transparent;
  color: var(--text-main);
}

.settings-popover button:hover {
  background: var(--table-row-hover);
}

.settings-popover button.danger-logout,
.settings-tabs button.danger-logout {
  color: #dc3545;
}

.settings-popover button.danger-logout:hover,
.settings-tabs button.danger-logout:hover {
  background: rgba(220, 53, 69, .08);
  color: #c72f3d;
}

.danger-logout svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-tabs button.danger-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(220, 53, 69, .04);
}

.must-password-dot {
  display: none;
  position: relative;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.must-password-dot:hover::after,
.must-password-dot:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #182230;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .14);
}

.password-section-title {
  display: flex;
  align-items: center;
}

body.needs-password-change .settings-menu::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

body.needs-password-change .must-password-dot {
  display: inline-flex;
}

[data-system-admin-only].hidden {
  display: none !important;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 64px !important;
}

.password-input-wrap .password-visibility {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: auto;
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 12px;
  box-shadow: none;
}

.password-input-wrap .password-visibility:hover {
  background: #eef2f7;
  color: #344054;
}

.password-guidance {
  display: grid;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f8fafc;
}

.password-strength-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.password-strength-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex: 1;
}

.password-strength-track i {
  height: 5px;
  border-radius: 999px;
  background: #e4e7ec;
}

.password-guidance[data-strength="weak"] .password-strength-track i:first-child { background: #dc3545; }
.password-guidance[data-strength="medium"] .password-strength-track i:nth-child(-n+2) { background: #f59e0b; }
.password-guidance[data-strength="strong"] .password-strength-track i { background: #16a34a; }
.password-guidance[data-strength="weak"] .password-strength-label { color: #dc3545; }
.password-guidance[data-strength="medium"] .password-strength-label { color: #b45309; }
.password-guidance[data-strength="strong"] .password-strength-label { color: #15803d; }

.password-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  color: #667085;
  font-size: 12px;
}

.password-rule-list span::before {
  content: "○";
  margin-right: 6px;
}

.password-rule-list span.is-valid {
  color: #15803d;
}

.password-rule-list span.is-valid::before { content: "✓"; }

.security-reminder-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.security-reminder-card {
  width: min(460px, calc(100vw - 32px));
  text-align: center;
}

.security-reminder-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff1f2;
  color: #dc3545;
  font-size: 24px;
  font-weight: 800;
}

.security-reminder-card p {
  margin: 10px 0 22px;
  color: #475467;
  line-height: 1.7;
}

.user-admin-loading {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
}

.user-admin-loading span {
  height: 110px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eef2f6 25%, #f8fafc 50%, #eef2f6 75%);
  background-size: 200% 100%;
  animation: user-admin-skeleton 1.4s ease-in-out infinite;
}

@keyframes user-admin-skeleton { to { background-position: -200% 0; } }

.page-load-error {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 28px;
  padding: 56px 24px;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.page-load-error p { color: #667085; }

@media (prefers-reduced-motion: reduce) {
  .user-admin-loading span { animation: none; }
}

.main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px;
}

body.theme-midnight input,
body.theme-midnight select,
body.theme-midnight textarea,
body.theme-midnight .settings-popover,
body.theme-midnight th,
body.theme-midnight td,
body.theme-midnight .secondary {
  background: #242b35;
  color: var(--text);
  border-color: var(--line);
}

.page-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 52px;
  margin: -4px 0 28px;
  padding-bottom: 14px;
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--header-divider);
}

.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 20%;
  height: 1px;
  background: var(--header-sweep);
  animation: headerLineSweep 7s ease-in-out infinite;
}

@keyframes headerLineSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  15% { opacity: .85; }
  85% { opacity: .85; }
  100% { transform: translateX(520%); opacity: 0; }
}

.page-head > div:first-child {
  min-height: 42px;
  display: grid;
  align-content: center;
}

#page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-icon-btn,
.refresh-icon-btn {
  background: #ffffff;
  color: #202938;
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.top-icon-btn svg,
.refresh-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-icon-btn:hover,
.refresh-icon-btn:hover {
  background: #ffffff;
  color: #111827;
  filter: none;
  box-shadow: none;
  border-color: rgba(148, 163, 184, .7);
}

#top-search-btn {
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, rgba(115,192,232,.96), rgba(174,139,238,.92), rgba(244,161,198,.86), rgba(115,192,232,.96)) border-box;
  background-size: 100% 100%, 320% 320%;
  animation: topSearchBorder 7s ease-in-out infinite;
}

#top-search-btn:hover {
  border-color: transparent;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, rgba(115,192,232,1), rgba(174,139,238,.98), rgba(244,161,198,.92), rgba(115,192,232,1)) border-box;
  background-size: 100% 100%, 320% 320%;
}

@keyframes topSearchBorder {
  0%, 100% {
    background-position: 0 0, 0% 50%;
    color: #202938;
  }
  50% {
    background-position: 0 0, 100% 50%;
    color: #202938;
  }
}

.top-user-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-color);
}

.top-user-btn:hover {
  background: var(--table-row-hover);
  filter: none;
}

.avatar-xs {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

#top-notify-btn {
  position: relative;
}

body.has-unread-notifications #top-notify-btn::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.16);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel,
.settings-panel,
.table-scroll,
.inventory-table-wrap {
  background: var(--panel-bg);
}

.theme-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  cursor: pointer;
}

.theme-card:has(input:checked) {
  border-color: var(--primary-button);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.theme-card input {
  width: 16px;
  height: 16px;
}

.settings-panel {
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid #eceef3;
  border-radius: 0;
  padding: 32px;
}

.app-segmented-tabs {
  --segmented-track: #eef2f6;
  --segmented-border: #e4e9f1;
  --segmented-text: #667085;
  --segmented-hover-text: #344054;
  --segmented-active: #ffffff;
  --segmented-active-text: #2563eb;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--segmented-border);
  border-radius: 999px;
  background: var(--segmented-track);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  scrollbar-width: none;
}

.app-segmented-tabs::-webkit-scrollbar {
  display: none;
}

.app-segmented-tabs > button {
  flex: 1 1 0;
  min-width: max-content;
  min-height: 38px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--segmented-text);
  box-shadow: none;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}

.app-segmented-tabs > button:hover {
  background: rgba(255, 255, 255, 0.62);
  color: var(--segmented-hover-text);
}

.app-segmented-tabs > button:focus {
  outline: 0;
}

.app-segmented-tabs > button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.app-segmented-tabs > button.active,
.app-segmented-tabs > button[aria-selected="true"] {
  background: var(--segmented-active);
  color: var(--segmented-active-text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
}

.settings-tabs.app-segmented-tabs {
  width: min(100%, 980px);
  margin-bottom: 18px;
}

.settings-tabs.app-segmented-tabs > button {
  flex: 1 0 110px;
  min-height: 42px;
  padding-inline: 14px;
}

.settings-tabs.app-segmented-tabs > button.danger-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  color: #dc3545;
}

.settings-tabs.app-segmented-tabs > button.danger-logout:hover {
  background: rgba(220, 53, 69, 0.08);
  color: #c72f3d;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.option-manager,
.option-list-inner {
  display: grid;
  gap: 12px;
}

.option-group {
  padding: 14px 0;
  border-bottom: 1px solid #eceef3;
}

.option-group-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.option-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.option-add-line,
.option-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.option-add-line {
  margin-bottom: 10px;
  width: 100%;
}

.option-add-line input {
  flex: 1;
  min-width: 220px;
}

.option-edit-row input {
  width: min(360px, 100%);
}

.about-page {
  background: #fff;
  padding: 32px;
  border-bottom: 1px solid #eceef3;
  line-height: 1.8;
}

.narrow {
  max-width: 760px;
  margin-bottom: 18px;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-section h4 {
  margin-bottom: 12px;
  font-size: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  color: #526075;
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--input-bg);
  color: var(--text-main);
}

textarea {
  width: 100%;
  min-height: 120px;
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--input-bg);
  color: var(--text-main);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(185, 28, 44, 0.16);
  border-color: var(--primary);
}

.field-error input,
.field-error select {
  border-color: var(--red);
  background: #fff7f7;
}

.error-text {
  color: var(--red);
  font-weight: 600;
}

.simple-form {
  display: grid;
  gap: 14px;
}

.inline-form,
.upload-form,
.form-actions,
.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.page-head .head-actions {
  flex-wrap: nowrap;
}

.inline-form input {
  max-width: 320px;
}

.tags {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.option-row input {
  min-height: 34px;
}

.option-row button:disabled {
  opacity: 0.45;
  cursor: default;
}

.calc-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.calc-strip span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: #4d5b70;
  font-size: 13px;
}

.form-actions {
  margin-top: 18px;
}

.import-box {
  display: grid;
  gap: 14px;
}

.result-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  line-height: 1.7;
}

.inventory-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inventory-metrics article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.inventory-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.inventory-metrics strong {
  font-size: 24px;
}

.inventory-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: calc(100vh - 320px);
  min-height: 360px;
}

.inventory-table {
  min-width: 1420px;
}

.inventory-table th,
.inventory-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-table th:nth-child(1),
.inventory-table td:nth-child(1) {
  width: 52px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
  width: 150px;
}

.inventory-table th:nth-child(3),
.inventory-table td:nth-child(3) {
  width: 150px;
}

.inventory-table th:nth-child(4),
.inventory-table td:nth-child(4) {
  width: 300px;
}

.wide-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.inventory-badge.safe {
  background: #dcfce7;
  color: var(--green);
}

.inventory-badge.need {
  background: #fef3c7;
  color: var(--amber);
}

.inventory-badge.urgent {
  background: #fecaca;
  color: var(--red);
}

.inventory-badge.nosales {
  background: #e5e7eb;
  color: #4c5b70;
}

.help-dot,
.sort-link {
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #edf1f5;
  color: #2e3a4d;
  font-size: 12px;
}

.sort-link {
  border-radius: 4px;
  font-weight: 700;
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.inventory-import-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-import-card p,
.unmatched-list {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.inventory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.inventory-actions select {
  width: 130px;
}

.counter {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(5, minmax(120px, 170px));
  gap: 10px;
  margin-bottom: 16px;
}

#product-list .panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#product-list .filters {
  grid-template-columns: minmax(220px, 1fr) repeat(auto-fit, minmax(140px, 170px));
  max-width: 100%;
  min-width: 0;
}

#inventory-status .filters {
  grid-template-columns: minmax(220px, 1fr) repeat(5, minmax(110px, 160px));
}

.product-groups {
  --product-group-columns: 34px 70px minmax(120px, .85fr) minmax(180px, 1.35fr) minmax(96px, .66fr) minmax(92px, .66fr) minmax(120px, .85fr) 86px 86px minmax(210px, .95fr);
  --product-child-columns: 70px minmax(120px, .85fr) minmax(120px, .9fr) minmax(180px, 1.35fr) minmax(82px, .55fr) minmax(82px, .55fr) minmax(108px, .72fr) 84px minmax(210px, .95fr);
  display: grid;
  gap: 10px;
  height: auto;
  min-height: auto;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-right: 2px;
}

.group-header {
  display: grid;
  grid-template-columns: var(--product-group-columns);
  gap: 8px;
  align-items: center;
  padding: 12px;
  color: #5b687b;
  font-size: 13px;
  font-weight: 700;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  min-width: 1080px;
  box-sizing: border-box;
}

.group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  width: 100%;
  min-width: 1080px;
  max-width: 100%;
  box-sizing: border-box;
}

.group-summary {
  display: grid;
  grid-template-columns: var(--product-group-columns);
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: #fbfcfd;
  cursor: pointer;
  transition: background .16s ease;
}

.group-summary:hover,
.child-row:hover {
  background: var(--table-row-hover);
}

.group-header > *,
.group-summary > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-header > :nth-child(2),
.group-summary > :nth-child(2),
.group-header > :nth-child(8),
.group-summary > :nth-child(8),
.group-header > :nth-child(9),
.group-summary > :nth-child(9) {
  justify-self: center;
  text-align: center;
}

.group-header > :nth-child(3),
.group-summary > :nth-child(3),
.group-header > :nth-child(4),
.group-summary > :nth-child(4),
.group-header > :nth-child(5),
.group-summary > :nth-child(5),
.group-header > :nth-child(6),
.group-summary > :nth-child(6),
.group-header > :nth-child(7),
.group-summary > :nth-child(7) {
  justify-self: start;
  text-align: left;
}

.group-header > :last-child,
.group-summary > :last-child {
  justify-self: stretch;
  text-align: center;
  overflow: visible;
}

.group-summary > :last-child {
  justify-content: center;
}

.expand-btn {
  width: 30px;
  min-height: 30px;
  padding: 0;
  background: #edf1f5;
  color: #2e3a4d;
}

.summary-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

.children {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.child-grid-table {
  width: 100%;
  min-width: 1040px;
  box-sizing: border-box;
}

.product-child-grid {
  display: grid;
  grid-template-columns: var(--product-child-columns);
  gap: 8px;
  align-items: center;
}

.child-header {
  min-height: 48px;
  padding: 10px 12px;
  background: var(--table-header-bg);
  color: #5b687b;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.child-row {
  min-height: 82px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s ease;
}

.child-header > *,
.child-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-header > :nth-child(1),
.child-row > :nth-child(1),
.child-header > :nth-child(5),
.child-row > :nth-child(5),
.child-header > :nth-child(6),
.child-row > :nth-child(6),
.child-header > :nth-child(8),
.child-row > :nth-child(8) {
  justify-self: center;
  text-align: center;
}

.child-header > :last-child,
.child-row > :last-child {
  justify-self: stretch;
  text-align: center;
  overflow: visible;
}

.sku-expand {
  width: 28px;
  min-height: 28px;
}

.sku-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sku-detail div {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-width: 0;
  overflow: hidden;
}

.sku-detail span {
  color: var(--muted);
  font-size: 12px;
}

.sku-detail strong {
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  table-layout: fixed;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  background: var(--table-header-bg);
  color: var(--text-muted);
}

.inventory-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.children table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed !important;
}

.children th:nth-child(1),
.children td:nth-child(1) { width: 66px; min-width: 66px; max-width: 66px; }
.children th:nth-child(2),
.children td:nth-child(2) { width: 145px; min-width: 145px; max-width: 145px; }
.children th:nth-child(3),
.children td:nth-child(3) { width: 126px; min-width: 126px; max-width: 126px; }
.children th:nth-child(4),
.children td:nth-child(4) { width: 12em; min-width: 12em; max-width: 12em; }
.children th:nth-child(5),
.children td:nth-child(5) { width: 92px; min-width: 92px; max-width: 92px; }
.children th:nth-child(6),
.children td:nth-child(6) { width: 92px; min-width: 92px; max-width: 92px; }
.children th:nth-child(7),
.children td:nth-child(7) { width: 126px; min-width: 126px; max-width: 126px; }
.children th:nth-child(8),
.children td:nth-child(8) { width: 90px; min-width: 90px; max-width: 90px; }
.children th:nth-child(9),
.children td:nth-child(9) { width: 220px; min-width: 220px; max-width: 220px; }

.children th:nth-child(1),
.children td:nth-child(1),
.children th:nth-child(5),
.children td:nth-child(5),
.children th:nth-child(6),
.children td:nth-child(6),
.children th:nth-child(8),
.children td:nth-child(8) {
  text-align: center;
}

.children th:nth-child(9),
.children td:nth-child(9) {
  text-align: center;
}

.children td {
  overflow: hidden;
  text-overflow: ellipsis;
  height: 82px;
  vertical-align: middle;
}

.children th {
  height: 48px;
}

.children .child-row .row-actions {
  height: 100%;
  width: 100%;
}

.children td.row-actions {
  display: table-cell;
  text-align: right;
  vertical-align: middle;
}

.children td.row-actions button {
  margin-left: 6px;
}

.children td.row-actions button:first-child {
  margin-left: 0;
}

.children .sku-detail-row td {
  height: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: #e8f6ee;
  color: var(--green);
}

.badge.warn {
  background: #fff2d9;
  color: var(--amber);
}

.badge.neutral {
  background: #eef2f6;
  color: #4c5b70;
}

.hidden {
  display: none !important;
}

.empty,
.empty-line {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

#command-dialog::backdrop {
  background: rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-card,
.command-card {
  position: relative;
}

.dialog-card {
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
  display: grid;
  gap: 14px;
  color: var(--text-main);
  background: var(--modal-bg);
}

dialog .account-center-card {
  width: min(944px, calc(100vw - 48px));
  max-height: min(88vh, 980px);
  overflow: auto;
  padding: 24px 28px;
  gap: 18px;
}

dialog .notification-card {
  width: min(1056px, calc(100vw - 56px));
  height: min(53vh, 532px);
  padding: 22px 28px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

#widget-dialog .dialog-card {
  width: min(760px, calc(100vw - 48px));
}

#purchase-import-dialog .dialog-card,
#shipment-import-dialog .dialog-card {
  width: min(720px, calc(100vw - 48px));
}

.dialog-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  z-index: 2;
  cursor: pointer;
}

.dialog-x:hover {
  background: #eef2f6;
  color: var(--text);
}

.dialog-x svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.wide-dialog {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.export-dialog-card {
  width: min(1100px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.export-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 12px 0 8px;
}

.export-check-list,
.export-field-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.export-check-list label,
.export-field-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.export-check-list input,
.export-field-list input {
  width: auto;
  min-height: auto;
}

.formula-popover {
  position: fixed;
  z-index: 9999;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.refresh-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .28s ease;
}

.refresh-icon-btn:hover svg {
  transform: rotate(90deg);
}

.refresh-icon-btn.is-refreshing svg {
  animation: refreshSpin .8s linear infinite;
}

@keyframes refreshSpin {
  to { transform: rotate(360deg); }
}

#toast {
  position: fixed;
  left: 50%;
  top: 22px;
  max-width: 460px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #1e5b7a;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: 0.2s ease;
  z-index: 12000;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#toast.info {
  background: #25637f;
}

#toast.success {
  background: #19705c;
}

#toast.error {
  background: var(--red);
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    height: 100vh;
  }

  .grid-two,
  .form-grid,
  .filters,
  .inventory-metrics,
  .import-grid,
  .option-row,
  .group-header,
  .group-summary {
    grid-template-columns: 1fr;
  }

  .group-summary {
    align-items: start;
  }
}

body.auth-pending .sidebar,
body.auth-pending .main,
body.login-locked .sidebar,
body.login-locked .main {
  display: none;
}

.login-screen {
  display: none;
}

body.auth-pending .login-screen {
  display: none;
}

body.login-locked .login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  grid-template-rows: 156px auto;
  align-content: center;
  row-gap: 38px;
  background: radial-gradient(circle at 12% 18%, rgba(255, 248, 235, 0.95), transparent 32%),
    radial-gradient(circle at 82% 20%, rgba(196, 239, 255, 0.88), transparent 34%),
    radial-gradient(circle at 78% 82%, rgba(232, 211, 255, 0.88), transparent 36%),
    linear-gradient(120deg, #dff6ff, #f3efff, #ffeaf3, #e7fff8, #fffaf0);
  background-size: 180% 180%;
  animation: loginGradient 15s ease-in-out infinite;
}

@keyframes loginGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-card {
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 18px;
  padding: 12px;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  justify-self: center;
  align-self: start;
}

.login-welcome {
  align-self: end;
  min-height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  text-align: center;
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.15;
  font-weight: 720;
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  color: rgba(23, 34, 51, 0.86);
  text-shadow: 0 12px 36px rgba(255, 255, 255, 0.72);
  transition: opacity 0.36s ease, transform 0.36s ease;
}

.login-welcome.changing {
  opacity: 0;
  transform: translateY(10px);
}

.login-card h1 {
  font-size: 26px;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.58);
}

.login-card p {
  color: rgba(31, 41, 55, 0.72);
}

.login-card button {
  background: var(--primary-button);
  border-radius: 0;
}

.password-wrap,
.login-input-wrap {
  position: relative;
  margin: 0;
}

.password-wrap input,
.login-input-wrap input {
  width: 100%;
  padding-left: 42px;
  padding-right: 46px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(12px);
}

.login-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #7b8494;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.login-field-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-wrap button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  filter: none;
}

.password-wrap button:hover {
  background: rgba(123, 132, 148, .12);
  filter: none;
}

.password-eye {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7b8494;
}

.password-eye svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye-open {
  display: none;
}

#toggle-password.is-visible .eye-open {
  display: inline-flex;
}

#toggle-password.is-visible .eye-closed {
  display: none;
}

.login-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(31, 41, 55, 0.7);
}

#login-error {
  min-height: 18px;
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.stats-grid article {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.stats-grid article span {
  color: var(--muted);
  font-size: 13px;
}

.stats-grid article strong {
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}

.dash-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  padding: 18px;
}

.dash-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px 0 2px;
}

.dashboard-hero h2 {
  font-size: 34px;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.widget-S,
.widget-M,
.widget-L,
.widget-XL {
  height: 392px;
}

.widget-S { grid-column: span 3; }
.widget-M { grid-column: span 4; }
.widget-L { grid-column: span 6; }
.widget-XL { grid-column: span 12; }

.widget {
  min-height: 0;
  overflow: hidden;
}

.widget .dash-list {
  flex: 1;
  overflow: hidden;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 242px;
}

.widget .dash-list button:nth-of-type(n+6) {
  display: none;
}

.widget-grid.editing .widget {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(90deg, rgba(115,192,232,.98), rgba(174,139,238,.94), rgba(244,161,198,.9), rgba(115,192,232,.98)) border-box;
  background-size: 100% 100%, 360% 360%;
  animation: searchGlow 16s ease-in-out infinite;
  box-shadow: 0 0 0 4px rgba(168, 216, 255, .18), var(--shadow);
}

.edit-mode-label {
  color: var(--muted);
  font-size: 14px;
}

.widget-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 32px;
  align-items: center;
}

.add-widget {
  grid-column: span 4;
  height: 392px;
  display: grid;
  gap: 10px;
  place-content: center;
  justify-items: center;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,.35);
  color: var(--muted);
  font-size: 44px;
  line-height: 1;
}

.add-widget span {
  font-size: 14px;
  line-height: 1.2;
}

.global-search {
  height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  background:
    linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.88)) padding-box,
    linear-gradient(90deg, rgba(115,192,232,.98), rgba(174,139,238,.94), rgba(244,161,198,.9), rgba(255,255,255,.96), rgba(115,192,232,.98)) border-box;
  background-size: 100% 100%, 360% 360%;
  animation: searchGlow 16s ease-in-out infinite;
  box-shadow: 0 12px 34px rgba(112, 126, 180, .14);
  cursor: pointer;
}

.search-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #62748d;
}

.search-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-search:hover,
.global-search:focus-within {
  box-shadow: 0 0 0 4px rgba(168, 216, 255, .34), 0 14px 38px rgba(112, 126, 180, .17);
}

@keyframes searchGlow {
  0%, 100% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
}

.global-search strong {
  color: var(--muted);
  font-weight: 500;
}

.global-search kbd {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #64748b;
}

.quick-actions,
.dash-card-head,
.dash-metrics {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.quick-actions-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-actions {
  margin-top: 0;
  align-items: center;
}

.quick-actions button,
.quick-actions-wrap > button,
.icon-edit {
  min-height: 38px;
  height: 38px;
  padding: 0 14px;
  align-items: center;
}

.icon-edit {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 6px;
}

.icon-edit svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover,
.icon-edit:hover,
.expand-btn:hover,
.help-dot:hover,
.sort-link:hover,
.thumb-btn:hover {
  background: #e7edf4;
  cursor: pointer;
}

.dash-card-head {
  justify-content: space-between;
  min-height: 30px;
  margin-top: 0;
  margin-bottom: 12px;
}

.widget > h3 {
  min-height: 30px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
}

.widget > h3 + .dash-metrics {
  margin-top: 0;
}

.dash-card-head button,
.dash-list button,
.dash-metrics button {
  background: var(--surface-soft);
  color: var(--text-main);
}

.dash-metrics button {
  flex: 1;
  min-width: 132px;
  min-height: 78px;
  display: grid;
  gap: 4px;
}

.dash-metrics strong {
  font-size: 24px;
}

.dash-list {
  display: grid;
  gap: 8px;
  flex: 1;
  align-content: start;
}

.dash-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  min-height: 42px;
  overflow: hidden;
  text-align: left;
  justify-items: stretch;
}

.dash-list .dash-text {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: start;
  overflow: hidden;
}

.dash-list .dash-text > span {
  display: block;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.dash-list .biz-badge,
.biz-badge,
.badge {
  flex: 0 0 auto;
  justify-self: end;
  max-width: max-content;
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1;
}

.dash-footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dash-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: auto;
  padding-top: 12px;
}

.dash-card-foot button {
  min-height: 36px;
  background: var(--primary-button);
  color: #fff;
}

.business-dialog-card {
  width: min(860px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 48px));
  overflow: auto;
}

.business-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.business-dialog-card textarea {
  min-height: 120px;
  resize: vertical;
}

.span-full,
.business-items,
.form-actions {
  grid-column: 1 / -1;
}

.span-2 {
  grid-column: span 2;
}

.business-items {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.item-picker {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
}

.business-filters {
  grid-template-columns: minmax(220px, 1fr) 170px 170px auto;
}

.table-scroll {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-scroll table,
.inventory-table-wrap table,
.export-check-list table,
.business-table {
  table-layout: auto;
  min-width: max-content;
}

.table-scroll th,
.inventory-table-wrap th,
.children th,
.business-table th {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.table-scroll td,
.business-table td {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.business-table th,
.business-table td {
  min-width: 120px;
}

.business-table th:last-child,
.business-table td:last-child {
  min-width: 150px;
}

.table-scroll thead th,
.inventory-table-wrap thead th,
.profit-data-table thead th,
.profit-table-wrap.fixed-height thead th,
.data-table thead th,
.business-table thead th,
.export-check-list thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f6f8fb;
  box-shadow: inset 0 -1px 0 var(--line);
}

.hidden,
[hidden] {
  display: none !important;
}

.purchase-stats {
  margin: 14px 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.purchase-stats article {
  box-shadow: none;
}

.purchase-filters {
  grid-template-columns: minmax(240px, 1fr) 170px 190px 170px auto;
  align-items: end;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 8px 0 12px;
  border-bottom: 1px solid var(--line);
}

.status-tabs button {
  position: relative;
  background: transparent;
  color: var(--text);
  border: 0;
  min-height: 42px;
  padding: 0 2px;
  border-radius: 0;
  font-weight: 700;
  box-shadow: none;
}

.status-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, #73c0e8, #ae8bee, #f4a1c6);
  transition: transform .22s ease;
}

.status-tabs button:hover::after {
  transform: scaleX(.55);
}

.status-tabs button.active {
  background: transparent;
  color: var(--text);
}

.status-tabs button.active::after {
  transform: scaleX(1);
}

.profit-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.profit-workspace-card,
.panel-like {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px;
  margin-top: 14px;
}

.profit-report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  color: var(--text-muted);
}

.profit-report-meta strong {
  color: var(--text-main);
  font-size: 18px;
}

.profit-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.profit-mini-grid article {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.profit-mini-grid span,
.profit-source-card small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.profit-mini-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text-main);
  font-size: 22px;
}

.profit-operation-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.62);
  backdrop-filter: blur(8px);
}

.profit-operation-loading.is-visible {
  display: flex;
}

.profit-operation-loading-card {
  min-width: 320px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 28px 30px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  color: #172033;
}

.profit-operation-loading-card strong {
  display: block;
  margin-top: 14px;
  font-size: 18px;
}

.profit-operation-loading-card p {
  margin: 8px 0 0;
  color: #64748b;
  line-height: 1.6;
}

.profit-operation-spinner {
  display: inline-block;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid #dbeafe;
  border-top-color: #2563eb;
  animation: profit-spin 0.82s linear infinite;
}

@keyframes profit-spin {
  to { transform: rotate(360deg); }
}

.profit-preview-grid {
  margin-top: 14px;
}

.profit-wizard {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.profit-wizard-step {
  min-width: 142px;
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 8px 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  position: relative;
}

.profit-wizard-step span {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-bg);
  color: var(--text-main);
  font-size: 12px;
}

.profit-wizard-step small {
  color: var(--text-soft);
  font-size: 12px;
}

.profit-wizard-step.current {
  color: var(--button-text);
  background: var(--button-bg);
  border-color: transparent;
}

.profit-wizard-step.current small,
.profit-wizard-step.current span {
  color: var(--button-text);
}

.profit-wizard-step.done {
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .08);
  color: var(--text-main);
}

.profit-wizard-step.error {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .08);
}

.profit-wizard-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 16px 0 24px;
  overflow-x: auto;
  padding: 4px 2px 10px;
}

.profit-flow-step {
  min-width: 132px;
  flex: 1 0 132px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 12px;
  position: relative;
  text-align: center;
}

.profit-flow-step::after {
  content: "";
  position: absolute;
  left: 32px;
  right: 0;
  top: 21px;
  height: 2px;
  background: var(--border-color);
  transform: translateX(50%);
  z-index: 0;
}

.profit-flow-step:last-child::after {
  display: none;
}

.profit-flow-step.done::after {
  background: linear-gradient(90deg, var(--button-bg), rgba(16, 185, 129, .6));
}

.profit-flow-index {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.profit-flow-step.current .profit-flow-index {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}

.profit-flow-step.done .profit-flow-index {
  background: rgba(16, 185, 129, .14);
  border-color: rgba(16, 185, 129, .45);
  color: #059669;
}

.profit-flow-step.error .profit-flow-index {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .45);
  color: #dc2626;
}

.profit-flow-text {
  display: grid;
  gap: 3px;
  min-width: 0;
  position: relative;
  z-index: 1;
  background: transparent;
  padding: 0;
}

.profit-flow-text strong,
.profit-flow-text small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
}

.profit-flow-text small {
  color: var(--text-soft);
  font-size: 12px;
}

.profit-step-panel {
  margin-top: 14px;
  padding: 24px;
}

.profit-step-title {
  margin-bottom: 22px;
}

.profit-step-title h4 {
  margin: 0 0 8px;
}

.profit-step-title p {
  margin: 0;
  color: var(--text-muted);
}

.profit-report-filters {
  display: grid !important;
  grid-template-columns: minmax(360px, 1fr) 180px 180px 150px;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 16px 0 20px;
}

.profit-report-filters input,
.profit-report-filters select,
.profit-report-filters button {
  width: 100%;
  min-width: 0;
}

.profit-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 18px;
}

.profit-report-card {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  padding: 22px;
  border-radius: var(--card-radius);
  display: grid;
  gap: 18px;
  cursor: pointer;
  min-height: 268px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* SaaS sidebar navigation */
body {
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  width: 260px;
  padding: 20px 12px 14px;
  overflow: visible;
  z-index: 100;
  transition: width .2s ease, padding .2s ease, transform .2s ease;
}

.brand {
  min-height: 64px;
  gap: 8px;
  padding: 4px 4px 0 8px;
  align-items: flex-start;
}

.brand-text {
  order: 1;
  min-width: 0;
  padding-top: 2px;
}

.brand-text h1 {
  white-space: nowrap;
  color: var(--text-main);
  font-size: 20px;
  line-height: 1.25;
}

.brand-text p {
  margin-top: 3px;
  white-space: nowrap;
  font-size: 12px;
}

#toggle-sidebar {
  order: 2;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin-left: auto;
  padding: 0;
  align-items: flex-start;
  padding-top: 1px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
}

#toggle-sidebar:hover {
  background: #f3f4f6;
  filter: none;
}

#toggle-sidebar svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.35;
}

.menu {
  gap: 2px;
  padding: 2px 0;
}

.menu-group {
  position: relative;
  gap: 2px;
  margin-top: 0;
}

.menu-group-head,
.menu-item {
  position: relative;
  min-height: 44px;
  border-radius: 8px;
}

.menu-group-head {
  justify-content: flex-start;
  gap: 14px;
  padding: 0 10px;
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
}

.menu-home .menu-item {
  gap: 14px;
  padding: 0 10px;
  min-height: 52px;
  color: var(--text-main);
  font-size: 17px;
  font-weight: 800;
}

.menu-module-icon,
.settings-menu > svg {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
  overflow: visible;
}

.menu-group-head .menu-module-icon {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
}

.menu-home .menu-module-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.settings-menu > svg {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

.menu-module-icon *,
.settings-menu > svg * {
  vector-effect: non-scaling-stroke;
}

.menu-group-head .menu-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
}

.menu-group-items {
  gap: 2px;
}

.menu-group-items .menu-item {
  min-height: 44px;
  padding-left: 58px;
  font-size: 15px;
  font-weight: 600;
}

.menu-item.active {
  background: #eef2f7;
  color: #2563eb;
}

.menu-item.active::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2563eb;
}

.sidebar.collapsed {
  width: 72px;
  padding: 20px 8px 14px;
}

.sidebar.collapsed .brand {
  padding: 0 6px;
}

.sidebar.collapsed #toggle-sidebar {
  margin: 0;
  align-items: center;
  padding-top: 0;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-user,
.sidebar.collapsed .menu-group-label,
.sidebar.collapsed .menu-home-label,
.sidebar.collapsed .menu-chevron,
.sidebar.collapsed .menu-group-items,
.sidebar.collapsed .settings-menu span {
  display: none;
}

.sidebar.collapsed .menu,
.sidebar.collapsed .settings-menu-wrap {
  display: flex;
}

.sidebar.collapsed .menu {
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.sidebar.collapsed .menu-group-head,
.sidebar.collapsed .menu-item,
.sidebar.collapsed .settings-menu {
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  margin-inline: auto;
}

.sidebar.collapsed .menu-module-icon,
.sidebar.collapsed .settings-menu > svg {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  stroke-width: 2;
}

.sidebar.collapsed .settings-menu > svg {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

.sidebar.collapsed .menu-group.flyout-open .menu-group-items {
  position: absolute;
  z-index: 10000;
  top: -5px;
  left: 60px;
  display: grid;
  width: 238px;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--modal-bg);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
}

.sidebar.collapsed .menu-group.flyout-open .menu-group-items::before {
  content: attr(data-flyout-title);
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px 7px;
  margin-bottom: 3px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 800;
}

.sidebar.collapsed .menu-group.flyout-open .menu-group-items::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: var(--modal-bg);
  transform: rotate(45deg);
}

.sidebar.collapsed .menu-group.flyout-open .menu-group-items .menu-item {
  justify-content: flex-start;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  margin: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
}

.sidebar.collapsed .menu-group.flyout-open .menu-group-head::after {
  display: none;
}

.sidebar.collapsed .menu-group.module-active .menu-group-head {
  background: #eef2f7;
  color: #2563eb;
}

.sidebar.collapsed .menu-group.module-active .menu-group-head::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2563eb;
}

.sidebar.collapsed .settings-menu-wrap {
  overflow: visible;
}

.sidebar.collapsed .settings-popover {
  left: calc(100% + 12px);
  right: auto;
  bottom: 0;
  width: 238px;
  padding: 9px;
  gap: 3px;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
  z-index: 10000;
}

.sidebar.collapsed .settings-popover::before {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 20px;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: var(--modal-bg);
  transform: rotate(45deg);
}

.sidebar.collapsed .settings-popover-user {
  display: flex;
}

.sidebar.collapsed .settings-popover button {
  width: 100%;
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

#page-title {
  font-size: 36px;
  font-weight: 800;
}

.page-head {
  min-height: 76px;
  padding-bottom: 18px;
}

.settings-menu > svg {
  overflow: visible;
}

.sidebar.collapsed [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 120;
  left: 52px;
  top: 50%;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--panel-bg);
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity .15s ease, transform .15s ease;
}

.sidebar.collapsed [data-tooltip]:hover::after,
.sidebar.collapsed [data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.mobile-sidebar-trigger,
.sidebar-backdrop {
  display: none;
}

.profit-report-card:hover {
  border-color: color-mix(in srgb, var(--button-bg) 38%, var(--border-color));
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.profit-report-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #10b981);
  opacity: 0.65;
}

.profit-report-card.is-published::before {
  background: linear-gradient(90deg, #10b981, #2563eb);
}

.profit-report-card.is-abandoned::before {
  background: #cbd5e1;
}

.profit-report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profit-report-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: #eff6ff;
  flex: 0 0 auto;
}

.profit-report-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-report-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 -8px;
  min-height: 28px;
}

.profit-report-status-line > span:last-child {
  color: #64748b;
  font-size: 12px;
}

.profit-report-card-head strong,
.profit-report-card-head span {
  display: block;
}

.profit-report-card-head strong {
  font-size: 18px;
  line-height: 1.35;
  word-break: break-word;
}

.profit-report-period {
  color: var(--text-muted);
  font-size: 14px;
}

.profit-report-card dl,
.profit-report-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profit-report-card dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profit-report-card dt,
.profit-report-card small {
  color: var(--text-soft);
  font-size: 12px;
}

.profit-report-card dd {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-report-card-metrics span {
  background: var(--input-bg);
  padding: 12px;
  border-radius: 8px;
}

.profit-report-card-metrics span.primary {
  background: linear-gradient(135deg, #eff6ff, #ecfdf5);
}

.profit-report-card-metrics b {
  display: block;
  margin-top: 4px;
}

.profit-report-card .biz-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.profit-new-head {
  align-items: flex-start;
  gap: 18px;
}

.profit-new-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  min-width: min(620px, 100%);
}

.profit-stage-status {
  position: relative;
  overflow: hidden;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-main);
  font-weight: 800;
}

.profit-stage-status::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: topRuleSweep 5.5s linear infinite;
  pointer-events: none;
}

.profit-stage-status small,
.profit-switcher span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.profit-switcher {
  display: flex;
  align-items: center;
  min-width: min(360px, 42vw);
}

.profit-report-select {
  width: 100%;
  min-width: 0;
  height: 44px;
}

.profit-abandon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  white-space: nowrap;
}

.profit-abandon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1180px) {
  .profit-new-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .profit-switcher {
    flex: 1 1 280px;
    min-width: min(280px, 100%);
  }

  .profit-report-filters {
    grid-template-columns: minmax(260px, 1fr) 160px 160px 140px;
  }

  .profit-report-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  }
}

@media (max-width: 820px) {
  .profit-report-filters {
    grid-template-columns: 1fr;
  }
}

/* Profit Report Center */
#profit-dashboard-app.panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profit-center-controls,
.profit-center-library {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--panel-bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}

.profit-center-controls {
  padding: 20px;
}

.profit-center-library {
  margin-top: 18px;
  padding: 20px;
}

.profit-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0;
}

.profit-center-heading {
  min-width: 0;
}

.profit-center-heading h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.profit-center-heading p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.profit-center-header-actions,
.profit-center-view-switch {
  display: flex;
  align-items: center;
}

.profit-center-header-actions {
  flex: 0 0 auto;
  gap: 12px;
}

.profit-center-view-switch {
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel-bg) 88%, transparent);
}

.profit-center-view-switch button {
  width: 36px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  box-shadow: none;
}

.profit-center-view-switch button.is-active {
  background: #eef4ff;
  color: #315fbd;
}

.profit-center-view-switch button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.profit-center-view-switch svg,
.profit-center-new-button svg,
.profit-center-search svg,
.profit-center-card-action svg,
.profit-center-empty svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-center-new-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid #356ee6;
  border-radius: 11px;
  background: linear-gradient(135deg, #4e82ef, #356ee6);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 6px 16px rgba(53, 110, 230, .14);
}

.profit-center-new-button:hover {
  background: linear-gradient(135deg, #4378e7, #2f64d6);
  box-shadow: 0 6px 16px rgba(53, 110, 230, .18);
}

.profit-center-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(155px, .65fr) minmax(155px, .65fr) minmax(155px, .65fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--border-color) 86%, #b8c9e5);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-bg) 88%, #f3f7fc);
}

.profit-center-search,
.profit-center-select {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border-color) 88%, #c8d5e8);
  border-radius: 11px;
  background: color-mix(in srgb, var(--input-bg) 94%, transparent);
  transition: border-color .18s ease-out, box-shadow .18s ease-out, background .18s ease-out;
}

.profit-center-search:focus-within,
.profit-center-select:focus-within {
  border-color: rgba(83, 125, 216, .48);
  box-shadow: 0 0 0 3px rgba(83, 125, 216, .08);
  background: var(--input-bg);
}

.profit-center-search {
  gap: 9px;
  padding: 0 13px;
  color: #718096;
}

.profit-center-search input,
.profit-center-select select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  box-shadow: none;
  outline: 0;
}

.profit-center-select {
  gap: 8px;
  padding-left: 11px;
}

.profit-center-select > span {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.profit-center-select select {
  padding-right: 10px;
  font-size: 13px;
  font-weight: 650;
}

.profit-center-clear {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #5e6f88;
  box-shadow: none;
  font-size: 13px;
  white-space: nowrap;
}

.profit-center-clear:hover {
  background: rgba(87, 112, 150, .07);
  color: var(--text-main);
}

.profit-center-count {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.profit-center-count strong {
  color: #315fbd;
  font-variant-numeric: tabular-nums;
}

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

.profit-center-card {
  --report-bg-start: #eaf3ff;
  --report-bg-end: #dcebff;
  --report-shape-primary: #7fb2ff;
  --report-shape-secondary: #b8d4ff;
  --report-shape-soft: #cfe4ff;
  --report-accent: #315f9f;
  position: relative;
  isolation: isolate;
  height: 292px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--report-shape-primary) 24%, rgba(255, 255, 255, .78));
  border-radius: 24px;
  background: linear-gradient(142deg, var(--report-bg-start) 0%, color-mix(in srgb, var(--report-bg-start) 58%, #fff) 52%, var(--report-bg-end) 100%);
  box-shadow: none;
  cursor: pointer;
  outline: none;
  transition: border-color .2s ease-out, box-shadow .2s ease-out, background .2s ease-out;
}

body:not(.no-card-shadow) .profit-center-card {
  box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
}

.profit-center-card:hover,
.profit-center-card:focus-visible {
  transform: none;
  border-color: color-mix(in srgb, var(--report-shape-primary) 58%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--report-shape-primary) 12%, transparent), 0 0 22px color-mix(in srgb, var(--report-shape-primary) 13%, transparent);
}

.profit-center-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 21px 18px;
}

.profit-center-card-top,
.profit-center-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profit-center-card-status-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.profit-center-type,
.profit-center-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.profit-center-type {
  background: rgba(255, 255, 255, .58);
  color: var(--report-accent);
  border: 1px solid rgba(255, 255, 255, .58);
  backdrop-filter: blur(8px);
}

.profit-center-status.is-published {
  background: rgba(21, 128, 92, .11);
  color: #117256;
}

.profit-center-status.is-draft {
  background: rgba(217, 119, 6, .12);
  color: #a65f00;
}

.profit-center-status.is-archived {
  background: rgba(82, 104, 133, .12);
  color: #526885;
}

.profit-center-status.is-processing {
  background: rgba(37, 99, 235, .11);
  color: #315fbd;
}

.profit-center-status.is-error {
  background: rgba(220, 53, 69, .11);
  color: #bd2f40;
}

.profit-center-card-title {
  margin-top: 15px;
  min-width: 0;
}

.profit-center-card-title h4 {
  margin: 0;
  overflow: hidden;
  color: #182230;
  font-size: clamp(19px, 1.4vw, 23px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-center-card-title p {
  margin: 7px 0 0;
  overflow: hidden;
  color: #5f6f84;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-center-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 18px;
  margin: 17px 0 0;
  max-width: 88%;
}

.profit-center-card-meta div {
  min-width: 0;
}

.profit-center-card-meta dt {
  margin: 0 0 4px;
  color: #718096;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.profit-center-card-meta dd {
  margin: 0;
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-center-card-footer {
  margin-top: auto;
  justify-content: flex-start;
}

.profit-center-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  color: var(--report-accent);
  box-shadow: none;
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 800;
}

.profit-center-card-action:hover {
  background: rgba(255, 255, 255, .9);
  box-shadow: none;
}

.profit-center-card-action svg {
  width: 15px;
  height: 15px;
}

.profit-center-more-wrap {
  position: relative;
  z-index: 5;
}

.profit-center-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 24px;
  min-height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #182230;
  box-shadow: none;
}

.profit-center-more span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.profit-center-more:hover,
.profit-center-more[aria-expanded="true"] {
  background: rgba(24, 34, 48, .07);
  color: #101828;
}

.profit-center-menu {
  position: absolute;
  right: 0;
  top: 32px;
  bottom: auto;
  display: none;
  width: 132px;
  padding: 6px;
  border: 1px solid rgba(207, 217, 230, .9);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
  backdrop-filter: blur(14px);
}

.profit-center-menu.is-open {
  display: grid;
}

.profit-center-menu button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  box-shadow: none;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
}

.profit-center-menu button:hover {
  background: #f3f6fa;
}

.profit-center-menu button.danger {
  color: #c63a49;
}

.profit-center-menu button.danger:hover {
  background: rgba(220, 53, 69, .07);
}

.profit-center-geometry {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.profit-center-geometry i {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
}

.geometry-main {
  right: -76px;
  bottom: -108px;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: var(--report-shape-primary);
  filter: blur(3px);
  opacity: .095;
  animation: reportShapeBreathe 12s ease-in-out infinite alternate;
}

.geometry-ring {
  right: 31px;
  bottom: 21px;
  width: 118px;
  height: 118px;
  border: 3px solid var(--report-shape-secondary);
  border-radius: 50%;
  filter: blur(.6px);
  opacity: .11;
  animation: reportShapeDrift 14s ease-in-out infinite alternate;
}

.geometry-arc {
  top: -72px;
  left: -62px;
  width: 176px;
  height: 176px;
  border: 3px solid var(--report-shape-soft);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  filter: blur(.8px);
  opacity: .09;
  animation: reportArcDrift 17s ease-in-out infinite alternate;
}

.geometry-dots {
  top: 48px;
  right: 21px;
  width: 66px;
  height: 66px;
  background-image: radial-gradient(circle, var(--report-shape-primary) 1.6px, transparent 1.8px);
  background-size: 14px 14px;
  opacity: .065;
  animation: reportDotsDrift 15s ease-in-out infinite alternate;
}

.geometry-glow {
  right: -36px;
  top: 27px;
  width: 210px;
  height: 142px;
  border-radius: 50%;
  background: var(--report-shape-soft);
  filter: blur(44px);
  opacity: .13;
  animation: reportGlowBreathe 10s ease-in-out infinite alternate;
}

.profit-center-card:hover .profit-center-geometry,
.profit-center-card:focus-visible .profit-center-geometry {
  opacity: .92;
}

.profit-center-card.template-mist-blue {
  --report-bg-start: #eaf3ff; --report-bg-end: #dcebff; --report-shape-primary: #7fb2ff; --report-shape-secondary: #b8d4ff; --report-shape-soft: #cfe4ff; --report-accent: #315f9f;
}

.profit-center-card.template-soft-purple {
  --report-bg-start: #f2eeff; --report-bg-end: #e8e1ff; --report-shape-primary: #a88bff; --report-shape-secondary: #c7b7ff; --report-shape-soft: #ddd4ff; --report-accent: #6550a6;
}

.profit-center-card.template-soft-purple .geometry-main,
.profit-center-card.template-pink-purple .geometry-main {
  right: -52px;
  bottom: -122px;
  width: 302px;
  height: 302px;
}

.profit-center-card.template-soft-purple .geometry-dots,
.profit-center-card.template-pink-purple .geometry-dots {
  top: 22px;
  right: 64px;
}

.profit-center-card.template-mint {
  --report-bg-start: #eafbf4; --report-bg-end: #d9f5e8; --report-shape-primary: #62d6a3; --report-shape-secondary: #a7e8cb; --report-shape-soft: #cff4e2; --report-accent: #237c5d;
}

.profit-center-card.template-apricot {
  --report-bg-start: #fff4ea; --report-bg-end: #fee8d7; --report-shape-primary: #ffb977; --report-shape-secondary: #ffd4ae; --report-shape-soft: #fce6cf; --report-accent: #a25d27;
}

.profit-center-card.template-apricot .geometry-ring,
.profit-center-card.template-warm-gold .geometry-ring {
  right: -25px;
  bottom: 21px;
  width: 156px;
  height: 156px;
}

.profit-center-card.template-pink-purple {
  --report-bg-start: #fff0f7; --report-bg-end: #f7e5f3; --report-shape-primary: #f19ac2; --report-shape-secondary: #f6b9d8; --report-shape-soft: #f9d5e8; --report-accent: #9d4c72;
}

.profit-center-card.template-cyan-blue {
  --report-bg-start: #eaf9ff; --report-bg-end: #ddf3ff; --report-shape-primary: #69bdeb; --report-shape-secondary: #a7dbf4; --report-shape-soft: #d2eef9; --report-accent: #2c7297;
}

.profit-center-card.template-cyan-blue .geometry-main,
.profit-center-card.template-cool-gray .geometry-main {
  right: -112px;
  bottom: -52px;
  width: 292px;
  height: 292px;
}

.profit-center-card.template-cyan-blue .geometry-ring,
.profit-center-card.template-cool-gray .geometry-ring {
  right: 39px;
  bottom: 33px;
}

.profit-center-card.template-warm-gold {
  --report-bg-start: #fff8ec; --report-bg-end: #f9efd9; --report-shape-primary: #d9b56e; --report-shape-secondary: #e8c98e; --report-shape-soft: #f3e3bf; --report-accent: #84662d;
}

.profit-center-card.template-cool-gray {
  --report-bg-start: #f3f6fa; --report-bg-end: #e8eef5; --report-shape-primary: #8ea4c0; --report-shape-secondary: #b7c5d7; --report-shape-soft: #d8e1ec; --report-accent: #526885;
}

.profit-center-empty {
  position: relative;
  isolation: isolate;
  min-height: 340px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 44px;
  border: 1px dashed color-mix(in srgb, var(--border-color) 82%, #a7c4ee);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(234, 243, 255, .58), rgba(248, 250, 252, .82), rgba(242, 238, 255, .52));
  text-align: center;
}

.profit-center-empty > div:not(.profit-center-geometry) {
  position: relative;
  z-index: 1;
}

.profit-center-empty .profit-center-geometry {
  --report-shape-primary: #9ebcf0;
  --report-shape-secondary: #c6b8ee;
  --report-shape-soft: #dce9fb;
}

.profit-center-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .76);
  color: #5e78a6;
}

.profit-center-empty-icon svg {
  width: 25px;
  height: 25px;
}

.profit-center-empty h4 {
  margin: 16px 0 0;
  color: var(--text-main);
  font-size: 20px;
}

.profit-center-empty p {
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.profit-center-empty button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: #356ee6;
  color: #fff;
}

body.square-cards .profit-center-card,
body.square-cards .profit-center-controls,
body.square-cards .profit-center-library,
body.square-cards .profit-center-toolbar,
body.square-cards .profit-center-empty,
body.square-cards .profit-center-view-switch,
body.square-cards .profit-center-new-button {
  border-radius: 0;
}

body.no-card-shadow .profit-center-card {
  box-shadow: none;
}

@keyframes reportShapeBreathe {
  from { transform: translate3d(0, 4px, 0) scale(1); opacity: .075; }
  to { transform: translate3d(-12px, -8px, 0) scale(1.045); opacity: .115; }
}

@keyframes reportShapeDrift {
  from { transform: translate3d(-5px, 3px, 0) scale(1); opacity: .085; }
  to { transform: translate3d(9px, -8px, 0) scale(1.04); opacity: .125; }
}

@keyframes reportGlowBreathe {
  from { transform: translate3d(2px, 5px, 0) scale(1); opacity: .10; }
  to { transform: translate3d(-11px, -7px, 0) scale(1.055); opacity: .155; }
}

@keyframes reportArcDrift {
  from { transform: translate3d(-3px, 2px, 0) scale(1); opacity: .07; }
  to { transform: translate3d(8px, -6px, 0) scale(1.035); opacity: .105; }
}

@keyframes reportDotsDrift {
  from { transform: translate3d(0, -3px, 0); opacity: .045; }
  to { transform: translate3d(-10px, 8px, 0); opacity: .085; }
}

@media (max-width: 1180px) {
  .profit-center-toolbar {
    grid-template-columns: minmax(250px, 1.4fr) repeat(3, minmax(145px, .7fr));
  }

  .profit-center-clear,
  .profit-center-count {
    justify-self: start;
  }

  .profit-center-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .profit-center-controls,
  .profit-center-library {
    padding: 15px;
  }

  .profit-center-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profit-center-header-actions {
    width: 100%;
  }

  .profit-center-new-button {
    flex: 1;
  }

  .profit-center-toolbar {
    grid-template-columns: 1fr;
  }

  .profit-center-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profit-center-card {
    height: 286px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profit-center-geometry i {
    animation: none !important;
  }
}

.profit-step-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 16px;
}

.profit-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.parse-progress {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 16px;
  display: grid;
  gap: 6px;
  background: var(--input-bg);
}

.parse-progress.running {
  border-color: rgba(59, 130, 246, .35);
  background: rgba(59, 130, 246, .08);
}

.parse-progress.success {
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .08);
}

.parse-progress.failed,
.parse-progress.error {
  border-color: rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .08);
}

.profit-file-state {
  min-width: 0;
}

.profit-file-state.success {
  border: 1px solid color-mix(in srgb, #16a34a 22%, var(--border-color));
  background: color-mix(in srgb, #16a34a 9%, var(--card-bg));
  border-radius: 8px;
  padding: 9px 10px;
}

.profit-file-state.empty {
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 9px 10px;
}

.profit-file-state span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-upload-card:has(.profit-file-state span:not(:empty)) .profit-file-state {
  border-radius: 8px;
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-row h3 {
  margin: 0;
}

.dialog-close.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 0;
}

.dialog-close.icon-only:hover {
  background: var(--input-bg);
  color: var(--text-main);
}

.dialog-close.icon-only svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.advanced-settings {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  background: var(--input-bg);
}

.advanced-settings summary {
  cursor: pointer;
  font-weight: 700;
}

.advanced-settings .form-grid {
  margin-top: 12px;
}

.profit-upload-form,
.profit-data-tools {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(130px, 1fr)) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.profit-data-tools {
  grid-template-columns: minmax(360px, 1fr) auto minmax(220px, .45fr) minmax(150px, .25fr) auto;
  gap: 18px;
  margin-top: 22px;
  margin-bottom: 22px;
}

.profit-product-import-row,
.profit-product-filter-row {
  display: grid;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.profit-product-import-row {
  grid-template-columns: minmax(280px, 1fr) auto;
  max-width: 720px;
}

.profit-product-filter-row {
  grid-template-columns: minmax(260px, 1fr) 180px auto auto;
}

.profit-product-filter-row .record-count {
  justify-self: end;
  color: var(--text-muted);
  white-space: nowrap;
}

.profit-product-table {
  max-height: min(58vh, 620px);
}

.ellipsis-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.profit-source-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
}

.profit-source-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.profit-upload-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.profit-upload-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profit-upload-card em {
  font-style: normal;
  font-size: 12px;
  color: #b45309;
  background: rgba(245, 158, 11, .14);
  border-radius: 999px;
  padding: 2px 8px;
}

.profit-upload-card p,
.profit-file-state small {
  color: var(--text-muted);
  margin: 4px 0 0;
}

.profit-file-state span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
  font-weight: 700;
}

.profit-upload-card-form {
  display: grid;
  gap: 8px;
}

.profit-upload-advanced {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--input-bg) 65%, transparent);
}

.profit-upload-advanced summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 700;
}

.profit-upload-advanced input {
  width: 100%;
  margin-top: 8px;
}

.profit-upload-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.profit-upload-actions input[type="file"] {
  min-width: 0;
  width: 100%;
}

.danger-soft {
  color: #b42318 !important;
  border-color: color-mix(in srgb, #ef4444 35%, var(--border-color)) !important;
  background: color-mix(in srgb, #ef4444 8%, var(--card-bg)) !important;
}

.profit-config-dialog-card {
  width: min(980px, calc(100vw - 48px));
  max-height: min(86vh, 860px);
  overflow: auto;
}

.profit-dialog-body {
  display: grid;
  gap: 12px;
}

.profit-dialog-section {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-bg);
}

.profit-dialog-section h4 {
  margin: 0 0 10px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.checkbox-line,
.check-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.formula-preview,
.muted-box {
  color: var(--text-muted);
  background: var(--input-bg);
}

.profit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.profit-tabs button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.profit-tabs button.active {
  background: var(--button-bg);
  border-color: transparent;
  color: var(--button-text);
}

.profit-data-table {
  max-height: 520px;
  overflow: auto;
  margin-top: 14px;
}

.profit-data-table table {
  min-width: 1200px;
}

.profit-table.compact {
  max-height: 280px;
  overflow: auto;
}

@media (max-width: 1366px) {
  .profit-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profit-upload-form,
  .profit-data-tools {
    grid-template-columns: 1fr 1fr;
  }
}

.purchase-table-wrap {
  max-height: 560px;
  overflow-y: auto;
}

.purchase-table th,
.purchase-table td {
  white-space: nowrap;
}

.purchase-table .num,
.purchase-table th.num,
.purchase-table td.num {
  text-align: right;
}

.purchase-detail-row td {
  background: #f8fafc;
}

.purchase-detail-row .table-scroll {
  max-height: 280px;
  overflow-y: auto;
}

.purchase-dialog-card {
  width: min(1180px, 96vw);
}

.purchase-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
}

.purchase-items-head h4 {
  margin: 0;
}

.purchase-items-scroll {
  max-height: 360px;
  overflow-y: auto;
}

.purchase-edit-table input {
  width: 120px;
  min-width: 0;
}

.purchase-edit-table td:nth-child(3) input,
.purchase-edit-table td:nth-child(4) input {
  width: 180px;
}

.po-picker {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 12px;
}

.tag-chip button {
  min-height: 18px;
  width: 18px;
  padding: 0;
  border-radius: 50%;
}

.biz-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.biz-badge.ok,
.biz-badge.green {
  background: #e8f6ee;
  color: var(--green);
}

.biz-badge.warn,
.biz-badge.yellow {
  background: #fff2d9;
  color: var(--amber);
}

.biz-badge.neutral,
.biz-badge.gray {
  background: #eef2f6;
  color: #4c5b70;
}

.biz-badge.blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.biz-badge.orange {
  background: #fed7aa;
  color: #9a3412;
}

.biz-badge.red {
  background: #fecaca;
  color: #991b1b;
}

.biz-badge.purple {
  background: #ddd6fe;
  color: #5b21b6;
}

.success-outline {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.quick-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-options label,
.toggle-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.planner-settings-form {
  align-items: end;
}

.planner-checks {
  display: flex;
  gap: 22px;
  justify-content: flex-start;
  align-items: center;
  padding: 4px 0;
}

.small-upload {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  background: #eef2f6;
  color: #2f3a4c;
  cursor: pointer;
  font-weight: 700;
}

.compact-dialog {
  width: min(560px, calc(100vw - 48px));
}

#ui-settings-form {
  display: grid;
  gap: 16px;
  align-items: start;
}

#ui-settings-form .toggle-line,
#ui-settings-form .color-setting {
  font-size: 15px;
}

.color-setting {
  display: grid;
  gap: 10px;
  color: #526075;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatches button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.color-swatches button.active {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .24), 0 0 0 1px var(--line);
}

#ui-settings-form button {
  justify-self: start;
}

.thumb-btn {
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3f6f9;
  border-radius: 4px;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder {
  display: inline-block;
  width: 54px;
  height: 54px;
  border: 1px dashed #cbd5e1;
  background: #f1f5f9;
  border-radius: 4px;
}

.image-preview {
  display: inline-flex;
  margin-top: 8px;
  align-items: center;
}

.image-delete-btn {
  margin-top: 8px;
  margin-left: 10px;
  vertical-align: top;
}

.image-dialog-card {
  width: min(760px, calc(100vw - 48px));
}

.image-dialog-card img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.evidence-thumb {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.batch-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.batch-section,
.planner-block {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.batch-fields {
  display: grid;
  gap: 18px;
}

.batch-field-group {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.batch-field-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.batch-field-group h5 {
  margin: 0;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 800;
}

.batch-field-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.batch-fields .batch-field span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.disabled-field,
input:disabled,
select:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.batch-sku-list table {
  min-width: 920px;
}

.pending-thumb {
  position: relative;
  display: inline-flex;
}

.pending-thumb::after {
  content: "待上传";
  position: absolute;
  right: -8px;
  bottom: -6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #fed7aa;
}

.compact-actions {
  justify-content: flex-start;
}

.planner-block:first-of-type {
  border-top: 0;
}

.planner-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.planner-settings {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
}

.planner-settings article {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.planner-settings span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.weight-total {
  font-weight: 700;
}

.weight-total.ok {
  color: var(--green);
}

.weight-total.bad {
  color: var(--red);
}

.planner-table {
  min-width: 2300px;
}

.planner-table-wrap {
  max-height: calc(100vh - 330px);
  overflow: auto;
}

.planner-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.planner-table input {
  width: 96px;
}

.planner-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-counter {
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.fixed-table,
.inventory-table-wrap,
.planner-table-wrap {
  max-height: calc(100vh - 320px);
}

.fixed-table,
.inventory-table-wrap,
.planner-table-wrap {
  overflow: auto;
}

.planner-summary {
  display: none;
}

.planner-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fff;
  font-weight: 700;
  border-top: 2px solid #d9dde7;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, .04);
}

body.theme-midnight .planner-table tfoot td {
  background: #1d222b;
}

.planner-table {
  min-width: 2960px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.planner-table-wrap {
  max-height: calc(100vh - 285px);
}

.planner-table th,
.planner-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-table thead th {
  background: #f5f7fb;
  z-index: 20;
}

.planner-th-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.planner-pin {
  flex: 0 0 auto;
}

.planner-table .planner-sticky-cell {
  position: sticky !important;
  left: var(--planner-sticky-left) !important;
  background: #fff;
  z-index: 16;
}

.planner-table thead .planner-sticky-cell {
  background: #f5f7fb;
  z-index: 44;
}

.planner-table tfoot .planner-sticky-cell {
  background: #fff;
  z-index: 36;
}

.planner-table .planner-sticky-edge {
  box-shadow: 4px 0 8px rgba(15, 23, 42, .12);
}

body.theme-midnight .planner-table .planner-sticky-cell,
body.theme-midnight .planner-table tfoot .planner-sticky-cell {
  background: #1d222b;
}

body.theme-midnight .planner-table thead .planner-sticky-cell {
  background: #252b36;
}

.planner-table input[data-plan-final-cartons] {
  width: 86px;
}

.planner-detail-table {
  min-width: 1180px;
}

.planner-detail-table th:nth-child(3),
.planner-detail-table td:nth-child(3) {
  min-width: 260px;
}

#planner-history .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 290px;
}

.widget-library {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.widget-library button {
  min-height: 98px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  justify-items: stretch;
  text-align: left;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
}

.widget-library button * {
  pointer-events: none;
}

.widget-option-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eef7;
  color: #334155;
  font-weight: 700;
}

.widget-option-text {
  display: grid;
  gap: 3px;
}

.widget-option-text small {
  color: var(--muted);
  font-size: 12px;
}

.link-widget,
.banner-widget {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.link-widget img {
  width: 28px;
  height: 28px;
}

.quick-link-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 14px 10px;
}

.quick-link-head {
  justify-content: space-between;
  flex-wrap: nowrap;
}

.quick-link-head h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-link-app {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
}

.quick-link-app a,
.quick-link-add {
  width: 100%;
  min-height: 96px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
}

.quick-link-app a:hover,
.quick-link-add:hover {
  background: var(--table-row-hover);
  filter: none;
}

.quick-link-icon,
.quick-link-add span {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.quick-link-icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.quick-link-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.quick-link-emoji.fallback {
  display: none;
}

.quick-link-app strong,
.quick-link-add strong {
  max-width: 100%;
  min-height: 34px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 1366px) {
  .quick-link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 2560px) {
  .quick-link-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.quick-link-add {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.quick-link-add * {
  pointer-events: none;
}

.quick-link-add span {
  border-radius: 999px;
  font-size: 24px;
  color: var(--primary-button);
}

.quick-link-tools {
  display: none;
  gap: 4px;
  justify-content: center;
  margin-top: -2px;
}

.widget-grid.editing .quick-link-tools {
  display: flex;
}

.quick-link-tools button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  background: var(--panel-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.banner-widget img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 8px;
}

#command-dialog {
  width: min(1040px, calc(100vw - 40px));
  margin: clamp(28px, 8vh, 86px) auto auto;
  background: transparent;
  box-shadow: none;
}

.command-card {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.command-search {
  display: grid;
  grid-template-columns: auto 1fr 150px auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 0 10px 0 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(rgba(255,250,255,.82), rgba(255,250,255,.82)) padding-box,
    linear-gradient(90deg, rgba(115,192,232,1), rgba(174,139,238,.98), rgba(244,161,198,.96), rgba(255,255,255,1), rgba(115,192,232,1)) border-box;
  background-size: 100% 100%, 360% 360%;
  animation: searchGlow 16s ease-in-out infinite;
  box-shadow: 0 16px 42px rgba(82, 92, 128, .16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.command-search input,
.command-search select {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.command-search input {
  font-size: 18px;
}

.command-search input:focus,
.command-search select:focus {
  outline: 0;
  box-shadow: none;
}

.command-search select {
  color: var(--muted);
  min-height: 36px;
  padding-left: 2px;
}

.command-close {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.command-close:hover {
  background: rgba(148,163,184,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  filter: none;
}

.command-results {
  max-height: 62vh;
  overflow: auto;
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 24px 64px rgba(82, 92, 128, .18);
}

.command-results:empty {
  display: none;
}

.command-results section {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.command-results button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  justify-content: stretch;
  text-align: left;
  background: rgba(248,250,252,.72);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
}

.result-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.result-main strong,
.result-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-main small {
  color: var(--muted);
  font-size: 13px;
}

.result-status {
  justify-self: end;
  align-self: center;
  min-width: 74px;
  display: flex;
  justify-content: flex-end;
}

.command-results button:hover {
  background: rgba(148,163,184,.12);
}

tr:hover td,
.dash-list button:hover,
.widget-library button:hover,
.theme-card:hover,
.upload-form:hover {
  background-color: var(--table-row-hover);
}

body.theme-aurora .global-search:hover {
  box-shadow: 0 12px 34px rgba(124, 58, 237, .12), 0 0 0 1px rgba(255,255,255,.38);
}

body.theme-aurora .sidebar,
body.theme-aurora .panel,
body.theme-aurora .dash-card,
body.theme-aurora .table-scroll,
body.theme-aurora .inventory-table-wrap,
body.theme-aurora .settings-panel {
  background: var(--panel-bg);
  border-color: rgba(161, 183, 226, .46);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-aurora .dialog-card {
  background:
    linear-gradient(var(--modal-bg), var(--modal-bg)) padding-box,
    linear-gradient(110deg, rgba(115,192,232,.55), rgba(174,139,238,.42), rgba(244,161,198,.38), rgba(115,192,232,.55)) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-aurora input,
body.theme-aurora select,
body.theme-aurora textarea {
  background: var(--input-bg);
}

body.theme-aurora button:hover {
  box-shadow: 0 0 0 3px rgba(125, 168, 231, .12);
}

body.theme-zen .badge {
  filter: saturate(.72);
}

body.theme-zen .theme-card,
body.theme-zen .widget-library button,
body.theme-zen .dash-list button,
body.theme-zen .dash-metrics button,
body.theme-zen .quick-link-icon {
  background: #f4f1ea;
  border-color: #ddd6c9;
}

body.theme-midnight .main,
body.theme-midnight .sidebar {
  color: var(--text-main);
}

body.theme-midnight .panel,
body.theme-midnight .dash-card,
body.theme-midnight .table-scroll,
body.theme-midnight .inventory-table-wrap,
body.theme-midnight .settings-panel,
body.theme-midnight .theme-card,
body.theme-midnight .widget-library button,
body.theme-midnight .dialog-card,
body.theme-midnight .settings-popover,
body.theme-midnight .command-results {
  background: var(--panel-bg);
  color: var(--text-main);
  border-color: var(--border-color);
}

body.theme-midnight input,
body.theme-midnight select,
body.theme-midnight textarea,
body.theme-midnight .dash-list button,
body.theme-midnight .dash-metrics button,
body.theme-midnight .quick-link-icon,
body.theme-midnight .quick-link-tools button,
body.theme-midnight .secondary {
  background: var(--input-bg);
  color: var(--text-main);
  border-color: var(--border-color);
}

body.theme-midnight th,
body.theme-midnight .inventory-table thead th,
body.theme-midnight .planner-table thead th {
  background: var(--table-header-bg);
  color: var(--text-muted);
  border-color: var(--border-color);
}

body.theme-midnight td,
body.theme-midnight .purchase-detail-row td,
body.theme-midnight .sku-detail-row td {
  background: var(--panel-bg);
  color: var(--text-main);
  border-color: var(--border-color);
}

body.theme-midnight tr:hover td {
  background: var(--table-row-hover);
}

body.theme-midnight .muted,
body.theme-midnight small,
body.theme-midnight .panel-head p,
body.theme-midnight .list-head p,
body.theme-midnight .dash-footer,
body.theme-midnight .table-counter,
body.theme-midnight .result-main small,
body.theme-midnight .global-search strong,
body.theme-midnight .menu-title {
  color: var(--text-soft);
}

body.theme-midnight .menu-item {
  color: var(--text-muted);
}

body.theme-midnight .menu-item.active {
  background: #243041;
  color: #f8fafc;
  box-shadow: inset 3px 0 0 #60a5fa;
}

body.theme-midnight .global-search,
body.theme-midnight .command-search {
  background:
    linear-gradient(#1b2330, #1b2330) padding-box,
    linear-gradient(90deg, rgba(94, 234, 212, .42), rgba(96, 165, 250, .42), rgba(244, 114, 182, .34), rgba(94, 234, 212, .42)) border-box;
  color: var(--text-main);
}

body.theme-midnight .command-search input,
body.theme-midnight .command-search select {
  background: transparent;
}

body.theme-midnight .badge.ok {
  background: rgba(22, 115, 74, .24);
  color: #86efac;
}

body.theme-midnight .badge.warn {
  background: rgba(154, 91, 0, .26);
  color: #facc15;
}

body.theme-midnight .badge.neutral {
  background: #334155;
  color: #cbd5e1;
}

body.theme-midnight button:disabled,
body.theme-midnight input:disabled,
body.theme-midnight select:disabled,
body.theme-midnight textarea:disabled {
  opacity: .62;
  color: var(--text-soft);
}

body.no-card-shadow .dashboard-hero,
body.no-card-shadow .dash-card,
body.no-card-shadow .panel,
body.no-card-shadow .inventory-metrics article {
  box-shadow: none;
}

body.square-cards .dashboard-hero,
body.square-cards .dash-card,
body.square-cards .panel,
body.square-cards .table-scroll,
body.square-cards .inventory-table-wrap,
body.square-cards .settings-panel {
  border-radius: 0;
}

.row-highlight {
  animation: rowFlash 1.6s ease;
}

@keyframes rowFlash {
  0%, 70% { background: #fff7d6; }
  100% { background: transparent; }
}

.option-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.gift-option-row {
  grid-template-columns: 120px minmax(160px, 1fr) minmax(120px, 1fr) auto auto auto;
}

@media (max-width: 1180px) {
  .dashboard-hero {
    display: grid;
  }

  .widget-S,
  .widget-M,
  .widget-L {
    grid-column: span 6;
  }

  .purchase-stats,
  .widget-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-filters,
  .item-picker {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .batch-field-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .batch-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1100px) and (max-width: 1400px) {
  body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  body {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .sidebar .brand {
    justify-content: center;
  }
  .sidebar .brand-text,
  .sidebar .menu {
    display: none;
  }
}

@media (max-width: 900px) {
  body,
  body.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(280px, 84vw);
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }
  .main {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .widget-S,
  .widget-M,
  .widget-L,
  .widget-XL,
  .add-widget {
    grid-column: span 12;
  }
  .theme-cards,
  .widget-library {
    grid-template-columns: 1fr;
  }
  .purchase-stats {
    grid-template-columns: 1fr;
  }
  .command-results button {
    grid-template-columns: 1fr;
  }
}

.v2-workspace-tabs button {
  min-width: 120px;
}

.stage-a-overview article strong {
  font-size: 20px;
}

.profit-section-block {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.profit-section-block h4 {
  margin: 0 0 12px;
}

.quality-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  background: #eef2f7;
  color: #475569;
}

.quality-pill.ok {
  background: #dcfce7;
  color: #166534;
}

.quality-pill.bad {
  background: #fee2e2;
  color: #b91c1c;
}

.profit-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(520px, 100%);
  flex: 1 1 420px;
}

.profit-search-wrap input {
  flex: 1;
  min-width: 0;
  padding-right: 112px;
}

.profit-search-icon-button,
.profit-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profit-search-icon-button {
  right: 8px;
}

.profit-search-clear {
  right: 54px;
  font-size: 20px;
  line-height: 1;
}

.profit-search-icon-button:hover,
.profit-search-clear:hover {
  color: var(--text-main);
  background: rgba(148, 163, 184, .14);
  border-radius: 8px;
}

.profit-search-icon-button svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-clear-search-button {
  min-height: 44px;
  white-space: nowrap;
}

.profit-clear-search-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.profit-search-clear:disabled,
.profit-search-clear.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.profit-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.profit-pagination input {
  width: 76px;
  height: 38px;
  text-align: center;
}
/* Profit V2 exception workspace */
.profit-exception-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.profit-exception-stats article {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profit-exception-stats span {
  color: var(--muted);
  font-size: 13px;
}

.profit-exception-stats strong {
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}

.profit-exception-filter,
.profit-exception-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.profit-cost-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.profit-cost-filter-row select,
.profit-cost-filter-row button {
  min-height: 42px;
}

.profit-review-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.profit-review-cards article {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profit-review-cards span {
  color: var(--muted);
  font-size: 13px;
}

.profit-review-cards strong {
  font-size: 22px;
  line-height: 1.1;
  color: var(--text);
}

.profit-result-section {
  margin-top: 18px;
}

.profit-result-section h4 {
  margin-bottom: 10px;
}

.profit-table-wrap.fixed-height.small-height {
  height: min(360px, 42vh);
}

.profit-exception-filter .profit-search-wrap {
  flex: 1 1 360px;
  min-width: 260px;
}

.profit-exception-filter select {
  flex: 0 0 180px;
}

.profit-exception-actions {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.profit-step-actions.end {
  justify-content: flex-end;
  margin-top: 16px;
}

.profit-table-wrap.fixed-height {
  height: min(560px, 58vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profit-table-wrap.fixed-height table {
  min-width: 1380px;
  table-layout: fixed;
}

.profit-table-wrap.fixed-height th,
.profit-table-wrap.fixed-height td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.profit-table-wrap.fixed-height thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.profit-table-wrap.fixed-height th:nth-child(1),
.profit-table-wrap.fixed-height td:nth-child(1) { width: 48px; text-align: center; }
.profit-table-wrap.fixed-height th:nth-child(2),
.profit-table-wrap.fixed-height td:nth-child(2) { width: 150px; }
.profit-table-wrap.fixed-height th:nth-child(3),
.profit-table-wrap.fixed-height td:nth-child(3) { width: 140px; }
.profit-table-wrap.fixed-height th:nth-child(4),
.profit-table-wrap.fixed-height td:nth-child(4) { width: 210px; }
.profit-table-wrap.fixed-height th:nth-child(5),
.profit-table-wrap.fixed-height td:nth-child(5) { width: 150px; }
.profit-table-wrap.fixed-height th:nth-child(6),
.profit-table-wrap.fixed-height td:nth-child(6) { width: 110px; }
.profit-table-wrap.fixed-height th:nth-child(7),
.profit-table-wrap.fixed-height td:nth-child(7) { width: 110px; }
.profit-table-wrap.fixed-height th:nth-child(8),
.profit-table-wrap.fixed-height td:nth-child(8) { width: 150px; }
.profit-table-wrap.fixed-height th:nth-child(9),
.profit-table-wrap.fixed-height td:nth-child(9) { width: 260px; }
.profit-table-wrap.fixed-height th:nth-child(10),
.profit-table-wrap.fixed-height td:nth-child(10) { width: 260px; }
.profit-table-wrap.fixed-height th:nth-child(11),
.profit-table-wrap.fixed-height td:nth-child(11) { width: 260px; }
.profit-table-wrap.fixed-height th:nth-child(12),
.profit-table-wrap.fixed-height td:nth-child(12) { width: 100px; }

.profit-table-wrap .text-cell {
  max-width: 260px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-weight: 700;
  font-size: 12px;
}

.status-pill.warning {
  background: #fff4d8;
  color: #8a5a00;
}

.status-pill.danger {
  background: #ffe4e4;
  color: #b42318;
}

.status-pill.success {
  background: #dcfce7;
  color: #166534;
}

.status-pill.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.muted {
  background: #eef2f7;
  color: #667085;
}

.profit-bi-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 18px 0 16px;
  padding: 5px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  background: #eef2f6;
  border: 1px solid #e4e9f1;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}


.profit-bi-tabs .tab-btn {
  flex: 1 1 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #667085;
  min-height: 38px;
  padding: 8px 18px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}




.profit-bi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
}

.profit-bi-section-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profit-bi-section-left h4 {
  margin: 0;
}

.profit-bi-toolbar-right {
  justify-content: flex-end;
  margin-left: auto;
}

.profit-bi-filter-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f7f9fc;
  color: #475467;
}

.profit-bi-filter-note span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-weight: 900;
}

.profit-bi-filter-note p {
  margin: 0;
  line-height: 1.5;
}

.profit-step-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.profit-bi-tabs .tab-btn:hover {
  background: rgba(255, 255, 255, 0.68);
  color: #344054;
}

.profit-bi-tabs .tab-btn.active,
.profit-bi-tabs .tab-btn[aria-selected="true"] {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12);
}

.profit-bi-card-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.profit-bi-card-section-title {
  margin: 18px 0 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.profit-bi-card-row article {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.profit-bi-card-main {
  position: relative;
  z-index: 2;
}

.profit-bi-card-row span {
  display: block;
  color: #667085;
  font-size: 13px;
  margin-bottom: 10px;
}

.profit-bi-card-row strong {
  font-size: 22px;
  color: #172033;
}

.profit-bi-cost-card {
  min-height: 112px;
}

.profit-bi-card-watermark {
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%) skewX(-2deg);
  color: rgba(37, 99, 235, 0.045);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(68px, 8.6vw, 124px);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: none;
  line-height: 0.9;
  pointer-events: none;
  z-index: 1;
}

.profit-bi-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.profit-bi-toolbar input,
.profit-bi-toolbar select {
  min-height: 40px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
}

.profit-bi-toolbar input {
  min-width: 320px;
}

.profit-bi-table {
  position: relative;
  isolation: isolate;
  max-height: 560px;
  overflow: auto;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #fff;
}

.profit-bi-grid {
  position: relative;
  width: max-content;
  min-width: 100%;
}

.profit-bi-grid-row {
  display: grid;
  grid-template-columns: var(--profit-bi-cols);
  width: max-content;
  min-width: 100%;
}

.profit-bi-grid-head {
  position: sticky;
  top: 0;
  z-index: 3000;
}

.profit-bi-cell {
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid #d9e1ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  background: #fff;
}

.profit-bi-head-cell {
  position: sticky;
  top: 0;
  z-index: 3200;
  min-height: 52px;
  display: flex;
  align-items: center;
  background: #f6f8fb;
  font-weight: 800;
  color: #667085;
  box-shadow: inset 0 -1px 0 var(--line);
}

.profit-bi-grid-row:nth-child(odd) .profit-bi-cell {
  background: #ffffff;
}

.profit-bi-grid-row:nth-child(even) .profit-bi-cell {
  background: #f8fafc;
}

.profit-bi-grid-head .profit-bi-cell,
.profit-bi-grid-head .profit-bi-head-cell {
  background: #f6f8fb;
}

.profit-bi-grid-row.total-row .profit-bi-cell {
  position: sticky;
  bottom: 0;
  z-index: 620;
  background: #fbfcff;
  font-weight: 800;
  border-top: 1px solid #d9e1ec;
}

.profit-bi-grid-wrap .sticky-col {
  position: sticky;
  z-index: 1800;
  background-clip: padding-box;
}

.profit-bi-cell.num,
.profit-bi-cell.text {
  text-align: left;
}

.profit-bi-grid-wrap .profit-bi-head-cell.sticky-col {
  z-index: 5200;
  background: #f6f8fb;
}

.profit-bi-grid-wrap .total-row .sticky-col {
  z-index: 2600;
  background: #fbfcff;
}

.profit-bi-grid-wrap .sticky-col.sticky-last {
  border-right: 1px solid #cbd5e1;
  box-shadow: none;
}

.profit-bi-th-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.profit-bi-th-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profit-bi-head-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  vertical-align: middle;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.profit-bi-cell-value {
  display: block;
  width: 100%;
  text-align: left;
}

.profit-bi-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  z-index: 5400;
}


.profit-bi-pin:hover {
  background: #eef2f6;
  color: #475467;
}

.profit-bi-pin.active {
  color: #2563eb;
}

.profit-bi-freeze-icon {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
  color: currentColor;
  pointer-events: none;
  flex: 0 0 auto;
  position: relative;
  z-index: 5401;
}

.profit-bi-col-resizer {
  position: absolute;
  top: 8px;
  right: -4px;
  bottom: 8px;
  width: 8px;
  cursor: col-resize;
  z-index: 980;
}

.profit-bi-col-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.profit-bi-head-cell:hover .profit-bi-col-resizer::after,
body.profit-bi-resizing .profit-bi-col-resizer::after {
  background: #94a3b8;
}

body.profit-bi-resizing {
  cursor: col-resize;
  user-select: none;
}

.profit-bi-sort-head {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 24px;
  margin-left: 0;
  border: 0;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.profit-bi-sort-head span {
  display: block;
  height: 10px;
  line-height: 10px;
  margin: 0;
}

.profit-bi-sort-head:hover,
.profit-bi-sort-head.active {
  color: #2563eb;
}

.profit-bi-metric {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.profit-bi-metric em {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.profit-bi-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
}

.profit-bi-order-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
}

.profit-bi-order-toolbar input {
  width: 100%;
  min-width: 0;
}

.profit-bi-order-toolbar select {
  width: 132px;
}

.profit-bi-count {
  color: #667085;
  font-weight: 700;
  justify-self: end;
}

.profit-bi-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.profit-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  max-height: 420px;
  overflow: auto;
}

.profit-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

@media (max-width: 1280px) {
  .profit-bi-card-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profit-exception-stats {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .profit-cost-filter-row {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 860px) {
  .profit-cost-filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .profit-exception-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profit-exception-filter select,
  .profit-exception-actions button {
    flex: 1 1 100%;
  }
}


.profit-bi-grid-wrap .sticky-col.sticky-last::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 1px;
  background: #cbd5e1;
  pointer-events: none;
  z-index: 1;
}

.profit-bi-head-cell .profit-bi-col-resizer {
  z-index: 5400;
}

.profit-bi-th-label,
.profit-bi-cell-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profit-published-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  min-width: 0;
  max-width: 100%;
}

#profit-published,
#profit-published .panel,
#profit-published-app {
  min-width: 0;
  max-width: 100%;
}

#profit-published .panel {
  overflow: hidden;
}

.profit-published-head h3 {
  margin: 4px 0;
  font-size: 24px;
}

.profit-published-head .head-actions {
  position: relative;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.profit-published-tabs {
  margin: 12px 0 18px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.profit-published-body {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: #f8fafc;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.profit-published-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.profit-published-kpis article {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.profit-published-kpis span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.profit-published-kpis strong {
  font-size: 24px;
}

.profit-published-table {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profit-published-table table {
  min-width: 1180px;
  width: 100%;
  border-collapse: collapse;
}

.profit-published-table th,
.profit-published-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profit-published-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  color: var(--muted);
}

.profit-published-loading {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #172033;
}

.profit-published-loading p {
  margin: 0;
  color: #667085;
}

.profit-loading-orbit {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid #dbe5f2;
  position: relative;
}

.profit-loading-orbit span {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: #2563eb;
  border-right-color: #10b981;
  animation: profitOrbitSpin 0.9s linear infinite;
}

@keyframes profitOrbitSpin {
  to { transform: rotate(360deg); }
}

.profit-pub-hero {
  --hero-bg-start: #eef7ff;
  --hero-bg-mid: #e7f2ff;
  --hero-bg-end: #d8ebff;
  --hero-circle-a: rgba(91, 165, 255, 0.32);
  --hero-circle-b: rgba(42, 124, 236, 0.24);
  --hero-circle-c: rgba(93, 203, 235, 0.26);
  --hero-card-bg: rgba(255, 255, 255, 0.76);
  --hero-card-border: rgba(255, 255, 255, 0.86);
  --hero-pill: rgba(147, 197, 253, 0.92);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(390px, 1.28fr) minmax(225px, 0.66fr) minmax(225px, 0.66fr) minmax(128px, 0.36fr);
  align-items: center;
  gap: 22px;
  min-height: 238px;
  padding: 36px 38px;
  border: 1px solid rgba(191, 219, 254, 0.58);
  border-radius: 24px;
  color: #111827;
  background: linear-gradient(105deg, var(--hero-bg-start) 0%, var(--hero-bg-mid) 48%, var(--hero-bg-end) 100%);
  box-shadow: none;
}

.profit-pub-hero::before,
.profit-pub-hero::after {
  content: none;
}

.profit-pub-theme-blue {
  --hero-bg-start: #eff7ff;
  --hero-bg-mid: #e5f1ff;
  --hero-bg-end: #d6eaff;
  --hero-circle-a: rgba(91, 165, 255, 0.34);
  --hero-circle-b: rgba(37, 107, 224, 0.24);
  --hero-circle-c: rgba(73, 198, 232, 0.28);
  --hero-pill: rgba(147, 197, 253, 0.94);
}

.profit-pub-theme-green {
  --hero-bg-start: #f1fbf6;
  --hero-bg-mid: #e8f8f0;
  --hero-bg-end: #dff7ec;
  --hero-circle-a: rgba(16, 185, 129, 0.25);
  --hero-circle-b: rgba(45, 133, 112, 0.22);
  --hero-circle-c: rgba(92, 202, 166, 0.26);
  --hero-pill: rgba(110, 231, 183, 0.9);
}

.profit-pub-theme-purple {
  --hero-bg-start: #f7f3ff;
  --hero-bg-mid: #eee8ff;
  --hero-bg-end: #e9e1ff;
  --hero-circle-a: rgba(139, 92, 246, 0.25);
  --hero-circle-b: rgba(88, 119, 235, 0.22);
  --hero-circle-c: rgba(190, 120, 230, 0.2);
  --hero-pill: rgba(196, 181, 253, 0.92);
}

.profit-pub-theme-warm {
  --hero-bg-start: #fbfbf8;
  --hero-bg-mid: #f2f4f7;
  --hero-bg-end: #eef2f6;
  --hero-circle-a: rgba(148, 163, 184, 0.24);
  --hero-circle-b: rgba(116, 147, 190, 0.2);
  --hero-circle-c: rgba(201, 213, 225, 0.34);
  --hero-pill: rgba(180, 198, 222, 0.88);
}

.profit-pub-theme-navy {
  --hero-bg-start: #edf4ff;
  --hero-bg-mid: #e5efff;
  --hero-bg-end: #dce8ff;
  --hero-circle-a: rgba(30, 64, 175, 0.2);
  --hero-circle-b: rgba(49, 118, 232, 0.24);
  --hero-circle-c: rgba(72, 177, 220, 0.2);
  --hero-pill: rgba(125, 168, 235, 0.92);
}

.profit-pub-geo {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  opacity: 1;
  filter: saturate(1.04);
}

.profit-pub-geo-a {
  right: -9%;
  top: -104%;
  width: min(54%, 700px);
  background: linear-gradient(135deg, var(--hero-circle-a), transparent 74%);
  animation: profitHeroCircleA 9s ease-in-out infinite alternate;
}

.profit-pub-geo-b {
  right: -2%;
  bottom: -78%;
  width: min(34%, 450px);
  background: linear-gradient(160deg, var(--hero-circle-b), transparent 70%);
  animation: profitHeroCircleB 11s ease-in-out infinite alternate-reverse;
}

.profit-pub-geo-c {
  left: 39%;
  bottom: -70%;
  width: min(31%, 410px);
  background: linear-gradient(0deg, var(--hero-circle-c), transparent 74%);
  animation: profitHeroCircleC 10s ease-in-out infinite alternate;
}

.profit-pub-hero > :not(.profit-pub-geo) {
  position: relative;
  z-index: 1;
}

.profit-pub-hero-title p,
.profit-pub-hero-title span {
  display: block;
  margin: 0;
  color: #4b5563;
  font-weight: 800;
}

.profit-pub-hero-title p {
  font-size: 17px;
  letter-spacing: 0;
}

.profit-pub-hero-title h3 {
  margin: 10px 0 12px;
  color: #151922;
  font-size: clamp(34px, 3vw, 48px);
  line-height: 1.06;
  letter-spacing: 0;
}

.profit-pub-hero-title span {
  margin-top: 5px;
  font-size: 17px;
  color: #303846;
}

.profit-pub-hero-card {
  display: grid;
  align-content: center;
  min-height: 154px;
  height: 154px;
  padding: 28px 28px;
  border: 1px solid var(--hero-card-border);
  border-radius: 22px;
  background: var(--hero-card-bg);
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.profit-pub-hero-card small,
.profit-pub-hero-card dt {
  color: #1f2937;
  font-size: 19px;
  font-weight: 900;
}

.profit-pub-hero-card strong {
  margin-top: 10px;
  color: #202124;
  font-size: clamp(30px, 2.16vw, 42px);
  line-height: 0.98;
  letter-spacing: 0;
}

.profit-pub-hero-card em {
  width: fit-content;
  margin-top: 16px;
  padding: 5px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--hero-pill);
  font-style: normal;
  font-size: 18px;
  font-weight: 900;
}

.profit-pub-hero dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profit-pub-hero-mini dt {
  font-size: 15px;
}

.profit-pub-hero dd {
  margin: 6px 0 0;
  color: #202124;
  font-size: 22px;
  font-weight: 900;
}

@keyframes profitHeroCircleA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-24px, 12px, 0) scale(1.035); }
}

@keyframes profitHeroCircleB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-18px, -16px, 0) scale(1.05); }
}

@keyframes profitHeroCircleC {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, -12px, 0) scale(1.04); }
}

.profit-pub-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
}

.profit-published-filter {
  position: relative;
}

.profit-published-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profit-published-filter-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-published-filter-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: 320px;
  padding: 16px;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.profit-published-filter-popover h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.profit-published-filter-popover input[type="text"],
.profit-published-filter-popover input[data-profit-published-group-filter-search] {
  width: 100%;
  height: 40px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.profit-published-filter-popover hr {
  border: 0;
  border-top: 1px solid #edf2f7;
  margin: 10px 0;
}

.profit-filter-list {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.profit-filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  color: #344054;
  font-weight: 700;
}

.profit-filter-option:hover {
  background: #f8fafc;
}

.profit-filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.profit-filter-foot div {
  display: flex;
  gap: 8px;
}

.profit-published-filter-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}

.profit-published-filter-notice span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 900;
}

.profit-published-filter-notice p {
  margin: 0;
  font-weight: 700;
}

.profit-dashboard-grid {
  display: grid;
  gap: 16px;
}

.profit-dashboard-row-1 {
  grid-template-columns: minmax(0, 1.22fr) minmax(360px, 0.78fr);
}

.profit-dashboard-row-2,
.profit-dashboard-row-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profit-dashboard-widget {
  min-height: 360px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
  overflow: hidden;
}

.profit-dashboard-widget.wide {
  min-width: 0;
}

.profit-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.profit-widget-head h4 {
  margin: 0;
  color: #172033;
  font-size: 17px;
}

.profit-widget-head p {
  margin: 5px 0 0;
  color: #667085;
  font-size: 13px;
}

.profit-waterfall-svg,
.profit-trend-svg {
  width: 100%;
  height: 300px;
  overflow: visible;
}

.profit-chart-zero,
.profit-grid-line {
  stroke: #e5edf6;
  stroke-width: 1;
}

.profit-waterfall-connector {
  stroke: #cbd5e1;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.profit-chart-bar {
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.profit-chart-bar:hover {
  opacity: 0.82;
  transform: translateY(-2px);
}

.profit-chart-bar.income {
  fill: #60a5fa;
}

.profit-chart-bar.cost {
  fill: #fb923c;
}

.profit-chart-bar.result {
  fill: #22c55e;
}

.profit-chart-value {
  fill: #344054;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.profit-chart-label {
  fill: #667085;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.profit-widget-toggle,
.profit-compare-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f1f5f9;
}

.profit-widget-toggle button,
.profit-compare-switch button {
  min-width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.profit-widget-toggle button.active,
.profit-compare-switch button.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.profit-donut-layout {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 12px;
}

.profit-donut-chart {
  width: 260px;
  height: 260px;
}

.profit-donut-chart path {
  transition: opacity 0.18s ease, stroke-width 0.18s ease;
}

.profit-donut-chart path:hover {
  opacity: 0.82;
  stroke-width: 28;
}

.profit-donut-label {
  fill: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.profit-donut-total {
  fill: #172033;
  font-size: 18px;
  font-weight: 900;
  text-anchor: middle;
}

.profit-donut-legend,
.profit-contribution-list,
.profit-attention-list,
.profit-dashboard-cost-chart,
.profit-compare-bars {
  display: grid;
  gap: 10px;
}

.profit-donut-legend div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.profit-donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profit-donut-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  max-width: 360px;
}

.profit-chart-tooltip {
  position: fixed;
  z-index: 10000;
  min-width: 148px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, .92);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  color: #475569;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .16);
  pointer-events: none;
  font-size: 13px;
  line-height: 1.45;
}

.profit-chart-tooltip.hidden {
  display: none;
}

.profit-chart-tooltip b {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 800;
}

.profit-chart-tooltip div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.profit-chart-tooltip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.profit-chart-tooltip span {
  color: #6b7280;
  white-space: nowrap;
}

.profit-chart-tooltip strong {
  color: #475569;
  font-weight: 900;
  white-space: nowrap;
}

.profit-dashboard-cost-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) 150px;
  align-items: center;
  gap: 12px;
}

.profit-dashboard-cost-row span,
.profit-compare-row span {
  color: #475467;
  font-weight: 800;
}

.profit-dashboard-cost-row div,
.profit-compare-pair {
  display: grid;
  gap: 5px;
}

.profit-dashboard-cost-row div {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.profit-dashboard-cost-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.profit-dashboard-cost-row strong {
  text-align: right;
  color: #172033;
}

.profit-dashboard-cost-row em {
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
}

.profit-chart-legend {
  display: flex;
  gap: 14px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.profit-chart-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}

.profit-chart-legend .sales::before {
  background: #60a5fa;
}

.profit-chart-legend .profit::before {
  background: #22c55e;
}

.profit-line-sales,
.profit-line-profit {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-line-sales,
.profit-line-sales-point {
  stroke: #3b82f6;
  fill: #3b82f6;
}

.profit-line-profit,
.profit-line-profit-point {
  stroke: #22c55e;
  fill: #22c55e;
}

.profit-compare-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
}

.profit-compare-pair i {
  display: block;
  height: 10px;
  border-radius: 999px;
}

.profit-compare-pair .previous {
  background: #dbeafe;
}

.profit-compare-pair .current {
  background: #60a5fa;
}

.profit-chart-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 1px dashed #dbe5f0;
  border-radius: 12px;
  color: #94a3b8;
  font-weight: 800;
}

.profit-contribution-list article,
.profit-attention-list article {
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.profit-contribution-list article div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.profit-contribution-list strong,
.profit-attention-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-contribution-list b {
  display: block;
  margin: 10px 0 4px;
  font-size: 20px;
  color: #172033;
}

.profit-contribution-list em,
.profit-attention-list em,
.profit-attention-list span {
  color: #64748b;
  font-style: normal;
  font-weight: 800;
}

.profit-contribution-list i {
  display: block;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.profit-contribution-list i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #22c55e);
}

.profit-attention-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.profit-attention-list article > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profit-attention-list i {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #ea580c;
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}

.profit-pub-panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 18px;
}

.profit-pub-panel-head,
.profit-pub-section-head,
.profit-pub-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profit-pub-panel-head h4,
.profit-pub-section-head h4,
.profit-pub-product-head h4 {
  margin: 0;
  font-size: 18px;
}

.profit-pub-panel-head p,
.profit-pub-section-head p,
.profit-pub-product-head p {
  margin: 4px 0 0;
  color: #667085;
}

.profit-waterfall {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 230px;
}

.profit-waterfall-item {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #475467;
}

.profit-waterfall-bar {
  width: 52px;
  border-radius: 8px 8px 3px 3px;
  background: #93c5fd;
}

.profit-waterfall-item.cost .profit-waterfall-bar {
  background: #fecaca;
}

.profit-waterfall-item.result .profit-waterfall-bar {
  background: #86efac;
}

.profit-waterfall-item strong {
  font-size: 12px;
  color: #172033;
}

.profit-cost-bars {
  display: grid;
  gap: 12px;
}

.profit-cost-bar-row {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 160px;
  align-items: center;
  gap: 12px;
}

.profit-cost-bar-row span {
  color: #475467;
  font-weight: 800;
}

.profit-cost-bar-row div {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.profit-cost-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #34d399);
}

.profit-cost-bar-row strong {
  text-align: right;
  color: #172033;
}

.profit-cost-bar-row em {
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
}

.profit-pub-rank-cards,
.profit-product-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.profit-pub-rank-cards article,
.profit-product-podium article,
.profit-product-rank-list {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.profit-pub-rank-cards h5 {
  margin: 0 0 12px;
  font-size: 15px;
}

.profit-pub-rank-cards article div,
.profit-product-rank-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
}

.profit-pub-rank-cards article div:first-of-type,
.profit-product-rank-list div:first-child {
  border-top: 0;
}

.profit-pub-rank-cards b,
.profit-product-rank-list b,
.profit-product-rank-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-quadrant {
  position: relative;
  min-height: 320px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #d9e1ec calc(50% - 1px), #d9e1ec calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), #d9e1ec calc(50% - 1px), #d9e1ec calc(50% + 1px), transparent calc(50% + 1px)),
    #f8fafc;
  overflow: hidden;
}

.profit-quadrant button {
  position: absolute;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.profit-product-podium article {
  min-height: 178px;
  display: grid;
  align-content: space-between;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.profit-product-podium article span {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 900;
}

.profit-product-podium article.rank-1 span {
  background: #fef3c7;
  color: #b45309;
}

.profit-product-podium article.rank-2 span {
  background: #f1f5f9;
  color: #475467;
}

.profit-product-podium article.rank-3 span {
  background: #ffedd5;
  color: #c2410c;
}

.profit-product-podium strong {
  font-size: 20px;
}

.profit-product-podium p {
  min-height: 36px;
  margin: 0;
  color: #475467;
  overflow: hidden;
}

.profit-product-podium b {
  font-size: 24px;
}

.profit-product-podium em {
  color: #667085;
  font-style: normal;
  font-weight: 800;
}

.profit-product-rank-list {
  margin: 14px 0;
  padding: 8px 14px;
}

.profit-product-rank-list div {
  grid-template-columns: 34px 180px minmax(0, 1fr) auto;
}

.profit-product-page-v2 {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.profit-product-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.profit-product-stat {
  min-height: 136px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  border: 1px solid #dfe8f4;
  border-radius: 22px;
  padding: 22px 26px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.profit-product-stat.green {
  background: linear-gradient(135deg, #f3fff9, #ffffff);
}

.profit-product-stat.orange {
  background: linear-gradient(135deg, #fff8ed, #ffffff);
}

.profit-product-stat.purple {
  background: linear-gradient(135deg, #f7f3ff, #ffffff);
}

.profit-product-stat h5 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  color: #16a34a;
  font-size: 15px;
  font-weight: 950;
}

.profit-product-stat.orange h5 {
  color: #ea580c;
}

.profit-product-stat.purple h5 {
  color: #7c3aed;
}

.profit-product-stat strong {
  color: #172033;
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
}

.profit-product-stat p {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 15px;
  font-weight: 850;
}

.profit-product-mini-ring {
  --ring-color: #22c55e;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), rgba(15, 23, 42, 0.07) 0);
}

.profit-product-stat.orange .profit-product-mini-ring {
  --ring-color: #f59e0b;
}

.profit-product-mini-ring span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #172033;
  font-size: 15px;
  font-weight: 950;
}

.profit-product-spark {
  flex: 0 0 100px;
  height: 84px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 9px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.11);
}

.profit-product-spark i {
  width: 12px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.profit-product-spark i:nth-child(1) { height: 32px; }
.profit-product-spark i:nth-child(2) { height: 48px; }
.profit-product-spark i:nth-child(3) { height: 64px; }
.profit-product-spark i:nth-child(4) { height: 40px; }

.profit-product-rank-section,
.profit-product-table-section {
  border: 1px solid #dfe8f4;
  border-radius: 22px;
  padding: 20px;
  background: #fff;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.profit-product-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profit-product-section-head h4 {
  margin: 0;
  color: #172033;
  font-size: 20px;
  font-weight: 950;
}

.profit-product-section-head p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
}

.profit-product-rank-switch {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: #edf2f7;
}

.profit-product-rank-switch button {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-weight: 900;
}

.profit-product-rank-switch button.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 2px 9px rgba(15, 23, 42, 0.08);
}

.profit-product-top3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.profit-product-top3 article {
  position: relative;
  min-height: 214px;
  overflow: hidden;
  border: 1px solid rgba(234, 179, 8, 0.42);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(135deg, #fffdf7, #fff7ed);
  isolation: isolate;
}

.profit-product-top3 article.rank-2 {
  border-color: rgba(148, 163, 184, 0.48);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.profit-product-top3 article.rank-3 {
  border-color: rgba(251, 146, 60, 0.48);
  background: linear-gradient(135deg, #fffaf5, #fff2e7);
}

.profit-product-top3 .rank-medal {
  position: absolute;
  right: -16px;
  top: 20px;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 31%, rgba(251, 191, 36, 0.16) 32% 48%, rgba(251, 191, 36, 0.07) 49% 64%, transparent 65%);
  color: rgba(180, 83, 9, 0.11);
  font-size: 82px;
  font-weight: 950;
  pointer-events: none;
  z-index: 0;
}

.profit-product-top3 .rank-medal::before,
.profit-product-top3 .rank-medal::after {
  content: "";
  position: absolute;
  bottom: -24px;
  width: 42px;
  height: 72px;
  background: rgba(251, 191, 36, 0.08);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 50% 72%, 24% 100%);
}

.profit-product-top3 .rank-medal::before {
  left: 40px;
  transform: rotate(14deg);
}

.profit-product-top3 .rank-medal::after {
  right: 40px;
  transform: rotate(-14deg);
}

.profit-product-top3 article.rank-2 .rank-medal {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.62) 0 31%, rgba(148, 163, 184, 0.13) 32% 48%, rgba(148, 163, 184, 0.06) 49% 64%, transparent 65%);
  color: rgba(100, 116, 139, 0.11);
}

.profit-product-top3 article.rank-2 .rank-medal::before,
.profit-product-top3 article.rank-2 .rank-medal::after {
  background: rgba(148, 163, 184, 0.08);
}

.profit-product-top3 article.rank-3 .rank-medal {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.58) 0 31%, rgba(251, 146, 60, 0.14) 32% 48%, rgba(251, 146, 60, 0.06) 49% 64%, transparent 65%);
  color: rgba(194, 65, 12, 0.11);
}

.profit-product-top3 article.rank-3 .rank-medal::before,
.profit-product-top3 article.rank-3 .rank-medal::after {
  background: rgba(251, 146, 60, 0.08);
}

.profit-product-rank-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 96px);
  min-width: 0;
}

.rank-crown {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: #f59e0b;
  filter: drop-shadow(0 2px 3px rgba(245, 158, 11, 0.18));
}

.rank-crown.silver {
  color: #94a3b8;
}

.rank-crown.bronze {
  color: #d97706;
}

.profit-product-top3 article > *:not(.rank-medal) {
  position: relative;
  z-index: 1;
}

.profit-product-rank-title strong {
  color: #172033;
  font-size: 30px;
  line-height: 1.22;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-product-group-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-width: 100%;
}

.profit-product-group-tags i {
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-product-rank-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 18px;
}

.profit-product-rank-metrics p {
  margin: 0;
}

.profit-product-rank-metrics span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.profit-product-rank-metrics b {
  color: #172033;
  font-size: 15px;
  font-weight: 950;
}

.profit-product-rank-metrics b.positive,
.profit-product-alert-list b.positive {
  color: #16a34a;
}

.profit-product-rank-metrics b.negative,
.profit-product-alert-list b.negative {
  color: #ef4444;
}

.profit-product-progress,
.profit-product-rank-list-v2 i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.profit-product-progress {
  position: relative;
  z-index: 1;
  margin-top: 16px;
}

.profit-product-progress i,
.profit-product-rank-list-v2 em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #22c55e);
}

.profit-product-rank-list-v2 {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.profit-product-rank-list-v2 article {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1.1fr) repeat(4, minmax(88px, 0.8fr)) 120px;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  border: 1px solid #e6edf5;
  border-radius: 13px;
  padding: 8px 14px;
  background: #fff;
  transition: background .16s ease, border-color .16s ease;
}

.profit-product-rank-list-v2 article:hover {
  background: #f8fbff;
  border-color: #d7e4f4;
}

.profit-product-rank-list-v2 article > span {
  color: #172033;
  font-weight: 950;
}

.profit-product-rank-list-v2 strong,
.profit-product-rank-list-v2 b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-product-rank-list-v2 strong {
  color: #172033;
  font-weight: 950;
}

.profit-product-rank-list-v2 b {
  color: #172033;
  font-weight: 900;
}

.profit-rank-mini-metric {
  min-width: 0;
}

.profit-rank-mini-metric small {
  display: block;
  margin-bottom: 2px;
  color: #8a97aa;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.profit-rank-mini-metric b {
  color: #172033;
  font-size: 13px;
  font-weight: 950;
}

.profit-product-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 100%;
  min-width: 0;
}

.profit-product-chart-grid-two {
  align-items: stretch;
}

.profit-product-chart-card {
  min-height: 340px;
}

.profit-product-donut-wrap {
  min-width: 0;
}

.profit-product-donut,
.profit-product-histogram {
  width: 100%;
  height: auto;
  max-height: 290px;
}

.profit-product-donut-segment,
.profit-product-histogram g {
  cursor: pointer;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.profit-product-donut-segment:hover,
.profit-product-histogram g:hover rect:not(.profit-product-histogram-hit) {
  opacity: 0.88;
  filter: drop-shadow(0 6px 10px rgba(59, 130, 246, 0.18));
}

.profit-product-legend {
  display: grid;
  gap: 9px;
}

.profit-product-legend span {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.profit-product-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profit-product-legend b {
  color: #172033;
}

.profit-product-histogram text {
  fill: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.profit-product-alert-list {
  display: grid;
  gap: 11px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

.profit-product-alert-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 90px;
  gap: 12px;
  align-items: center;
  border: 1px solid #e6edf5;
  border-radius: 15px;
  padding: 13px 16px;
  background: #fbfdff;
  transition: background .16s ease, border-color .16s ease;
}

.profit-product-alert-list article:hover {
  background: #f8fbff;
  border-color: #d7e4f4;
}

.profit-product-alert-list strong,
.profit-product-alert-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-product-alert-list strong {
  color: #172033;
  font-weight: 950;
}

.profit-product-alert-list small {
  margin-top: 4px;
  color: #64748b;
  font-weight: 750;
}

.profit-product-alert-list em {
  color: #64748b;
  font-style: normal;
  font-weight: 900;
}

.profit-product-alert-list p {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.profit-product-alert-list p span {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.profit-product-alert-list .red { background: #fee2e2; color: #dc2626; }
.profit-product-alert-list .orange { background: #ffedd5; color: #ea580c; }
.profit-product-alert-list .blue { background: #dbeafe; color: #2563eb; }
.profit-product-alert-list .purple { background: #ede9fe; color: #7c3aed; }

.profit-product-table-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto 150px auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
}

.profit-product-table-toolbar input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 800;
}

.profit-product-table-toolbar select {
  height: 40px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  font-weight: 850;
}

.profit-product-table-toolbar span {
  color: #64748b;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .profit-product-table-toolbar {
    grid-template-columns: 1fr auto auto;
  }

  .profit-product-table-toolbar select,
  .profit-product-table-toolbar [data-profit-published-product-export],
  .profit-product-table-toolbar span {
    grid-column: auto;
  }
}

.profit-product-full-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  overflow: auto;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  overscroll-behavior: contain;
}

.profit-product-full-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.profit-product-full-table th:nth-child(1),
.profit-product-full-table td:nth-child(1) { width: 220px; }
.profit-product-full-table th:nth-child(2),
.profit-product-full-table td:nth-child(2) { width: 260px; }
.profit-product-full-table th:nth-child(3),
.profit-product-full-table td:nth-child(3) { width: 190px; }
.profit-product-full-table th:nth-child(4),
.profit-product-full-table td:nth-child(4),
.profit-product-full-table th:nth-child(5),
.profit-product-full-table td:nth-child(5) { width: 84px; }
.profit-product-full-table th:nth-child(6),
.profit-product-full-table td:nth-child(6),
.profit-product-full-table th:nth-child(7),
.profit-product-full-table td:nth-child(7),
.profit-product-full-table th:nth-child(8),
.profit-product-full-table td:nth-child(8),
.profit-product-full-table th:nth-child(9),
.profit-product-full-table td:nth-child(9),
.profit-product-full-table th:nth-child(10),
.profit-product-full-table td:nth-child(10) { width: 128px; }
.profit-product-full-table th:nth-child(11),
.profit-product-full-table td:nth-child(11) { width: 96px; }

.profit-product-full-table th,
.profit-product-full-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e6edf5;
  color: #172033;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profit-product-full-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f3f7fb;
  color: #64748b;
  font-weight: 950;
}

.profit-product-main-row:hover td {
  background: #f8fbff;
}

.profit-product-main-row button {
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  color: #2563eb;
  font-weight: 950;
}

.profit-product-full-table td.positive,
.profit-product-full-table .positive {
  color: #16a34a;
}

.profit-product-full-table td.negative,
.profit-product-full-table .negative {
  color: #ef4444;
}

.profit-product-variants-row td {
  background: #f8fafc;
}

.profit-product-variants {
  padding: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

.profit-product-variants table {
  width: 100%;
  min-width: 880px;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.profit-product-variants th,
.profit-product-variants td {
  padding: 10px 12px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#product-list,
#product-list .panel-like,
#product-list .product-groups,
#product-list .children,
#product-list .sku-detail,
#product-list .pager {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#product-list .panel-like {
  overflow: hidden;
}

#product-list .children {
  overscroll-behavior-x: contain;
}

#product-list .sku-detail-row,
#product-list .sku-detail-row td {
  max-width: 100%;
  overflow: hidden;
}

#product-list .row-actions button {
  max-width: 100%;
}

@media (max-width: 1500px) {
  .profit-product-top3 {
    grid-template-columns: 1fr;
  }

  .profit-product-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .profit-product-stat-grid {
    grid-template-columns: 1fr;
  }

  .profit-product-donut-wrap {
    grid-template-columns: 1fr;
  }

  .profit-product-rank-list-v2 article {
    grid-template-columns: 34px minmax(120px, 1fr) repeat(2, minmax(92px, auto));
  }

  .profit-product-rank-list-v2 article b:nth-of-type(3),
  .profit-product-rank-list-v2 article b:nth-of-type(4),
  .profit-product-rank-list-v2 article i {
    display: none;
  }
}

.profit-bi-toolbar .secondary.active {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.profit-group-page {
  display: grid;
  gap: 18px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.profit-group-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 100%;
  min-width: 0;
}

.profit-group-kpi {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  min-height: 154px;
  padding: 22px 26px;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  background: #fff;
  box-shadow: none;
  min-width: 0;
}

.profit-group-kpi.green {
  background: linear-gradient(135deg, #f0fff8, #ffffff);
  --kpi-color: #26c281;
  --kpi-deep: #15905d;
  --kpi-soft: rgba(38, 194, 129, 0.14);
}

.profit-group-kpi.orange {
  background: linear-gradient(135deg, #fff8ed, #ffffff);
  --kpi-color: #f59e0b;
  --kpi-deep: #c56d08;
  --kpi-soft: rgba(245, 158, 11, 0.14);
}

.profit-group-kpi.purple {
  background: linear-gradient(135deg, #f5f3ff, #ffffff);
  --kpi-color: #7c3aed;
  --kpi-deep: #5b21b6;
  --kpi-soft: rgba(124, 58, 237, 0.13);
}

.profit-group-kpi-copy {
  min-width: 0;
}

.profit-group-kpi-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--kpi-deep);
  font-size: 14px;
  font-weight: 900;
}

.profit-group-kpi-title svg {
  width: 18px;
  height: 18px;
}

.profit-group-kpi strong {
  display: block;
  margin-top: 16px;
  color: #172033;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.profit-group-kpi strong small {
  margin-left: 5px;
  color: #475467;
  font-size: 17px;
  font-weight: 900;
}

.profit-group-kpi em {
  display: block;
  margin-top: 14px;
  color: #667085;
  font-style: normal;
  font-weight: 800;
}

.profit-group-kpi-ring {
  width: 112px;
  height: 112px;
  overflow: visible;
}

.profit-group-kpi-ring .ring-bg,
.profit-group-kpi-ring .ring-value {
  fill: none;
  stroke-width: 12;
}

.profit-group-kpi-ring .ring-bg {
  stroke: var(--kpi-soft);
}

.profit-group-kpi-ring .ring-value {
  stroke: var(--kpi-color);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.profit-group-kpi-ring text {
  fill: #172033;
  text-anchor: middle;
  font-size: 18px;
  font-weight: 950;
}

.profit-group-kpi-ring .ring-caption {
  fill: #667085;
  font-size: 10px;
  font-weight: 900;
}

.profit-group-kpi-trend {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 14px;
  width: 112px;
  height: 88px;
  padding: 14px 10px 18px;
  border-radius: 22px;
  background: var(--kpi-soft);
}

.profit-group-kpi-trend span {
  position: relative;
  width: 24px;
  border-radius: 999px 999px 5px 5px;
  background: rgba(124, 58, 237, 0.32);
}

.profit-group-kpi-trend span.current {
  background: var(--kpi-color);
}

.profit-group-kpi-trend i {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  color: #667085;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.profit-group-table-card,
.profit-group-widget {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
  min-width: 0;
  max-width: 100%;
}

.profit-group-table-card {
  padding: 18px;
  overflow: hidden;
}

.profit-group-table-head,
.profit-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.profit-group-table-head h4,
.profit-widget-head h4 {
  margin: 0;
  color: #172033;
  font-size: 19px;
}

.profit-group-table-head p,
.profit-widget-head p {
  margin: 5px 0 0;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.profit-group-table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.profit-group-search {
  height: 42px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  font-weight: 800;
}

.profit-group-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 240px;
  padding: 0 13px;
  color: #94a3b8;
}

.profit-group-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.profit-group-search input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172033;
  font-weight: 850;
}

.profit-group-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #e5edf6;
  border-radius: 18px;
  background: #f8fafc;
}

.profit-group-table {
  width: 2040px;
  min-width: 2040px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.profit-group-table.operating-expanded {
  width: 2470px;
  min-width: 2470px;
}

.profit-group-table.logistics-expanded {
  width: 2670px;
  min-width: 2670px;
}

.profit-group-table.operating-expanded.logistics-expanded {
  width: 3100px;
  min-width: 3100px;
}

.profit-group-table col.profit-group-col-name {
  width: 340px;
}

.profit-group-table col.profit-group-col-sales {
  width: 210px;
}

.profit-group-table col.profit-group-col-count {
  width: 140px;
}

.profit-group-table col.profit-group-col-money {
  width: 190px;
}

.profit-group-table col.profit-group-col-operating,
.profit-group-table col.profit-group-col-logistics {
  width: 190px;
}

.profit-group-table.operating-expanded col.profit-group-col-operating {
  width: 620px;
}

.profit-group-table.logistics-expanded col.profit-group-col-logistics {
  width: 820px;
}

.profit-group-table col.profit-group-col-rate {
  width: 140px;
}

.profit-group-table col.profit-group-col-contribution {
  width: 210px;
}

.profit-group-table col.profit-group-col-status {
  width: 120px;
}

.profit-group-table th,
.profit-group-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #e6edf5;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.profit-group-table th {
  background: #f3f7fb;
  color: #64748b;
  font-size: 15px;
  font-weight: 950;
  text-align: center;
}

.profit-group-table tbody tr {
  background: #fff;
  transition: background 0.16s ease;
}

.profit-group-table tbody tr:nth-child(even) {
  background: #f9fbfd;
}

.profit-group-table tbody tr:hover {
  background: #eff6ff;
}

.profit-group-table td b {
  color: #172033;
  font-weight: 900;
  font-size: 15px;
}

.profit-group-table td small {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.profit-group-table td.positive b {
  color: #16a34a;
}

.profit-group-table td.negative b {
  color: #ef4444;
}

.profit-group-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 300px;
}

.profit-group-name-cell strong {
  display: block;
  max-width: 258px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #172033;
  font-weight: 950;
}

.profit-group-name-cell .plain-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.profit-bi-inline-ratio {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e8f7ee;
  color: #16834b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.profit-center-trash-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  color: #526176;
  font-weight: 850;
}

.profit-center-trash-button:hover {
  border-color: #b9c9de;
  background: #f7f9fc;
  color: #315f9b;
}

.profit-center-trash-button svg,
.profit-published-audit-eye svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-pub-hero-title {
  min-width: 0;
}

.profit-pub-hero-title h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-pub-hero-title.is-medium h3 {
  font-size: clamp(30px, 2.5vw, 42px);
}

.profit-pub-hero-title.is-long h3 {
  font-size: clamp(25px, 2vw, 34px);
}

.profit-pub-period-line,
.profit-group-title-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.profit-published-period-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profit-published-audit-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #66809f;
}

.profit-published-audit-eye:hover {
  background: rgba(255,255,255,.62);
  color: #2f6be5;
}

.profit-pub-hero-profit.is-negative strong,
.profit-pub-hero-profit.is-negative em {
  color: #b84f5a;
}

.profit-pub-hero-profit.is-negative em {
  background: rgba(255, 255, 255, .66);
  border: 1px solid rgba(184, 79, 90, .2);
}

.profit-published-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profit-published-audit-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e9f2;
  border-radius: 10px;
  background: #f8fafc;
}

.profit-published-audit-grid span,
.profit-published-audit-grid strong {
  display: block;
}

.profit-published-audit-grid span {
  color: #748197;
  font-size: 12px;
  font-weight: 800;
}

.profit-published-audit-grid strong {
  margin-top: 6px;
  color: #172033;
  font-size: 15px;
}

.profit-published-audit-help,
.profit-published-audit-note {
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.profit-published-audit-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f5f8fc;
}

.profit-published-audit-note .profit-published-audit-eye {
  width: 24px;
  height: 24px;
}

.profit-group-cost-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.profit-group-cost-toggle span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8eef7;
  color: #58708e;
  font-size: 10px;
}

.profit-group-cost-toggle.active span {
  background: #dceafe;
  color: #2563c9;
}

.profit-group-cost-cell.operating.expanded,
.profit-group-cost-cell.logistics.expanded {
  background: #f5f9ff;
}

.profit-group-cost-breakdown {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  gap: 8px;
}

.profit-group-cost-breakdown span {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #eaf2fd;
}

.profit-group-cost-breakdown small,
.profit-group-cost-breakdown b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .profit-pub-hero-title h3,
  .profit-pub-hero-title.is-medium h3,
  .profit-pub-hero-title.is-long h3 {
    white-space: normal;
    font-size: 28px;
  }

  .profit-published-audit-grid {
    grid-template-columns: 1fr;
  }

  .profit-published-audit-note {
    align-items: flex-start;
  }
}

.profit-group-contribution {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profit-group-contribution span {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.profit-group-contribution i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.profit-group-contribution i.positive {
  background: linear-gradient(90deg, #60a5fa, #22c55e);
}

.profit-group-contribution i.negative {
  background: linear-gradient(90deg, #fb7185, #ef4444);
}

.profit-group-status {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.profit-group-status.profit {
  background: #dcfce7;
  color: #15803d;
}

.profit-group-status.loss {
  background: #fee2e2;
  color: #dc2626;
}

.profit-group-status.flat {
  background: #f1f5f9;
  color: #64748b;
}

.profit-group-sort {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 0 0 20px;
  width: 20px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.profit-group-sort:hover,
.profit-group-sort.active {
  background: #eaf2ff;
  color: #2563eb;
}

.profit-group-sort .tri {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.profit-group-sort .tri.up {
  border-bottom: 6px solid currentColor;
}

.profit-group-sort .tri.down {
  border-top: 6px solid currentColor;
}

.profit-group-sort .tri:not(.on) {
  color: #b6c1d1;
}

.profit-group-th-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.profit-group-th-main > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-group-table th.sticky-col,
.profit-group-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
}

.profit-group-table th.sticky-col {
  z-index: 5;
  background: #f3f7fb;
}

.profit-group-table td.sticky-col {
  background: #fff;
}

.profit-group-table tbody tr:nth-child(even) td.sticky-col {
  background: #f9fbfd;
}

.profit-group-table tbody tr:hover td.sticky-col {
  background: #eff6ff;
}

.profit-group-table tfoot td {
  background: #f8fafc;
  border-top: 1px solid #d8e2ef;
  font-weight: 950;
}

.profit-group-table tfoot td.sticky-col {
  background: #f8fafc;
  z-index: 4;
}

.profit-group-table .sticky-last {
  border-right: 1px solid #ccd7e5;
}

.profit-group-pin {
  width: 28px;
  height: 28px;
}

.profit-group-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.profit-group-widget {
  min-height: 360px;
  padding: 20px;
  overflow: hidden;
}

.profit-group-donut-box {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.85fr);
  align-items: center;
  gap: 16px;
}

.profit-group-donut {
  width: min(260px, 100%);
  margin: 0 auto;
}

.profit-donut-bg {
  fill: none;
  stroke: #edf2f7;
  stroke-width: 12;
}

.profit-donut-segment {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: opacity 0.18s ease, stroke-width 0.18s ease;
}

.profit-donut-segment:hover {
  opacity: 0.78;
  stroke-width: 14;
}

.profit-donut-center b,
.profit-donut-center span {
  display: block;
  text-align: center;
}

.profit-donut-center span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.profit-donut-center b {
  color: #172033;
  font-size: 18px;
  font-weight: 950;
}

.profit-group-donut-legend,
.profit-radar-legend {
  display: grid;
  gap: 10px;
}

.profit-group-donut-legend div,
.profit-radar-legend span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.profit-group-donut-legend i,
.profit-radar-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profit-group-histogram {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  margin-top: 8px;
  overflow: visible;
}

.profit-group-histogram text {
  font-size: 12px;
}

.profit-group-histogram .profit-histogram-bar {
  fill: url("#profitGroupHistogramGradient");
  fill: #60a5fa;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.profit-group-histogram .profit-histogram-bar:hover {
  opacity: 0.82;
  transform: translateY(-2px);
}

.profit-radar-wrap {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(140px, 0.75fr);
  align-items: center;
  gap: 10px;
}

.profit-group-radar {
  width: 100%;
  min-height: 260px;
}

.profit-radar-ring,
.profit-radar-axis {
  fill: none;
  stroke: #dbe7f4;
  stroke-width: 1;
}

.profit-radar-label {
  fill: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.profit-radar-series {
  fill: var(--radar-color);
  fill-opacity: 0.14;
  stroke: var(--radar-color);
  stroke-width: 2;
  transition: fill-opacity 0.18s ease, stroke-width 0.18s ease;
  pointer-events: auto;
}

.profit-radar-series:hover {
  fill-opacity: 0.24;
  stroke-width: 3;
}

.profit-filter-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3f6fb;
  color: #475467;
  font-weight: 800;
}

.profit-filter-notice i {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-style: normal;
}

@media (max-width: 1280px) {
  .profit-pub-overview-grid,
  .profit-pub-rank-cards,
  .profit-product-podium,
  .profit-group-kpi-grid,
  .profit-group-chart-grid {
    grid-template-columns: 1fr;
  }

  .profit-group-donut-box,
  .profit-radar-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .profit-pub-hero {
    grid-template-columns: 1fr;
  }
}

/* Sidebar responsive rules kept last to win over legacy breakpoints. */
@media (min-width: 1200px) {
  body:not(.sidebar-collapsed) {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  body:not(.sidebar-collapsed) .sidebar {
    width: 260px;
  }
}

@media (min-width: 901px) and (max-width: 1199px) {
  body:not(.sidebar-collapsed) {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  body:not(.sidebar-collapsed) .sidebar {
    width: 260px;
  }

  body.sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar.collapsed {
    width: 72px;
    padding: 20px 8px 14px;
  }

  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .sidebar-user,
  .sidebar.collapsed .menu-group-label,
  .sidebar.collapsed .menu-home-label,
  .sidebar.collapsed .menu-chevron,
  .sidebar.collapsed .menu-group-items,
  .sidebar.collapsed .settings-menu span {
    display: none;
  }

  .sidebar.collapsed .menu,
  .sidebar.collapsed .settings-menu-wrap {
    display: flex;
  }

  .sidebar.collapsed .menu {
    flex-direction: column;
    overflow: visible;
  }

  .sidebar.collapsed .menu-group-head,
  .sidebar.collapsed .menu-item,
  .sidebar.collapsed .settings-menu {
    justify-content: center;
    width: 44px;
    min-width: 44px;
    padding: 0;
    margin-inline: auto;
  }
}

@media (max-width: 900px) {
  .sidebar,
  .sidebar.collapsed {
    width: min(260px, 88vw);
    padding: 20px 12px 14px;
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
    box-shadow: 18px 0 48px rgba(15, 23, 42, .18);
  }

  .sidebar:not(.collapsed) .brand-text,
  .sidebar:not(.collapsed) .menu-group-label,
  .sidebar:not(.collapsed) .menu-chevron,
  .sidebar:not(.collapsed) .menu-group-items,
  .sidebar:not(.collapsed) .settings-menu span {
    display: initial;
  }

  .sidebar:not(.collapsed) .menu {
    display: flex;
  }

  .sidebar:not(.collapsed) .settings-menu-wrap {
    display: block;
  }

  .mobile-sidebar-trigger {
    position: fixed;
    z-index: 75;
    left: 14px;
    top: 14px;
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--panel-bg);
    color: var(--text-main);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .1);
  }

  .mobile-sidebar-trigger svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.sidebar-drawer-open .mobile-sidebar-trigger {
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.sidebar-drawer-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .page-head {
    padding-left: 52px;
  }
}
/* Unified permission and account-management surfaces */
.permission-hidden { display: none !important; }
.permission-disabled { cursor: not-allowed !important; opacity: .58; }
.permission-denied-view { min-height: min(68vh, 680px); place-items: center; }
.permission-denied-view.active { display: grid; }
.permission-denied-card { width: min(520px, calc(100vw - 40px)); padding: 52px 42px; text-align: center; background: #fff; border: 1px solid #e3e9f2; border-radius: 20px; }
.permission-denied-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; color: #4774d8; background: #eef4ff; border-radius: 18px; }
.permission-denied-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.permission-denied-card h3 { margin: 0 0 10px; font-size: 24px; color: #182230; }
.permission-denied-card p { margin: 0 0 24px; color: #667085; }
.user-readonly-notice { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; color: #58677c; background: #eef2f7; border-radius: 9px; font-size: 13px; font-weight: 700; }

.user-account-dialog { width: min(1120px, calc(100vw - 40px)); height: min(90vh, 960px); max-width: none; max-height: 90vh; padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(15, 23, 42, .24); }
.user-account-dialog::backdrop { background: rgba(19, 28, 43, .48); backdrop-filter: blur(5px); }
.user-account-panel { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; max-height: none; margin: 0; overflow: hidden; color: #182230; }
#user-form-content { display: flex; flex: 1 1 auto; flex-direction: column; width: 100%; min-height: 0; overflow: hidden; }
.user-account-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 16px 26px; border-bottom: 1px solid #e7ebf1; }
.user-account-header h3 { margin: 0; font-size: 23px; }
.user-account-header p { margin: 3px 0 0; color: #8792a3; font-size: 12px; letter-spacing: .04em; }
.user-account-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: #475467; background: transparent; border: 0; border-radius: 10px; font-size: 27px; font-weight: 300; }
.user-account-close:hover { background: #f1f4f8; }
.user-account-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 20px 24px 30px; background: #f7f9fc; }
.user-account-summary { display: grid; grid-template-columns: auto minmax(220px, 1fr) minmax(280px, .9fr); gap: 20px; align-items: center; padding: 20px 22px; margin-bottom: 14px; background: linear-gradient(135deg, #fff 0%, #f5f8ff 100%); border: 1px solid #e1e7f0; border-radius: 16px; }
.user-account-avatar { width: 76px; height: 76px; font-size: 24px; }
.user-account-identity h4 { margin: 0 0 6px; font-size: 22px; }
.user-account-identity p { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: #667085; }
.user-account-identity p button { width: 26px; height: 26px; padding: 4px; color: #667085; background: transparent; border: 0; }
.user-account-identity p button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.user-account-identity > div { display: flex; gap: 8px; align-items: center; }
.user-account-login-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; padding-left: 22px; border-left: 1px solid #dce3ed; }
.user-account-login-meta div { min-width: 0; }
.user-account-login-meta dt { color: #8a96a8; font-size: 12px; }
.user-account-login-meta dd { margin: 4px 0 0; overflow: hidden; color: #344054; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-account-section { margin-top: 14px; padding: 19px 20px 21px; background: #fff; border: 1px solid #e1e7f0; border-radius: 16px; }
.user-account-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.user-account-section-head h4 { margin: 0; font-size: 17px; }
.user-account-section-head p { margin: 4px 0 0; color: #7a8699; font-size: 12px; }
.user-account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.user-account-fields > label:not(.user-account-toggle), .user-security-grid > label:not(.user-account-toggle) { display: grid; gap: 7px; color: #4a5668; font-size: 13px; font-weight: 650; }
.user-account-fields label > span, .user-security-grid label > span { color: #e04452; }
.user-account-fields input, .user-account-fields textarea, .user-security-grid input { width: 100%; min-height: 42px; padding: 10px 12px; color: #182230; background: #fff; border: 1px solid #d8e0ea; border-radius: 9px; outline: none; }
.user-account-fields input:focus, .user-account-fields textarea:focus, .user-security-grid input:focus { border-color: #7aa1ff; box-shadow: 0 0 0 3px rgba(82, 127, 244, .1); }
.user-account-fields textarea { min-height: 90px; resize: vertical; }
.user-account-fields small { color: #98a2b3; font-weight: 400; }
.user-account-note { grid-row: span 2; }
.user-account-toggle { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 11px 12px; background: #f7f9fc; border: 1px solid #e5eaf1; border-radius: 10px; }
.user-account-toggle input { width: 17px; height: 17px; min-height: 0; margin-top: 2px; accent-color: #3971ed; }
.user-account-toggle span { display: grid; gap: 3px; color: #344054 !important; font-size: 13px; font-weight: 700; }
.user-account-toggle small { color: #8b96a8; font-size: 11px; font-weight: 400; }
.permission-mode-actions { display: flex; align-items: center; gap: 10px; }
.permission-mode-actions strong { color: #526176; font-size: 12px; }
.permission-mode-actions button { min-height: 34px; padding: 0 11px; font-size: 12px; }
.user-role-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.user-role-option { display: flex; align-items: flex-start; gap: 9px; min-height: 78px; padding: 12px; text-align: left; color: #475467; background: #fff; border: 1px solid #dde4ed; border-radius: 12px; }
.user-role-option i { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 4px; background: #91a0b4; border-radius: 50%; }
.user-role-option span { display: grid; gap: 4px; }
.user-role-option strong { color: #253247; }
.user-role-option small { color: #8a95a6; font-size: 10px; line-height: 1.35; }
.user-role-option.active { border-color: #6f91ed; background: #f3f7ff; box-shadow: 0 0 0 2px rgba(73, 116, 231, .08); }
.user-role-option.role-admin i { background: #8a63dd; }.user-role-option.role-operator i { background: #30a66f; }.user-role-option.role-operator_assistant i { background: #2e9ebd; }.user-role-option.role-boss i { background: #d89929; }.user-role-option.role-visitor i { background: #7589a3; }
.permission-role-notice { margin: -3px 0 15px; padding: 10px 12px; color: #6941c6; background: #f4f0ff; border-radius: 9px; font-size: 12px; }
.permission-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.permission-module-card { min-width: 0; padding: 13px; background: #fbfcfe; border: 1px solid #e1e7ef; border-radius: 12px; }
.permission-module-card header { display: flex; align-items: center; gap: 8px; min-height: 27px; margin-bottom: 9px; }
.permission-module-card header > span { display: grid; place-items: center; width: 24px; height: 24px; color: #5277c6; }
.permission-module-card header svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.permission-module-card h5 { flex: 1; margin: 0; color: #26364b; font-size: 13px; }
.permission-module-card header input { width: 16px; height: 16px; accent-color: #3971ed; }
.permission-module-card > div { display: grid; gap: 7px; }
.permission-check { display: flex; align-items: flex-start; gap: 8px; color: #526176; font-size: 12px; line-height: 1.35; }
.permission-check input { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; accent-color: #3971ed; }
.permission-check span { display: grid; gap: 2px; }
.permission-check small { color: #a0a9b7; font-size: 9px; }
.permission-check.is-dependent-disabled { opacity: .46; }
.permission-module-card.system-derived p { margin: 0; color: #667085; font-size: 11px; line-height: 1.55; }
.permission-lock { color: #8b96a8; font-size: 10px; font-style: normal; }
.user-security-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.password-input-line { display: flex; gap: 8px; }.password-input-line input { flex: 1; }.password-input-line button { flex: 0 0 auto; min-width: 88px; }
.reset-password-panel-button { min-height: 42px; justify-self: start; }
.user-account-footer { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 13px 24px; background: rgba(255, 255, 255, .96); border-top: 1px solid #e1e7ef; backdrop-filter: blur(10px); }
.user-account-footer > div { display: flex; gap: 10px; }
.user-account-footer button { min-height: 42px; padding: 0 18px; border-radius: 9px; }
.danger-text { color: #d92d3d; background: transparent; border: 1px solid transparent; }
.danger-text:hover { background: rgba(217, 45, 61, .07); }.danger-text:disabled { opacity: .4; cursor: not-allowed; }
.user-role-badge.assistant { color: #087f9b; background: #e4f7fb; }.user-role-badge.boss { color: #946200; background: #fff3d6; }.user-role-badge.visitor { color: #52657c; background: #edf2f7; }
.square-cards .user-account-dialog, .square-cards .user-account-summary, .square-cards .user-account-section, .square-cards .permission-module-card, .square-cards .user-role-option { border-radius: 0 !important; }
body.card-shadow-enabled .user-account-section, body.card-shadow-enabled .user-account-summary { box-shadow: 0 8px 24px rgba(15, 23, 42, .06); }

@media (max-width: 900px) {
  .user-account-dialog { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .user-account-panel { height: 100%; max-height: none; }
  .user-account-scroll { padding: 14px; }
  .user-account-summary { grid-template-columns: auto 1fr; }
  .user-account-login-meta { grid-column: 1 / -1; padding: 14px 0 0; border-left: 0; border-top: 1px solid #dce3ed; }
  .user-role-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-security-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .user-access-dialog { width: calc(100vw - 20px); }
  .user-access-dialog-card { padding: 22px 18px 16px; }
  .user-dialog-details > div { grid-template-columns: 1fr; gap: 5px; }
  .user-account-fields, .permission-card-grid, .user-role-picker { grid-template-columns: 1fr; }
  .user-account-footer { padding: 10px 14px; }
  .user-account-footer > div:first-child { display: none; }
  .user-account-footer > div:last-child { width: 100%; }.user-account-footer > div:last-child button { flex: 1; }
}
