:root {
  color-scheme: dark;
  --bg: #030b0b;
  --bg-soft: #061414;
  --panel: #071d1d;
  --panel-2: #092525;
  --panel-3: #0b3030;
  --header: #101a2d;
  --border: #1b5553;
  --border-soft: rgba(94, 192, 184, 0.18);
  --teal: #66e6d8;
  --teal-strong: #20c7b6;
  --teal-deep: #087e75;
  --yellow: #ffd21c;
  --yellow-soft: #fff0a2;
  --red: #ff6868;
  --green: #63e6aa;
  --amber: #ffb84d;
  --blue: #78b7ff;
  --text: #f6fbfa;
  --muted: #a7c2bf;
  --muted-2: #75928f;
  --sidebar: 270px;
  --topbar: 74px;
  --radius: 12px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(28, 175, 161, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--teal);
}

button {
  border: 0;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--yellow);
  color: #10120f;
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(124, 228, 217, 0.2);
  background:
    linear-gradient(180deg, rgba(3, 13, 13, 0.74), rgba(3, 13, 13, 0.96)),
    radial-gradient(circle at 50% 15%, #234e49, #061111 58%);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.23);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 25px 18px;
}

.brand-mark {
  display: grid;
  width: 45px;
  height: 45px;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  border: 1px solid var(--teal-strong);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(102, 230, 216, 0.17), transparent);
  box-shadow: inset 0 0 20px rgba(102, 230, 216, 0.08);
  color: var(--teal);
  font-weight: 800;
  letter-spacing: -2px;
}

.brand-mark span:last-child {
  color: var(--yellow);
}

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

.brand strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

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

.partnership {
  margin: 0 18px 19px;
  padding: 14px 15px;
  border: 1px solid rgba(102, 230, 216, 0.16);
  border-radius: 10px;
  background: rgba(8, 35, 35, 0.76);
}

.partnership > * {
  display: block;
}

.partnership strong {
  margin-top: 3px;
}

.partnership small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.eyebrow {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-gate {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(99, 230, 170, 0.11), rgba(7, 29, 29, 0.96));
}

.payment-gate.is-blocked {
  border-left-color: var(--yellow);
  background: linear-gradient(90deg, rgba(255, 210, 28, 0.12), rgba(7, 29, 29, 0.96));
}

.payment-gate-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--yellow);
}

.payment-gate-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.payment-gate h2 {
  margin: 4px 0 5px;
}

.payment-gate p,
.payment-gate small {
  margin: 0;
  color: var(--muted);
}

.inline-link-control {
  display: flex;
  min-width: 230px;
  gap: 7px;
}

.inline-link-control select {
  min-width: 145px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--text);
}

.skeleton-label { width: 150px; height: 12px; }
.skeleton-title { width: 340px; height: 38px; margin-top: 10px; }
.skeleton-kpi { height: 72px; }
.detail-grid-padded { padding: 16px; }

