:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #17212b;
  background: #f3f5f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --navy: #252525;
  --blue: #438fd4;
  --line: #d7dce1;
  --muted: #65717c;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.2rem;
  padding: 0.45rem max(0.75rem, env(safe-area-inset-left));
  color: #fff;
  background: var(--navy);
  box-shadow: 0 2px 6px #0002;
}

.brand {
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  margin-top: 0.18rem;
  color: #c9cdd1;
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  gap: 0.3rem;
}

.icon-button,
.close-button {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
}

.icon-button:hover,
.close-button:hover {
  background: #ffffff1c;
}

.icon-button svg,
.nav-button svg,
.floating-button svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.demo-banner {
  padding: 0.55rem 1rem;
  color: #48350f;
  background: #fff1cb;
  font-size: 0.78rem;
  text-align: center;
}

.search-panel {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.search-panel input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid #b9c3cc;
  border-radius: 0.5rem;
}

.search-panel button {
  border: 0;
  color: #075b9c;
  background: transparent;
  font-weight: 600;
}

.drawer {
  position: absolute;
  z-index: 6;
  top: 4.2rem;
  left: 0.6rem;
  width: min(21rem, calc(100vw - 1.2rem));
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0 0 0.8rem 0.8rem;
  background: #fff;
  box-shadow: 0 0.6rem 1.5rem #0003;
}

