/**
 * Empresa — estilos globales (misma linea visual que Patrimonio Admin).
 */
:root {
  --color-bg: #0f1419;
  --color-surface: #1a2332;
  --color-surface-hover: #243047;
  --color-border: #2d3a4f;
  --color-text: #e8edf4;
  --color-text-muted: #8b9cb3;
  --color-accent: #3d9cf5;
  --color-accent-soft: rgba(61, 156, 245, 0.15);
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --sidebar-width: 260px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 100;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.main {
  flex: 1;
  padding: 1.75rem 2rem 3rem;
  min-width: 0;
}

.main__header {
  margin-bottom: 1.75rem;
}

.main__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.main__subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.main__header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.main__header-text {
  min-width: 0;
  flex: 1 1 12rem;
}

.main__user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  font-size: 0.88rem;
}

.main__user-label {
  font-weight: 600;
  color: var(--color-text);
}

.main__user-email {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--color-bg, #0f1419);
}

.auth-gate--loading {
  color: var(--color-text-muted);
}

.auth-login-card {
  max-width: 400px;
  width: 100%;
}

.auth-login-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.view {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.card__desc {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: linear-gradient(145deg, var(--color-surface) 0%, #1e2a3d 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.metric-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.metric-card__value {
  font-size: 1.25rem;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.data-table tbody tr:hover {
  background: var(--color-surface-hover);
}

.data-table tbody tr.tr--clickable {
  cursor: pointer;
}

.data-table tbody tr.tr--clickable:hover {
  background: rgba(61, 156, 245, 0.08);
}

.data-table tbody tr.tr--clickable:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.data-table tbody td.td--proyecto-nombre {
  cursor: pointer;
}

.data-table tbody td.td--proyecto-nombre:hover {
  background: rgba(61, 156, 245, 0.08);
}

.data-table tbody td.td--proyecto-nombre:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.detalle-proyecto__section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.detalle-proyecto__sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge--natural {
  background: rgba(61, 156, 245, 0.2);
  color: var(--color-accent);
}

.badge--juridica {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.badge--cot-enviada {
  background: rgba(251, 191, 36, 0.2);
  color: var(--color-warning);
}

.badge--cot-aprobada {
  background: rgba(52, 211, 153, 0.2);
  color: var(--color-success);
}

.badge--cot-rechazada {
  background: rgba(248, 113, 113, 0.2);
  color: var(--color-danger);
}

.estado-switch {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.estado-switch__btn {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}

.estado-switch__btn + .estado-switch__btn {
  border-left: 1px solid var(--color-border);
}

.estado-switch__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.estado-switch__btn.is-active {
  font-weight: 700;
}

.estado-switch__btn--enviada.is-active {
  background: rgba(251, 191, 36, 0.2);
  color: var(--color-warning);
}

.estado-switch__btn--aprobada.is-active {
  background: rgba(52, 211, 153, 0.2);
  color: var(--color-success);
}

.estado-switch__btn--rechazada.is-active {
  background: rgba(248, 113, 113, 0.2);
  color: var(--color-danger);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.search-fold {
  margin: 0.55rem 0 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.32);
}

.search-fold--visible .search-fold__body {
  display: flex;
  padding: 0.75rem 0.8rem;
}

.search-fold__summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 0.86rem;
  color: #cbd5e1;
  padding: 0.6rem 0.8rem;
}

.search-fold__summary::-webkit-details-marker {
  display: none;
}

.search-fold__summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.4rem;
  transform: translateY(-0.02rem);
  transition: transform 0.18s ease;
}

.search-fold[open] .search-fold__summary::before {
  transform: rotate(90deg) translateY(-0.02rem);
}

.search-fold__body {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.8rem 0.75rem;
}

.search-fold__input {
  flex: 1 1 20rem;
  min-width: 16rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
}

.search-fold__input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

@media (max-width: 640px) {
  .search-fold__body {
    flex-wrap: wrap;
  }

  .search-fold__input {
    min-width: 100%;
  }
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table--compact th,
.data-table--compact td {
  font-size: 0.82rem;
  white-space: nowrap;
}

.data-table--compact input[type="text"],
.data-table--compact input[type="number"],
.data-table--compact input[type="date"],
.data-table--compact select {
  max-width: 100%;
  font: inherit;
  font-size: 0.85rem;
}

.data-table--compact td:nth-child(6),
.data-table--compact td:nth-child(15),
.data-table--compact td:nth-child(18) {
  white-space: normal;
  max-width: 14rem;
}

.data-table--compact td.proyecto-facturas-td {
  white-space: normal;
  max-width: 24rem;
  vertical-align: top;
}

.data-table--compact td.td--proyecto-por-pagar {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table--compact th.th--proyecto-por-pagar {
  text-align: center;
}

.data-table--compact th.th--proyecto-facturas,
.data-table--compact td.td--proyecto-facturas {
  text-align: center;
}

.data-table--compact td.td--proyecto-por-pagar .por-pagar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.por-pagar-chip {
  min-width: 7.5rem;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
}

.por-pagar-chip--deuda {
  border-color: rgba(234, 179, 8, 0.45);
  color: #facc15;
  background: rgba(234, 179, 8, 0.12);
}

.por-pagar-chip--pagado {
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.proyecto-facturas-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}

.proyecto-factura-block {
  display: block;
  width: 100%;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.proyecto-factura-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.proyecto-factura-line {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
}

.proyecto-factura-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.proyecto-factura-detail__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.proyecto-factura-detail__k {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.factura-estado-icon {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.factura-estado-icon--pendiente {
  background: var(--color-warning);
}

.factura-estado-icon--pagado {
  background: var(--color-success);
}

.factura-estado-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.detalle-cotizacion {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.65rem 1.25rem;
  margin: 0;
  font-size: 0.9rem;
}

.detalle-cotizacion dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detalle-cotizacion dd {
  margin: 0;
  line-height: 1.45;
}

.detalle-cotizacion__texto {
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-hint {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.nav-item.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

.nav-item__icon {
  opacity: 0.85;
  width: 1.25rem;
  text-align: center;
}

/* Formularios CRUD (modal) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
}

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

.field span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field input,
.field select,
.field textarea {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.field input.input-readonly {
  background: var(--color-surface);
  opacity: 0.92;
  cursor: default;
}

.field input.input-readonly:focus {
  outline: none;
}

.field-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin: 0.15rem 0 0;
}

.crud-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.crud-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--color-text);
}

.check-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-accent);
}

.btn {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

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

.btn--pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #e5252a;
  font-weight: 600;
}

.btn--pdf:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.btn--pdf__icon {
  display: flex;
  line-height: 0;
}

/* Icono avión de papel — enviar documento por correo */
.btn--mail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.42rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn--mail-icon:hover:not(:disabled) {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: #9fd6ff;
}

.btn--mail-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--mail-icon svg {
  display: block;
}

.btn--mail-icon--row {
  padding: 0.22rem 0.3rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
}

.data-table .th--mail-col,
.data-table .td--mail-col {
  width: 3rem;
  text-align: center;
  vertical-align: middle;
}

.btn--primary {
  background: var(--color-accent);
  color: #0a0e14;
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn--ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.btn--danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--color-danger);
}

.btn--danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.12);
}

.btn--sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
}

.table-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.data-table th.actions-col,
.data-table td.actions-col {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.form-error {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--color-danger);
  font-size: 0.85rem;
}

.form-success {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--color-success);
  font-size: 0.85rem;
}

.form-success--block {
  margin: 0 0 0.85rem;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 600;
}

.config-empresa-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.config-logo-preview-wrap {
  margin-top: 0.35rem;
}

.config-logo-preview-box {
  position: relative;
  display: inline-block;
}

.config-logo-remove-btn {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid rgba(248, 113, 113, 0.7);
  border-radius: 999px;
  background: #1b2433;
  color: var(--color-danger);
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.config-logo-remove-btn:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.16);
}

.config-logo-remove-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.config-logo-preview {
  max-height: 72px;
  max-width: 220px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 0.35rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal__panel--wide {
  width: min(760px, 100%);
}

.modal__panel--facturas {
  width: min(920px, calc(100vw - 2.5rem));
  max-width: 100%;
}

.factura-modal-table-wrap {
  margin-top: 0.75rem;
}

.data-table--compact.factura-modal-table {
  min-width: 44rem;
}

.data-table--compact.factura-modal-table th:not(.factura-modal-actions-col),
.data-table--compact.factura-modal-table td:not(.factura-modal-actions-cell) {
  white-space: normal;
  max-width: 10rem;
  vertical-align: middle;
}

.data-table--compact.factura-modal-table .factura-modal-actions-col,
.data-table--compact.factura-modal-table .factura-modal-actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1%;
  min-width: 10.5rem;
  max-width: none;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--color-surface);
  box-shadow: -8px 0 12px -6px rgba(0, 0, 0, 0.45);
}

.data-table--compact.factura-modal-table thead .factura-modal-actions-col {
  z-index: 3;
  font-size: 0.68rem;
}

.data-table--compact.factura-modal-table tbody tr:hover .factura-modal-actions-cell {
  background: var(--color-surface-hover);
}

.factura-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__close {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.modal__close:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal__hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.proyecto-numero-btn {
  font-variant-numeric: tabular-nums;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
}

/* PDF a un extremo; Cerrar / Editar (u otras acciones) al otro */
.modal__footer--split {
  width: 100%;
  align-self: stretch;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.modal__footer--split .modal__footer__start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.modal__footer--split .modal__footer__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-left: auto;
}

.modal__footer .btn--danger {
  margin-right: auto;
}

.modal__footer--split .btn--danger {
  margin-right: 0;
}

.reuse-cotiz-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  margin: 3px 0 0;
  padding: 0;
  list-style: none;
  max-height: 11.5rem;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.reuse-cotiz-list__item {
  margin: 0;
  padding: 0.38rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.25;
  cursor: pointer;
  border-bottom: 1px solid rgba(45, 58, 79, 0.6);
  color: var(--color-text);
}

.reuse-cotiz-list__item:last-child {
  border-bottom: none;
}

.reuse-cotiz-list__item:hover {
  background: var(--color-surface-hover);
}

@media (max-width: 900px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .main {
    padding: 4rem 1.25rem 2rem;
  }
}