.agreement-shell { width: min(960px, calc(100% - 28px)); margin: 32px auto 60px; }
.agreement-hero { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, #0a3633, #081d1d); }
.agreement-hero h1 { margin: 6px 0 8px; font-size: clamp(25px, 4vw, 40px); line-height: 1.08; }
.agreement-hero p { max-width: 760px; margin: 0; color: var(--muted); }
.agreement-actions { display: flex; gap: 8px; margin-top: 18px; }
.agreement-section { margin-top: 14px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.agreement-section h2 { margin: 0 0 12px; font-size: 17px; }
.agreement-section p, .agreement-section li { color: var(--muted); font-size: 12px; }
.agreement-section li + li { margin-top: 7px; }
.agreement-admin-panel,
.agreement-current {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.agreement-admin-panel {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr);
  gap: 22px;
  padding: 22px;
  border-left: 3px solid var(--yellow);
}
.agreement-admin-panel[hidden],
.agreement-current[hidden] { display: none; }
.agreement-admin-panel h2,
.agreement-document-header h2 { margin: 5px 0 7px; font-size: 18px; }
.agreement-admin-panel p,
.agreement-document-header p { margin: 0; color: var(--muted); font-size: 12px; }
.agreement-upload-form { display: grid; gap: 10px; align-content: start; }
.file-drop {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--aqua);
  border-radius: 9px;
  background: rgba(37, 201, 184, .05);
  font-size: 12px;
  font-weight: 800;
}
.file-drop input { color: var(--muted); }
.agreement-document-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.word-document {
  width: min(816px, calc(100% - 34px));
  min-height: 880px;
  margin: 28px auto 38px;
  padding: clamp(34px, 7vw, 76px);
  border: 1px solid #d8dce0;
  background: #fff;
  color: #172024;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .34);
  font-family: Calibri, Aptos, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
}
.word-document h1 { margin: 0 0 24px; color: #10181b; font-size: 24px; text-align: center; }
.word-document h2 { margin: 24px 0 8px; color: #10181b; font-size: 17px; }
.word-document h3 { margin: 18px 0 7px; color: #10181b; font-size: 14px; }
.word-document p { margin: 0 0 9px; color: #172024; text-align: justify; }
.word-document .word-list-item { padding-left: 18px; }
.word-document .word-empty { min-height: 8px; margin: 0; }
.word-table-wrap { max-width: 100%; margin: 16px 0; overflow-x: auto; }
.word-document table { width: 100%; border-collapse: collapse; }
.word-document td { padding: 7px; border: 1px solid #9ea8ad; vertical-align: top; }
.word-document td p { margin: 0; text-align: left; }
.role-guide-panel { margin-top: 14px; }
.role-guide { display: grid; gap: 8px; padding: 12px; }
.role-guide article {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}
.role-guide strong { color: var(--aqua); font-size: 12px; }
.role-guide small { color: var(--muted); font-size: 11px; line-height: 1.45; }

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

.client-source-search .button {
  min-height: 42px;
}

.client-search-results {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(3, 27, 27, 0.54);
}

.client-search-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.client-result {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.client-result:hover,
.client-result:focus-visible {
  border-color: var(--aqua);
  outline: none;
}

.client-result.is-selected {
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-color: var(--aqua);
  cursor: default;
}

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

.client-result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.formula { padding: 15px; border-left: 3px solid var(--yellow); border-radius: 6px; background: #0a2928; color: #fff; font-weight: 700; }
.rate-table { width: 100%; border-collapse: collapse; }
.rate-table th, .rate-table td { padding: 11px 12px; border: 1px solid var(--border); text-align: left; }
.rate-table th { background: var(--header); color: var(--yellow); font-size: 10px; text-transform: uppercase; }

.main-nav {
  display: grid;
  gap: 3px;
  padding: 2px 12px 24px;
}

.main-nav a {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #dbe9e7;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.main-nav a:hover {
  border-color: rgba(102, 230, 216, 0.13);
  background: rgba(102, 230, 216, 0.07);
}

.main-nav a[aria-current="page"] {
  border-color: #2aa99e;
  background: linear-gradient(90deg, rgba(20, 124, 115, 0.38), rgba(13, 62, 60, 0.4));
  box-shadow: inset 3px 0 var(--teal);
  color: #fff;
}

.nav-index {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 7px;
  background: rgba(88, 205, 194, 0.15);
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
}

.main-nav a[aria-current="page"] .nav-index {
  background: rgba(102, 230, 216, 0.22);
  color: #fff;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: auto 15px 16px;
  padding: 12px 13px;
  border: 1px solid rgba(102, 230, 216, 0.2);
  border-radius: 9px;
  background: rgba(8, 30, 30, 0.9);
  color: var(--muted);
  font-size: 11px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(99, 230, 170, 0.13);
}

.content-shell {
  min-height: 100vh;
  padding-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--topbar);
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(102, 230, 216, 0.18);
  background: rgba(3, 12, 12, 0.92);
  backdrop-filter: blur(16px);
}

.topbar-context {
  min-width: 180px;
}

.topbar-context > * {
  display: block;
}

.topbar-context strong {
  margin-top: 3px;
  font-size: 16px;
}

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

.sync-pill,
.source-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sync-pill {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(102, 230, 216, 0.27);
  background: rgba(7, 34, 34, 0.74);
  color: var(--muted);
}

.sync-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 184, 77, 0.12);
}

.sync-pill.is-ready .sync-indicator {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(99, 230, 170, 0.12);
}

.sync-pill.is-error .sync-indicator {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 104, 104, 0.12);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 4px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(102, 230, 216, 0.36);
  border-radius: 50%;
  background: var(--panel-3);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.user-chip strong,
.user-chip small {
  display: block;
}

.user-chip strong {
  font-size: 11px;
}

.user-chip small {
  color: var(--muted-2);
  font-size: 9px;
}

.icon-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 140ms ease,
    filter 140ms ease,
    border-color 140ms ease;
}

.icon-button:hover,
.button:hover {
  filter: brightness(1.08);
}

.icon-button:active,
.button:active {
  transform: translateY(1px);
}

.icon-button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--teal);
}

.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.menu-button {
  display: none;
}

.button {
  min-height: 38px;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.button-primary {
  background: linear-gradient(180deg, #ffe15d, var(--yellow));
  color: #151508;
  box-shadow: 0 8px 22px rgba(255, 210, 28, 0.13);
}

.button-secondary {
  border-color: #2d877f;
  background: #0d4541;
  color: #dcfffa;
}

.button-report {
  border-color: rgba(255, 210, 28, 0.72);
  background: rgba(255, 210, 28, 0.12);
  color: var(--yellow-soft);
}

.button-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--teal);
}

.button-danger {
  border-color: rgba(255, 104, 104, 0.55);
  background: rgba(116, 32, 38, 0.35);
  color: #ffb9b9;
}

.button-danger.is-confirming {
  border-color: #ffcf46;
  background: rgba(108, 74, 0, 0.42);
  color: #ffe17b;
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.56;
}

main {
  width: 100%;
  padding: 22px 24px 42px;
}

.page {
  width: min(100%, 1680px);
  margin-inline: auto;
  animation: page-in 220ms ease-out;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

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

.page-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 37px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.page-heading p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.report-action-button svg {
  width: 15px;
  height: 15px;
}

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

.kpi-card {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(9, 39, 38, 0.98), rgba(5, 25, 25, 0.98));
  box-shadow: inset 0 3px var(--yellow);
}

.kpi-card::after {
  position: absolute;
  right: -30px;
  bottom: -48px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(76, 213, 199, 0.035);
  content: "";
}

.kpi-label,
.kpi-source,
.kpi-note {
  display: block;
}

.kpi-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-value {
  display: block;
  min-height: 34px;
  margin-top: 6px;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.kpi-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.kpi-source {
  margin-top: 3px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 700;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 12px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 25, 25, 0.92);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.panel + .panel {
  margin-top: 12px;
}

.panel-header {
  display: flex;
  min-height: 69px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(9, 38, 38, 0.94), rgba(6, 29, 29, 0.94));
}

.panel-header h2,
.panel-header h3 {
  margin: 2px 0 0;
}

.panel-header h2 {
  font-size: 15px;
}

.panel-header h3 {
  font-size: 13px;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(5, 23, 23, 0.86);
}

.filter-control {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  min-width: 150px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #061919;
  color: var(--text);
}

.filter-control svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.8;
}

.filter-control input,
.filter-control select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
}

