:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #d9e2ec;
  --surface: #ffffff;
  --canvas: #f1f8fc;
  --primary: #0076b6;
  --primary-deep: #0a4f83;
  --secondary: #008bd2;
  --teal: #00a6cf;
  --amber: #f36b2a;
  --rose: #c2414b;
  --good: #16803c;
  --shadow: 0 14px 34px rgba(4, 88, 135, 0.1);
  --tooltip-bg: rgba(11,18,32,0.95);
  --tooltip-color: #ffffff;
  --tooltip-padding: 8px 10px;
  --tooltip-radius: 8px;
  --tooltip-shadow: 0 10px 30px rgba(11,18,32,0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 4px solid var(--amber);
  background: var(--primary);
  color: #fff;
  padding: 16px 32px;
}

.admin-header {
  align-items: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: #d7efff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.15;
}

.brand-title {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-title > div {
  min-width: 0;
}

.brand-title h1,
.brand-title .eyebrow {
  overflow-wrap: anywhere;
}

.brand-title h1 {
  max-width: 520px;
}

.brand-logo {
  display: block;
  width: 150px;
  max-width: 30vw;
  height: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 58, 102, 0.18);
  padding: 6px 8px;
}

h2 {
  font-size: 15px;
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 310px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.field.compact {
  min-width: 170px;
}

.field.period-field {
  min-width: 250px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  outline: none;
  padding: 8px 10px;
}

input:focus,
select:focus {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.26);
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  text-decoration: none;
}

.header-link:hover,
.header-link:focus {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.12);
}

.header-link.current {
  border-color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.18);
}

.session-user {
  align-self: center;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(0, 118, 182, 0.08) 47%, rgba(0, 118, 182, 0.26)),
    radial-gradient(circle at 82% 16%, rgba(243, 107, 42, 0.16), transparent 26%),
    url("login-access-panel.png") left center / auto 92% no-repeat,
    #f7fbfd;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  align-items: center;
  justify-items: end;
  padding: clamp(20px, 5vw, 64px);
  padding-right: clamp(22px, 3vw, 44px);
}

