@font-face {
  font-family: "Vazirmatn";
  src: url("./assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Estedad";
  src: url("./assets/fonts/Estedad-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Commission governance workspace — effective-dated, auditable and manager-first. */
.app-shell[data-module="commission"] {
  --app-font: "Estedad", "Vazirmatn", Tahoma, Arial, sans-serif;
  --cs-ink: #14243d;
  --cs-muted: #607087;
  --cs-line: #dce3ec;
  --cs-soft: #f5f8fc;
  --cs-blue: #173f7a;
  --cs-cyan: #087f8c;
  --cs-green: #087f5b;
  --cs-amber: #b9770e;
  background: #f3f6fa;
  font-family: var(--app-font);
  font-feature-settings: "kern" 1, "ss01" 1;
}

.app-shell[data-module="commission"] .workspace {
  background:
    radial-gradient(circle at 8% 8%, rgba(26, 92, 150, .06), transparent 24rem),
    linear-gradient(180deg, #f8fafc 0, #f2f5f9 100%);
}

.app-shell[data-module="commission"] .view {
  max-width: 1540px;
  margin-inline: auto;
}

.cs-command-card,
.cs-protocol-banner,
.cs-calculation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 22px;
  align-items: center;
  padding: 24px 28px;
  margin-bottom: 16px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 22px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .08), transparent 42%),
    linear-gradient(135deg, #112d56, #17497a 58%, #087783);
  box-shadow: 0 18px 45px rgba(21, 48, 82, .18);
  overflow: hidden;
  position: relative;
}

.cs-command-card::after,
.cs-protocol-banner::after,
.cs-calculation-header::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  left: -90px;
  top: -140px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .035), 0 0 0 58px rgba(255, 255, 255, .025);
}