.filter-control select {
  cursor: pointer;
}

.filter-control.search {
  min-width: min(330px, 100%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

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

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 51px;
  background: var(--header);
  color: var(--yellow);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.12;
  text-transform: uppercase;
}

.table-column-source {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: none;
}

.invoice-table {
  min-width: 1420px;
}

.invoice-table th {
  height: auto;
  min-height: 68px;
  padding-block: 13px;
  overflow: visible;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}

.invoice-table th:nth-child(7) {
  min-width: 145px;
}

.invoice-table th:nth-child(8) {
  min-width: 155px;
}

.invoice-table th:nth-child(9) {
  min-width: 150px;
}

.data-table tbody tr {
  background: rgba(4, 23, 23, 0.72);
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: rgba(15, 63, 61, 0.44);
}

.cell-title {
  display: block;
  color: #fff;
  font-weight: 750;
}

.cell-note,
.cell-source {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.cell-source {
  color: var(--teal);
}

.source-badge {
  padding: 5px 8px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

.source-badge.zoho {
  color: #70c5ff;
}

.source-badge.odoo {
  color: #d59aff;
}

.source-badge.portal {
  color: var(--teal);
}

.status-badge {
  padding: 5px 9px;
  background: rgba(120, 183, 255, 0.12);
  color: var(--blue);
  white-space: nowrap;
}

.status-badge.success,
.status-badge.paid,
.status-badge.active {
  background: rgba(99, 230, 170, 0.12);
  color: var(--green);
}

.status-badge.warning,
.status-badge.pending,
.status-badge.draft {
  background: rgba(255, 184, 77, 0.12);
  color: var(--amber);
}

.status-badge.danger,
.status-badge.overdue,
.status-badge.rejected {
  background: rgba(255, 104, 104, 0.12);
  color: #ff9292;
}

.amount {
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
}

.amount.muted {
  color: var(--muted-2);
}

.commission-entry {
  display: grid;
  min-width: 126px;
}

.commission-entry input {
  width: 100%;
  min-width: 106px;
  padding: 8px 9px;
  border: 1px solid #e2b900;
  border-radius: 7px;
  outline: 0;
  background: #fff0a3;
  color: #15201f;
  font: inherit;
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.commission-entry input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.18);
}

.commission-entry input.is-invalid {
  border-color: #ff6868;
  background: #ffd0d0;
  color: #761e1e;
}

.invoice-panel-header {
  position: relative;
  z-index: 1;
  background: #082827;
}

.commission-save-all {
  min-width: 174px;
}

.commission-save-all.has-pending {
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.18);
}

.commissionable-amount {
  color: #9af4df;
}

.commissionable-amount.is-invalid {
  color: #ff9292;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-action {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 38px 20px;
  text-align: center;
}

.empty-state.compact {
  min-height: 170px;
}

.empty-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--teal);
}

.empty-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.empty-state h3 {
  margin: 0;
  font-size: 14px;
}

.empty-state p {
  max-width: 460px;
  margin: 7px auto 15px;
  color: var(--muted);
  font-size: 11px;
}

.summary-list {
  display: grid;
}

.summary-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-soft);
}

.summary-item:last-child {
  border-bottom: 0;
}

.summary-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(102, 230, 216, 0.1);
  color: var(--teal);
}

.summary-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

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

.summary-item strong {
  font-size: 11px;
}

.summary-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.summary-value {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 800;
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 210, 28, 0.48);
  border-radius: 9px;
  background: rgba(255, 210, 28, 0.08);
}

.callout svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--yellow);
  stroke-width: 1.8;
}

