/* ===== Base ===== */
:root {
  --bg: #c8d3e0;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #1f2937;
  --brand-2: #0f172a;

  --radius: 10px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    "Noto Sans",
    "Liberation Sans",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand__title {
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  text-decoration: none;
}

.brand__meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.menu__link {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.menu__link:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.menu__dropdown {
  position: relative;
}

.menu__dropdown summary {
  list-style: none;
}

.menu__dropdown summary::-webkit-details-marker {
  display: none;
}

.menu__link--summary {
  cursor: pointer;
  user-select: none;
}

.menu__link--summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.15s ease;
}

.menu__dropdown[open] .menu__link--summary {
  background: rgba(255, 255, 255, 0.12);
}

.menu__dropdown[open] .menu__link--summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.menu__dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
}

.menu__dropdown-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.menu__dropdown-link:hover {
  background: #eef2ff;
  text-decoration: none;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.userchip strong {
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #94a3b8;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  box-shadow:
    0 2px 0 rgba(148, 163, 184, 0.7),
    0 8px 18px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.08s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #64748b;
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  box-shadow:
    0 2px 0 rgba(100, 116, 139, 0.75),
    0 12px 24px rgba(15, 23, 42, 0.12);
}
.btn:active {
  transform: translateY(0px);
  box-shadow:
    0 1px 0 rgba(100, 116, 139, 0.75),
    0 6px 14px rgba(15, 23, 42, 0.1);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 2px 0 rgba(100, 116, 139, 0.75),
    0 0 0 4px rgba(37, 99, 235, 0.18),
    0 12px 24px rgba(15, 23, 42, 0.12);
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn--topbar {
  min-height: 38px;
  padding: 8px 12px;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 10px rgba(2, 6, 23, 0.18);
}

.btn--topbar:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(2, 6, 23, 0.24);
}

.btn--topbar:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 4px rgba(191, 219, 254, 0.22),
    0 8px 18px rgba(2, 6, 23, 0.24);
}

.btn--primary {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
  box-shadow:
    0 2px 0 rgba(30, 64, 175, 0.85),
    0 12px 24px rgba(29, 78, 216, 0.22);
}
.btn--primary:hover {
  background: #1e40af;
  border-color: #1e3a8a;
}

.btn-primary,
.btn.btn-primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #1d4ed8;
  box-shadow:
    0 2px 0 rgba(30, 64, 175, 0.85),
    0 12px 24px rgba(29, 78, 216, 0.22);
}

.btn-primary:hover,
.btn.btn-primary:hover {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e3a8a;
}

.btn-secondary,
.btn.btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  border-color: #64748b;
}

/* ===== Cards / Forms ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__header {
  padding: 16px 16px 0 16px;
}
.card__title {
  margin: 0;
  font-size: 18px;
}
.card__subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card__body {
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form {
  display: grid;
  gap: 10px;
  /* max-width: 360px; */
}

.label {
  font-size: 13px;
  color: #374151;
  font-weight: 600;
  margin-bottom: 4px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.input:hover {
  border-color: #94a3b8;
  background: #fff;
}
.input:focus {
  border-color: #1d4ed8;
  box-shadow: var(--focus);
  background: #fff;
}

/* ===== Alerts ===== */
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
}
.alert--error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

/* ===== Links ===== */
a {
  color: #1d4ed8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}
.list li {
  margin: 6px 0;
}
.muted {
  color: var(--muted);
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  background: #fff;
}

.table-wrap--abm {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 520px;
  overflow-y: auto;
}

.abm-table {
  width: 100%;
  border-collapse: collapse;
}

.abm-table thead tr {
  background: #e5e7eb;
}

.abm-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #94a3b8;
  color: #1f2937;
  font-weight: 700;
}

.abm-table th:last-child {
  text-align: right;
}

.abm-table td {
  padding: 10px;
  border-bottom: 1px solid #cbd5e1;
  vertical-align: middle;
}

.abm-table td:last-child {
  text-align: right;
}

