:root {
  --ink: #17212b;
  --muted: #627180;
  --line: #d8e0e7;
  --panel: #ffffff;
  --page: #f4f7f8;
  --nav: #17324d;
  --nav-2: #24445f;
  --gold: #d9a441;
  --green: #19735b;
  --green-soft: #e3f4ed;
  --red: #b64032;
  --red-soft: #f9e5e2;
  --blue-soft: #e7f1f7;
  --shadow: 0 18px 50px rgba(19, 38, 55, 0.12);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  background: var(--nav);
  color: #eef5f8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  overflow: hidden;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
}

.brand-mark,
.work-icon,
.company-icon,
.entity-photo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 800;
}

.brand-mark {
  width: 44px;
  height: 44px;
  background: var(--gold);
  color: #182533;
}

.brand-block span,
.profile-card label,
.eyebrow,
.meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-block span {
  color: #b8c8d5;
  display: block;
  margin-top: 2px;
}

.profile-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
}

.profile-card label {
  color: #bfd1dc;
  display: block;
  margin-bottom: 8px;
}

.profile-card select {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  background: var(--nav-2);
  padding: 10px;
}

.login-preview-link {
  width: 100%;
  margin-top: 10px;
  padding: 8px 0 2px;
  background: transparent;
  color: #f0c05a;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
}

.login-preview-link:hover {
  color: #fff;
}