.callout strong,
.callout small {
  display: block;
}

.callout strong {
  color: var(--yellow);
  font-size: 11px;
}

.callout small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 230, 216, 0.1);
}

.progress > span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-deep), var(--teal));
}

.modal {
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--teal-strong);
  border-radius: 14px;
  background: #061b1b;
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal-small {
  width: min(610px, calc(100% - 28px));
}

.report-modal {
  width: min(650px, calc(100% - 28px));
}

.field > small {
  color: var(--muted-2);
  font-size: 10px;
}

.modal::backdrop {
  background: rgba(0, 8, 8, 0.76);
  backdrop-filter: blur(7px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--header);
}

.modal-header h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.modal-header p {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-body {
  padding: 19px 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(5, 20, 20, 0.82);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.field b {
  color: var(--yellow);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #041313;
  color: var(--text);
  outline: 0;
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
  padding: 10px 12px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #637b78;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(12, 47, 46, 0.44);
}

.check-field input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.check-field strong,
.check-field small {
  display: block;
}

.check-field strong {
  font-size: 10px;
}

.check-field small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.form-message {
  display: none;
  margin: 0 20px 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 104, 104, 0.4);
  border-radius: 7px;
  background: rgba(255, 104, 104, 0.08);
  color: #ffb5b5;
  font-size: 10px;
}

.form-message.is-visible {
  display: block;
}

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

.auth-form .form-message {
  margin: 0;
}

body.is-auth-screen {
  overflow-x: hidden;
  background: #020909;
}

.is-auth-screen .sidebar,
.is-auth-screen .topbar,
.is-auth-screen .sidebar-scrim {
  display: none !important;
}

.is-auth-screen .content-shell {
  padding-left: 0;
}

.is-auth-screen main {
  min-height: 100vh;
  padding: 0;
}

.login-experience {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 9%, rgba(47, 224, 201, 0.12), transparent 30%),
    radial-gradient(circle at 88% 86%, rgba(255, 211, 34, 0.08), transparent 28%),
    #020a0a;
}

.login-experience::before,
.login-experience::after {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  content: "";
  filter: blur(2px);
}

.login-experience::before {
  top: -28vw;
  left: -18vw;
  width: 57vw;
  height: 57vw;
  border: 1px solid rgba(88, 226, 211, 0.12);
  box-shadow:
    0 0 0 8vw rgba(88, 226, 211, 0.018),
    0 0 0 17vw rgba(88, 226, 211, 0.012);
}

.login-experience::after {
  right: -13vw;
  bottom: -23vw;
  width: 42vw;
  height: 42vw;
  border: 1px solid rgba(255, 211, 34, 0.12);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 5vw, 78px);
  border-right: 1px solid rgba(99, 221, 209, 0.16);
}

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

.login-brand-mark {
  display: grid;
  width: 57px;
  height: 57px;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 15px;
  background: rgba(6, 38, 36, 0.76);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
  color: var(--teal);
  font-size: 17px;
}

.login-brand-mark b:last-child {
  color: var(--yellow);
}

.login-brand-lockup > span:last-child {
  display: grid;
  gap: 2px;
}

.login-brand-lockup strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.09em;
}

.login-brand-lockup small {
  color: var(--muted);
  font-size: 12px;
}

.login-story-copy {
  width: min(100%, 780px);
  margin-block: clamp(50px, 9vh, 100px);
}

.login-story-copy h1 {
  max-width: 820px;
  margin: 17px 0 24px;
  color: #f4fffd;
  font-size: clamp(45px, 6vw, 84px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.login-story-copy h1 em {
  color: var(--teal);
  font-style: normal;
}

.login-story-copy p {
  max-width: 650px;
  margin: 0;
  color: #abc2bf;
  font-size: clamp(16px, 1.35vw, 21px);
  line-height: 1.65;
}

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

.login-assurance-grid > div {
  display: grid;
  min-height: 128px;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(92, 213, 202, 0.18);
  border-radius: 13px;
  background: rgba(8, 31, 30, 0.7);
  backdrop-filter: blur(12px);
}

.login-assurance-grid span {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.login-assurance-grid strong {
  color: #effbf9;
  font-size: 13px;
}

.login-assurance-grid small {
  color: #8fa9a6;
  font-size: 11px;
  line-height: 1.5;
}

.login-partnership {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 26px;
  color: #79928f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-partnership i {
  width: 36px;
  height: 1px;
  background: rgba(255, 211, 34, 0.58);
}

.login-access {
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  padding: clamp(26px, 5vw, 82px);
  background: rgba(1, 10, 10, 0.34);
}

.login-card {
  position: relative;
  width: min(100%, 510px);
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
  border: 1px solid rgba(92, 223, 211, 0.3);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(10, 45, 42, 0.97), rgba(4, 24, 23, 0.98));
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.42);
}

.login-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--yellow), #f8ed85 60%, transparent);
  content: "";
}

.login-card-heading {
  margin-bottom: 30px;
}

