:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --text: #17202a;
  --muted: #687585;
  --line: #d8e0e8;
  --primary: #167f6b;
  --primary-dark: #0e5d50;
  --accent: #e8a13a;
  --shadow: 0 12px 32px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.mobile-topbar {
  display: none;
}

.mobile-menu-toggle {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  min-height: 40px;
  padding: 10px 12px;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

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

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

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

.company-switcher,
.company-current {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 12px;
}

.company-switcher label,
.company-current span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.company-switcher select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px;
  width: 100%;
}

.company-current strong {
  display: block;
  font-size: 14px;
}

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

.menu-link {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  padding: 11px 12px;
}

button.menu-link {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

.menu-link .fa-solid {
  font-size: 14px;
  text-align: center;
  width: 18px;
}

.menu-link:hover,
.menu-link.active {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.version-badge {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: auto;
  padding: 18px 12px 0;
  text-align: left;
}

.version-badge span {
  color: var(--text);
  display: block;
  font-weight: 700;
}

.version-badge small {
  display: block;
  margin-top: 2px;
}

.main-content {
  padding: 30px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

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

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 0;
}

h2 {
  font-size: 18px;
}

.page-subtitle {
  color: var(--muted);
  margin: 8px 0 0;
}

.status-pill {
  border: 1px solid rgba(22, 127, 107, 0.24);
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(22, 127, 107, 0.1);
  padding: 8px 12px;
  white-space: nowrap;
}

.button-primary,
.button-secondary {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  font-weight: 700;
  min-height: 40px;
  padding: 10px 14px;
}

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

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: 22px;
}

.panel p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.auth-page {
  background: var(--surface-soft);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

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

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

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

.login-brand small {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.login-form input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(22, 127, 107, 0.14);
}

.login-form button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  font-weight: 700;
  margin-top: 8px;
  padding: 12px 16px;
}

.login-form button:hover {
  background: var(--primary-dark);
}

.form-stack {
  display: grid;
  gap: 10px;
}

.form-stack label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.form-stack small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin-top: -4px;
}

.form-stack input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.form-stack select,
.form-stack textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

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

.client-form {
  display: grid;
  gap: 18px;
}

.form-card h2 {
  margin: 0 0 18px;
}

.client-form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -4px;
}

.client-form-buttons button,
.client-form-buttons .button-action {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  font-weight: 700;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
}

.client-form-buttons .button-action {
  border: 1px solid transparent;
  color: #fff;
}

.client-form-buttons .action-save {
  background: var(--primary);
}

.client-form-buttons .action-save:hover {
  background: var(--primary-dark);
}

.client-form-buttons .action-print {
  background: #2563eb;
}

.client-form-buttons .action-print:hover {
  background: #1d4ed8;
}

.client-form-buttons .action-back {
  background: #64748b;
}

.client-form-buttons .action-back:hover {
  background: #475569;
}

.client-form .pj-only {
  display: none;
}

.client-form.is-pj .pj-only {
  display: grid;
}

.client-main-grid {
  grid-template-columns: minmax(220px, 0.9fr) minmax(170px, 0.7fr) minmax(320px, 1.6fr) minmax(180px, 0.8fr);
}

.client-main-grid .field-company,
.client-main-grid .field-person-type,
.client-main-grid .field-name,
.client-main-grid .field-document {
  grid-column: auto;
}

.client-main-grid .pj-only.field-name {
  grid-column: 3;
}

.client-main-grid .pj-only.field-document {
  grid-column: 4;
}

.client-address-power-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(560px, 1.45fr) minmax(360px, 0.9fr);
}

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

.client-address-grid .field-cep {
  grid-column: span 3;
}

.client-address-grid .field-street {
  grid-column: span 7;
}

.client-address-grid .field-number {
  grid-column: span 2;
}

.cep-status-line {
  display: none;
}

.client-address-grid .field-district {
  grid-column: span 4;
}

.client-address-grid .field-city {
  grid-column: span 5;
}

.client-address-grid .field-state {
  grid-column: span 3;
}

.client-power-grid {
  grid-template-columns: minmax(210px, 1fr) minmax(160px, 0.75fr);
}

.client-location-grid {
  align-items: start;
  grid-template-columns: minmax(320px, 1fr) 150px 150px auto;
}

.client-location-grid .field-maps-link {
  min-width: 0;
}

.location-open-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 43px;
  white-space: nowrap;
}

.location-open-button.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 16px;
}

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

.field label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  width: fit-content;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.readonly-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(22, 127, 107, 0.14);
}

.field input.is-required-missing,
.field select.is-required-missing,
.field textarea.is-required-missing {
  border-color: #d92d20;
  outline: 3px solid rgba(217, 45, 32, 0.12);
}

.field input.is-required-filled,
.field select.is-required-filled,
.field textarea.is-required-filled {
  border-color: var(--primary);
  outline: 3px solid rgba(22, 127, 107, 0.12);
}

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

.field-status-icon {
  align-items: center;
  color: var(--primary-dark);
  display: none;
  font-size: 13px;
  height: 14px;
  justify-content: center;
  line-height: 1;
  width: 14px;
}

.field.is-valid .field-status-icon {
  display: inline-flex;
}

.field.is-valid input {
  border-color: rgba(22, 127, 107, 0.44);
}

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

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

.field-status {
  min-height: 16px;
}

.field-status:empty {
  display: none;
}

.field-status.success {
  color: var(--primary-dark);
}

.field-status.warning {
  color: #8a5a12;
}

.field-status.error {
  color: #9d2424;
}

.checkbox-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

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

.checkbox-item input {
  width: auto;
}

.form-actions {
  align-self: end;
  grid-column: 1 / -1;
}

.filter-actions {
  align-items: end;
  display: flex;
  gap: 10px;
}

.filter-actions button {
  border: 0;
  cursor: pointer;
}

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