.login-panel {
  width: min(364px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(0, 91, 145, 0.24);
  backdrop-filter: blur(10px);
  padding: 24px;
}

.login-logo {
  display: block;
  width: 100%;
  max-width: 364px;
  height: auto;
  margin: 0 auto 20px;
  object-fit: contain;
}

.login-panel .eyebrow {
  color: var(--secondary);
}

.login-panel h1 {
  color: var(--ink);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-error {
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
}

.login-success {
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
}

.login-support-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.login-support-link:hover,
.login-support-link:focus {
  text-decoration: underline;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.remember-login input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.update-notice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
}

.update-notice-dialog {
  width: min(540px, 100%);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(11, 18, 32, 0.28);
  color: var(--ink);
  padding: 24px;
}

.update-notice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.update-notice-header h2 {
  color: var(--primary-deep);
  font-size: 24px;
  line-height: 1.2;
}

.update-notice-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.update-notice-close:hover,
.update-notice-close:focus {
  border-color: var(--primary);
  color: var(--primary-deep);
}

.update-notice-intro {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.update-notice-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding-left: 20px;
}

.update-notice-list li {
  line-height: 1.45;
}

.update-notice-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.update-notice-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.update-notice-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.update-notice-confirm {
  min-width: 112px;
}

.account-panel {
  max-width: 520px;
}

.account-form {
  max-width: 520px;
}

.shell {
  display: grid;
  gap: 18px;
  padding: 20px 32px 34px;
}

.admin-workspace {
  gap: 14px;
}

.orders-workspace {
  width: 100%;
}

.admin-filters.orders-filters {
  grid-template-columns: minmax(280px, 1.4fr) minmax(180px, 0.75fr) minmax(200px, 0.75fr) minmax(180px, 0.65fr);
}

.admin-workbench.orders-workbench {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(230px, 0.85fr) minmax(150px, 0.55fr) minmax(150px, 0.55fr);
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.dashboard-filters {
  grid-template-columns: minmax(220px, 1.25fr) minmax(210px, 0.78fr) minmax(145px, 0.48fr) minmax(180px, 0.65fr) minmax(145px, 0.48fr);
}

.admin-filters .field {
  position: relative;
  min-width: 0;
  color: var(--ink);
}

.admin-filters .field span {
  color: var(--muted);
}

.admin-filters input,
.admin-filters select {
  border-color: var(--line);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 20;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestions button {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
}

.search-suggestions button:nth-child(even) {
  background: #f8fafc;
}

.search-suggestions button:last-child {
  border-bottom: 0;
}

.search-suggestions button:hover,
.search-suggestions button:focus {
  background: #edf6fb;
  outline: none;
}

.search-suggestions span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.search-suggestions small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.active-filter-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(0, 139, 210, 0.24);
  border-radius: 8px;
  background: #e7f6fc;
  padding: 10px 14px;
}

.active-filter-strip[hidden] {
  display: none;
}

.active-filter-card {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.active-filter-items,
.active-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.active-filter-items {
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.active-filter-actions {
  flex: 0 0 auto;
}

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

.active-filter-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.analysis-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

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

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

.representative-shell {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.representative-kpis {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.representative-kpis .kpi {
  grid-column: span 4;
}

.representative-kpis .kpi-wide {
  grid-column: span 3;
}

.representative-kpis .kpi strong {
  overflow-wrap: normal;
  word-break: normal;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.08;
}

.open-orders-kpis {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.open-orders-kpis .kpi {
  grid-column: span 4;
}

.open-orders-kpis .kpi span {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.open-orders-kpis .kpi:nth-child(2),
.open-orders-kpis .kpi:nth-child(3) {
  grid-column: span 6;
  order: -1;
}

.open-orders-kpis .kpi strong {
  overflow-wrap: normal;
  word-break: normal;
  font-size: clamp(22px, 2.05vw, 30px);
  line-height: 1.08;
}

.open-orders-kpis .kpi:nth-child(2) strong,
.open-orders-kpis .kpi:nth-child(3) strong {
  font-size: clamp(26px, 2.4vw, 34px);
}

.representative-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, 0.85fr);
}

.kpi,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  position: relative;
  min-height: 90px;
  padding: 14px 16px;
}

.kpi[data-kpi-help] {
  cursor: help;
  padding-right: 40px;
}

.kpi[data-kpi-help]::after {
  content: "i";
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(0, 118, 182, 0.34);
  border-radius: 50%;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.kpi[data-kpi-help]:hover,
.kpi[data-kpi-help]:focus-visible {
  border-color: rgba(0, 118, 182, 0.42);
}

.kpi[data-kpi-help]:focus-visible {
  outline: 3px solid rgba(0, 118, 182, 0.18);
  outline-offset: 2px;
}

.kpi-help-tooltip {
  position: fixed;
  z-index: 10000;
  width: min(300px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--tooltip-radius);
  background: var(--tooltip-bg);
  box-shadow: var(--tooltip-shadow);
  color: var(--tooltip-color);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.kpi-help-tooltip[hidden] {
  display: none;
}

.kpi-help-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(19px, 1.55vw, 23px);
  line-height: 1.08;
  min-width: 0;
  letter-spacing: -0.02em;
}

[data-fit-value] {
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal !important;
  text-overflow: clip;
  white-space: nowrap;
}

.kpi strong.company-name {
  overflow: hidden;
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi.accent {
  border-color: rgba(0, 139, 210, 0.28);
  background: #e7f6fc;
}

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

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

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel.collapsed [data-collapsible-body] {
  display: none !important;
}

.orders-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.orders-summary-strip div {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.orders-summary-strip [data-kpi-help] {
  cursor: help;
  padding-right: 38px;
}

.orders-summary-strip [data-kpi-help]::after {
  content: "i";
  position: absolute;
  top: 9px;
  right: 10px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(0, 118, 182, 0.34);
  border-radius: 50%;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.orders-summary-strip [data-kpi-help]:hover,
.orders-summary-strip [data-kpi-help]:focus-visible {
  border-color: rgba(0, 118, 182, 0.42);
}

.orders-summary-strip [data-kpi-help]:focus-visible {
  outline: 3px solid rgba(0, 118, 182, 0.18);
  outline-offset: 2px;
}

.orders-summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.orders-summary-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.open-orders-dashboard-panel {
  margin-top: 0;
}

.compact-orders-table table {
  min-width: 860px;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5),
.orders-table th:nth-child(6),
.orders-table td:nth-child(6),
.compact-orders-table th:nth-child(5),
.compact-orders-table td:nth-child(5) {
  text-align: left;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4),
.orders-table th:nth-child(7),
.orders-table td:nth-child(7),
.compact-orders-table th:nth-child(4),
.compact-orders-table td:nth-child(4),
.compact-orders-table th:nth-child(6),
.compact-orders-table td:nth-child(6) {
  text-align: right;
}

.order-age-ranges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 0 16px 14px;
}

.order-age-range {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
}

.order-age-range:hover,
.order-age-range:focus,
.order-age-range.active {
  border-color: #7dd3fc;
  box-shadow: inset 3px 0 0 var(--secondary);
  outline: none;
}

.order-age-range.warning {
  background: #fff7ed;
}

.order-age-range.critical {
  background: #fff1f2;
}

.order-age-range.fresh.active {
  background: #edf6fb;
}

.order-age-range.warning.active {
  border-color: #f59e0b;
}

.order-age-range.critical.active {
  border-color: var(--rose);
}

.order-age-range span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-age-range strong {
  font-size: 18px;
}

.order-age-range small {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.order-age-range div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.order-age-range i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.order-age-range.warning i {
  background: var(--amber);
}

.order-age-range.critical i {
  background: var(--rose);
}

tbody tr.order-age-warning {
  background: #fff7ed;
}

tbody tr.order-age-critical {
  background: #fff1f2;
}

.company-order-insights {
  display: grid;
  gap: 14px;
}

.company-order-row {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.company-order-row:nth-child(even) {
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px 12px;
}

.company-order-row:last-child {
  border-bottom: 0;
}

.company-order-head,
.company-order-metrics,
.company-order-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.company-order-head strong,
.company-order-total strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-order-head span,
.company-order-metrics span,
.company-order-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-order-metrics {
  flex-wrap: wrap;
}

.company-order-metrics span:first-child {
  color: var(--ink);
  font-size: 16px;
}

.company-order-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.company-order-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal));
}

.invoice-revenue-track div {
  background: linear-gradient(90deg, var(--teal), #16a34a);
}

.company-order-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

/* Chart tooltip (moved from inline JS) */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  background: var(--tooltip-bg);
  color: var(--tooltip-color);
  padding: var(--tooltip-padding);
  border-radius: var(--tooltip-radius);
  box-shadow: var(--tooltip-shadow);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: transform 120ms ease, opacity 120ms ease;
}
.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.title-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.title-stack h2,
.title-stack span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.text-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.text-button:hover,
.text-button:focus {
  border-color: #7dd3fc;
  background: #edf6fb;
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.primary-action {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.primary-action:hover,
.primary-action:focus {
  background: var(--primary-deep);
  color: #fff;
}

.line-chart {
  height: 300px;
  padding: 12px 16px 16px;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.legend {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 30px;
  height: 8px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.08);
}

.legend-swatch.actual {
  background: var(--primary);
}

.legend-swatch.target {
  background: var(--amber);
}

.legend-swatch.revenue {
  background: var(--teal);
}

.status-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.status-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 0;
}

.legend-chip {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.legend-chip strong {
  color: var(--ink);
  font-size: 12px;
}

.legend-chip.meta-batida {
  background: #dcfce7;
  color: #166534;
}

.legend-chip.proximo {
  background: #fef3c7;
  color: #92400e;
}

.legend-chip.acompanhar {
  background: #e0f2fe;
  color: #075985;
}

.legend-chip.critico {
  background: #fee2e2;
  color: #991b1b;
}

.status-row,
.top-row {
  display: grid;
  gap: 8px;
}

.status-row:nth-child(even),
.top-row:nth-child(even) {
  background: #f8fafc;
}

.status-row {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 8px;
  text-align: left;
}

.status-row:hover,
.status-row:focus {
  border-color: #7dd3fc;
  background: #f7fbfe;
  outline: none;
}

.status-row.active {
  border-color: rgba(23, 107, 135, 0.42);
  background: #edf6fb;
}

.status-meta,
.top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf3;
}

.fill {
  height: 100%;
  border-radius: inherit;
  background: var(--secondary);
}

.fill.good {
  background: var(--good);
}

.fill.near {
  background: var(--amber);
}

.fill.watch {
  background: var(--teal);
}

.fill.risk {
  background: var(--rose);
}

.fill.no-target {
  background: #64748b;
}

.top-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.top-name {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.representative-list-panel {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.representatives-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 12px;
}

.rep-list-item {
  display: grid;
  position: relative;
  width: 100%;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 11px;
  text-align: left;
}

.rep-list-item:nth-child(even) {
  background: #f8fafc;
}

.orders-representative-item {
  min-height: 44px;
  align-content: center;
}

.orders-workbench .open-orders-kpis {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.orders-workbench .open-orders-kpis .kpi {
  grid-column: span 4;
}

.orders-workbench .open-orders-kpis .kpi:nth-child(2),
.orders-workbench .open-orders-kpis .kpi:nth-child(3) {
  grid-column: span 6;
}

.representative-tooltip {
  position: fixed;
  z-index: 1000;
  width: min(218px, calc(100vw - 24px));
  border: 1px solid rgba(23, 107, 135, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  padding: 9px 10px;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: pre-line;
}

.representative-tooltip[hidden] {
  display: none;
}

.representative-tooltip.visible {
  opacity: 1;
  transform: translateX(0);
}

.rep-list-item:hover,
.rep-list-item:focus {
  border-color: #7dd3fc;
  background: #f7fbfe;
  outline: none;
}

.rep-list-item.active {
  border-color: rgba(23, 107, 135, 0.5);
  background: #edf6fb;
  box-shadow: inset 3px 0 0 var(--secondary);
}

.rep-list-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rep-list-company {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rep-list-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.rep-list-metrics strong {
  color: var(--secondary);
  font-size: 15px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 18px;
  text-align: center;
}

.detail-chart {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.month-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.month-row:nth-child(even) {
  border-radius: 6px;
  background: #f8fafc;
  padding: 6px 8px;
}

.month-bars {
  display: grid;
  gap: 4px;
}

.bar {
  height: 8px;
  border-radius: 999px;
}

.bar.actual {
  background: var(--secondary);
}

.bar.target {
  background: #cbd5e1;
}

.breakdown {
  display: grid;
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.breakdown-head,
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(96px, 1.2fr) repeat(3, minmax(72px, 1fr));
  gap: 1px;
  background: #fff;
  font-size: 12px;
}

.breakdown-row:nth-child(even) {
  background: #f8fafc;
}

.representative-breakdown .breakdown-head,
.representative-breakdown .breakdown-row {
  grid-template-columns: minmax(148px, 1.45fr) repeat(3, minmax(68px, 1fr));
}

.monthly-values {
  margin-top: 8px;
}

.company-sections {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.company-detail {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.company-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.company-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.company-detail-title h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.company-detail-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-month-row {
  grid-template-columns: 56px minmax(0, 1fr) 70px;
}

.company-detail.sales-collapsed .monthly-values,
.company-detail.sales-collapsed .company-month-row {
  display: none !important;
}

.breakdown-head {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.breakdown-head span,
.breakdown-row span {
  padding: 8px;
  text-align: right;
}

.breakdown-head span:first-child,
.breakdown-row span:first-child {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-panel {
  margin-top: 2px;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
}

.table-panel.collapsed .table-wrap {
  display: none;
}

.admin-shell {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.admin-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

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

.admin-field {
  min-width: 0;
  color: var(--ink);
}

.admin-field span {
  color: var(--muted);
}

.admin-field input {
  border-color: var(--line);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.report-filters {
  grid-template-columns: minmax(190px, 0.48fr) minmax(140px, 0.25fr) minmax(180px, 0.42fr) minmax(220px, 0.55fr) auto auto auto;
}

.report-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.55fr);
}

.report-grid.email-config-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.report-search-field {
  min-width: 240px;
}

#reportPeriod {
  font-size: 16px;
  line-height: 1.18;
  overflow-wrap: anywhere;
  white-space: normal;
}

.report-preview-table table {
  min-width: 1180px;
}

.report-batch-table table {
  min-width: 640px;
}

.report-email-table table {
  min-width: 720px;
}

.report-preview-table th:first-child,
.report-preview-table td:first-child {
  width: 46px;
  text-align: center;
}

.report-preview-table input[type="checkbox"],
#selectAllReports {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.report-preview-table th:nth-child(2),
.report-preview-table td:nth-child(2),
.report-preview-table th:nth-child(3),
.report-preview-table td:nth-child(3),
.report-preview-table th:nth-child(4),
.report-preview-table td:nth-child(4) {
  text-align: left;
}

.report-preview-table th:nth-child(5),
.report-preview-table td:nth-child(5),
.report-preview-table th:nth-child(6),
.report-preview-table td:nth-child(6),
.report-preview-table th:nth-child(7),
.report-preview-table td:nth-child(7) {
  text-align: right;
}

.report-preview-table th:nth-child(8),
.report-preview-table td:nth-child(8),
.report-preview-table th:nth-child(9),
.report-preview-table td:nth-child(9) {
  text-align: center;
}

.email-config-form {
  gap: 12px;
}

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

.interactive-kpi {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.interactive-kpi:hover,
.interactive-kpi:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
  outline: none;
}

.users-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 210px;
  align-items: end;
  gap: 12px;
  padding: 16px;
}

.users-toolbar .field {
  min-width: 0;
  color: var(--muted);
}

.users-toolbar input,
.users-toolbar select {
  border-color: var(--line);
}

.password-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  background: #e7f6fc;
  padding: 12px;
}

.password-notice[hidden] {
  display: none;
}

.password-notice div {
  display: grid;
  gap: 4px;
}

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

.password-notice code {
  border-radius: 6px;
  background: #fff;
  color: var(--primary-deep);
  font-size: 14px;
  font-weight: 900;
  padding: 8px 10px;
}

.users-table td:first-child strong,
.users-table td:first-child small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-table td:first-child small,
.muted-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warning-note {
  color: #92400e;
}

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

.action-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.access-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 118px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.access-badge.enabled {
  background: #dcfce7;
  color: #166534;
}

.access-badge.blocked {
  background: #fee2e2;
  color: #991b1b;
}

.access-badge.inactive {
  background: #e2e8f0;
  color: #334155;
}

.presence-badge,
.event-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 78px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.presence-badge.online,
.event-badge.login {
  background: #dcfce7;
  color: #166534;
}

.presence-badge.offline,
.event-badge.logout {
  background: #e2e8f0;
  color: #334155;
}

.event-badge.failed {
  min-width: 132px;
  background: #fee2e2;
  color: #991b1b;
}

.last-seen,
.audit-table td:nth-child(2) small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

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

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px 160px 160px auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
}

.audit-table {
  max-height: 520px;
}

.audit-table table {
  min-width: 980px;
}

.audit-table td:nth-child(1),
.audit-table td:nth-child(5),
.audit-table td:nth-child(7) {
  white-space: nowrap;
}

.audit-table td:nth-child(6) {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-cell {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.compact-table {
  max-height: 420px;
}

.compact-table table {
  min-width: 100%;
  table-layout: fixed;
}

.compact-table th:nth-child(1),
.compact-table td:nth-child(1) {
  width: 92px;
}

.compact-table th:nth-child(2),
.compact-table td:nth-child(2) {
  width: 58px;
}

.compact-table th:nth-child(3),
.compact-table td:nth-child(3) {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.compact-table th:nth-child(4),
.compact-table td:nth-child(4) {
  width: 186px;
}

.compact-table th:nth-child(5),
.compact-table td:nth-child(5) {
  width: 126px;
}

.import-history-table table {
  min-width: 1040px;
}

.import-history-table th:nth-child(1),
.import-history-table td:nth-child(1) {
  width: 70px;
}

.import-history-table th:nth-child(4),
.import-history-table td:nth-child(4) {
  width: 136px;
}

.import-history-table th:nth-child(7),
.import-history-table td:nth-child(7) {
  overflow: hidden;
  max-width: 420px;
  text-align: left;
  text-overflow: ellipsis;
}

.import-summary {
  padding: 16px;
}

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

.summary-list div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.summary-list div:nth-child(even) {
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 10px 10px;
}

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

.summary-list strong {
  font-size: 13px;
}

.source-paths-list {
  margin-top: 10px;
}

.source-paths-list strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.automation-log-list pre {
  overflow: auto;
  max-height: 92px;
  margin: 6px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px;
  white-space: pre-wrap;
}

.file-name,
.file-name + .muted-note {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.file-name + .muted-note {
  margin-top: 3px;
  white-space: normal;
}

.interactive-summary {
  gap: 0;
}

.summary-action {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 10px 0;
  text-align: left;
}

.summary-action:nth-child(even) {
  background: #f8fafc;
}

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

.summary-action:hover,
.summary-action:focus,
.summary-action.active {
  background: #edf6fb;
  outline: none;
}

.summary-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-action strong {
  color: var(--ink);
  font-size: 13px;
}

.summary-action small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.invoice-revenue-ranking .summary-action.active {
  box-shadow: inset 3px 0 0 var(--teal);
  padding-left: 10px;
}

.table-link {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.table-link:hover,
.table-link:focus {
  text-decoration: underline;
}

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

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

td:first-child,
th:first-child {
  max-width: 420px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

td:nth-child(2),
th:nth-child(2),
td:nth-child(7),
th:nth-child(7),
td:nth-child(8),
th:nth-child(8) {
  text-align: left;
}

tbody tr {
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:hover {
  background: #edf6fb;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: " ↕";
  color: #94a3b8;
  font-weight: 900;
}

th.sortable.sorted::after {
  content: " ↓";
  color: var(--primary);
}

th.sortable.sorted[data-direction="asc"]::after {
  content: " ↑";
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-width: 96px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.meta-batida {
  background: #dcfce7;
  color: #166534;
}

.status-pill.proximo {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.acompanhar {
  background: #e0f2fe;
  color: #075985;
}

.status-pill.critico {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.sem-meta {
  background: #e2e8f0;
  color: #334155;
}

@media (max-width: 1180px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    max-width: 240px;
    width: 62vw;
  }

  .header-actions,
  .admin-filters,
  .active-filter-strip,
  .admin-workbench,
  .layout-grid,
  .bottom-grid,
  .source-fields,
  .users-toolbar,
  .audit-toolbar,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .open-orders-kpis .kpi,
  .open-orders-kpis .kpi:nth-child(2),
  .open-orders-kpis .kpi:nth-child(3) {
    grid-column: 1;
  }

  .active-filter-strip,
  .active-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    display: grid;
  }

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

  .admin-filters.orders-filters,
  .admin-workbench.orders-workbench {
    grid-template-columns: 1fr;
  }

  .representative-list-panel {
    position: static;
    max-height: none;
  }

  .representatives-list {
    max-height: 420px;
  }

  .password-notice {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .login-body {
    background-position: center;
    background-size: cover;
  }

  .login-shell {
    justify-items: center;
  }

  .login-panel {
    background: rgba(255, 255, 255, 0.92);
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .update-notice-backdrop {
    align-items: end;
    padding: 14px;
  }

  .update-notice-dialog {
    padding: 18px;
  }

  .update-notice-header h2 {
    font-size: 22px;
  }

  .update-notice-actions {
    justify-content: stretch;
  }

  .update-notice-confirm {
    width: 100%;
  }

  .app-header {
    gap: 14px;
    padding: 14px 14px 16px;
  }

  .brand-title {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .brand-logo {
    width: 96px;
    max-width: 96px;
    padding: 5px 6px;
  }

  .eyebrow {
    font-size: 11px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 14px;
  }

  .session-user {
    max-width: none;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    text-align: center;
  }

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

  .header-link {
    min-height: 42px;
    padding: 9px 10px;
  }

  .shell {
    gap: 14px;
    padding: 14px 10px 24px;
  }

  .admin-filters {
    gap: 10px;
    border-radius: 8px;
    padding: 12px;
  }

  .field,
  .field.compact,
  .field.period-field {
    min-width: 0;
  }

  input,
  select {
    min-height: 44px;
    font-size: 14px;
  }

  .active-filter-strip {
    padding: 10px;
  }

  .active-filter-items {
    grid-template-columns: 1fr;
  }

  .active-filter-card strong {
    white-space: normal;
  }

  .kpi-grid,
  .representative-kpis,
  .open-orders-kpis {
    gap: 10px;
  }

  .kpi {
    min-height: 82px;
    padding: 12px 14px;
  }

  .kpi span {
    font-size: 11px;
    text-transform: uppercase;
  }

  .kpi strong,
  .representative-kpis .kpi strong,
  .open-orders-kpis .kpi strong,
  .open-orders-kpis .kpi:nth-child(2) strong,
  .open-orders-kpis .kpi:nth-child(3) strong {
    margin-top: 8px;
    font-size: clamp(20px, 7vw, 28px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .representative-kpis .kpi,
  .representative-kpis .kpi-wide {
    grid-column: 1;
  }

  .panel {
    border-radius: 8px;
  }

  .panel-title {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
  }

  .panel-title .panel-actions {
    width: 100%;
    justify-content: space-between;
  }

  .title-stack {
    gap: 4px;
  }

  .title-stack span,
  .panel-title > span {
    font-size: 12px;
    line-height: 1.35;
  }

  .orders-summary-strip {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .orders-summary-strip div {
    padding: 10px;
  }

  .orders-summary-strip strong {
    font-size: 16px;
    line-height: 1.15;
  }

  .order-age-ranges {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 12px 12px;
  }

  .order-age-range {
    padding: 10px;
  }

  .order-age-range small {
    font-size: 11px;
  }

  .import-summary {
    padding: 12px;
  }

  .company-order-row:nth-child(even),
  .summary-list div:nth-child(even) {
    padding: 9px 10px;
  }

  .company-order-head,
  .company-order-metrics {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .summary-action {
    padding: 11px 10px;
  }

  .summary-action span,
  .summary-list span {
    font-size: 11px;
  }

  .summary-action strong,
  .summary-list strong {
    font-size: 12px;
    line-height: 1.3;
  }

  .line-chart {
    height: 240px;
    padding: 8px 8px 12px;
  }

  .legend {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 8px 8px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table,
  .orders-table table,
  .compact-orders-table table {
    min-width: 760px;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .search-suggestions {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: 12px;
    left: 10px;
    max-height: min(360px, 62vh);
    overflow-y: auto;
  }

  .search-suggestions button {
    padding: 12px;
  }

  .login-shell {
    align-items: center;
    padding: 18px;
  }

  .login-panel {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .brand-title {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .brand-logo {
    width: 82px;
    max-width: 82px;
  }

  h1 {
    font-size: 20px;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }

  .orders-summary-strip,
  .order-age-ranges {
    grid-template-columns: 1fr;
  }
}
