:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --primary: #155e63;
  --primary-strong: #0e4549;
  --accent: #b56b16;
  --danger: #b42318;
  --ok-soft: #e7f4ee;
  --radius: 8px;
  --shadow: 0 14px 35px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
}

a:hover {
  text-decoration: underline;
}

code {
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #e8edf1;
}

.auth-panel {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-row,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle,
.muted,
.auth-note,
.topbar p,
.sidebar-brand small {
  color: var(--muted);
}

.auth-panel h1 {
  margin: 26px 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.auth-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.auth-tabs a:hover {
  text-decoration: none;
}

.auth-tabs a.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

label {
  font-weight: 700;
  color: #344054;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="file"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #c9d1dd;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="file"],
input[type="date"],
input[type="month"],
select {
  min-height: 42px;
}

input:focus {
  outline: 3px solid rgba(21, 94, 99, 0.18);
  border-color: var(--primary);
}

select:focus,
textarea:focus {
  outline: 3px solid rgba(21, 94, 99, 0.18);
  border-color: var(--primary);
}

.form-panel {
  margin-bottom: 14px;
}

.entity-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.entity-form label:not(.check-row) {
  display: block;
  margin-bottom: 6px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.entity-form .btn,
.entity-form .check-row {
  align-self: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #8f1d14;
}

.btn-block {
  width: 100%;
  margin-top: 10px;
}

.btn-small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
}

.btn-icon {
  width: 34px;
  min-width: 34px;
  padding: 5px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.inline-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 420px;
}

.inline-edit-form input[type="text"] {
  min-height: 34px;
  padding: 6px 8px;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions-cell form {
  margin: 0;
}

.company-ficha-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 16px;
}

.client-ficha-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}

.client-ficha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

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

.client-modal-open {
  overflow: hidden;
}

.client-modal[hidden] {
  display: none;
}

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

.client-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
}

.client-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 96vw);
  max-height: min(720px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.client-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

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

.client-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.client-group-form textarea {
  min-height: 72px;
}

.client-groups-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.client-group-description {
  margin: 0;
  padding: 14px 16px;
  color: var(--muted);
}

.client-group-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  color: var(--muted);
}

.client-group-summary strong {
  color: var(--text);
}

.client-assign-form {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.client-assign-form select {
  max-width: 420px;
}

.client-consolidation-assignment-form {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, .8fr) minmax(140px, .8fr) auto;
}

.user-conf-modal-dialog {
  width: min(1280px, 96vw);
}

.user-conf-modal-subtitle {
  margin: 4px 0 0;
}

.user-conf-resource-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
}

.user-conf-resource-tabs button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.user-conf-resource-tabs button.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.user-conf-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px 0;
}

.user-conf-transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.user-conf-transfer-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.user-conf-transfer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.user-conf-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.user-conf-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, .8fr);
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.user-conf-filters input,
.user-conf-filters select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.user-conf-filters select[hidden] {
  display: none;
}

.user-conf-table-wrap {
  max-height: 430px;
  min-height: 280px;
  overflow: auto;
}

.user-conf-mini-table {
  min-width: 680px;
  font-size: 13px;
}

.user-conf-mini-table th,
.user-conf-mini-table td {
  padding: 7px 8px;
  white-space: nowrap;
}

.user-conf-mini-table th:first-child,
.user-conf-mini-table td:first-child {
  width: 34px;
  text-align: center;
}

.user-conf-mini-table td:nth-child(3) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-conf-mini-table select {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 13px;
}