.quick-periods a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  padding: 7px 11px;
}

.form-actions button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font-weight: 700;
  padding: 12px 18px;
}

.form-actions button:hover {
  background: var(--primary-dark);
}

.form-stack input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(22, 127, 107, 0.14);
}

.form-stack button {
  align-items: center;
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font-weight: 700;
  margin-top: 8px;
  padding: 12px 16px;
}

.form-stack button:hover {
  background: var(--primary-dark);
}

.alert {
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 11px 12px;
}

.alert-error {
  background: #fff1f1;
  border: 1px solid #ffd0d0;
  color: #9d2424;
}

.alert-success {
  background: #eefaf4;
  border: 1px solid #bdebd2;
  color: #14623f;
}

.toast-container {
  display: grid;
  gap: 10px;
  position: fixed;
  right: 18px;
  top: 18px;
  width: min(420px, calc(100vw - 36px));
  z-index: 1000;
}

.toast-message {
  align-items: center;
  background: #eefaf4;
  border: 1px solid #bdebd2;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20, 98, 63, 0.18);
  color: #14623f;
  display: flex;
  gap: 10px;
  padding: 12px 14px;
}

.toast-message.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-icon {
  align-items: center;
  background: #d6f4e6;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.toast-text {
  flex: 1;
  font-weight: 700;
  line-height: 1.35;
}

.toast-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  width: 28px;
}

.project-tabs {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: -10px 0 22px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.project-tab {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #33465f;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.project-tab:hover {
  border-color: #b8ded8;
  color: var(--primary-dark);
}

.project-tab.is-active {
  background: #e8f7f4;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.table-panel {
  overflow-x: auto;
}

.technical-search-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin: 12px 0 18px;
}

.technical-search-card {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.technical-search-equipment {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-search-button {
  align-items: center;
  background: #eef8f6;
  border: 1px solid #b8ded8;
  border-radius: 8px;
  color: var(--primary-dark);
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.technical-search-button:hover {
  background: #def2ee;
  border-color: var(--primary);
}

.client-search {
  margin: 0 0 30px;
}

.client-search input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.06);
  color: var(--text);
  min-height: 42px;
  padding: 11px 14px;
  width: 100%;
}

.client-search input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(22, 127, 107, 0.14);
}

.client-list-panel {
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

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

.data-table th {
  color: var(--muted);
  font-size: 13px;
}

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

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

.clients-clean-table {
  min-width: 980px;
}

.clients-table th {
  letter-spacing: 0;
  text-transform: uppercase;
}

.clients-table td {
  padding: 18px 24px;
}

.clients-clean-table th,
.clients-clean-table td {
  padding-left: 24px;
  padding-right: 24px;
}

.clients-clean-table th:nth-child(1),
.clients-clean-table td:nth-child(1) {
  width: 30%;
}

.clients-clean-table th:nth-child(2),
.clients-clean-table td:nth-child(2) {
  width: 18%;
}

.clients-clean-table th:nth-child(3),
.clients-clean-table td:nth-child(3) {
  width: 16%;
}

.clients-clean-table th:nth-child(4),
.clients-clean-table td:nth-child(4) {
  width: 24%;
}

.clients-clean-table th:nth-child(5),
.clients-clean-table td:nth-child(5) {
  width: 12%;
}

.projects-clean-table {
  min-width: 1200px;
}

.projects-clean-table th:nth-child(1),
.projects-clean-table td:nth-child(1) {
  width: 26%;
}

.projects-clean-table th:nth-child(2),
.projects-clean-table td:nth-child(2) {
  width: 15%;
}

.projects-clean-table th:nth-child(3),
.projects-clean-table td:nth-child(3) {
  width: 13%;
}

.projects-clean-table th:nth-child(4),
.projects-clean-table td:nth-child(4) {
  width: 16%;
}

.projects-clean-table th:nth-child(5),
.projects-clean-table td:nth-child(5) {
  width: 18%;
}

.projects-clean-table th:nth-child(6),
.projects-clean-table td:nth-child(6) {
  width: 8%;
}

.projects-clean-table th:nth-child(7),
.projects-clean-table td:nth-child(7) {
  width: 4%;
}

.table-primary,
.table-secondary,
.table-muted {
  display: block;
}

.table-primary {
  font-size: 15px;
  line-height: 1.35;
}

.client-name-link {
  color: var(--text);
  font-weight: 700;
}

.client-name-link:hover {
  color: var(--primary-dark);
}

.table-secondary {
  font-weight: 500;
  line-height: 1.35;
}

.table-muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 3px;
}

.mobile-location,
.mobile-meta-separator {
  display: none;
}

.document-cell {
  color: #44556b;
  font-weight: 500;
  white-space: nowrap;
}

.mobile-client-avatar {
  display: none;
}

.date-cell {
  color: #44556b;
  display: block;
  font-weight: 500;
  white-space: nowrap;
}

.power-cell {
  color: #4b607a;
  font-weight: 700;
  white-space: nowrap;
}

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