.table-wrap--abm .abm-table th,
.table-wrap--abm .abm-table td {
  padding: 11px 12px;
}

.table-wrap--abm .abm-table th:first-child,
.table-wrap--abm .abm-table td:first-child {
  min-width: 320px;
}

.table-wrap--abm .abm-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.rectificar-ordenes-table th,
.rectificar-ordenes-table td {
  white-space: nowrap !important;
}

.rectificar-ordenes-table .badge {
  white-space: nowrap;
}

.abm-list-card {
  display: flex;
  flex-direction: column;
}

.abm-list-card .card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.abm-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

.abm-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.abm-table tbody tr:hover {
  background: #eef2ff;
}

/* ===== Responsive (desktop-first, pero que no rompa) ===== */
@media (min-width: 860px) {
  .grid--2 {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .grid--abm-wide {
    grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
    gap: 18px;
  }

  .form--abm {
    gap: 12px;
  }

  .abm-list-card {
    min-height: 720px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1560px;
  }

  .topbar__inner {
    max-width: 1560px;
  }

  .grid--abm-wide {
    grid-template-columns: minmax(0, 1.7fr) minmax(420px, 1fr);
  }
}

@media (max-width: 859px) {
  .menu {
    flex-wrap: wrap;
  }

  .menu__dropdown {
    width: 100%;
  }

  .menu__dropdown-panel {
    position: static;
    margin-top: 8px;
    min-width: 0;
  }
}

/* =========================
   ORDENES / MODULO OPERATIVO
   ========================= */

   .page-header--compact {
    margin-bottom: 18px;
  }
  
  .page-header--compact h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
  }
  
  .orders-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .orders-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 112px;
    padding: 20px 22px;
    border: 1px solid #d7dee7;
    border-radius: 12px;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    transition:
      border-color 0.15s ease,
      box-shadow 0.15s ease,
      transform 0.12s ease;
  }
  
  .orders-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
    text-decoration: none;
  }
  
  .orders-card--primary {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  }
  
  .orders-card__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    color: #0f172a;
  }
  
  .orders-card__meta {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
  }
  
  @media (min-width: 860px) {
    .orders-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  
  .section-note {
    padding: 18px;
  }
  
  .section-note h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
  }
  
  .section-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
  }
  
  .form-card {
    padding: 18px;
  }
  
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .field label {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
  }
  
  .field input,
  .field select,
  .field textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    outline: none;
    transition:
      border-color 0.15s ease,
      box-shadow 0.15s ease,
      background 0.15s ease;
  }
  
  .field input:hover,
  .field select:hover,
  .field textarea:hover {
    border-color: #94a3b8;
    background: #fff;
  }
  
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.inline-input-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.inline-input-action input {
  flex: 1 1 auto;
}

.inline-input-action .btn {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 42px;
  padding: 0 10px;
}

.material-icons {
  font-size: 20px;
  line-height: 1;
}

.field-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

.orden-manual-date {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.45), rgba(255, 255, 255, 0.96));
}

.orden-manual-date__copy {
  display: grid;
  gap: 4px;
}