.user-conf-table-info {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.user-conf-actions {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.muted-path {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pgc-override-row td {
  background: #fbfcfd;
}

.pgc-override-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 0;
}

.pgc-override-form label {
  display: block;
  margin-bottom: 5px;
}

.pgc-override-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 9px 11px;
  border: 1px solid #c9d1dd;
  border-radius: var(--radius);
  font: inherit;
}

.pgc-override-reason {
  grid-column: span 2;
}

.pgc-override-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.pyg-adjustment-form {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1.4fr) 110px 140px 130px minmax(220px, 1.6fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.pyg-adjustment-form label {
  display: block;
  margin-bottom: 5px;
}

.pyg-adjustment-description {
  min-width: 0;
}

.pyg-adjustment-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.pyg-adjustment-edit-row td {
  background: #fbfcfd;
}

.pyg-category-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, .8fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.pyg-section-form {
  grid-template-columns: minmax(260px, 1fr) 160px auto;
}

.pyg-category-edit-form {
  grid-template-columns: minmax(260px, 1fr) minmax(220px, .8fr) 90px auto;
  flex: 1 1 auto;
  padding: 0;
  border-top: 0;
}

.pyg-section-edit-form {
  grid-template-columns: minmax(260px, 1fr) 90px 140px auto;
  flex: 1 1 auto;
  padding: 0;
  border-top: 0;
}

.pyg-category-form label {
  display: block;
  margin-bottom: 5px;
}

.pyg-config-list {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.pyg-config-section {
  border: 1px solid #cdd9e5;
  border-radius: var(--radius);
  background: #f8fafc;
}

.pyg-config-section-header {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #dbe5ef;
  background: #eef4f8;
}

.pyg-config-section-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.pyg-config-section-body[hidden],
.pyg-config-category-body[hidden] {
  display: none;
}

.pyg-config-toggle {
  flex: 0 0 auto;
  gap: 6px;
  white-space: nowrap;
}

.pyg-config-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  font-weight: 700;
}

.pyg-config-category {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.pyg-config-category-header {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.pyg-config-category-body {
  display: block;
}

.pyg-config-order-actions,
.pyg-account-move-form,
.pyg-account-assign-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pyg-account-move-form select {
  min-width: 260px;
}

.pyg-account-target-fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pyg-account-move-form .pyg-account-target-select {
  min-width: 210px;
}

.pyg-category-delete-form {
  padding: 0 12px 12px;
}

.pyg-category-modal-dialog {
  width: min(860px, 96vw);
}

.pyg-category-modal-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.pyg-category-modal-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.pyg-category-modal-list {
  display: grid;
  gap: 8px;
}

.pyg-category-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.pyg-category-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alert {
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.alert-error {
  color: var(--danger);
  background: #fff1f0;
  border-color: #fecdca;
}

.alert-success {
  color: #175b40;
  background: var(--ok-soft);
  border-color: #abdbc5;
}

.auth-note {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #202832;
  color: #ffffff;
  border-right: 1px solid #111820;
}

.sidebar-brand {
  color: #ffffff;
  padding: 6px 6px 18px;
}

.sidebar-brand:hover {
  text-decoration: none;
}

.sidebar-brand small {
  display: block;
  margin-top: 2px;
  color: #b7c0cd;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #d7dde6;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #303b48;
  color: #ffffff;
  text-decoration: none;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  margin: 3px 0 0;
}

.content {
  padding: 22px 24px 32px;
}

.notice-band,
.panel,
.stat-card,
.module-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.notice-band {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-color: #e9c46a;
  background: #fff8e8;
}

.notice-band span {
  display: block;
  margin-top: 4px;
  color: #62420e;
}

.stat-grid,
.module-grid,
.split-grid {
  display: grid;
  gap: 14px;
}

.stat-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.stat-card {
  padding: 15px;
  min-height: 92px;
}

.stat-card span {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 26px;
  line-height: 1;
}

.stat-card strong.is-negative {
  color: var(--danger);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.report-filter-form {
  display: grid;
  grid-template-columns: minmax(124px, .55fr) minmax(124px, .55fr) minmax(112px, .34fr) minmax(72px, .2fr) minmax(92px, .25fr) minmax(100px, .28fr) minmax(68px, .18fr) minmax(108px, .31fr) minmax(108px, .31fr) minmax(110px, .34fr) max-content;
  gap: 4px;
  align-items: end;
  margin-bottom: 14px;
}

.report-filter-form > div {
  min-width: 0;
}

.report-filter-form label,
.report-filter-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #344054;
}

.report-filter-form select,
.report-filter-form input[type="date"],
.report-filter-form input[type="month"] {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.report-filter-form select[multiple] {
  min-height: 92px;
}

.report-source-field {
  min-width: 0;
  max-width: none;
}

.report-source-field-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  margin-bottom: 4px;
}

.report-source-field-header .report-filter-label {
  margin-bottom: 0;
}

.report-source-field-header .btn {
  min-height: 28px;
  padding: 4px 8px;
  margin-left: auto;
}

.report-source-selected {
  width: 100%;
  height: 86px;
  padding: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #c9d1dd;
  border-radius: var(--radius);
  background: #ffffff;
}

.report-source-empty {
  margin: 0;
  padding: 8px 6px;
  color: var(--muted);
  font-size: 13px;
}

.report-source-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-bottom: 3px;
  padding: 3px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fbfcfd;
}

.report-source-selected-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.report-source-selected-row .btn {
  width: 24px;
  min-height: 24px;
  padding: 2px 0;
  font-size: 11px;
}

.report-source-selected-row .btn:disabled {
  opacity: .45;
  cursor: default;
}

.report-filter-form .report-source-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 2px;
  padding: 3px 5px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  cursor: pointer;
}

.report-filter-form .report-source-option:hover {
  background: #f3f6f8;
}

.report-filter-form .report-source-option input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

.report-filter-form .report-source-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-filter-form [hidden] {
  display: none;
}

.report-filter-actions {
  grid-column: -2 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  justify-self: end;
  min-width: 0;
}

.report-language-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 148px;
}

.report-language-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-weight: 700;
  font-size: 13px;
  color: #344054;
}

.report-language-picker {
  display: grid;
  grid-template-columns: repeat(6, 30px);
  gap: 4px;
}

.report-language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 1px solid #c9d1dd;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.report-language-option:hover,
.report-language-option.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21, 94, 99, .16);
}

