/* Ajustes de SIBA: notificaciones y apartados de costo. */
body.erp-workspace-mode .app-toast-region { top: 22px !important; right: 22px !important; bottom: auto !important; width: min(410px, calc(100vw - 44px)) !important; }
body.erp-workspace-mode .app-toast {
  --app-toast-accent: #f58220;
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  min-height: 82px !important;
  padding: 17px 46px 17px 17px !important;
  gap: 13px !important;
  border: 1px solid #d9dcde !important;
  border-left: 3px solid #f58220 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #202528 !important;
  box-shadow: 0 8px 26px #05070814 !important;
  animation: siba-toast-enter 220ms ease-out both !important;
}
body.erp-workspace-mode .app-toast .app-toast-icon { width: 30px !important; height: 30px !important; min-height: 30px !important; border: 1px solid #b9d8c5 !important; border-radius: 0 !important; background: #eef6f1 !important; color: #2d6946 !important; font-size: 17px !important; font-weight: 700 !important; }
body.erp-workspace-mode .app-toast-error { border-left-color: #b64137 !important; --app-toast-accent: #b64137; }
body.erp-workspace-mode .app-toast-error .app-toast-icon { border-color: #ecc6c0 !important; background: #fff1ee !important; color: #a9362d !important; }
body.erp-workspace-mode .app-toast .app-toast-copy { min-width: 0; gap: 4px !important; }
body.erp-workspace-mode .app-toast .app-toast-copy strong { color: #202528 !important; font-size: 14px !important; font-weight: 700 !important; }
body.erp-workspace-mode .app-toast .app-toast-copy span { color: #5e656a !important; font-size: 12px !important; line-height: 1.5 !important; overflow-wrap: anywhere; }
body.erp-workspace-mode .app-toast .app-toast-copy small { color: #747b80 !important; font-size: 11px !important; }
body.erp-workspace-mode .app-toast .app-toast-close { top: 11px !important; right: 9px !important; width: 28px !important; height: 28px !important; border-radius: 0 !important; background: transparent !important; color: #747b80 !important; font-size: 21px !important; }
body.erp-workspace-mode .app-toast .app-toast-close:hover { transform: none !important; background: #f1f2f3 !important; color: #202528 !important; }
body.erp-workspace-mode .app-toast::after { height: 2px; background: var(--app-toast-accent); }
body.erp-workspace-mode .app-toast.is-leaving { opacity: 0 !important; transform: translateY(-6px) !important; transition: opacity 180ms ease, transform 180ms ease !important; }
#budgetCostsPanel > .budget-cost-card { min-width: 0; }
#budgetCostsPanel .budget-equipment-table { overflow-x: auto; }
#loginView.pg-login .pg-login-alert { border-radius: 0; background: #fff8f4; border-color: #edcfc0; }
@keyframes siba-toast-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
body.erp-workspace-mode.dark-mode .app-toast { background: #1b1e20 !important; border-color: #3d4247 !important; border-left-color: #f58220 !important; }
body.erp-workspace-mode.dark-mode .app-toast .app-toast-copy strong { color: #f1f2f3 !important; }
body.erp-workspace-mode.dark-mode .app-toast .app-toast-copy span { color: #c3c7cb !important; }
body.erp-workspace-mode.dark-mode .app-toast .app-toast-copy small, body.erp-workspace-mode.dark-mode .app-toast .app-toast-close { color: #a1a8ae !important; }
body.erp-workspace-mode.dark-mode .app-toast .app-toast-close:hover { background: #31363a !important; color: #fff !important; }
body.erp-workspace-mode.dark-mode .app-toast-error { border-left-color: #dc766a !important; }
@media (max-width: 600px) { body.erp-workspace-mode .app-toast-region { top: 12px !important; right: 12px !important; width: calc(100vw - 24px) !important; } }
@media (prefers-reduced-motion: reduce) { body.erp-workspace-mode .app-toast, body.erp-workspace-mode .app-toast::after { animation: none !important; transition: none !important; } }

/* Catálogo de conceptos: misma secuencia de columnas en captura y documento. */
body.erp-workspace-mode #clientQuoteModule .client-quote-table { max-width: 100%; overflow-x: auto; }
body.erp-workspace-mode #clientQuoteModule .client-quote-head,
body.erp-workspace-mode #clientQuoteModule .siba-quote-row {
  grid-template-columns: 104px minmax(280px, 1fr) 58px 94px 116px 124px 82px !important;
  min-width: 1020px; gap: 10px; padding: 12px 14px; align-items: start;
}
body.erp-workspace-mode #presupuestoModule #clientQuoteModule .client-quote-head { background: #0d2d50 !important; color: #fff !important; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-key { display: grid; gap: 6px; min-width: 0; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row input,
body.erp-workspace-mode #clientQuoteModule .siba-quote-row select,
body.erp-workspace-mode #clientQuoteModule .siba-quote-row textarea { width: 100%; min-width: 0; font-size: 12px !important; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row textarea { min-height: 86px; resize: vertical; line-height: 1.5; padding: 9px; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row input:disabled { visibility: hidden; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row [data-client-quote-amount] { padding-top: 11px; text-align: right; white-space: nowrap; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row-actions .remove-client-quote-row { grid-column: 1 / -1; justify-self: center; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row-actions button { width: 32px; height: 32px; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row-actions button:disabled { opacity: .35; }
body.erp-workspace-mode #presupuestoModule #clientQuoteModule .siba-quote-row.is-titulo { background: #e4ebf2 !important; }
body.erp-workspace-mode #presupuestoModule #clientQuoteModule .siba-quote-row.is-capitulo { background: #eff3f7 !important; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-row.is-titulo textarea,
body.erp-workspace-mode #clientQuoteModule .siba-quote-row.is-capitulo textarea { font-weight: 700; }
body.erp-workspace-mode #clientQuoteModule .siba-quote-add-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.erp-workspace-mode.dark-mode #presupuestoModule #clientQuoteModule .siba-quote-row.is-titulo,
body.erp-workspace-mode.dark-mode #presupuestoModule #clientQuoteModule .siba-quote-row.is-capitulo { background: #253749 !important; }

/* Herramientas se despliega dentro del área desplazable del menú. */
#appView.command-center #mainNav .sidebar-tools > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 10px 14px; border-radius: 5px; color: var(--erp-muted, #687886); font-size: 12px; font-weight: 500; cursor: pointer; list-style: none; user-select: none; }
#appView #mainNav .sidebar-tools > summary::-webkit-details-marker { display: none; }
#appView #mainNav .sidebar-tools > summary .sidebar-tools-chevron { margin-left: auto; transition: transform 180ms ease; }
#appView #mainNav .sidebar-tools[open] > summary .sidebar-tools-chevron { transform: rotate(180deg); }
#appView #mainNav .sidebar-tools > summary:hover { background: #102f5009; color: #102f50; }
#appView #mainNav .sidebar-tools > summary:focus-visible { outline: 2px solid #f58220; outline-offset: -2px; }
#appView #mainNav .sidebar-tools-items { padding: 3px 0 6px; }
#appView.sidebar-collapsed #mainNav .sidebar-tools > summary > span, #appView.sidebar-collapsed #mainNav .sidebar-tools-chevron { display: none; }
body.dark-mode #appView #mainNav .sidebar-tools > summary:hover { color: #e7edf3; background: #ffffff0b; }
@media (prefers-reduced-motion: reduce) { #appView #mainNav .sidebar-tools-chevron { transition: none; } }

/* Cada cotización reserva el ancho real del monto y de su botón. */
body.erp-workspace-mode #appView #presupuestoModule .projects-list { container: siba-quotes / inline-size; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-card {
  grid-template-columns: minmax(0,1.7fr) minmax(0,1.1fr) minmax(0,1fr) max-content max-content 34px !important;
  grid-template-areas: "main meta status amount actions flag" !important;
  gap: 16px 22px !important;
  padding: 18px !important;
  width: 100% !important; max-width: 100%; box-sizing: border-box;
}
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-main { grid-area: main !important; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-meta { grid-area: meta !important; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-meta span { white-space: normal !important; overflow: visible !important; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-status { grid-area: status !important; min-width: 0; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-amount { grid-area: amount !important; display: grid !important; min-width: max-content !important; white-space: nowrap !important; text-align: right !important; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-amount strong { display: block; font-variant-numeric: tabular-nums; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .budget-actions { grid-area: actions !important; display: flex !important; flex-wrap: nowrap !important; width: max-content; padding: 0 !important; margin: 0 !important; justify-self: end; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .budget-actions button { position: static !important; margin: 0 !important; white-space: nowrap; min-height: 38px; }
body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-card > .row-flag-cell { grid-area: flag !important; position: static !important; order: initial !important; justify-self: end !important; align-self: center !important; width: 34px; margin: 0 !important; }
@container siba-quotes (max-width: 1000px) {
  body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-card { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 34px !important; grid-template-areas: "main meta flag" "status meta flag" "amount actions flag" !important; }
  body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-amount { text-align: left !important; }
}
@container siba-quotes (max-width: 560px) {
  body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-card { grid-template-columns: minmax(0,1fr) 34px !important; grid-template-areas: "main flag" "meta meta" "status status" "amount amount" "actions actions" !important; padding: 16px !important; }
  body.erp-workspace-mode #appView #presupuestoModule .projects-list .budget-actions { justify-self: start; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 1260px) {
    body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-card { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 34px !important; grid-template-areas: "main meta flag" "status meta flag" "amount actions flag" !important; }
  }
  @media (max-width: 700px) {
    body.erp-workspace-mode #appView #presupuestoModule .projects-list .project-list-card { grid-template-columns: minmax(0,1fr) 34px !important; grid-template-areas: "main flag" "meta meta" "status status" "amount amount" "actions actions" !important; }
    body.erp-workspace-mode #appView #presupuestoModule .projects-list .budget-actions { justify-self: start; }
  }
}

/* Informes dentro de la ficha operativa. */
#appView #proyectosModule .operational-project-reports { min-width: 0; border-radius: 5px; }
#appView #proyectosModule .operational-project-reports .budget-supervision-card { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
#appView #proyectosModule .operational-project-reports .budget-supervision-card > div:first-child { flex: 1 1 155px; min-width: 0; overflow-wrap: anywhere; }
#appView #proyectosModule .operational-project-reports .budget-supervision-actions { flex: 1 1 210px; flex-wrap: wrap; }
#appView #proyectosModule .operational-project-reports .budget-report-pdf-preview { flex: 1 0 100%; min-width: 0; }
#appView #proyectosModule .operational-project-reports .budget-report-pdf-preview iframe { width: 100%; height: min(70vh, 620px); }
@media (max-width: 620px) {
  #appView #proyectosModule .operational-project-reports { padding: 14px; }
  #appView #proyectosModule .operational-project-reports .budget-supervision-heading { flex-wrap: wrap; }
  #appView #proyectosModule .operational-project-reports .budget-supervision-actions { justify-content: flex-start; }
}
