/* BIMTRAZA — Contabilidad profesional */
#bimtraza-conta.bt-co {
  position: fixed;
  z-index: 21610;
  top: var(--bimtraza-menubar-h, 38px);
  left: var(--bimtraza-shell-width, 148px);
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background:
    radial-gradient(1100px 380px at 100% -8%, rgba(30, 64, 175, 0.12), transparent 50%),
    linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #0f172a;
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
#bimtraza-conta.bt-co[hidden] {
  display: none !important;
}

.bt-co-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-bottom: 1px solid #cbd5e1;
}
.bt-co-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}
.bt-co-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
  color: #eff6ff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.bt-co-brand h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
}
.bt-co-brand p {
  margin: 2px 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.bt-co-project {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #334155;
}
.bt-co-project strong {
  color: #0f172a;
}
.bt-co-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.bt-co-btn {
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 7px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.bt-co-btn:hover {
  background: #e2e8f0;
}
.bt-co-btn--primary {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}
.bt-co-btn--primary:hover {
  background: #1e3a8a;
}
.bt-co-btn--danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.bt-co-btn--ghost {
  background: transparent;
}
.bt-co-btn--ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.bt-co-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  overflow-x: auto;
  border-bottom: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.55);
}
.bt-co-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: #475569;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
}
.bt-co-tab.is-active {
  background: #fff;
  color: #1e40af;
  border-color: #cbd5e1;
}

.bt-co-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  overflow: hidden;
}
.bt-co-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.bt-co-panel.is-active {
  display: flex;
}

.bt-co-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 1200px) {
  .bt-co-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.bt-co-kpi {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 72px;
}
.bt-co-kpi span {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bt-co-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
  font-weight: 780;
  color: #0f172a;
  line-height: 1.1;
}
.bt-co-kpi.is-ok strong {
  color: #15803d;
}
.bt-co-kpi.is-bad strong {
  color: #b91c1c;
}
.bt-co-kpi.is-warn strong {
  color: #b45309;
}

.bt-co-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.bt-co-toolbar input[type="search"],
.bt-co-toolbar select,
.bt-co-editor input,
.bt-co-editor select,
.bt-co-editor textarea {
  border: 1px solid #94a3b8;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}
.bt-co-toolbar input[type="search"] {
  min-width: 200px;
  flex: 1 1 180px;
}

.bt-co-split {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 10px;
}
@media (max-width: 980px) {
  .bt-co-split {
    grid-template-columns: 1fr;
  }
}
.bt-co-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.bt-co-card-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 750;
}
.bt-co-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.bt-co-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bt-co-table th,
.bt-co-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}
.bt-co-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}
.bt-co-table tbody tr {
  cursor: pointer;
}
.bt-co-table tbody tr:hover {
  background: #eff6ff;
}
.bt-co-table tbody tr.is-selected {
  background: #dbeafe;
  outline: 1px solid #93c5fd;
  outline-offset: -1px;
}
.bt-co-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bt-co-muted {
  color: #64748b;
  font-size: 12px;
  padding: 16px;
}
.bt-co-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.bt-co-badge--draft {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.bt-co-badge--open {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.bt-co-badge--ok {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.bt-co-badge--bad {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.bt-co-badge--partial {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}

.bt-co-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.bt-co-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bt-co-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bt-co-form-grid label.full {
  grid-column: 1 / -1;
}
.bt-co-lines {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.bt-co-lines table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.bt-co-lines th,
.bt-co-lines td {
  border-bottom: 1px solid #e2e8f0;
  padding: 5px 6px;
}
.bt-co-lines input,
.bt-co-lines select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 11px;
}
.bt-co-editor-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 4px;
}
.bt-co-balance {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
}
.bt-co-balance.is-ok {
  color: #15803d;
}
.bt-co-balance.is-bad {
  color: #b91c1c;
}
.bt-co-toast {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  max-width: min(360px, 80vw);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  display: none;
}
.bt-co-toast.is-on {
  display: block;
}
.bt-co-toast.is-err {
  background: #991b1b;
}