.drawer p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.role-preview {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.role-preview label {
  font-size: 0.85rem;
  font-weight: 700;
}

.role-preview select {
  padding: 0.65rem;
  border: 1px solid #aeb8c1;
  border-radius: 0.45rem;
  background: #fff;
}

.drawer-note {
  margin-bottom: 0;
  font-size: 0.76rem !important;
}

.demo-warning {
  margin: 0.8rem;
  padding: 0.9rem;
  border: 1px solid #f1c57b;
  border-radius: 0.6rem;
  color: #543b12;
  background: #fff8e9;
}

main {
  width: min(100%, 70rem);
  margin: 0 auto;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.7rem;
}

.summary-item {
  min-width: 0;
  padding: 0.65rem 0.55rem;
  border: 1px solid #e0e5e9;
  border-radius: 0.55rem;
  background: #fff;
}

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

.summary-item strong {
  font-size: 1.1rem;
}

.summary-item span {
  overflow: hidden;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.2rem 0.7rem 0.8rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.status-tab {
  flex: 0 0 auto;
  padding: 0.48rem 0.75rem;
  border: 1px solid #cbd3da;
  border-radius: 99px;
  color: #344653;
  background: #fff;
  font-size: 0.8rem;
}

.status-tab.is-active {
  border-color: #1d5e91;
  color: #fff;
  background: #1d5e91;
}

.view-panel {
  padding: 0 0.7rem 1rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.1rem 0.35rem 0.55rem;
}

.section-heading h1 {
  margin: 0;
  font-size: 1.15rem;
}

.section-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.role-badge {
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem;
  border-radius: 99px;
  color: #23465d;
  background: #dcebf5;
  font-size: 0.72rem;
  font-weight: 700;
}

.dispatch-list,
.updates-list {
  border-top: 1px solid var(--line);
}

.dispatch-group-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid #cdd4da;
  color: #294354;
  background: #e8edf1;
  font-size: 0.78rem;
  font-weight: 700;
}

.dispatch-group-title span {
  min-width: 1.4rem;
  padding: 0.08rem 0.3rem;
  border-radius: 0.3rem;
  background: #d1d9df;
  text-align: center;
}

.dispatch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 0.7rem;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.dispatch-main {
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.dispatch-number {
  display: block;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.dispatch-meta {
  display: block;
  margin-top: 0.25rem;
  color: #45515b;
  font-size: 0.8rem;
}

.dispatch-customer {
  display: block;
  overflow: hidden;
  margin-top: 0.35rem;
  color: #69747d;
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-actions {
  display: flex;
  align-items: start;
  gap: 0.2rem;
}

.mini-action {
  display: grid;
  width: 2.05rem;
  height: 2.05rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #447da5;
  background: transparent;
  font-size: 1.1rem;
}

.mini-action:hover {
  background: #e8f2f8;
}

.mini-action svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.status-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
}

.status-pendiente {
  color: #775410;
  background: #fff0c7;
}

.status-enviado {
  color: #174e7a;
  background: #d9edfb;
}

.status-entregado {
  color: #28603b;
  background: #dff2e4;
}

.status-devuelto {
  color: #7d3f25;
  background: #f9e3d8;
}

.status-faltantes {
  color: #7c4200;
  background: #ffe8cc;
}

.status-anulado {
  color: #752c35;
  background: #f7dfe2;
}

.empty-state {
  padding: 2rem 1rem;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.update-row {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.update-row strong,
.update-row span {
  display: block;
}

.update-row span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.floating-button {
  position: fixed;
  z-index: 7;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(5.35rem + env(safe-area-inset-bottom));
  display: grid;
  width: 3.35rem;
  height: 3.35rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 3px 10px #0003;
}

.floating-button svg {
  width: 1.45rem;
  height: 1.45rem;
}

.bottom-nav {
  position: fixed;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(3.75rem + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #f7f8f9;
  box-shadow: 0 -2px 8px #0002;
}

.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 0;
  color: #53616d;
  background: transparent;
  font-size: 0.72rem;
}

.nav-button.is-active {
  color: #fff;
  background: var(--blue);
}

.detail-dialog {
  width: min(100% - 1.2rem, 34rem);
  max-height: min(90dvh, 48rem);
  padding: 1.2rem;
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 1rem 3rem #0005;
}

.detail-dialog::backdrop {
  background: #1119;
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0.15rem 0 0.8rem;
  font-size: 1.25rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.close-button {
  width: 2rem;
  height: 2rem;
  color: #4b5964;
  font-size: 1.6rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.detail-field {
  min-width: 0;
}

.detail-field span,
.detail-field strong {
  display: block;
}

.detail-field span {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.detail-field strong {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.request-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.request-form label {
  font-size: 0.83rem;
  font-weight: 700;
}

.request-form select,
.request-form textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #b8c2ca;
  border-radius: 0.45rem;
  background: #fff;
}

.request-form textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.request-form select:disabled,
.request-form textarea:disabled {
  color: #68737c;
  background: #f0f2f4;
}

.permission-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.submit-request {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.5rem;
  color: #fff;
  background: #1d5e91;
  font-weight: 700;
}

.submit-request:disabled {
  color: #6a737b;
  background: #e1e5e8;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 1rem;
  bottom: calc(9.5rem + env(safe-area-inset-bottom));
  left: 1rem;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  color: #fff;
  background: #263d4c;
  box-shadow: 0 3px 12px #0003;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (min-width: 760px) {
  .topbar {
    padding-right: max(1.25rem, calc((100vw - 68rem) / 2));
    padding-left: max(1.25rem, calc((100vw - 68rem) / 2));
  }

  .summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 1rem 0.7rem;
  }

  .dispatch-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.85rem 0.8rem;
  }

  .bottom-nav {
    right: auto;
    left: 50%;
    width: min(100%, 70rem);
    transform: translateX(-50%);
  }
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: #f5f7fa;
  color: #17212b;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.card-pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
  background: #f5f7fa;
  color: #17212b;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.pdf-link.is-disabled,
.card-pdf-link.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.quick-status-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.quick-status-btn {
  padding: 0.28rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
  color: #17212b;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.quick-status-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.quick-status-btn.is-current,
.quick-status-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.quick-status-btn.is-pending-sync {
  opacity: 1;
  background: #fdeaea;
  border-color: #f3c6c6;
  color: #17212b;
  font-weight: 700;
  cursor: wait;
}

.quick-status-btn.is-synced {
  opacity: 1;
  background: #e3f5e8;
  border-color: #b8e1c4;
  color: #17212b;
  font-weight: 700;
}

.quick-assign-select {
  padding: 0.25rem 0.5rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #17212b;
  font-size: 0.74rem;
  font-weight: 600;
  max-width: 11.5rem;
}

.quick-assign-select.is-pending-sync {
  background: #fdeaea;
  border-color: #f3c6c6;
  font-weight: 700;
}

.quick-assign-select.is-synced {
  background: #e3f5e8;
  border-color: #b8e1c4;
  font-weight: 700;
}

.catalog-add-btn {
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: 0.55rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.catalog-search {
  margin: 0 0.8rem 0.75rem;
}

.catalog-search input,
#productForm input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fff;
  color: #17212b;
}

.product-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.product-main {
  display: grid;
  gap: 0.2rem;
}

.product-actions {
  display: flex;
  gap: 0.35rem;
}

.product-delete-btn:hover {
  border-color: #e59a9a;
  color: #9e2a2b;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.drawer-nav {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.drawer-nav-btn {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fff;
  color: #17212b;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.drawer-nav-btn.is-active {
  border-color: var(--blue);
  background: #e9f3fc;
  color: #174e7a;
}

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

.materials-box {
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #f8fafc;
}

.materials-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.materials-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.84rem;
  color: #17212b;
}

.is-pending-field {
  background: #fdeaea !important;
  border-color: #f3c6c6 !important;
  color: #9e2a2b !important;
  font-weight: 600;
}

.auth-panel {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.auth-button {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 0.55rem;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.detail-expand-btn {
  font-size: 1.05rem;
  font-weight: 700;
}

.detail-expand-btn.is-expanded {
  border-color: var(--blue);
  background: #e9f3fc;
  color: #174e7a;
}

.card-detail-chip {
  display: inline-block;
  margin-left: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.18rem 0.48rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #eef2f6;
  color: #324150;
}

.card-detail-chip.has-shortage {
  background: #ffe8cc;
  color: #7c4200;
}

.dispatch-detail-drawer {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f8fafc;
  display: grid;
  gap: 0.65rem;
}

.detail-drawer-head,
.complement-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.detail-drawer-head strong,
.complement-section-head strong {
  font-size: 0.82rem;
  color: #17212b;
}

.detail-drawer-head span {
  font-size: 0.74rem;
  color: var(--muted);
}

.detail-lines-list {
  display: grid;
  gap: 0.5rem;
}

.detail-line-item {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fff;
  display: grid;
  gap: 0.4rem;
}

.detail-line-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.detail-line-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #17212b;
}

.detail-line-code {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.08rem 0.38rem;
  border-radius: 0.3rem;
  background: #eef2f6;
  font-size: 0.72rem;
  font-weight: 700;
  color: #324150;
}

.detail-line-qty {
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: #174e7a;
}

.detail-line-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.detail-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.shortage-inline-form,
.complement-inline-form {
  margin-top: 0.25rem;
  padding: 0.6rem;
  border: 1px dashed #b9c5d1;
  border-radius: 0.5rem;
  background: #fdfefe;
  display: grid;
  gap: 0.4rem;
}

.shortage-inline-form label,
.complement-inline-form label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #324150;
}

.shortage-inline-form input,
.shortage-inline-form select,
.complement-inline-form input,
.complement-inline-form select {
  width: 100%;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #fff;
  color: #17212b;
  font-size: 0.84rem;
}

.inline-preview-note {
  font-size: 0.75rem;
  color: #7c4200;
  font-weight: 600;
}

.inline-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.btn-primary-sm {
  padding: 0.36rem 0.7rem;
  border: 0;
  border-radius: 0.45rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-confirm-line {
  border-color: #b8e1c4;
  background: #eef9f1;
  color: #1f7a3e;
}

.btn-confirm-line:disabled {
  opacity: 0.5;
}

.btn-shortage-line {
  border-color: #f0cda0;
  background: #fff8ed;
  color: #8a5a00;
}

.complement-section {
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.45rem;
}

.complement-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.26rem 0.6rem;
  border: 1px solid var(--blue);
  border-radius: 99px;
  background: #e9f3fc;
  color: #174e7a;
  font-size: 0.75rem;
  font-weight: 700;
}

.complement-row {
  padding: 0.45rem 0.6rem;
  border: 1px solid #d4e4f4;
  border-radius: 0.5rem;
  background: #f3f9ff;
  font-size: 0.78rem;
  display: grid;
  gap: 0.15rem;
}

.subtabs-row {
  display: flex;
  gap: 0.45rem;
  margin: 0 0.8rem 0.75rem;
  flex-wrap: wrap;
}

.shortages-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0.8rem 0.75rem;
}

.traffic-card {
  padding: 0.65rem 0.55rem;
  border-radius: 0.65rem;
  border: 2px solid transparent;
  text-align: center;
  display: grid;
  gap: 0.15rem;
}

.traffic-card strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.traffic-card span {
  font-size: 0.72rem;
  font-weight: 700;
}

.traffic-card.is-selected {
  border-color: #17212b;
  box-shadow: 0 0 0 1px #17212b;
}

.aging-verde {
  background: #e3f5e8;
  color: #1f7a3e;
  border-color: #b8e1c4;
}

.aging-amarillo {
  background: #fff6db;
  color: #8a5a00;
  border-color: #f2d58b;
}

.aging-rojo {
  background: #fdeaea;
  color: #a61d24;
  border-color: #f3c6c6;
}

.origin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0.8rem 0.75rem;
}

.shortage-card {
  border-left: 5px solid var(--line);
  grid-template-columns: minmax(0, 1fr);
}

.shortage-card.border-verde {
  border-left-color: #288a48;
}

.shortage-card.border-amarillo {
  border-left-color: #d39617;
}

.shortage-card.border-rojo {
  border-left-color: #c9343a;
}

.shortage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.shortage-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.origin-badge {
  display: inline-block;
  padding: 0.18rem 0.48rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #eef2f6;
  color: #324150;
}

.aging-pill {
  display: inline-block;
  padding: 0.18rem 0.48rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
}

.shortage-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #324150;
}

.shortages-section-label {
  margin: 0.4rem 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.install-banner {
  margin: 0.65rem 0.8rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #b8d8f4;
  border-radius: 0.65rem;
  background: #e9f3fc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.install-banner-text {
  display: grid;
  gap: 0.12rem;
}

.install-banner-text strong {
  font-size: 0.84rem;
  color: #174e7a;
}

.install-banner-text span {
  font-size: 0.76rem;
  color: #324150;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.install-cta-btn {
  padding: 0.42rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.install-dismiss-btn {
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: #324150;
  font-size: 1.15rem;
  line-height: 1;
}

.offline-banner {
  position: sticky;
  top: 4.2rem;
  z-index: 4;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #f3c6c6;
  background: #fdeaea;
  color: #8c1d24;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.rejection-alert {
  margin-top: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #f3c6c6;
  border-radius: 0.55rem;
  background: #fdeaea;
  color: #8c1d24;
  font-size: 0.82rem;
  line-height: 1.4;
}

.terminal-notice {
  margin: 0.65rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid #f2d58b;
  border-radius: 0.5rem;
  background: #fff6db;
  color: #6b4700;
  font-size: 0.78rem;
  font-weight: 600;
}

.sync-rejected-badge {
  grid-column: 1 / -1;
  padding: 0.42rem 0.65rem;
  border: 1px solid #f3c6c6;
  border-radius: 0.45rem;
  background: #fdeaea;
  color: #8c1d24;
  font-size: 0.76rem;
  font-weight: 600;
}

.evidence-section {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.65rem;
}

.evidence-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}

.evidence-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #17212b;
}

.evidence-role-note {
  font-size: 0.75rem;
  color: var(--muted);
}

.evidence-controls {
  display: grid;
}

.evidence-upload-btn {
  min-height: 2.75rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: 0.55rem;
  background: #1d5e91;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.evidence-upload-btn:disabled {
  background: #e1e5e8;
  color: #6a737b;
  cursor: not-allowed;
}

.evidence-status {
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.45rem;
  background: #e9f3fc;
  color: #174e7a;
  font-size: 0.78rem;
  font-weight: 600;
}

.evidence-status.is-error {
  border: 1px solid #f3c6c6;
  background: #fdeaea;
  color: #8c1d24;
}

.evidence-list {
  display: grid;
  gap: 0.45rem;
}

.evidence-item {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #f8fafc;
  display: grid;
  gap: 0.2rem;
}

.evidence-item-title {
  min-width: 0;
}

.evidence-item-link {
  color: #174e7a;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: underline;
  word-break: break-word;
}

.evidence-item-name {
  color: #17212b;
  font-size: 0.84rem;
  font-weight: 700;
  word-break: break-word;
}

.evidence-item-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.evidence-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
