:root {
  --bc-primary: #0f766e;
  --bc-primary-dark: #115e59;
  --bc-soft: #ecfdf5;
  --bc-border: #d7e2e1;
  --bc-text-soft: #64748b;
  --bc-danger: #b42318;
  --bc-warning: #b54708;
}

.common-property-content {
  width: min(1560px, calc(100% - 32px));
  margin: 26px auto 48px;
  display: grid;
  gap: 18px;
}

.bc-card {
  background: var(--panel, #fff);
  border: 1px solid var(--bc-border);
  border-radius: 18px;
  box-shadow: none;
  padding: 20px;
  min-width: 0;
}

.search-card {
  padding-top: 14px;
}

.bc-section-head,
.bc-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.bc-section-head h1,
.bc-section-head h2,
.bc-editor-head h3,
.bc-card h3 {
  margin: 0;
}

.bc-card h3 {
  font-size: .98rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.bc-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bc-soft);
  color: var(--bc-primary-dark);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.bc-search-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 160px)) minmax(250px, 300px) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}

.bc-search-grid:has(.bc-holder-inline[hidden]) {
  grid-template-columns: repeat(3, minmax(110px, 160px)) minmax(250px, 300px);
  justify-content: center;
}

.bc-search-grid > label > input {
  text-align: center;
}

.common-property-page input,
.common-property-page select,
.common-property-page button,
.common-property-page .bc-card,
.common-property-page .login-modal {
  box-shadow: none !important;
}