.login-card-heading h2 {
  margin: 10px 0 7px;
  color: #fff;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.login-card-heading p {
  margin: 0;
  color: #9cb4b1;
  font-size: 13px;
}

.login-card .field > span {
  color: #c1d3d0;
}

.login-card input {
  min-height: 50px;
  border-color: rgba(95, 220, 208, 0.27);
  background: rgba(1, 16, 15, 0.74);
}

.login-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(73, 219, 204, 0.13);
}

.login-submit {
  display: flex;
  width: 100%;
  min-height: 52px;
  justify-content: space-between;
  margin-top: 3px;
  padding-inline: 19px;
  box-shadow: 0 12px 34px rgba(255, 205, 30, 0.15);
}

.login-submit-arrow {
  font-size: 21px;
  line-height: 1;
}

.login-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid rgba(96, 210, 200, 0.15);
  color: #7f9c98;
  font-size: 10px;
  line-height: 1.4;
}

.login-support {
  width: min(100%, 510px);
  margin: 18px 0 0;
  color: #708b87;
  font-size: 10px;
  text-align: center;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 34px;
  height: 32px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  border-color: var(--border);
  background: rgba(102, 230, 216, 0.08);
  outline: 0;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.users-panel {
  margin-bottom: 18px;
}

.user-create-form,
.self-password-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(210px, 1.5fr) minmax(130px, 0.8fr) minmax(190px, 1.2fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 35, 34, 0.38);
}

.self-password-form {
  grid-template-columns: repeat(3, minmax(190px, 1fr)) auto;
}

.field-span-all {
  grid-column: 1 / -1;
}

.user-create-form .form-message,
.self-password-form .form-message,
.password-reset-form .form-message {
  margin: 0;
}

.user-create-button {
  height: 42px;
  white-space: nowrap;
}

.user-access-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
}

.user-access-row {
  display: grid;
  grid-template-columns: 38px minmax(190px, 1.6fr) minmax(130px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(6, 27, 27, 0.66);
}

.user-access-identity strong,
.user-access-identity small,
.user-access-meta strong,
.user-access-meta small {
  display: block;
}

.user-access-identity strong,
.user-access-meta strong {
  font-size: 11px;
}

.user-access-identity small,
.user-access-meta small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.password-reset-dialog {
  width: min(560px, calc(100% - 28px));
}

.password-reset-body {
  display: grid;
  gap: 14px;
}

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

.detail-item {
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(9, 40, 39, 0.58);
}

.detail-item span,
.detail-item strong {
  display: block;
}

.client-unlink-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid rgba(255, 104, 104, 0.38);
  border-radius: 10px;
  background: rgba(75, 24, 29, 0.2);
}

.client-unlink-zone.is-inactive {
  border-color: var(--border);
  background: rgba(9, 40, 39, 0.42);
}

.client-unlink-zone strong,
.client-unlink-zone p {
  display: block;
}

.client-unlink-zone strong {
  margin-top: 4px;
}

.client-unlink-zone p {
  max-width: 560px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.unlink-confirmation-note {
  grid-column: 1 / -1;
  color: #ffe17b;
  font-size: 10px;
}

.period-bill-manager,
.vendor-bill-unlink-confirmation {
  display: grid;
  gap: 14px;
}

.period-bill-intro {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(9, 52, 49, 0.62);
  color: var(--muted);
  line-height: 1.55;
}

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

.period-bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(6, 35, 34, 0.76);
}

.period-bill-payment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.payment-summary {
  display: grid;
  gap: 3px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.vendor-bill-unlink-confirmation {
  padding: 16px;
  border: 1px solid rgba(255, 207, 70, 0.45);
  border-radius: 10px;
  background: rgba(75, 45, 8, 0.18);
}

.vendor-bill-unlink-confirmation strong {
  display: block;
  margin-top: 5px;
}

.vendor-bill-unlink-confirmation p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.vendor-bill-unlink-confirmation p strong {
  display: inline;
}

.modal-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.attachment-list {
  display: grid;
  min-width: 190px;
  gap: 7px;
}

.attachment-file {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(8, 35, 34, 0.68);
}

.attachment-file > span:first-child,
.attachment-file strong,
.attachment-file small {
  display: block;
}

.attachment-file strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 10px;
}

.attachment-file small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

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

.detail-attachments {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(9, 40, 39, 0.42);
}

@media (max-width: 620px) {
  .client-unlink-zone {
    grid-template-columns: 1fr;
  }
}

.detail-item span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.detail-item strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #092322;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.toast.error::before {
  background: var(--red);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 11px;
}

.toast span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.skeleton {
  overflow: hidden;
  border-radius: 4px;
  background: #0e302f;
}