.documents-files-table .actions-cell {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-pill {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-right: 6px;
  padding: 7px 10px;
}

.action-pill:hover {
  background: var(--surface-soft);
}

.action-icon {
  align-items: center;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  margin-right: 8px;
  padding: 0;
  vertical-align: middle;
  width: 28px;
}

.action-icon:last-child {
  margin-right: 0;
}

.action-icon .fa-solid {
  font-size: 14px;
  line-height: 1;
}

.delete-pill {
  color: #b42318;
}

.delete-pill:hover {
  background: #fff1f1;
}

.status-tag {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 13px;
  padding: 5px 9px;
}

.status-tag.status-success {
  background: #edf8f2;
  color: #047857;
  font-weight: 700;
}

.status-tag.status-danger {
  background: #fff1f1;
  color: #b42318;
  font-weight: 700;
}

.project-status-line {
  display: block;
  margin-top: 6px;
}

.project-status-line .status-tag {
  font-size: 12px;
  padding: 4px 8px;
}

.status-tabs {
  align-items: center;
  display: flex;
  gap: 18px;
  margin: 0 0 18px;
  overflow-x: auto;
  padding: 2px 0 8px;
  white-space: nowrap;
}

.status-tab {
  align-items: center;
  color: #4b607a;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 7px;
  padding: 6px 0;
}

.status-tab:hover,
.status-tab.active {
  color: var(--primary-dark);
}

.status-tab strong {
  background: var(--surface-soft);
  border-radius: 999px;
  color: #60738d;
  font-size: 11px;
  min-width: 18px;
  padding: 2px 6px;
  text-align: center;
}

.status-tab.active strong {
  background: rgba(22, 127, 107, 0.12);
  color: var(--primary-dark);
}

.status-tab.clear {
  color: var(--muted);
}

.table-action {
  color: var(--primary-dark);
  display: inline-flex;
  font-weight: 700;
  margin-right: 0;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 700;
  margin: 0 10px 0 0;
  padding: 0;
}

.danger-link {
  color: #9d2424;
}

.button-plain {
  border: 0;
  cursor: pointer;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

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

.history-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

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

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

.history-item span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.history-item p {
  color: var(--muted);
  margin: 8px 0 0;
}

.project-form-section {
  margin-bottom: 22px;
}

.project-form-flat {
  background: transparent;
}

.project-new-form {
  align-items: end;
  grid-template-columns: minmax(280px, 1.6fr) minmax(160px, 0.7fr) minmax(190px, 0.9fr) 150px minmax(120px, 0.6fr);
}

.project-client-field {
  position: relative;
}

.client-autocomplete-options {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(11, 31, 55, 0.18);
  display: grid;
  gap: 4px;
  left: 0;
  margin-top: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 50;
}

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

.client-autocomplete-option {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.client-autocomplete-option:hover,
.client-autocomplete-option:focus {
  background: #eef3f6;
  outline: none;
}

.client-autocomplete-name {
  font-weight: 800;
  line-height: 1.25;
}

.client-autocomplete-location {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.project-new-form .form-actions {
  grid-column: 1 / -1;
}

.project-new-equipment {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.project-new-required-documents {
  grid-column: 1 / -1;
}

.project-new-location {
  grid-column: 1 / -1;
}

.project-new-form input[readonly] {
  background: var(--surface-soft);
  color: var(--text);
  cursor: default;
}

.project-uc-field input[readonly] {
  color: var(--primary-dark);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.project-card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(320px, 1fr);
}

.project-card {
  align-self: start;
}

.project-card-wide {
  grid-column: 1 / -1;
  min-width: 0;
}

.attachment-card {
  grid-column: 3;
  grid-row: 3;
}

.history-card {
  grid-column: 2;
  grid-row: 3;
}

.comments-card {
  grid-column: 1;
  grid-row: 3;
}

.required-documents-card {
  grid-column: 1 / -1;
  grid-row: 2;
}

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

.card-header h2 {
  margin: 2px 0 0;
}

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

.compact-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
}

.protocol-title-count {
  color: var(--primary-dark);
  font-size: 0.86em;
  font-weight: 700;
}

.protocol-overdue-count {
  background: #fff1f1;
  border-radius: 999px;
  color: #b42318;
  display: inline-flex;
  font-size: 12px;
  margin-left: 8px;
  padding: 3px 8px;
  vertical-align: middle;
}

.card-kicker {
  color: var(--accent);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.protocol-summary > div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 8px 10px;
}

.protocol-summary span,
.protocol-summary small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.protocol-summary strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
  margin-top: 3px;
}

.protocol-summary small {
  font-weight: 400;
  margin-top: 1px;
}

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

.protocol-form .field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-width: 0;
}

.protocol-form .field-wide {
  grid-column: 1 / -1;
}

.protocol-form input,
.protocol-form select {
  min-height: 46px;
  width: 100%;
}

.protocol-form textarea {
  min-height: 86px;
  width: 100%;
}

.deadline-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 7px;
  width: 100%;
}

.deadline-shortcuts button {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 9px;
}

.deadline-shortcuts button:hover {
  background: rgba(22, 127, 107, 0.1);
  border-color: rgba(22, 127, 107, 0.3);
}

.protocol-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-color: rgba(22, 127, 107, 0.45) var(--surface-soft);
  scrollbar-width: thin;
}

.protocol-list::-webkit-scrollbar {
  height: 8px;
}

.protocol-list::-webkit-scrollbar-track {
  background: var(--surface-soft);
  border-radius: 999px;
}

.protocol-list::-webkit-scrollbar-thumb {
  background: rgba(22, 127, 107, 0.45);
  border-radius: 999px;
}

.protocol-item {
  align-items: start;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
  display: block;
  flex: 0 0 calc((100% - 48px) / 5);
  gap: 12px;
  min-height: 148px;
  min-width: 250px;
  padding: 14px;
  position: relative;
}

.protocol-item.deadline-overdue {
  border-left-color: #b42318;
}

.protocol-item.deadline-today,
.protocol-item.deadline-soon {
  border-left-color: var(--accent);
}

.protocol-main strong,
.protocol-main span,
.protocol-main p {
  display: block;
}

.protocol-deadline-line strong,
.protocol-deadline-line span,
.protocol-deadline-line em {
  display: inline-flex;
}

.protocol-main > strong {
  font-size: 16px;
  line-height: 1.2;
  padding-right: 92px;
}

.protocol-main p {
  color: var(--muted);
  font-size: 12px;
}