.quick-launch-button {
  width: 100%;
  min-height: 46px;
  border-radius: 6px;
  background: #e5ad36;
  color: #13283d;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.quick-launch-button:hover,
.quick-launch-button.active {
  background: #f2bf52;
  color: #0f2338;
}

.quick-launch-button[hidden] {
  display: none;
}

.nav-menu {
  display: grid;
  gap: 6px;
  max-width: 100%;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #dce9f0;
  background: transparent;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-weight: 800;
}

.main-panel {
  min-width: 0;
  padding: 24px clamp(16px, 3vw, 34px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 2.5vw, 2.1rem);
  line-height: 1.15;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.topbar-refresh {
  min-height: 34px;
  padding: 8px 12px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-weight: 800;
  color: #506171;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.sync-pill.offline {
  background: var(--red-soft);
  color: var(--red);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.view-root {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.panel,
.metric,
.work-card,
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel,
.form-panel {
  padding: 18px;
}

.metric {
  padding: 16px;
  min-width: 0;
  overflow: hidden;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 6vw, 1.45rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.reimbursement-highlight strong,
.reimbursement-value {
  color: var(--red) !important;
  font-weight: 900 !important;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
}

.subsection-title {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.subsection-title h3 {
  margin: 0;
  font-size: 0.95rem;
}

.confirmation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(15 33 48 / 58%);
}

.confirmation-dialog {
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 20px 55px rgb(15 33 48 / 28%);
}

.confirmation-dialog > label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.confirmation-dialog textarea {
  min-height: 82px;
  resize: vertical;
}

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

.confirmation-summary span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  overflow-wrap: anywhere;
}

.confirmation-summary b {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

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

.confirmation-attachment p {
  margin: 2px 0 0;
}

.confirmation-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 560px) {
  .confirmation-backdrop {
    align-items: end;
    padding: 8px;
  }

  .confirmation-dialog {
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }

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

  .confirmation-actions .btn {
    flex: 1 1 100%;
  }
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.helper-text {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-action-row .btn {
  flex: 1 1 180px;
}

.approval-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  padding: 10px 13px;
  background: var(--nav);
  color: #fff;
  font-weight: 800;
}

.btn.secondary {
  background: #e8eef2;
  color: var(--ink);
}

.btn.success {
  background: var(--green);
}

.btn.danger {
  background: var(--red);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.work-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.work-icon,
.company-icon,
.entity-photo {
  width: 46px;
  height: 46px;
  color: #fff;
}

.entity-photo {
  display: block;
  object-fit: cover;
  background: var(--nav);
}

.work-icon.house {
  background: #5c7f71;
}

.work-icon.store {
  background: #8b6650;
}

.work-icon.solar {
  background: #bb8a2f;
}

.company-icon {
  background: var(--nav);
  position: relative;
  overflow: hidden;
}

.company-identity-icon > span {
  position: relative;
  z-index: 0;
}

.company-identity-icon > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.company-icon.compact {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.company-identity,
.company-selection-preview,
.company-icon-current {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.company-selection-preview {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.company-icon-current {
  justify-content: space-between;
  flex-wrap: wrap;
}

.report-company-identity {
  color: inherit;
}

.work-card h3,
.item-main strong {
  margin: 0;
  font-size: 0.98rem;
}

.work-card p,
.item-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.operational-summary-grid .metric:nth-child(4) {
  border-top: 4px solid var(--gold);
}

.operational-summary-grid .metric:nth-child(4) strong {
  color: var(--nav);
}

.operational-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.operational-filter-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.operational-filter-form select,
.operational-filter-form input {
  width: 100%;
}

.operational-filter-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
}

.operational-period-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.operational-period-presets > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.operational-period-presets .btn.active {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--nav);
}

.operational-dashboard-launches {
  margin-top: 4px;
}

.operational-work-list {
  display: grid;
  gap: 12px;
}

.operational-company-list {
  display: grid;
  gap: 18px;
}

.operational-company-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.operational-company-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.4fr);
  align-items: center;
  gap: 18px;
  padding: 16px;
  background: var(--nav);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}

.operational-company-header small {
  display: block;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
}

.operational-company-header h3 {
  margin: 3px 0;
  font-size: 1.05rem;
}

.operational-company-header > div > span {
  color: #d9e3ec;
  font-size: 0.78rem;
}

.operational-company-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.operational-company-totals span {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.operational-company-totals b {
  color: #bfcdda;
  font-size: 0.68rem;
}

.operational-company-totals .operational-balance {
  color: var(--red);
  font-weight: 900;
}

.operational-company-block > .operational-work-list {
  padding: 12px;
  background: var(--soft);
}

.operational-work-summary {
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.operational-work-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.operational-work-header .work-icon {
  background: var(--nav);
}

.operational-work-identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.operational-work-identity small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.operational-work-identity strong {
  overflow-wrap: anywhere;
}

.operational-work-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.operational-work-values span {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--nav);
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.operational-work-values b {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.operational-work-values .operational-balance {
  color: var(--red);
}

.operational-work-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.operational-pending-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: var(--panel);
}

.operational-pending-item > div {
  display: grid;
  gap: 4px;
}

.operational-pending-item > div:last-child {
  justify-items: end;
}

.operational-pending-item span:not(.badge) {
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--blue-soft);
  color: #24587b;
  white-space: nowrap;
}

.badge.warn {
  background: var(--red-soft);
  color: var(--red);
}

.badge.ok {
  background: var(--green-soft);
  color: var(--green);
}

.approval-status-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.approval-reason {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #4b5c6b;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.password-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.password-visibility-button {
  min-width: 82px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--nav);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-diagnostic-id {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  font-weight: 700;
}

.fixed-field-value {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7f8;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 700;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.field-hint.error {
  color: var(--red);
  font-weight: 700;
}

.field textarea {
  resize: vertical;
  min-height: 86px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  color: #4b5c6b;
  font-size: 0.82rem;
  font-weight: 800;
}

.filter-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
}

.report-stage-filter {
  grid-column: span 2;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 12px 12px;
}

.report-stage-filter legend {
  padding: 0 5px;
  color: #4b5c6b;
  font-size: 0.82rem;
  font-weight: 800;
}

.report-stage-filter:disabled {
  background: #f4f7f9;
}

.report-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.filter-grid .report-stage-select-all,
.filter-grid .report-stage-option {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.report-stage-select-all input,
.report-stage-option input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--nav);
  flex: 0 0 auto;
}

.report-stage-clear {
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: var(--nav);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.report-stage-clear:disabled {
  color: #8a98a5;
  cursor: default;
}

.report-stage-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  max-height: 184px;
  overflow-y: auto;
  padding: 10px 4px 4px 0;
}

.report-stage-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-stage-empty,
.report-stage-count {
  color: #657583;
  font-size: 0.78rem;
  font-weight: 600;
}

.report-stage-empty {
  padding: 8px 0 4px;
}

.report-stage-count {
  padding-top: 8px;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-box {
  display: grid;
  place-items: center;
  gap: 4px;
  width: 100%;
  min-height: 112px;
  border: 1px dashed #9aabb7;
  border-radius: 8px;
  background: #f7fafb;
  color: #526678;
  text-align: center;
  padding: 14px;
  cursor: pointer;
}

.upload-box:hover,
.upload-box:focus-visible {
  border-color: var(--nav-2);
  background: #eef5f8;
  outline: 2px solid rgba(36, 68, 95, 0.2);
  outline-offset: 2px;
}

.upload-box:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  border-style: solid;
}

.upload-box strong {
  color: var(--ink);
}

.upload-box span {
  font-size: 0.82rem;
}

.file-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.attachment-picker-actions {
  display: flex;
  justify-content: flex-start;
  margin: 8px 0 10px;
}

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

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

.payment-proof-counter {
  margin: 10px 0 4px;
  padding: 8px 10px;
  border: 1px solid #d6e0e8;
  border-radius: 6px;
  background: #f8fbfd;
}

.document-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.payment-dossier-item {
  border: 1px solid #d6e0e8;
  border-radius: 6px;
  padding: 12px;
}

.compact-title {
  margin-bottom: 8px;
}

@media (max-width: 520px) {
  .document-toolbar {
    grid-template-columns: 1fr;
  }

  .payment-dossier-item .section-title {
    align-items: stretch;
    flex-direction: column;
  }
}

.form-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fbfd;
  color: var(--muted);
  font-weight: 800;
}

.form-status.ok {
  border-color: #93c5ad;
  background: #eef8f2;
  color: #17623c;
}

.form-status.warn {
  border-color: #f0c36b;
  background: #fff8e6;
  color: #845600;
}

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

.attachment-item strong,
.attachment-item p {
  overflow-wrap: anywhere;
}

.attachment-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.attachment-item.compact {
  padding: 8px 10px;
}

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

.attachment-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.text-link {
  color: var(--nav);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.stage-tools {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1.3fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.stage-tools > .stage-form {
  grid-column: 1 / -1;
}

.stage-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px auto auto auto;
  gap: 10px;
  align-items: end;
}

.stage-form .field,
.stage-tools .field {
  min-width: 0;
}

.stage-form button {
  align-self: end;
  min-height: 48px;
}

.stage-item .action-row {
  justify-content: flex-end;
}

.work-stage-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.work-stage-options {
  display: grid;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-access-company-group + .work-access-company-group {
  border-top: 3px solid var(--line);
}

.work-access-company-name {
  display: block;
  padding: 10px 12px;
  background: #f4f8fb;
  color: var(--nav);
}

.work-stage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.work-stage-choice {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.work-stage-check {
  width: 20px;
  height: 20px;
  accent-color: var(--nav);
}

.stage-order {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8eff5;
  color: var(--nav);
  font-weight: 900;
}

.work-stage-label {
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}

.custom-stage-input {
  min-height: 40px;
}

.compact-btn {
  min-height: 38px;
  padding: 8px 12px;
}

.stage-create-option {
  width: 100%;
  min-height: 50px;
  border: 0;
  background: #f4f8fb;
  color: var(--nav);
  font: inherit;
  font-weight: 900;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

.stage-create-option:hover {
  background: #e8eff5;
}

.empty-state {
  min-height: 70px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f7fafb;
  border: 1px dashed #b8c5ce;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.empty-state.compact {
  min-height: 44px;
  padding: 10px;
}

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

.admin-tabs .danger-tab {
  color: #9d3329;
}

.admin-tabs .danger-tab.active {
  color: #fff;
  background: #9d3329;
}

.deletion-intro {
  border-top: 4px solid var(--gold);
}

.archive-view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 8px;
  margin-top: 14px;
}

.archive-view-option {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--nav);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.archive-view-option span {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 26px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #edf3f6;
  color: #4b5c6b;
  font-size: 0.76rem;
}

.archive-view-option.active {
  border-color: var(--nav);
  background: var(--nav);
  color: #fff;
}

.archive-view-option.active span {
  background: var(--gold);
  color: var(--nav);
}

.archive-state-message {
  margin: 12px 0;
  padding: 11px 12px;
  border-left: 4px solid var(--gold);
  background: #f7fafb;
  color: #4b5c6b;
  font-size: 0.82rem;
  font-weight: 700;
}

.deletion-flow-note {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.deletion-flow-note span {
  min-width: 0;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
  color: #4b5c6b;
  font-size: 0.78rem;
  font-weight: 800;
}

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

.deletion-entity-group {
  min-width: 0;
}

.compact-title {
  margin-bottom: 8px;
}

.compact-title h3 {
  margin: 0;
  color: var(--nav);
  font-size: 1rem;
}

.deletion-entity-item {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.deletion-entity-item .btn {
  width: 100%;
}

.deletion-entity-item strong,
.deletion-entity-item p {
  overflow-wrap: anywhere;
}

.deletion-impact-panel {
  border-top: 4px solid #9d3329;
}

.deletion-financial-summary .metric:nth-child(2) strong,
.deletion-financial-summary .metric:nth-child(3) strong {
  color: #9d3329;
}

.deletion-blockers {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #e6aaa4;
  border-radius: 8px;
  background: #fff1ef;
  color: #8d2e25;
}

.deletion-blockers p {
  margin: 5px 0 0;
}

.deletion-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.deletion-relations span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
  color: #4b5c6b;
  font-size: 0.8rem;
}

.deletion-launch-table {
  margin: 14px 0;
}

.deletion-launch-table table {
  min-width: 880px;
}

.deletion-destinations {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.deletion-destinations h3 {
  margin: 0 0 10px;
  color: var(--nav);
  font-size: 0.95rem;
}

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

.deletion-destination-grid span {
  padding: 9px 10px;
  border-left: 4px solid var(--gold);
  background: #fff;
  color: #4b5c6b;
  font-size: 0.82rem;
  font-weight: 700;
}

.deletion-adjustment-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fff;
}

.deletion-adjustment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--nav);
}

.deletion-adjustment-heading span {
  color: var(--red);
  font-size: 1.1rem;
  font-weight: 900;
}

.deletion-adjustment-history {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.deletion-adjustment-history h3 {
  margin: 0;
  color: var(--nav);
  font-size: 0.95rem;
}

.excluded-account-panel {
  border-top: 4px solid var(--nav);
}

.archive-filters {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #f7fafb;
}

.archive-filter-actions {
  align-items: center;
  justify-content: space-between;
}

.archive-filter-actions span {
  color: #4b5c6b;
  font-size: 0.8rem;
  font-weight: 700;
}

.archive-history-list {
  margin-top: 14px;
}

.excluded-archive-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  border-left: 4px solid var(--gold);
}

.archive-value-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
}

.archive-value-line > span:not(.badge) {
  color: #4b5c6b;
  font-size: 0.82rem;
}

.archive-value-line b {
  color: var(--nav);
}

.archive-history-details {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.archive-history-details p {
  margin: 0;
}

.archive-balance-row {
  display: grid;
  grid-template-columns: 90px repeat(3, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.excluded-archive-item .item-actions {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.operational-login-panel {
  max-width: 820px;
}

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

.operational-user-option {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.operational-user-option:has(input:checked) {
  border-color: var(--nav);
  box-shadow: 0 0 0 2px rgba(23, 50, 77, 0.12);
}

.operational-user-option.disabled {
  background: #f5f7f8;
  color: var(--muted);
  cursor: not-allowed;
}

.operational-user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--nav);
  color: #fff;
  font-weight: 900;
}

.operational-user-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.operational-user-details span {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.operational-login-actions {
  margin-top: 14px;
}

.consultation-context-panel {
  border-top: 4px solid var(--gold);
}

.delegated-access-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.delegated-access-line span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.delegated-access-line b {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.consultation-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.consultation-company-field {
  width: min(520px, 100%);
}

.consultation-work-card {
  border-left: 4px solid var(--gold);
}

.app-shell.login-preview-mode {
  display: block;
}

.app-shell.login-preview-mode .sidebar,
.app-shell.login-preview-mode .topbar {
  display: none;
}

.app-shell.login-preview-mode .main-panel {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

.app-shell.login-preview-mode .view-root {
  min-height: 100vh;
  min-height: 100dvh;
}

.login-preview-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(30px, 7vw, 100px);
  padding: clamp(24px, 7vw, 90px);
  background: var(--nav);
}

.login-preview-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fff;
}

.login-preview-brand img {
  width: 84px;
  height: 84px;
  padding: 10px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.login-preview-brand div {
  display: grid;
  gap: 7px;
}

.login-preview-brand strong {
  font-size: clamp(1.65rem, 4vw, 3rem);
}

.login-preview-brand span {
  color: #c7d6e0;
  line-height: 1.5;
}

.login-preview-card {
  width: min(100%, 520px);
  justify-self: end;
  padding: clamp(24px, 4vw, 42px);
  border-top: 6px solid var(--gold);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-preview-card h1 {
  margin: 4px 0 8px;
  color: var(--nav);
  font-size: 2rem;
}

.login-preview-card form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-preview-card > .form-status {
  margin-top: 16px;
}

.app-shell.authenticated-session .profile-card {
  display: none;
}

.login-preview-submit,
.login-preview-back {
  width: 100%;
}

.login-future-link {
  justify-self: start;
  min-height: 44px;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.login-preview-back {
  margin-top: 14px;
}

.data-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid #ecf0f3;
  min-width: 0;
  overflow: hidden;
}

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

.report-item {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.report-main {
  min-width: 0;
}

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

.report-heading strong {
  font-size: 1rem;
}

.report-meta,
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.report-meta span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.report-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.report-fields span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid #ecf0f3;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbfd;
  color: var(--ink);
  font-size: 0.86rem;
}

.report-fields b {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.report-history-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--gold);
}

.report-history-section h3 {
  margin: 0;
  color: var(--nav);
  font-size: 1rem;
}

.amount {
  font-weight: 900;
  white-space: nowrap;
}

.amount.negative {
  color: var(--red);
}

.amount.positive {
  color: var(--green);
}

.current-account-panel {
  border-color: #b9c8d3;
}

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

.cc-summary-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.cc-summary-card.positive {
  border-color: #b7dec9;
  background: #f2fbf6;
}

.cc-summary-card.negative {
  border-color: #efc4c4;
  background: #fff7f7;
}

.cc-summary-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.cc-summary-card strong {
  font-size: clamp(1.28rem, 2vw, 1.85rem);
  line-height: 1.05;
}

.compact-breakdown {
  margin-top: 12px;
}

.cc-company-list {
  display: grid;
  gap: 14px;
}

.cc-company-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.cc-company-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.cc-company-header div {
  display: grid;
  gap: 4px;
}

.cc-company-header strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.cc-company-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.cc-company-header em {
  font-style: normal;
  font-size: 1.12rem;
  font-weight: 900;
}

.cc-company-stats,
.cc-work-values {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.cc-mini-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cc-mini-stat b {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.cc-mini-stat em {
  min-width: 0;
  overflow-wrap: anywhere;
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 900;
}

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

.cc-work-line {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2ebf0;
  border-radius: 8px;
  background: #fff;
}

.cc-work-title {
  display: grid;
  gap: 3px;
}

.cc-work-title strong {
  color: var(--ink);
}

.cc-work-title span {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.cc-company-reimbursements > strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.cc-reimbursement-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: #7b2d2d;
  font-size: 0.82rem;
}

.cc-reimbursement-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cc-reimbursement-line strong,
.cc-reimbursement-line em {
  white-space: nowrap;
}

.cc-reimbursement-line em {
  font-style: normal;
}

.current-total {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.current-total > div,
.current-chip,
.current-row {
  border: 1px solid #ecf0f3;
  border-radius: 8px;
  background: #f8fbfd;
}

.current-total > div {
  padding: 14px;
}

.current-total span,
.current-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.current-total strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.35rem, 7vw, 2rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.current-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.current-chip {
  padding: 10px 12px;
}

.current-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.current-chip.warn {
  background: #fff8e6;
  border-color: #f0d58d;
}

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

.current-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 12px;
  min-width: 0;
}

.current-row-main {
  min-width: 0;
}

.current-row-main strong {
  display: block;
  overflow-wrap: anywhere;
}

.current-row-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.current-row-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.current-row-values span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.current-row-values b {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.current-row-values em {
  font-style: normal;
}

.negative-text {
  color: var(--red);
}

.positive-text {
  color: var(--green);
}

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

.tab {
  min-height: 36px;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8eef2;
  color: var(--ink);
  font-weight: 800;
}

.tab.active {
  background: var(--nav);
  color: #fff;
}

.tab.disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.company-admin-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.company-admin-heading > div {
  min-width: 0;
}

.company-admin-item .item-main {
  display: grid;
  gap: 8px;
}

.user-authorized-works {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.user-authorized-title {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.user-authorized-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-authorized-work {
  border: 1px solid #aac8dc;
  border-radius: 6px;
  padding: 5px 8px;
  background: #edf6fb;
  color: var(--nav);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.user-authorized-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0 14px;
}

.compact-field {
  margin: 0;
}

.upload-box.compact {
  min-height: 104px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  max-width: min(420px, calc(100vw - 32px));
  background: #17212b;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

  .sidebar {
    position: static;
    z-index: 5;
    padding: calc(14px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 14px calc(14px + env(safe-area-inset-left));
  }

  .brand-block {
    min-height: 42px;
  }

  .nav-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: hidden;
    max-width: 100%;
    padding-bottom: 4px;
  }

  .nav-menu.admin-nav-menu {
    grid-auto-flow: row;
  }

  .nav-button {
    width: 100%;
    white-space: nowrap;
  }

  .profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .profile-card .login-preview-link {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .profile-card label {
    margin: 0;
  }

  .main-panel {
    padding: 18px calc(14px + env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  }

  .grid.cols-2,
  .grid.cols-3,
  .cc-summary-grid,
  .cc-company-header,
  .cc-company-stats,
  .cc-work-values,
  .cc-reimbursement-line,
  .current-total,
  .current-breakdown,
  .current-row,
  .current-row-values,
  .form-grid,
  .filter-grid,
  .catalog-toolbar,
  .stage-tools,
  .stage-form,
  .deletion-entity-grid,
  .deletion-flow-note,
  .deletion-destination-grid,
  .archive-view-switch,
  .archive-balance-row,
  .excluded-archive-item {
    grid-template-columns: 1fr;
  }

  .delegated-access-line {
    grid-template-columns: 1fr;
  }

  .login-preview-shell {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .login-preview-card {
    justify-self: stretch;
  }

  .excluded-archive-item .item-actions {
    min-width: 0;
  }

  .deletion-flow-note span {
    padding: 6px 0 6px 10px;
  }

  .operational-work-values {
    grid-template-columns: 1fr;
  }

  .report-stage-filter {
    grid-column: 1;
  }

  .report-stage-options {
    grid-template-columns: 1fr;
  }

  .work-stage-row {
    grid-template-columns: 1fr;
  }

  .work-stage-row .compact-btn {
    grid-column: 1;
    justify-self: start;
  }

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

  .topbar-title-row {
    align-items: flex-start;
    justify-content: space-between;
  }

  .sync-pill {
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .btn,
  .nav-button {
    min-height: 44px;
  }

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

  .attachment-actions {
    justify-content: flex-start;
  }

  .attachment-actions .btn:not(.icon-button) {
    width: auto;
  }

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

  .consultation-toolbar .btn {
    width: 100%;
  }

  .login-preview-shell {
    gap: 22px;
    padding: calc(20px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  }

  .login-preview-brand {
    align-items: flex-start;
  }

  .login-preview-brand img {
    width: 64px;
    height: 64px;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .login-preview-card {
    padding: 22px 18px;
  }

  .operational-summary-title {
    align-items: stretch;
    flex-direction: column;
  }

  .operational-summary-title .btn {
    width: 100%;
  }

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

  .operational-summary-grid .metric {
    padding: 12px;
  }

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

  .operational-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operational-filter-actions .btn {
    width: 100%;
  }

  .operational-work-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .operational-work-header .badge {
    grid-column: 2;
    justify-self: start;
  }

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

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

  .operational-company-totals .operational-balance {
    grid-column: 1 / -1;
  }

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

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

  .operational-pending-item > div:last-child {
    justify-items: start;
  }

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

  .data-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .work-card .badge,
  .data-item .amount,
  .data-item .badge {
    grid-column: auto;
    justify-self: start;
    max-width: 100%;
  }

  .report-heading {
    display: grid;
    gap: 6px;
  }

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

  .report-item .amount,
  .report-item .badge {
    grid-column: auto;
  }

  .action-row .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .login-preview-brand {
    align-items: center;
    gap: 12px;
  }

  .login-preview-brand strong {
    font-size: 1.5rem;
  }

  .login-preview-brand span {
    line-height: 1.35;
  }
}