.skeleton::after {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  content: "";
  animation: shimmer 1.1s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

.loading-table {
  min-height: 260px;
  padding: 20px;
}

.loading-line {
  height: 34px;
  margin-bottom: 10px;
}

.loading-line:nth-child(2) {
  width: 86%;
}

.loading-line:nth-child(3) {
  width: 92%;
}

.loading-line:nth-child(4) {
  width: 75%;
}

.is-spinning svg {
  animation: spin 900ms linear infinite;
}

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

.sidebar-scrim {
  position: fixed;
  z-index: 35;
  inset: 0;
  background: rgba(0, 5, 5, 0.65);
  backdrop-filter: blur(4px);
}

@media (max-width: 1180px) {
  :root {
    --sidebar: 230px;
  }

  .sync-pill {
    display: none;
  }

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

  .layout-grid {
    grid-template-columns: 1fr;
  }

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

  .self-password-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar: min(290px, 84vw);
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

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

  .menu-button {
    display: inline-flex;
  }

  .topbar {
    padding-inline: 14px;
  }

  .user-chip > span:last-child {
    display: none;
  }

  main {
    padding: 18px 14px 34px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .report-actions {
    width: 100%;
  }

  .report-action-button {
    flex: 1 1 auto;
  }

  .user-access-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .user-access-meta {
    grid-column: 2;
  }

  .user-access-row .button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 580px) {
  .topbar-context .eyebrow,
  .topbar-actions .button span {
    display: none;
  }

  .topbar-context strong {
    max-width: 150px;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .button {
    width: 38px;
    padding: 0;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 98px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .user-create-form,
  .self-password-form {
    grid-template-columns: 1fr;
  }

  .field-span-all {
    grid-column: auto;
  }

  .user-access-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .user-access-row .button {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-inline: 15px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.commission-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 190px)
    minmax(150px, 190px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.invoice-date-filters {
  grid-template-columns: minmax(240px, 1fr) minmax(145px, 180px)
    minmax(145px, 180px) minmax(145px, 180px) auto;
  position: relative;
  z-index: 2;
  background: rgba(5, 25, 25, 0.98);
}

.summary-date-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(155px, 190px)
    minmax(155px, 190px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 25, 25, 0.98);
}

.summary-date-copy {
  display: grid;
  gap: 3px;
}

.summary-date-copy strong {
  color: var(--text);
  font-size: 0.9rem;
}

.summary-date-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.date-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.date-filter input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
}

.amount-accent,
.amount-ok {
  color: var(--teal);
  font-weight: 900;
}

.amount-warning {
  color: var(--yellow);
  font-weight: 900;
}

@media (max-width: 900px) {
  .commission-filters {
    grid-template-columns: 1fr 1fr;
  }

  .commission-filters .search {
    grid-column: 1 / -1;
  }

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

  .summary-date-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .login-experience {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: auto;
    padding-bottom: 34px;
    border-right: 0;
    border-bottom: 1px solid rgba(99, 221, 209, 0.16);
  }

  .login-story-copy {
    margin-block: 48px 38px;
  }

  .login-story-copy h1 {
    font-size: clamp(43px, 9vw, 72px);
  }

  .login-access {
    min-height: auto;
    padding-block: 58px 72px;
  }
}

@media (max-width: 620px) {
  .login-story,
  .login-access {
    padding-inline: 20px;
  }

  .login-assurance-grid {
    grid-template-columns: 1fr;
  }

  .login-assurance-grid > div {
    min-height: auto;
  }

  .login-card {
    padding: 27px 21px;
    border-radius: 15px;
  }
}

/* Invoice operation context */
.operation-filters { display:flex; gap:10px; flex-wrap:wrap; margin:0 0 16px; }
.operation-filters button { display:flex; align-items:center; gap:14px; padding:11px 15px; border:1px solid #245655; border-radius:9px; background:#0a2525; color:#c9dedd; cursor:pointer; font:inherit; font-size:12px; }
.operation-filters button[aria-pressed="true"] { border-color:#ffe23b; color:#ffe23b; background:#172c20; }
.operation-filters strong { padding:2px 7px; border-radius:5px; background:#ffffff0a; }
.invoice-operation-cell { min-width:210px; white-space:normal !important; }
.invoice-operation-cell .cell-note { display:block; margin-top:4px; line-height:1.4; }
.invoice-operation-cell .table-action { display:block; margin-top:6px; }
.operation-badge { display:inline-block; margin-top:7px; padding:4px 7px; border-radius:5px; font-size:10px; font-weight:700; }
.operation-third_party { color:#87efe7; background:#123e3a; }
.operation-own_purchase { color:#ced6f2; background:#283247; }
.operation-direct { color:#c5dcda; background:#17332f; }
.operation-unclassified { color:#f4d985; background:#3b3217; }
.operation-editor { display:grid; gap:13px; padding:0 0 24px; margin:0 0 22px; border-bottom:1px solid #245655; }
.operation-editor h3,.operation-editor p { margin:0; }
.operation-editor p { color:#c5d8d7; font-size:13px; line-height:1.5; }
.operation-editor [hidden] { display:none !important; }
.operation-editor .form-message { color:#ffce8b; }
.operation-editor button { justify-self:start; }

/* Product eligibility belongs beside the payable base, with a readable per-line audit. */
.projection-badge { display:block; margin:8px 0 4px; padding:6px 8px; border:1px solid #50736b; border-radius:7px; font-size:10px; line-height:1.35; font-weight:700; white-space:normal; text-align:left; }
.projection-badge.validated { color:#9cf5cc; background:#123b2d; border-color:#267653; }
.projection-badge.partial, .projection-badge.pending { color:#ffe58a; background:#3b3216; border-color:#776523; }
.projection-badge.excluded { color:#e4c3c3; background:#352223; border-color:#765253; }
.invoice-table td.commissionable-amount { min-width:170px; white-space:normal; }
.invoice-table td.commissionable-amount .cell-note { text-align:left; line-height:1.4; }
.projection-detail { padding:16px; margin-bottom:18px; border:1px solid var(--border); border-radius:10px; background:rgba(15,51,45,.35); }
.projection-detail p { line-height:1.5; }
.projection-heading .projection-badge { display:inline-block; font-size:12px; }
.projection-detail .data-table { min-width:0; }
.projection-detail .data-table td { white-space:normal; }
.projection-formula { padding:12px; background:rgba(0,0,0,.2); border-radius:8px; }

.commission-suggestion-note { display:block; max-width:180px; margin-top:6px; font-size:10px; line-height:1.45; color:var(--muted); }
.commission-suggestion-note.warning { color:#ffe58a; }
.commission-suggestion-note.manual { color:#8ce8df; }
.commission-entry input:disabled { opacity:.75; cursor:not-allowed; }
.commission-suggestion-breakdown { padding-left:20px; line-height:1.6; font-size:12px; }

.own-purchases-panel { border-color:rgba(240,202,110,.35); }
.own-purchases-summary { cursor:pointer; justify-content:flex-start; list-style:none; gap:16px; }
.own-purchases-summary::-webkit-details-marker { display:none; }
.own-purchases-summary:focus-visible { outline:2px solid var(--teal); outline-offset:-3px; }
.own-purchases-summary:hover { background:rgba(240,202,110,.05); }
.own-purchases-summary .invoice-group-chevron { color:#e2c884; }
[data-own-purchases][open] > summary .invoice-group-chevron { transform:rotate(90deg); }
.own-purchases-count { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:20px; background:rgba(240,202,110,.12); color:#e2c884; font-size:12px; }
.own-purchases-intro > p { margin:16px 16px 0; color:var(--muted); font-size:12px; line-height:1.6; }
.own-purchases-table .table-action { display:block; margin-top:8px; }
.own-purchases-table .operation-badge { white-space:normal; }
.invoice-client-groups { padding:0 14px 14px; }
.invoice-groups-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 2px 16px; }
.invoice-groups-toolbar p { margin:0; font-size:12px; line-height:1.5; color:var(--muted); }
.invoice-groups-toolbar p strong { color:var(--text); }
.invoice-groups-actions { display:flex; gap:18px; flex-shrink:0; }
.invoice-client-group { margin-bottom:10px; border:1px solid #394346; border-radius:10px; overflow:hidden; background:rgba(9,38,36,.45); }
.invoice-client-group:last-child { margin-bottom:0; }
.invoice-client-summary { display:grid; grid-template-columns:20px minmax(240px,1.2fr) minmax(510px,2fr); align-items:center; gap:16px; padding:18px 16px; cursor:pointer; list-style:none; background:#202427; color:#f1f4f4; }
.invoice-client-summary::-webkit-details-marker { display:none; }
.invoice-client-summary:hover { background:#292e31; }
.invoice-client-summary:focus-visible { outline:2px solid var(--teal); outline-offset:-3px; }
.invoice-group-chevron { font-size:26px; line-height:1; color:var(--teal); transition:transform .15s ease; text-align:center; }
.invoice-client-summary .invoice-group-chevron { color:#79d7ce; }
.invoice-client-group[open] > summary .invoice-group-chevron { transform:rotate(90deg); }
.invoice-client-group[open] > summary { border-bottom:1px solid #394346; background:#202427; }
.invoice-client-group[open] > summary:hover { background:#292e31; }
.invoice-summary-hint { display:block; font-size:10px; margin-top:4px; }
.invoice-group-name { display:flex; flex-direction:column; gap:6px; min-width:0; }
.invoice-group-name > strong { font-size:14px; line-height:1.4; overflow-wrap:anywhere; }
.invoice-group-name > span { font-size:11px; line-height:1.5; color:#bdc6c8; }
.invoice-group-participation { display:flex; flex-direction:column; gap:5px; margin-top:5px; overflow-wrap:anywhere; }
.invoice-group-participation b { font-weight:650; color:#dae1e2; }
.invoice-group-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:start; }
.invoice-group-total { text-align:right; display:flex; flex-direction:column; gap:6px; }
.invoice-group-total > span { font-size:10px; color:#bdc6c8; line-height:1.4; }
.invoice-group-total > strong { font-size:14px; line-height:1.5; font-variant-numeric:tabular-nums; color:#f1f4f4; }
.invoice-group-total > strong > span { display:block; }
.invoice-group-total small { font-size:9px; color:#bdc6c8; font-weight:500; }
.invoice-group-commissions > strong { color:#9ce2cf; }
.invoice-group-content .table-wrap { border-radius:0; }
@media(max-width:1250px) {
  .invoice-client-summary { grid-template-columns:20px minmax(0,1fr); }
  .invoice-group-metrics { grid-column:2; padding-top:12px; border-top:1px solid #394346; }
  .invoice-group-total { text-align:left; }
}
@media(max-width:700px) {
  .invoice-groups-toolbar { align-items:flex-start; flex-direction:column; }
  .invoice-client-summary { grid-template-columns:18px minmax(0,1fr); gap:14px 10px; padding:14px 12px; }
  .invoice-group-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 12px; }
}

/* Supplier intake is independent from customer collections. */
.vendor-form {display:grid;gap:14px;padding:18px 0;border-top:1px solid var(--border);margin-top:18px}
.vendor-form h3,.vendor-form p {margin:0;line-height:1.5}
.vendor-form input[type=file] {max-width:100%;padding:12px}
.vendor-check {display:flex;align-items:flex-start;gap:10px;line-height:1.5;font-size:13px}
.vendor-check input {width:18px;height:18px;flex:none;margin-top:2px}
.vendor-file-list {display:flex;gap:15px;flex-wrap:wrap;margin:16px 0}
.vendor-sync-notes {padding:0 18px;font-size:12px;color:var(--text-muted)}
.vendor-document-table {min-width:1120px}.vendor-document-table .cell-note {max-width:200px;overflow-wrap:anywhere}
.supplier-document-table {min-width:1100px}
.supplier-document-table td {vertical-align:top}
.supplier-document-table .supplier-concept-cell {width:30%;min-width:280px;white-space:normal}
.supplier-document-table .cell-note {max-width:200px;white-space:normal;line-height:1.5}
.supplier-concepts {margin:0 0 8px;padding-left:14px;line-height:1.6}
.supplier-concepts li+li {margin-top:4px}
.supplier-payment-date {display:block;white-space:nowrap;line-height:1.6}
.commission-transaction-table {min-width:1220px}

/* Role editing is inline and scoped to administrator configuration. */
.user-access-row{grid-template-columns:38px minmax(160px,1.6fr) minmax(210px,1fr) auto;}
.user-role-form{display:flex;align-items:flex-end;gap:7px;min-width:0;}.user-role-form label{flex:1;min-width:0;display:grid;gap:3px;font-size:9px;color:var(--muted);}.user-role-form select{width:100%;min-width:0;padding:8px;border:1px solid var(--border-soft);border-radius:6px;background:var(--bg,#091923);color:var(--text,#effafa);font:inherit;font-size:11px;}.user-role-form button{padding:8px 10px;min-height:33px;}.user-access-meta [data-role-message]{white-space:normal;color:#ffda73;max-width:300px;}.user-role-form button:disabled{opacity:.45;cursor:default;}
@media(max-width:1100px){.user-access-row{grid-template-columns:38px minmax(0,1fr) auto;}.user-access-meta{grid-column:2;}.user-role-form .button{grid-column:auto;grid-row:auto;}}
@media(max-width:580px){.user-access-row{grid-template-columns:34px minmax(0,1fr);}.user-access-meta{grid-column:1/-1;}.user-role-form .button{grid-column:auto;grid-row:auto;justify-self:auto;}.user-role-form{width:100%;}}

.user-access-row{grid-template-columns:38px minmax(140px,1.4fr) minmax(205px,1fr) auto auto;gap:9px}.user-remove-button{color:#ffc1bb;border:1px solid #9e554e;background:#562b2b33;white-space:nowrap}.user-remove-button:hover{background:#8b3b3b55}.user-access-feedback{grid-column:2/-1;color:#ffd978;font-size:11px;white-space:normal}.user-access-feedback:empty{display:none}.user-removed-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border:1px solid var(--border-soft);border-radius:8px}.user-removed-row strong,.user-removed-row small{display:block}.user-removed-row small{color:var(--muted);font-size:11px;margin-top:4px}.user-removed-row .user-access-feedback{grid-column:1/-1}
@media(max-width:1200px){.user-access-row{grid-template-columns:38px minmax(0,1fr) auto}.user-access-meta{grid-column:2;grid-row:2}.user-access-row>[data-reset-user]{grid-column:3;grid-row:1}.user-access-row>.user-remove-button{grid-column:3;grid-row:2}.user-access-row .user-role-form .button{grid-column:auto;grid-row:auto}.user-access-row .user-access-feedback{grid-column:2/-1}}
@media(max-width:580px){.user-access-row{grid-template-columns:34px minmax(0,1fr)}.user-access-meta{grid-column:1/-1;grid-row:auto}.user-access-row>[data-reset-user],.user-access-row>.user-remove-button{grid-column:1/-1;grid-row:auto;justify-self:stretch}.user-access-row .user-access-feedback{grid-column:1/-1}.user-removed-row{grid-template-columns:1fr}}