.protocol-type {
  color: var(--muted);
  display: inline-flex;
  max-width: 94px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.protocol-deadline-line b {
  color: #9aa8b8;
  font-weight: 400;
  margin: 0 6px;
}

.protocol-main p {
  margin: 12px 0 0;
}

.protocol-deadline-line {
  align-items: center;
  color: var(--text);
  display: flex;
  flex-wrap: nowrap;
  font-size: 11px;
  gap: 0;
  margin-top: 8px;
  white-space: nowrap;
}

.protocol-deadline-due {
  margin-top: 6px;
}

.protocol-deadline-line .fa-solid {
  color: var(--primary-dark);
  font-size: 13px;
  margin-right: 7px;
}

.protocol-deadline-line em {
  color: #d16b00;
  font-style: normal;
  white-space: nowrap;
}

.deadline-overdue strong,
.deadline-overdue .protocol-deadline-line em {
  color: #b42318;
}

.deadline-today .protocol-deadline-line em,
.deadline-soon .protocol-deadline-line em {
  color: #9a5a00;
}

.protocol-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  right: 12px;
  top: 12px;
}

.protocol-item .delete-pill {
  color: #c71919;
  margin-top: 0;
}

.finish-pill {
  align-items: center;
  background: rgba(22, 127, 107, 0.1);
  border: 1px solid rgba(22, 127, 107, 0.24);
  border-radius: 6px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  gap: 5px;
  margin: 0;
  padding: 5px 8px;
}

.empty-card-text {
  color: var(--muted);
  margin: 0;
}

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

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

.required-document-item {
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 104px;
  padding: 14px;
}

.required-document-item.is-sent {
  background: #ecfdf5;
  border-color: rgba(22, 127, 107, 0.28);
  border-left-color: var(--primary);
}

.required-document-info strong,
.required-document-info span,
.required-document-info small {
  display: block;
}

.required-document-info span,
.required-document-info small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.required-document-item.is-sent .required-document-info span {
  color: var(--primary-dark);
  font-weight: 700;
}

.required-document-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.required-document-modal-note {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  margin: 0 0 14px;
  padding: 10px 12px;
}

.required-document-modal-note strong,
.required-document-modal-note span {
  display: block;
}

.required-document-modal-note strong {
  color: var(--text);
  margin-bottom: 4px;
}

.confirm-line {
  align-items: center;
  color: var(--text);
  display: flex;
  font-weight: 700;
  gap: 8px;
  margin-bottom: 14px;
}

.confirm-line input {
  height: 16px;
  width: 16px;
}

.required-fields-modal-text {
  color: var(--muted);
  margin: 0 0 10px;
}

.required-fields-list {
  color: var(--text);
  margin: 0 0 16px;
  padding-left: 20px;
}

.required-fields-list li + li {
  margin-top: 6px;
}

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

.attachment-info strong,
.attachment-info span,
.attachment-info small {
  display: block;
}

.attachment-info span,
.attachment-info small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

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

.attachment-upload-form {
  display: inline-flex;
}

.attachment-upload-button {
  align-items: center;
  border: 1px solid transparent;
  display: inline-flex;
  gap: 7px;
  margin: 0;
}

.attachment-upload-button input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.attachment-file-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.attachment-file-row {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px 8px;
}

.attachment-file-row span {
  margin-top: 0;
}

.attachment-file-row small {
  margin-top: 0;
}

.attachment-show-all {
  font-size: 12px;
  margin-top: 8px;
}

.attachment-file-list-modal .attachment-file-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.comment-form {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.comment-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.comment-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 82px;
  resize: vertical;
  width: 100%;
}

.comment-form button {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-self: end;
  min-height: 36px;
  padding: 8px 12px;
}

.trello-comment-form {
  position: relative;
}

.comment-editor {
  position: relative;
}

.comment-tools {
  align-items: center;
  color: #4f5f72;
  display: flex;
  gap: 12px;
  margin-top: -2px;
  min-height: 20px;
}

.comment-tools .fa-solid {
  font-size: 12px;
}

.mention-suggestions {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.16);
  left: 8px;
  max-height: 180px;
  min-width: 220px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  top: 42px;
  z-index: 8;
}

.mention-suggestions button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 8px;
  justify-content: flex-start;
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.mention-suggestions button:hover,
.mention-suggestions button.is-active {
  background: var(--surface-soft);
}

.mention-avatar {
  align-items: center;
  background: rgba(22, 127, 107, 0.12);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

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

.comment-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.comment-author {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.comment-author span {
  color: var(--muted);
  font-size: 12px;
}

.comment-author em {
  color: var(--muted);
  font-style: normal;
  margin-left: 6px;
}

.comment-item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.comment-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.comment-actions .link-button {
  font-size: 12px;
  margin: 0;
}

.comment-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.comment-edit-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 86px;
  resize: vertical;
  width: 100%;
}

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

.comment-edit-actions button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
}

.comment-edit-actions button[type="submit"] {
  background: var(--primary);
  color: #fff;
}

.comment-item.is-editing > p,
.comment-item.is-editing > .comment-actions {
  display: none;
}

.modal-backdrop {
  align-items: center;
  background: rgba(23, 32, 42, 0.46);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 22px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 50;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.26);
  max-height: min(720px, calc(100vh - 44px));
  overflow-y: auto;
  padding: 22px;
  width: min(620px, 100%);
}

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

.modal-header h2 {
  margin: 2px 0 0;
}

.modal-close {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.modal-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.modal-actions button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
}

.modal-actions button[type="submit"] {
  background: var(--primary);
  color: #fff;
}

.modal-actions .button-secondary {
  border: 1px solid var(--line);
}

.finished-protocols-modal {
  width: min(760px, 100%);
}

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

.finished-protocol-item {
  align-items: start;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px;
}

.finished-protocol-item strong,
.finished-protocol-item span,
.finished-protocol-item small {
  display: block;
}

.finished-protocol-item span,
.finished-protocol-item small,
.finished-protocol-item p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.finished-protocol-meta {
  text-align: right;
}

.finished-protocol-meta strong {
  white-space: nowrap;
}

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

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

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