.report-flag {
  display: block;
  position: relative;
  width: 22px;
  height: 15px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, .22);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}

.report-flag-es {
  background: linear-gradient(to bottom, #c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.report-flag-de {
  background: linear-gradient(to bottom, #000 0 33.333%, #dd0000 33.333% 66.666%, #ffce00 66.666% 100%);
}

.report-flag-nl {
  background: linear-gradient(to bottom, #ae1c28 0 33.333%, #fff 33.333% 66.666%, #21468b 66.666% 100%);
}

.report-flag-ru {
  background: linear-gradient(to bottom, #fff 0 33.333%, #1c57a7 33.333% 66.666%, #d52b1e 66.666% 100%);
}

.report-flag-zh {
  background: #de2910;
}

.report-flag-zh::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 7px;
  height: 7px;
  background: #ffde00;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
}

.report-flag-en {
  background:
    linear-gradient(146deg, transparent 0 42%, #fff 42% 48%, #c8102e 48% 52%, #fff 52% 58%, transparent 58% 100%),
    linear-gradient(34deg, transparent 0 42%, #fff 42% 48%, #c8102e 48% 52%, #fff 52% 58%, transparent 58% 100%),
    linear-gradient(to right, transparent 0 42%, #fff 42% 58%, transparent 58% 100%),
    linear-gradient(to bottom, transparent 0 38%, #fff 38% 62%, transparent 62% 100%),
    linear-gradient(to right, transparent 0 46%, #c8102e 46% 54%, transparent 54% 100%),
    linear-gradient(to bottom, transparent 0 43%, #c8102e 43% 57%, transparent 57% 100%),
    #012169;
}

.report-filter-actions .btn {
  width: auto;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.report-source-modal[hidden] {
  display: none;
}

.report-source-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.report-source-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
}

.report-source-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 96vw);
  max-height: min(720px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.report-source-modal-header,
.report-source-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

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

.report-source-modal-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 14px;
}

.report-source-modal-body input[type="search"] {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.report-source-modal-options {
  display: grid;
  gap: 4px;
  max-height: 420px;
  overflow: auto;
}

.report-source-modal-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  font-weight: 400;
  cursor: pointer;
}

.report-source-modal-option:hover {
  background: #f8fafc;
}

.report-source-modal-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-source-modal-option small {
  color: var(--muted);
  font-size: 12px;
}

.report-source-modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.report-panel {
  margin-bottom: 14px;
}

.report-section-row td {
  background: #eef4f4;
  color: var(--primary-strong);
  font-weight: 700;
}

.report-total-row td,
.report-grand-total-row td {
  font-weight: 700;
}

.report-total-row td {
  background: #fbfcfd;
}

.report-grand-total-row td {
  background: #f3f6f8;
  border-top: 2px solid var(--line);
}

.a3-report {
  background: #ffffff;
}

.a3-report-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 12px;
  border-bottom: 2px solid #1f2933;
}

.a3-report-header h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.a3-report-header p {
  margin: 3px 0;
  color: #344054;
}

.report-source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.report-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 4px 8px;
  border: 1px solid var(--source-border);
  border-radius: 999px;
  background: var(--source-bg);
  color: var(--source-fg);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.report-source-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--source-border);
}

.report-stats-overview {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, .9fr);
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.report-stats-block {
  min-width: 0;
}

.report-stats-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.report-line-chart {
  margin-bottom: 16px;
}

.report-line-chart svg {
  display: block;
  width: 100%;
  min-height: 220px;
}

.report-chart-grid {
  stroke: #e4e7ec;
  stroke-width: 1;
}

.report-chart-axis {
  stroke: #98a2b3;
  stroke-width: 1.4;
}

.report-chart-zero {
  stroke: #c9d1dd;
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.report-chart-line {
  fill: none;
  stroke: var(--chart-color);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-chart-line.is-total {
  stroke-width: 3.2;
}

.report-chart-point {
  fill: #ffffff;
  stroke: var(--chart-color);
  stroke-width: 2;
}

.report-chart-x-label,
.report-chart-y-label {
  fill: #667085;
  font-size: 11px;
}

.report-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}

.report-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.report-chart-legend i {
  width: 18px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--chart-color);
}

.report-chart-empty {
  padding: 16px;
  border: 1px dashed #c9d1dd;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.report-stats-bars {
  display: grid;
  gap: 8px;
}

.report-stats-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(140px, 1fr) minmax(96px, auto);
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
}

.report-stats-bar-row > span {
  color: #344054;
  font-weight: 700;
}

.report-stats-bar-row strong {
  text-align: right;
}

.report-stats-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f4;
}

.report-stats-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.report-stats-bar.is-positive {
  background: #177245;
}

.report-stats-bar.is-negative {
  background: #b42318;
}

.report-stats-small-table {
  max-height: 260px;
}

.report-stats-small-table .a3-table {
  font-size: 13px;
}

.report-stats-small-table th:first-child,
.report-stats-small-table td:first-child {
  min-width: 82px;
}

.report-stats-source {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.report-stats-table-wrap {
  margin: 16px 18px;
}

.report-stats-subtitle {
  margin: 0 0 10px;
  font-size: 16px;
}

.report-stats-table th:first-child,
.report-stats-table td:first-child {
  min-width: 220px;
}

.report-category-table {
  font-size: 13px;
}

.report-category-table th:first-child,
.report-category-table td:first-child {
  min-width: 260px;
  max-width: 420px;
}

.report-category-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-category-table th:nth-child(2),
.report-category-table td:nth-child(2) {
  min-width: 100px;
}

.report-category-table .num {
  min-width: 96px;
}

.report-stats-delta-row td,
.report-stats-percent-row td {
  background: #fbfcfd;
  font-weight: 700;
}

.a3-balance-part {
  margin-top: 24px;
}

.a3-balance-grid {
  gap: 18px;
  padding: 0;
}

.a3-balance-grid .table-wrap {
  min-width: 0;
}

.a3-table {
  font-size: 13px;
}

.a3-period-table th:first-child,
.a3-period-table td:first-child {
  min-width: 260px;
}

.a3-period-table .num {
  min-width: 82px;
}

.a3-period-table .a3-period-group {
  text-align: center;
}

.a3-period-table .a3-source-column {
  min-width: 110px;
  white-space: normal;
}

.a3-period-table .a3-source-column .report-source-badge {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.a3-amount-drill {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: right;
}

.a3-amount-drill:hover,
.a3-amount-drill:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.a3-table th {
  background: #ffffff;
  border-bottom: 2px solid #1f2933;
  color: #17202a;
  font-size: 13px;
  text-transform: none;
}

.a3-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #eef1f4;
}

.a3-heading-row td {
  background: #ffffff;
  font-weight: 700;
}

.a3-heading-row.is-collapsed td {
  background: #fbfcfd;
}

.a3-row-toggle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0 8px 0 0;
  padding: 0;
  border: 1px solid #cdd5df;
  border-radius: 4px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.a3-row-toggle:hover,
.a3-row-toggle:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.a3-heading-label {
  vertical-align: middle;
}

.a3-heading-row.level-1 td {
  padding-top: 14px;
  border-top: 1px solid #9aa4b2;
}

.a3-heading-row.level-2 td:first-child {
  padding-left: 24px;
}

.a3-heading-row.level-3 td:first-child {
  padding-left: 40px;
  font-weight: 600;
}

.a3-heading-row.level-4 td:first-child,
.a3-heading-row.level-5 td:first-child {
  padding-left: 56px;
  font-weight: 600;
}

.a3-account-row td {
  color: #344054;
}

.a3-account-row.is-manual-adjustment td {
  background: #e8f3ff;
  border-bottom-color: #c8ddf3;
}

.a3-account-row.is-manual-adjustment .a3-account-code,
.a3-account-row.is-manual-adjustment .a3-account-name {
  color: #1f4f78;
}

.a3-account-row td:first-child {
  padding-left: 72px;
}

.a3-account-row.level-2 td:first-child {
  padding-left: 48px;
}

.a3-account-row.level-3 td:first-child {
  padding-left: 64px;
}

.a3-account-row.level-4 td:first-child,
.a3-account-row.level-5 td:first-child {
  padding-left: 80px;
}

.a3-account-row .a3-account-cell {
  white-space: nowrap;
}

.a3-account-row .a3-account-code {
  display: inline-block;
  min-width: 84px;
  color: #17202a;
  font-weight: 700;
}

.a3-account-row .a3-account-name {
  display: inline-block;
  max-width: clamp(130px, 30vw, 460px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.a3-account-row .a3-account-cell.no-code .a3-account-name {
  max-width: clamp(180px, 34vw, 540px);
}

.a3-balance-grid .a3-account-row .a3-account-name {
  max-width: clamp(120px, 18vw, 320px);
}

.a3-result-row td {
  padding-top: 10px;
  border-top: 2px solid #1f2933;
  background: #fbfcfd;
  font-weight: 700;
}

.a3-result-row.final td {
  background: #eef4f4;
}

.report-modal-open {
  overflow: hidden;
}

.report-movements-modal[hidden] {
  display: none;
}

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

.report-movements-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
}

.report-movements-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 96vw);
  max-height: min(760px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.report-movements-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.report-movements-header h2 {
  margin: 0;
  font-size: 18px;
}

.report-movements-header p,
.report-movements-status {
  margin: 6px 0 0;
  color: var(--muted);
}

.report-movements-status {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.report-movements-table-wrap {
  max-height: 610px;
}

.report-movements-table {
  font-size: 13px;
}

.report-movements-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.report-movements-table td:nth-child(4),
.report-movements-table td:nth-child(5) {
  min-width: 220px;
}

.module-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  margin-bottom: 14px;
}

.module-tile {
  display: block;
  min-height: 82px;
  padding: 15px;
  color: var(--text);
}

.module-tile:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.module-tile span {
  display: block;
  font-weight: 700;
  font-size: 17px;
}

.module-tile small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

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

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar input {
  max-width: 520px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  background: #fbfcfd;
  font-size: 13px;
  text-transform: uppercase;
}

td {
  line-height: 1.35;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.num.is-negative,
.num.is-negative .a3-amount-drill {
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: #175b40;
  font-size: 13px;
  font-weight: 700;
}

.pgc-level-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
}

.app-embed-shell {
  min-height: 100vh;
  background: #f6f8fb;
}

.embed-content {
  padding: 16px;
}

.menu-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #eef1f4;
}

.menu-shell.menu-sidebar-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.menu-shell.menu-sidebar-hidden .menu-sidebar {
  display: none;
}

.menu-shell.menu-sidebar-hidden .menu-workspace {
  grid-column: 1;
}

.menu-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 14px 12px;
  background: #f8f9fb;
  border-right: 1px solid var(--line);
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 16px;
  color: var(--text);
}

.menu-brand:hover {
  text-decoration: none;
}

.menu-brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.menu-sidebar-heading {
  margin: 6px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-sidebar-nav {
  display: grid;
  gap: 4px;
}

.menu-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: #384250;
  font-weight: 700;
}

.menu-sidebar-nav a:hover {
  background: #eef4f4;
  color: var(--primary-strong);
  text-decoration: none;
}

.menu-nav-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 6px;
  background: #e1e8ee;
  color: var(--primary-strong);
  font-size: 12px;
}

.menu-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.menu-topbar h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.menu-topbar p {
  margin: 3px 0 0;
  color: var(--muted);
}

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

.menu-layout-actions .btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.menu-alert-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid #ead99c;
  background: #fff8e8;
  color: #62420e;
}

.menu-alert-strip span {
  color: #806124;
}

.menu-editor-shell {
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: #1f242b;
}

.menu-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-top: 2px solid transparent;
}

