:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --ink: #1d252d;
  --muted: #66717d;
  --line: #d8dee5;
  --brand: #18344f;
  --brand-2: #3aa4c6;
  --accent: #2f8f5b;
  --auth-primary: #178bb8;
  --auth-primary-dark: #0c6e9c;
  --auth-secondary: #d0761f;
  --sidebar-bg: linear-gradient(180deg, #18344f 0%, #101c27 100%);
  --sidebar-solid: #101c27;
  --sidebar-muted: #9eabb7;
  --topbar-bg: #101c27;
  --warning: #b7791f;
  --danger: #b44444;
  --radius: 8px;
  --shadow: 0 18px 40px rgba(18, 35, 48, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-company="vinland"] {
  --bg: #f6f7f9;
  --surface-soft: #eef2f5;
  --brand: #2f2a63;
  --brand-2: #48b143;
  --accent: #48b143;
  --sidebar-bg: linear-gradient(180deg, #322d63 0%, #090810 100%);
  --sidebar-solid: #171532;
  --sidebar-muted: #b7b3d6;
  --topbar-bg: linear-gradient(90deg, #322d63 0%, #090810 100%);
  --topbar-strip-bg: linear-gradient(90deg, #322d63 0%, #000000 100%);
}

body[data-company="ace"] {
  --bg: #f4f8f8;
  --surface-soft: #eaf3f2;
  --brand: #165f5b;
  --brand-2: #c49a45;
  --accent: #c49a45;
  --sidebar-bg: linear-gradient(180deg, #165f5b 0%, #071514 100%);
  --sidebar-solid: #0f302f;
  --sidebar-muted: #a6c7c4;
  --topbar-bg: linear-gradient(90deg, #071514 0%, #0f302f 48%, #165f5b 100%);
  --topbar-strip-bg: linear-gradient(90deg, #0f302f 0%, #000000 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  display: none;
}

.hidden {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.active-page,
.workspace:not(.hidden),
.tenant-screen:not(.hidden),
.auth-screen:not(.hidden) {
  display: block;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 16% 16%, color-mix(in srgb, var(--auth-primary) 22%, transparent), transparent 28%),
    radial-gradient(circle at 86% 78%, color-mix(in srgb, var(--auth-secondary) 18%, transparent), transparent 30%),
    linear-gradient(135deg, #f4f8fb 0%, #edf3f7 44%, #f7f9fb 100%);
}

.auth-shell {
  background: #fff;
  border: 1px solid rgba(24, 52, 79, 0.08);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(18, 35, 48, 0.16);
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(340px, 0.82fr);
  min-height: 560px;
  overflow: hidden;
  width: min(980px, 100%);
}

.auth-visual {
  background:
    linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 58%, var(--auth-secondary) 140%);
  color: #fff;
  display: grid;
  min-height: 560px;
  overflow: hidden;
  padding: 64px 56px;
  position: relative;
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-visual::before {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  height: 520px;
  left: -180px;
  top: -150px;
  width: 520px;
}

.auth-visual::after {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 58% 0 0 0;
  bottom: -150px;
  height: 300px;
  right: -90px;
  width: 460px;
}

.auth-visual-content {
  align-self: start;
  max-width: 390px;
  position: relative;
  z-index: 2;
}

.auth-visual .eyebrow {
  color: rgba(255, 255, 255, 0.88);
}

.auth-visual h1 {
  font-size: 42px;
  line-height: 1.02;
  margin-bottom: 12px;
}

.auth-visual p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  line-height: 1.45;
}

.reports-art {
  bottom: 70px;
  height: 300px;
  left: 54px;
  opacity: 0.78;
  position: absolute;
  right: 46px;
  z-index: 1;
}

.report-sheet {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(18, 35, 48, 0.12);
  display: grid;
  gap: 10px;
  padding: 18px;
  position: absolute;
}

.sheet-main {
  bottom: 10px;
  height: 220px;
  left: 42px;
  transform: rotate(-5deg);
  width: 260px;
}

.sheet-side {
  bottom: 72px;
  height: 156px;
  right: 20px;
  transform: rotate(6deg);
  width: 180px;
}

.report-sheet span,
.report-sheet strong,
.report-sheet i,
.report-sheet em {
  border-radius: 999px;
  display: block;
}

.report-sheet span {
  background: rgba(24, 52, 79, 0.16);
  height: 12px;
  width: 46%;
}

.report-sheet strong {
  background: linear-gradient(90deg, var(--auth-secondary), color-mix(in srgb, var(--auth-secondary) 58%, white));
  height: 28px;
  width: 68%;
}

.report-sheet i {
  background: rgba(24, 52, 79, 0.11);
  height: 8px;
}

.report-sheet i:nth-of-type(1) {
  width: 88%;
}

.report-sheet i:nth-of-type(2) {
  width: 74%;
}

.report-sheet i:nth-of-type(3) {
  width: 54%;
}

.report-sheet em {
  align-self: end;
  background: linear-gradient(90deg, color-mix(in srgb, var(--auth-primary) 28%, transparent), color-mix(in srgb, var(--auth-secondary) 34%, transparent));
  height: 58px;
}

.report-chart {
  align-items: end;
  background: rgba(24, 52, 79, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  bottom: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  height: 96px;
  padding: 16px;
  position: absolute;
  right: 118px;
  width: 150px;
}

.report-chart span {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px 999px 3px 3px;
}

.report-chart span:nth-child(1) {
  height: 34%;
}

.report-chart span:nth-child(2) {
  height: 66%;
}

.report-chart span:nth-child(3) {
  height: 48%;
}

.report-chart span:nth-child(4) {
  height: 82%;
}

.auth-panel {
  align-content: center;
  background: #fff;
  display: grid;
  gap: 30px;
  padding: 60px 54px;
}

.auth-logo {
  display: block;
  height: auto;
  max-height: 104px;
  max-width: 260px;
  object-fit: contain;
  object-position: left center;
  width: 76%;
}

.auth-heading {
  display: grid;
  gap: 4px;
}

.auth-heading h2 {
  color: var(--auth-primary);
  font-size: 26px;
  line-height: 1.12;
}

.brand-mark {
  width: 56px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  font-weight: 800;
}

.brand-mark.compact {
  width: 38px;
  font-size: 13px;
}

.eyebrow {
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 6px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 18px;
}

.muted,
small {
  color: var(--muted);
}

.system-version {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0.58;
}

.login-form,
.settings-grid {
  display: grid;
  gap: 14px;
}

.auth-panel .login-form {
  gap: 18px;
}

.auth-panel label {
  color: #5f6b76;
  font-size: 12px;
  font-weight: 850;
}

.auth-panel input {
  border: 0;
  border-bottom: 2px solid #d9e3ea;
  border-radius: 0;
  min-height: 46px;
  padding: 8px 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-panel input:focus {
  border-color: var(--auth-secondary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--auth-secondary) 12%, transparent);
  outline: none;
}

.auth-panel .primary-button {
  background: var(--auth-secondary);
  border-radius: 4px;
  box-shadow: 0 16px 28px color-mix(in srgb, var(--auth-secondary) 24%, transparent);
  color: #fff;
  margin-top: 8px;
  min-height: 48px;
  text-transform: uppercase;
}

.auth-panel .text-button {
  color: var(--auth-primary);
  justify-self: center;
}

.auth-owner-signature {
  align-items: center;
  border-top: 1px solid #e7ebef;
  color: #7a858f;
  display: flex;
  font-size: 11px;
  gap: 7px;
  justify-content: center;
  letter-spacing: 0.02em;
  margin-top: -10px;
  padding-top: 18px;
}

.auth-owner-signature img {
  height: 24px;
  object-fit: contain;
  width: 24px;
}

.auth-owner-signature strong {
  color: #18344f;
  font-size: 11px;
  font-weight: 850;
}

.technical-panel {
  margin-top: 18px;
}

.mapping-preview {
  background: color-mix(in srgb, var(--surface-soft) 58%, white);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
}

.mapping-preview pre {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.normalization-overview {
  margin-bottom: 18px;
}

.normalization-source-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.mapping-preview-panel .mapping-preview {
  margin-top: 0;
}

.mapping-field-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
}

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

.mapping-field-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr) 38px;
  gap: 10px;
  align-items: center;
}

.mapping-field-row input {
  min-width: 0;
}

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

.wide-field {
  grid-column: span 2;
}

.theme-editor input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.logo-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.file-picker-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.template-header-actions {
  display: flex;
  gap: 10px;
}

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

.template-summary-card {
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--surface-soft) 52%, #fff));
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: var(--radius);
  display: grid;
  gap: 5px;
  padding: 14px;
}

.template-summary-card span,
.template-summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.template-summary-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.logo-picker .secondary-button {
  min-height: 40px;
}

.theme-preview {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 160px 1fr 140px;
  min-height: 66px;
}

.theme-preview > div {
  display: grid;
  place-items: center;
  font-weight: 850;
}

.theme-preview-sidebar {
  background: var(--theme-preview-sidebar, var(--sidebar-bg));
  color: white;
}

.theme-preview-topbar {
  background: linear-gradient(90deg, var(--theme-preview-topbar-start, #322d63), var(--theme-preview-topbar-end, #090810));
  color: white;
}

.theme-preview-accent {
  background: color-mix(in srgb, var(--theme-preview-accent, var(--accent)) 16%, white);
  color: var(--theme-preview-accent, var(--accent));
}

.font-manager {
  display: grid;
  gap: 14px;
}

.font-manager-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.font-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.font-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 10%, white);
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.font-item strong,
.font-item small {
  display: block;
}

.font-item small {
  margin-top: 4px;
  color: var(--muted);
}

.danger-text {
  color: #b42318;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  min-height: 40px;
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button,
.switch-tenant,
.nav-item {
  border: 0;
  border-radius: 6px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: white;
}

.secondary-button {
  background: var(--surface-soft);
  color: var(--brand);
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.ghost-button,
.text-button,
.icon-button {
  background: transparent;
  color: var(--brand);
  font-weight: 800;
}

.table-action {
  background: color-mix(in srgb, var(--brand) 8%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  min-height: 30px;
  padding: 0 10px;
}

.table-action:hover {
  background: color-mix(in srgb, var(--brand-2) 14%, #ffffff);
}

.button-icon {
  width: 22px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.simple-header {
  height: 72px;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header-logo {
  background: #3aa4c6;
  border-radius: 7px;
  height: 38px;
  object-fit: contain;
  padding: 7px;
  width: 38px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup small {
  display: block;
}

.tenant-screen {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(24, 52, 79, 0.04), rgba(244, 246, 248, 0) 230px),
    var(--bg);
}

.tenant-home {
  width: min(1240px, calc(100% - 48px));
  margin: 54px auto 0;
  display: grid;
  gap: 18px;
}

.tenant-hero {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 0 26px;
}

.tenant-hero h1 {
  color: var(--ink);
  font-size: 36px;
  line-height: 1.05;
  max-width: 720px;
}

.tenant-hero .muted {
  margin-top: 10px;
  max-width: 640px;
}

.tenant-hero-actions {
  display: flex;
  gap: 10px;
}

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

.tenant-overview article {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  min-height: 110px;
  padding: 18px;
}

.tenant-overview span,
.tenant-overview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tenant-overview strong {
  color: var(--brand);
  font-size: 34px;
  line-height: 1;
}

.tenant-revenue-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.tenant-revenue-list {
  display: grid;
  gap: 0;
}

.tenant-revenue-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 0;
}

.tenant-revenue-row:first-child {
  border-top: 0;
}

.tenant-revenue-row strong,
.tenant-revenue-row small {
  display: block;
}

.tenant-revenue-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 3px;
}

.tenant-revenue-row b {
  color: var(--brand);
  font-size: 18px;
  white-space: nowrap;
}

.tenant-revenue-row.inactive {
  opacity: 0.68;
}

.tenant-revenue-row.inactive b {
  color: var(--muted);
}

.tenant-revenue-row.total {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 10px;
  padding: 14px;
}

.tenant-revenue-row.total b {
  font-size: 22px;
}

.tenant-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.tenant-panel .panel-header input {
  max-width: 280px;
}

.client-modal {
  display: grid;
  inset: 0;
  padding: 24px;
  place-items: center;
  position: fixed;
  z-index: 50;
}

.client-modal-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(16, 28, 39, 0.28);
  display: grid;
  gap: 16px;
  max-width: calc(100vw - 48px);
  padding: 22px;
  position: relative;
  width: min(760px, 100%);
  z-index: 1;
}

.client-modal-panel.compact-modal {
  width: min(460px, 100%);
}

.client-modal-panel .drawer-actions {
  margin-top: 4px;
}

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.admin-client-grid {
  margin: 0;
  width: 100%;
}

.tenant-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 188px;
  padding: 18px;
  display: grid;
  gap: 16px;
  text-align: left;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(18, 35, 48, 0.06);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tenant-card:hover {
  border-color: color-mix(in srgb, var(--brand-2) 58%, var(--line));
  box-shadow: 0 18px 38px rgba(18, 35, 48, 0.11);
  transform: translateY(-2px);
}

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

.tenant-card-main {
  justify-content: flex-start;
}

.tenant-card strong,
.tenant-card small {
  display: block;
}

.tenant-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.tenant-card-footer b {
  color: var(--brand);
  font-size: 13px;
}

.tenant-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tenant-card-actions .text-button {
  font-size: 12px;
  min-height: 32px;
  padding: 0 4px;
}

.tenant-progress {
  background: var(--surface-soft);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.tenant-progress i {
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.tenant-logo {
  width: 54px;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: white;
}

.tenant-logo.vinland {
  background: #2f2a63;
}

.tenant-logo.ace {
  background: #165f5b;
}

.workspace {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  background: var(--sidebar-bg);
  color: white;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: width 0.2s ease, padding 0.2s ease;
}

.sidebar small,
.sidebar .muted {
  color: var(--sidebar-muted);
}

.sidebar-brand {
  padding-bottom: 40px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  min-height: 83px;
}

.sidebar-brand strong {
  font-size: 25px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar-brand small {
  color: #5cc8f4;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.sidebar-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: contain;
}

.sidebar-toggle {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  width: 18px;
  height: 36px;
  min-height: 36px;
  position: absolute;
  top: 50%;
  right: -18px;
  background: var(--sidebar-solid, var(--sidebar-bg));
  color: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 800;
  box-shadow: 6px 0 14px rgba(0, 0, 0, 0.16);
  z-index: 4;
  transform: translateY(-50%);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-toggle:hover {
  border-color: rgba(92, 200, 244, 0.55);
  background: rgba(50, 45, 99, 0.98);
  color: white;
}

.sidebar-toggle .nav-icon {
  width: 15px;
  height: 15px;
  transition: transform 0.16s ease;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-section-label {
  color: rgba(139, 207, 242, 0.78);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 18px 12px 6px;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-item {
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 12px 14px;
  text-align: left;
  font-size: 16px;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  position: relative;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.nav-item.active .nav-icon {
  color: var(--brand-2);
}

.switch-tenant {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  padding: 12px 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.content-shell {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

body.sidebar-collapsed .sidebar {
  width: 82px;
  padding-left: 14px;
  padding-right: 14px;
}

body.sidebar-collapsed .content-shell {
  margin-left: 82px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-section-label {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle,
body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .switch-tenant {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .sidebar-toggle {
  right: -18px;
  transform: translateY(-50%);
}

body.sidebar-collapsed .sidebar-toggle .nav-icon {
  transform: rotate(180deg);
}

body.sidebar-collapsed .nav-item:hover {
  transform: none;
}

body.sidebar-collapsed .nav-icon {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  stroke-width: 2;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .switch-tenant {
  min-height: 58px;
}

body.sidebar-collapsed .sidebar-toggle .nav-icon {
  width: 15px;
  height: 15px;
}

body.sidebar-collapsed .nav-item::after,
body.sidebar-collapsed .switch-tenant::after {
  background: #090810;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  color: white;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 850;
  left: calc(100% + 14px);
  line-height: 1;
  opacity: 0;
  padding: 9px 10px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
  z-index: 30;
}

body.sidebar-collapsed .nav-item::before,
body.sidebar-collapsed .switch-tenant::before {
  border-bottom: 6px solid transparent;
  border-right: 6px solid #090810;
  border-top: 6px solid transparent;
  content: "";
  left: calc(100% + 8px);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 31;
}

body.sidebar-collapsed .nav-item:hover::after,
body.sidebar-collapsed .nav-item:hover::before,
body.sidebar-collapsed .switch-tenant:hover::after,
body.sidebar-collapsed .switch-tenant:hover::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.topbar {
  height: 146px;
  padding: 0 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 110px 36px;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  background: var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: var(--topbar-strip-bg, var(--topbar-bg));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.tenant-top-logo {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.topbar-divider {
  width: 1px;
  height: 86px;
  background: rgba(255, 255, 255, 0.16);
}

.topbar-heading {
  display: grid;
  align-content: center;
  min-height: 86px;
}

.topbar-heading .eyebrow {
  color: white;
  font-size: 21px;
  line-height: 1;
  margin-bottom: 8px;
}

.topbar-heading h2 {
  color: white;
  font-size: 24px;
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.topbar .eyebrow,
.topbar h2,
.topbar small,
.topbar label {
  color: white;
}

.topbar .secondary-button,
.topbar .primary-button,
.topbar select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: white;
  min-height: 40px;
}

.topbar .primary-button {
  background: rgba(255, 255, 255, 0.12);
}

.topbar select option {
  color: var(--ink);
}

.period-select {
  min-width: 180px;
  gap: 6px;
  line-height: 1;
}

.period-select select {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

.topbar .primary-button,
.topbar .secondary-button {
  height: 40px;
  min-height: 40px;
}

@media (max-width: 1180px) {
  .topbar {
    height: 184px;
    grid-template-columns: 1fr;
    grid-template-rows: 98px 50px 36px;
    gap: 0;
    padding: 0 32px;
  }

  .topbar-title {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-actions {
    align-items: center;
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-end;
  }

  .topbar-divider {
    height: 70px;
  }

  .topbar-heading {
    min-height: 70px;
  }
}

.page {
  padding: 28px 32px 48px;
}

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

.compact-metrics .metric-card strong {
  font-size: 26px;
}

.metric-card,
.panel,
.template-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card {
  padding: 18px;
  display: grid;
  gap: 6px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: 30px;
}

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

.monthly-pipeline article {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--surface-soft) 58%, #ffffff));
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
}

.monthly-pipeline span {
  align-items: center;
  background: var(--brand);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.monthly-pipeline strong,
.monthly-pipeline small {
  display: block;
}

.monthly-pipeline small {
  color: var(--muted);
  margin-top: 3px;
}

.plan-card {
  border-left: 4px solid var(--brand-2);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.management-chart-panel {
  min-width: 0;
}

.management-chart {
  min-height: 294px;
  overflow: hidden;
}

.management-chart.compact {
  min-height: 224px;
}

.management-chart svg {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.management-grid-line {
  stroke: #d8dee3;
  stroke-dasharray: 6 6;
  stroke-width: 1;
}

.management-zero-line {
  stroke: #9aa8b2;
  stroke-width: 1.2;
}

.management-month-guide {
  stroke: #edf1f4;
  stroke-width: 1;
}

.management-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.management-line.average {
  stroke: var(--brand);
}

.management-line.median {
  stroke: var(--brand-2);
  opacity: 0.78;
}

.management-line.fund {
  stroke: var(--brand);
}

.management-line.benchmark {
  stroke: var(--brand-2);
}

.management-point {
  cursor: help;
  fill: var(--brand);
  stroke: #fff;
  stroke-width: 2;
}

.management-point.fund {
  fill: var(--brand);
}

.management-point.median {
  fill: var(--brand-2);
}

.management-point.benchmark {
  fill: var(--brand-2);
}

.management-axis,
.management-month-label {
  fill: var(--muted);
  font-size: 12px;
}

.management-month-label {
  text-anchor: middle;
}

.management-legend,
.management-ranking {
  display: grid;
  gap: 10px;
}

.management-legend {
  grid-template-columns: repeat(2, max-content);
  margin-top: 10px;
}

.management-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  gap: 7px;
}

.management-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 4px;
  width: 26px;
}

.management-legend i.average {
  background: var(--brand);
}

.management-legend i.median {
  background: var(--brand-2);
}

.management-legend i.fund {
  background: var(--brand);
}

.management-legend i.benchmark {
  background: var(--brand-2);
}

.management-fund-history {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.management-fund-history-head {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.management-fund-history-head strong,
.management-fund-history-head small {
  display: block;
}

.management-fund-history-head small {
  color: var(--muted);
  margin-top: 3px;
}

.management-fund-history-head select {
  max-width: 360px;
  min-width: 260px;
}

.management-select-control {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    color-mix(in srgb, var(--brand) 5%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(18, 35, 48, 0.06);
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 7px 38px 7px 12px;
  position: relative;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.management-select-control::after {
  border-bottom: 2px solid var(--brand);
  border-right: 2px solid var(--brand);
  content: "";
  height: 8px;
  pointer-events: none;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-65%) rotate(45deg);
  width: 8px;
}

.management-select-control:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  box-shadow: 0 16px 30px rgba(18, 35, 48, 0.09);
  transform: translateY(-1px);
}

.management-select-control:focus-within {
  border-color: var(--brand-2);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent),
    0 16px 30px rgba(18, 35, 48, 0.1);
}

.management-select-control span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.management-select-control select {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.management-select-ui {
  min-width: 0;
  position: relative;
}

.management-select-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  display: flex;
  font-size: 14px;
  font-weight: 850;
  justify-content: space-between;
  line-height: 1.25;
  min-height: 22px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.management-select-button b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-select-menu {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 8px;
  box-shadow: 0 22px 50px rgba(12, 25, 35, 0.18);
  display: none;
  left: -13px;
  max-height: 294px;
  min-width: calc(100% + 51px);
  overflow: auto;
  padding: 6px;
  position: absolute;
  top: calc(100% + 14px);
  z-index: 70;
}

.management-select-control.open .management-select-menu {
  display: grid;
  gap: 3px;
}

.management-select-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  justify-content: space-between;
  line-height: 1.25;
  min-height: 34px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.management-select-option:hover,
.management-select-option.active {
  background: color-mix(in srgb, var(--brand-2) 14%, #ffffff);
  color: var(--brand);
}

.management-select-option.active::after {
  background: var(--brand-2);
  border-radius: 999px;
  content: "";
  flex: 0 0 auto;
  height: 8px;
  margin-left: 12px;
  width: 8px;
}

.management-select-control.compact {
  width: 220px;
}

.management-select-control.wide {
  width: min(420px, 48vw);
}

.management-readout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.management-readout.quiet {
  border-left-color: var(--line);
}

.management-readout.company-readout {
  background: color-mix(in srgb, var(--brand-2) 7%, #ffffff);
  border-left-color: var(--brand);
}

.management-readout span,
.management-readout small {
  color: var(--muted);
  font-size: 13px;
}

.management-readout strong {
  color: var(--ink);
  line-height: 1.25;
}

.management-fund-breakdown {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  margin-top: 2px;
  max-height: 320px;
  overflow: auto;
}

.management-section-title,
.management-fund-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.management-section-title {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}

.management-section-title small {
  color: var(--muted);
}

.management-fund-row {
  border-bottom: 1px solid var(--line);
  min-height: 38px;
}

.management-fund-row:last-child {
  border-bottom: 0;
}

.management-fund-row span {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-width: 0;
}

.management-fund-row span b {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.management-fund-row strong {
  color: var(--brand);
  flex: 0 0 auto;
}

.management-fund-row.negative strong {
  color: #9f3434;
}

.chart-tooltip {
  background: rgba(20, 37, 33, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(4, 12, 18, 0.22);
  color: #fff;
  display: grid;
  gap: 3px;
  left: 0;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translateZ(0);
  z-index: 80;
}

.chart-tooltip strong {
  color: var(--brand-2);
  font-size: 12px;
  line-height: 1.25;
}

.chart-tooltip span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.25;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-action {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: left;
}

.quick-action:hover {
  border-color: var(--brand-2);
  box-shadow: 0 10px 24px rgba(18, 35, 48, 0.08);
}

.quick-action.static {
  cursor: default;
}

.quick-action.static:hover {
  border-color: var(--line);
  box-shadow: none;
}

.quick-action strong {
  color: var(--brand);
}

.quick-action small {
  line-height: 1.35;
}

.workflow-panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 5%, white), white 180px),
    var(--surface);
  box-shadow: 0 18px 42px rgba(18, 35, 48, 0.06);
  display: grid;
  gap: 22px;
  padding: 22px;
}

.workflow-steps {
  background: color-mix(in srgb, var(--surface-soft) 58%, white);
  border: 1px solid color-mix(in srgb, var(--line) 78%, white);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px;
}

.workflow-step {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  font-weight: 850;
  position: relative;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.workflow-step span {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--line) 70%, white);
  border-radius: 999px;
  color: var(--brand);
  display: grid;
  font-size: 12px;
  height: 22px;
  place-items: center;
  width: 22px;
}

.workflow-step.active {
  background: var(--brand);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 22%, transparent);
  color: #fff;
}

.workflow-step.active span {
  border-color: transparent;
}

.workflow-stage {
  display: none;
}

.workflow-stage.active-stage {
  display: grid;
  gap: 18px;
}

.stage-copy {
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.stage-copy h3 {
  font-size: 22px;
}

.compact-dropzone {
  min-height: 128px;
}

.stage-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
}

.stage-actions-top {
  border-bottom: 1px solid var(--line);
  border-top: 0;
  margin-top: -4px;
  padding-bottom: 14px;
  padding-top: 0;
}

.workflow-tools {
  justify-content: flex-start;
}

.text-tools {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.export-tools {
  align-items: center;
}

.export-console {
  background: color-mix(in srgb, var(--surface-soft) 62%, white);
  border: 1px solid color-mix(in srgb, var(--line) 78%, white);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.export-settings {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 180px);
}

.export-run-actions {
  display: flex;
  gap: 10px;
}

.export-run-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  padding-top: 14px;
}

.export-inline-progress {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(280px, 1fr) auto;
  padding-top: 12px;
}

.export-progress-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.export-progress-main > strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}

.export-progress-namebar {
  background: color-mix(in srgb, var(--surface-soft) 82%, white);
  border-radius: 4px;
  height: 27px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.export-progress-namebar span {
  color: #fff;
  display: block;
  font-size: 15px;
  font-weight: 850;
  line-height: 27px;
  min-width: 0;
  overflow: hidden;
  padding: 0 10px;
  position: relative;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
}

.export-progress-fill {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 4px;
  height: 100%;
  left: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  transition: width 0.28s ease;
  width: 0%;
}

.export-progress-fill::after {
  animation: progress-shine 1.15s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.export-progress-numbers {
  align-items: end;
  color: var(--muted);
  display: grid;
  gap: 0;
  justify-items: start;
  min-width: 72px;
}

.export-progress-numbers span {
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

.export-progress-numbers strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 0.95;
}

.export-result-banner {
  align-items: center;
  background: color-mix(in srgb, var(--accent) 11%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-left: 5px solid var(--accent);
  border-radius: 7px;
  color: var(--ink);
  display: flex;
  gap: 12px;
  padding: 12px 14px;
}

.export-result-banner.warn {
  background: color-mix(in srgb, var(--warning) 12%, white);
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  border-left-color: var(--warning);
}

.export-result-banner span {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  letter-spacing: 0;
  min-width: 30px;
}

.export-result-banner.warn span {
  background: var(--warning);
}

.export-result-banner strong,
.export-result-banner small {
  display: block;
}

.export-result-banner strong {
  font-size: 16px;
}

.export-result-banner small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  margin-top: 2px;
}

.export-status {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.workflow-list {
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 10px;
  overflow: visible;
  padding: 0;
  background: transparent;
}

.empty-state {
  padding: 16px;
}

.workflow-row {
  align-items: center;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--line) 76%, white);
  border-radius: 7px;
  border-left: 4px solid transparent;
  box-shadow: 0 8px 22px rgba(18, 35, 48, 0.045);
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 62px;
  padding: 14px 16px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

label.workflow-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.workflow-row:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, white);
}

.workflow-row:hover {
  border-color: color-mix(in srgb, var(--brand-2) 42%, var(--line));
  box-shadow: 0 14px 30px rgba(18, 35, 48, 0.08);
  transform: translateY(-1px);
}

.workflow-row.selectable-row {
  cursor: pointer;
}

.workflow-row.selected-row {
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand-2) 8%, white), #fff 36%);
  border-color: color-mix(in srgb, var(--brand-2) 48%, var(--line));
  border-left: 4px solid var(--brand-2);
}

.workflow-row.generated-row {
  border-left-color: var(--accent);
}

.workflow-row.generated-row .badge.ready {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.workflow-row.needs-summary-row {
  border-left-color: #b7791f;
}

.workflow-row input {
  min-height: auto;
  width: 18px;
}

.workflow-row strong,
.workflow-row small {
  display: block;
}

.workflow-row small {
  margin-top: 3px;
}

.workflow-row.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.workflow-stage[data-generate-panel="export"] .workflow-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.workflow-stage[data-generate-panel="export"] .workflow-row .badge {
  min-width: 120px;
  text-align: center;
}

.production-hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hero-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.system-notice {
  align-items: center;
  background: #fff3da;
  border: 1px solid #f0cf92;
  border-radius: 6px;
  color: #7a4b00;
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.system-notice span {
  font-size: 13px;
}

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

.production-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.9fr) auto auto;
  padding: 14px;
}

.production-card:not(.disabled) {
  border-left-color: var(--brand-2);
}

.production-card.disabled {
  opacity: 0.64;
}

.production-card strong,
.production-card small {
  display: block;
}

.production-card small {
  margin-top: 3px;
}

.production-flow {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}

.flow-step.done {
  background: #e3f5eb;
  color: var(--accent);
}

.flow-step.active {
  background: #eaf4f7;
  color: #22718a;
}

.flow-step.muted-step {
  color: #9aa4ad;
}

.editor-workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 1.22fr);
  align-items: start;
}

.workflow-stage[data-generate-panel="text"] .editor-workspace {
  min-height: min(680px, calc(100vh - 220px));
}

.workflow-stage[data-generate-panel="text"] #workflow-text-list {
  align-content: start;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 6px;
}

.workflow-stage[data-generate-panel="text"] #workflow-text-list::-webkit-scrollbar,
.workflow-stage[data-generate-panel="text"] #workflow-report-simulation::-webkit-scrollbar {
  width: 8px;
}

.workflow-stage[data-generate-panel="text"] #workflow-text-list::-webkit-scrollbar-track,
.workflow-stage[data-generate-panel="text"] #workflow-report-simulation::-webkit-scrollbar-track {
  background: var(--surface-soft);
  border-radius: 999px;
}

.workflow-stage[data-generate-panel="text"] #workflow-text-list::-webkit-scrollbar-thumb,
.workflow-stage[data-generate-panel="text"] #workflow-report-simulation::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 34%, var(--line));
  border-radius: 999px;
}

.report-simulation {
  background: #fbfbfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 460px;
  padding: 18px;
}

.workflow-stage[data-generate-panel="text"] #workflow-report-simulation {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  position: sticky;
  top: 14px;
}

.simulation-slide {
  display: grid;
  gap: 14px;
}

.simulation-topline {
  background: var(--brand-2);
  height: 5px;
}

.simulation-slide h3 {
  color: #45a33a;
  text-align: center;
}

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

.simulation-grid article {
  background: linear-gradient(180deg, #f0f2f4 0 50%, #fff 50% 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
}

.simulation-grid span,
.simulation-chart span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.simulation-grid strong {
  font-size: 16px;
}

.simulation-chart {
  align-items: center;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, #d8dee5 40px),
    linear-gradient(135deg, rgba(24, 52, 79, 0.08), rgba(58, 164, 198, 0.08));
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  justify-content: center;
  min-height: 140px;
}

.real-chart {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 150px;
  min-height: 170px;
  padding: 12px;
}

.real-chart svg {
  height: 150px;
  width: 100%;
}

.real-chart line {
  stroke: #c7cdd4;
  stroke-dasharray: 4 4;
  stroke-width: 0.7;
}

.real-chart polyline {
  fill: none;
  stroke: #0d347f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.real-chart div {
  align-self: center;
  display: grid;
  gap: 4px;
}

.real-chart strong {
  color: #45a33a;
  font-size: 16px;
}

.simulation-preview-sections {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simulation-preview-sections h4 {
  color: #45a33a;
  margin-bottom: 8px;
}

.simulation-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.simulation-table th {
  background: var(--brand);
  color: #fff;
  font-weight: 850;
  text-align: left;
}

.simulation-table th,
.simulation-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px;
}

.simulation-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.uploaded-comment-editor {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.inline-actions {
  border-top: 0;
  justify-content: flex-start;
  padding-top: 0;
}

.panel {
  padding: 18px;
}

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

.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-tools input,
.table-tools select {
  min-width: 170px;
}

.inline-select,
.inline-number {
  min-height: 32px;
  padding: 6px 8px;
}

.inline-number {
  display: inline-block;
  margin-left: 4px;
  width: 72px;
}

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

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

.history-month-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
}

.history-month-grid::-webkit-scrollbar {
  height: 8px;
}

.history-month-grid::-webkit-scrollbar-track {
  background: var(--surface-soft);
  border-radius: 999px;
}

.history-month-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 34%, var(--line));
  border-radius: 999px;
}

.history-month-card {
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--surface-soft) 52%, #fff));
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-2);
  border-radius: var(--radius);
  color: var(--ink);
  display: grid;
  flex: 0 0 152px;
  gap: 5px;
  min-height: 134px;
  padding: 11px;
  scroll-snap-align: start;
  text-align: left;
}

.history-month-card:hover,
.history-month-card.active {
  border-color: color-mix(in srgb, var(--brand-2) 62%, var(--line));
  border-top-color: var(--brand-2);
  box-shadow: 0 12px 28px rgba(18, 35, 48, 0.08);
}

.history-month-card.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 10%, white), #fff);
}

.history-month-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.history-month-card strong {
  font-size: 22px;
  line-height: 1;
}

.history-month-card small {
  color: var(--muted);
}

.history-month-stats {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
}

.history-month-stats span {
  color: var(--muted);
  display: flex;
  font-size: 10.5px;
  justify-content: space-between;
}

.history-month-stats b {
  color: var(--ink);
}

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

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

.history-report-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1.2fr) minmax(320px, 1fr) minmax(220px, auto) auto;
  padding: 14px 16px;
}

.history-report-card strong,
.history-report-card small {
  display: block;
}

.history-report-main strong {
  line-height: 1.25;
}

.history-report-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-report-meta small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.history-report-meta strong {
  color: var(--ink);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-report-files,
.publication-files {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-report-status {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.file-chip {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  min-height: 24px;
  padding: 5px 10px;
  text-decoration: none;
}

.file-chip.ready {
  background: #ddf4e7;
  color: #239155;
}

.file-chip.draft {
  background: #edf2f6;
  color: var(--muted);
}

.pending-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.pending-summary-card {
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--surface-soft) 55%, white));
  border: 1px solid var(--line);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  display: grid;
  gap: 5px;
  padding: 14px;
}

.pending-summary-card.empty {
  border-left-color: var(--line);
  opacity: 0.72;
}

.pending-summary-card span,
.pending-summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.pending-summary-card strong {
  font-size: 28px;
  line-height: 1;
}

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

.pending-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) max-content max-content max-content;
  padding: 14px 16px;
}

.pending-card .text-button {
  white-space: nowrap;
}

.pending-card.priority-critical {
  border-left-color: var(--danger);
}

.pending-card.priority-attention {
  border-left-color: var(--warning);
}

.pending-card.priority-routine {
  border-left-color: var(--brand-2);
}

.pending-card strong,
.pending-card small {
  display: block;
}

.pending-card small {
  color: var(--muted);
  margin-top: 3px;
}

.pending-priority {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 4px 9px;
  white-space: nowrap;
}

.priority-critical .pending-priority {
  background: #fde8e8;
  color: var(--danger);
}

.priority-attention .pending-priority {
  background: #fff3da;
  color: var(--warning);
}

.priority-routine .pending-priority {
  background: #eaf4f7;
  color: #22718a;
}

.status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.status.ready,
.badge.ready {
  background: #e3f5eb;
  color: var(--accent);
}

.status.ready {
  background: var(--accent);
}

.status.draft {
  background: var(--brand-2);
}

.status.warn {
  background: var(--warning);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
}

.badge.draft {
  background: #eaf4f7;
  color: #22718a;
}

.badge.warn {
  background: #fff3da;
  color: var(--warning);
}

.badge.danger {
  background: #fde8e8;
  color: var(--danger);
}

.publication-hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.deadline-box {
  background: var(--surface-soft);
  border-radius: 6px;
  min-width: 150px;
  padding: 14px;
  text-align: center;
}

.deadline-box span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
}

.deadline-box strong {
  color: var(--accent);
  display: block;
  font-size: 34px;
}

.deadline-box.late strong {
  color: var(--danger);
}

.pill {
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.slide-preview {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  background: #fbfbfb;
  display: grid;
  grid-template-rows: 6px auto 1fr 42px;
  gap: 14px;
}

.slide-topline {
  background: var(--brand-2);
}

.slide-title {
  text-align: center;
  color: #45a33a;
  font-size: 20px;
  font-weight: 800;
}

.slide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.slide-grid div,
.slide-table {
  background: linear-gradient(#eceff2 50%, #fff 50%);
  background-size: 100% 18px;
  border-radius: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.table-subtext {
  display: block;
  margin-top: 3px;
}

.segmented {
  display: inline-flex;
  background: var(--surface-soft);
  border-radius: 6px;
  padding: 3px;
}

.segmented button {
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: var(--surface);
  color: var(--brand);
}

.import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  align-items: start;
}

.dropzone {
  background: color-mix(in srgb, var(--brand-2) 8%, white);
  min-height: 170px;
  border: 1px dashed color-mix(in srgb, var(--brand-2) 70%, white);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  background: color-mix(in srgb, var(--brand-2) 14%, white);
  border-color: color-mix(in srgb, var(--brand-2) 86%, #155d2f);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-2) 22%, transparent);
}

.dropzone.is-dragover {
  background: color-mix(in srgb, var(--brand-2) 22%, white);
  border-color: color-mix(in srgb, var(--brand-2) 78%, #0d5727);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-2) 34%, transparent), 0 12px 28px rgba(18, 35, 48, 0.08);
  transform: translateY(-1px);
}

.dropzone.is-uploading {
  background: #f4f8fa;
  border-color: var(--brand);
  cursor: progress;
}

.dropzone input {
  display: none;
}

.dropzone small:not(#workflow-drop-hint) {
  display: none;
}

#workflow-drop-hint {
  color: var(--muted);
  font-weight: 750;
}

.upload-icon {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 900;
}

.validation-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.validation-list div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 750;
}

.imported-files {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  overflow: hidden;
}

.imported-files-header,
.imported-file-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.imported-files-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.imported-files-header span,
.imported-file-row small {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 3px;
}

.imported-file-row .imported-file-template {
  color: var(--brand);
  font-weight: 850;
}

.imported-file-list {
  display: grid;
}

.imported-file-row {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.imported-file-row:last-child {
  border-bottom: 0;
}

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

.template-card {
  min-height: 130px;
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.template-card:hover,
.template-card.selected-card {
  border-color: color-mix(in srgb, var(--brand-2) 55%, var(--line));
  box-shadow: 0 12px 28px rgba(18, 35, 48, 0.08);
}

.template-card.selected-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 8%, white), #fff);
}

.template-card.ready-card {
  border-left: 4px solid var(--accent);
}

.template-card-meta {
  background: var(--surface-soft);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.template-card-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-card-meta strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card-action {
  background: color-mix(in srgb, var(--brand-2) 12%, white);
  border: 1px solid color-mix(in srgb, var(--brand-2) 38%, var(--line));
  border-radius: 6px;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  min-height: 34px;
  padding: 8px 10px;
  text-align: center;
}

.template-card-action:hover {
  background: color-mix(in srgb, var(--brand-2) 20%, white);
  border-color: color-mix(in srgb, var(--brand-2) 62%, var(--line));
}

.template-card .template-path {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.admin-setup-grid {
  align-items: start;
  margin-bottom: 18px;
}

.admin-context-bar {
  align-items: center;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--brand-2) 13%, white), #fff 62%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand-2) 34%, var(--line));
  border-left: 5px solid var(--brand-2);
  border-radius: var(--radius);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.admin-context-bar h3 {
  color: var(--brand);
  font-size: 28px;
  line-height: 1;
}

.admin-context-bar small {
  display: block;
  margin-top: 7px;
}

.compact-form-grid {
  margin-top: 0;
}

.form-status {
  margin-top: 14px;
}

.form-status.success {
  color: var(--accent);
  font-weight: 800;
}

.form-status.error {
  color: var(--danger);
  font-weight: 800;
}

.progress-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.progress-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 8, 16, 0.48);
  backdrop-filter: blur(4px);
}

.progress-panel {
  position: relative;
  width: min(480px, 100%);
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(9, 8, 16, 0.28);
  display: grid;
  gap: 16px;
  padding: 24px;
}

.progress-heading {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.progress-heading h3 {
  margin-top: 3px;
}

.progress-heading > strong {
  color: var(--brand);
  font-size: 34px;
  line-height: 1;
}

.progress-track {
  background: var(--surface-soft);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  border-radius: inherit;
  height: 100%;
  overflow: hidden;
  position: relative;
  transition: width 0.28s ease;
  width: 0%;
}

.progress-fill::after {
  animation: progress-shine 1.15s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.progress-meta {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.progress-meta strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.progress-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

@keyframes progress-shine {
  to {
    transform: translateX(100%);
  }
}

.preview-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 39, 0.28);
}

.drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(620px, 100%);
  background: var(--surface);
  box-shadow: -24px 0 45px rgba(18, 35, 48, 0.18);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: auto;
}

.package-panel {
  width: min(760px, 100%);
}

.drawer-header,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-actions {
  margin-top: auto;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.preview-summary article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.preview-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-summary strong {
  font-size: 19px;
}

.workflow-strip {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.package-summary strong {
  font-size: 22px;
}

.package-tools {
  align-items: stretch;
  margin-bottom: 4px;
}

.package-tools input {
  flex: 1;
}

.package-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  max-height: 58vh;
  overflow: auto;
}

.package-fund-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  font-size: 14px;
  font-weight: 600;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px;
}

.package-fund-row:last-child {
  border-bottom: 0;
}

.package-fund-row:hover {
  background: var(--surface-soft);
}

.package-fund-row input {
  min-height: auto;
  width: 18px;
}

.package-fund-row strong,
.package-fund-row small {
  display: block;
}

.package-fund-row small {
  margin-top: 3px;
}

.package-fund-row.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section h4 {
  margin: 0;
  font-size: 14px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-counter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.comment-counter.over-limit {
  color: var(--warning);
}

.comment-alert {
  align-items: center;
  background: #fff3da;
  border: 1px solid #f0cf92;
  border-radius: 6px;
  color: #7a4b00;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.comment-alert span {
  font-size: 13px;
  font-weight: 750;
}

.comment-mode {
  font-size: 12px;
}

.mini-table {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.mini-table div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.mini-table div:nth-child(odd) {
  background: var(--surface-soft);
}

.mini-table div:last-child {
  border-bottom: 0;
}

@media (max-width: 980px) {
  .auth-screen {
    padding: 24px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    width: min(560px, 100%);
  }

  .auth-visual {
    min-height: 300px;
    padding: 36px;
  }

  .auth-visual h1 {
    font-size: 34px;
  }

  .reports-art {
    bottom: 20px;
    left: auto;
    opacity: 0.42;
    right: 18px;
    transform: scale(0.72);
    transform-origin: bottom right;
    width: 380px;
  }

  .auth-panel {
    padding: 40px 36px;
  }

  .sidebar {
    position: static;
    width: auto;
  }

  .content-shell {
    margin-left: 0;
  }

  .metric-grid,
  .monthly-pipeline,
  .pending-summary-grid,
  .tenant-overview,
  .template-summary-grid,
  .template-grid,
  .tenant-grid,
  .two-column,
  .editor-workspace,
  .production-card,
  .import-panel,
  .settings-grid,
  .theme-editor,
  .theme-preview,
  .export-settings,
  .export-inline-progress,
  .history-report-card,
  .normalization-layout,
  .normalization-source-form,
  .mapping-field-row,
  .pending-card {
    grid-template-columns: 1fr;
  }

  .workflow-stage[data-generate-panel="text"] .editor-workspace,
  .workflow-stage[data-generate-panel="text"] #workflow-text-list,
  .workflow-stage[data-generate-panel="text"] #workflow-report-simulation {
    max-height: none;
    min-height: auto;
    overflow: visible;
  }

  .workflow-stage[data-generate-panel="text"] #workflow-report-simulation {
    position: static;
  }

  .wide-field {
    grid-column: auto;
  }

  .export-run-actions {
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
    height: 210px;
    grid-template-columns: 1fr;
    grid-template-rows: 98px 76px 36px;
  }

  .topbar-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .production-hero,
  .tenant-hero,
  .system-notice,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .tenant-hero-actions,
  .admin-context-bar,
  .tenant-panel .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .tenant-panel .panel-header input {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .auth-screen {
    padding: 14px;
  }

  .auth-visual {
    min-height: 250px;
    padding: 28px;
  }

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

  .auth-visual p:not(.eyebrow) {
    font-size: 15px;
  }

  .reports-art {
    display: none;
  }

  .auth-panel {
    padding: 32px 24px;
  }

  .auth-logo {
    max-width: 180px;
    width: 68%;
  }
}