.finance-overview-layout {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: max-content 1fr;
  margin-bottom: 22px;
  max-width: 1106px;
}

.finance-info-card {
  margin-bottom: 0;
  max-width: 380px;
}

.finance-info-fields {
  align-items: end;
  gap: 10px;
  grid-template-columns: 270px 42px;
}

.finance-info-card .finance-highlight-input {
  background: #edf8f2;
  border-color: #9bdabf;
  color: #064e3b;
  font-size: 18px;
  font-weight: 800;
}

.finance-icon-button {
  height: 42px;
  justify-content: center;
  min-height: 42px;
  padding: 0;
  width: 42px;
}

.finance-summary-card {
  align-items: center;
  display: flex;
  justify-self: end;
  margin-bottom: 0;
  max-width: none;
  padding: 8px 20px;
  width: max-content;
}

.finance-indicators-summary {
  grid-template-columns: repeat(3, 220px);
  gap: 8px;
  margin-bottom: 0;
  max-width: 684px;
}

.finance-indicators-summary .metric-card {
  min-height: 50px;
  padding: 6px 12px;
}

.finance-indicators-summary .metric-card > span {
  font-size: 13px;
}

.finance-indicators-summary .metric-card strong {
  font-size: 22px;
  margin-top: 2px;
}

.finance-gross-profit-card {
  grid-column: 1;
}

.finance-project-flow {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 650px) minmax(360px, 440px);
}

.finance-costs-card {
  border-color: #f1b4ad;
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.08), var(--shadow);
  margin-bottom: 22px;
  max-width: 760px;
}

.finance-costs-fields {
  align-items: end;
  column-gap: 8px;
  row-gap: 4px;
  grid-template-columns: minmax(170px, 1fr) 54px 88px 96px 42px 34px;
}

.finance-costs-card .field {
  gap: 5px;
}

.finance-costs-card .field label {
  font-size: 12px;
}

.finance-costs-card .field input {
  border-radius: 7px;
  font-size: 13px;
  min-height: 30px;
  padding: 5px 10px;
}

.finance-costs-card [data-project-cost-total] {
  background: #263742;
  border-color: #263742;
  font-weight: 800;
}

.finance-costs-card [data-project-cost-total].is-zero {
  color: rgba(255, 255, 255, 0.42);
}

.finance-costs-card [data-project-cost-total].has-value {
  color: #fff;
}

.finance-costs-card [data-project-cost-total]:focus {
  border-color: #167f6b;
  outline: 3px solid rgba(22, 127, 107, 0.16);
}

.finance-cost-status-field {
  min-width: 0;
}

.finance-cost-status-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  width: 30px;
}

.finance-cost-status-toggle input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.finance-cost-status-box {
  align-items: center;
  background: #fff;
  border: 1px solid #cfdbe7;
  border-radius: 7px;
  color: transparent;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.finance-cost-status-toggle:focus-within .finance-cost-status-box {
  border-color: #167f6b;
  outline: 3px solid rgba(22, 127, 107, 0.14);
}

.finance-costs-fields.is-confirmed-cost .finance-cost-status-box {
  background: #12846a;
  border-color: #12846a;
  color: #fff;
}

.finance-costs-fields + .finance-costs-fields .field > label:not(.finance-cost-status-toggle) {
  height: 1px;
  margin: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.finance-cost-remove {
  height: 30px;
  width: 34px;
}

.finance-costs-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-top: 2px;
}

.finance-costs-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.finance-cost-add-button {
  background: #fff5f4;
  border: 1px solid #d92d20;
  color: #b42318;
  font-size: 14px;
  min-height: 36px;
  padding: 8px 14px;
}

.finance-cost-add-button:hover {
  background: #ffe7e4;
}

.finance-costs-summary {
  align-items: center;
  background: #1f3139;
  border-radius: 8px;
  color: #dbe8eb;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 378px;
  padding: 10px 12px;
}

.finance-costs-summary span {
  font-size: 13px;
  font-weight: 800;
}

.finance-costs-summary strong {
  color: #fff;
  font-size: 16px;
}

.finance-costs-summary [data-project-costs-grand-total].is-zero {
  color: rgba(255, 255, 255, 0.58);
}

.finance-costs-summary [data-project-costs-grand-total].has-value {
  color: #fff;
}

.finance-costs-breakdown {
  color: #52677d;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  gap: 8px 12px;
  justify-content: flex-end;
  margin-left: auto;
  width: 100%;
}

.finance-costs-breakdown strong {
  color: var(--text);
  font-size: 13px;
  margin-left: 4px;
}

.finance-receipts-card {
  border-color: #a8dfc4;
  box-shadow: 0 0 0 1px rgba(22, 132, 95, 0.1), var(--shadow);
  margin-bottom: 22px;
  max-width: 440px;
}

.finance-receipts-card .equipment-card-icon {
  background: #e2f6ee;
  border-color: #9bdabf;
  color: #047857;
}

.finance-receipts-fields {
  align-items: end;
  column-gap: 6px;
  row-gap: 4px;
  grid-template-columns: minmax(185px, 1fr) 92px 32px 28px;
}

.finance-receipts-fields:not(.finance-receipts-fixed-row) .finance-receipt-status-placeholder {
  grid-column: 4;
  grid-row: 1;
}

.finance-receipts-fields:not(.finance-receipts-fixed-row) .finance-receipt-remove {
  grid-column: 3;
  grid-row: 1;
}

.finance-receipts-card .field {
  gap: 5px;
}

.finance-receipts-card .field label {
  color: #486276;
  font-size: 12px;
  font-weight: 800;
}

.finance-receipts-card .field input {
  border-color: #c8ded4;
  border-radius: 7px;
  font-size: 13px;
  min-height: 30px;
  padding: 5px 10px;
}

.finance-receipts-fixed-row .field input {
  background: #edf8f2;
  border-color: #9bdabf;
  color: #245346;
  font-weight: 700;
}

.finance-receipts-fixed-row .finance-receipt-remove {
  visibility: hidden;
}

.finance-receipt-status-field {
  min-width: 0;
}

.finance-receipt-status-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  width: 28px;
}