.menu-pane.active {
  border-top-color: var(--accent);
}

.menu-pane.drop-hover {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.menu-pane-secondary {
  border-left: 1px solid #313842;
}

.menu-pane.is-hidden,
.menu-pane-resizer.is-hidden,
.menu-home.is-hidden {
  display: none;
}

.menu-pane-resizer {
  width: 5px;
  flex: 0 0 5px;
  cursor: col-resize;
  background: #313842;
}

.menu-pane-resizer:hover,
body.is-resizing-menu-pane .menu-pane-resizer {
  background: #56616f;
}

.menu-tabbar {
  min-height: 39px;
  display: flex;
  align-items: end;
  gap: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #242b33;
  border-bottom: 1px solid #313842;
}

.menu-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-right: 1px solid #313842;
  background: #2a313a;
  color: #cfd6df;
  cursor: pointer;
  font: inherit;
}

.menu-tab.active {
  background: #ffffff;
  color: var(--text);
}

.menu-tab.is-dragging {
  opacity: .45;
}

.menu-tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-tab-close {
  color: inherit;
  opacity: .72;
  font-size: 18px;
  line-height: 1;
}

.menu-tab-close:hover {
  opacity: 1;
}

.menu-pane-content {
  min-height: 0;
  overflow: auto;
  position: relative;
  background: #f6f8fb;
}