.orden-manual-date.is-active,
.is-active .orden-manual-date {
  border-color: #60a5fa;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}
  
  .field-full {
    grid-column: 1 / -1;
  }
  
  .checkbox-field {
    justify-content: flex-end;
  }
  
  .checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    font-size: 14px;
    color: #334155;
    font-weight: 600;
  }
  
  .checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: unset;
    margin: 0;
  }
  
  .form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
  }
  
  .hidden {
    display: none !important;
  }

  @media (min-width: 860px) {
    .orden-manual-date {
      grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
      align-items: end;
    }
  }
  
  .result-card {
    padding: 18px;
    margin-top: 18px;
  }
  
  .result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .result-item {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
  }
  
  .result-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  
  .result-item span {
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
  }
  
  .badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
  }
  
  .badge--preparada {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
  }
  
  .badge--ingresada {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
  }
  
  .badge--reingresada {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
  }
  
  .badge--observada {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
  }
  
  .badge--inscripta {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
  }
  
  @media (min-width: 860px) {
    .quick-actions-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  
    .form-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  
    .result-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  .segmented-actions {
    display: inline-flex;
    border: 1px solid #d7dee7;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #fff;
  }
  
  .segmented-actions__btn {
    border: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #334155;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.22);
    transition:
      background 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
  }
  
  .segmented-actions__btn + .segmented-actions__btn {
    border-left: 1px solid #d7dee7;
  }
  
  .segmented-actions__btn.is-active {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    box-shadow:
      inset 0 -1px 0 rgba(255, 255, 255, 0.08),
      0 10px 18px rgba(15, 23, 42, 0.16);
  }
  
  .tab-panel {
    display: none;
  }
  
  .tab-panel.is-active {
    display: block;
  }
  
  .inline-message {
    padding: 14px 16px;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
  }
  
  .inline-message--success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
  }

  .inline-message--info {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #b45309;
  }
  
  .inline-message--error {
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #be123c;
  }
  
  .table-card {
    padding: 18px;
    margin-top: 18px;
  }
  
.table-card .section-head {
  margin-bottom: 14px;
}

.section-head--table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head--table-tools h2 {
  margin: 0;
}

.ingresos-dia-tools {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ingresos-dia-tools .field {
  margin: 0;
}

.consultas-filter-panel {
  position: relative;
  margin-top: 8px;
  margin-bottom: 18px;
  padding: 0;
  overflow: visible;
  min-height: 50px;
  z-index: 19;
}

.consultas-filter-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  border: 1px solid #dbe4f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.consultas-filter-panel__summary::-webkit-details-marker {
  display: none;
}

.consultas-filter-panel__summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.consultas-filter-panel[open] .consultas-filter-panel__summary::after {
  transform: rotate(225deg);
}

.consultas-filter-panel__lead {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.consultas-filter-panel__lead svg {
  width: 18px;
  height: 18px;
  color: #334155;
  flex: 0 0 auto;
}

.consultas-filter-panel__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.consultas-filter-panel__body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 15;
  padding: 14px 16px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

.consultas-filter-grid {
  gap: 12px;
}

.field--compact {
  gap: 4px;
}

.field--compact label {
  font-size: 12px;
}

.field--compact input,
.field--compact select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.consultas-filter-actions {
  margin-top: 2px;
}

.consultas-filter-actions .btn {
  padding: 8px 12px;
  font-size: 13px;
}
  
  .table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
  }
  
  .table th,
  .table td {
    padding: 12px 14px;
    border-bottom: 1px solid #d9d9d9;
    text-align: left;
    font-size: 14px;
  }
  
.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #e2e8f0;
  border-bottom: 1px solid #94a3b8;
}
  
  .table-empty {
    color: #64748b;
    text-align: center;
    padding: 22px !important;
  }

  .subpage-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
  }
  
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f4f82;
  text-decoration: none;
  font-weight: 600;
}