.finance-receipt-status-toggle input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.finance-receipt-status-box {
  align-items: center;
  background: #fff;
  border: 1px solid #c8ded4;
  border-radius: 7px;
  color: transparent;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 28px;
}

.finance-receipt-status-toggle:focus-within .finance-receipt-status-box {
  border-color: #16a34a;
  outline: 3px solid rgba(22, 163, 74, 0.14);
}

.finance-receipts-fields.is-confirmed-receipt .finance-receipt-status-box {
  background: #0f8a63;
  border-color: #0f8a63;
  color: #fff;
}

.finance-receipts-fields + .finance-receipts-fields .field > label:not(.finance-receipt-status-toggle) {
  height: 1px;
  margin: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.finance-receipt-remove {
  color: #047857;
  height: 30px;
  padding: 0;
  width: 28px;
}

.finance-receipts-footer {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 8px;
}

.finance-receipt-add-button {
  background: #ecfdf3;
  border: 1px solid #16a34a;
  color: #047857;
  font-size: 14px;
  min-height: 36px;
  padding: 8px 12px;
}

.finance-receipt-add-button:hover {
  background: #dcfce7;
}

.finance-receipts-summary {
  align-items: center;
  background: #0f5138;
  border-radius: 8px;
  color: #d9f4e8;
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-left: auto;
  padding: 10px 11px;
}

.finance-receipts-summary span {
  font-size: 12px;
  font-weight: 800;
}

.finance-receipts-summary strong {
  color: #fff;
  font-size: 15px;
}

.finance-category-card {
  border-left: 4px solid var(--line);
}

.finance-income-card {
  background: #f3fbf7;
  border-left-color: #16845f;
  box-shadow: 0 0 0 1px rgba(22, 132, 95, 0.14), 0 0 18px rgba(22, 132, 95, 0.2);
}

.finance-cost-card {
  background: #fff7ef;
  border-left-color: #d96b1f;
  box-shadow: 0 0 0 1px rgba(217, 107, 31, 0.14), 0 0 18px rgba(217, 107, 31, 0.2);
}

.finance-card-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.finance-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.finance-card-header h2 {
  margin: 0;
}

.finance-integrator-list-card {
  margin-top: 22px;
  max-width: 980px;
}

.finance-integrator-summary-card {
  margin-top: 22px;
  max-width: 980px;
}

.finance-integrator-summary {
  gap: 14px;
}

.finance-integrator-summary .metric-card {
  padding: 14px 16px;
}

.finance-integrator-summary .metric-card strong {
  font-size: 28px;
}

.integrator-payable-card {
  background: #fff5f4;
  border-color: #f1b4ad;
}

.integrator-paid-card {
  background: #edf8f2;
  border-color: #9bdabf;
}

.integrator-remaining-card {
  background: #fff8e5;
  border-color: #f2d58b;
}

.finance-category-badge {
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 9px;
}

.finance-income-card .finance-category-badge {
  background: #dff5ec;
  color: #08724d;
}

.finance-cost-card .finance-category-badge {
  background: #ffe5d1;
  color: #9a420b;
}

.finance-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.equipment-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.equipment-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.equipment-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.equipment-card-header {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.equipment-card-header h2 {
  margin: 0 0 4px;
}

.equipment-card-header p {
  color: var(--muted);
  margin: 0;
}

.equipment-card-icon {
  align-items: center;
  background: rgba(22, 127, 107, 0.1);
  border: 1px solid rgba(22, 127, 107, 0.2);
  border-radius: 8px;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 42px;
}

.equipment-card-fields {
  display: grid;
  gap: 14px;
}

.required-fields-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}

.required-fields-note span,
.required-mark {
  color: #d92d20;
}

.equipment-inline-fields {
  align-items: end;
  display: grid;
  gap: 14px;
}

.equipment-inverter-main {
  grid-template-columns: minmax(0, 1fr) 132px;
}

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

.equipment-inverter-auto input[readonly],
.equipment-network-cables input[readonly] {
  background: var(--surface-soft);
  color: var(--text);
  cursor: default;
}

.equipment-module-main {
  grid-template-columns: minmax(0, 1fr) 116px 86px;
}

.equipment-network-main {
  grid-template-columns: minmax(0, 1fr) 116px;
}

.equipment-network-cables {
  grid-template-columns: minmax(0, 1fr) 86px 128px;
}

.equipment-actions {
  margin-bottom: 22px;
}

.equipment-actions button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font-weight: 700;
  padding: 12px 18px;
}

.equipment-actions button:hover {
  background: var(--primary-dark);
}

.documents-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.dashboard-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 22px;
}

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

.metric-text {
  font-size: 20px;
  line-height: 1.3;
}

.compact-table {
  min-width: 620px;
}

.info-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.info-list dd {
  margin: 0;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 32px;
  margin-top: 8px;
}

.metric-card small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 8px;
}

.dashboard-grid .metric-card strong {
  font-size: 28px;
}

.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto 22px;
  max-width: 820px;
  padding: 54px 64px;
}

.print-only-page {
  background: #fff;
}

.print-only-page .print-sheet {
  border: 0;
  box-shadow: none;
  margin-top: 0;
}

.power-document {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.75;
}

.power-document h1 {
  font-size: 24px;
  letter-spacing: 0;
  margin: 0 0 42px;
  text-align: center;
}

.power-document p {
  color: #111;
  margin: 0 0 34px;
  text-align: justify;
}

.power-document .power-date {
  margin-top: 34px;
  text-align: center;
}

.signature-block {
  margin: 86px auto 0;
  max-width: 300px;
  text-align: center;
}