.menu-frame-wrap {
  display: none;
  position: absolute;
  inset: 0;
  background: #ffffff;
}

.menu-frame-wrap.active {
  display: block;
}

.menu-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.menu-drop-zone {
  display: none;
  position: absolute;
  inset: 39px 0 0;
  z-index: 20;
  place-items: center;
  padding: 18px;
  background: rgba(21, 94, 99, .10);
  border: 2px dashed rgba(21, 94, 99, .55);
  color: var(--primary-strong);
  font-weight: 700;
  pointer-events: auto;
}

.menu-drop-zone span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
}

body.is-dragging-menu-tab .menu-pane:not(.is-hidden) .menu-drop-zone {
  display: grid;
}

.menu-home {
  padding: 16px;
}

.menu-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.menu-stat-card,
.menu-card-panel,
.menu-module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.menu-stat-card {
  min-height: 78px;
  padding: 13px;
}

.menu-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.menu-stat-card strong {
  display: block;
  margin-top: 9px;
  font-size: 24px;
  line-height: 1;
}

.menu-card-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.menu-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.menu-section-header h2 {
  margin: 0;
  font-size: 16px;
}

.menu-section-header span {
  color: var(--muted);
}

.menu-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
}

.menu-module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 12px;
  color: #344054;
  background: #fff8e8;
  border-color: #f1d99a;
}