.cs-command-main,
.cs-command-card > *,
.cs-protocol-banner > *,
.cs-calculation-header > * { position: relative; z-index: 1; }
.cs-eyebrow,
.cs-command-main > span,
.cs-protocol-banner > div > span,
.cs-calculation-header > div > span {
  display: block;
  margin-bottom: 5px;
  color: #aee7e6;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.cs-command-main h1,
.cs-protocol-banner h1,
.cs-calculation-header h1 { margin: 0; color: #fff; font-size: clamp(1.25rem, 2vw, 1.85rem); }
.cs-command-main h1 b { margin-inline-start: 8px; color: #f7d48d; font-size: .72em; }
.cs-command-main p,
.cs-protocol-banner p,
.cs-calculation-header p { margin: 7px 0 0; color: #d7e3ef; }
.cs-date-control { min-width: 190px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(255,255,255,.09); }
.cs-date-control span, .cs-calculation-header label span { display: block; margin-bottom: 6px; color: #cfe0ef; font-size: .72rem; }
.cs-date-control input, .cs-calculation-header select { width: 100%; min-height: 38px; padding: 7px 10px; color: #fff; font-weight: 800; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; outline: none; background: rgba(3,22,43,.3); }
.cs-date-control small { display: block; margin-top: 5px; color: #b9ccdc; font-size: .65rem; }
.cs-protocol-proof { display: grid; gap: 4px; min-width: 190px; padding-inline-start: 20px; border-inline-start: 1px solid rgba(255,255,255,.2); }
.cs-protocol-proof strong { color: #f8d996; font-family: ui-monospace, monospace; direction: ltr; text-align: right; }
.cs-protocol-proof span { color: #d7e3ef; font-size: .72rem; }
.cs-scheduled-note { display: flex; align-items: center; gap: 10px; padding: 11px 15px; margin: -4px 0 16px; color: #5b4215; border: 1px solid #ead6aa; border-radius: 12px; background: #fff9e9; }

.cs-protocol-strip {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(260px, 1fr) 150px;
  align-items: center;
  gap: 9px 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  color: #dceaf5;
  border: 1px solid #315773;
  border-radius: 14px;
  background: linear-gradient(100deg, #102c46, #174c64 58%, #126e71);
  box-shadow: 0 8px 24px rgba(20, 48, 72, .12);
}
.cs-protocol-strip-title span,
.cs-protocol-date span { display: block; color: #9fc5d3; font-size: .62rem; }
.cs-protocol-strip-title strong { display: block; margin-top: 2px; color: #fff; font-size: .82rem; white-space: nowrap; }
.cs-protocol-chip { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 7px; min-width: 0; padding: 7px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: rgba(255,255,255,.07); }
.cs-protocol-chip i { padding: 3px 6px; color: #0d554e; font-size: .6rem; font-style: normal; font-weight: 900; border-radius: 6px; background: #a9e4d6; }
.cs-protocol-chip.headquarters i { color: #6d4707; background: #f6d796; }
.cs-protocol-chip span { min-width: 0; overflow: hidden; color: #fff; font-size: .7rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.cs-protocol-chip b { color: #f5d28d; font-size: .65rem; white-space: nowrap; }
.cs-protocol-chip small { grid-column: 2 / -1; direction: ltr; color: #a9c2d2; font: 500 .55rem ui-monospace, monospace; text-align: right; }
.cs-protocol-date input { width: 100%; min-height: 32px; padding: 5px 8px; color: #fff; font-weight: 800; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(5,25,42,.34); }
.cs-protocol-strip-note { grid-column: 1 / -1; margin-top: -3px; color: #a8c7d1; font-size: .56rem; text-align: left; }

.cs-rules-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 12px; margin-bottom: 14px; border: 1px solid #cad8e3; border-radius: 15px; background: linear-gradient(120deg, #f9fcfd, #eef7f6); }
.cs-rules-summary > div { padding: 10px 12px; border: 1px solid #d8e4e9; border-radius: 10px; background: #fff; }
.cs-rules-summary span, .cs-rules-summary strong, .cs-rules-summary small { display: block; }
.cs-rules-summary span { color: var(--cs-cyan); font-size: .64rem; font-weight: 900; }
.cs-rules-summary strong { margin-top: 4px; color: var(--cs-ink); font-size: .78rem; }
.cs-rules-summary small { margin-top: 3px; color: var(--cs-muted); font-size: .61rem; }
.cs-rules-summary > p { grid-column: 1 / -1; margin: 0 4px; color: var(--cs-muted); font-size: .67rem; }
.cs-protocol-summary-card { position: relative; }
.cs-protocol-history { margin-top: 8px; border-top: 1px solid #e6edf0; }
.cs-protocol-history summary { display: flex; align-items: center; gap: 5px; padding-top: 7px; color: #14786f; font-size: .62rem; font-weight: 900; cursor: pointer; list-style: none; }
.cs-protocol-history summary::-webkit-details-marker { display: none; }
.cs-protocol-history summary::before { content: "＋"; display: inline-grid; width: 17px; height: 17px; place-items: center; border: 1px solid #abd5cf; border-radius: 50%; font-size: .7rem; }
.cs-protocol-history[open] summary::before { content: "−"; }
.cs-protocol-history > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 6px; }
.cs-protocol-history > div span { display: grid !important; gap: 2px; padding: 6px 7px; border-radius: 6px; background: #f5f9fa; color: #59727e !important; font-size: .56rem !important; font-weight: 700 !important; }
.cs-protocol-history > div b { color: #315a70; font-size: .58rem; }
.cs-protocol-history > div small { margin: 0; color: #7c8d96 !important; font-size: .52rem !important; }
.cs-protocol-history > div em { color: #6f818a; font-size: .52rem; font-style: normal; line-height: 1.65; }
.cs-protocol-layout > .cs-panel:first-child { grid-column: 1 / -1; }
.cs-protocol-history-panel { display: none; }
.cs-protocol-layout #csProtocolForm { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cs-protocol-layout #csProtocolForm .cs-product-editor { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs-protocol-layout #csProtocolForm .cs-product-editor.cs-product-rates-editor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-product-rates-editor > label { min-width: 0; }
.cs-protocol-layout #csProtocolForm input[data-cs-rial-input] { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.cs-sales-protocol-table { min-width: 1420px; }
.cs-sale-protocol-cell select { min-width: 280px; }
.cs-payment-action { min-width: 145px; min-height: 34px; padding: 7px 11px; font-size: .64rem; }
.cs-payment-action:disabled { cursor: not-allowed; opacity: .5; }
.cs-empty-payment { padding: 26px; color: var(--cs-muted); text-align: center; border: 1px dashed #cbd7e1; border-radius: 12px; background: #f8fafc; }

@media (max-width: 1100px) {
  .cs-protocol-strip { grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 1fr); }
  .cs-protocol-date { grid-column: 1 / -1; display: grid; grid-template-columns: auto 150px; align-items: center; gap: 8px; }
  .cs-protocol-layout #csProtocolForm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-protocol-layout #csProtocolForm .cs-product-editor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-protocol-layout #csProtocolForm .cs-product-editor.cs-product-rates-editor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .cs-protocol-strip { grid-template-columns: 1fr; }
  .cs-protocol-chip, .cs-protocol-date, .cs-protocol-strip-note { grid-column: 1; }
  .cs-rules-summary { grid-template-columns: 1fr; }
  .cs-rules-summary > p { grid-column: 1; }
  .cs-protocol-layout #csProtocolForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-protocol-layout #csProtocolForm .cs-product-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-protocol-layout #csProtocolForm .cs-product-editor.cs-product-rates-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .cs-protocol-layout #csProtocolForm,
  .cs-protocol-layout #csProtocolForm .cs-product-editor { grid-template-columns: 1fr; }
  .cs-protocol-layout #csProtocolForm .cs-product-editor.cs-product-rates-editor { grid-template-columns: 1fr; }
  .cs-target-record { grid-template-columns: 1fr 1fr; }
  .cs-target-record b, .cs-target-record small { grid-column: 1; grid-row: auto; }
  .cs-target-record button { grid-column: auto; }
}

.cs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.cs-kpis article { min-width: 0; padding: 18px 19px; border: 1px solid var(--cs-line); border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(20,36,61,.055); }
.cs-kpis article::before { content: ""; display: block; width: 32px; height: 4px; margin-bottom: 12px; border-radius: 4px; background: #7c91aa; }
.cs-kpis article.accent { color: #fff; border-color: transparent; background: linear-gradient(145deg, #087f72, #0f6674); }
.cs-kpis article.accent::before { background: #8de2cf; }
.cs-kpis span { display: block; color: var(--cs-muted); font-size: .76rem; font-weight: 700; }
.cs-kpis strong { display: block; margin: 6px 0 4px; color: var(--cs-ink); font-size: clamp(1rem, 1.45vw, 1.3rem); white-space: nowrap; }
.cs-kpis small { color: #7b8899; font-size: .68rem; }
.cs-kpis .accent span, .cs-kpis .accent small { color: #ccebe7; }
.cs-kpis .accent strong { color: #fff; }
.cs-kpis article > button {
  width: 100%;
  min-height: 30px;
  margin-top: 12px;
  border: 1px solid #d6e2e8;
  border-radius: 9px;
  background: #f5f8fa;
  color: #44657d;
  font: 800 .64rem var(--app-font, "Estedad", sans-serif);
  cursor: pointer;
}
.cs-kpis article > button:hover,
.cs-kpis article > button:focus-visible { border-color: #16877c; background: #e8f7f4; color: #08766b; outline: none; }
.cs-kpis article.accent > button { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.11); color: #fff; }
.cs-kpis article.accent > button:hover,
.cs-kpis article.accent > button:focus-visible { background: #fff; color: #08766b; }

.cs-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .8fr); gap: 16px; margin-bottom: 16px; }
.cs-target-only-layout { grid-template-columns: 1fr; }
.cs-layout-main { grid-template-columns: minmax(0, 1.65fr) minmax(290px, .55fr); }
.cs-team-layout, .cs-protocol-layout { align-items: start; }
.cs-panel { min-width: 0; padding: 22px; margin-bottom: 16px; border: 1px solid var(--cs-line); border-radius: 19px; background: rgba(255,255,255,.96); box-shadow: 0 10px 30px rgba(20,36,61,.055); }
.cs-layout > .cs-panel { margin-bottom: 0; }
.cs-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.cs-title > div > span { display: block; margin-bottom: 3px; color: var(--cs-cyan); font-size: .7rem; font-weight: 900; }
.cs-title h1, .cs-title h2 { margin: 0; color: var(--cs-ink); font-size: 1.08rem; }
.cs-title p { margin: 6px 0 0; color: var(--cs-muted); font-size: .76rem; }
.cs-title > small { color: var(--cs-muted); font-size: .7rem; }
.cs-status { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 6px 9px; color: #08654d; font-size: .68rem; font-weight: 900; white-space: nowrap; border: 1px solid #bfe7d9; border-radius: 999px; background: #eefbf6; }
.cs-status i { width: 7px; height: 7px; border-radius: 50%; background: #0a9a70; box-shadow: 0 0 0 3px rgba(10,154,112,.12); }
.cs-status-warn { color: #8a5c08; border-color: #ead5a3; background: #fff8e6; }
.cs-status-warn i { background: #c88713; }
.cs-status-danger { color: #a23333; border-color: #efc7c7; background: #fff1f1; }
.cs-status-danger i { background: #cf4545; }

.cs-process { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 0; overflow-x: auto; padding-bottom: 4px; }
.cs-process > div { display: flex; align-items: center; gap: 9px; min-width: 120px; padding: 13px 10px; position: relative; }
.cs-process > div:not(:last-child)::after { content: "←"; position: absolute; left: -5px; color: #9caabd; font-weight: 900; }
.cs-process b { display: grid; flex: 0 0 31px; width: 31px; height: 31px; place-items: center; color: #66768a; border: 1px solid #cad3df; border-radius: 50%; background: #f5f7fa; }
.cs-process .done b { color: #fff; border-color: var(--cs-green); background: var(--cs-green); }
.cs-process span, .cs-process strong, .cs-process small { display: block; }
.cs-process strong { color: var(--cs-ink); font-size: .72rem; }
.cs-process small { margin-top: 3px; color: var(--cs-muted); font-size: .61rem; }
.cs-decision-panel ul { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.cs-decision-panel li { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; padding: 10px; border: 1px solid #e2e8ef; border-radius: 12px; background: #f8fafc; }
.cs-decision-panel li b { display: grid; width: 38px; height: 38px; place-items: center; color: #9a5d0b; border-radius: 10px; background: #fff0cf; }
.cs-decision-panel li span { color: var(--cs-ink); font-size: .72rem; line-height: 1.7; }

.cs-table-wrap { width: 100%; overflow: auto; border: 1px solid #e1e7ef; border-radius: 13px; }
.cs-table { width: 100%; min-width: 780px; border-collapse: collapse; background: #fff; }
.cs-table th { padding: 11px 13px; color: #5e6c7e; font-size: .68rem; text-align: right; white-space: nowrap; border-bottom: 1px solid #dce3ec; background: #f6f8fb; }
.cs-table td { padding: 12px 13px; color: #2d3e55; font-size: .72rem; vertical-align: middle; border-bottom: 1px solid #edf0f4; }
.cs-table tr:last-child td { border-bottom: 0; }
.cs-table td strong, .cs-table td small { display: block; }
.cs-table td strong { color: #162a45; }
.cs-table td small { margin-top: 3px; color: #7a899b; font-size: .64rem; }
.cs-table select { min-width: 190px; padding: 8px; color: var(--cs-ink); border: 1px solid #cfd9e4; border-radius: 8px; background: #fff; }
.cs-row-error td { background: #fff8f8; }
.cs-row-duplicate td { color: #8a2e2e; background: #fff0f0 !important; }
.cs-row-duplicate td:first-child { box-shadow: inset -4px 0 #d54949; }
.cs-duplicate-badge { display: inline-flex; margin: 4px 0 0 6px; padding: 3px 6px; color: #a52f2f; font-size: .58rem; font-weight: 900; border: 1px solid #efb5b5; border-radius: 999px; background: #fff; }
.cs-delete-invoice { min-height: 31px; padding: 5px 9px; color: #9a3434; font: 800 .62rem var(--app-font, "Estedad", sans-serif); border: 1px solid #ecc2c2; border-radius: 8px; background: #fff6f6; cursor: pointer; }
.cs-delete-invoice:hover, .cs-delete-invoice:focus-visible, .cs-delete-invoice.duplicate { color: #fff; border-color: #c83f3f; background: #c83f3f; outline: none; }
.cs-delete-invoice:disabled { color: #9aa5b0; border-color: #dde3e8; background: #f3f5f7; cursor: not-allowed; opacity: .72; }
.cs-row-inactive td { color: #7a8490; background: #f4f6f8 !important; opacity: .9; }
.cs-inactive-badge { display: inline-flex; margin: 4px 0 0 5px; padding: 3px 6px; color: #56616d; font-size: .58rem; font-weight: 900; border: 1px solid #cbd3da; border-radius: 999px; background: #fff; }
.cs-row-controls { display: grid; gap: 5px; min-width: 112px; }
.cs-row-controls > span { color: #9c3c3c; font-size: .58rem; font-weight: 800; text-align: center; }
.cs-row-controls > small { color: #687681; font-size: .55rem; line-height: 1.6; text-align: center; }
.cs-toggle-invoice { min-height: 30px; padding: 5px 8px; color: #6f5b27; font: 800 .61rem var(--app-font, "Estedad", sans-serif); border: 1px solid #dfcf9f; border-radius: 8px; background: #fff9e9; cursor: pointer; }
.cs-toggle-invoice.activate { color: #08705a; border-color: #acd9cd; background: #edf9f6; }
.cs-toggle-invoice:disabled { color: #9aa5b0; border-color: #dde3e8; background: #f3f5f7; cursor: not-allowed; }
.cs-inline-value-button { display: grid; width: 100%; min-width: 118px; gap: 2px; padding: 10px 11px; text-align: center; border: 1px solid #d6e1e7; border-radius: 9px; background: #f8fbfc; cursor: pointer; }
.cs-inline-value-button span { color: #168078; font-size: .55rem; font-weight: 900; }
.cs-inline-value-button strong { overflow: hidden; color: #1d344a; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.cs-inline-value-button small { overflow: hidden; color: #7a8895; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.cs-inline-value-button:hover, .cs-inline-value-button:focus-visible { border-color: #18867e; background: #ecf8f6; outline: none; }
.cs-inline-value-button:disabled { cursor: not-allowed; opacity: .6; }

.cs-sale-assignment-dialog { width: min(calc(100% - 28px), 700px); padding: 0; overflow: hidden; border: 1px solid #ccdae2; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(5,26,45,.3); }
.cs-sale-assignment-dialog::backdrop { background: rgba(6,22,37,.66); backdrop-filter: blur(5px); }
.cs-sale-assignment-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; color: #fff; background: linear-gradient(120deg,#11385d,#0b7770); }
.cs-sale-assignment-dialog header small, .cs-sale-assignment-dialog header h2, .cs-sale-assignment-dialog header p { display: block; margin: 0; }
.cs-sale-assignment-dialog header small { color: #a9e1d9; font-size: .65rem; }
.cs-sale-assignment-dialog header h2 { margin-top: 3px; font-size: 1.1rem; }
.cs-sale-assignment-dialog header p { margin-top: 3px; color: #d1e4e8; font-size: .65rem; }
.cs-sale-assignment-dialog header button { display: grid; width: 36px; height: 36px; place-items: center; color: #fff; font-size: 1.25rem; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; background: rgba(255,255,255,.1); cursor: pointer; }
.cs-sale-assignment-dialog .cs-form { padding: 18px; }
.cs-sale-assignment-dialog label > small { display: block; margin-top: 5px; color: #768795; font-size: .58rem; line-height: 1.7; }
.cs-sale-editor-note { padding: 11px 13px; border: 1px solid #d5e4e6; border-radius: 10px; background: #f3f9f8; }
.cs-sale-editor-note strong { color: #08766d; font-size: .68rem; }
.cs-sale-editor-note p { margin: 3px 0 0; color: #667987; font-size: .62rem; }
.cs-sale-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }

.cs-export-actions { display: flex; gap: 7px; margin-inline-start: auto; }
.cs-guide-header .cs-export-actions button { width: auto; height: 34px; padding: 0 11px; color: #fff; font: 800 .62rem var(--app-font, sans-serif); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: rgba(255,255,255,.12); }
.cs-guide-header .cs-export-actions button:hover, .cs-guide-header .cs-export-actions button:focus-visible { color: #0c5f5b; background: #fff; outline: none; }
.cs-guide-header .cs-export-actions button:disabled { opacity: .5; }
.cs-export-stage { position: fixed; z-index: -9999; top: 0; left: -20000px; width: 1060px; padding: 0; direction: rtl; background: #f6f9fb; }
.cs-export-stage, .cs-export-stage * { font-family: "Estedad", "Vazirmatn", Tahoma, Arial, sans-serif; font-feature-settings: "kern" 1, "ss01" 1; }
.cs-export-stage .cs-calculation-dialog { display: block; position: static; inset: auto; transform: none; width: 1020px; max-height: none; margin: 20px; overflow: visible; }

.cs-import-hero { padding: 25px; background: linear-gradient(135deg, #fff, #f5f9fc); }
.cs-import-flow { display: grid; grid-template-columns: minmax(170px,.45fr) minmax(360px,1.2fr) minmax(180px,.5fr); gap: 12px; align-items: stretch; }
.cs-import-flow > label, .cs-import-flow > div { display: flex; flex-direction: column; justify-content: center; min-height: 110px; padding: 15px; border: 1px solid #dce4ed; border-radius: 14px; background: #fff; }
.cs-import-flow > * > span { margin-bottom: 7px; color: var(--cs-cyan); font-size: .68rem; font-weight: 900; }
.cs-import-flow select { width: 100%; padding: 10px; border: 1px solid #cfd9e4; border-radius: 9px; }
.cs-file-drop { cursor: pointer; border-style: dashed !important; border-width: 2px !important; border-color: #8eb6c5 !important; background: #f5fbfc !important; }
.cs-file-drop strong { color: var(--cs-ink); }
.cs-file-drop small, .cs-import-flow > div small { margin-top: 6px; color: var(--cs-muted); font-size: .66rem; line-height: 1.7; }
.cs-file-drop input { margin-top: 10px; font-size: .68rem; }
.cs-inline-notice { padding: 10px 13px; margin-top: 12px; color: #4c6078; font-size: .7rem; border-radius: 10px; background: #eef4f8; }
.cs-actions { display: flex; gap: 8px; }
.cs-validation-summary { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.cs-import-control-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.cs-import-control-cards article { padding: 12px; border: 1px solid #dbe6e7; border-radius: 11px; background: #f5fbf9; }
.cs-import-control-cards article.correction { border-color: #ead5a5; background: #fff9ea; }
.cs-import-control-cards article.duplicate { border-color: #ecc4c4; background: #fff4f4; }
.cs-import-control-cards span, .cs-import-control-cards strong, .cs-import-control-cards small { display: block; }
.cs-import-control-cards span { color: #637984; font-size: .6rem; }
.cs-import-control-cards strong { margin-top: 4px; color: #173d4e; font-size: 1.05rem; }
.cs-import-control-cards small { margin-top: 2px; color: #7c8d96; font-size: .56rem; }
.cs-row-correction td { background: #fffaf0; }
.cs-import-control-table td:last-child { min-width: 250px; white-space: normal; line-height: 1.8; }
.cs-validation-summary b, .cs-validation-summary span { padding: 6px 10px; color: #17654f; font-size: .7rem; border-radius: 8px; background: #eaf8f3; }
.cs-validation-summary .warn { color: #9b5b0c; background: #fff2d8; }
.cs-template-list, .cs-audit-list, .cs-target-list { display: grid; gap: 9px; }
.cs-template-list > div, .cs-audit-list > div, .cs-target-list > div { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid #e4e9ef; border-radius: 11px; background: #f9fafc; }
.cs-template-list strong, .cs-audit-list strong, .cs-target-list strong { color: var(--cs-ink); font-size: .74rem; }
.cs-template-list span, .cs-audit-list span, .cs-audit-list small, .cs-target-list span { color: var(--cs-muted); font-size: .65rem; line-height: 1.7; }

.cs-import-history { overflow-x: auto; }
.cs-import-history .cs-table { min-width: 760px; }
.cs-import-history .cs-table td,
.cs-import-history .cs-table th { padding: 10px 9px; }
.cs-import-history .cs-table td strong,
.cs-import-history .cs-table td small { display: block; }
.cs-import-history .cs-table td small { margin-top: 3px; color: #788896; font-size: .6rem; }
.cs-import-history .cs-row-correction { background: #fffaf0; }
.cs-import-errors { margin-top: 14px; padding: 14px; border: 1px solid #ebcaca; border-radius: 14px; background: #fff7f7; }
.cs-import-errors .cs-title { margin-bottom: 10px; }
.cs-import-errors .cs-title h3 { margin: 3px 0 0; color: #8e3434; font-size: .86rem; }
.cs-import-error-list { display: grid; gap: 7px; }
.cs-import-error-list > div { display: grid; grid-template-columns: 28px minmax(110px, .4fr) minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #f0d8d8; border-radius: 9px; background: #fff; }
.cs-import-error-list b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: #a43f3f; background: #ffe7e7; font-size: .62rem; }
.cs-import-error-list strong { color: #703a3a; font-size: .68rem; }
.cs-import-error-list span { color: #805d5d; font-size: .65rem; line-height: 1.8; }
.cs-import-success,
.cs-import-empty { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-radius: 10px; font-size: .66rem; }
.cs-import-success { color: #176b57; border: 1px solid #c8e5d9; background: #f0faf6; }
.cs-import-success strong { font-size: .7rem; }
.cs-import-success span { color: #5c7b74; }
.cs-import-empty { justify-content: center; min-height: 76px; color: #718393; border: 1px dashed #cedbe3; background: #f8fafc; text-align: center; }
.cs-target-list > div { grid-template-columns: 1fr auto; }
.cs-target-list span { grid-row: 2; }
.cs-target-list b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--cs-blue); }
.cs-protocol-target-panel { margin-top: 12px; border-top: 1px solid #dce8ec; padding-top: 14px; }
.cs-target-record { grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 5px 10px; }
.cs-target-record strong { grid-column: 1; }
.cs-target-record span { grid-column: 1; grid-row: 2; }
.cs-target-record b { grid-column: 2; grid-row: 1 / span 2; }
.cs-target-record small { grid-column: 1; color: #68818c; font-size: .58rem; }
.cs-target-record button { min-height: 27px; padding: 4px 8px; border: 1px solid #b8dcd6; border-radius: 7px; background: #eff9f7; color: #08776e; font: 700 .6rem var(--app-font, sans-serif); cursor: pointer; }
.cs-target-record button:last-child { border-color: #e2c58e; background: #fff8e9; color: #8b5c12; }
.cs-target-record button:disabled { opacity: .45; cursor: not-allowed; }
.cs-target-record.is-inactive { opacity: .68; }
.cs-target-record.is-locked { border-color: #cad6de; background: #f3f6f8; }
.cs-protocol-target-panel .cs-target-list { margin-top: 12px; }
.cs-protocol-target-panel { overflow: hidden; }
.cs-target-year { min-width: 135px; display: grid; gap: 5px; color: #52717a; font-size: .62rem; font-weight: 800; }
.cs-target-year select { min-height: 40px; border: 1px solid #b7d8d4; border-radius: 10px; padding: 6px 11px; background: #fff; color: #114b52; font: 900 .78rem var(--app-font,sans-serif); }
.cs-forecast-note { margin: 8px 0 15px; padding: 12px 14px; border: 1px solid #bfe3dd; border-radius: 12px; display: grid; gap: 4px; background: linear-gradient(135deg,#effbf8,#f5f9ff); color: #315f66; }
.cs-forecast-note strong { color: #08776e; font-size: .72rem; }
.cs-forecast-note span { font-size: .62rem; line-height: 1.9; }
.cs-annual-target-table { overflow-x: auto; border: 1px solid #dae7e8; border-radius: 14px; }
.cs-annual-target-table table { width: 100%; min-width: 780px; border-collapse: collapse; }
.cs-annual-target-table th { padding: 11px 12px; background: #f0f7f7; color: #517078; text-align: right; font-size: .62rem; }
.cs-annual-target-table td { padding: 12px; border-top: 1px solid #e3ecee; vertical-align: middle; }
.cs-annual-target-table td:first-child strong,.cs-annual-target-table td:nth-child(3) b { display: block; color: #164b53; font-size: .72rem; }
.cs-annual-target-table td small { display: block; margin-top: 3px; color: #748b92; font-size: .56rem; }
.cs-target-forecast { color: #2456c7; font-size: .7rem; font-weight: 900; }
.cs-target-forecast.is-empty { color: #9caeb2; }
.cs-target-month-edit { min-height: 37px; padding: 7px 12px; border: 1px solid #3b9e92; border-radius: 9px; background: #ecfbf7; color: #08776e; cursor: pointer; font: 900 .61rem var(--app-font,sans-serif); white-space: nowrap; }
.cs-annual-target-table tr.is-empty .cs-target-month-edit { border: 0; background: linear-gradient(135deg,#2456c7,#2841ad); color: #fff; box-shadow: 0 7px 15px rgba(36,86,199,.18); }
.cs-annual-target-table td:last-child em { display: inline-block; margin-inline-start: 7px; padding: 3px 7px; border-radius: 999px; font: 900 .52rem var(--app-font,sans-serif); font-style: normal; }
.cs-annual-target-table td:last-child em.ok { background: #e4f8ef; color: #0b8061; }
.cs-annual-target-table td:last-child em.bad { background: #fff0e8; color: #b84a16; }
.cs-monthly-target-dialog { width: min(780px,calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid #9ecfca; border-radius: 20px; overflow: auto; box-shadow: 0 24px 70px rgba(14,55,64,.3); color: #173f46; font-family: var(--app-font,sans-serif); }
.cs-monthly-target-dialog::backdrop { background: rgba(14,38,50,.62); backdrop-filter: blur(4px); }
.cs-monthly-target-dialog form > header { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; background: linear-gradient(135deg,#0c5268,#0d8b80); color: #fff; }
.cs-monthly-target-dialog header small,.cs-monthly-target-dialog header p { color: rgba(255,255,255,.84); }
.cs-monthly-target-dialog header h2 { margin: 4px 0; font-size: 1rem; }
.cs-monthly-target-dialog header p { margin: 0; font-size: .62rem; }
.cs-monthly-target-dialog header button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.45); border-radius: 9px; background: transparent; color: #fff; cursor: pointer; font-size: 1.1rem; }
.cs-month-target-fields { padding: 17px 20px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; background: #f7fafb; }
.cs-month-target-fields label { display: grid; gap: 6px; color: #345e65; font-size: .62rem; font-weight: 900; }
.cs-month-target-fields input,.cs-allocation-editor input { min-height: 43px; padding: 8px 11px; border: 1px solid #bad6d7; border-radius: 10px; background: #fff; color: #143f47; font: 900 .78rem var(--app-font,sans-serif); direction: ltr; text-align: right; }
.cs-month-target-fields input:read-only { background: #eef3f6; color: #52727b; }
.cs-month-target-fields small { color: #7a9298; font-size: .54rem; }
.cs-allocation-editor { margin: 0; padding: 10px 20px 18px; display: grid; gap: 8px; }
.cs-allocation-editor > div { margin-bottom: 4px; padding: 10px 12px; border-radius: 10px; display: flex; justify-content: space-between; gap: 10px; background: #edf6f6; }
.cs-allocation-editor > div strong { font-size: .7rem; }
.cs-allocation-editor > div small { font-size: .6rem; font-weight: 900; color: #8b5c12; }
.cs-allocation-editor > div small.is-balanced { color: #08776e; }
.cs-allocation-editor > div small.is-unbalanced { color: #b45217; }
.cs-allocation-editor > label { padding: 8px 10px; border: 1px solid #e0e9eb; border-radius: 10px; display: grid; grid-template-columns: 1fr minmax(190px,42%); align-items: center; gap: 10px; }
.cs-allocation-editor > label span { display: grid; gap: 3px; }
.cs-allocation-editor > label b { color: #164b53; font-size: .65rem; }
.cs-allocation-editor > label small { color: #81979c; font-size: .53rem; }
.cs-monthly-target-dialog form > footer { position: sticky; bottom: 0; padding: 13px 20px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #dce8e9; background: rgba(255,255,255,.97); }
.cs-monthly-target-dialog footer button { min-height: 40px; padding: 8px 15px; border: 1px solid #b9d1d3; border-radius: 10px; cursor: pointer; font: 900 .66rem var(--app-font,sans-serif); }
.cs-product-catalog-panel { margin-top: 14px; }
.cs-product-catalog-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cs-product-catalog-list > span { display: grid; gap: 2px; min-width: 120px; padding: 9px 11px; border: 1px solid #d7e6e8; border-radius: 10px; background: #f4faf9; }
.cs-product-catalog-list strong { color: #125f65; font-size: .7rem; }
.cs-product-catalog-list small { color: #78909a; font-size: .58rem; }
.cs-province-picker { position: relative; }
.cs-province-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cfd9e4; border-radius: 9px; background: #fff; color: var(--cs-ink); font: 700 .68rem var(--app-font, sans-serif); cursor: pointer; }
.cs-province-trigger span { display: inline-grid; min-width: 22px; height: 22px; place-items: center; border-radius: 50%; background: #e7f6f3; color: #08776e; }
.cs-province-combo { position: relative; }
.cs-province-combo .cs-province-trigger { display: block; width: 100%; min-height: 42px; padding: 9px 40px 9px 11px; border: 1px solid #cfd9e4; border-radius: 9px; background: #fff; color: var(--cs-ink); font: 700 .68rem var(--app-font, sans-serif); cursor: text; outline: none; }
.cs-province-combo .cs-province-trigger:focus { border-color: #16847c; box-shadow: 0 0 0 3px rgba(22,132,124,.12); }
.cs-province-combo > span { position: absolute; top: 50%; right: 11px; display: inline-grid; min-width: 22px; height: 22px; transform: translateY(-50%); place-items: center; border-radius: 50%; background: #e7f6f3; color: #08776e; font: 800 .58rem var(--app-font, sans-serif); pointer-events: none; }
.cs-province-menu { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; left: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; max-height: 245px; overflow: auto; padding: 9px; border: 1px solid #cbdde2; border-radius: 11px; background: #fff; box-shadow: 0 16px 36px rgba(22,59,75,.18); }
.cs-province-menu { display: block; max-height: 360px; padding: 10px; }
.cs-province-menu[hidden] { display: none !important; }
.cs-province-menu-footer { position: sticky; bottom: -10px; padding: 8px 0 0; background: linear-gradient(transparent, #fff 18%); }
.cs-province-menu-footer button { width: 100%; min-height: 36px; border: 0; border-radius: 8px; background: #0f8278; color: #fff; font: 800 .65rem var(--app-font, sans-serif); cursor: pointer; }
.cs-province-search input { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid #cbdde2; border-radius: 9px; color: var(--cs-ink); background: #f8fbfc; font: 700 .65rem var(--app-font, sans-serif); outline: none; }
.cs-province-search input:focus { border-color: #16847c; box-shadow: 0 0 0 3px rgba(22,132,124,.12); background: #fff; }
.cs-province-list { display: grid; gap: 2px; max-height: 275px; overflow: auto; padding-inline-end: 2px; }
.cs-province-list label[data-cs-province-row] { display: grid; grid-template-columns: 18px minmax(0,1fr) 70px; align-items: center; gap: 6px; padding: 6px 3px; border-bottom: 1px dashed #e2ecee; }
.cs-province-list label[data-cs-province-row][hidden],
.cs-province-list label[data-cs-province-row].is-filtered-out { display: none !important; }
.cs-province-empty { margin: 8px 0; padding: 14px 10px; border: 1px dashed #cbdde2; border-radius: 8px; color: #6b8490; text-align: center; font: 700 .64rem var(--app-font, sans-serif); }
.cs-province-empty[hidden] { display: none !important; }
.cs-province-list label[data-cs-province-row]:last-child { border-bottom: 0; }
.cs-province-list label[data-cs-province-row] input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #0b8278; }
.cs-province-list label[data-cs-province-row] input[type="number"] { width: 70px; min-height: 27px; padding: 4px 5px; border: 1px solid #d1e1e3; border-radius: 6px; text-align: center; color: #466875; font: 700 .58rem var(--app-font, sans-serif); }
.cs-province-zone-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 9px 0 7px; }
.cs-province-zone-tabs button { flex: 0 0 auto; min-height: 27px; padding: 4px 9px; border: 1px solid #d3e3e5; border-radius: 999px; background: #f5fafb; color: #466875; font: 800 .58rem var(--app-font, sans-serif); cursor: pointer; }
.cs-province-zone-tabs button.active { border-color: #0b8278; background: #0b8278; color: #fff; }
.cs-province-zone-lists { display: grid; gap: 8px; max-height: 265px; overflow: auto; padding-inline-end: 2px; }
.cs-province-zone-lists section { padding: 7px 8px; border: 1px solid #e0ecee; border-radius: 9px; background: #fbfdfd; }
.cs-province-zone-lists section[hidden], .cs-province-zone-lists [data-cs-province-row][hidden] { display: none; }
.cs-province-zone-lists h4 { display: flex; justify-content: space-between; margin: 0 0 4px; color: #0b736d; font-size: .63rem; }
.cs-province-zone-lists h4 small { color: #78909a; font-size: .55rem; font-weight: 600; }
.cs-province-menu label { display: flex; align-items: center; gap: 5px; padding: 5px; color: #36586a; font-size: .61rem; }
.cs-province-zone-lists label[data-cs-province-row] { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 6px; padding: 5px 2px; border-bottom: 1px dashed #e2ecee; }
.cs-province-zone-lists label[data-cs-province-row]:last-child { border-bottom: 0; }
.cs-province-zone-lists label[data-cs-province-row] input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #0b8278; }
.cs-province-zone-lists label[data-cs-province-row] select { min-height: 25px; padding: 3px 5px; border: 1px solid #d1e1e3; border-radius: 6px; background: #fff; color: #53717c; font: 700 .53rem var(--app-font, sans-serif); }
.cs-province-selected { margin-top: 5px; color: #63808b; font-size: .59rem; line-height: 1.8; }
.cs-region-factor-open { margin-top: 2px; }
.cs-region-factor-dialog { width: min(900px, calc(100vw - 28px)); max-height: 88vh; padding: 0; border: 1px solid #b9d7dc; border-radius: 18px; color: var(--cs-ink); background: #fff; box-shadow: 0 28px 80px rgba(14,54,72,.35); }
.cs-region-factor-dialog::backdrop { background: rgba(8,31,45,.58); backdrop-filter: blur(4px); }
.cs-region-factor-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; color: #fff; background: linear-gradient(120deg,#0e4567,#0a7b73); }
.cs-region-factor-dialog > header h2 { margin: 4px 0 0; font-size: 1.05rem; }
.cs-region-factor-dialog > header small { color: #c8e8e6; font-size: .62rem; }
.cs-region-factor-dialog > header button { width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.45); border-radius: 9px; background: transparent; color: #fff; font-size: 1.2rem; cursor: pointer; }
.cs-region-factor-dialog > p { margin: 14px 20px; color: #68818c; font-size: .68rem; }
.cs-region-zone-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 12px; }
.cs-region-zone-tab { min-height: 32px; padding: 6px 14px; border: 1px solid #c9dfe2; border-radius: 999px; background: #f5fafb; color: #33616f; font: 800 .65rem var(--app-font, sans-serif); cursor: pointer; }
.cs-region-zone-tab.active, .cs-region-zone-tab:focus-visible { border-color: #0b8278; background: #0b8278; color: #fff; outline: none; }
.cs-region-zone-grid { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0 20px 16px; max-height: 62vh; overflow: auto; }
.cs-region-zone-grid > section[hidden] { display: none; }
.cs-region-zone-grid > section { padding: 10px; border: 1px solid #dfebed; border-radius: 12px; background: #f8fbfb; }
.cs-region-zone-grid h3 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 7px; color: #0b736d; font-size: .76rem; }
.cs-region-zone-grid h3 small { color: #78909a; font-size: .58rem; font-weight: 600; }
.cs-region-zone-grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; color: #4f6a76; font-size: .62rem; }
.cs-region-zone-grid label[data-cs-province-row] { display: grid; grid-template-columns: minmax(0,1fr) 70px minmax(120px,auto); align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #d9e8e9; }
.cs-region-zone-grid label[data-cs-province-row]:last-child { border-bottom: 0; }
.cs-region-zone-grid input { width: 70px; min-height: 29px; padding: 4px 6px; border: 1px solid #cddfe2; border-radius: 7px; text-align: center; }
.cs-region-zone-grid select { min-height: 29px; padding: 4px 7px; border: 1px solid #cddfe2; border-radius: 7px; background: #fff; color: #466473; font: 700 .58rem var(--app-font, sans-serif); }
.cs-region-zone-grid .cs-zone-factor { margin-bottom: 5px; padding-bottom: 7px; border-bottom: 1px dashed #c7dfe0; color: #8b5c12; }
.cs-region-factor-dialog > footer { display: flex; justify-content: flex-start; padding: 12px 20px 18px; border-top: 1px solid #e1ecee; }

.cs-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.cs-form label { display: grid; gap: 5px; }
.cs-form label > span { color: #53667d; font-size: .68rem; font-weight: 800; }
.cs-form input, .cs-form select, .cs-form textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--cs-ink); border: 1px solid #cfd9e4; border-radius: 9px; outline: none; background: #fff; }
.cs-form textarea { resize: vertical; }
.cs-form input:focus, .cs-form select:focus, .cs-form textarea:focus { border-color: #2b8491; box-shadow: 0 0 0 3px rgba(43,132,145,.11); }
.cs-form .wide { grid-column: 1 / -1; }
.cs-field-label { position: relative; display: flex !important; align-items: center; justify-content: space-between; gap: 7px; }
.cs-field-help-button { display: inline-grid; flex: 0 0 18px; width: 18px; height: 18px; place-items: center; padding: 0; border: 1px solid #9cc9c4; border-radius: 50%; background: #eff9f7; color: #08776e; font: 900 .66rem/1 var(--app-font, "Estedad", sans-serif); cursor: help; }
.cs-field-help-button:hover, .cs-field-help-button:focus-visible { border-color: #087f76; background: #087f76; color: #fff; outline: none; }
.cs-field-help { position: static; display: none !important; width: 100%; margin-top: 2px; padding: 9px 11px; border: 1px solid #c9e2df; border-right: 3px solid #16877e; border-radius: 9px; background: #f0f8f7; color: #405f6d !important; box-shadow: none; font-size: .63rem !important; font-weight: 600 !important; line-height: 1.9 !important; white-space: normal; pointer-events: auto; }
.cs-field-help-open .cs-field-help { display: block !important; }
.cs-jalali-picker { position: fixed; z-index: 10000; inset: 0; margin: auto; width: min(330px, calc(100vw - 24px)); height: fit-content; padding: 14px; border: 1px solid #9fcfca; border-radius: 17px; background: #fff; box-shadow: 0 22px 70px rgba(8,35,48,.38); overflow: visible; }
.cs-jalali-picker::backdrop { background: rgba(7,31,43,.38); backdrop-filter: blur(2px); }
.cs-jalali-picker-head { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 6px; margin-bottom: 9px; }
.cs-jalali-picker-head strong { color: #17445d; font-size: .78rem; text-align: center; }
.cs-jalali-picker-head button { width: 30px; height: 30px; border: 1px solid #d5e4e8; border-radius: 8px; background: #f3f8f9; color: #0a776e; font: 900 1.1rem/1 var(--app-font, sans-serif); cursor: pointer; }
.cs-jalali-picker-head button:hover, .cs-jalali-picker-head button:focus-visible { border-color: #159185; background: #e7f6f3; outline: none; }
.cs-jalali-picker-close { width: 100%; min-height: 34px; margin-top: 10px; border: 1px solid #c7dbde; border-radius: 9px; background: #f5f9fa; color: #315f66; cursor: pointer; font: 800 .62rem var(--app-font,sans-serif); }
.cs-jalali-weekdays, .cs-jalali-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cs-jalali-weekdays { margin-bottom: 4px; }
.cs-jalali-weekdays span { color: #7b8d99; font-size: .57rem; font-weight: 800; text-align: center; }
.cs-jalali-days button, .cs-jalali-days .empty { min-height: 31px; }
.cs-jalali-days button { border: 1px solid transparent; border-radius: 8px; background: #f7fafb; color: #21445a; font: 700 .68rem var(--app-font, sans-serif); cursor: pointer; }
.cs-jalali-days button:hover, .cs-jalali-days button:focus-visible { border-color: #159185; background: #e7f6f3; color: #086e65; outline: none; }
.cs-jalali-days button.selected { border-color: #c78b35; background: #fff3d9; color: #8a5c08; }
.cs-form-section { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 9px 11px; border-bottom: 1px solid #dce8ea; border-right: 3px solid #16877e; border-radius: 8px 0 0 8px; background: linear-gradient(90deg, #f8fbfc, #f0f8f6); }
.cs-form-section strong { color: #17485d; font-size: .75rem; }
.cs-form-section small { color: #78909a; font-size: .59rem; }
.cs-form-inline { grid-template-columns: 1.2fr .6fr .6fr 1fr auto; margin-top: 14px; }
.cs-product-editor { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; padding: 12px; border: 1px solid #e1e8ef; border-radius: 12px; background: #f7f9fb; }
.cs-region-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cs-region-grid > div { padding: 13px; border: 1px solid #dfe6ed; border-radius: 12px; background: linear-gradient(145deg,#fff,#f7f9fb); }
.cs-region-grid span, .cs-region-grid strong, .cs-region-grid small, .cs-region-grid em { display: block; }
.cs-region-grid span { color: #8693a4; font: .65rem ui-monospace, monospace; }
.cs-region-grid strong { margin-top: 3px; color: var(--cs-ink); }
.cs-region-grid small { margin-top: 2px; color: var(--cs-muted); }
.cs-region-grid p { display: flex; align-items: center; gap: 5px; margin: 10px 0 5px; color: #65758a; font-size: .68rem; }
.cs-region-grid p b { color: #0c6b71; }
.cs-region-grid p i { color: #9ca8b7; font-style: normal; }
.cs-region-grid em { color: #78521c; font-size: .66rem; font-style: normal; }

.cs-link-chain { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; overflow-x: auto; border: 1px solid #dce5ed; border-radius: 13px; background: #f7fafc; }
.cs-link-chain span { flex: 0 0 auto; padding: 9px 13px; color: #204263; font-size: .72rem; font-weight: 800; border: 1px solid #cedbe6; border-radius: 9px; background: #fff; }
.cs-link-chain b { color: #8191a3; }

.cs-sales-search-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px auto 18px; }
.cs-sales-search { display: flex; align-items: center; width: min(100%, 580px); min-height: 46px; gap: 9px; padding: 0 15px; border: 1px solid #bfcfda; border-radius: 13px; background: #f8fbfc; box-shadow: 0 8px 22px rgba(18, 54, 78, .06); transition: border-color .2s, box-shadow .2s, background .2s; }
.cs-sales-search:focus-within { border-color: #16877e; background: #fff; box-shadow: 0 0 0 4px rgba(22, 135, 126, .1); }
.cs-sales-search > span { color: #167c76; font-size: 1.35rem; line-height: 1; }
.cs-sales-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #17354d; font: 700 .76rem var(--app-font, "Estedad", sans-serif); }
.cs-sales-search input::placeholder { color: #8898a6; font-weight: 600; }
.cs-sales-search-wrap > small { min-width: 72px; color: #738696; font-size: .64rem; font-weight: 800; }
.cs-sales-clickable-row { cursor: pointer; transition: background .18s, box-shadow .18s; }
.cs-sales-clickable-row:hover, .cs-sales-clickable-row:focus-visible { background: #f2faf8; box-shadow: inset -3px 0 #15877d; outline: 0; }
.cs-sales-clickable-row button { cursor: pointer; }
.cs-sales-no-result td { padding: 28px !important; color: #788895; text-align: center !important; }

.cs-protocol-banner > div:last-child { display: grid; gap: 7px; min-width: 210px; }
.cs-protocol-banner > div:last-child strong { color: #f8d895; }
.cs-protocol-banner > div:last-child small { color: #cad9e8; }
.cs-timeline { display: grid; gap: 0; }
.cs-timeline > div { display: grid; grid-template-columns: 18px auto 1fr; gap: 5px 10px; padding: 0 0 18px; position: relative; }
.cs-timeline > div::before { content: ""; position: absolute; top: 16px; right: 7px; bottom: -2px; width: 1px; background: #d7e0e9; }
.cs-timeline > div:last-child::before { display: none; }
.cs-timeline i { grid-row: 1 / span 3; width: 15px; height: 15px; margin-top: 2px; border: 3px solid #fff; border-radius: 50%; background: #a9b5c3; box-shadow: 0 0 0 1px #a9b5c3; z-index: 1; }
.cs-timeline .active i { background: #087f72; box-shadow: 0 0 0 1px #087f72, 0 0 0 5px rgba(8,127,114,.1); }
.cs-timeline span { width: max-content; padding: 3px 7px; color: #53657a; font-size: .62rem; border-radius: 6px; background: #edf1f5; }
.cs-timeline strong { color: var(--cs-ink); font-size: .76rem; }
.cs-timeline small, .cs-timeline p { grid-column: 2 / -1; margin: 0; color: var(--cs-muted); font-size: .65rem; }
.cs-limit-strip { display: flex; gap: 10px; margin-top: 12px; }
.cs-limit-strip span { flex: 1; padding: 10px; color: #5c6c7f; font-size: .68rem; text-align: center; border-radius: 9px; background: #f4f7fa; }
.cs-limit-strip b { color: var(--cs-ink); }

.cs-calculation-header > label { min-width: 255px; }
.cs-calculation-header > div:last-child { min-width: 230px; padding-inline-start: 20px; border-inline-start: 1px solid rgba(255,255,255,.2); }
.cs-calculation-header > div:last-child span, .cs-calculation-header > div:last-child small { display: block; color: #cbdce9; font-size: .7rem; }
.cs-calculation-header > div:last-child strong { display: block; margin: 5px 0; color: #ffe1a1; font-size: 1.3rem; white-space: nowrap; }
.cs-waterfall { display: grid; gap: 7px; }
.cs-waterfall > div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #e3e8ef; border-radius: 11px; background: #fbfcfd; }
.cs-waterfall > div > b { display: grid; width: 30px; height: 30px; place-items: center; color: #53708c; border-radius: 8px; background: #e9eff5; }
.cs-waterfall span strong, .cs-waterfall span small { display: block; }
.cs-waterfall span strong { color: var(--cs-ink); font-size: .73rem; }
.cs-waterfall span small { color: var(--cs-muted); font-size: .63rem; }
.cs-waterfall em { color: #146c58; font-size: .76rem; font-style: normal; font-weight: 900; direction: rtl; }
.cs-waterfall em.negative { color: #b13d3d; }
.cs-waterfall .total { color: #fff; border-color: transparent; background: linear-gradient(135deg,#123a68,#087873); }
.cs-waterfall .total > b { color: #fff; background: rgba(255,255,255,.15); }
.cs-waterfall .total span strong, .cs-waterfall .total em { color: #fff; }
.cs-waterfall .total span small { color: #cfe2e8; }
.cs-formula { display: grid; gap: 9px; padding: 18px; border: 1px solid #dce4ed; border-radius: 13px; background: #f8fafc; }
.cs-formula code { padding: 11px; color: #163e69; font: 800 .78rem var(--app-font, sans-serif); text-align: center; border-radius: 9px; background: #e9f1f8; }
.cs-formula b, .cs-formula span { padding-inline: 9px; color: #465d76; font-size: .7rem; }
.cs-formula strong { padding: 12px; color: #fff; font-size: 1rem; text-align: center; border-radius: 9px; background: #087f72; }
.cs-example-list { display: grid; gap: 8px; }
.cs-example-list > div { display: grid; grid-template-columns: 1fr auto; gap: 3px; padding: 11px; border: 1px solid #e1e7ed; border-radius: 10px; }
.cs-example-list span { color: #52667e; font-size: .7rem; }
.cs-example-list b { color: var(--cs-blue); font-size: .73rem; }
.cs-example-list small { grid-column: 1 / -1; color: #7d8b9b; font-size: .62rem; }

@media (max-width: 1180px) {
  .cs-command-card, .cs-calculation-header { grid-template-columns: 1fr auto; }
  .cs-protocol-proof, .cs-calculation-header > div:last-child { grid-column: 1 / -1; padding: 12px 0 0; border-inline-start: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .cs-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cs-process { grid-template-columns: repeat(3,minmax(140px,1fr)); }
  .cs-process > div:nth-child(3)::after { display: none; }
  .cs-import-flow { grid-template-columns: 1fr 1.5fr; }
  .cs-import-flow > div:last-child { grid-column: 1 / -1; }
  .cs-form-inline { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .cs-command-card, .cs-protocol-banner, .cs-calculation-header { grid-template-columns: 1fr; padding: 20px; }
  .cs-date-control, .cs-calculation-header > label { min-width: 0; }
  .cs-layout, .cs-layout-main { grid-template-columns: 1fr; }
  .cs-process { grid-template-columns: repeat(2,minmax(145px,1fr)); }
  .cs-process > div:nth-child(2n)::after { display: none; }
  .cs-import-flow, .cs-form, .cs-form-inline { grid-template-columns: 1fr; }
  .cs-import-flow > div:last-child, .cs-form .wide { grid-column: auto; }
  .cs-product-editor, .cs-region-grid { grid-template-columns: 1fr; }
  .cs-validation-summary, .cs-limit-strip { flex-direction: column; align-items: stretch; }
}

@media (max-width: 540px) {
  .cs-kpis { grid-template-columns: 1fr; }
  .cs-process { grid-template-columns: 1fr; }
  .cs-process > div::after { display: none; }
  .cs-title { flex-direction: column; }
  .cs-panel { padding: 16px; border-radius: 15px; }
}

@font-face {
  font-family: "IranNastaliqLocal2026";
  src:
    url("./assets/fonts/IranNastaliq.ttf") format("truetype"),
    url("./assets/gts-products/irannastaliq.ttf?v=20260827") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #fbf8ff;
  --surface: #ffffff;
  --surface-soft: #f4f2fc;
  --ink: #1a1b22;
  --muted: #667085;
  --line: #e3e1eb;
  --nav: #00288e;
  --nav-strong: #dde1ff;
  --blue: #1e40af;
  --teal: #10b981;
  --gold: #f59e0b;
  --red: #d92d20;
  --green: #10b981;
  --shadow: 0 10px 24px rgba(30, 41, 59, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  font-synthesis: none;
  font-variant-numeric: proportional-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body.auth-pending {
  overflow: hidden;
}

.login-screen {
  position: relative;
  display: none;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  background:
    radial-gradient(circle at 12% 16%, rgba(151, 91, 44, 0.22), transparent 29%),
    radial-gradient(circle at 88% 80%, rgba(189, 156, 125, 0.22), transparent 32%),
    linear-gradient(135deg, #fffdfa 0%, #f7f0e6 46%, #eadfd2 100%);
}

.login-screen::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(137, 104, 49, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(137, 104, 49, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 88%);
  pointer-events: none;
}

body.auth-pending .login-screen {
  display: grid;
}

.welcome-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 24%, rgba(16, 185, 129, 0.28), transparent 30%),
    radial-gradient(circle at 84% 72%, rgba(59, 130, 246, 0.32), transparent 34%),
    linear-gradient(135deg, #020617 0%, #0b1f5c 52%, #0f3a63 100%);
}

.welcome-screen[hidden] {
  display: none;
}

.welcome-screen::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  opacity: 0.75;
  pointer-events: none;
}

.welcome-card {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: 48px 42px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  box-shadow: 0 30px 90px rgba(0, 7, 36, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  color: #f8fafc;
  text-align: center;
}

.welcome-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
  font-size: 13px;
  font-weight: 900;
}

.welcome-card > strong {
  display: block;
  color: #a7f3d0;
  font-size: 18px;
  font-weight: 900;
}

.welcome-card h1 {
  margin: 14px 0 8px;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.8px;
}

.welcome-card p,
.welcome-card small {
  color: rgba(226, 232, 240, 0.82);
  font-weight: 700;
}

.welcome-loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.welcome-loader span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fbbf24;
  animation: welcomePulse 900ms ease-in-out infinite alternate;
}

.welcome-loader span:nth-child(2) {
  animation-delay: 120ms;
}

.welcome-loader span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes welcomePulse {
  from {
    opacity: 0.35;
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.app-shell.is-locked {
  display: none;
}

.login-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(111, 66, 31, 0.2);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 90px rgba(111, 66, 31, 0.1);
}

.login-glow::after {
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(111, 66, 31, 0.12);
  border-radius: inherit;
  content: "";
}

.login-glow-one {
  top: -110px;
  right: -70px;
}

.login-glow-two {
  bottom: -130px;
  left: -90px;
  transform: scale(1.25);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 30px 36px 26px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  box-shadow: 0 30px 90px rgba(0, 7, 36, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  text-align: right;
}

.login-card::before {
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.18), transparent 34%, transparent 70%, rgba(255, 255, 255, 0.08));
  content: "";
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 290px);
  min-height: 48px;
  height: auto;
  margin: 0 auto 14px;
  padding: 10px 16px;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, rgba(204, 251, 241, 0.72), rgba(191, 219, 254, 0.34));
  color: #e0f2fe;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.login-heading {
  text-align: center;
}

.login-heading > span {
  position: relative;
  z-index: 1;
  color: #a7f3d0;
  font-size: 13px;
  font-weight: 800;
}

.login-heading h1 {
  position: relative;
  z-index: 1;
  margin: 8px 0 10px;
  color: #f8fafc;
  font-size: clamp(27px, 4vw, 34px);
  letter-spacing: -0.5px;
}

.login-heading p,
.login-note {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  line-height: 1.9;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-progress {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 18px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.22);
}

.auth-progress span {
  display: grid;
  min-height: 32px;
  place-items: center;
  border-radius: 9px;
  color: rgba(226, 232, 240, 0.58);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.auth-progress span.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.88), rgba(37, 99, 235, 0.88));
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.2);
}

.auth-step:not([hidden]) {
  display: grid;
  gap: 12px;
}

.auth-step[hidden] {
  display: none;
}

.login-mode-switch {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.24);
}

.login-mode-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.login-mode-button:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.login-mode-button.active {
  border-color: rgba(167, 243, 208, 0.5);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.94), rgba(37, 99, 235, 0.94));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.2);
}

.registration-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(167, 243, 208, 0.2);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.16);
}

.registration-fields[hidden],
.otp-fields[hidden] {
  display: none;
}

.registration-hint {
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.8;
}

.captcha-box {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(186, 230, 253, 0.22);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.2);
}

.captcha-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.captcha-heading button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid rgba(167, 243, 208, 0.45);
  border-radius: 9px;
  background: rgba(20, 184, 166, 0.12);
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  direction: rtl;
}

.captcha-row strong {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.94), rgba(219, 234, 254, 0.86));
  color: #172554;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 5px;
  direction: ltr;
}

.captcha-row input {
  min-height: 46px;
  text-align: center;
}

.otp-fields {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.otp-timer {
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.login-field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
}

.login-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.24);
  color: #f8fafc;
  outline: none;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.login-field input::placeholder {
  color: rgba(226, 232, 240, 0.56);
}

.login-field input:focus {
  border-color: rgba(167, 243, 208, 0.78);
  background: rgba(15, 23, 42, 0.36);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.13), 0 8px 24px rgba(2, 6, 23, 0.1);
}

.login-error {
  position: relative;
  z-index: 1;
  min-height: 21px;
  margin: -2px 0 -4px;
  color: #fecaca;
  font-size: 12px;
  font-weight: 700;
}

.login-error:not(:empty) {
  padding: 10px 12px;
  border: 1px solid rgba(253, 186, 116, 0.38);
  border-radius: 12px;
  background: rgba(124, 45, 18, 0.2);
}

.login-submit {
  position: relative;
  z-index: 1;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #2563eb);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(14, 116, 144, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 15px 30px rgba(14, 116, 144, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11px;
}

button,
input,
select,
textarea {
  font: inherit;
}

html,
body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  background: linear-gradient(#00288e, #172554);
  color: #ffffff;
}

.brand-block,
.identity,
.panel-title,
.toolbar,
.search-box,
.select-control,
.sidebar-nav button,
.primary-action,
.icon-button,
.status-chip,
.chart-legend,
.progress-row {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
  min-width: 0;
}

.brand-icon,
.identity-icon,
.panel-title > span,
.nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
  line-height: 1;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: #dde1ff;
  color: #00288e;
}

.brand-block strong,
.identity strong {
  display: block;
  white-space: nowrap;
}

.brand-block small,
.identity small,
.panel-title small,
.sidebar-status small,
.kpi-card small,
.metric-card small {
  display: block;
  color: inherit;
  opacity: 0.72;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.sidebar-nav button {
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  text-align: right;
}

.sidebar-nav button:hover,
.sidebar-nav button.active {
  background: var(--nav-strong);
  border-color: rgba(221, 225, 255, 0.2);
}

.sidebar-nav button.active {
  color: #001453;
}

.nav-icon {
  width: 34px;
  height: 26px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 11px;
}

.sidebar-status {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(221, 225, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 20, 83, 0.36);
}

.sidebar-status span {
  color: #dde1ff;
  font-size: 12px;
}

.sidebar-status strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 18px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.identity {
  gap: 12px;
  min-width: 260px;
}

.identity-icon,
.panel-title > span {
  width: 42px;
  height: 42px;
  background: #dde1ff;
  color: var(--blue);
  font-size: 11px;
}

.toolbar {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.user-session {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}

.user-session-label {
  color: var(--muted);
  font-size: 11px;
}

.user-session strong {
  color: var(--blue);
  font-size: 13px;
}

.logout-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
}

.access-settings-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.access-settings-button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.logout-button:hover {
  border-color: #98a2b3;
  background: #f8fafc;
}

.search-box,
.select-control,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-box {
  gap: 8px;
  width: min(360px, 42vw);
  padding: 0 12px;
}

.search-box span,
.select-control span {
  font-size: 12px;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.select-control {
  gap: 8px;
  padding: 0 10px;
}

.select-control select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.select-control.standalone {
  width: fit-content;
}

.icon-button {
  padding: 0 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-card,
.primary-panel,
.attention-panel,
.panel,
.upload-panel,
.personal-card,
.result-panel,
.sale-card,
.collection-item,
.payment-column,
.setting-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 122px;
  padding: 18px;
  overflow: hidden;
}

.kpi-card strong {
  display: block;
  margin: 9px 0 8px;
  font-size: clamp(18px, 2vw, 24px);
}

.kpi-card mark {
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(23, 33, 30, 0.07);
  color: inherit;
  white-space: nowrap;
}

.kpi-card.blue {
  border-color: var(--line);
  border-top: 3px solid #1e40af;
}

.kpi-card.gold {
  border-color: var(--line);
  border-top: 3px solid #f59e0b;
}

.kpi-card.green {
  border-color: var(--line);
  border-top: 3px solid #10b981;
}

.dashboard-grid,
.split-grid,
.entry-layout,
.commission-layout,
.personal-layout {
  display: grid;
  gap: 14px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  margin-bottom: 14px;
}

.split-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.primary-panel,
.attention-panel,
.panel {
  padding: 18px;
}

.wide-panel {
  min-height: calc(100vh - 124px);
}

.panel-title {
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h1,
.panel-title h2 {
  margin: 3px 0 0;
  font-size: 21px;
  line-height: 1.45;
}

.panel-title h2 {
  font-size: 18px;
}

.chart-box {
  min-height: 340px;
}

.chart-legend {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 6px;
  border-radius: 2px;
}

.legend-sales {
  background: var(--blue);
}

.legend-target {
  background: var(--gold);
}

.legend-collection {
  background: var(--teal);
}

.legend-commission {
  background: #6d5bd0;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 274px;
  padding: 18px 10px 0;
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(23, 33, 30, 0.08) 1px, transparent 1px) 0 0 / 100% 25%,
  var(--surface-soft);
}

.line-chart {
  position: relative;
  min-height: 280px;
  padding: 0;
  border-radius: 8px;
  background: #fff;
}

.trend-svg {
  display: block;
  width: 100%;
  height: 310px;
  overflow: visible;
}

.trend-grid {
  stroke: var(--line);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.trend-axis-label,
.trend-month-label {
  fill: var(--muted);
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
}

.trend-month-label {
  font-size: 12px;
}

.trend-line,
.trend-point {
  vector-effect: non-scaling-stroke;
}

.trend-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-area {
  fill: url(#sales-area-gradient);
}

.trend-line-commission {
  stroke-dasharray: 5 4;
  opacity: 0.78;
}

.trend-point {
  stroke: #fff;
  stroke-width: 2;
}

.trend-tooltip {
  position: absolute;
  z-index: 4;
  width: min(260px, calc(100% - 24px));
  padding: 11px 13px;
  border: 1px solid #d9dce8;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(30, 41, 59, 0.14);
  color: var(--ink);
  direction: rtl;
  font-size: 12px;
  pointer-events: none;
}

.trend-tooltip[hidden] {
  display: none;
}

.trend-tooltip-title {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
}

.trend-tooltip-row {
  display: grid;
  grid-template-columns: 10px minmax(54px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  white-space: nowrap;
}

.trend-tooltip-row b {
  font-weight: 800;
}

.tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tooltip-sales {
  background: var(--blue);
}

.tooltip-target {
  background: var(--gold);
}

.tooltip-collection {
  background: var(--teal);
}

.tooltip-commission {
  background: #6d5bd0;
}

.month-group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  height: 245px;
}

.month-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 4px;
}

.month-bars span {
  min-height: 8px;
  border-radius: 5px 5px 0 0;
}

.bar-sales {
  background: var(--blue);
}

.bar-target {
  background: var(--gold);
}

.bar-collection {
  background: var(--teal);
}

.bar-commission {
  background: #6d5bd0;
}

.month-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.alert-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.alert-list li {
  padding: 12px;
  border-radius: 8px;
  background: #ffdadb;
  border: 1px solid #ffb2b7;
  color: #920029;
  line-height: 1.75;
}

.primary-action {
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.table-frame {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  justify-content: center;
  min-width: 116px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.status-success {
  background: #d1fae5;
  color: #065f46;
}

.status-critical {
  background: #ffdadb;
  color: #920029;
}

.score-board,
.sales-grid,
.collection-list,
.payment-board,
.settings-grid {
  display: grid;
  gap: 12px;
}

.score-board {
  grid-template-columns: 1fr;
}

.metric-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 21px;
}

.entry-layout,
.commission-layout {
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1fr);
}

.data-form,
.calculator {
  display: grid;
  gap: 12px;
}

.data-form label,
.calculator label {
  display: grid;
  gap: 7px;
}

.data-form input,
.calculator input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  background: #f7fbff;
}

.upload-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.import-status {
  padding: 11px;
  border-radius: 8px;
  background: #edf5f2;
  color: var(--teal);
}

.sales-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.sale-card,
.collection-item,
.payment-column,
.setting-card,
.personal-card,
.result-panel {
  padding: 16px;
}

.progress-row {
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.progress-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ece8;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.personal-layout {
  grid-template-columns: 250px minmax(280px, 1fr);
}

.personal-card {
  display: grid;
  gap: 14px;
}

.personal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.personal-stats div {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.collection-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 14px;
  align-items: center;
}

.commission-layout {
  align-items: start;
}

.calculator output {
  color: var(--teal);
  font-weight: 800;
}

.result-panel strong {
  display: block;
  margin: 10px 0;
  font-size: 28px;
}

.payment-board {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: start;
}

.payment-column h2 {
  margin-top: 0;
  font-size: 17px;
}

.payment-card {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.setting-card strong {
  display: block;
  margin-bottom: 8px;
}

.setting-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.access-management-panel,
.access-summary-panel,
.access-denied-panel {
  min-width: 0;
  padding: 18px;
}

.access-intro {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.9;
}

.access-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) minmax(220px, 1.5fr) 110px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.access-row:first-child {
  border-top: 0;
}

.access-row-heading {
  padding-block: 10px;
  border-top: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.access-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.access-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.access-status-on {
  background: #e7f8ef;
  color: #087443;
}

.access-status-off {
  background: #fef0ef;
  color: #b42318;
}

.permission-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.permission-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 160ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.24);
  content: "";
  transition: transform 160ms ease;
}

.permission-toggle input:checked + .toggle-track {
  background: var(--teal);
}

.permission-toggle input:checked + .toggle-track::after {
  transform: translateX(-16px);
}

.permission-toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.access-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.access-denied-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.employer-management-panel {
  grid-column: 1 / -1;
}

.employer-admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, #f7fbff);
}

.employer-admin-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.employer-admin-form input,
.employer-admin-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cfd6e6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.menu-access-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.menu-access-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d7ddeb;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.menu-access-chip input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--nav);
}

.employer-admin-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.employer-admin-list {
  display: grid;
  gap: 10px;
}

.employer-admin-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 10px;
  padding: 12px 14px;
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
}

.employer-admin-list-heading strong,
.employer-admin-list-heading small {
  display: block;
}

.employer-admin-list-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.employer-admin-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1.5fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.employer-admin-row strong,
.employer-admin-row small {
  display: block;
}

.employer-admin-row small,
.employer-admin-row p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.employer-admin-row p {
  margin: 0;
}

.support-contract-panel {
  max-width: 1180px;
  margin: 0 auto;
  min-width: 0;
}

.contract-toolbar,
.contract-section-heading,
.signature-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.contract-toolbar {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.contract-toolbar strong,
.contract-toolbar small {
  display: block;
}

.contract-toolbar small,
.contract-section > p,
.contract-section li,
.contract-section-heading p {
  color: var(--muted);
  line-height: 1.9;
}

.contract-toolbar small {
  margin-top: 4px;
  font-size: 12px;
}

.contract-role-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #e5eee9;
}

.role-button,
.secondary-action,
.table-action {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.role-button.active {
  border-color: var(--nav);
  background: var(--nav);
  color: #fff;
}

.contract-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.contract-meta-grid label {
  display: grid;
  gap: 7px;
}

.contract-meta-grid span {
  color: var(--muted);
  font-size: 12px;
}

.contract-meta-grid input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.contract-draft-note,
.read-only-badge,
.contract-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 12px;
}

.contract-draft-note {
  display: block;
  margin-bottom: 20px;
  background: #fff8e9;
  color: #8d621c;
  line-height: 1.8;
}

.contract-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contract-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.contract-section h2 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.6;
}

.contract-section p {
  margin: 8px 0 0;
}

.contract-section ul,
.contract-section ol {
  margin: 8px 0 0;
  padding-right: 22px;
}

.contract-section li + li {
  margin-top: 5px;
}

.contract-section-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

.contract-section-heading h2 {
  margin-bottom: 0;
}

.contract-section-heading p {
  margin: 4px 0 0;
  font-size: 12px;
}

.contract-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.secondary-action {
  border-color: rgba(21, 131, 111, 0.28);
  background: #edf8f4;
  color: var(--teal);
}

.contract-save-status {
  background: #f2f5f3;
  color: var(--muted);
}

.read-only-badge {
  background: #edf1ff;
  color: #4059a9;
}

.contract-table-frame {
  overflow-x: auto;
}

.contract-table {
  min-width: 800px;
}

.contract-table th,
.contract-table td {
  vertical-align: middle;
}

.contract-table th:nth-child(1) {
  width: 64px;
}

.contract-table th:nth-child(2),
.contract-table td:nth-child(2) {
  width: 34%;
  min-width: 290px;
}

.contract-table th:nth-child(3),
.contract-table th:nth-child(4),
.contract-table th:nth-child(5) {
  min-width: 150px;
}

.contract-table-input {
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid #bfd6cd;
  border-radius: 6px;
  background: #fbfffd;
  color: var(--ink);
}

.contract-subject-input {
  min-height: 66px;
  padding: 8px 9px;
  line-height: 1.8;
  resize: vertical;
  white-space: pre-wrap;
}

.contract-subject-text {
  display: block;
  min-width: 260px;
  line-height: 1.9;
  white-space: normal;
  overflow-wrap: anywhere;
}

.contract-number-input {
  min-width: 132px;
}

.contract-amount-cell {
  font-weight: 800;
  color: var(--teal);
  white-space: nowrap;
}

.table-action {
  min-height: 34px;
  padding-inline: 10px;
}

.danger-action {
  border-color: rgba(196, 71, 71, 0.24);
  background: #fff3f3;
  color: var(--red);
}

.empty-contract-row {
  padding: 22px !important;
  color: var(--muted);
  text-align: center;
}

.sla-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}

.sla-grid article {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sla-grid strong {
  color: var(--teal);
}

.sla-grid p {
  margin-bottom: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.contract-warning-section {
  padding: 16px;
  border: 1px solid rgba(196, 71, 71, 0.2);
  border-radius: 8px;
  background: #fffafa;
}

.contract-warning-section h2 {
  color: var(--red);
}

.signature-grid {
  align-items: stretch;
  margin-top: 26px;
}

.signature-grid div {
  display: grid;
  gap: 10px;
  width: 48%;
  min-height: 120px;
  padding: 14px;
  border: 1px dashed #b8c9c2;
  border-radius: 8px;
}

.signature-grid span {
  color: var(--muted);
  font-size: 13px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full-panel {
  grid-column: 1 / -1;
}

.sales-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.pipeline-card {
  position: relative;
}

.pipeline-card > b {
  position: absolute;
  top: 12px;
  left: 14px;
  color: var(--teal);
  font-size: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.marketer-list,
.rule-stack,
.timeline {
  display: grid;
  gap: 10px;
}

.marketer-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}

.marketer-picker span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
}

.marketer-picker b {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--teal);
}

.marketer-picker.active {
  border-color: var(--teal);
  background: #edf8f4;
}

.explain-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d8e8f3;
  border-radius: 10px;
  background: #f7fbff;
}

.explain-box p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.progress-cell {
  display: grid;
  gap: 6px;
  min-width: 110px;
}

.progress-cell b {
  font-size: 12px;
}

.progress-cell > span {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efec;
}

.progress-cell i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.rule-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.rule-card code,
.timeline code {
  color: var(--teal);
  font-family: inherit;
}

.rule-card span,
.timeline span,
.timeline small {
  color: var(--muted);
  font-size: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.timeline code {
  grid-column: 2;
}

.import-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #b8c9c2;
  border-radius: 10px;
  background: #fbfffd;
}

.upload-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.compact-title {
  margin-top: 20px;
}

.status-review {
  background: #fff7e8;
  color: #9a6b1f;
}

/* Unified polymer operations portal */
.login-screen {
  grid-template-columns: minmax(0, 720px) minmax(400px, 520px);
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 6vw, 86px);
  padding: 34px clamp(24px, 5vw, 84px);
}

.login-context {
  position: relative;
  z-index: 1;
  width: 100%;
  color: #f8fafc;
}

.login-context-kicker,
.hub-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 12px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.14);
  color: #99f6e4;
  font-size: 12px;
  font-weight: 900;
}

.login-context h2 {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 720px;
  margin: 0 0 14px;
  padding: clamp(20px, 2.6vw, 30px) clamp(22px, 3vw, 34px);
  border: 1px solid rgba(111, 66, 31, 0.36);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(251, 242, 229, 0.64)),
    radial-gradient(circle at 100% 0, rgba(170, 111, 57, 0.18), transparent 48%);
  box-shadow:
    0 28px 70px rgba(79, 45, 24, 0.17),
    0 8px 24px rgba(111, 66, 31, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #f6d675;
  font-family: "IranNastaliqLocal2026", "Vazirmatn", Tahoma, sans-serif;
  font-size: clamp(43px, 5vw, 66px);
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.login-context h2 > span {
  display: block;
  width: 100%;
  padding-block: 3px 10px;
  background: linear-gradient(180deg, #542c12 3%, #c48b3b 48%, #6f3815 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 1px rgba(255, 255, 255, 0.82)) drop-shadow(0 5px 13px rgba(75, 39, 18, 0.2));
}

.login-context .hero-title-primary {
  font-size: clamp(36px, 3.15vw, 50px);
  line-height: 1.75;
  white-space: nowrap;
}

.login-context .hero-title-secondary {
  margin-top: -0.12em;
  font-size: clamp(45px, 4.05vw, 61px);
  line-height: 1.68;
  white-space: nowrap;
}

.login-context h2::before {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 84, 38, 0.72), transparent);
  content: "";
}

.login-context > p {
  max-width: 690px;
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 16px;
  font-weight: 600;
  line-height: 2;
}

.login-context-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.login-context-modules span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.login-context-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
}

.login-context-status i,
.module-panel-state i,
.module-card-footer em i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 14%, transparent);
}

.login-card {
  width: 100%;
  max-width: 520px;
  border-color: rgba(119, 72, 34, 0.3);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.91), rgba(250, 240, 227, 0.74));
  box-shadow: 0 32px 80px rgba(75, 43, 23, 0.2), 0 10px 26px rgba(111, 66, 31, 0.09), inset 0 1px 0 #fff;
  color: #4b3024;
}

.login-card::before {
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.72), transparent 34%, transparent 70%, rgba(117, 67, 31, 0.08));
}

.login-brand {
  border-color: rgba(119, 72, 34, 0.36);
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(220, 187, 151, 0.7));
  box-shadow: 0 12px 28px rgba(82, 46, 24, 0.15), inset 0 1px 0 #fff;
  color: #60371c;
}

.login-heading > span { color: #8a4d25; }
.login-heading h1 { color: #4b3024; }
.login-heading p,
.login-note { color: #667085; }

.auth-progress,
.login-mode-switch {
  border-color: rgba(166, 123, 47, 0.2);
  background: rgba(239, 232, 219, 0.68);
}

.auth-progress span,
.login-mode-button { color: #7a8290; }

.auth-progress span.active,
.login-mode-button.active {
  border-color: rgba(122, 84, 21, 0.28);
  background: linear-gradient(135deg, #b77730, #6d3c1d);
  box-shadow: 0 8px 18px rgba(84, 45, 20, 0.2);
}

.login-mode-button:hover { color: #6e4c16; }

.captcha-box,
.registration-fields {
  border-color: rgba(166, 123, 47, 0.24);
  background: rgba(255, 255, 255, 0.52);
}

.captcha-heading,
.login-field { color: #50372a; }

.captcha-heading button {
  border-color: rgba(154, 112, 39, 0.36);
  background: #f7eedc;
  color: #70401f;
}

.captcha-row input {
  border: 1px solid rgba(148, 119, 70, 0.34);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.82);
  color: #4a3025;
}

.captcha-row input:focus {
  border-color: rgba(177, 129, 45, 0.75);
  box-shadow: 0 0 0 4px rgba(195, 151, 70, 0.12);
}

.login-field input {
  border-color: rgba(148, 119, 70, 0.34);
  background: rgba(255, 255, 255, 0.78);
  color: #4a3025;
}

.login-field input::placeholder { color: #9ba0a9; }

.login-field input:focus {
  border-color: rgba(177, 129, 45, 0.75);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(195, 151, 70, 0.12), 0 10px 24px rgba(100, 76, 35, 0.08);
}

.login-submit {
  border-color: rgba(109, 75, 20, 0.28);
  background: linear-gradient(135deg, #b97830, #67391d);
  box-shadow: 0 13px 28px rgba(82, 43, 19, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.login-note { border-top-color: rgba(155, 120, 62, 0.2); }

.login-context { color: #4b3024; }
.login-context > p { color: #6c5b50; }

.login-context-modules span {
  border-color: rgba(119, 72, 34, 0.24);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 7px 18px rgba(96, 72, 32, 0.06);
  color: #594438;
}

.login-context-status { color: #0f766e; }

.module-hub {
  min-height: 100vh;
  background:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    #f5f7fb;
  background-size: 36px 36px;
}

.module-hub.is-locked {
  display: none;
}

.hub-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid #e5e9f1;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #111827;
  text-decoration: none;
}

.hub-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #0f766e, #0f3a8a);
  box-shadow: 0 10px 24px rgba(15, 58, 138, 0.2);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.hub-brand strong,
.hub-brand small,
.hub-session small,
.hub-session strong {
  display: block;
}

.hub-brand strong {
  font-size: 15px;
}

.hub-brand small {
  margin-top: 2px;
  color: #718096;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hub-session {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-session small {
  color: #8490a3;
  font-size: 10px;
}

.hub-session strong {
  max-width: 180px;
  overflow: hidden;
  color: #1f2937;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #e9effb;
  color: #0f3a8a;
  font-weight: 900;
}

.hub-logout-button,
.hub-settings-button,
.module-back-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dce2eb;
  border-radius: 9px;
  background: #fff;
  color: #4b5563;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
}

.hub-settings-button {
  border-color: #c8d8f4;
  background: #eef4ff;
  color: #174ea6;
}

.hub-logout-button:hover,
.hub-settings-button:hover {
  transform: translateY(-1px);
}

.toolbar > [hidden] {
  display: none !important;
}

.hub-content {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px) clamp(20px, 5vw, 72px) 54px;
}

.hub-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 30px;
  padding: clamp(28px, 4vw, 50px);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.18), transparent 28%),
    linear-gradient(118deg, #06142d, #0d2f5f 64%, #0f766e);
  box-shadow: 0 24px 60px rgba(15, 35, 70, 0.18);
  color: #fff;
}

.hub-hero::after {
  position: absolute;
  inset: 0 58% 0 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 30px 30px;
  content: "";
  pointer-events: none;
}

.hub-hero > * {
  position: relative;
  z-index: 1;
}

.hub-kicker b {
  margin-right: 4px;
  color: #fff;
}

.hub-hero h1 {
  margin: 20px 0 8px;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -1px;
}

.hub-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.9;
}

.hub-date {
  flex: 0 0 auto;
  min-width: 170px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.hub-date small,
.hub-date strong {
  display: block;
}

.hub-date small {
  color: #99f6e4;
  font-size: 10px;
  font-weight: 800;
}

.hub-date strong {
  margin-top: 6px;
  font-size: 13px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  position: relative;
  display: flex;
  grid-column: span 2;
  min-height: 285px;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #e2e7ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
  color: #111827;
  font: inherit;
  text-align: right;
  transition: 180ms ease;
}

.module-card:hover {
  border-color: color-mix(in srgb, var(--module-color) 36%, #e2e7ef);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--module-color) 14%, transparent);
  transform: translateY(-5px);
}

.module-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--module-color);
  content: "";
}

.module-card::after {
  position: absolute;
  top: -80px;
  left: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--module-soft);
  content: "";
  opacity: 0.75;
  pointer-events: none;
}

.module-card-top,
.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-card-top {
  position: relative;
  z-index: 1;
}

.module-card-top > b {
  color: var(--module-color);
  font-size: 12px;
}

.module-card-top > i {
  color: #8a96a8;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.module-card-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  margin: 24px 0 18px;
  place-items: center;
  border-radius: 15px;
  background: var(--module-soft);
  color: var(--module-color);
  font-size: 12px;
  font-weight: 900;
}

.module-card-copy {
  display: block;
}

.module-card-copy strong,
.module-card-copy small {
  display: block;
}

.module-card-copy strong {
  font-size: 20px;
  letter-spacing: -0.35px;
}

.module-card-copy small {
  min-height: 50px;
  margin-top: 8px;
  color: #687386;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.85;
}

.module-card-footer {
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid #edf0f4;
}

.module-card-footer em {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7b8798;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.module-card-footer em i {
  width: 6px;
  height: 6px;
  color: var(--module-color);
}

.module-card-footer > b {
  color: var(--module-color);
  font-size: 11px;
}

.hub-access-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 0;
  color: #7b8798;
  font-size: 11px;
  font-weight: 700;
}

.hub-access-note span {
  color: #0f766e;
  font-size: 8px;
}

.hub-empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  border: 1px dashed #cfd7e4;
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.hub-empty-state strong {
  font-size: 18px;
}

.hub-empty-state p {
  margin-bottom: 0;
  color: #718096;
}

.app-shell[data-module] .sidebar {
  background: linear-gradient(165deg, var(--active-module), color-mix(in srgb, var(--active-module) 74%, #07142d));
}

.app-shell[data-module] .brand-icon,
.app-shell[data-module] .identity-icon,
.app-shell[data-module] .panel-title > span {
  background: var(--active-module-soft);
  color: var(--active-module);
}

.module-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.module-back-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.module-panel-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--module-color) 20%, #e2e7ef);
  border-radius: 18px;
  background: linear-gradient(120deg, #fff, var(--module-soft));
}

.module-panel-hero::after {
  position: absolute;
  left: -50px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border: 36px solid color-mix(in srgb, var(--module-color) 10%, transparent);
  border-radius: 50%;
  content: "";
}

.module-panel-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.module-panel-title > span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 17px;
  background: var(--module-color);
  box-shadow: 0 12px 25px color-mix(in srgb, var(--module-color) 22%, transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.module-panel-title small {
  color: var(--module-color);
  font-size: 10px;
  font-weight: 900;
}

.module-panel-title h1 {
  margin: 3px 0 4px;
  font-size: clamp(24px, 3vw, 36px);
}

.module-panel-title p {
  margin: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.module-panel-state {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--module-color) 25%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--module-color);
  font-size: 10px;
  font-weight: 900;
}

.module-blueprint {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.module-blueprint-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #edf0f4;
}

.module-blueprint-heading span {
  color: var(--active-module);
  font-size: 10px;
  font-weight: 900;
}

.module-blueprint-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.module-blueprint-heading p {
  max-width: 520px;
  margin: 0;
  color: #738094;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.8;
}

.module-blueprint-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.module-blueprint-grid article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid #e8ecf2;
  border-radius: 14px;
  background: #fafbfc;
}

.module-blueprint-grid article > span,
.module-blueprint-grid strong {
  display: block;
}

.module-blueprint-grid article > span {
  color: var(--active-module);
  font-size: 10px;
  font-weight: 900;
}

.module-blueprint-grid strong {
  margin-top: 16px;
  font-size: 13px;
}

.module-blueprint-grid p {
  margin: 7px 0 0;
  color: #7b8798;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.8;
}

.ops-module-body {
  --ops-color: var(--active-module, #087f5b);
  --ops-soft: var(--active-module-soft, #e7f8f1);
  margin-top: 18px;
}

.ops-module-body *,
.ops-module-body *::before,
.ops-module-body *::after {
  box-sizing: border-box;
}

.ops-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid #e4e9f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(31, 42, 68, 0.055);
}

.ops-card + .ops-card,
.ops-grid + .ops-card,
.ops-metric-grid + .ops-grid,
.ops-metric-grid + .ops-card {
  margin-top: 16px;
}

.ops-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.ops-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-grid-form {
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.75fr);
}

.ops-grid > .ops-card {
  margin-top: 0;
}

.ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 13px;
}

.ops-metric-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #e4e9f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 42, 68, 0.045);
}

.ops-metric-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: #c8d2df;
  content: "";
}

.ops-metric-card.is-primary::before { background: var(--ops-color); }
.ops-metric-card.is-warning::before { background: #e9a23b; }
.ops-metric-card.is-danger::before { background: #d74747; }

.ops-metric-card span,
.ops-metric-card small {
  display: block;
  color: #758197;
  font-size: 10px;
  font-weight: 800;
}

.ops-metric-card strong {
  display: block;
  margin: 9px 0 7px;
  color: #142033;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.25;
}

.ops-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid #edf0f4;
}

.ops-section-head > div {
  min-width: 0;
}

.ops-section-head span {
  display: block;
  color: var(--ops-color);
  font-size: 9px;
  font-weight: 900;
}

.ops-section-head h2 {
  margin: 4px 0 5px;
  color: #19263a;
  font-size: 18px;
}

.ops-section-head p {
  max-width: 720px;
  margin: 0;
  color: #768398;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.85;
}

.ops-primary-button,
.ops-secondary-button,
.ops-link-button,
.ops-table-button,
.ops-row-actions button,
.ops-product-card footer button {
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.ops-primary-button,
.ops-product-card footer button {
  padding: 11px 16px;
  background: var(--ops-color);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--ops-color) 20%, transparent);
  color: #fff;
}

.ops-secondary-button,
.ops-link-button,
.ops-table-button,
.ops-row-actions button {
  padding: 9px 12px;
  background: var(--ops-soft);
  color: var(--ops-color);
}

.ops-primary-button:hover,
.ops-secondary-button:hover,
.ops-link-button:hover,
.ops-table-button:hover,
.ops-row-actions button:hover,
.ops-product-card footer button:hover {
  transform: translateY(-1px);
}

.ops-row-actions button.is-primary {
  background: var(--ops-color);
  color: #fff;
}

.ops-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--ops-color) 22%, #e5eaf0);
  border-radius: 13px;
  background: var(--ops-soft);
}

.ops-notice span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--ops-color);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.ops-notice p {
  margin: 0;
  color: #263449;
  font-size: 11px;
  font-weight: 700;
}

.ops-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.ops-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ops-form label > span,
.ops-catalog-toolbar label > span {
  color: #536177;
  font-size: 10px;
  font-weight: 900;
}

.ops-form input,
.ops-form select,
.ops-catalog-toolbar input,
.ops-formula-components input,
.ops-formula-components select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #dbe2eb;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfe;
  color: #1f2d40;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.ops-form input:focus,
.ops-form select:focus,
.ops-catalog-toolbar input:focus,
.ops-formula-components input:focus,
.ops-formula-components select:focus {
  border-color: var(--ops-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ops-color) 11%, transparent);
  background: #fff;
}

.ops-span-2 {
  grid-column: 1 / -1;
}

.ops-form-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 4px;
}

.ops-form-actions small {
  color: #7a8798;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.7;
}

.ops-help-card {
  align-self: start;
  background: linear-gradient(145deg, #fff, var(--ops-soft));
}

.ops-help-icon {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--ops-color);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.ops-help-card h3 {
  margin: 15px 0 8px;
  color: #1a273b;
  font-size: 15px;
}

.ops-help-card ul {
  margin: 0;
  padding-right: 18px;
  color: #637086;
  font-size: 10px;
  font-weight: 650;
  line-height: 2;
}

.ops-warning-box {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid #f0ca89;
  border-radius: 12px;
  background: #fff9ed;
}

.ops-warning-box strong,
.ops-warning-box p {
  display: block;
  margin: 0 0 8px;
  color: #7a5316;
  font-size: 10px;
}

.ops-table-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e7ebf0;
  border-radius: 13px;
  scrollbar-width: thin;
}

.ops-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
  text-align: right;
}

.ops-table th,
.ops-table td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf0f4;
  color: #344258;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  vertical-align: middle;
}

.ops-table th {
  background: #f7f9fb;
  color: #67758a;
  font-size: 9px;
  font-weight: 900;
}

.ops-table tbody tr:last-child td {
  border-bottom: 0;
}

.ops-table tbody tr:hover td {
  background: #fbfcfd;
}

.ops-table-sub {
  display: block;
  margin-top: 4px;
  color: #8792a3;
  font-size: 8px;
}

.ops-external-quotes .ops-table {
  min-width: 1180px;
}

.ops-external-state {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  background: #f8fafc;
  color: #526177;
  font-size: 10px;
  font-weight: 800;
}

.ops-external-state.is-loading {
  border-color: #ddd2fa;
  background: #f8f5ff;
  color: #6d45b8;
}

.ops-external-state.is-error {
  border-color: #f2c6c6;
  background: #fff4f4;
  color: #a82e2e;
}

.ops-external-state.is-success {
  border-color: #bfe6d3;
  background: #effaf5;
  color: #087f5b;
}

.ops-external-product {
  display: block;
  max-width: 260px;
  color: #263449;
  text-decoration: none;
  white-space: normal;
}

.ops-external-product b,
.ops-external-product small {
  display: block;
}

.ops-external-product small {
  margin-top: 4px;
  color: #7a8799;
  font-size: 8px;
}

.ops-external-product:hover b {
  color: var(--active-module, #7c3aed);
}

.ops-verified-mobile {
  color: #087f5b;
}

.ops-quote-status-control {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ops-quote-status-control select {
  min-width: 126px;
  padding: 7px 9px;
  border: 1px solid #dbe1e9;
  border-radius: 9px;
  background: #fff;
  color: #344258;
  font: inherit;
}

.ops-empty-cell {
  padding: 28px !important;
  color: #8792a3 !important;
  text-align: center;
}

.ops-emphasis,
.ops-positive { color: #087f5b; }
.ops-negative { color: #c64141; }

.ops-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.ops-badge-success { background: #e6f7ef; color: #087f5b; }
.ops-badge-warning { background: #fff3dc; color: #a96504; }
.ops-badge-danger { background: #fde9e9; color: #b83232; }
.ops-badge-neutral { background: #eef1f5; color: #58667a; }

.ops-process-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.ops-process-summary > div {
  padding: 11px;
  border-radius: 11px;
  background: #f7f9fb;
}

.ops-process-summary span,
.ops-process-summary strong {
  display: block;
}

.ops-process-summary span { color: #7a8799; font-size: 8px; font-weight: 800; }
.ops-process-summary strong { margin-top: 6px; color: #263449; font-size: 13px; }

.ops-line-list {
  display: grid;
  gap: 9px;
}

.ops-line-list > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #edf0f4;
  border-radius: 11px;
}

.ops-line-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ops-color);
  box-shadow: 0 0 0 4px var(--ops-soft);
}

.ops-line-list b,
.ops-line-list small { display: block; }
.ops-line-list b { color: #263449; font-size: 10px; }
.ops-line-list small { margin-top: 4px; color: #8490a1; font-size: 8px; }

.ops-asset-grid,
.ops-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ops-asset-grid article,
.ops-definition-grid article {
  padding: 14px;
  border: 1px solid #e8ecf2;
  border-radius: 13px;
  background: #fafbfd;
}

.ops-asset-grid header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ops-asset-grid header > span,
.ops-definition-grid article > span { color: var(--ops-color); font-size: 8px; font-weight: 900; }
.ops-asset-grid h3,
.ops-definition-grid h3 { margin: 12px 0 5px; color: #263449; font-size: 12px; }
.ops-asset-grid p,
.ops-definition-grid p { margin: 0; color: #66748a; font-size: 9px; line-height: 1.8; }
.ops-asset-grid small { color: #8a95a5; font-size: 8px; }

.ops-definition-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-pareto {
  display: grid;
  gap: 13px;
}

.ops-pareto > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(100px, 2fr) auto;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  font-weight: 800;
}

.ops-pareto b {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef1f5;
}

.ops-pareto b i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ops-color), color-mix(in srgb, var(--ops-color) 55%, #fff));
}

.ops-pareto strong { color: #5b687c; font-size: 8px; }

.ops-material-flow,
.ops-balance-equation,
.ops-close-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ops-material-flow article {
  flex: 1;
  min-width: 110px;
  padding: 14px;
  border: 1px solid #e5eaf0;
  border-radius: 12px;
  background: #f9fafc;
  text-align: center;
}

.ops-material-flow article.is-result {
  border-color: color-mix(in srgb, var(--ops-color) 28%, #e5eaf0);
  background: var(--ops-soft);
}

.ops-material-flow span,
.ops-material-flow strong { display: block; }
.ops-material-flow span { color: #758197; font-size: 8px; font-weight: 800; }
.ops-material-flow strong { margin-top: 7px; color: #233146; font-size: 13px; }
.ops-material-flow > i { color: var(--ops-color); font-size: 16px; font-style: normal; font-weight: 900; }

.ops-balance-equation {
  justify-content: center;
  margin-top: 15px;
  padding: 13px;
  border-radius: 11px;
  background: #f6f8fa;
  color: #5d6b80;
  font-size: 10px;
  font-weight: 800;
}

.ops-close-bar {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--ops-color) 18%, #e4e9f0);
  border-radius: 13px;
  background: var(--ops-soft);
}

.ops-close-bar strong,
.ops-close-bar small { display: block; }
.ops-close-bar strong { color: #29374b; font-size: 11px; }
.ops-close-bar small { margin-top: 4px; color: #6f7c90; font-size: 8px; }

.ops-reconciliation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-reconciliation-summary > div {
  padding: 16px;
  border: 1px solid #e5eaf0;
  border-radius: 13px;
  background: #fafbfd;
}

.ops-reconciliation-summary > div.is-warning {
  border-color: #f0ca89;
  background: #fff9ed;
}

.ops-reconciliation-summary > div.is-success {
  border-color: #a9ddc7;
  background: #effaf5;
}

.ops-reconciliation-summary span,
.ops-reconciliation-summary strong,
.ops-reconciliation-summary small {
  display: block;
}

.ops-reconciliation-summary span {
  color: #68768b;
  font-size: 12px;
  font-weight: 850;
}

.ops-reconciliation-summary strong {
  margin: 8px 0 5px;
  color: #19263a;
  font-size: 21px;
}

.ops-reconciliation-summary small {
  color: #7d899a;
  font-size: 11px;
  line-height: 1.6;
}

.ops-reconciliation-status {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #a9ddc7;
  border-radius: 12px;
  background: #effaf5;
}

.ops-reconciliation-status.is-danger {
  border-color: #efb1b1;
  background: #fff1f1;
}

.ops-reconciliation-status strong,
.ops-reconciliation-status p {
  display: block;
  margin: 0;
  color: #087f5b;
  font-size: 13px;
}

.ops-reconciliation-status p {
  margin-top: 4px;
  color: #526c63;
  line-height: 1.7;
}

.ops-reconciliation-status.is-danger strong,
.ops-reconciliation-status.is-danger p {
  color: #a63232;
}

.ops-equation-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.ops-equation-stack > article {
  padding: 17px;
  border: 1px solid #e4e9f0;
  border-radius: 14px;
  background: #fff;
}

.ops-equation-stack > article.is-consolidated {
  border-color: color-mix(in srgb, var(--ops-color) 35%, #e4e9f0);
  background: color-mix(in srgb, var(--ops-soft) 45%, #fff);
}

.ops-equation-stack header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.ops-equation-stack header > span {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ops-soft);
  color: var(--ops-color);
  font-size: 14px;
  font-weight: 950;
}

.ops-equation-stack header strong,
.ops-equation-stack header small {
  display: block;
}

.ops-equation-stack header strong {
  color: #233146;
  font-size: 15px;
}

.ops-equation-stack header small {
  margin-top: 3px;
  color: #738095;
  font-size: 11px;
  line-height: 1.6;
}

.ops-equation-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.ops-equation-line > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ops-color);
  font-size: 22px;
  font-style: normal;
  font-weight: 950;
}

.ops-equation-side {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 7px;
}

.ops-equation-side > b {
  display: inline-flex;
  align-items: center;
  color: #8894a5;
  font-size: 16px;
}

.ops-equation-term {
  flex: 1 1 130px;
  min-width: 0;
  padding: 12px;
  border-radius: 11px;
  background: #f6f8fa;
}

.ops-equation-term span,
.ops-equation-term strong,
.ops-equation-term small {
  display: block;
}

.ops-equation-term span {
  color: #6a788d;
  font-size: 11px;
  font-weight: 850;
}

.ops-equation-term strong {
  margin-top: 6px;
  color: #202e43;
  font-size: 15px;
}

.ops-equation-term small {
  margin-top: 5px;
  color: #8792a2;
  font-size: 10px;
  line-height: 1.6;
}

.ops-equation-stack footer {
  margin-top: 11px;
  color: #67758a;
  font-size: 12px;
}

.ops-equation-stack footer strong {
  color: #263449;
}

.ops-internal-bridge,
.ops-balance-note {
  margin-top: 15px;
  padding: 15px 17px;
  border: 1px dashed color-mix(in srgb, var(--ops-color) 35%, #cdd5df);
  border-radius: 13px;
  background: #fbfcfd;
}

.ops-internal-bridge span,
.ops-internal-bridge strong,
.ops-internal-bridge small,
.ops-balance-note strong,
.ops-balance-note p {
  display: block;
}

.ops-internal-bridge span {
  color: var(--ops-color);
  font-size: 11px;
  font-weight: 900;
}

.ops-internal-bridge strong {
  margin-top: 6px;
  color: #263449;
  font-size: 14px;
}

.ops-internal-bridge small,
.ops-balance-note p {
  margin: 6px 0 0;
  color: #68768a;
  font-size: 12px;
  line-height: 1.75;
}

.ops-balance-note strong {
  color: #27364b;
  font-size: 14px;
}

.ops-primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.55;
}

.ops-formula-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  border-color: color-mix(in srgb, var(--ops-color) 20%, #e4e9f0);
  background: linear-gradient(125deg, #fff, var(--ops-soft));
}

.ops-formula-banner > div:first-child span { color: var(--ops-color); font-size: 9px; font-weight: 900; }
.ops-formula-banner h2 { margin: 6px 0; color: #1e2b3e; font-size: 19px; }
.ops-formula-banner p { max-width: 700px; margin: 0; color: #6e7b8f; font-size: 10px; line-height: 1.8; }
.ops-formula-banner > div:not(:first-child) { min-width: 85px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.78); text-align: center; }
.ops-formula-banner > div:not(:first-child) strong,
.ops-formula-banner > div:not(:first-child) span { display: block; }
.ops-formula-banner > div:not(:first-child) strong { color: var(--ops-color); font-size: 21px; }
.ops-formula-banner > div:not(:first-child) span { margin-top: 4px; color: #69768a; font-size: 8px; font-weight: 800; }

.ops-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ops-formula-components {
  overflow: hidden;
  border: 1px solid #e3e8ef;
  border-radius: 13px;
}

.ops-formula-components header,
.ops-formula-components > div {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(85px, 0.55fr) minmax(85px, 0.55fr) minmax(180px, 1.1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.ops-formula-components header {
  background: #f3f6f9;
  color: #68758a;
  font-size: 9px;
  font-weight: 900;
}

.ops-formula-components > div {
  border-top: 1px solid #edf0f4;
}

.ops-category-list,
.ops-insight-list {
  display: grid;
  gap: 9px;
}

.ops-category-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e9edf2;
  border-radius: 11px;
  background: #fafbfd;
  color: #526075;
  font-size: 10px;
  font-weight: 800;
}

.ops-catalog-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 13px;
  border-radius: 13px;
  background: #f5f7fa;
}

.ops-catalog-toolbar label {
  display: grid;
  flex: 1;
  gap: 6px;
  max-width: 520px;
}

.ops-catalog-toolbar > div {
  color: #66748a;
  font-size: 9px;
  font-weight: 800;
}

.ops-catalog-toolbar > div span {
  color: var(--ops-color);
  font-size: 17px;
}

.ops-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.ops-product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 15px;
  border: 1px solid #e4e9f0;
  border-radius: 15px;
  background: #fff;
}

.ops-product-card[hidden] { display: none; }

.ops-product-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ops-color);
  font-size: 8px;
  font-weight: 900;
}

.ops-product-visual {
  display: grid;
  height: 76px;
  margin: 13px 0;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ops-soft), #f7f9fb);
  color: var(--ops-color);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0.5px;
}

.ops-product-card > small { color: #8a95a5; font-size: 8px; font-weight: 800; }
.ops-product-card h3 { min-height: 38px; margin: 5px 0 10px; color: #263449; font-size: 12px; line-height: 1.7; }
.ops-product-card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.ops-product-card li { min-width: 0; padding: 8px; border-radius: 9px; background: #f7f9fb; }
.ops-product-card li span,
.ops-product-card li b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-product-card li span { color: #8691a1; font-size: 7px; font-weight: 800; }
.ops-product-card li b { margin-top: 4px; color: #4a586d; font-size: 8px; }
.ops-product-card footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.ops-product-card footer div span,
.ops-product-card footer div small { display: block; }
.ops-product-card footer div span { color: #263449; font-size: 10px; font-weight: 900; }
.ops-product-card footer div small { margin-top: 3px; color: #8a95a5; font-size: 7px; }
.ops-product-card footer button { padding: 9px 10px; }

.ops-product-formula {
  margin: 11px -15px -15px;
  padding: 8px 15px;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.ops-product-formula.is-ready { background: #e6f7ef; color: #087f5b; }
.ops-product-formula.is-missing { background: #fff1de; color: #a96504; }

.ops-insight-list > div {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  overflow: hidden;
  padding: 12px;
  border-radius: 10px;
  background: #f5f7fa;
  color: #56647a;
  font-size: 10px;
  font-weight: 800;
}

.ops-insight-list i {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--ops-color);
}

.access-fieldset {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #e2e7ef;
  border-radius: 12px;
}

.access-fieldset legend {
  padding: 0 8px;
  color: #526176;
  font-size: 11px;
  font-weight: 900;
}

.module-access-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.module-access-chip span {
  gap: 7px;
  border-color: color-mix(in srgb, var(--module-color) 18%, #e2e7ef);
  background: var(--module-soft);
}

.module-access-chip span b {
  color: var(--module-color);
  font-size: 9px;
}

/* Readability pass: operational screens are designed for continuous factory use. */
body {
  font-size: 14px;
  line-height: 1.65;
}

.app-shell button,
.app-shell input,
.app-shell select,
.app-shell textarea {
  font-size: 14px;
}

.app-shell input:not([type="checkbox"]):not([type="radio"]),
.app-shell select,
.app-shell textarea {
  min-height: 48px;
}

.app-shell label,
.data-form label,
.calculator label,
.employer-admin-form label,
.contract-meta-grid label {
  font-size: 14px;
  line-height: 1.65;
}

.app-shell p,
.app-shell li {
  font-size: 14px;
  line-height: 1.85;
}

.app-shell small,
.brand-block small,
.identity small,
.panel-title small,
.sidebar-status small,
.kpi-card small,
.metric-card small {
  font-size: 12px;
  line-height: 1.7;
}

.sidebar-nav button {
  min-height: 49px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
}

.nav-icon {
  width: 38px;
  height: 30px;
  font-size: 12px;
}

.identity strong,
.brand-block strong {
  font-size: 15px;
}

.identity #pageSubtitle {
  font-size: 13px;
}

.module-panel-title small,
.module-panel-state {
  font-size: 12px;
}

.module-panel-title p {
  font-size: 14px;
  line-height: 1.75;
}

table th,
table td,
.ops-table th,
.ops-table td,
.contract-table th,
.contract-table td {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
}

table th,
.ops-table th,
.contract-table th {
  font-size: 13px;
  font-weight: 900;
}

.status-chip,
.ops-badge {
  min-height: 28px;
  padding: 6px 10px;
  font-size: 11px;
}

.ops-module-body {
  font-size: 14px;
  line-height: 1.7;
}

.ops-voice-invoice-layout {
  align-items: start;
}

/* Voice invoice is a focused work surface: hide navigation and keep the microphone above the flow. */
.app-shell.voice-work-mode {
  display: block;
  min-height: 100vh;
  background: #f4f8fb;
}

.app-shell.voice-work-mode .sidebar,
.app-shell.voice-work-mode .command-bar,
.app-shell.voice-work-mode .module-panel-hero {
  display: none;
}

.app-shell.voice-work-mode .workspace {
  min-height: 100vh;
  padding: 0;
}

.app-shell.voice-work-mode #modulePanelContent {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 42px) 48px;
}

.app-shell.voice-work-mode .ops-module-body {
  max-width: 1180px;
  margin: 0 auto;
}

.ops-voice-workbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
  margin: -20px calc(clamp(16px, 3vw, 42px) * -1) 18px;
  padding: 16px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid #e1e8ef;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(44, 65, 87, 0.08);
  backdrop-filter: blur(12px);
}

.ops-voice-workbar-copy span,
.ops-voice-workbar-copy strong,
.ops-voice-workbar-copy small {
  display: block;
}

.ops-voice-workbar-copy span {
  color: var(--ops-color);
  font-size: 12px;
  font-weight: 900;
}

.ops-voice-workbar-copy strong {
  margin-top: 3px;
  color: #1f2d40;
  font-size: 18px;
}

.ops-voice-workbar-copy small {
  margin-top: 4px;
  color: #718096;
  font-size: 11px;
}

.ops-voice-workbar .ops-voice-stage {
  min-width: 230px;
  margin: 0;
  padding: 10px 24px 8px;
  border-radius: 18px;
}

.ops-voice-workbar .ops-voice-ring {
  width: 82px;
  height: 82px;
}

.ops-voice-workbar.ops-voice-mic-only {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
  padding: 8px;
}

.ops-voice-mic-only .ops-voice-stage {
  min-width: 230px;
  margin: 0;
  padding: 8px 20px;
}

.ops-voice-workbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-transcript-top {
  margin: 0 0 16px;
}

.ops-transcript-top textarea {
  min-height: 62px;
}

.ops-invoice-preview-card {
  margin-top: 16px;
}

.ops-voice-launch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border-color: #d9c8f8;
  background: linear-gradient(120deg, #fff 0%, #f7f1ff 100%);
}

.ops-voice-launch-card span,
.ops-voice-launch-card strong,
.ops-voice-launch-card small {
  display: block;
}

.ops-voice-launch-card span {
  color: #7c3aed;
  font-size: 12px;
  font-weight: 900;
}

.ops-voice-launch-card strong {
  margin-top: 3px;
  color: #24133f;
  font-size: 18px;
}

.ops-voice-launch-card small {
  margin-top: 4px;
  color: #6e6480;
  font-size: 12px;
}

.ops-pool-guided-card {
  margin-bottom: 16px;
  background: linear-gradient(155deg, #ffffff 0%, #f7fbff 100%);
}

.ops-pool-guided-minimal {
  padding: 12px;
}

.ops-pool-loading {
  min-height: 100px;
  display: grid;
  place-items: center;
  color: #68778d;
  font-size: 13px;
  font-weight: 800;
}

.ops-voice-flow-preview {
  display: grid;
  grid-template-columns: minmax(125px, 1fr) 28px minmax(125px, 1fr) 28px minmax(125px, 1fr) 28px minmax(125px, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.ops-voice-flow-box {
  min-width: 0;
  min-height: 68px;
  padding: 8px 10px;
  border: 1px solid #e2e8ef;
  border-radius: 14px;
  background: #fbfcfe;
}

.ops-voice-flow-box > span {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #e7edf3;
  color: #6d7a8c;
  font-size: 11px;
  font-weight: 900;
}

.ops-voice-flow-box small,
.ops-voice-flow-box strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-voice-flow-box small {
  margin-top: 4px;
  color: #7b8798;
  font-size: 10px;
  font-weight: 800;
}

.ops-voice-flow-box strong {
  margin-top: 3px;
  color: #253249;
  font-size: 12px;
  line-height: 1.7;
}

.ops-voice-flow-box.is-active,
.ops-voice-flow-box.is-done {
  border-color: #a9dccd;
  background: #f0faf6;
}

.ops-voice-flow-box.is-active > span,
.ops-voice-flow-box.is-done > span {
  background: #087f5b;
  color: #fff;
}

.ops-voice-flow-box.is-done strong {
  color: #087f5b;
}

.ops-pool-guided-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ops-pool-guided-head strong {
  color: #27354a;
  font-size: 16px;
}

.ops-pool-guided-head small {
  color: #7b8798;
  font-size: 11px;
}

.ops-pool-guided-card > .ops-pool-loading {
  min-height: 0;
  justify-content: start;
  padding: 2px 0 8px;
  font-size: 11px;
}

.ops-pool-back-button {
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ops-color);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
}

.ops-pool-confirmation {
  padding: 14px;
  border: 1px solid #cbe8dc;
  border-radius: 12px;
  background: #f2fbf7;
}

.ops-pool-confirmation > span,
.ops-pool-confirmation > strong,
.ops-pool-confirmation > small {
  display: block;
}

.ops-pool-confirmation > span {
  color: #087f5b;
  font-size: 11px;
  font-weight: 900;
}

.ops-pool-confirmation > strong {
  margin-top: 5px;
  color: #253249;
  font-size: 15px;
}

.ops-pool-confirmation > small {
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
}

.ops-voice-flow-connector {
  height: 1px;
  background: #d9e1e9;
}

.ops-pool-voice-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 17px;
  padding: 13px 15px;
  border-right: 4px solid var(--ops-color);
  border-radius: 10px;
  background: var(--ops-soft);
}

.ops-pool-voice-prompt span {
  flex: 0 0 auto;
  color: var(--ops-color);
  font-size: 11px;
  font-weight: 900;
}

.ops-pool-voice-prompt strong {
  color: #27354a;
  font-size: 13px;
  line-height: 1.8;
}

.ops-pool-category-grid,
.ops-pool-product-grid,
.ops-pool-attribute-grid {
  display: grid;
  gap: 10px;
}

.ops-pool-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-pool-category-box,
.ops-pool-product-box,
.ops-pool-term {
  border: 1px solid #dfe6ee;
  border-radius: 12px;
  background: #fff;
  color: #26344a;
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.ops-pool-category-box:hover,
.ops-pool-product-box:hover,
.ops-pool-term:hover,
.ops-pool-category-box.is-selected,
.ops-pool-product-box.is-selected,
.ops-pool-term.is-selected {
  border-color: #82cbb7;
  background: #f0faf6;
  box-shadow: 0 7px 18px rgba(28, 117, 90, 0.08);
  transform: translateY(-1px);
}

.ops-pool-category-box {
  position: relative;
  min-height: 108px;
  padding: 16px;
}

.ops-pool-category-box strong,
.ops-pool-category-box small,
.ops-pool-product-box strong,
.ops-pool-product-box small,
.ops-pool-product-box em {
  display: block;
}

.ops-pool-category-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #e8f6f1;
  color: #087f5b;
  font-size: 11px;
  font-weight: 900;
}

.ops-pool-category-box strong {
  font-size: 14px;
}

.ops-pool-category-box small {
  margin-top: 7px;
  color: #748196;
  font-size: 11px;
  line-height: 1.7;
}

.ops-pool-step-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e9edf2;
}

.ops-pool-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ops-pool-step-title > span {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--ops-color);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.ops-pool-step-title strong,
.ops-pool-step-title small {
  display: block;
}

.ops-pool-step-title strong {
  color: #27354a;
  font-size: 14px;
}

.ops-pool-step-title small {
  margin-top: 3px;
  color: #7b8798;
  font-size: 11px;
}

.ops-pool-product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-pool-product-box {
  min-height: 115px;
  padding: 13px;
}

.ops-pool-product-box strong {
  font-size: 12px;
  line-height: 1.75;
}

.ops-pool-product-box small {
  margin-top: 7px;
  color: #7a8799;
  font-size: 10px;
  line-height: 1.6;
}

.ops-pool-product-box em {
  margin-top: 9px;
  color: #087f5b;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.ops-pool-more-hint {
  display: block;
  margin-top: 9px;
  color: #7b8798;
  font-size: 11px;
}

.ops-pool-attribute-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-pool-attribute-box {
  padding: 13px;
  border: 1px solid #e4e9f0;
  border-radius: 12px;
  background: #fbfcfe;
}

.ops-pool-attribute-box > span {
  display: block;
  margin-bottom: 9px;
  color: #536177;
  font-size: 12px;
  font-weight: 900;
}

.ops-pool-attribute-box > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ops-pool-term {
  padding: 7px 10px;
  color: #5d6b7e;
  font-size: 11px;
  font-weight: 800;
}

.ops-pool-term.is-selected {
  color: #087f5b;
  font-weight: 900;
}

.ops-pool-preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.ops-pool-preview-actions small {
  color: #7b8798;
  font-size: 11px;
}

.ops-pool-preview-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.ops-voice-capture-card {
  background: linear-gradient(155deg, #ffffff 0%, #f6fbfa 100%);
}

.ops-voice-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 6px 0 20px;
  padding: 25px 18px 20px;
  border: 1px solid #dceee8;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 15%, #e8f8f3, transparent 58%), #fbfefd;
}

.ops-voice-button {
  display: grid;
  justify-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #193b36;
  font: inherit;
  cursor: pointer;
}

.ops-voice-button strong {
  font-size: 15px;
}

.ops-voice-button small {
  color: #72858a;
  font-size: 11px;
}

.ops-voice-ring {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid #9ed9c9;
  border-radius: 50%;
  background: #e6f8f1;
  box-shadow: 0 0 0 10px rgba(102, 190, 163, 0.1), 0 12px 28px rgba(22, 124, 91, 0.15);
  color: #087f5b;
  font-size: 11px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ops-voice-button:hover .ops-voice-ring,
.ops-voice-stage.is-listening .ops-voice-ring {
  transform: scale(1.04);
  box-shadow: 0 0 0 15px rgba(102, 190, 163, 0.12), 0 12px 30px rgba(22, 124, 91, 0.2);
}

.ops-voice-stage.is-listening .ops-voice-ring {
  animation: ops-voice-pulse 1.5s ease-in-out infinite;
}

.ops-voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
}

.ops-voice-wave i {
  display: block;
  width: 4px;
  height: 8px;
  border-radius: 8px;
  background: #8bcdbb;
}

.ops-voice-stage.is-listening .ops-voice-wave i {
  animation: ops-voice-wave 800ms ease-in-out infinite alternate;
}

.ops-voice-stage.is-listening .ops-voice-wave i:nth-child(2),
.ops-voice-stage.is-listening .ops-voice-wave i:nth-child(6) { animation-delay: 120ms; }
.ops-voice-stage.is-listening .ops-voice-wave i:nth-child(3),
.ops-voice-stage.is-listening .ops-voice-wave i:nth-child(5) { animation-delay: 240ms; }
.ops-voice-stage.is-listening .ops-voice-wave i:nth-child(4) { animation-delay: 360ms; }

.ops-transcript-field {
  display: grid;
  gap: 7px;
}

.ops-transcript-field > span {
  color: #536177;
  font-size: 13px;
  font-weight: 900;
}

.ops-transcript-field textarea,
.ops-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 11px 13px;
  border: 1px solid #dbe2eb;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfe;
  color: #1f2d40;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.ops-transcript-field textarea:focus,
.ops-form textarea:focus {
  border-color: var(--ops-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ops-color) 11%, transparent);
  background: #fff;
}

.ops-voice-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.ops-voice-note {
  margin: 17px 0 0;
  color: #72818c;
  font-size: 12px;
  line-height: 1.9;
}

.ops-voice-note b {
  color: #277866;
}

.ops-invoice-lines {
  display: grid;
  gap: 8px;
}

.ops-invoice-lines > header,
.ops-invoice-line {
  display: grid;
  grid-template-columns: minmax(340px, 2.4fr) minmax(75px, 0.55fr) minmax(125px, 1fr) minmax(115px, 0.9fr) 38px;
  gap: 8px;
  align-items: center;
}

.ops-invoice-lines > header {
  padding: 0 4px 5px;
  color: #778398;
  font-size: 11px;
  font-weight: 900;
}

.ops-invoice-line input,
.ops-invoice-line select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #dbe2eb;
  border-radius: 9px;
  outline: 0;
  background: #fbfcfe;
  color: #1f2d40;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.ops-invoice-line input:focus,
.ops-invoice-line select:focus {
  border-color: var(--ops-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ops-color) 11%, transparent);
  background: #fff;
}

.ops-invoice-product-classification {
  display: grid;
  grid-template-columns: minmax(150px, 0.78fr) minmax(190px, 1.22fr);
  gap: 7px;
  min-width: 0;
}

.ops-invoice-product-classification label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ops-invoice-product-classification label > span {
  color: #78859a;
  font-size: 10px;
  font-weight: 900;
}

.ops-invoice-product-classification select:disabled {
  cursor: wait;
  color: #8b96a6;
  background: #f2f5f8;
}

.ops-remove-line {
  width: 34px;
  height: 34px;
  border: 1px solid #f0caca;
  border-radius: 9px;
  background: #fff6f6;
  color: #c34b4b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ops-add-line {
  justify-self: start;
  margin-top: 4px;
  border: 0;
}

.ops-invoice-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 15px;
  border: 1px solid #e2e8ef;
  border-radius: 13px;
  background: #f8fafc;
}

.ops-invoice-summary div {
  display: grid;
  gap: 4px;
}

.ops-invoice-summary span {
  color: #778398;
  font-size: 11px;
  font-weight: 800;
}

.ops-invoice-summary strong {
  color: #253249;
  font-size: 14px;
}

.ops-invoice-summary .is-total {
  padding-right: 12px;
  border-right: 1px solid #dfe7ee;
}

.ops-invoice-summary .is-total strong {
  color: var(--ops-color);
  font-size: 18px;
}

@keyframes ops-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 10px rgba(102, 190, 163, 0.1), 0 12px 28px rgba(22, 124, 91, 0.15); }
  50% { box-shadow: 0 0 0 17px rgba(102, 190, 163, 0.18), 0 12px 30px rgba(22, 124, 91, 0.24); }
}

@keyframes ops-voice-wave {
  from { height: 7px; }
  to { height: 22px; }
}

.ops-metric-card span,
.ops-metric-card small {
  font-size: 12px;
  line-height: 1.65;
}

.ops-metric-card strong {
  font-size: clamp(22px, 2.2vw, 29px);
}

.ops-section-head span {
  font-size: 11px;
}

.ops-section-head h2 {
  font-size: 21px;
}

.ops-section-head p,
.ops-notice p,
.ops-help-card ul,
.ops-warning-box strong,
.ops-warning-box p,
.ops-formula-banner p,
.ops-definition-grid p {
  font-size: 13px;
  line-height: 1.8;
}

.ops-form label > span,
.ops-catalog-toolbar label > span {
  font-size: 13px;
}

.ops-form input,
.ops-form select,
.ops-catalog-toolbar input,
.ops-formula-components input,
.ops-formula-components select {
  min-height: 48px;
  padding: 11px 13px;
  font-size: 14px;
}

.ops-form-actions small,
.ops-table-sub,
.ops-product-card > small,
.ops-product-card footer div small,
.ops-close-bar small,
.ops-asset-grid small,
.ops-line-list small {
  font-size: 11px;
  line-height: 1.65;
}

.ops-primary-button,
.ops-secondary-button,
.ops-link-button,
.ops-table-button,
.ops-row-actions button,
.ops-product-card footer button {
  min-height: 42px;
  padding: 10px 14px;
  font-size: 13px;
}

.ops-help-icon,
.ops-asset-grid header > span,
.ops-definition-grid article > span,
.ops-formula-banner > div:first-child span,
.ops-formula-banner > div:not(:first-child) span {
  font-size: 11px;
}

.ops-help-card h3,
.ops-asset-grid h3,
.ops-definition-grid h3 {
  font-size: 16px;
}

.ops-process-summary span,
.ops-material-flow span,
.ops-pareto strong {
  font-size: 11px;
}

.ops-process-summary strong,
.ops-material-flow strong {
  font-size: 16px;
}

.ops-line-list b,
.ops-pareto > div,
.ops-balance-equation,
.ops-close-bar strong,
.ops-category-list > div,
.ops-insight-list > div {
  font-size: 13px;
}

.ops-formula-components header {
  font-size: 12px;
}

.ops-product-card > header,
.ops-product-card li span,
.ops-product-formula {
  font-size: 11px;
}

.ops-product-card h3 {
  min-height: 48px;
  font-size: 16px;
}

.ops-product-card li b,
.ops-product-card footer div span {
  font-size: 13px;
}

/* A searchable combobox replaces each select in the same visual field. */
.searchable-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.searchable-select::after {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #738094;
  border-bottom: 2px solid #738094;
  content: "";
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 150ms ease;
}

.searchable-select.is-open::after {
  transform: translateY(-25%) rotate(225deg);
}

.searchable-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.searchable-select__input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px 11px 42px;
  border: 1px solid #dbe2eb;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfe;
  color: #1f2d40;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: text;
}

.searchable-select__input:focus {
  border-color: var(--active-module, var(--blue));
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--active-module, var(--blue)) 11%, transparent);
}

.searchable-select__input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #d92d20;
}

.searchable-select.is-disabled {
  opacity: 0.65;
}

.searchable-select__list {
  position: fixed;
  z-index: 10000;
  display: none;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid #d9e0e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(21, 32, 50, 0.18);
  direction: rtl;
}

.searchable-select__list.is-open {
  display: grid;
  gap: 4px;
}

.searchable-select__option {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #354258;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  text-align: right;
}

.searchable-select__option:hover,
.searchable-select__option.is-active {
  background: var(--active-module-soft, #eef3ff);
  color: var(--active-module, var(--blue));
}

.searchable-select__option.is-selected {
  background: color-mix(in srgb, var(--active-module, var(--blue)) 12%, #fff);
  color: var(--active-module, var(--blue));
  font-weight: 900;
}

.searchable-select__empty {
  padding: 18px 12px;
  color: #7a8798;
  font-size: 13px;
  text-align: center;
}

.persian-date-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
  text-align: right;
}

.persian-date-input.is-invalid-date {
  border-color: #d92d20 !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1) !important;
}

.select-control .searchable-select {
  min-width: 130px;
}

.select-control .searchable-select__input {
  min-height: 38px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: minmax(0, 520px) minmax(380px, 480px);
    gap: 32px;
  }

  .login-context h2 {
    font-size: 42px;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-card {
    grid-column: auto;
  }

  .module-blueprint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-access-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .sidebar-status {
    margin-top: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }

  .dashboard-grid,
  .split-grid,
  .entry-layout,
  .commission-layout,
  .page-grid,
  .sales-pipeline-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid > *,
  .split-grid > *,
  .entry-layout > *,
  .commission-layout > *,
  .personal-layout > *,
  .page-grid > *,
  .sales-pipeline-grid > * {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: minmax(0, 520px);
    padding: 16px;
  }

  .login-context {
    display: none;
  }

  .hub-hero,
  .module-panel-hero,
  .module-blueprint-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-header {
    position: static;
    align-items: center;
    flex-direction: row;
  }

  .hub-session {
    flex-wrap: nowrap;
  }

  .hub-session > span:nth-child(2) {
    margin-left: auto;
  }

  .hub-settings-button,
  .hub-logout-button {
    flex: 0 0 auto;
  }

  .hub-content {
    padding: 20px 14px 34px;
  }

  .hub-hero {
    padding: 24px;
  }

  .hub-hero h1 {
    font-size: 30px;
  }

  .hub-date {
    min-width: 0;
  }

  .module-grid,
  .module-blueprint-grid,
  .module-access-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 265px;
  }

  .module-panel-title {
    align-items: flex-start;
  }

  .module-panel-state {
    width: fit-content;
  }

  .workspace,
  .sidebar {
    padding: 14px;
  }

  .command-bar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .identity,
  .search-box,
  .select-control,
  .icon-button,
  .user-session {
    width: 100%;
    min-width: 0;
  }

  .user-session {
    justify-content: space-between;
  }

  .sidebar-nav,
  .kpi-grid,
  .sales-grid,
  .page-grid,
  .sales-pipeline-grid,
  .profile-grid,
  .import-grid,
  .personal-layout,
  .personal-stats,
  .payment-board,
  .settings-grid,
  .collection-item,
  .contract-meta-grid,
  .sla-grid {
    grid-template-columns: 1fr;
  }

  .contract-toolbar,
  .contract-section-heading,
  .signature-grid {
    align-items: stretch;
    flex-direction: column;
  }

  .contract-role-switch,
  .contract-role-switch .role-button,
  .contract-actions,
  .contract-actions > * {
    width: 100%;
  }

  .signature-grid div {
    width: 100%;
  }

  .bar-chart {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 520px) {
  .hub-brand small,
  .hub-session > span:nth-child(2) {
    display: none;
  }

  .hub-header {
    min-height: 68px;
    padding: 12px 14px;
  }

  .hub-user-avatar {
    display: none;
  }

  .hub-settings-button {
    display: none;
  }

  .module-panel-hero,
  .module-blueprint {
    padding: 18px;
  }

  .module-panel-title {
    flex-direction: column;
  }

  .module-blueprint-grid article {
    min-height: 132px;
  }

  .sidebar,
  .workspace {
    padding: 10px;
  }

  .sidebar {
    gap: 14px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .login-card {
    padding: 24px 16px 20px;
    border-radius: 18px;
  }

  .login-mode-switch,
  .captcha-box,
  .registration-fields {
    padding: 10px;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .brand-block strong,
  .brand-block small,
  .identity strong,
  .identity small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .brand-block strong {
    font-size: 14px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .sidebar-nav button {
    min-height: 46px;
    gap: 6px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .nav-icon {
    width: 28px;
    height: 24px;
    font-size: 10px;
  }

  .sidebar-status {
    padding: 12px;
  }

  .sidebar-status strong {
    font-size: 16px;
  }

  .command-bar,
  .primary-panel,
  .attention-panel,
  .panel,
  .upload-panel,
  .personal-card,
  .result-panel,
  .sale-card,
  .collection-item,
  .payment-column,
  .setting-card {
    padding: 12px;
  }

  .command-bar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .access-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .access-row-heading {
    display: none;
  }

  .panel-title {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
  }

  .panel-title > div {
    min-width: 0;
  }

  .panel-title h1,
  .panel-title h2 {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .panel-title > span,
  .identity-icon {
    width: 34px;
    height: 34px;
  }

  .kpi-card {
    min-height: 0;
    padding: 13px;
  }

  .kpi-card strong {
    font-size: 18px;
  }

  .chart-box {
    min-height: 0;
  }

  .chart-legend {
    gap: 7px;
    margin-bottom: 8px;
    font-size: 11px;
  }

  .line-chart,
  .trend-svg {
    min-height: 230px;
    height: 230px;
  }

  .trend-axis-label,
  .trend-month-label {
    font-size: 9px;
  }

  .trend-tooltip {
    width: min(245px, calc(100% - 16px));
    padding: 9px 10px;
    font-size: 11px;
  }

  .trend-tooltip-row {
    grid-template-columns: 8px minmax(42px, 1fr) auto;
    gap: 5px;
    min-height: 20px;
  }

  .table-frame,
  .contract-table-frame {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 12px;
  }

  .contract-table {
    min-width: 760px;
  }

  .contract-table th:nth-child(2),
  .contract-table td:nth-child(2) {
    min-width: 250px;
  }

  .contract-table-input {
    font-size: 12px;
  }

  .contract-subject-input {
    min-height: 72px;
  }

  .contract-section > p,
  .contract-section li,
  .contract-section-heading p {
    font-size: 13px;
    line-height: 1.9;
  }

  .metric-card strong,
  .result-panel strong {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .progress-row {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-item {
    align-items: stretch;
  }

  .primary-action,
  .secondary-action,
  .icon-button,
  .role-button {
    min-height: 44px;
  }
}

@media (max-width: 1180px) {
  .ops-grid-2,
  .ops-grid-form {
    grid-template-columns: 1fr;
  }

  .ops-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-definition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-reconciliation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-equation-line {
    grid-template-columns: 1fr;
  }

  .ops-equation-line > i {
    min-height: 28px;
  }

  .ops-material-flow {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 5px;
  }

  .ops-material-flow article {
    flex: 0 0 145px;
  }

  .ops-voice-workbar {
    grid-template-columns: 1fr auto;
  }

  .ops-voice-workbar-copy {
    grid-column: 1 / -1;
  }

  .ops-voice-workbar .ops-voice-stage {
    grid-column: 1;
  }

  .ops-voice-workbar-actions {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .ops-module-body {
    margin-top: 12px;
  }

  .ops-card,
  .ops-metric-card {
    padding: 16px;
    border-radius: 14px;
  }

  .ops-metric-grid,
  .ops-reconciliation-summary,
    .ops-product-grid,
    .ops-asset-grid,
    .ops-definition-grid,
    .ops-form,
    .ops-grid-form,
    .ops-pool-category-grid,
    .ops-pool-product-grid,
    .ops-pool-attribute-grid,
    .ops-process-summary {
      grid-template-columns: 1fr;
    }

  .ops-voice-flow-preview {
    grid-template-columns: 1fr;
  }

  .app-shell.voice-work-mode #modulePanelContent {
    padding: 12px 10px 32px;
  }

  .ops-voice-workbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: -12px -10px 14px;
    padding: 14px 10px;
  }

  .ops-voice-workbar-copy,
  .ops-voice-workbar .ops-voice-stage,
  .ops-voice-workbar-actions {
    grid-column: auto;
  }

  .ops-voice-workbar-actions {
    justify-content: flex-start;
  }

  .ops-voice-launch-card {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-voice-flow-connector {
    width: 1px;
    height: 15px;
    margin: 0 auto;
  }

  .ops-pool-voice-prompt,
  .ops-pool-preview-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-invoice-lines {
    overflow-x: auto;
  }

  .ops-invoice-lines > header,
  .ops-invoice-line {
    min-width: 680px;
  }

  .ops-invoice-summary {
    grid-template-columns: 1fr;
  }

  .ops-invoice-summary .is-total {
    padding-right: 0;
    padding-top: 10px;
    border-top: 1px solid #dfe7ee;
    border-right: 0;
  }

  .ops-equation-side {
    flex-direction: column;
  }

  .ops-equation-side > b {
    justify-content: center;
  }

  .ops-span-2 {
    grid-column: auto;
  }

  .ops-section-head,
  .ops-form-actions,
  .ops-voice-actions,
  .ops-catalog-toolbar,
  .ops-close-bar,
  .ops-product-card footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-section-head > button,
  .ops-form-actions button,
  .ops-close-bar button {
    width: 100%;
  }

  .ops-formula-banner {
    grid-template-columns: repeat(2, 1fr);
  }

  .ops-formula-banner > div:first-child {
    grid-column: 1 / -1;
  }

  .ops-formula-components {
    overflow-x: auto;
  }

  .ops-formula-components header,
  .ops-formula-components > div {
    min-width: 680px;
  }

  .ops-balance-equation {
    flex-wrap: wrap;
    text-align: center;
  }

  .ops-pareto > div {
    grid-template-columns: minmax(75px, 0.8fr) minmax(85px, 1.3fr) auto;
  }

  .ops-row-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .command-bar,
  .contract-toolbar,
  .contract-draft-note,
  .contract-actions,
  .contract-role-switch,
  .table-action {
    display: none !important;
  }

  .app-shell,
  .workspace {
    display: block;
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #view-support-contract {
    display: block !important;
  }

  .support-contract-panel,
  .panel {
    max-width: none;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .contract-table {
    min-width: 0;
  }

  .contract-table-input {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .contract-section {
    break-inside: avoid;
  }
}

/* Keep the commission command bar calm at dashboard widths. */
.app-shell[data-module="commission"] .command-bar {
  align-items: center;
}

.app-shell[data-module="commission"] .command-bar .search-box {
  display: none !important;
}

.app-shell[data-module="commission"] .command-bar .identity {
  flex: 0 1 290px;
  min-width: 220px;
}

.app-shell[data-module="commission"] .command-bar .toolbar {
  flex: 1 1 auto;
}

@media (max-width: 1280px) {
  .app-shell[data-module="commission"] .command-bar .identity #pageSubtitle,
  .app-shell[data-module="commission"] .command-bar .user-session-label {
    display: none;
  }

  .app-shell[data-module="commission"] .command-bar .identity {
    min-width: 170px;
  }

  .contract-meta-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .contract-meta-grid input {
    min-height: 0;
    padding: 4px 0;
    border: 0;
    background: transparent;
  }
}

.contract-parties-section {
  margin-bottom: 2px;
}

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

.contract-party-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, #fbfffd, #f4f8ff);
}

.contract-party-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.contract-party-heading small {
  color: var(--muted);
  font-size: 11px;
}

.contract-party-heading h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.contract-party-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7f7f2;
  color: var(--teal);
  font-size: 11px;
  white-space: nowrap;
}

.contract-party-type-switch {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 7px;
  background: #eaf1f6;
}

.contract-party-type-switch .role-button {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

.contract-party-type-switch .role-button:disabled {
  cursor: default;
  opacity: 0.7;
}

.contract-party-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contract-party-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.contract-party-fields label:last-child {
  grid-column: 1 / -1;
}

.contract-party-fields label > span:first-child {
  color: var(--muted);
  font-size: 11px;
}

.contract-party-input,
.contract-party-value {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  line-height: 1.6;
}

.contract-party-value {
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.contract-party-note,
.contract-readonly-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.contract-appendix-frame {
  display: grid;
  gap: 12px;
}

.contract-appendix-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-right: 3px solid var(--teal);
  border-radius: 7px;
  background: #f0f8f6;
}

.contract-appendix-intro span {
  color: var(--muted);
  font-size: 12px;
}

.contract-appendix-table-frame {
  overflow-x: auto;
}

.contract-appendix-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.contract-appendix-table th,
.contract-appendix-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.contract-appendix-table th {
  color: var(--muted);
  background: #f7f9fc;
  font-size: 11px;
}

.contract-appendix-table td {
  font-size: 12px;
}

.contract-appendix-input {
  width: 100%;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid #bfd6cd;
  border-radius: 6px;
  background: #fbfffd;
  color: var(--ink);
}

.contract-appendix-subject {
  min-width: 210px;
  min-height: 56px;
  resize: vertical;
  line-height: 1.7;
}

.contract-appendix-table th:nth-child(4),
.contract-appendix-table th:nth-child(5) {
  min-width: 120px;
}

.contract-appendix-table th:nth-child(6),
.contract-appendix-table th:nth-child(7),
.contract-appendix-table th:nth-child(8),
.contract-appendix-table th:nth-child(9) {
  min-width: 145px;
}

.contract-tax-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.contract-tax-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.contract-tax-summary span {
  color: var(--muted);
  font-size: 11px;
}

.contract-tax-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.contract-tax-summary .contract-tax-total {
  border-color: rgba(21, 131, 111, 0.35);
  background: #edf8f4;
}

.contract-tax-summary .contract-tax-total strong {
  color: var(--teal);
}

/* Luxury industrial authentication — 2026 refresh */
body.auth-pending {
  width: 100%;
  height: 100%;
  max-height: 100svh;
  overflow: hidden !important;
  background: #0d2d3a;
}

body.auth-pending .login-screen {
  display: grid;
}

.login-screen {
  isolation: isolate;
  width: 100%;
  max-width: 100vw;
  height: 100svh;
  min-height: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 500px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: center;
  gap: 16px clamp(42px, 6vw, 92px);
  padding: 20px clamp(28px, 5vw, 84px) 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 14%, rgba(80, 166, 169, 0.3), transparent 31rem),
    radial-gradient(circle at 8% 92%, rgba(211, 161, 89, 0.16), transparent 29rem),
    radial-gradient(circle at 42% 48%, rgba(31, 105, 119, 0.22), transparent 38rem),
    linear-gradient(122deg, #0b2634 0%, #123b49 52%, #0d2b38 100%);
  font-family: "Estedad", "Vazirmatn", Tahoma, sans-serif;
}

.login-screen::before {
  z-index: -2;
  background-image:
    linear-gradient(rgba(191, 222, 224, 0.062) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 222, 224, 0.062) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 1;
  mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.28));
}

.login-screen::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(112deg, transparent 0 49.8%, rgba(223, 178, 106, 0.09) 50%, transparent 50.2%),
    linear-gradient(112deg, transparent 0 52.2%, rgba(255, 255, 255, 0.025) 52.3%, transparent 52.45%);
  content: "";
  pointer-events: none;
}

.login-glow {
  z-index: -1;
  border-color: rgba(203, 154, 80, 0.12);
  box-shadow: 0 0 0 38px rgba(203, 154, 80, 0.018), 0 0 0 78px rgba(203, 154, 80, 0.012);
}

.login-glow::after {
  border-color: rgba(203, 154, 80, 0.09);
}

.login-glow-one {
  top: -190px;
  right: -120px;
  width: 430px;
  height: 430px;
}

.login-glow-two {
  bottom: -230px;
  left: -120px;
  width: 410px;
  height: 410px;
}

.login-topbar,
.login-footer {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  width: 100%;
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(180, 207, 210, 0.11);
}

.portal-identity,
.portal-service-state,
.login-card-topline,
.secure-session,
.login-note,
.login-context-status span {
  display: flex;
  align-items: center;
}

.portal-identity {
  gap: 11px;
  color: #f6f4ed;
}

.portal-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(222, 180, 111, 0.42);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(211, 162, 87, 0.2), rgba(211, 162, 87, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.16);
}

.portal-logo svg {
  width: 24px;
  fill: none;
  stroke: #e2b76f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.portal-identity > span:last-child {
  display: grid;
  gap: 1px;
}

.portal-identity strong {
  font-size: 14px;
  font-weight: 900;
}

.portal-identity small {
  color: rgba(208, 220, 222, 0.52);
  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.55px;
}

.portal-service-state {
  gap: 9px;
  color: rgba(218, 229, 229, 0.68);
  font-size: 11px;
  font-weight: 700;
}

.portal-service-state i,
.login-context-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fc2a0;
  box-shadow: 0 0 0 5px rgba(63, 194, 160, 0.1), 0 0 16px rgba(63, 194, 160, 0.42);
}

.login-context {
  align-self: center;
  max-width: 760px;
  color: #f6f4ed;
}

.login-context-kicker {
  gap: 10px;
  min-height: auto;
  margin-bottom: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #d9b374;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-context h2 {
  overflow: hidden;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(24px, 3vw, 38px) clamp(25px, 3.5vw, 46px) clamp(27px, 3.2vw, 42px);
  border: 1px solid rgba(206, 168, 102, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 0, rgba(210, 163, 88, 0.12), transparent 18rem),
    linear-gradient(145deg, rgba(17, 48, 61, 0.9), rgba(7, 27, 39, 0.82));
  box-shadow:
    0 28px 65px rgba(0, 5, 12, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 45px rgba(28, 86, 91, 0.08);
  color: #fff;
  font-family: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  font-size: inherit;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.login-context h2::before {
  position: absolute;
  inset: 0 24% auto;
  display: block;
  width: auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #deb56f 46%, #deb56f 54%, transparent);
  box-shadow: 0 0 18px rgba(222, 181, 111, 0.5);
  content: "";
}

.login-context h2 > span {
  width: auto;
  padding: 0;
  background: none;
  color: #fff;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

.login-context .hero-title-primary {
  font-size: clamp(32px, 3vw, 47px);
  font-weight: 750;
  line-height: 1.42;
  white-space: normal;
  letter-spacing: -1.4px;
}

.login-context .hero-title-secondary {
  margin-top: 5px;
  color: #e6b96e;
  font-size: clamp(36px, 3.55vw, 55px);
  font-weight: 900;
  line-height: 1.36;
  white-space: normal;
  letter-spacing: -1.8px;
}

.login-context .hero-title-tertiary {
  margin-top: -2px;
  color: #f3f5ef;
  font-size: clamp(36px, 3.55vw, 55px);
  font-weight: 900;
  line-height: 1.36;
  white-space: normal;
  letter-spacing: -1.8px;
}

.login-context > p {
  max-width: 650px;
  margin: 15px 0 0;
  color: rgba(218, 229, 230, 0.68);
  font-size: 14px;
  font-weight: 500;
  line-height: 2.05;
}

.login-context-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.login-context-modules article {
  position: relative;
  display: block;
  min-height: 108px;
  padding: 14px 13px 12px;
  border: 1px solid rgba(180, 207, 210, 0.17);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 12px 26px rgba(0, 8, 15, 0.11);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-context-modules article > b {
  position: absolute;
  z-index: 1;
  top: 11px;
  right: 11px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(222, 183, 111, 0.33);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(222, 183, 111, 0.16), rgba(222, 183, 111, 0.06));
  color: #e6bc76;
  font-size: 8px;
  font-weight: 900;
}

.login-context-modules article > span,
.login-context-modules strong,
.login-context-modules small {
  display: block;
}

.login-context-modules article > span {
  display: grid;
  width: 100%;
  min-height: 80px;
  grid-template-rows: auto 1fr;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.login-context-modules strong {
  display: flex;
  min-height: 32px;
  align-items: center;
  padding-right: 34px;
  color: #eef4f3;
  font-family: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  white-space: normal;
}

.login-context-modules small {
  align-self: end;
  overflow: visible;
  width: 100%;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(187, 211, 213, 0.11);
  color: rgba(213, 226, 226, 0.62);
  font-family: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 450;
  line-height: 1.7;
  text-align: right;
  text-overflow: clip;
  white-space: normal;
}

.login-context-status {
  display: flex;
  flex-wrap: wrap;
  gap: 13px 23px;
  margin-top: 20px;
  color: rgba(209, 224, 224, 0.6);
  font-size: 10px;
  font-weight: 650;
}

.login-context-status span {
  gap: 7px;
}

.login-context-status i {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #b88a4b;
  box-shadow: none;
  transform: rotate(45deg);
}

.login-card {
  align-self: center;
  width: 100%;
  max-width: 500px;
  padding: 26px 30px 21px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(210, 178, 124, 0.12), transparent 17rem),
    linear-gradient(150deg, #ffffff, rgba(246, 249, 247, 0.99));
  box-shadow: 0 34px 90px rgba(0, 5, 12, 0.4), 0 5px 18px rgba(0, 8, 18, 0.2), inset 0 1px 0 #fff;
  color: #152b34;
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
}

.login-card::before {
  inset: 1px;
  border-radius: 23px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.64), transparent 30%, transparent 72%, rgba(171, 126, 64, 0.045));
}

.login-card-topline {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dce4e1;
}

.login-brand {
  display: inline-flex;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #9c6a2e;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.4;
}

.secure-session {
  gap: 5px;
  color: #4c6b68;
  font-size: 10px;
  font-weight: 750;
}

.secure-session svg,
.login-note svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.login-heading {
  text-align: right;
}

.login-heading > span {
  color: #74878c;
  font-size: 11px;
  font-weight: 750;
}

.login-heading h1 {
  margin: 6px 0 8px;
  color: #102933;
  font-size: clamp(30px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: -0.7px;
}

.login-heading p,
.login-note {
  color: #718087;
}

.login-heading p {
  color: #5f7379;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.85;
}

.auth-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
}

.auth-progress::before {
  position: absolute;
  z-index: -1;
  top: 15px;
  right: 17%;
  left: 17%;
  height: 1px;
  background: #dce3e1;
  content: "";
}

.auth-progress span {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  border-radius: 0;
  background: none;
  color: #829094;
  font-size: 10.5px;
  font-weight: 750;
  box-shadow: none;
}

.auth-progress span b {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #d7dfdc;
  border-radius: 50%;
  background: #f7f9f8;
  color: #9aa6a7;
  font-size: 11px;
  font-weight: 850;
}

.auth-progress span em {
  font-style: normal;
}

.auth-progress span.active {
  border: 0;
  background: none;
  color: #825a29;
  box-shadow: none;
}

.auth-progress span.active b {
  border-color: #b78543;
  background: linear-gradient(145deg, #c79550, #9a682e);
  color: #fff;
  box-shadow: 0 5px 12px rgba(150, 102, 45, 0.25), 0 0 0 4px rgba(183, 133, 67, 0.09);
}

.login-form {
  gap: 10px;
  margin-top: 17px;
}

.auth-step:not([hidden]) {
  gap: 12px;
}

.login-field {
  gap: 7px;
  color: #243f49;
  font-size: 11.5px;
  font-weight: 800;
}

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

.login-input-wrap > svg {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 15px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #8b9b9f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-field input {
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #ccd8d5;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  color: #102f3a;
  font-size: 14px;
  font-weight: 750;
}

.mobile-login-field input {
  padding-right: 48px;
}

.login-field input::placeholder {
  color: #87979a;
  font-weight: 550;
}

.login-field input:focus {
  border-color: #9e763f;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(178, 132, 67, 0.1), 0 8px 20px rgba(18, 48, 57, 0.045);
}

.captcha-box,
.registration-fields {
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6dfdc;
  border-radius: 13px;
  background: rgba(231, 237, 234, 0.68);
}

.captcha-heading {
  color: #2d4a53;
  font-size: 11.5px;
}

.captcha-heading button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 3px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #88612e;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.captcha-heading button:hover {
  background: rgba(183, 133, 67, 0.09);
}

.captcha-heading button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.captcha-row {
  grid-template-columns: minmax(0, 1.15fr) minmax(105px, 0.85fr);
  gap: 8px;
}

.captcha-row strong {
  min-height: 46px;
  border: 1px dashed rgba(157, 111, 52, 0.36);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(196, 151, 83, 0.09), rgba(255, 255, 255, 0.7)),
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(139, 103, 54, 0.035) 7px 8px);
  color: #263e46;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 6px;
}

.captcha-row input {
  min-height: 46px;
  border-color: #d9dfdd;
  border-radius: 9px;
  background: #fff;
  color: #18333c;
  font-size: 12.5px;
}

.captcha-row input:focus {
  border-color: #9e763f;
  box-shadow: 0 0 0 3px rgba(178, 132, 67, 0.1);
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  border: 1px solid rgba(225, 189, 125, 0.35);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 45%),
    linear-gradient(110deg, #112d3a, #183e48 68%, #28565a);
  color: #fff;
  font-size: 13.5px;
  font-weight: 850;
  box-shadow: 0 12px 25px rgba(12, 39, 49, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.login-submit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #dcb371;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.login-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(12, 39, 49, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.login-submit:hover svg {
  transform: translateX(-3px);
}

.login-submit:disabled {
  cursor: wait;
  filter: saturate(0.45);
  opacity: 0.7;
}

.login-note {
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e3e8e6;
  color: #60747a;
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.8;
}

.login-note svg {
  flex: 0 0 15px;
  margin-top: 1px;
  color: #568079;
}

.login-error {
  min-height: 16px;
  margin: -2px 0 -5px;
  color: #a54035;
  font-size: 10px;
}

.login-error:not(:empty) {
  padding: 8px 10px;
  border-color: rgba(185, 85, 72, 0.22);
  background: rgba(255, 235, 231, 0.72);
}

.otp-timer,
.registration-hint {
  color: #637b7a;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  color: rgba(187, 205, 207, 0.36);
  font-size: 9px;
  font-weight: 600;
}

@media (max-width: 1120px) {
  .login-screen {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 445px);
    gap: 16px 40px;
    padding-inline: 34px;
  }

  .login-context .hero-title-primary { font-size: 34px; }
  .login-context .hero-title-secondary { font-size: 42px; }
  .login-context-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
  .login-context-modules article { min-height: 60px; }
}

@media (max-width: 840px) {
  body.auth-pending { overflow: hidden !important; }

  .login-screen {
    grid-template-columns: minmax(0, 480px);
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 16px;
  }

  .login-context { display: none; }
  .login-card { grid-column: 1; }
  .login-topbar, .login-footer { grid-column: 1; }
}

@media (max-width: 520px) {
  .login-screen { padding: 12px; }
  .login-topbar { min-height: 46px; }
  .portal-logo { width: 37px; height: 37px; border-radius: 11px; }
  .portal-service-state span { display: none; }
  .login-card { padding: 20px 17px 17px; border-radius: 19px; }
  .login-card::before { border-radius: 18px; }
  .login-heading h1 { font-size: 26px; }
  .portal-service-state { display: none; }
  .captcha-row { grid-template-columns: minmax(0, 1fr) 105px; }
  .login-footer { padding-inline: 4px; }
}

@media (max-height: 760px) and (min-width: 841px) {
  .login-screen {
    padding-block: 13px 10px;
    gap: 9px clamp(42px, 6vw, 92px);
  }

  .login-topbar { min-height: 45px; padding-bottom: 8px; }
  .portal-logo { width: 38px; height: 38px; }
  .login-context-kicker { margin-bottom: 12px; }
  .login-context > p { margin-top: 8px; }
  .login-context-modules { margin-top: 17px; }
  .login-context-status { margin-top: 14px; }
  .login-card { padding-block: 19px 15px; }
  .login-card-topline { margin-bottom: 13px; padding-bottom: 10px; }
  .auth-progress { margin-top: 11px; }
  .login-form { margin-top: 11px; }
  .login-note { margin-top: 10px; padding-top: 9px; }
}

/* Organizational systems center — compact, role-aware redesign */
.module-hub {
  min-height: 100vh;
  background:
    linear-gradient(rgba(28, 72, 84, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 72, 84, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 90% 8%, rgba(32, 125, 123, 0.08), transparent 26rem),
    #f2f6f7;
  background-size: 38px 38px, 38px 38px, auto, auto;
  color: #122f38;
  font-family: "Estedad", "Vazirmatn", Tahoma, sans-serif;
}

.hub-header {
  min-height: 70px;
  padding: 11px clamp(22px, 4.5vw, 68px);
  border-bottom: 1px solid rgba(43, 78, 89, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 30px rgba(20, 48, 58, 0.04);
}

.hub-brand {
  gap: 11px;
  color: #15313b;
}

.hub-brand-mark {
  width: 43px;
  height: 43px;
  border: 1px solid rgba(190, 139, 69, 0.32);
  border-radius: 13px;
  background: linear-gradient(145deg, #173b47, #14655f);
  box-shadow: 0 10px 22px rgba(18, 72, 75, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.hub-brand-mark svg {
  width: 23px;
  fill: none;
  stroke: #e1b66e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.hub-brand strong {
  font-size: 14px;
  font-weight: 850;
}

.hub-brand small {
  color: #7c8d92;
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 1.2px;
}

.hub-session {
  gap: 9px;
}

.hub-user-avatar {
  width: 36px;
  height: 36px;
  border: 1px solid #d5e2e1;
  background: #eef6f4;
  color: #176961;
  font-size: 12px;
}

.hub-session small {
  color: #829298;
  font-size: 9px;
}

.hub-session strong {
  color: #203943;
  font-size: 11px;
}

.hub-logout-button,
.hub-settings-button {
  min-height: 35px;
  padding-inline: 12px;
  border-radius: 10px;
  font-size: 10px;
}

.hub-settings-button {
  border-color: #c7dedb;
  background: #edf8f6;
  color: #14665f;
}

.hub-content {
  width: min(100%, 1440px);
  padding: 28px clamp(22px, 4.5vw, 64px) 44px;
}

.hub-hero {
  display: grid;
  min-height: 164px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
  padding: 24px 28px;
  border: 1px solid rgba(213, 173, 103, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 0, rgba(73, 169, 160, 0.22), transparent 21rem),
    linear-gradient(118deg, #0b2532, #123f4a 62%, #146c65);
  box-shadow: 0 20px 46px rgba(14, 47, 58, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.hub-hero::after {
  inset: 0 68% 0 0;
  border-right-color: rgba(255, 255, 255, 0.06);
  opacity: 0.7;
}

.hub-kicker {
  min-height: 26px;
  padding: 4px 10px;
  border-color: rgba(94, 234, 212, 0.24);
  background: rgba(20, 151, 139, 0.12);
  color: #9fddd4;
  font-size: 9px;
}

.hub-kicker b {
  color: #fff;
}

.hub-hero h1 {
  margin: 9px 0 5px;
  color: #fff;
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 900;
  letter-spacing: -0.7px;
}

.hub-hero p {
  max-width: 760px;
  color: rgba(224, 236, 237, 0.74);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.85;
}

.hub-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
}

.hub-hero-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(218, 232, 233, 0.64);
  font-size: 9px;
  font-weight: 650;
}

.hub-hero-tags i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9ab65;
  box-shadow: 0 0 0 4px rgba(217, 171, 101, 0.08);
}

.hub-hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 10px;
}

.hub-date,
.hub-access-counter {
  min-width: 132px;
  min-height: 72px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hub-date small,
.hub-date strong,
.hub-access-counter small,
.hub-access-counter strong {
  display: block;
}

.hub-date small,
.hub-access-counter small {
  color: #98d8d0;
  font-size: 9px;
  font-weight: 750;
}

.hub-date strong,
.hub-access-counter strong {
  margin-top: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.hub-access-counter strong {
  color: #e5bb75;
  font-size: 16px;
}

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

.module-card {
  display: grid;
  grid-column: auto;
  min-height: 224px;
  grid-template-rows: auto 1fr auto;
  padding: 19px 21px 17px;
  border: 1px solid #dce5e7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 9px 26px rgba(19, 52, 63, 0.055), inset 0 1px 0 #fff;
}

.module-card:hover {
  border-color: color-mix(in srgb, var(--module-color) 30%, #dce5e7);
  box-shadow: 0 18px 38px color-mix(in srgb, var(--module-color) 12%, rgba(17, 48, 58, 0.08));
  transform: translateY(-4px);
}

.module-card::before {
  inset: 18px 0 18px auto;
  width: 3px;
  height: auto;
  border-radius: 3px 0 0 3px;
}

.module-card::after {
  top: -76px;
  left: -66px;
  width: 160px;
  height: 160px;
  opacity: 0.55;
}

.module-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-card-icon {
  width: 45px;
  height: 45px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--module-color) 14%, transparent);
  border-radius: 13px;
  font-size: 10px;
}

.module-card-access {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--module-color) 18%, #dfe7e8);
  border-radius: 999px;
  background: color-mix(in srgb, var(--module-soft) 70%, #fff);
  color: color-mix(in srgb, var(--module-color) 88%, #263c43);
  font-size: 8.5px;
  font-weight: 800;
}

.module-card-access i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--module-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--module-color) 10%, transparent);
}

.module-card-copy {
  position: relative;
  z-index: 1;
  margin-top: 13px;
}

.module-card-copy em {
  display: block;
  margin-bottom: 3px;
  color: var(--module-color);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.module-card-copy strong {
  color: #16313b;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.3px;
}

.module-card-copy small {
  min-height: 42px;
  margin-top: 6px;
  color: #64777e;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.8;
}

.module-card-footer {
  position: relative;
  z-index: 1;
  margin-top: 13px;
  padding-top: 12px;
  border-top-color: #e8edef;
}

.module-card-footer em {
  color: #71848a;
  font-size: 8.5px;
}

.module-card-footer > b {
  color: var(--module-color);
  font-size: 10px;
}

.module-card-order {
  position: absolute;
  z-index: 0;
  bottom: 48px;
  left: 16px;
  color: #eef2f3;
  font-family: Arial, sans-serif;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.hub-access-note {
  margin-top: 20px;
  color: #6f8187;
  font-size: 10px;
}

.hub-access-note span {
  color: #18847a;
}

@media (max-width: 1100px) {
  .hub-hero { grid-template-columns: 1fr; }
  .hub-hero-meta { grid-template-columns: repeat(2, minmax(0, 180px)); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .cs-month-target-fields { grid-template-columns: 1fr; }
  .cs-allocation-editor > label { grid-template-columns: 1fr; }
  .hub-header {
    position: static;
    align-items: center;
    padding: 10px 14px;
  }

  .hub-brand strong { font-size: 11px; }
  .hub-brand small,
  .hub-session > span:nth-child(2),
  .hub-user-avatar,
  .hub-settings-button { display: none; }
  .hub-content { padding: 16px 13px 30px; }
  .hub-hero { min-height: 0; padding: 21px; border-radius: 17px; }
  .hub-hero h1 { font-size: 25px; }
  .hub-hero-meta { grid-template-columns: 1fr 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 215px; }
}

@media (max-width: 430px) {
  .hub-brand-mark { width: 38px; height: 38px; }
  .hub-brand strong { max-width: 190px; line-height: 1.55; }
  .hub-hero-meta { grid-template-columns: 1fr; }
  .hub-date,
  .hub-access-counter { min-height: 62px; }
}

/* Contract financial appendix and accounting */
.contract-print-header,
.contract-print-footer {
  display: none;
}

.contract-appendix-table {
  min-width: 0;
  table-layout: fixed;
}

.contract-appendix-table-frame { overflow: visible; }
.contract-appendix-table th,
.contract-appendix-table td { padding: 9px 5px; overflow-wrap: anywhere; }
.contract-appendix-table th { line-height: 1.55; }
.contract-appendix-table th:nth-child(1),
.contract-appendix-table td:nth-child(1) { width: 3.5%; text-align: center; }
.contract-appendix-table th:nth-child(2),
.contract-appendix-table td:nth-child(2) { width: 18%; }
.contract-appendix-table th:nth-child(3),
.contract-appendix-table td:nth-child(3),
.contract-appendix-table th:nth-child(4),
.contract-appendix-table td:nth-child(4) { width: 9%; min-width: 0; }
.contract-appendix-table th:nth-child(5),
.contract-appendix-table td:nth-child(5),
.contract-appendix-table th:nth-child(6),
.contract-appendix-table td:nth-child(6) { width: 11.5%; min-width: 0; }
.contract-appendix-table th:nth-child(7),
.contract-appendix-table td:nth-child(7),
.contract-appendix-table th:nth-child(8),
.contract-appendix-table td:nth-child(8) { width: 10.5%; min-width: 0; }
.contract-appendix-table th:nth-child(9),
.contract-appendix-table td:nth-child(9) { width: 12%; min-width: 0; }
.contract-appendix-table th:nth-child(10),
.contract-appendix-table td:nth-child(10) { width: 8%; }

.contract-money-input {
  min-width: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.contract-financial-link,
.contract-payable-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(19, 132, 112, 0.26);
  border-radius: 8px;
  background: #f0faf7;
  color: #087965;
  text-align: right;
}

.contract-payable-button {
  border-color: rgba(25, 76, 157, 0.25);
  background: #f2f6ff;
  color: #153f89;
}

.contract-financial-link small,
.contract-payable-button small {
  color: var(--muted);
  font-size: 10px;
}

.contract-tax-help {
  width: 20px;
  height: 20px;
  margin-inline-start: 4px;
  border: 1px solid rgba(8, 121, 101, 0.35);
  border-radius: 50%;
  background: #fff;
  color: #087965;
  font-weight: 800;
}

.contract-row-actions {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.contract-appendix-subject { min-width: 0; }

@media (max-width: 1050px) {
  .contract-appendix-table,
  .contract-appendix-table tbody,
  .contract-appendix-table tr { display: block; width: 100%; }
  .contract-appendix-table thead { display: none; }
  .contract-appendix-table tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }
  .contract-appendix-table td,
  .contract-appendix-table td:nth-child(n) {
    display: grid;
    gap: 5px;
    width: auto;
    padding: 0;
    border: 0;
  }
  .contract-appendix-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }
  .contract-appendix-table td:nth-child(2) { grid-column: span 2; }
  .contract-appendix-table td:nth-child(9) { grid-column: span 2; }
}

@media (max-width: 620px) {
  .contract-appendix-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-appendix-table td:nth-child(2),
  .contract-appendix-table td:nth-child(9) { grid-column: 1 / -1; }
}

.contract-accounting-action {
  border-color: rgba(25, 76, 157, 0.24);
  color: #194c9d;
  background: #f4f7ff;
}

.contract-financial-dialog {
  width: min(930px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(5, 30, 45, 0.28);
}

.contract-financial-dialog::backdrop {
  background: rgba(8, 31, 43, 0.62);
  backdrop-filter: blur(4px);
}

.contract-financial-dialog-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(115deg, #103b62, #087b73);
  color: #fff;
}

.contract-financial-dialog-card > header small,
.contract-financial-dialog-card > header h2 {
  display: block;
  margin: 0;
}

.contract-financial-dialog-card > header small { opacity: 0.78; }
.contract-financial-dialog-card > header h2 { margin-top: 5px; font-size: 20px; }
.contract-financial-dialog-card > header button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 22px;
}

.contract-financial-breakdown,
.contract-accounting-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 20px 8px;
}

.contract-financial-breakdown > div,
.contract-accounting-summary > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.contract-financial-breakdown span,
.contract-accounting-summary span { color: var(--muted); font-size: 11px; }
.contract-financial-breakdown strong,
.contract-accounting-summary strong { font-size: 15px; }
.contract-financial-breakdown .payable,
.contract-accounting-summary .remaining { border-color: rgba(8,121,101,.3); background: #edf9f5; color: #087965; }

.contract-tax-guide {
  margin: 10px 20px;
  padding: 13px 15px;
  border-right: 3px solid #c28a2c;
  border-radius: 9px;
  background: #fff8e9;
  color: #654713;
  line-height: 1.9;
}

.contract-tax-guide p { margin: 4px 0 0; color: inherit; }
.contract-financial-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; padding: 10px 20px 18px; }
.contract-financial-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.contract-financial-fields input,
.contract-financial-fields textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.contract-financial-fields textarea { min-height: 82px; resize: vertical; }
.contract-financial-dialog-card > footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: #f8fafc; }

.contract-payment-entry { margin: 10px 20px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.contract-payment-entry h3 { margin: 0 0 12px; font-size: 15px; }
.contract-payment-entry > div { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 10px; align-items: end; }
.contract-payment-entry label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.contract-payment-entry input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.contract-payment-entry p { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.contract-payment-table-frame { margin: 14px 20px 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.contract-payment-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.contract-payment-table th,
.contract-payment-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; font-size: 12px; }
.contract-payment-table th { background: #f4f7fa; color: var(--muted); }
.contract-payment-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #fff3d8; color: #8a5b00; font-size: 10px; }
.contract-payment-status.approved { background: #e6f7f0; color: #087965; }
.contract-payment-status.rejected { background: #fff0f0; color: #b12b2b; }
.contract-attachment-link { color: #194c9d; text-decoration: underline; }
.approve-action { border-color: rgba(8,121,101,.3); color: #087965; }

@media (max-width: 760px) {
  .contract-financial-breakdown,
  .contract-accounting-summary,
  .contract-financial-fields { grid-template-columns: 1fr; }
  .contract-payment-entry > div { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 13mm 12mm 16mm; }
  html, body { width: auto; color: #152d39; font-size: 9.5pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .support-contract-panel > .panel-title { display: none !important; }
  .contract-print-header {
    display: grid;
    grid-template-columns: 18mm 1fr auto;
    align-items: center;
    gap: 4mm;
    margin-bottom: 7mm;
    padding: 4mm 0 4mm;
    border-bottom: 1.5pt solid #b4893e;
  }
  .contract-print-mark { display: grid; place-items: center; width: 16mm; height: 16mm; border-radius: 4mm; background: #0b5f66; color: #fff; font-size: 17pt; font-weight: 900; }
  .contract-print-header small { color: #0b5f66; font-weight: 800; }
  .contract-print-header h1 { margin: 1mm 0; font-size: 17pt; color: #123849; }
  .contract-print-header span { color: #6b7d86; font-size: 8pt; }
  .contract-print-seal { padding: 2mm 3mm; border: .7pt solid #b4893e; border-radius: 2mm; color: #765b2c; font-size: 8pt; }
  .contract-print-footer { display: flex; position: fixed; right: 12mm; bottom: 5mm; left: 12mm; justify-content: space-between; padding-top: 2mm; border-top: .5pt solid #b6c3c8; color: #6c7d85; font-size: 7pt; }
  .contract-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2mm; margin-bottom: 4mm; }
  .contract-meta-grid label { padding: 2mm; border: .5pt solid #cad5da; border-radius: 2mm; }
  .contract-meta-grid input { min-height: 0; padding: 1mm 0; border: 0; background: transparent; color: #132f3d; font-weight: 700; }
  .contract-parties-grid { gap: 3mm; }
  .contract-party-card { padding: 3mm; border-radius: 2mm; background: #f8fbfa; break-inside: avoid-page; }
  .contract-party-type-switch,
  .contract-party-note { display: none !important; }
  .contract-party-fields { gap: 2mm; }
  .contract-party-input,
  .contract-party-value { min-height: 0; padding: 1mm 0; border: 0; background: transparent; }
  .contract-section { padding: 4mm 0; break-inside: auto; }
  .contract-section h2 { margin-bottom: 2mm; padding-right: 2mm; border-right: 2pt solid #0b7b70; font-size: 11.5pt; }
  .contract-section p,
  .contract-section li { color: #304b58; line-height: 1.75; }
  .sla-grid article,
  .signature-grid > div { break-inside: avoid-page; }
  .contract-appendix-intro { padding: 2mm 3mm; border-radius: 2mm; }
  .contract-appendix-table-frame { overflow: visible; }
  .contract-appendix-table { min-width: 0; border-collapse: separate; border-spacing: 0 2mm; }
  .contract-appendix-table thead { display: none; }
  .contract-appendix-table tbody,
  .contract-appendix-table tr { display: block; width: 100%; }
  .contract-appendix-table tr { display: grid; grid-template-columns: .35fr 2.1fr 1fr 1fr 1.2fr 1.2fr; gap: 1.5mm; padding: 2.5mm; border: .6pt solid #bfcdd2; border-radius: 2mm; background: #fff; break-inside: avoid-page; }
  .contract-appendix-table td { display: grid; align-content: start; gap: 1mm; padding: 0; border: 0; font-size: 8pt; }
  .contract-appendix-table td::before { content: attr(data-label); color: #71838c; font-size: 6.7pt; font-weight: 500; }
  .contract-appendix-table td:nth-child(2) { grid-column: span 2; }
  .contract-appendix-table td:nth-child(7),
  .contract-appendix-table td:nth-child(8),
  .contract-appendix-table td:nth-child(9) { grid-column: span 2; }
  .contract-appendix-table td:last-child { display: none; }
  .contract-appendix-input { min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; resize: none; }
  .contract-financial-link,
  .contract-payable-button { min-width: 0; padding: 0; border: 0; background: transparent; color: #123849; }
  .contract-financial-link small,
  .contract-payable-button small { display: none; }
  .contract-readonly-note { margin-top: 2mm; }
  .contract-signatures { break-inside: avoid-page; margin-top: 5mm; }
  .signature-grid > div { min-height: 31mm; border-color: #aebdc4; }
}

/* Compact tabbed systems launcher */
.module-hub [hidden] { display: none !important; }

.hub-content {
  width: min(100%, 1180px);
  padding: 22px 24px 36px;
}

.hub-view-as {
  display: grid;
  gap: 2px;
  min-width: 230px;
}

.hub-view-as > span {
  color: #819095;
  font-size: 8px;
  font-weight: 750;
}

.hub-view-as select {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #d7e2e1;
  border-radius: 9px;
  outline: 0;
  background: #f8fbfa;
  color: #244049;
  font-size: 9px;
  font-weight: 750;
}

.hub-hero {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding: 16px 20px;
  border-radius: 16px;
}

.hub-hero h1 {
  margin: 4px 0 1px;
  font-size: 23px;
}

.hub-hero p {
  font-size: 10px;
}

.hub-kicker {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 8px;
}

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

.hub-access-counter {
  display: inline-flex;
  min-width: 94px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.hub-access-counter small,
.hub-access-counter strong {
  display: inline;
  margin: 0;
}

.hub-access-counter small { color: #a7d8d3; font-size: 8px; }
.hub-access-counter strong { color: #edc17a; font-size: 11px; }

.hub-guide-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(226, 186, 116, 0.28);
  border-radius: 10px;
  background: rgba(226, 186, 116, 0.1);
  color: #f0d39e;
  font-size: 9px;
  font-weight: 800;
}

.hub-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #d8e7e7;
  font-size: 8px;
}

.hub-view-mode strong { color: #f1c77f; }
.hub-view-mode button { padding: 3px 7px; border: 0; border-radius: 6px; background: rgba(255,255,255,.1); color: #fff; font-size: 8px; }

.hub-access-workspace {
  padding: 11px;
  border: 1px solid #dae5e6;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(20, 55, 65, 0.055);
}

.module-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.module-tab {
  display: inline-flex;
  min-width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid #e0e8e9;
  border-radius: 11px;
  background: #fff;
  color: #526970;
  font-size: 9px;
  transition: 160ms ease;
}

.module-tab > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: var(--module-soft);
  color: var(--module-color);
  font-size: 8px;
  font-weight: 900;
}

.module-tab strong { font-weight: 800; }
.module-tab.active { border-color: color-mix(in srgb, var(--module-color) 35%, #dae4e5); background: color-mix(in srgb, var(--module-soft) 48%, #fff); color: var(--module-color); box-shadow: inset 0 -2px 0 var(--module-color); }

.hub-access-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 10px;
}

.module-detail {
  min-height: 174px;
  padding: 17px 18px;
  border: 1px solid #e0e8e9;
  border-radius: 13px;
  background: #fff;
}

.module-detail-heading {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 11px;
}

.module-detail-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--module-soft);
  color: var(--module-color);
  font-size: 9px;
  font-weight: 900;
}

.module-detail-heading small { display: block; color: var(--module-color); font-size: 8px; font-weight: 800; }
.module-detail-heading h2 { margin: 2px 0 0; color: #18343d; font-size: 17px; }
.module-detail-heading button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 9px; background: var(--module-color); color: #fff; font-size: 9px; font-weight: 800; }

.module-sublevels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #edf1f2;
}

.module-sublevels span {
  padding: 6px 9px;
  border: 1px solid #e3e9ea;
  border-radius: 8px;
  background: #f7faf9;
  color: #5b7076;
  font-size: 8.5px;
  font-weight: 700;
}

.hub-service-stack {
  display: grid;
  gap: 7px;
}

.hub-service-card {
  display: grid;
  min-height: 52px;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #e0e8e9;
  border-radius: 12px;
  background: #fff;
}

.hub-service-card > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #eef6f4;
  color: #167268;
  font-size: 8px;
  font-weight: 900;
}

.hub-service-card div small,
.hub-service-card div strong { display: block; }
.hub-service-card div small { color: #8a999d; font-size: 7px; }
.hub-service-card div strong { margin-top: 1px; color: #29444c; font-size: 10px; }
.hub-service-card button { min-height: 29px; padding: 0 8px; border: 1px solid #d7e4e2; border-radius: 7px; background: #f6faf9; color: #1d6e67; font-size: 8px; font-weight: 800; }
.hub-service-finance > span { background: #fff4df; color: #a8660e; }
.hub-service-contract > span { background: #eef2fb; color: #355aa0; }

.hub-access-note { margin: 12px 0 0; font-size: 8.5px; }

.hub-guide-dialog,
.hub-support-dialog,
.hub-finance-dialog {
  width: min(calc(100% - 28px), 760px);
  max-height: min(82vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce6e6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 35px 90px rgba(4, 25, 32, 0.3);
  color: #19353e;
  font-family: "Estedad", "Vazirmatn", Tahoma, sans-serif;
}

.hub-support-dialog { width: min(calc(100% - 28px), 900px); }
.hub-finance-dialog { width: min(calc(100% - 28px), 640px); overflow-y: auto; }
.hub-guide-dialog::backdrop,
.hub-support-dialog::backdrop,
.hub-finance-dialog::backdrop { background: rgba(5, 24, 31, 0.64); backdrop-filter: blur(5px); }

.hub-guide-dialog > header,
.hub-support-dialog > header,
.hub-finance-dialog > header,
.hub-support-dialog form > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #e5ebec;
  background: #f7faf9;
}

.hub-guide-dialog header small,
.hub-support-dialog header small,
.hub-finance-dialog header small { color: #188075; font-size: 8px; font-weight: 800; }
.hub-guide-dialog header h2,
.hub-support-dialog header h2,
.hub-finance-dialog header h2 { margin: 2px 0 0; font-size: 17px; }
.hub-guide-dialog header > button,
.hub-support-dialog header > button,
.hub-finance-dialog header > button { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid #dbe4e4; border-radius: 9px; background: #fff; color: #62777d; font-size: 19px; }

.hub-guide-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; max-height: 60vh; padding: 16px; overflow-y: auto; }
.hub-guide-list article { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px; border: 1px solid #e2e9ea; border-radius: 12px; }
.hub-guide-list article > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; background: var(--module-soft); color: var(--module-color); font-size: 8px; font-weight: 900; }
.hub-guide-list small,.hub-guide-list strong { display:block; }
.hub-guide-list small { color: var(--module-color); font-size: 7px; }
.hub-guide-list strong { font-size: 11px; }
.hub-guide-list p { margin: 4px 0 0; color: #687b81; font-size: 8.5px; line-height: 1.8; }

.hub-support-tabs,
.hub-finance-tabs { display: flex; gap: 5px; padding: 10px 16px 0; }
.hub-support-tabs button,
.hub-finance-tabs button { min-height: 34px; padding: 0 12px; border: 1px solid #dfe7e8; border-radius: 9px; background: #fff; color: #65787e; font-size: 9px; font-weight: 800; }
.hub-support-tabs button.active,
.hub-finance-tabs button.active { border-color: #bcd9d5; background: #eaf7f5; color: #176d65; }

.hub-support-panel,
.hub-finance-panel { display: none; padding: 16px; }
.hub-support-panel.active,
.hub-finance-panel.active { display: grid; gap: 11px; }
.hub-support-dialog label,
.hub-finance-dialog label { display: grid; gap: 5px; color: #435c64; font-size: 9px; font-weight: 750; }
.hub-support-dialog input,.hub-support-dialog select,.hub-support-dialog textarea,
.hub-finance-dialog input,.hub-finance-dialog select,.hub-finance-dialog textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #d8e2e2; border-radius: 9px; outline: 0; background: #fff; color: #203e47; font-size: 10px; }
.hub-support-dialog textarea,.hub-finance-dialog textarea { resize: vertical; }
.hub-support-grid,.hub-finance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.hub-ticket-upload,.hub-receipt-upload { padding: 10px; border: 1px dashed #cbdcda; border-radius: 10px; background: #f5faf8; }
.hub-ticket-upload small,.hub-receipt-upload small,.hub-finance-hint { color: #7b8d91; font-size: 8px; }
.hub-support-panel footer { display: flex; justify-content: flex-end; gap: 7px; }
.hub-dialog-primary,.hub-dialog-secondary { min-height: 38px; padding: 0 14px; border-radius: 9px; font-size: 9px; font-weight: 800; }
.hub-dialog-primary { border: 0; background: #176e67; color: #fff; }
.hub-dialog-secondary { border: 1px solid #dce5e5; background: #fff; color: #60747a; }

.hub-ticket-list { display: grid; gap: 10px; max-height: 58vh; overflow-y: auto; }
.hub-ticket { border: 1px solid #dfe7e8; border-radius: 12px; overflow: hidden; }
.hub-ticket > header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f7faf9; }
.hub-ticket > header small,.hub-ticket > header strong { display:block; }
.hub-ticket > header small { color:#849398;font-size:7px; }
.hub-ticket > header strong { font-size:11px; }
.hub-ticket > header > span { padding:4px 7px;border-radius:999px;background:#fff3dc;color:#97600e;font-size:7px;font-weight:800; }
.hub-ticket > header > span[data-status="answered"] { background:#e7f7f1;color:#15705f; }
.hub-ticket-thread { display:grid; gap:7px; padding:10px; }
.hub-ticket-message { max-width:88%; padding:9px 10px; border-radius:10px; background:#f1f5f5; }
.hub-ticket-message.designer { margin-right:auto; background:#e9f7f4; }
.hub-ticket-message > div { display:flex; justify-content:space-between; gap:15px; }
.hub-ticket-message strong { font-size:8px; }.hub-ticket-message small{color:#87979b;font-size:7px;}.hub-ticket-message p{margin:5px 0 0;font-size:9px;line-height:1.8;white-space:pre-wrap;}
.hub-ticket-images { display:flex;gap:5px;margin-top:7px; }.hub-ticket-images img{width:64px;height:48px;object-fit:cover;border-radius:7px;border:1px solid #d5e1e0;}
.hub-ticket-reply { display:grid;grid-template-columns:1fr 150px auto;gap:7px;align-items:end;padding:10px;border-top:1px solid #e5ebeb;background:#fbfcfc;}.hub-ticket-reply textarea{min-height:42px;}.hub-ticket-reply input{font-size:8px;}.hub-ticket-reply button{min-height:38px;border:0;border-radius:8px;background:#176e67;color:#fff;font-size:8px;font-weight:800;}.hub-ticket-reply>small{grid-column:1/-1;color:#a54c3b;font-size:8px;}
.hub-ticket-empty { padding:30px;text-align:center; }.hub-ticket-empty strong{font-size:12px;}.hub-ticket-empty p{color:#7b8c91;font-size:9px;}
#hubSupportStatus,#hubGatewayStatus,#hubReceiptStatus { min-height:16px;margin:0;color:#9a5e14;font-size:8.5px; }

@media (max-width: 780px) {
  .hub-view-as { min-width: 150px; }
  .hub-view-as > span { display:none; }
  .hub-access-stage { grid-template-columns: 1fr; }
  .hub-service-stack { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hub-service-card { grid-template-columns:30px 1fr; }.hub-service-card button{grid-column:1/-1;}.hub-service-card>span{width:30px;height:30px;}
  .hub-guide-list { grid-template-columns:1fr; }
}

@media (max-width: 560px) {
  .hub-content { padding: 13px; }
  .hub-hero { align-items:flex-start;flex-direction:column; }
  .hub-hero-actions { width:100%; }.hub-guide-button{flex:1;}
  .hub-service-stack,.hub-support-grid,.hub-finance-grid { grid-template-columns:1fr; }
  .module-detail-heading { grid-template-columns:38px 1fr; }.module-detail-heading button{grid-column:1/-1;}
  .hub-ticket-reply { grid-template-columns:1fr; }.hub-ticket-reply>small{grid-column:auto;}
}

/* Final print contract — keep after every responsive rule. */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 11mm 15mm;
  }

  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #18313d !important;
    font-size: 8.7pt !important;
    line-height: 1.65 !important;
  }

  .support-contract-panel {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .contract-print-header {
    display: grid !important;
    grid-template-columns: 15mm minmax(0, 1fr) auto !important;
    gap: 3.5mm !important;
    margin: 0 0 5mm !important;
    padding: 0 0 3.5mm !important;
  }

  .contract-print-mark {
    width: 14mm !important;
    height: 14mm !important;
    border-radius: 3mm !important;
    font-size: 15pt !important;
  }

  .contract-print-header h1 {
    margin: .5mm 0 !important;
    font-size: 15pt !important;
    line-height: 1.35 !important;
  }

  .contract-print-seal {
    max-width: 44mm;
    text-align: center;
  }

  .contract-meta-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 2mm !important;
    margin-bottom: 3mm !important;
  }

  .contract-meta-grid label {
    display: grid !important;
    gap: .5mm !important;
    min-height: 0 !important;
    padding: 1.6mm 2mm !important;
  }

  .contract-meta-grid input {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 8pt !important;
  }

  .contract-parties-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3mm !important;
  }

  .contract-party-card {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 2.5mm !important;
    break-inside: avoid-page !important;
  }

  .contract-party-heading {
    margin-bottom: 1.5mm !important;
  }

  .contract-party-heading h3 {
    margin-top: 0 !important;
    font-size: 10pt !important;
  }

  .contract-party-fields {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1mm 2mm !important;
  }

  .contract-party-fields label,
  .contract-party-fields label:last-child {
    display: grid !important;
    grid-column: auto !important;
    gap: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .contract-party-fields label:last-child {
    grid-column: 1 / -1 !important;
  }

  .contract-party-input,
  .contract-party-value {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: .4mm 0 !important;
    border: 0 !important;
    line-height: 1.35 !important;
    font-size: 8pt !important;
  }

  .contract-section-heading,
  .signature-grid {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
  }

  .sla-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .contract-body,
  .contract-section {
    width: 100% !important;
    min-width: 0 !important;
  }

  .contract-section {
    margin: 0 !important;
    padding: 3mm 0 !important;
    break-inside: auto !important;
  }

  .contract-section h2 {
    margin: 0 0 1.4mm !important;
    font-size: 10.5pt !important;
  }

  .contract-section p,
  .contract-section li {
    margin-top: 1mm !important;
    font-size: 8.4pt !important;
    line-height: 1.7 !important;
    orphans: 3;
    widows: 3;
  }

  .contract-appendix-table-frame {
    overflow: visible !important;
  }

  .contract-appendix-table,
  .contract-appendix-table tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .contract-appendix-table tr {
    display: grid !important;
    grid-template-columns: .35fr 2fr 1fr 1fr 1.15fr 1.15fr !important;
    gap: 1.3mm !important;
    margin: 0 0 2mm !important;
    padding: 2.2mm !important;
  }

  .contract-appendix-table td,
  .contract-appendix-table td:nth-child(n) {
    display: grid !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  .contract-appendix-table td:nth-child(2),
  .contract-appendix-table td:nth-child(7),
  .contract-appendix-table td:nth-child(8),
  .contract-appendix-table td:nth-child(9) {
    grid-column: span 2 !important;
  }

  .contract-appendix-table td:last-child {
    display: none !important;
  }

  .contract-appendix-input,
  .contract-financial-link,
  .contract-payable-button {
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    font-size: 7.7pt !important;
  }

  .contract-signatures {
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  .signature-grid {
    gap: 5mm !important;
  }

  .signature-grid > div {
    flex: 1 1 0;
    min-height: 27mm !important;
    padding: 3mm !important;
  }
}

/* Per-row commission calculation guide */
.cs-calculation-guide-button {
  min-width: 104px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #bcd8d3;
  border-radius: 9px;
  background: #edf8f5;
  color: #08796c;
  font: 800 .68rem var(--app-font, "Estedad", sans-serif);
  white-space: nowrap;
  cursor: pointer;
}

.cs-calculation-guide-button:hover,
.cs-calculation-guide-button:focus-visible {
  border-color: #0b8174;
  background: #0b8174;
  color: #fff;
  outline: none;
}
.cs-calculation-guide-button.compact { min-width: 70px; min-height: 29px; padding: 4px 8px; font-size: .61rem; }
.cs-invoice-calculation-button {
  display: grid;
  min-width: 145px;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid #c6ddd9;
  border-radius: 9px;
  background: #f0f9f7;
  color: #176e66;
  font-family: var(--app-font, "Estedad", sans-serif);
  text-align: right;
  cursor: pointer;
}
.cs-invoice-calculation-button strong { color: #135e59; font-size: .7rem; }
.cs-invoice-calculation-button small { color: #63847f; font-size: .58rem; }
.cs-invoice-calculation-button:hover,
.cs-invoice-calculation-button:focus-visible { border-color: #148077; background: #e2f5f1; outline: none; }
.cs-invoice-guide-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cs-calculation-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 30px), 980px);
  height: min(88vh, 820px);
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #d4e0e5;
  border-radius: 20px;
  background: #f6f9fb;
  color: #183047;
  font-family: var(--app-font, "Estedad", "Vazirmatn", sans-serif);
  box-shadow: 0 34px 90px rgba(4, 24, 42, .32);
}

.cs-calculation-dialog::backdrop {
  background: rgba(6, 22, 37, .67);
  backdrop-filter: blur(6px);
}

.cs-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  color: #fff;
  background: linear-gradient(125deg, #0c3158, #0a7772);
}

.cs-guide-header > div { min-width: 0; flex: 1 1 auto; }

.cs-guide-header small,
.cs-guide-header h2,
.cs-guide-header p { display: block; margin: 0; }
.cs-guide-header small { color: #aee6dc; font-size: .68rem; font-weight: 800; }
.cs-guide-header h2 { margin-top: 3px; font-size: 1.2rem; }
.cs-guide-header p { margin-top: 4px; color: #d5e7ed; font-size: .72rem; }
.cs-guide-header button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.cs-guide-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #dde6eb;
  background: #fff;
}

.cs-guide-summary span { padding: 9px 11px; border: 1px solid #e1e8ec; border-radius: 10px; background: #f8fafb; }
.cs-guide-summary small,
.cs-guide-summary strong { display: block; }
.cs-guide-summary small { color: #728393; font-size: .62rem; }
.cs-guide-summary strong { margin-top: 4px; color: #17354f; font-size: .78rem; }

.cs-guide-period-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #dde6eb;
  background: #f9fbfc;
}
.cs-guide-period-meta span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 7px 10px; border: 1px solid #dce7eb; border-radius: 9px; background: #fff; }
.cs-guide-period-meta small { color: #728393; font-size: .6rem; }
.cs-guide-period-meta strong { color: #17455f; font-size: .7rem; direction: ltr; white-space: nowrap; }
.cs-network-guide-body > .cs-guide-period-meta { padding: 0; border: 0; background: transparent; }

.cs-guide-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
  padding: 15px 16px;
  overflow-y: auto;
}

.cs-guide-block {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-content: start;
  gap: 8px 10px;
  padding: 14px;
  border: 1px solid #dce5ea;
  border-radius: 14px;
  background: #fff;
}

.cs-guide-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #e8f6f3; color: #08796c; font-size: .75rem; font-weight: 900; }
.cs-guide-block h3 { margin: 0; color: #17344f; font-size: .9rem; }
.cs-guide-block p { margin: 3px 0 0; color: #728292; font-size: .62rem; line-height: 1.75; }
.cs-guide-block > strong { align-self: center; color: #0b756c; font-size: .9rem; white-space: nowrap; }
.cs-guide-block code,
.cs-guide-substitution,
.cs-guide-block > small,
.cs-guide-score-parts { grid-column: 1 / -1; }
.cs-guide-block code { padding: 9px 11px; border-radius: 9px; background: #edf3f8; color: #184873; font: 800 .68rem var(--app-font, sans-serif); line-height: 1.9; text-align: right; white-space: normal; }
.cs-guide-substitution { padding: 9px 11px; border: 1px dashed #d5b46d; border-radius: 9px; background: #fff9ec; color: #6d5325; font-size: .67rem; line-height: 1.9; }
.cs-guide-substitution b { color: #9a6311; font-size: .75rem; }
.cs-guide-block > small { color: #6d7f8e; font-size: .62rem; line-height: 1.85; }
.cs-guide-block > small b { color: #164e67; }
.cs-guide-score-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cs-guide-score-parts span { padding: 7px 9px; border-radius: 8px; background: #f6f8fa; color: #637687; font-size: .64rem; }
.cs-guide-score-parts b { color: #173c5a; }
.cs-guide-commission-block { border-color: #b9dcd5; background: linear-gradient(180deg, #fff, #f4fbf9); }

.cs-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 17px;
  border-top: 1px solid #dde6eb;
  background: #fff;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}
.cs-guide-footer span { color: #738492; font-size: .62rem; }
.cs-guide-footer button { min-height: 34px; padding: 0 18px; border: 0; border-radius: 9px; background: #0b776e; color: #fff; font: 800 .68rem var(--app-font, sans-serif); cursor: pointer; }
.cs-guide-footer-actions { display: flex; gap: 7px; }
.cs-guide-footer .cs-detail-toggle-invoice { color: #75561d; border: 1px solid #e0c784; background: #fff7e2; }
.cs-guide-footer .cs-detail-toggle-invoice.activate { color: #086b58; border-color: #acd8cc; background: #eaf8f4; }
.cs-guide-footer .cs-detail-delete-invoice { color: #a43f3f; border: 1px solid #e4bcbc; background: #fff1f1; }
.cs-guide-footer .cs-detail-delete-invoice:disabled { color: #9ca7af; border-color: #dfe5e9; background: #f3f5f6; cursor: not-allowed; opacity: .75; }
.cs-guide-footer .secondary-action { color: #325a72; border: 1px solid #c9d8e2; background: #f4f8fa; }

.cs-invoice-facts { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid #d9e5e8; border-radius: 14px; background: linear-gradient(135deg, #f7fbfb, #f5f8fb); }
.cs-invoice-facts > div { min-width: 0; padding: 9px 10px; border-radius: 9px; background: #fff; }
.cs-invoice-facts span, .cs-invoice-facts strong { display: block; }
.cs-invoice-facts span { color: #778895; font-size: .58rem; }
.cs-invoice-facts strong { margin-top: 4px; overflow: hidden; color: #17394f; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.cs-invoice-items { grid-column: 1 / -1; padding: 13px; border: 1px solid #dbe5e9; border-radius: 14px; background: #fff; }
.cs-invoice-items .cs-title { margin-bottom: 10px; }
.cs-invoice-items .cs-title h3 { margin: 2px 0 0; color: #17384f; font-size: .88rem; }
.cs-invoice-items .cs-table-wrap { overflow: visible; }
.cs-invoice-items .cs-table { width: 100%; min-width: 0; table-layout: fixed; font-size: .56rem; }
.cs-invoice-items .cs-table th,
.cs-invoice-items .cs-table td { padding: 7px 4px; white-space: normal; overflow-wrap: anywhere; word-break: normal; line-height: 1.65; }
.cs-invoice-items .cs-table th:nth-child(1), .cs-invoice-items .cs-table td:nth-child(1) { width: 5%; }
.cs-invoice-items .cs-table th:nth-child(2), .cs-invoice-items .cs-table td:nth-child(2) { width: 25%; }
.cs-invoice-items .cs-table th:nth-child(3), .cs-invoice-items .cs-table td:nth-child(3) { width: 9%; }
.cs-invoice-items .cs-table th:nth-child(4), .cs-invoice-items .cs-table td:nth-child(4) { width: 10%; }
.cs-invoice-items .cs-table th:nth-child(5), .cs-invoice-items .cs-table td:nth-child(5) { width: 11%; }
.cs-invoice-items .cs-table th:nth-child(6), .cs-invoice-items .cs-table td:nth-child(6) { width: 8%; }
.cs-invoice-items .cs-table th:nth-child(7), .cs-invoice-items .cs-table td:nth-child(7) { width: 8%; }
.cs-invoice-items .cs-table th:nth-child(8), .cs-invoice-items .cs-table td:nth-child(8) { width: 11%; }
.cs-invoice-items .cs-table th:nth-child(9), .cs-invoice-items .cs-table td:nth-child(9) { width: 7%; }
.cs-invoice-items .cs-table th:nth-child(10), .cs-invoice-items .cs-table td:nth-child(10) { width: 11%; }
.cs-invoice-items .cs-table td:nth-child(2) strong, .cs-invoice-items .cs-table td:nth-child(2) small { display: block; }
.cs-invoice-items .cs-table td:nth-child(2) small { margin-top: 3px; color: #7c8b98; direction: ltr; text-align: right; }

.cs-network-guide-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
  padding: 15px 16px;
  overflow-y: auto;
}
.cs-network-formula-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 18px;
  padding: 16px;
  border: 1px solid #bddcd7;
  border-radius: 14px;
  background: linear-gradient(130deg, #f7fcfb, #eef7fa);
}
.cs-network-formula-card > span { color: #0b796d; font-size: .65rem; font-weight: 900; }
.cs-network-formula-card > strong { grid-row: span 2; align-self: center; color: #0c6f67; font-size: 1.25rem; white-space: nowrap; }
.cs-network-formula-card > p { margin: 0; color: #657888; font-size: .68rem; line-height: 1.8; }
.cs-network-formula-card > code,
.cs-network-formula-card > div { grid-column: 1 / -1; padding: 10px 12px; border-radius: 9px; font: 800 .7rem var(--app-font, sans-serif); line-height: 1.9; }
.cs-network-formula-card > code { background: #e6eff6; color: #164a72; white-space: normal; }
.cs-network-formula-card > div { border: 1px dashed #d2ad60; background: #fff9e9; color: #725322; }
.cs-network-formula-card > div b { color: #a1660f; }
.cs-network-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.cs-network-totals span { padding: 10px; border: 1px solid #dfe7eb; border-radius: 10px; background: #fff; }
.cs-network-totals small,
.cs-network-totals b { display: block; }
.cs-network-totals small { color: #788896; font-size: .6rem; }
.cs-network-totals b { margin-top: 4px; color: #173750; font-size: .7rem; }
.cs-network-breakdown { padding: 14px; border: 1px solid #dce5e9; border-radius: 14px; background: #fff; }
.cs-network-breakdown > div:first-child { margin-bottom: 10px; }
.cs-network-breakdown h3 { margin: 2px 0 0; color: #18364f; font-size: .9rem; }
.cs-network-breakdown > div > small { color: #0b7d71; font-size: .62rem; font-weight: 900; }

.cs-help-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px; background: linear-gradient(135deg, #fff, #f1f8f7); }
.cs-help-hero span { color: #0b7b71; font-size: .67rem; font-weight: 900; }
.cs-help-hero h1 { margin: 4px 0 5px; color: #173750; font-size: 1.3rem; }
.cs-help-hero p { max-width: 780px; margin: 0; color: #647787; font-size: .7rem; line-height: 1.9; }
.cs-help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.cs-help-grid details { overflow: hidden; border: 1px solid #dce6ea; border-radius: 14px; background: #fff; box-shadow: 0 8px 25px rgba(20, 53, 72, .04); }
.cs-help-grid summary { display: flex; align-items: center; gap: 11px; padding: 14px; list-style: none; cursor: pointer; }
.cs-help-grid summary::-webkit-details-marker { display: none; }
.cs-help-grid summary > b { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; color: #0a776e; border-radius: 9px; background: #e8f6f3; }
.cs-help-grid summary span, .cs-help-grid summary strong, .cs-help-grid summary small { display: block; }
.cs-help-grid summary strong { color: #17384f; font-size: .78rem; }
.cs-help-grid summary small { margin-top: 2px; color: #7a8996; font-size: .6rem; }
.cs-help-grid details > div { padding: 0 15px 15px; color: #5f7383; font-size: .68rem; line-height: 2; }
.cs-help-grid details > div p { margin: 0 0 8px; }
.cs-help-grid code { display: block; margin-top: 7px; padding: 8px 10px; color: #184c72; font: 800 .65rem var(--app-font, sans-serif); border-radius: 8px; background: #edf3f7; white-space: normal; }
.cs-help-note { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; margin-top: 14px; padding: 14px 16px; border: 1px solid #d5e5df; border-radius: 13px; background: #f2faf7; }
.cs-help-note strong { color: #087569; font-size: .7rem; }
.cs-help-note p { margin: 0; color: #526d78; font-size: .67rem; }
.cs-help-note small { color: #70858d; font-size: .61rem; }

.cs-export-stage .cs-calculation-dialog {
  height: auto;
}

.cs-product-catalog-example {
  display: block;
  max-width: 760px;
  margin-top: 6px;
  color: #52717d;
  font-size: .68rem;
  line-height: 1.9;
}

@media (max-width: 760px) {
  .cs-guide-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-guide-period-meta { grid-template-columns: 1fr; padding: 8px 10px; }
  .cs-guide-period-meta span { justify-content: flex-start; }
  .cs-guide-body { grid-template-columns: 1fr; max-height: calc(88vh - 270px); }
  .cs-network-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-invoice-guide-body { grid-template-columns: 1fr; }
  .cs-export-actions { margin-inline-start: 0; }
  .cs-guide-header { flex-wrap: wrap; }
  .cs-invoice-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-sales-search-wrap { align-items: stretch; flex-direction: column; }
  .cs-sales-search-wrap > small { text-align: center; }
  .cs-guide-footer-actions { flex-wrap: wrap; }
  .cs-help-grid { grid-template-columns: 1fr; }
  .cs-help-note { grid-template-columns: 1fr; }
  .cs-import-control-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-import-error-list > div { grid-template-columns: 28px 1fr; }
  .cs-import-error-list span { grid-column: 2; }
  .cs-field-help { width: min(250px, calc(100vw - 40px)); }
  .cs-province-menu { max-height: min(52vh, 330px); }
  .cs-province-list { max-height: min(37vh, 240px); }
  .cs-province-list label[data-cs-province-row] { grid-template-columns: 18px minmax(0,1fr) 62px; }
  .cs-province-zone-lists { max-height: min(37vh, 240px); }
  .cs-province-zone-lists label[data-cs-province-row] { grid-template-columns: 18px minmax(0,1fr); }
  .cs-province-zone-lists label[data-cs-province-row] select { grid-column: 2; width: 100%; }
  .cs-region-zone-tabs { padding-inline: 12px; }
  .cs-region-zone-grid { padding-inline: 12px; }
  .cs-region-zone-grid label[data-cs-province-row] { grid-template-columns: minmax(0,1fr) 62px; }
  .cs-region-zone-grid label[data-cs-province-row] select { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 480px) {
  .cs-calculation-dialog { width: calc(100% - 16px); height: calc(100vh - 16px); max-height: calc(100vh - 16px); border-radius: 15px; }
  .cs-guide-header { padding: 14px; }
  .cs-guide-header h2 { font-size: 1.05rem; }
  .cs-guide-summary { padding: 9px; }
  .cs-guide-body { padding: 9px; }
  .cs-guide-score-parts { grid-template-columns: 1fr; }
  .cs-guide-footer span { display: none; }
  .cs-guide-footer button { width: 100%; }
}

@media (max-width: 760px) {
  .contract-parties-grid { grid-template-columns: 1fr; }
  .contract-party-fields { grid-template-columns: 1fr; }
  .contract-party-fields label:last-child { grid-column: auto; }
  .contract-appendix-intro { align-items: flex-start; flex-direction: column; }
  .contract-tax-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-section-heading { align-items: stretch; flex-direction: column; }
  .contract-actions { justify-content: flex-start; }
}

@media (max-width: 430px) {
  .contract-tax-summary { grid-template-columns: 1fr; }
  .contract-role-switch { width: 100%; }
  .contract-role-switch .role-button { flex: 1; }
}

/* Modern systems hub: stronger hierarchy, fewer words, clearer actions. */
.module-hub {
  background:
    radial-gradient(circle at 12% 0%, rgba(32, 125, 123, 0.09), transparent 28rem),
    linear-gradient(rgba(28, 72, 84, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 72, 84, 0.035) 1px, transparent 1px), #f5f8f9;
  background-size: auto, 38px 38px, 38px 38px, auto;
}

.hub-header {
  min-height: 76px;
  padding-inline: clamp(18px, 5vw, 74px);
}

.hub-content {
  width: min(100%, 1120px);
  padding-top: 28px;
}

.hub-hero {
  min-height: 138px;
  margin-bottom: 16px;
  padding: 24px 26px;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(14, 47, 58, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hub-hero h1 {
  margin-top: 10px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.9px;
}

.hub-hero p {
  font-size: 12px;
}

.hub-access-counter {
  min-width: 112px;
  min-height: 48px;
}

.hub-access-counter small,
.hub-guide-button,
.module-tab,
.hub-service-card button {
  font-size: 10px;
}

.hub-access-workspace {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 38px rgba(20, 55, 65, 0.07);
}

.module-tabs {
  gap: 8px;
  padding-bottom: 13px;
}

.module-tab {
  min-height: 48px;
  padding-inline: 13px;
  border-radius: 12px;
}

.module-tab > span {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.module-detail {
  min-height: 186px;
  padding: 21px;
  border-radius: 15px;
  box-shadow: inset 4px 0 0 var(--module-color, #17847b);
}

.module-detail-heading h2 {
  font-size: 21px;
}

.module-detail-heading button {
  min-height: 42px;
  padding-inline: 17px;
  font-size: 10px;
}

.module-sublevels {
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
}

.module-sublevels span {
  padding: 7px 11px;
  font-size: 9.5px;
}

.hub-service-stack {
  gap: 9px;
}

.hub-service-card {
  min-height: 56px;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 13px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hub-service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 55, 65, 0.1);
}

.hub-service-card > span {
  width: 38px;
  height: 38px;
  font-size: 9px;
}

.hub-service-card div small { font-size: 8px; }
.hub-service-card div strong { font-size: 12px; }
.hub-service-card button { min-height: 32px; padding-inline: 10px; }

.hub-access-note {
  margin-top: 14px;
  font-size: 10px;
}

@media (max-width: 780px) {
  .hub-hero { padding: 20px; }
  .module-detail { min-height: 160px; }
}

@media (max-width: 560px) {
  .hub-content { padding-top: 16px; }
  .hub-hero h1 { font-size: 26px; }
  .hub-hero p { font-size: 11px; }
  .module-detail-heading h2 { font-size: 19px; }
}

/* Unified business workspace and accordion navigation */
.module-hub {
  background:
    radial-gradient(circle at 82% 4%, rgba(17, 132, 120, 0.16), transparent 28rem),
    radial-gradient(circle at 6% 78%, rgba(188, 137, 55, 0.1), transparent 25rem),
    linear-gradient(rgba(20, 67, 77, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 67, 77, 0.035) 1px, transparent 1px),
    #f2f6f6;
  background-size: auto, auto, 36px 36px, 36px 36px, auto;
}

.hub-content {
  width: min(100%, 1240px);
  padding-bottom: 44px;
}

.hub-hero {
  position: relative;
  overflow: hidden;
  min-height: 156px;
  padding: 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 9% 125%, rgba(212, 164, 83, 0.22), transparent 18rem),
    linear-gradient(118deg, #082f3b 0%, #0d4f59 56%, #177d72 100%);
}

.hub-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 55%, rgba(255, 255, 255, 0.07));
  pointer-events: none;
}

.hub-hero-main,
.hub-hero-actions { position: relative; z-index: 1; }
.hub-kicker { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); }
.hub-hero h1 { color: #fff; font-size: clamp(30px, 3vw, 42px); }
.hub-hero p { color: rgba(232, 247, 244, 0.78); }

.hub-access-workspace {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 20px 54px rgba(18, 56, 64, 0.1), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hub-workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.hub-workspace-heading small,
.hub-workspace-heading h2 { display: block; margin: 0; }
.hub-workspace-heading small { color: #768a8e; font-size: 9px; font-weight: 750; }
.hub-workspace-heading h2 { margin-top: 3px; color: #173740; font-size: 20px; }
.hub-workspace-heading > span { display: inline-flex; align-items: center; gap: 6px; color: #337269; font-size: 9px; font-weight: 800; }
.hub-workspace-heading > span i { width: 7px; height: 7px; border-radius: 50%; background: #14a883; box-shadow: 0 0 0 5px rgba(20,168,131,.1); }

.module-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  overflow: visible;
  padding: 0;
}

.system-access-card {
  min-width: 0;
  min-height: 224px;
  animation: system-card-in 420ms both;
  animation-delay: calc(var(--card-index) * 45ms);
}

@keyframes system-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.system-access-card > button {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 224px;
  grid-template-columns: 56px 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 16px 14px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--module-color) 18%, rgba(255,255,255,.85));
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--module-soft) 78%, transparent), transparent 56%),
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.58));
  box-shadow: 0 12px 28px rgba(22, 59, 66, 0.07), inset 0 1px 0 #fff;
  color: #183840;
  text-align: right;
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.system-access-card > button::before {
  content: "";
  position: absolute;
  top: -48px;
  left: -52px;
  width: 132px;
  height: 132px;
  border: 1px solid color-mix(in srgb, var(--module-color) 15%, transparent);
  border-radius: 50%;
}

.system-access-card > button:hover,
.system-access-card > button:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--module-color) 40%, #fff);
  box-shadow: 0 18px 36px rgba(18, 54, 62, 0.13), inset 0 1px 0 #fff;
  outline: 0;
}

.system-card-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--module-color) 16%, #fff);
  border-radius: 16px;
  background: color-mix(in srgb, var(--module-soft) 76%, rgba(255,255,255,.7));
  color: var(--module-color);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.system-card-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.system-card-state { display: inline-flex; justify-self: end; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid rgba(32,125,107,.14); border-radius: 999px; background: rgba(238,250,246,.8); color: #287565; font-size: 8px; font-weight: 800; }
.system-card-state i { width: 6px; height: 6px; border-radius: 50%; background: #20a47f; }
.system-card-title { grid-column: 2 / 4; align-self: center; }
.system-card-title small,
.system-card-title strong { display: block; }
.system-card-title small { margin-bottom: 5px; color: var(--module-color); font-size: 9px; font-weight: 800; }
.system-card-title strong { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; }
.system-card-modules { display: flex; grid-column: 1 / -1; align-content: flex-start; flex-wrap: wrap; gap: 6px; }
.system-card-modules em { padding: 5px 8px; border: 1px solid rgba(50,80,88,.09); border-radius: 7px; background: rgba(255,255,255,.65); color: #64787d; font-size: 8.5px; font-style: normal; font-weight: 700; }
.system-card-enter { display: inline-flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px solid rgba(55,83,89,.1); color: var(--module-color); font-size: 10px; font-weight: 850; }
.system-card-enter b { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: var(--module-color); color: #fff; font-size: 14px; }

.hub-service-stack {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(36, 74, 81, 0.09);
}

.hub-service-card {
  min-height: 45px;
  grid-template-columns: 30px auto auto;
  width: auto;
  padding: 6px 8px;
  border-color: rgba(31, 74, 81, 0.1);
  background: rgba(255,255,255,.62);
}
.hub-service-card > span { width: 30px; height: 30px; }
.hub-service-card div small { display: none; }
.hub-service-card div strong { margin: 0; font-size: 10px; }
.hub-service-card button { min-height: 28px; }

/* One professional level-one navigation shared by every activated module. */
.app-shell {
  grid-template-columns: 310px minmax(0, 1fr);
}

.sidebar {
  gap: 14px;
  padding: 20px 17px;
  background:
    radial-gradient(circle at 50% 0%, rgba(20, 134, 128, 0.35), transparent 18rem),
    linear-gradient(180deg, #082f3f 0%, #0a3b49 46%, #082a38 100%);
  box-shadow: -14px 0 34px rgba(6, 30, 40, 0.13);
}

.brand-block { padding: 0 4px 4px; }
.brand-icon { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.1); color: #f3c77c; }
.brand-block strong { font-size: 14px; }
.brand-block small { margin-top: 3px; color: #a9c7cb; font-size: 9px; }
.module-back-button { min-height: 42px; border-color: rgba(255,255,255,.14); border-radius: 11px; background: rgba(255,255,255,.07); color: #dbeaec; }

.sidebar-nav {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.nav-accordion { overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.035); }
.sidebar-nav .nav-group-toggle {
  min-height: 52px;
  gap: 10px;
  padding: 8px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.sidebar-nav .nav-group-toggle:hover { border-color: transparent; background: rgba(255,255,255,.055); color: #fff; }
.nav-group-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.07); color: #abd8d4; }
.nav-group-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-group-copy { min-width: 0; flex: 1; }
.nav-group-copy strong,
.nav-group-copy small { display: block; }
.nav-group-copy strong { color: #f4f8f8; font-size: 11.5px; }
.nav-group-copy small { margin-top: 2px; color: #86aab0; font-size: 8px; }
.nav-chevron { color: #86aab0; font-size: 17px; transition: transform 170ms ease; }
.nav-accordion.open .nav-chevron { transform: rotate(180deg); }
.nav-accordion.open { border-color: rgba(127, 211, 201, 0.2); background: rgba(255,255,255,.055); }
.nav-accordion.open .nav-group-icon { border-color: rgba(119,217,204,.2); background: rgba(73,170,159,.16); color: #d0f2ed; }

.nav-group-panel { display: grid; gap: 3px; max-height: 0; padding: 0 7px; overflow: hidden; opacity: 0; transition: max-height 240ms ease, opacity 160ms ease, padding 180ms ease; }
.nav-accordion.open .nav-group-panel { max-height: 800px; padding: 0 7px 8px; opacity: 1; }
.sidebar-nav .nav-leaf {
  min-height: 36px;
  gap: 9px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  color: #bad0d3;
  font-size: 10px;
}
.sidebar-nav .nav-leaf:hover { border-color: transparent; background: rgba(255,255,255,.065); color: #fff; }
.sidebar-nav .nav-leaf.active { border-color: transparent; background: linear-gradient(90deg, rgba(208,242,237,.95), rgba(237,248,246,.98)); color: #123e47; box-shadow: 0 5px 14px rgba(0,20,28,.16); }
.nav-leaf-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #6f989e; }
.nav-leaf.active .nav-leaf-dot { background: #0b8173; box-shadow: 0 0 0 4px rgba(11,129,115,.1); }

.sidebar-status { padding: 13px 14px; border-color: rgba(255,255,255,.12); border-radius: 12px; background: rgba(2,23,32,.25); }
.sidebar-status span { color: #9fc5c8; font-size: 9px; }
.sidebar-status strong { font-size: 14px; }
.sidebar-status small { color: #9db7bc; font-size: 8px; line-height: 1.7; }

.module-ready-card { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; }
.module-ready-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; background: var(--active-module-soft, #eef7f5); color: var(--active-module, #137d70); }
.module-ready-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-ready-card small,.module-ready-card strong { display: block; }
.module-ready-card h2 { margin: 3px 0; font-size: 18px; }
.module-ready-card p { margin: 0; color: var(--muted); font-size: 10px; }
.module-ready-card > span { padding: 5px 9px; border-radius: 999px; background: #e8f8f2; color: #187561; font-size: 9px; font-weight: 800; }
.module-capability-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.module-capability-grid article { display: flex; min-height: 86px; align-items: center; gap: 10px; }
.module-capability-grid article > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: #f1f6f5; color: #577178; font-size: 9px; }
.module-capability-grid article.active { border-color: color-mix(in srgb, var(--active-module) 28%, var(--line)); background: var(--active-module-soft); }

@media (max-width: 1050px) {
  .module-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .sidebar-status { margin-top: 0; }
}

@media (max-width: 680px) {
  .hub-access-workspace { padding: 14px; border-radius: 18px; }
  .module-tabs { grid-template-columns: 1fr; }
  .system-access-card,
  .system-access-card > button { min-height: 196px; }
  .hub-workspace-heading { align-items: flex-start; }
  .hub-service-stack { display: grid; grid-template-columns: 1fr; }
  .hub-service-card { width: 100%; }
  .sidebar-nav { grid-template-columns: 1fr; }
  .module-capability-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 430px) {
  .hub-hero { padding: 22px 18px; }
  .hub-hero-actions { width: 100%; }
  .hub-access-counter,
  .hub-guide-button { flex: 1; }
  .system-access-card > button { grid-template-columns: 48px 1fr auto; padding: 16px; }
  .system-card-icon { width: 48px; height: 48px; }
  .module-capability-grid { grid-template-columns: 1fr; }
}

/* Direct workspace entry: one area selector, one complete contextual menu. */
.sidebar-area-switcher {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  background: rgba(255,255,255,.065);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.sidebar-area-switcher > span:first-child {
  color: #9dc2c6;
  font-size: 10.5px;
  font-weight: 750;
}

.sidebar-area-select-wrap { position: relative; display: block; }
.sidebar-area-select-wrap select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px 8px 34px;
  border: 1px solid rgba(146, 222, 213, .2);
  border-radius: 10px;
  outline: 0;
  appearance: none;
  background: rgba(4, 35, 44, .55);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.sidebar-area-select-wrap select:focus {
  border-color: rgba(147, 231, 219, .55);
  box-shadow: 0 0 0 3px rgba(77, 190, 175, .12);
}

.sidebar-area-select-wrap select option { background: #0a3b49; color: #fff; }
.sidebar-area-select-wrap i {
  position: absolute;
  top: 50%;
  left: 11px;
  color: #9ed5d0;
  font-size: 15px;
  font-style: normal;
  pointer-events: none;
  transform: translateY(-56%);
}

.sidebar-active-area {
  order: 0;
  padding: 12px 8px 13px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-active-area > div { min-width: 0; }
.sidebar-active-area small { margin: 0 0 3px; color: #8fb5ba; font-size: 9px; font-weight: 750; }
.sidebar-active-area strong { overflow: hidden; color: #fff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-active-area #activeModuleLabel { display: block; margin-top: 3px; color: #a9c7cb; font-size: 9px; }

.sidebar-nav {
  align-content: start;
  gap: 10px;
}

.sidebar-menu-heading {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 3px 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-menu-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(136, 218, 208, .18);
  border-radius: 10px;
  background: rgba(73,170,159,.13);
  color: #caeee9;
}

.sidebar-menu-heading svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-menu-heading small,
.sidebar-menu-heading strong { display: block; }
.sidebar-menu-heading small { color: #86aab0; font-size: 10px; }
.sidebar-menu-heading strong { margin-top: 3px; color: #f3f8f8; font-size: 14px; }
.sidebar-menu-heading em { display: grid; min-width: 27px; height: 27px; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); color: #b9dcda; font-size: 9px; font-style: normal; font-weight: 800; }

.sidebar-menu-list { display: grid; gap: 4px; }
.sidebar-submodule-label {
  display: block;
  margin: 7px 5px 2px;
  color: #82aeb2;
  font-size: 10.5px;
  font-weight: 800;
}

.sidebar-nav .sidebar-menu-list .nav-leaf {
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #c4d8da;
  font-size: 13px;
  font-weight: 750;
}

.sidebar-nav .sidebar-menu-list .nav-leaf:hover { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.065); }
.sidebar-nav .sidebar-menu-list .nav-leaf.active { border-color: rgba(205,242,236,.22); background: linear-gradient(90deg, #caeee8, #eef9f7); color: #123f47; }

@media (max-width: 1050px) {
  .sidebar-nav { grid-template-columns: 1fr; }
  .sidebar-menu-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .sidebar-submodule-label { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .sidebar-menu-list { grid-template-columns: 1fr; }
}

/* Abshar product catalog and productivity reports */
.product-groups-panel,
.product-reports-panel { overflow: hidden; }

.product-catalog-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.65fr) repeat(3, minmax(140px, .75fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.product-catalog-summary > div,
.product-catalog-summary > article,
.product-report-kpis > article {
  min-height: 104px;
  padding: 17px 18px;
  border: 1px solid #dce8ec;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f6fbfc);
  box-shadow: 0 8px 24px rgba(30, 71, 84, .055);
}

.product-catalog-summary > div {
  background: linear-gradient(135deg, #0d5967, #0b7e78);
  color: #fff;
}

.product-catalog-summary small,
.product-catalog-summary span,
.product-report-kpis span,
.product-report-kpis small { display: block; color: #68818a; font-size: 11px; }
.product-catalog-summary > div small { color: #bfe3df; }
.product-catalog-summary strong,
.product-report-kpis strong { display: block; margin-top: 8px; color: #123e49; font-size: 19px; line-height: 1.55; }
.product-catalog-summary > div strong { color: #fff; font-size: 17px; }
.product-catalog-summary a { display: inline-flex; margin-top: 9px; color: #f6cc74; font-size: 11px; font-weight: 800; text-decoration: none; }

.product-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-group-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #dce7eb;
  border-top: 4px solid var(--group-color);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(28, 68, 80, .07);
}
.product-group-card:first-child { grid-column: 1 / -1; }
.product-group-card header { display: grid; grid-template-columns: 48px minmax(0,1fr) 36px; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.product-group-card header > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--group-color) 13%, white); color: var(--group-color); font-size: 10px; font-weight: 900; text-align: center; }
.product-group-card header small { display: block; color: #718890; font-size: 10px; }
.product-group-card header h2 { margin: 4px 0 0; color: #143f49; font-size: 18px; }
.product-group-card header > b { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--group-color); color: #fff; font-size: 11px; }
.product-family-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 20px 18px; }
.product-family-list span { padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--group-color) 22%, #dce6e9); border-radius: 999px; background: color-mix(in srgb, var(--group-color) 5%, white); color: #36535b; font-size: 10.5px; font-weight: 700; }
.product-group-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid #edf2f4; background: #f9fbfc; }
.product-group-card footer span { color: #6d858d; font-size: 10px; }
.product-group-card footer span b { color: var(--group-color); font-size: 14px; }
.product-group-card footer strong { color: #183f48; font-size: 12px; }

.product-report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.product-report-kpis > article:first-child { background: linear-gradient(135deg, #0e4d5a, #087c73); }
.product-report-kpis > article:first-child span,
.product-report-kpis > article:first-child small { color: #c6e3e1; }
.product-report-kpis > article:first-child strong { color: #fff; }

.product-pie-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; margin: 16px 0 20px; }
.product-pie-card { min-width: 0; padding: 18px; border: 1px solid #dce7eb; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(28,68,80,.07); }
.product-pie-card > header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.product-pie-card header small { color: #789097; font-size: 10px; }
.product-pie-card h3 { margin: 4px 0 0; color: #153e48; font-size: 16px; }
.product-pie-card header > strong { color: #0b756d; font-size: 11px; line-height: 1.7; text-align: left; }
.product-pie-layout { display: grid; grid-template-columns: 154px minmax(0,1fr); align-items: center; gap: 14px; margin-top: 20px; }
.product-pie { position: relative; display: grid; width: 154px; aspect-ratio: 1; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(18,63,73,.08), 0 10px 26px rgba(26,67,79,.13); }
.product-pie::after { position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(25,68,80,.06); content: ""; }
.product-pie > div { position: relative; z-index: 1; text-align: center; }
.product-pie > div strong,
.product-pie > div span { display: block; }
.product-pie > div strong { color: #163f49; font-size: 20px; }
.product-pie > div span { margin-top: 2px; color: #758b92; font-size: 9px; }
.product-pie-legend { display: grid; gap: 8px; }
.product-pie-legend > div { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 7px; padding-bottom: 7px; border-bottom: 1px dashed #e7edef; }
.product-pie-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--legend-color); }
.product-pie-legend span { overflow: hidden; color: #36565e; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.product-pie-legend strong { color: #173f48; font-size: 10px; }
.product-pie-legend small { grid-column: 2 / -1; color: #81949a; font-size: 8.5px; }

.product-report-table { padding: 18px; border: 1px solid #dce7eb; border-radius: 18px; background: #fff; }
.product-report-table .compact-title { margin-bottom: 14px; }
.product-table-group { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; white-space: nowrap; }
.product-table-group i { width: 9px; height: 9px; border-radius: 50%; background: var(--group-color); }
.product-report-method { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: #eff8f6; color: #4c6870; font-size: 10.5px; line-height: 1.9; }
.product-report-method strong { color: #0b716a; }

@media (max-width: 1280px) {
  .product-pie-grid { grid-template-columns: 1fr; }
  .product-pie-layout { grid-template-columns: 170px minmax(0,1fr); }
  .product-pie { width: 170px; }
}

@media (max-width: 900px) {
  .product-catalog-summary,
  .product-report-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .product-catalog-summary > div { grid-column: 1 / -1; }
  .product-group-grid { grid-template-columns: 1fr; }
  .product-group-card:first-child { grid-column: auto; }
}

@media (max-width: 560px) {
  .product-catalog-summary,
  .product-report-kpis { grid-template-columns: 1fr; }
  .product-pie-layout { grid-template-columns: 1fr; justify-items: center; }
  .product-pie-legend { width: 100%; }
  .product-group-card header { grid-template-columns: 42px minmax(0,1fr) 32px; padding-inline: 14px; }
  .product-family-list,
  .product-group-card footer { padding-inline: 14px; }
  .product-group-card footer { align-items: flex-start; flex-direction: column; }
}

/* Final responsive contract: desktop/projector keeps a right sidebar; mobile uses a compact grid. */
@media (min-width: 901px) and (max-width: 1180px) {
  .app-shell { grid-template-columns: 280px minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    top: 0;
    gap: 12px;
    height: 100vh;
    padding: 16px 13px;
  }
  .sidebar-nav {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .sidebar-menu-list { grid-template-columns: 1fr; }
  .sidebar-nav .sidebar-menu-list .nav-leaf { min-height: 42px; padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    gap: 12px;
    height: auto;
    padding: 14px;
  }
  .sidebar-nav {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .sidebar-menu-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .sidebar-submodule-label { grid-column: 1 / -1; }
  .sidebar-status { margin-top: 0; }
}

@media (max-width: 680px) {
  .sidebar-menu-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-nav .sidebar-menu-list .nav-leaf { min-height: 44px; justify-content: center; padding: 8px; text-align: center; }
}

@media (max-width: 420px) {
  .sidebar-menu-list { grid-template-columns: 1fr; }
}

/* Protocol workspace: glass cards, version actions, sharing, and province levels. */
.cs-protocol-manager { margin-bottom: 16px; padding: 20px; border: 1px solid #c9dfe1; border-radius: 22px; background: linear-gradient(135deg,rgba(255,255,255,.96),rgba(229,246,244,.8)); box-shadow: 0 16px 42px rgba(24,73,84,.08); }
.cs-protocol-manager > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.cs-protocol-manager > header span { color: #0b8177; font-size: .62rem; font-weight: 900; }
.cs-protocol-manager > header h1 { margin: 4px 0; color: #173f48; font-size: 1.22rem; }
.cs-protocol-manager > header p { margin: 0; color: #69818a; font-size: .68rem; }
.cs-protocol-manager > header button { min-height: 42px; padding: 9px 18px; border: 0; border-radius: 12px; background: linear-gradient(135deg,#0b8177,#125873); box-shadow: 0 10px 22px rgba(11,129,119,.2); color: #fff; font: 900 .7rem var(--app-font,sans-serif); cursor: pointer; }
.cs-protocol-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.cs-protocol-list > article { min-width: 0; overflow: hidden; border: 1px solid #d8e5e7; border-radius: 16px; background: rgba(255,255,255,.82); transition: border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.cs-protocol-list > article:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(25,75,85,.09); }
.cs-protocol-list > article.is-selected { border: 2px solid #0b8177; box-shadow: 0 0 0 4px rgba(11,129,119,.09),0 15px 32px rgba(21,91,93,.12); }
.cs-protocol-list > article.is-inactive { background: rgba(244,247,248,.82); filter: saturate(.72); }
.cs-protocol-list-main { display: grid; width: 100%; min-height: 130px; gap: 7px; padding: 14px; border: 0; background: transparent; color: #264c55; text-align: right; cursor: pointer; }
.cs-protocol-list-main > span { display: flex; align-items: center; gap: 6px; }
.cs-protocol-list-main em,.cs-protocol-list-main b,.cs-protocol-state { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: .55rem; font-style: normal; }
.cs-protocol-list > article.is-active .cs-protocol-list-main em,.cs-protocol-state.is-active { background: #dcf5e9; color: #147555; }
.cs-protocol-list > article.is-inactive .cs-protocol-list-main em,.cs-protocol-state.is-inactive { background: #e9edef; color: #667a82; }
.cs-protocol-list-main b { background: #fff1ce; color: #865e13; }
.cs-protocol-list-main strong { overflow: hidden; color: #173f48; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.cs-protocol-list-main small { overflow: hidden; color: #70868d; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.cs-protocol-list > article > footer { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid #e4edef; background: rgba(247,251,251,.84); }
.cs-protocol-list > article > footer button { min-height: 31px; padding: 5px 10px; border: 1px solid #bed9db; border-radius: 8px; background: #fff; color: #176e69; font: 800 .57rem var(--app-font,sans-serif); cursor: pointer; }
.cs-protocol-list > article > footer button.danger { margin-inline-start: auto; border-color: #edc9c9; color: #a34b4b; }
.cs-protocol-list > article > footer button.activate { margin-inline-start: auto; border-color: #a9d9c8; color: #147555; }
.cs-protocol-list > article > footer button:disabled { opacity: .55; cursor: not-allowed; }
.cs-protocol-create-choice { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 22px; border: 1px solid rgba(133,183,190,.48); border-radius: 24px; background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(225,245,243,.7)); box-shadow: 0 18px 45px rgba(26,72,84,.1); }
.cs-protocol-create-choice > div { grid-column: 1 / -1; }
.cs-protocol-create-choice h2 { margin: 5px 0; color: #173f48; font-size: 1.15rem; }
.cs-protocol-create-choice p { margin: 0; color: #67808a; font-size: .72rem; }
.cs-protocol-create-choice article { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 7px 12px; align-items: center; padding: 18px; border: 1px solid rgba(163,200,204,.65); border-radius: 18px; background: rgba(255,255,255,.74); backdrop-filter: blur(16px); }
.cs-protocol-create-choice article > i { grid-row: 1 / span 3; display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: linear-gradient(135deg,#0b8278,#52aaa2); color: #fff; font-size: 1.4rem; font-style: normal; }
.cs-protocol-create-choice article strong { color: #173f48; }
.cs-protocol-create-choice article small { color: #718890; line-height: 1.8; }
.cs-protocol-create-choice article select,.cs-protocol-create-choice article button { grid-column: 2; min-height: 38px; border-radius: 10px; }
.cs-protocol-create-choice article button { border: 0; background: #0c7f76; color: #fff; font: 800 .68rem var(--app-font,sans-serif); cursor: pointer; }
.cs-protocol-card-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; padding: 15px 17px; border: 1px solid rgba(140,190,194,.48); border-radius: 17px; background: rgba(255,255,255,.76); backdrop-filter: blur(16px); }
.cs-protocol-card-toolbar > div { display: grid; gap: 4px; margin-inline-end: auto; }
.cs-protocol-card-toolbar strong { color: #164b53; }
.cs-protocol-card-toolbar small { color: #64818a; }
.cs-protocol-card-toolbar .cs-protocol-toolbar-kicker { color: #0b8177; font-size: .57rem; font-weight: 900; }
.cs-protocol-card-toolbar.is-readonly { border-color: #c8d9dd; background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(241,247,248,.85)); }
.cs-protocol-edit-cta { min-height: 56px; padding: 9px 15px; border: 0; border-radius: 14px; display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(135deg,#ff9f1c,#ea5b0c); color: #fff; box-shadow: 0 10px 22px rgba(234,91,12,.28); cursor: pointer; font-family: var(--app-font,sans-serif); transition: transform .18s ease,box-shadow .18s ease,filter .18s ease; }
.cs-protocol-edit-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 27px rgba(234,91,12,.36); filter: saturate(1.08); }
.cs-protocol-edit-cta:focus-visible { outline: 3px solid rgba(255,159,28,.35); outline-offset: 3px; }
.cs-protocol-edit-cta > i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 1.1rem; font-style: normal; }
.cs-protocol-edit-cta > span { display: grid; gap: 2px; text-align: right; }
.cs-protocol-card-toolbar .cs-protocol-edit-cta strong,.cs-protocol-card-toolbar .cs-protocol-edit-cta small { color: #fff; }
.cs-protocol-edit-cta strong { font-size: .78rem; }
.cs-protocol-edit-cta small { font-size: .54rem; opacity: .92; }
.cs-protocol-edit-cta:disabled { cursor: not-allowed; filter: grayscale(.72); opacity: .62; transform: none; box-shadow: none; }
.cs-protocol-list footer .cs-protocol-list-edit { padding-inline: 13px; border-color: #ffad55; background: #fff3e5; color: #bd4a08; font-weight: 900; }
.cs-protocol-list-main b.is-editable { background:#e1f5ec; color:#147555; }
.cs-protocol-list-main b.is-edit-closed { background:#fbe6e3; color:#a1463d; }
.cs-protocol-list > article > footer button.cs-edit-permission.is-on { border-color:#efb16d; color:#a65a0e; background:#fff8ed; }
.cs-protocol-list > article > footer button.cs-edit-permission.is-off { border-color:#9dd8c7; color:#0b7661; background:#eefbf6; }
.cs-protocol-audit-dialog { width:min(980px,calc(100% - 28px)); max-height:88vh; padding:0; overflow:hidden; border:1px solid rgba(255,255,255,.92); border-radius:24px; background:#f7fbfb; box-shadow:0 32px 90px rgba(8,40,55,.3); }
.cs-protocol-audit-dialog::backdrop { background:rgba(5,28,39,.53); backdrop-filter:blur(5px); }
.cs-protocol-audit-dialog > header { display:flex; justify-content:space-between; gap:18px; padding:20px 24px; color:#fff; background:linear-gradient(120deg,#0e4357,#118078); }
.cs-protocol-audit-dialog > header small,.cs-protocol-audit-dialog > header p { color:#bde8e2; }
.cs-protocol-audit-dialog > header h2 { margin:3px 0; }
.cs-protocol-audit-dialog > header p { margin:0; font-size:.67rem; }
.cs-protocol-audit-dialog > header button { width:38px; height:38px; color:#fff; border:1px solid rgba(255,255,255,.25); border-radius:11px; background:rgba(255,255,255,.1); }
.cs-audit-layout { display:grid; grid-template-columns:240px 1fr; max-height:60vh; }
.cs-audit-layout nav { padding:14px; overflow:auto; border-left:1px solid #dbe8ea; background:#eff7f7; }
.cs-audit-layout nav button { display:grid; width:100%; gap:3px; margin-bottom:8px; padding:11px; text-align:right; border:1px solid #d4e3e5; border-radius:12px; background:#fff; color:#385b66; }
.cs-audit-layout nav button.is-selected { border-color:#17988b; background:#e7f7f3; box-shadow:0 0 0 3px rgba(23,152,139,.09); }
.cs-audit-layout nav button small { color:#788f97; font-size:.57rem; }
.cs-audit-layout nav button em { color:#168176; font-size:.55rem; font-style:normal; }
.cs-audit-layout > section { padding:20px; overflow:auto; }
.cs-revision-summary dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:0; }
.cs-revision-summary dl div { padding:10px 12px; border:1px solid #dce8ea; border-radius:11px; background:#fff; }
.cs-revision-summary dt { color:#789099; font-size:.57rem; }
.cs-revision-summary dd { margin:4px 0 0; color:#214c58; font-size:.72rem; font-weight:900; }
.cs-revision-summary h3 { margin:18px 0 8px; color:#174c56; font-size:.78rem; }
.cs-revision-summary > p { margin:0; padding:12px; border-radius:11px; background:#fff; color:#607b85; font-size:.68rem; }
.cs-revision-products { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.cs-revision-products span { display:grid; gap:3px; padding:10px 12px; border:1px solid #dce8ea; border-radius:11px; background:#fff; }
.cs-revision-products small { color:#718991; font-size:.57rem; }
.cs-protocol-audit-dialog > footer { display:flex; justify-content:space-between; align-items:center; padding:12px 20px; border-top:1px solid #dce8ea; background:#fff; color:#6f878f; font-size:.62rem; }
.cs-protocol-audit-dialog > footer button { padding:8px 16px; color:#fff; border:0; border-radius:9px; background:#176e78; }
.cs-protocol-save-toast { position: fixed; z-index: 100000; inset-inline-start: 50%; bottom: 24px; transform: translate(-50%,24px); min-width: min(420px,calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 12px 17px; border: 1px solid #badbd5; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.97); color: #184e55; box-shadow: 0 14px 40px rgba(14,55,64,.22); opacity: 0; pointer-events: none; transition: opacity .2s ease,transform .2s ease; font: 800 .72rem var(--app-font,sans-serif); direction: rtl; }
.cs-protocol-save-toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.cs-protocol-save-toast i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #dff7ef; color: #08776e; font-style: normal; }
.cs-protocol-save-toast.is-saving i { background: #e9f2ff; color: #2456c7; }
.cs-protocol-save-toast.is-error { border-color: #ffc8c1; color: #a52d21; }
.cs-protocol-save-toast.is-error i { background: #ffebe8; color: #c83c2e; }
.cs-protocol-card-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.cs-protocol-card-shell { min-width: 0; border: 1px solid rgba(156,194,201,.55); border-radius: 19px; display: grid; grid-template-rows: 1fr auto; overflow: hidden; background: rgba(255,255,255,.76); box-shadow: 0 12px 30px rgba(30,74,86,.08); }
.cs-protocol-glass-card { min-height: 175px; padding: 16px; border: 1px solid rgba(156,194,201,.55); border-radius: 19px; background: linear-gradient(145deg,rgba(255,255,255,.91),rgba(237,247,248,.68)); box-shadow: 0 12px 30px rgba(30,74,86,.08); color: #234c56; text-align: right; cursor: pointer; transition: transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.cs-protocol-card-shell .cs-protocol-glass-card { border: 0; border-radius: 0; box-shadow: none; }
.cs-card-edit-button { min-height: 43px; padding: 8px 12px; border: 0; border-top: 1px solid #f2c17b; display: flex; align-items: center; justify-content: center; gap: 7px; background: linear-gradient(135deg,#fff5e6,#ffead0); color: #b64c0d; cursor: pointer; font: 900 .63rem var(--app-font,sans-serif); transition: background .18s ease,color .18s ease; }
.cs-card-edit-button:hover { background: linear-gradient(135deg,#ff9f1c,#ea5b0c); color: #fff; }
.cs-card-edit-button i { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; background: rgba(234,91,12,.13); font-size: .82rem; font-style: normal; }
.cs-card-edit-button:hover i { background: rgba(255,255,255,.2); }
.cs-card-edit-button:disabled { cursor: not-allowed; filter: grayscale(.8); opacity: .55; }
.cs-protocol-glass-card:hover { transform: translateY(-3px); border-color: #68aaa7; box-shadow: 0 18px 34px rgba(30,74,86,.14); }
.cs-protocol-glass-card > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-protocol-glass-card i { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; background: #eaf5f5; color: #187971; font-size: 1.1rem; font-style: normal; }
.cs-protocol-glass-card em { padding: 5px 8px; border-radius: 999px; background: #eef2f4; color: #71828a; font-size: .57rem; font-style: normal; }
.cs-protocol-glass-card strong,.cs-protocol-glass-card small,.cs-protocol-glass-card b { display: block; }
.cs-protocol-glass-card strong { margin-top: 17px; font-size: .87rem; }
.cs-protocol-glass-card small { min-height: 40px; margin-top: 6px; color: #6d858e; font-size: .62rem; line-height: 1.8; }
.cs-protocol-glass-card b { margin-top: 10px; color: #0c7d75; font-size: .61rem; }
.cs-protocol-glass-card.is-complete { border-color: rgba(36,168,126,.54); background: linear-gradient(145deg,rgba(255,255,255,.94),rgba(224,247,238,.82)); }
.cs-protocol-glass-card.is-complete em { background: #daf4e8; color: #187b58; }
.cs-protocol-glass-card.is-partial { border-color: rgba(228,166,57,.62); background: linear-gradient(145deg,rgba(255,255,255,.94),rgba(255,247,225,.82)); }
.cs-protocol-glass-card.is-partial em { background: #fff0c8; color: #91620d; }
.cs-protocol-card-dialog,.cs-protocol-share-dialog { width: min(880px,calc(100vw - 28px)); max-height: 90vh; padding: 0; overflow: auto; border: 1px solid #b9d7dc; border-radius: 22px; color: var(--cs-ink); background: rgba(250,253,253,.98); box-shadow: 0 28px 90px rgba(8,35,48,.36); }
.cs-protocol-card-dialog::backdrop,.cs-protocol-share-dialog::backdrop { background: rgba(6,29,41,.58); backdrop-filter: blur(5px); }
.cs-protocol-card-dialog > header,.cs-protocol-share-dialog > header { position: sticky; z-index: 3; top: 0; display: flex; align-items: flex-start; justify-content: space-between; padding: 19px 22px; background: linear-gradient(120deg,#103f5c,#0b8177); color: #fff; }
.cs-protocol-card-dialog header h2,.cs-protocol-share-dialog header h2 { margin: 4px 0; font-size: 1.05rem; }
.cs-protocol-card-dialog header p,.cs-protocol-share-dialog header p { margin: 0; color: #cbe8e7; font-size: .66rem; }
.cs-protocol-card-dialog header button,.cs-protocol-share-dialog header button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.5); border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.cs-protocol-dialog-form { padding: 18px 22px; }
.cs-protocol-dialog-form .cs-form { margin: 0; }
.cs-protocol-dialog-form [data-cs-protocol-group][hidden] { display: none !important; }
.cs-protocol-card-dialog > footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 13px 22px; border-top: 1px solid #dce9ea; background: rgba(255,255,255,.96); color: #607d86; font-size: .63rem; }
.cs-protocol-card-dialog > footer button { min-height: 36px; padding: 7px 18px; border: 0; border-radius: 10px; background: #0c7f76; color: #fff; font-weight: 800; cursor: pointer; }
.cs-protocol-dialog-actions { display: flex; align-items: center; gap: 8px; }
.cs-protocol-card-dialog > footer .cs-dialog-edit-button { min-height: 40px; padding-inline: 17px; background: linear-gradient(135deg,#ff9f1c,#ea5b0c); box-shadow: 0 7px 17px rgba(234,91,12,.25); }
.cs-protocol-card-dialog > footer .cs-dialog-edit-button:disabled { background: #9aa8ac; box-shadow: none; cursor: not-allowed; }
.cs-annual-target-card { position: relative; border-color: #e4a13d; background: linear-gradient(145deg,#fffdf8,#fff1dc); }
.cs-annual-target-card > span i { background: linear-gradient(135deg,#ffad2f,#ef6c0d); color: #fff; }
.cs-annual-target-card u { display: block; margin-top: 9px; padding-top: 8px; border-top: 1px dashed #efc27b; color: #9c5a14; font-size: .56rem; font-weight: 900; text-decoration: none; }
.cs-annual-target-dialog { width: min(920px,calc(100vw - 28px)); max-height: 92vh; padding: 0; border: 1px solid #9fcfca; border-radius: 21px; overflow: auto; background: #f8fbfb; color: #173f46; box-shadow: 0 28px 85px rgba(8,35,48,.38); font-family: var(--app-font,sans-serif); }
.cs-annual-target-dialog::backdrop { background: rgba(7,31,43,.58); backdrop-filter: blur(5px); }
.cs-annual-target-dialog form > header { position: sticky; z-index: 5; top: 0; padding: 18px 21px; display: flex; align-items: flex-start; justify-content: space-between; background: linear-gradient(120deg,#0d5268,#0b8177); color: #fff; }
.cs-annual-target-dialog header h2 { margin: 4px 0; font-size: 1.05rem; }
.cs-annual-target-dialog header p,.cs-annual-target-dialog header small { margin: 0; color: #d2ebea; font-size: .62rem; }
.cs-annual-target-dialog header button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.5); border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.cs-annual-target-head { padding: 17px 20px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; border-bottom: 1px solid #dce9e9; background: #fff; }
.cs-annual-target-head label { display: grid; gap: 6px; color: #466c73; font-size: .6rem; font-weight: 900; }
.cs-annual-target-head input,.cs-annual-target-head select,.cs-quarter-target input { min-height: 42px; padding: 8px 11px; border: 1px solid #bdd7da; border-radius: 10px; background: #fff; color: #153f47; font: 900 .73rem var(--app-font,sans-serif); }
.cs-annual-target-head input { direction: ltr; text-align: right; }
.cs-annual-target-head > button { min-height: 39px; border: 1px solid #8ecbc3; border-radius: 10px; background: #e9f8f5; color: #08776e; cursor: pointer; font: 900 .61rem var(--app-font,sans-serif); }
.cs-annual-balance { grid-column: span 2; padding: 9px 11px; border-radius: 9px; background: #fff3e4; color: #a05313; font-size: .58rem; font-weight: 900; }
.cs-annual-balance.is-balanced { background: #e7f8f1; color: #08745a; }
.cs-equal-suggestion { display: block; padding: 8px 10px; border-radius: 9px; background: #f2f5ff; color: #3958a8; font-size: .57rem; font-weight: 900; }
.cs-quarter-targets { padding: 15px 20px 21px; display: grid; gap: 10px; }
.cs-quarter-target { border: 1px solid #cfe0e2; border-radius: 13px; overflow: hidden; background: #fff; }
.cs-quarter-target summary { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; background: #f1f7f7; cursor: pointer; list-style: none; }
.cs-quarter-target summary span { display: flex; align-items: center; gap: 8px; }
.cs-quarter-target summary b { color: #164b53; font-size: .7rem; }
.cs-quarter-target summary small { color: #718990; font-size: .57rem; }
.cs-quarter-target summary em { color: #2456c7; font-size: .64rem; font-weight: 900; font-style: normal; }
.cs-quarter-target-body { padding: 13px; display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; }
.cs-quarter-total { display: grid; gap: 5px; color: #496b72; font-size: .59rem; font-weight: 900; }
.cs-quarter-tools { align-self: end; display: flex; flex-wrap: wrap; gap: 7px; }
.cs-equal-distribute { align-self: end; min-height: 42px; padding: 8px 13px; border: 1px solid #efb45b; border-radius: 10px; background: #fff5e5; color: #a85612; cursor: pointer; font: 900 .59rem var(--app-font,sans-serif); }
.cs-copy-quarter { min-height: 42px; padding: 8px 13px; border: 1px solid #89b9da; border-radius: 10px; background: #eef7ff; color: #246897; cursor: pointer; font: 900 .59rem var(--app-font,sans-serif); }
.cs-quarter-balance { grid-column: 1/-1; padding: 8px 10px; border-radius: 8px; background: #fff1e7; color: #a94f18; font-size: .57rem; font-weight: 900; }
.cs-quarter-balance.is-balanced { background: #e7f8f1; color: #08745a; }
.cs-quarter-people { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.cs-quarter-people label { padding: 8px 9px; border: 1px solid #e0eaeb; border-radius: 9px; display: grid; grid-template-columns: 1fr minmax(150px,42%); align-items: center; gap: 9px; }
.cs-quarter-people label span { display: grid; gap: 2px; }
.cs-quarter-people label b { color: #224e56; font-size: .61rem; }
.cs-quarter-people label small { color: #83979c; font-size: .51rem; }
.cs-quarter-people input { direction: ltr; text-align: right; }
.cs-quarter-target-body > .cs-equal-suggestion { grid-column: 1/-1; }
.cs-annual-form-error { margin: 0 20px 12px; padding: 10px 12px; border: 1px solid #f0b7b7; border-radius: 10px; background: #fff0f0; color: #a12e2e; font-size: .62rem; font-weight: 900; }
.cs-annual-target-dialog form > footer { position: sticky; z-index: 5; bottom: 0; padding: 13px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #dce7e8; background: rgba(255,255,255,.97); }
.cs-annual-target-dialog footer button { min-height: 40px; padding: 8px 15px; border: 1px solid #b8d1d3; border-radius: 10px; cursor: pointer; font: 900 .63rem var(--app-font,sans-serif); }
.cs-annual-target-dialog footer [data-cs-annual-autosave] { margin-inline-end: auto; align-self: center; color: #688188; font-size: .57rem; font-weight: 800; }
.cs-annual-target-dialog footer [data-cs-annual-autosave][data-state="saving"] { color: #9b6914; }
.cs-annual-target-dialog footer [data-cs-annual-autosave][data-state="saved"] { color: #08745a; }
.cs-annual-target-dialog footer [data-cs-annual-autosave][data-state="error"] { color: #a12e2e; }
.cs-target-remaining-mini { position: fixed; z-index: 900; inset-inline-start: 18px; bottom: 17px; min-width: 205px; padding: 9px 12px; border: 1px solid rgba(130,180,183,.65); border-radius: 12px; display: grid; gap: 2px; background: rgba(255,255,255,.93); color: #55737a; box-shadow: 0 8px 24px rgba(15,55,64,.14); backdrop-filter: blur(10px); direction: rtl; pointer-events: none; }
.cs-target-remaining-mini span,.cs-target-remaining-mini small { font-size: .5rem; }
.cs-target-remaining-mini strong { color: #0b776f; font-size: .66rem; }
.cs-protocol-card-dialog.is-readonly input:disabled,.cs-protocol-card-dialog.is-readonly select:disabled,.cs-protocol-card-dialog.is-readonly textarea:disabled { opacity: 1; border-color: #dbe4e7; background: #f2f5f6; color: #455d65; -webkit-text-fill-color: #455d65; }
.cs-protocol-share-dialog form { padding: 20px 22px 24px; }
.cs-expiry-time-field { position: relative; z-index: 5; }
.cs-expiry-time-picker { position: relative; }
.cs-expiry-time-picker > input[type="hidden"] { display: none; }
.cs-expiry-time-picker > button { width: 100%; min-height: 43px; padding: 8px 11px; border: 1px solid #c4d8df; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; background: #fff; color: #123f4b; cursor: pointer; font: 900 .76rem var(--app-font,sans-serif); }
.cs-expiry-time-picker > button i { color: #5e7983; font-style: normal; }
.cs-expiry-time-menu { position: absolute; z-index: 20; inset-inline: 0; bottom: calc(100% + 7px); padding: 9px; border: 1px solid #a9d0cd; border-radius: 13px; grid-template-columns: repeat(6,1fr); gap: 6px; background: #fff; box-shadow: 0 15px 38px rgba(9,52,63,.24); }
.cs-expiry-time-menu:not([hidden]) { display: grid; }
.cs-expiry-time-menu button { min-height: 32px; padding: 4px; border: 1px solid #d7e5e7; border-radius: 7px; background: #f7fafb; color: #315d65; cursor: pointer; font: 800 .58rem var(--app-font,sans-serif); }
.cs-expiry-time-menu button:hover,.cs-expiry-time-menu button.is-selected { border-color: #168e82; background: #e5f7f3; color: #08776e; }
.cs-share-result { display: grid; gap: 8px; padding: 13px; border: 1px solid #a9d8ca; border-radius: 12px; background: #effaf5; color: #286351; }
.cs-share-result.is-error { border-color: #efb9b9; background: #fff1f1; color: #9d3030; }
.cs-share-result input { width: 100%; }
.cs-protocol-links-panel { margin-top: 16px; }
.cs-protocol-link-list { display: grid; gap: 9px; }
.cs-protocol-link-list article { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid #dce9ea; border-radius: 13px; background: #fbfdfd; }
.cs-protocol-link-list article div { display: grid; gap: 3px; }
.cs-protocol-link-list article span,.cs-protocol-link-list article small { color: #71878e; font-size: .6rem; }
.cs-protocol-link-list article em { padding: 5px 9px; border-radius: 999px; background: #eef3f4; font-size: .58rem; font-style: normal; }
.cs-protocol-link-list article em.complete { background: #daf4e8; color: #187b58; }
.cs-protocol-link-list article em.warn { background: #fff0c8; color: #91620d; }
.cs-protocol-link-list article button,.cs-protocol-version-actions button { min-height: 31px; padding: 5px 10px; border: 1px solid #bed9db; border-radius: 8px; background: #fff; color: #176e69; font: 800 .58rem var(--app-font,sans-serif); cursor: pointer; }
.cs-protocol-link-list article button.danger { border-color: #efc8c8; color: #a24747; }
.cs-protocol-version-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cs-protocol-version-actions button:disabled { opacity: .58; cursor: not-allowed; }
.cs-province-level-factors { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; padding: 0 20px 14px; }
.cs-province-level-factors label { display: grid; gap: 5px; color: #496b75; font-size: .58rem; }
.cs-province-level-factors input { min-height: 34px; border: 1px solid #cbdfe1; border-radius: 8px; text-align: center; }
.cs-protocol-card-dialog input[type="number"],.cs-province-level-dialog input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.cs-protocol-card-dialog input[type="number"]::-webkit-inner-spin-button,.cs-protocol-card-dialog input[type="number"]::-webkit-outer-spin-button,.cs-province-level-dialog input[type="number"]::-webkit-inner-spin-button,.cs-province-level-dialog input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.cs-province-level-dialog[open] { display: grid; grid-template-rows: auto auto auto minmax(0,1fr) auto; max-height: min(92dvh,900px); overflow: hidden; }
.cs-province-level-table-wrap { min-height: 0; max-height: none; margin: 0 20px 16px; overflow-x: hidden; overflow-y: auto; border: 1px solid #d8e7e8; border-radius: 12px; scrollbar-gutter: stable; }
.cs-province-level-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; }
.cs-province-level-table thead th:first-child { width: 34%; }
.cs-province-level-table th,.cs-province-level-table td { padding: 7px; border-bottom: 1px solid #e7eeee; text-align: center; }
.cs-province-level-table tbody tr:nth-child(odd) > * { background: #fff; }
.cs-province-level-table tbody tr:nth-child(even) > * { background: #f1f7fa; }
.cs-province-level-table tbody tr:hover > * { background: #e7f5f3; }
.cs-province-level-table tbody tr:last-child > * { border-bottom: 0; }
.cs-province-level-table thead th { position: sticky; z-index: 2; top: 0; background: #eef7f6; color: #235962; font-size: .62rem; }
.cs-province-level-table th:first-child { text-align: right; }
.cs-province-level-table th small { display: block; margin-top: 2px; color: #7c9298; font-size: .49rem; }
.cs-province-level-table td label { display: grid; place-items: center; cursor: pointer; }
.cs-province-level-table td input { position: absolute; opacity: 0; }
.cs-province-level-table td span { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #d3e1e3; border-radius: 50%; color: #6d8389; font-size: .57rem; }
.cs-province-level-table td input:checked + span { border-color: #0b8278; background: #0b8278; color: #fff; box-shadow: 0 0 0 4px rgba(11,130,120,.12); }
.cs-province-level-dialog > footer { align-items: center; justify-content: space-between; background: #fff; }
.cs-calculation-blocked { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-color: #efc978; background: #fff9e9; color: #79540b; }
.cs-calculation-blocked a { padding: 9px 13px; border-radius: 9px; background: #936711; color: #fff; text-decoration: none; }

@media (max-width: 1050px) { .cs-protocol-list,.cs-protocol-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px) { .cs-audit-layout { grid-template-columns:1fr; } .cs-audit-layout nav { display:flex; gap:8px; border-left:0; border-bottom:1px solid #dbe8ea; } .cs-audit-layout nav button { min-width:180px; } .cs-revision-summary dl,.cs-revision-products { grid-template-columns:1fr; } }
@media (max-width: 680px) {
  .cs-annual-target-head { grid-template-columns: 1fr; }
  .cs-annual-balance { grid-column: auto; }
  .cs-quarter-target-body { grid-template-columns: 1fr; }
  .cs-quarter-people { grid-template-columns: 1fr; }
  .cs-quarter-people label { grid-template-columns: 1fr; }
  .cs-target-remaining-mini { inset-inline: 12px; bottom: 10px; }
  .cs-protocol-manager { padding: 14px; }
  .cs-protocol-manager > header { align-items: stretch; flex-direction: column; }
  .cs-protocol-list,.cs-protocol-create-choice,.cs-protocol-card-grid { grid-template-columns: 1fr; }
  .cs-protocol-card-toolbar { align-items: stretch; flex-direction: column; }
  .cs-protocol-card-toolbar > div { margin: 0; }
  .cs-protocol-create-choice article { grid-template-columns: 42px minmax(0,1fr); }
  .cs-protocol-link-list article { grid-template-columns: 1fr; }
  .cs-province-level-factors { grid-template-columns: repeat(2,minmax(0,1fr)); padding-inline: 12px; }
  .cs-province-level-table-wrap { margin-inline: 12px; }
  .cs-province-level-table th,.cs-province-level-table td { min-width: 48px; padding: 6px 4px; }
  .cs-calculation-blocked { align-items: stretch; flex-direction: column; }
}
/* Versioned, database-backed protocol structure editor */
.cs-protocol-manager-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.cs-protocol-structure-dialog { width: min(900px, calc(100vw - 32px)); max-height: min(86vh, 900px); border: 0; border-radius: 24px; padding: 0; color: #12344a; box-shadow: 0 30px 90px rgba(15, 42, 66, .28); }
.cs-protocol-structure-dialog::backdrop { background: rgba(7, 29, 52, .55); backdrop-filter: blur(4px); }
.cs-protocol-structure-dialog > form { display: grid; gap: 1rem; padding: 1.25rem; overflow: auto; max-height: inherit; }
.cs-protocol-structure-dialog header, .cs-protocol-structure-dialog > form > footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cs-protocol-structure-dialog header h2 { margin: .2rem 0; }
.cs-protocol-structure-dialog header p { margin: 0; color: #64748b; }
.cs-protocol-structure-dialog header > button { border: 0; background: #eef5f8; border-radius: 999px; width: 38px; height: 38px; font-size: 1.35rem; }
.cs-structure-status { display: flex; gap: .75rem; align-items: baseline; padding: .8rem 1rem; border: 1px solid #cce7e5; border-radius: 14px; background: #f2fbfa; }
.cs-structure-status strong { color: #087f75; font-size: 1.2rem; }
.cs-structure-status small { margin-inline-start: auto; color: #64748b; }
.cs-protocol-structure-dialog [data-cs-structure-fields] { display: grid; gap: .8rem; }
.cs-structure-field { border: 1px solid #d8e4ea; border-radius: 16px; padding: 1rem; background: #fff; }
.cs-structure-field > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.cs-structure-field label { display: grid; gap: .35rem; color: #456173; font-size: .82rem; }
.cs-structure-field input, .cs-structure-field select { min-width: 0; border: 1px solid #cbd9e1; border-radius: 10px; padding: .7rem .8rem; font: inherit; background: #fff; }
.cs-structure-field footer { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.cs-structure-field footer code { direction: ltr; margin-inline-end: auto; color: #64748b; }
.cs-structure-field .danger { border: 1px solid #efc7c7; color: #b42318; background: #fff6f6; border-radius: 9px; padding: .55rem .75rem; }
.cs-structure-empty { text-align: center; color: #64748b; border: 1px dashed #cbd9e1; border-radius: 14px; padding: 1.2rem; }
@media (max-width: 680px) { .cs-structure-field > div { grid-template-columns: 1fr; } .cs-structure-field footer { align-items: flex-start; flex-direction: column; } }