.signature-line {
  border-top: 1px solid #111;
  height: 1px;
  margin-bottom: 10px;
}

.power-document .signature-name {
  font-size: 16px;
  margin-bottom: 0;
  text-align: center;
}

.signature-name span {
  font-size: 14px;
  font-weight: 400;
}

@media print {
  @page {
    margin: 18mm;
    size: A4;
  }

  body {
    background: #fff;
  }

  .app-shell {
    display: block;
    min-height: 0;
  }

  .sidebar,
  .no-print {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  .print-sheet {
    border: 0;
    box-shadow: none;
    margin: 0;
    max-width: none;
    padding: 0;
  }
}

@media (max-width: 780px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100vw;
    overflow-x: hidden;
    padding-top: 64px;
    width: 100%;
  }

  .mobile-topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.08);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    left: 0;
    min-height: 64px;
    padding: 10px 14px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 20;
  }

  .mobile-topbar strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    border-bottom: 0;
    border-right: 0;
    bottom: 0;
    box-shadow: 16px 0 34px rgba(23, 32, 42, 0.18);
    left: 0;
    max-width: 330px;
    overflow-y: auto;
    padding: 18px;
    position: fixed;
    top: 64px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    width: min(86vw, 330px);
    z-index: 19;
  }

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

  .main-content {
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
    padding: 20px 14px 28px;
    width: 100%;
  }

  .panel,
  .form-card,
  .modal-panel,
  .project-tabs,
  .project-tab,
  .card-header,
  .card-actions,
  .protocol-list,
  .required-document-item,
  .attachment-item,
  .attachment-file-row,
  .comment-item,
  .comment-editor,
  .finished-protocol-item {
    max-width: 100%;
    min-width: 0;
  }

  .panel,
  .form-card,
  .project-card {
    overflow-x: hidden;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
  }

  .page-header .button-primary,
  .client-search input {
    width: 100%;
  }

  .page-header .button-primary {
    justify-content: center;
    min-height: 44px;
  }

  .project-tabs {
    margin: -4px -2px 18px;
    max-width: calc(100vw - 28px);
  }

  .project-tab {
    min-width: 0;
    min-height: 40px;
    padding: 9px 12px;
  }

  .project-tab span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .client-search {
    margin-bottom: 16px;
  }

  .status-tabs {
    display: none;
  }

  .project-card-grid,
  .protocol-summary,
  .protocol-form,
  .protocol-item,
  .technical-search-actions {
    grid-template-columns: 1fr;
  }

  .project-card-wide,
  .required-documents-card,
  .comments-card,
  .history-card,
  .attachment-card {
    grid-column: auto;
    grid-row: auto;
  }

  .required-documents-grid {
    grid-template-columns: 1fr;
  }

  .project-company-field,
  .project-concessionaria-field,
  .project-date-field,
  .project-uc-field {
    display: none;
  }

  .protocol-deadline-line {
    text-align: left;
  }

  .project-card,
  .project-card-grid,
  .protocols-board,
  .required-documents-card,
  .comments-card,
  .history-card,
  .attachment-card {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .project-card .card-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .project-card .card-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  .project-card .compact-button,
  .project-card .card-actions button,
  .comment-form button,
  .comment-edit-actions button,
  .modal-actions button {
    justify-content: center;
    width: 100%;
  }

  .protocol-list {
    display: grid;
    gap: 10px;
    overflow-x: visible;
  }

  .protocol-item {
    flex: none;
    min-height: 0;
    min-width: 0;
    padding-right: 12px;
    width: 100%;
  }

  .protocol-main > strong {
    padding-right: 0;
  }

  .protocol-deadline-line {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 6px;
    white-space: normal;
  }

  .protocol-type {
    max-width: none;
    white-space: normal;
  }

  .protocol-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 12px;
    position: static;
  }

  .required-document-item,
  .attachment-item,
  .attachment-file-row,
  .finished-protocol-item {
    grid-template-columns: 1fr;
  }

  .required-document-actions,
  .attachment-actions,
  .attachment-file-row > div,
  .finished-protocol-meta {
    justify-content: flex-start;
  }

  .attachment-upload-form,
  .attachment-upload-button {
    width: 100%;
  }

  .comment-author,
  .comment-actions,
  .comment-edit-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-panel,
  .finished-protocols-modal {
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    width: 100%;
  }

  .client-list-panel {
    overflow: visible;
  }

  .clients-table,
  .clients-clean-table,
  .data-table {
    border-collapse: separate;
    border-spacing: 0 12px;
    min-width: 0;
  }

  .clients-table thead {
    display: none;
  }

  .clients-table tbody,
  .clients-table tr,
  .clients-table td {
    display: block;
    width: 100%;
  }

  .clients-table tr {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(23, 32, 42, 0.06);
    display: grid;
    gap: 14px;
    grid-template-areas: "avatar info actions";
    grid-template-columns: 64px minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 16px;
  }

  .mobile-client-avatar {
    align-items: center;
    background: #eaf5f3;
    border-radius: 999px;
    display: inline-flex;
    grid-area: avatar;
    height: 58px;
    justify-content: center;
    position: relative;
    width: 58px;
  }

  .mobile-client-avatar span::before {
    background: var(--primary-dark);
    border-radius: 999px;
    content: "";
    height: 13px;
    left: 50%;
    position: absolute;
    top: 16px;
    transform: translateX(-50%);
    width: 13px;
  }

  .mobile-client-avatar span::after {
    background: var(--primary-dark);
    border-radius: 10px 10px 4px 4px;
    bottom: 15px;
    content: "";
    height: 13px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 24px;
  }

  .clients-table td {
    border-bottom: 0;
    padding: 0;
  }

  .clients-table td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
    text-transform: uppercase;
  }

  .clients-table td[data-label="Cliente"] {
    grid-area: info;
    min-width: 0;
    padding-right: 0;
    width: auto;
  }

  .clients-table td[data-label="Cliente"]::before,
  .mobile-client-avatar::before,
  .clients-table .empty-row::before {
    display: none;
  }

  .clients-table .document-cell,
  .clients-table td[data-label="Data"],
  .clients-table td[data-label="Concessionaria"] {
    display: none;
  }

  .clients-clean-table th,
  .clients-clean-table td {
    padding-left: 0;
    padding-right: 0;
    width: auto;
  }

  .clients-clean-table th:nth-child(1),
  .clients-clean-table td:nth-child(1),
  .clients-clean-table th:nth-child(2),
  .clients-clean-table td:nth-child(2),
  .clients-clean-table th:nth-child(3),
  .clients-clean-table td:nth-child(3),
  .clients-clean-table th:nth-child(4),
  .clients-clean-table td:nth-child(4),
  .clients-clean-table th:nth-child(5),
  .clients-clean-table td:nth-child(5) {
    width: auto;
  }

  .actions-cell {
    align-items: center;
    display: flex;
    gap: 12px;
    grid-area: actions;
    justify-content: flex-end;
    text-align: right;
    width: auto;
  }

  .clients-table .actions-cell::before {
    display: none;
  }

  .clients-table .inline-form {
    display: none;
  }

  .action-icon {
    align-items: center;
    background: var(--surface-soft);
    border-radius: 8px;
    display: inline-flex;
    height: 58px;
    justify-content: center;
    margin-right: 0;
    padding: 0;
    width: 58px;
  }

  .action-icon .fa-solid {
    font-size: 23px;
    line-height: 1;
  }

  .clients-table .table-primary {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.28;
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
  }

  .clients-table .table-muted {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 16px;
    gap: 10px;
    margin-top: 6px;
  }

  .mobile-location,
  .mobile-meta-separator {
    display: inline-flex;
  }

  .mobile-location {
    align-items: center;
    gap: 6px;
  }

  .mobile-location .fa-solid {
    font-size: 14px;
  }

  .clients-table .empty-row {
    grid-column: 1 / -1;
    padding: 18px;
    text-align: center;
  }

  .projects-mobile-table tr {
    gap: 12px;
    grid-template-areas: "project-icon info actions";
    grid-template-columns: 46px minmax(0, 1fr) auto;
    padding: 14px 12px;
  }

  .projects-mobile-table tr::before {
    align-items: center;
    background: #eaf5f3;
    border-radius: 999px;
    color: var(--primary-dark);
    content: "P";
    display: inline-flex;
    font-size: 18px;
    font-weight: 800;
    grid-area: project-icon;
    height: 46px;
    justify-content: center;
    width: 46px;
  }

  .projects-mobile-table td[data-label="Empresa"],
  .projects-mobile-table .power-cell {
    display: none;
  }

  .projects-mobile-table .project-number-meta {
    color: var(--muted);
    display: inline-flex;
  }

  .projects-clean-table th:nth-child(1),
  .projects-clean-table td:nth-child(1),
  .projects-clean-table th:nth-child(2),
  .projects-clean-table td:nth-child(2),
  .projects-clean-table th:nth-child(3),
  .projects-clean-table td:nth-child(3),
  .projects-clean-table th:nth-child(4),
  .projects-clean-table td:nth-child(4),
  .projects-clean-table th:nth-child(5),
  .projects-clean-table td:nth-child(5),
  .projects-clean-table th:nth-child(6),
  .projects-clean-table td:nth-child(6),
  .projects-clean-table th:nth-child(7),
  .projects-clean-table td:nth-child(7) {
    width: auto;
  }

  .projects-mobile-table .actions-cell {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, 40px);
  }

  .projects-mobile-table .action-icon {
    height: 40px;
    width: 40px;
  }

  .projects-mobile-table .action-icon .fa-solid {
    font-size: 17px;
  }

  @media (max-width: 520px) {
    .clients-table tr {
      gap: 10px;
      grid-template-columns: 46px minmax(0, 1fr) auto;
      padding: 14px 12px;
    }

    .mobile-client-avatar {
      font-size: 20px;
      height: 46px;
      width: 46px;
    }

    .mobile-client-avatar span::before {
      height: 10px;
      top: 12px;
      width: 10px;
    }

    .mobile-client-avatar span::after {
      bottom: 11px;
      height: 10px;
      width: 20px;
    }

    .actions-cell {
      gap: 6px;
    }

    .action-icon {
      height: 40px;
      width: 40px;
    }

    .action-icon .fa-solid {
      font-size: 18px;
    }

    .clients-table .table-primary {
      font-size: 15px;
    }

    .clients-table .table-muted {
      font-size: 13px;
      gap: 7px;
    }
  }

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

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

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

  .finance-grid,
  .equipment-cards,
  .finance-summary,
  .equipment-summary,
  .documents-summary,
  .dashboard-grid,
  .dashboard-columns {
    grid-template-columns: 1fr;
  }

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

  .equipment-inverter-main {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  .equipment-inverter-auto {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equipment-module-main {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 70px 58px;
  }

  .equipment-network-main {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .equipment-network-cables {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 56px 88px;
  }

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

  .finance-project-flow {
    grid-template-columns: 1fr;
  }

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

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

  .client-main-grid,
  .client-address-power-grid,
  .client-address-grid,
  .client-power-grid,
  .client-location-grid {
    grid-template-columns: 1fr;
  }

  .client-address-grid .field-cep,
  .client-address-grid .field-street,
  .client-address-grid .field-number,
  .client-address-grid .field-complement,
  .client-address-grid .field-district,
  .client-address-grid .field-city,
  .client-address-grid .field-state {
    grid-column: auto;
  }

  .client-main-grid .pj-only.field-name,
  .client-main-grid .pj-only.field-document {
    grid-column: auto;
  }

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

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