.menu-module-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.menu-card-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--primary-strong);
  border: 1px solid #f1d99a;
  font-weight: 700;
}

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

.menu-module-card small {
  margin-top: 5px;
  color: #6b5a36;
  line-height: 1.25;
}

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

.menu-empty-pane {
  display: grid;
  place-items: center;
  color: #cfd6df;
  background: #1f242b;
}

.menu-empty-pane div {
  display: grid;
  gap: 6px;
  text-align: center;
}

.menu-empty-pane span {
  color: #9aa6b2;
}

@media (max-width: 1120px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .report-summary {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

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

  .report-filter-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .report-stats-overview {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

  .menu-stat-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .menu-card-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .menu-home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .auth-page {
    padding: 16px;
  }

  .auth-panel {
    padding: 22px;
  }

  .auth-panel h1 {
    font-size: 26px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    min-height: 100svh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    padding: 10px 12px 12px;
    border-right: 0;
    border-bottom: 1px solid #111820;
  }

  .sidebar-brand {
    padding: 0 0 10px;
  }

  .sidebar-nav {
    display: flex;
    gap: 8px;
    margin-top: 0;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .sidebar-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 14px 16px;
  }

  .topbar h1 {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .topbar .btn {
    width: 100%;
  }

  .a3-report-header {
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .btn {
    min-height: 42px;
  }

  .btn-small {
    min-height: 38px;
  }

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

  .panel-header .btn,
  .panel-header a.btn {
    width: 100%;
  }

  .inline-edit-form {
    grid-template-columns: 1fr;
    min-width: 0;
    align-items: stretch;
  }

  .inline-edit-form .btn {
    width: 100%;
  }

  .actions-cell {
    align-items: stretch;
    flex-direction: column;
  }

  .actions-cell .btn,
  .actions-cell button {
    width: 100%;
  }

  .stat-grid,
  .report-summary,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .report-filter-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .report-filter-actions {
    align-items: stretch;
    justify-self: stretch;
  }

  .report-language-control {
    align-items: stretch;
    width: 100%;
  }

  .report-language-label {
    justify-content: flex-start;
  }

  .report-language-picker {
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .report-filter-actions .btn {
    width: 100%;
    min-height: 38px;
  }

  .report-source-selected {
    height: auto;
    min-height: 62px;
    max-height: 140px;
  }

  .report-source-selected-row {
    grid-template-columns: minmax(0, 1fr) repeat(3, 28px);
  }

  .report-source-selected-row .btn {
    width: 28px;
    min-height: 28px;
  }

  .report-source-modal {
    padding: 10px;
  }

  .report-source-modal-dialog,
  .client-modal-dialog,
  .report-movements-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px);
    border-radius: var(--radius);
  }

  .report-source-modal-header,
  .report-source-modal-actions,
  .client-modal-header,
  .report-movements-header {
    align-items: stretch;
    flex-direction: column;
  }

  .report-source-modal-actions .btn,
  .client-modal-actions .btn,
  .report-movements-header .btn {
    width: 100%;
  }

  .report-source-modal-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .report-source-modal-option small {
    grid-column: 2;
  }

  .report-movements-modal,
  .client-modal {
    padding: 10px;
  }

  .report-movements-table-wrap {
    max-height: none;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input {
    max-width: none;
  }

  .company-ficha-meta,
  .client-ficha-meta {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

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

  .client-ficha-actions {
    width: 100%;
    margin-left: 0;
  }

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

  .client-modal {
    padding: 14px;
  }

  .client-modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

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

  .user-conf-transfer-grid,
  .user-conf-filters {
    grid-template-columns: 1fr;
  }

  .user-conf-transfer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-conf-panel-actions {
    justify-content: flex-start;
  }

  .form-wide {
    grid-column: span 1;
  }

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

  .pgc-override-reason {
    grid-column: span 1;
  }

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

  .pyg-category-form,
  .pyg-category-edit-form,
  .pyg-section-form,
  .pyg-section-edit-form,
  .pyg-category-modal-form {
    grid-template-columns: 1fr;
  }

  .pyg-config-category-header,
  .pyg-config-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .pyg-category-modal-row {
    align-items: stretch;
    flex-direction: column;
  }

  .pyg-account-move-form select {
    min-width: 0;
    width: 100%;
  }

  .table-wrap {
    width: 100%;
  }

  th,
  td {
    padding: 8px 9px;
  }

  .a3-report-header {
    padding: 14px;
  }

  .report-source-badge {
    max-width: 100%;
  }

  .report-stats-overview {
    padding: 14px;
  }

  .report-stats-table-wrap {
    margin: 14px;
  }

  .report-stats-bar-row {
    grid-template-columns: 1fr auto;
  }

  .report-stats-bar-track {
    grid-column: 1 / -1;
  }

  .report-category-table th:first-child,
  .report-category-table td:first-child,
  .a3-period-table th:first-child,
  .a3-period-table td:first-child {
    min-width: 220px;
  }

  .a3-table {
    font-size: 12px;
  }

  .a3-table td {
    padding: 5px 8px;
  }

  .a3-heading-row.level-2 td:first-child {
    padding-left: 18px;
  }

  .a3-heading-row.level-3 td:first-child {
    padding-left: 28px;
  }

  .a3-heading-row.level-4 td:first-child,
  .a3-heading-row.level-5 td:first-child {
    padding-left: 38px;
  }

  .a3-account-row td:first-child,
  .a3-account-row.level-2 td:first-child {
    padding-left: 28px;
  }

  .a3-account-row.level-3 td:first-child {
    padding-left: 38px;
  }

  .a3-account-row.level-4 td:first-child,
  .a3-account-row.level-5 td:first-child {
    padding-left: 48px;
  }

  .a3-account-row .a3-account-cell {
    white-space: normal;
  }

  .a3-account-row .a3-account-code {
    min-width: 58px;
    margin-right: 6px;
  }

  .a3-account-row .a3-account-name,
  .a3-account-row .a3-account-cell.no-code .a3-account-name,
  .a3-balance-grid .a3-account-row .a3-account-name {
    max-width: none;
    overflow: visible;
    white-space: normal;
  }

  .menu-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    overflow: auto;
  }

  .menu-sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    max-height: none;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .menu-brand {
    padding: 0 0 10px;
  }

  .menu-sidebar-heading {
    display: none;
  }

  .menu-sidebar-nav {
    display: flex;
    gap: 8px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .menu-sidebar-nav a {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
  }

  .menu-workspace {
    min-height: 0;
  }

  .menu-topbar,
  .menu-alert-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-layout-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .menu-layout-actions .btn {
    width: 100%;
  }

  .menu-alert-strip {
    padding: 10px 14px;
  }

  .menu-alert-strip span {
    font-size: 13px;
  }

  .menu-editor-shell {
    flex-direction: column;
    min-height: 70vh;
    min-height: 70svh;
  }

  .menu-pane {
    flex: 0 0 auto;
    min-height: 66vh;
    min-height: 66svh;
  }

  .menu-pane-resizer {
    display: none;
  }

  .menu-pane-secondary {
    border-left: 0;
    border-top: 1px solid #313842;
  }

  .menu-stat-grid,
  .menu-card-grid {
    grid-template-columns: 1fr;
  }

  .menu-home {
    padding: 12px;
  }

  .menu-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-tab {
    max-width: min(62vw, 220px);
  }
}

@media (max-width: 520px) {
  .content,
  .embed-content {
    padding: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .sidebar,
  .menu-sidebar {
    padding: 9px 10px;
  }

  .sidebar-brand,
  .menu-brand {
    gap: 10px;
  }

  .topbar,
  .menu-topbar {
    padding: 12px;
  }

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

  .notice-band,
  .stat-card,
  .module-tile,
  .menu-stat-card,
  .menu-module-card {
    padding: 12px;
  }

  .stat-card strong,
  .menu-stat-card strong {
    font-size: 22px;
  }

  .report-stats-overview,
  .report-stats-table-wrap {
    margin: 0;
    padding: 12px;
  }

  .report-stats-bar-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .report-stats-bar-row strong {
    text-align: left;
  }

  .report-category-table th:first-child,
  .report-category-table td:first-child,
  .a3-period-table th:first-child,
  .a3-period-table td:first-child {
    min-width: 190px;
  }

  .a3-period-table .num,
  .a3-period-table .a3-source-column {
    min-width: 92px;
  }

  .a3-row-toggle {
    width: 26px;
    height: 26px;
  }

  .report-movements-header,
  .client-modal-header,
  .report-source-modal-header {
    padding: 12px;
  }

  .report-source-modal-body,
  .pyg-category-modal-body {
    padding: 12px;
  }
}