.back-link::before {
  content: "";
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link:hover::before {
  transform: translateX(-2px) rotate(45deg);
}
  
  .subpage-breadcrumb {
    font-size: 14px;
    color: #6b7280;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  
  .btn[disabled] {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  .table tbody tr:hover {
    background: #f8fafc;
  }

.table td .badge {
  vertical-align: middle;
}

.remitos-table {
  min-width: 100%;
}

.remito-notes {
  padding: 18px;
  margin-top: 18px;
}

.remito-preview-frame-wrap {
  width: 100%;
  min-height: 920px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
}

.remito-preview-frame {
  width: 100%;
  height: 920px;
  border: 0;
  background: #fff;
}

.remito-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

.remito-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.remito-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

.remito-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.remito-modal__header h2 {
  margin: 0 0 4px;
}

.remito-modal__header p {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.remito-preview-frame-wrap--modal {
  min-height: 78vh;
}

.remito-preview-frame--modal {
  height: 78vh;
}

  .table td {
    vertical-align: middle;
    white-space: nowrap;
  }
  
.table td:nth-child(3),
.table td:nth-child(4) {
  white-space: normal;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.table-sort::after {
  content: "\2195";
  font-size: 11px;
  line-height: 1;
  color: #94a3b8;
}

.table-sort[data-sort-dir="asc"]::after {
  content: "\2191";
  color: #1d4ed8;
}

.table-sort[data-sort-dir="desc"]::after {
  content: "\2193";
  color: #1d4ed8;
}

.table-sort:hover::after,
.table-sort[aria-pressed="true"]::after {
  color: #1d4ed8;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #1f2937;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.icon-action:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.08);
}

.icon-action svg {
  width: 20px;
  height: 20px;
  display: block;
}

  /* ===== Ingresos ===== */

#tab-nueva-entrada .field input,
#tab-reingreso .field input {
  font-size: 16px;
}

#ingresos-orden-card {
  margin-top: 18px;
}

#ingresos-recientes-card {
  margin-top: 18px;
}

.table-empty {
  text-align: center;
  color: #64748b;
  font-style: italic;
}

.inline-message {
  margin-top: 18px;
}

.result-item .badge {
  width: fit-content;
}

@media (max-width: 859px) {
  .segmented-actions {
    width: 100%;
  }

  .segmented-actions__btn {
    flex: 1 1 0;
  }

  .consultas-filter-panel__summary {
    align-items: flex-start;
  }

  .consultas-filter-panel__body {
    right: auto;
    width: min(100vw - 36px, 520px);
  }
}

#ingresos-orden-card {
  margin-top: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

#ingresos-orden-card .section-head {
  margin-bottom: 12px;
}

.orden-inline-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.orden-inline-summary__item {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  min-width: 0;
}

.orden-inline-summary__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b7090;
}

.orden-inline-summary__item strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.3;
  word-break: break-word;
}

@media (max-width: 980px) {
  .orden-inline-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .orden-inline-summary {
    grid-template-columns: 1fr;
  }
}

/* ===== Ingresos del día ===== */

.ingresos-dia-table {
  min-width: 100%;
  table-layout: auto;
}

.ingresos-dia-table th,
.ingresos-dia-table td {
  white-space: nowrap;
}

.ingresos-dia-table th {
  font-size: 12px;
  padding: 9px 10px;
}

.ingresos-dia-table td {
  font-size: 13px;
  padding: 8px 10px;
}

.ingresos-dia-col--hora {
  width: 90px;
}

.ingresos-dia-col--oblea {
  width: 120px;
}

.ingresos-dia-col--cliente {
  width: 15%;
}

.ingresos-dia-col--tramite {
  width: 15%;
}

.ingresos-dia-col--estado {
  width: 10%;
}

.ingresos-dia-col--urgencia {
  width: 8%;
}

.ingresos-dia-col--numero {
  width: 12%;
}

.ingresos-dia-col--accion {
  width: 11%;
}

.table-input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

.table-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.btn-sm {
  padding: 8px 10px;
  min-height: auto;
  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-note {
  color: #475569;
  font-size: 14px;
  margin-top: 6px;
}

#remitos-history-pagination {
  margin-top: 16px;
}

#ingresos-dia-success,
#ingresos-dia-error {
  margin-bottom: 16px;
}

@media (max-width: 980px) {
  .table-input {
    min-width: 120px;
  }
}

.numero-entrada-readonly {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.numero-entrada-readonly__value {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  white-space: nowrap;
}

.ingresos-dia-table .badge {
  padding: 4px 8px;
  font-size: 11px;
}

.row-complete {
  background: rgba(15, 23, 42, 0.02);
}

.toast-container {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 320px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  pointer-events: auto;
}

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

.toast__title {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.toast__message {
  font-size: 14px;
  line-height: 1.4;
  color: #334155;
}

.toast--success {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.toast--success .toast__title {
  color: #047857;
}

.toast--error {
  border-color: #fecdd3;
  background: #fff1f2;
}

.toast--error .toast__title {
  color: #be123c;
}

@media (max-width: 640px) {
  .toast-container {
    top: 14px;
    right: 14px;
    left: 14px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}