.bc-search-grid label {
  display: grid;
  gap: 7px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--bc-text-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.bc-search-grid input,
.construction-editor input,
.construction-editor select,
.bc-recap-table input,
.bc-edit-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  background: var(--panel, #fff);
  color: inherit;
  padding: 9px 10px;
  box-sizing: border-box;
}

.bc-search-grid button,
.bc-actions button,
.bc-add-row {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 800;
  cursor: pointer;
}

.bc-search-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.bc-search-actions .secondary {
  border: 1px solid var(--bc-border);
  background: #eef2f6;
  color: #334155;
}

.bc-search-grid button,
.bc-actions .primary {
  background: var(--bc-primary);
  color: #fff;
}

.bc-search-grid button:not(.secondary):hover,
.bc-actions .primary:hover {
  background: var(--bc-primary);
  color: #fff;
}

.bc-add-row,
.bc-actions .secondary {
  background: #eef2f6;
  color: #334155;
}

.bc-add-row {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.bc-holder-inline {
  align-self: stretch;
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(280px, 1.4fr);
  align-content: center;
  gap: 4px;
  border-left: 1px solid var(--bc-border);
  padding-left: 18px;
  min-width: 0;
}

.bc-holder-primary {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.bc-holder-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  align-content: center;
  gap: 7px;
  min-width: 0;
}

.bc-holder-detail {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--bc-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel, #fff) 92%, var(--bc-soft));
}

.bc-holder-inline .bc-holder-detail span {
  font-size: .62rem;
  letter-spacing: .03em;
}

.bc-holder-detail strong {
  color: inherit;
  font-size: .72rem;
  font-weight: 750;
}

.bc-holder-inline span {
  color: var(--bc-text-soft);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bc-holder-inline strong {
  overflow: visible;
  white-space: normal;
  line-height: 1.25;
}

.bc-holder-name {
  color: #dc2626;
  font-weight: 850;
}

.bc-holder-name-button {
  width: fit-content;
  max-width: 100%;
  min-height: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #dc2626 !important;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
  cursor: pointer;
}

.bc-holder-name-button:hover,
.bc-holder-name-button:focus-visible {
  text-decoration: underline;
}

.bc-holder-inline small {
  color: var(--bc-text-soft);
  font-size: .72rem;
  overflow: visible;
  white-space: normal;
  line-height: 1.25;
}

.bc-holder-details small {
  white-space: normal;
  text-transform: none;
}

.bc-holder-details b {
  color: #475569;
}

.bc-holder-inline button {
  justify-self: start;
  border: 1px solid var(--bc-primary);
  background: var(--bc-soft);
  color: var(--bc-primary-dark);
}

.bc-actions .danger {
  background: #fff1f0;
  color: var(--bc-danger);
}

.bc-search-grid button:disabled,
.bc-actions button:disabled,
.bc-add-row:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.bc-message {
  margin-top: 14px;
  border-radius: 10px;
  padding: 11px 13px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.bc-message.error {
  background: #fff1f0;
  color: var(--bc-danger);
}

.bc-workspace,
.bc-editors {
  display: grid;
  gap: 18px;
}

.bc-unit-list {
  display: grid;
  gap: 7px;
  max-height: 248px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.bc-unit-button {
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  background: var(--panel, #fff);
  color: inherit;
  padding: 10px 8px;
  cursor: pointer;
  font-weight: 800;
}

.bc-unit-button.active {
  border-color: #eab308;
  background: #fef9c3;
  color: #713f12;
}

.bc-unit-button.saved {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.bc-unit-button:hover:not(.active):not(.saved) {
  border-color: var(--bc-border);
  background: var(--panel, #fff);
  color: inherit;
}

.bc-unit-button.saved:hover {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.bc-main-grid {
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.bc-side-column {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
}

.unit-list-card {
  position: static;
}

.bc-lot-close-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bc-lot-close-panel button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--bc-primary);
  color: #fff;
  font-weight: 850;
}

.bc-lot-close-panel #bc-close-lot.closed {
  background: #dc2626;
  color: #fff;
  opacity: 1;
  cursor: pointer;
}

.bc-lot-close-panel #bc-reopen-lot {
  min-height: 32px;
  border: 1px solid var(--bc-border);
  background: var(--panel, #fff);
  color: var(--bc-primary-dark);
  font-size: .76rem;
}

.bc-unit-list-head,
.bc-unit-button {
  display: grid;
  grid-template-columns: repeat(4, minmax(55px, 1fr));
  align-items: center;
  gap: 5px;
}

.bc-unit-list-head {
  padding: 0 9px 7px;
  color: var(--bc-text-soft);
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.bc-unit-button span {
  text-align: center;
}

.bc-data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
}

#bc-common-fields {
  grid-template-columns: repeat(3, minmax(130px, 220px));
  justify-content: start;
}

.bc-data-item {
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  padding: 11px 12px;
  min-width: 0;
}

.bc-data-item span {
  display: block;
  color: var(--bc-text-soft);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.bc-data-item strong {
  display: block;
  word-break: break-word;
}

.bc-common-land-area {
  border-color: #5eead4;
  background: #ccfbf1;
  color: #115e59;
}

body.dark-theme .bc-common-land-area {
  border-color: #0f766e;
  background: #123d3a;
  color: #ccfbf1;
}

.bc-edit-field {
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--bc-primary);
  border-radius: 12px;
  padding: 9px 10px;
}

.bc-edit-field span {
  color: var(--bc-primary-dark);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bc-edit-field input {
  min-height: 36px;
}

.bc-terrain-area-field {
  border-color: #0ea5e9;
  background: #f0f9ff;
}

.bc-terrain-area-field span {
  color: #0369a1;
}

.bc-terrain-area-field input {
  border-color: #7dd3fc;
  font-weight: 800;
}

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

.bc-table {
  width: 100%;
  min-width: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .84rem;
}

.bc-table th,
.bc-table td {
  border-bottom: 1px solid var(--bc-border);
  padding: 10px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.bc-area-groups {
  display: grid;
  gap: 12px;
}

.bc-area-group {
  overflow: hidden;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
}

.bc-area-group-title {
  padding: 8px 10px;
  background: var(--bc-soft);
  color: var(--bc-primary-dark);
  font-size: .76rem;
  font-weight: 850;
  text-align: center;
}

.bc-area-table-wrap {
  width: 100%;
  overflow: hidden;
}

.bc-area-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  font-size: .72rem;
}

.bc-area-table th:nth-child(1) { width: 48px; }
.bc-area-table th:nth-child(2) { width: auto; }
.bc-area-table th:nth-child(3) { width: 72px; }
.bc-area-table th:nth-child(4) { width: 88px; }

.bc-area-table th,
.bc-area-table td {
  display: table-cell !important;
  padding: 7px 2px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-area-table th {
  white-space: normal;
  line-height: 1.15;
}

.construction-editor {
  min-width: 830px !important;
  table-layout: fixed !important;
}

.construction-editor th,
.construction-editor td,
.bc-area-table th,
.bc-area-table td,
.bc-recap-table th,
.bc-recap-table td {
  text-align: center;
  padding: 7px 4px;
}

.bc-table th {
  background: #f8fafc;
  color: #475569;
  font-size: .72rem;
  text-transform: uppercase;
}

.construction-editor input,
.construction-editor select {
  min-width: 0;
  min-height: 36px;
}

.construction-editor .custom-select {
  min-width: 0;
}

.construction-editor .custom-select-trigger {
  min-height: 36px;
  border-radius: 9px;
  padding: 6px 7px;
  gap: 5px;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: none !important;
}

.construction-editor .custom-select-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.construction-editor .custom-select-menu {
  min-width: 175px;
  right: auto;
  padding: 5px;
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(15,23,42,.16) !important;
}

.construction-editor .custom-select-menu:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}

.construction-editor .custom-select-option {
  display: block;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 8px;
  font-size: .72rem;
}

.construction-editor select {
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  background: var(--panel, #fff);
  color: inherit;
  padding: 7px 8px;
}

.construction-editor .bc-col-short,
.construction-editor .bc-col-remove {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
}

.construction-editor .bc-col-area {
  width: 82px;
  min-width: 82px;
}

.construction-editor .bc-col-date {
  width: 118px;
  min-width: 118px;
}

.construction-editor .bc-col-catalog {
  width: 112px;
  min-width: 112px;
}

.construction-editor .bc-col-ciiu {
  width: 52px;
  min-width: 52px;
}

.construction-editor .bc-code-input {
  width: 42px;
  min-width: 42px;
  padding-inline: 5px;
  text-align: center;
}

.bc-date-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--bc-border);
  border-radius: 9px;
  background: var(--panel, #fff);
}

.bc-date-control:focus-within {
  border-color: #60a5fa;
  outline: 2px solid rgba(59, 130, 246, .16);
}

.bc-date-control > input[data-field="mesAnioConstruccion"] {
  min-height: 34px;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  text-align: center;
  padding-inline: 5px;
}

.bc-open-month {
  width: 28px;
  height: 34px;
  border: 0;
  border-left: 1px solid var(--bc-border);
  border-radius: 0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  padding: 0;
}

.bc-open-month:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.bc-month-picker {
  position: fixed;
  z-index: 1300;
  width: min(310px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  min-width: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--bc-border);
  border-radius: 14px;
  background: var(--panel, #fff);
  color: inherit;
  box-shadow: none !important;
}

.bc-month-picker-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bc-border);
}

.bc-month-picker-head strong,
.bc-month-picker-title {
  font-size: .9rem;
  font-weight: 700;
}

.bc-month-picker-title,
.bc-month-picker-nav button,
.bc-year-grid button,
.bc-month-grid button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.bc-month-picker-title {
  padding: 8px 4px;
}

.bc-month-picker-title span {
  color: var(--bc-text-soft);
  font-size: .7rem;
}

.bc-month-picker-nav {
  display: flex;
  gap: 10px;
}

.bc-month-picker-nav button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bc-border);
  border-radius: 50%;
  background: #f8fafc;
  color: var(--bc-text-soft);
  font-size: 0;
  line-height: 0;
  box-sizing: border-box;
}

.bc-month-picker-nav button::before {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.bc-month-picker-nav button[data-month-action^="previous"]::before {
  transform: translateX(1px) rotate(-135deg);
}

.bc-month-picker-nav button[data-month-action^="next"]::before {
  transform: translateX(-1px) rotate(45deg);
}

.bc-month-picker-nav button:hover:not(:disabled),
.bc-month-picker-title:hover,
.bc-year-grid button:hover:not(:disabled),
.bc-month-grid button:hover:not(:disabled) {
  background: #f1f5f9;
}

.bc-year-grid,
.bc-month-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 6px;
  padding: 14px 12px 16px;
}

.bc-year-grid button,
.bc-month-grid button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 4px;
  font-size: .78rem;
  font-weight: 560;
}

.bc-year-grid button.selected,
.bc-month-grid button.selected {
  border-color: #94a3b8;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 700;
}

.bc-month-picker button:disabled {
  cursor: not-allowed;
  opacity: .28;
}

.bc-ciiu-state {
  color: var(--bc-text-soft);
  font-weight: 800;
}

.bc-ciiu-state.yes {
  color: #b42318;
}

.bc-view-ciiu {
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: #fff1f0;
  color: #b42318;
  font-weight: 850;
  cursor: pointer;
  padding: 5px 9px;
}

.bc-remove-row {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--bc-danger);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
}

.bc-col-remove {
  text-align: center !important;
}

.bc-recap-table input {
  width: 82px;
  min-height: 36px;
}

.bc-recap-table {
  min-width: 760px !important;
  table-layout: fixed !important;
  font-size: .72rem;
}

.bc-recap-table th,
.bc-recap-table td {
  width: 82px;
  padding: 6px 2px;
  white-space: normal;
}

.bc-recap-table th:nth-child(-n+4),
.bc-recap-table td:nth-child(-n+4) {
  width: 48px;
}

.bc-recap-table th:nth-child(5) {
  background: #fef3c7 !important;
  color: #92400e;
}

.bc-recap-table td:nth-child(5) {
  background: #fffbeb;
}

.bc-recap-table td:nth-child(5) input {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #92400e;
  font-weight: 850;
  text-align: center;
}

.bc-balance-fill {
  display: block;
  margin: 12px auto 0;
  min-height: 38px;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  padding: 8px 14px;
  cursor: pointer;
}

.bc-balance-fill:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.bc-common-construction-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--bc-primary-dark);
  font-weight: 800;
  cursor: pointer;
}

.bc-common-construction-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--bc-primary);
}

.bc-linked-doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
}

.bc-door-item {
  display: block;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.bc-door-principal {
  border-color: #f4c96b;
  background: #fff4cc;
  color: #7c4a03;
}

.bc-cotitular-modal {
  width: min(1400px, calc(100vw - 40px)) !important;
  max-width: min(1400px, calc(100vw - 40px)) !important;
  max-height: min(88dvh, 820px);
  padding: 30px;
}

.bc-cotitular-modal .bc-table-wrap {
  max-height: calc(88dvh - 125px);
}

.bc-cotitular-modal .bc-table {
  min-width: 1040px !important;
  font-size: .92rem;
}

.bc-cotitular-modal .bc-table th,
.bc-cotitular-modal .bc-table td {
  padding: 14px 18px;
}

.bc-ciiu-modal {
  width: min(430px, calc(100vw - 28px));
}

.bc-close-confirm-modal {
  width: min(460px, calc(100vw - 28px));
}

.bc-close-confirm-modal p {
  color: var(--bc-text-soft);
  line-height: 1.55;
}

.bc-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.bc-confirm-actions button {
  min-width: 92px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  font-weight: 850;
  cursor: pointer;
}

.bc-confirm-actions .secondary {
  border: 1px solid var(--bc-border);
  background: #eef2f6;
  color: #334155;
}

.bc-confirm-actions .primary {
  background: var(--bc-primary);
  color: #fff;
}

.bc-ciiu-detail {
  display: grid;
  gap: 8px;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  padding: 14px;
}

.bc-ciiu-detail span {
  color: var(--bc-text-soft);
}

.bc-works-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bc-works-controls button {
  min-height: 32px;
  border: 1px solid var(--bc-border);
  border-radius: 9px;
  padding: 6px 10px;
  background: #f8fafc;
  color: var(--bc-primary-dark);
  font-weight: 800;
  box-shadow: none !important;
}

.bc-unit-works-panel {
  border-color: #fed7aa;
  background: #fff7ed;
}

.bc-common-works-panel {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.bc-common-works-panel .bc-section-head {
  margin-bottom: 10px;
}

.bc-common-works-panel h2 {
  margin: 0;
}

.bc-unit-works-panel .bc-table-wrap,
.bc-common-works-panel .bc-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.bc-unit-works-panel .bc-works-table,
.bc-common-works-panel .bc-works-table {
  background: #fff;
}

.bc-works-table {
  min-width: 880px !important;
  table-layout: fixed !important;
  font-size: .76rem;
}

.bc-works-table th,
.bc-works-table td {
  padding: 8px 5px !important;
  text-align: center !important;
  white-space: normal;
}

.bc-works-table th:first-child,
.bc-works-table td:first-child {
  width: 190px;
  text-align: left !important;
}

.bc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.balance-ok {
  color: var(--bc-primary-dark);
  font-weight: 800;
}

.balance-pending {
  color: #ca8a04;
  font-weight: 800;
}

.balance-exceeded {
  color: var(--bc-danger);
  font-weight: 800;
}

.bc-empty {
  color: var(--bc-text-soft);
  padding: 12px 0;
}

body.dark-theme .bc-card,
body.dark-theme .bc-search-grid input,
body.dark-theme .construction-editor input,
body.dark-theme .construction-editor select,
body.dark-theme .bc-recap-table input,
body.dark-theme .bc-edit-field input,
body.dark-theme .bc-unit-button {
  background: #14202b;
  border-color: #334155;
}

body.dark-theme .bc-terrain-area-field {
  border-color: #0369a1;
  background: #102c3a;
}

body.dark-theme .bc-terrain-area-field span {
  color: #7dd3fc;
}

body.dark-theme .bc-table th {
  background: #1e293b;
  color: #cbd5e1;
}

body.dark-theme .bc-recap-table th:nth-child(5) {
  background: #4b3d10 !important;
  color: #fde68a;
}

body.dark-theme .bc-recap-table td:nth-child(5),
body.dark-theme .bc-recap-table td:nth-child(5) input {
  border-color: #a16207;
  background: #352f16;
  color: #fde68a;
}

body.dark-theme .bc-area-group,
body.dark-theme .bc-door-item,
body.dark-theme .bc-ciiu-detail,
body.dark-theme .bc-date-control,
body.dark-theme .bc-holder-detail,
body.dark-theme .bc-month-picker {
  border-color: #334155;
  background: #14202b;
}

body.dark-theme .bc-door-principal {
  border-color: #a16207;
  background: #3f3214;
  color: #fde68a;
}

body.dark-theme .bc-area-group-title {
  background: #123d3a;
  color: #99f6e4;
}

body.dark-theme .bc-open-month {
  border-left-color: #334155;
  background: #1e293b;
  color: #e2e8f0;
}

body.dark-theme .bc-open-month:hover {
  background: #263548;
}

body.dark-theme .bc-month-picker-nav button:hover:not(:disabled),
body.dark-theme .bc-month-picker-title:hover,
body.dark-theme .bc-year-grid button:hover:not(:disabled),
body.dark-theme .bc-month-grid button:hover:not(:disabled) {
  background: #263548;
}

body.dark-theme .bc-year-grid button.selected,
body.dark-theme .bc-month-grid button.selected {
  border-color: #60a5fa;
  background: #173b67;
  color: #dbeafe;
}

body.dark-theme .balance-ok { color: #5eead4; }
body.dark-theme .balance-pending { color: #facc15; }
body.dark-theme .balance-exceeded { color: #fca5a5; }

body.dark-theme .bc-holder-details b {
  color: #cbd5e1;
}

body.dark-theme .bc-view-ciiu {
  border-color: #7f1d1d;
  background: #451a1a;
  color: #fecaca;
}

body.dark-theme .bc-unit-button.active {
  border-color: #eab308;
  background: #4b3d10;
  color: #fef08a;
}

body.dark-theme .bc-unit-button.saved,
body.dark-theme .bc-unit-button.saved:hover {
  border-color: #15803d;
  background: #12351f;
  color: #bbf7d0;
}

body.dark-theme .bc-unit-button:hover:not(.active):not(.saved) {
  border-color: #475569;
  background: #14202b;
  color: #e7edf7;
}

body.dark-theme .bc-works-controls button {
  border-color: #334155;
  background: #263548;
  color: #dbeafe;
}

body.dark-theme .bc-unit-works-panel {
  border-color: #7c4a1d;
  background: #342514;
}

body.dark-theme .bc-common-works-panel {
  border-color: #5b4b83;
  background: #28203d;
}

body.dark-theme .bc-unit-works-panel .bc-table-wrap,
body.dark-theme .bc-common-works-panel .bc-table-wrap,
body.dark-theme .bc-unit-works-panel .bc-works-table,
body.dark-theme .bc-common-works-panel .bc-works-table {
  border-color: #334155;
  background: #14202b;
}

body.dark-theme .construction-editor .custom-select-trigger,
body.dark-theme .construction-editor .custom-select-menu,
body.dark-theme .construction-editor .custom-select-option {
  border-color: #334155;
  background: #14202b;
  color: #e7edf7;
}

body.dark-theme .construction-editor .custom-select-option:hover {
  background: #263548;
}

body.dark-theme .construction-editor .custom-select-option.selected {
  background: #173b67;
  color: #dbeafe;
}

body.dark-theme .bc-common-land-area {
  border-color: #0f766e;
  background: #123d3a;
  color: #ccfbf1;
}

body.dark-theme .bc-add-row,
body.dark-theme .bc-actions .secondary,
body.dark-theme .bc-search-actions .secondary,
body.dark-theme .bc-confirm-actions .secondary {
  background: #263548;
  color: #e2e8f0;
}

body.dark-theme .bc-add-row {
  background: #173b67;
  border-color: #3b82f6;
  color: #dbeafe;
}

@media (max-width: 1300px) {
  .bc-search-grid { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .bc-search-grid:has(.bc-holder-inline[hidden]) { grid-template-columns: repeat(3, minmax(110px, 160px)); }
  .bc-search-grid:has(.bc-holder-inline[hidden]) .bc-search-actions {
    width: min(300px, 100%);
    grid-column: 1 / -1;
    justify-self: center;
  }
  .bc-search-actions { grid-column: 1 / 3; }
  .bc-holder-inline { grid-column: 3; grid-template-columns: 1fr; }
  .bc-main-grid { grid-template-columns: 360px minmax(0, 1fr); }
}

@media (max-width: 1050px) {
  .bc-main-grid { grid-template-columns: 1fr; }
  .bc-side-column { position: static; }
  .bc-data-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .bc-area-groups { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
}

@media (max-width: 680px) {
  .common-property-content { width: min(100% - 18px, 1560px); margin-top: 12px; }
  .bc-card { padding: 14px; border-radius: 14px; }
  .bc-search-grid { grid-template-columns: 1fr; }
  .bc-search-grid:has(.bc-holder-inline[hidden]) { grid-template-columns: 1fr; }
  .bc-search-grid:has(.bc-holder-inline[hidden]) .bc-search-actions { width: 100%; }
  .bc-search-actions,
  .bc-holder-inline { grid-column: auto; }
  .bc-holder-inline { grid-template-columns: 1fr; border-left: 0; border-top: 1px solid var(--bc-border); padding: 14px 0 0; }
  .bc-data-grid,
  .bc-recap-grid { grid-template-columns: 1fr; }
  #bc-common-fields { grid-template-columns: 1fr; }
  .bc-area-groups { grid-template-columns: 1fr; }
  .construction-editor { min-width: 790px; }
  .bc-recap-table { min-width: 760px; }
  .bc-actions { flex-direction: column; }
  .bc-search-actions { grid-template-columns: 1fr; }
}
.bc-area-terrain { color: #b91c1c; }
body.dark-theme .bc-area-terrain { color: #fca5a5; }

.bc-terrain-area-field.is-disabled {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.bc-terrain-area-field.is-disabled span {
  color: #475569;
}

.bc-terrain-area-field.is-disabled input:disabled {
  background: #f1f5f9;
  border-color: #9ca3af;
  color: #475569;
  -webkit-text-fill-color: currentColor;
  opacity: 1;
  cursor: not-allowed;
}

body.dark-theme .bc-terrain-area-field.is-disabled {
  background: #27313f;
  border-color: #64748b;
}

body.dark-theme .bc-terrain-area-field.is-disabled span {
  color: #cbd5e1;
}

body.dark-theme .bc-terrain-area-field.is-disabled input:disabled {
  background: #334155 !important;
  border-color: #64748b !important;
  color: #cbd5e1 !important;
}
.bc-close-issues-modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: none; }
.bc-close-issues-modal h2 { padding-right: 32px; }
#bc-close-issues-list { padding-left: 24px; text-align: left; line-height: 1.6; overflow-wrap: anywhere; }
#bc-close-issues-list li + li { margin-top: 12px; }
#bc-close-issues-ok { width: 100%; }

/* Dark surfaces and balances must override the shared table text rule. */
body.dark-theme.common-property-page {
  --panel: #14202b;
  --bc-soft: #123d3a;
  --bc-border: #334155;
  --bc-text-soft: #a7b3c5;
  --bc-primary-dark: #99f6e4;
  --bc-danger: #fca5a5;
  --bc-warning: #fcd34d;
  color-scheme: dark;
}
body.dark-theme.common-property-page .bc-message { background: #142c48; color: #bfdbfe; border: 1px solid #365783; }
body.dark-theme.common-property-page .bc-message.error { background: #351e27; color: #fecaca; border-color: #714050; }
body.dark-theme.common-property-page .bc-chip { background: #123d3a; color: #99f6e4; }
body.dark-theme.common-property-page .bc-area-table th:nth-child(4) { background: #3a301c !important; color: #fde68a !important; }
body.dark-theme.common-property-page .bc-area-table td[data-area-remaining] { font-weight: 850; }
body.dark-theme.common-property-page .bc-area-table td.balance-ok { background: #12352d; color: #99f6e4 !important; border-left: 3px solid #2dd4bf; }
body.dark-theme.common-property-page .bc-area-table td.balance-pending { background: #3a301c; color: #fde68a !important; border-left: 3px solid #fbbf24; }
body.dark-theme.common-property-page .bc-area-table td.balance-exceeded { background: #351e27; color: #fecaca !important; border-left: 3px solid #fb7185; }
body.dark-theme.common-property-page .bc-actions .danger,
body.dark-theme.common-property-page .bc-remove-row { background: #351e27; color: #fecaca; }
body.dark-theme.common-property-page .bc-balance-fill { background: #142c48; color: #bfdbfe; border-color: #365783; }
body.dark-theme.common-property-page .bc-balance-fill:hover:not(:disabled) { background: #1b3755; color: #dbeafe; }
body.dark-theme.common-property-page .bc-month-picker-nav button { background: #1e293b; color: #cbd5e1; }
body.dark-theme.common-property-page .bc-holder-name { color: #fca5a5; }
body.dark-theme.common-property-page .bc-holder-name-button { color: #fca5a5 !important; }
body.dark-theme.common-property-page .bc-ciiu-state.yes { color: #fca5a5; }
