/* Enhance — tema oscuro sobre Bootstrap 5.3 (CDN). Sin build. */

:root {
  --ink: #e7eaf3;
  --muted: #98a1b6;
  --faint: #6f788b;
  --panel: #12151d;
  --panel-2: #171b25;
  --line: #232837;
  --accent: #6b8cff;
  --accent-2: #38d9c0;

  --bs-body-bg: #0b0d13;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: #98a1b6;
  --bs-primary: #6b8cff;
  --bs-primary-rgb: 107, 140, 255;
  --bs-link-color: #8ea6ff;
  --bs-link-hover-color: #a9bcff;
  --bs-emphasis-color: #fff;
  --bs-secondary-bg: #171b25;
  --bs-tertiary-bg: #12151d;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 560px at 18% -12%, rgba(43, 63, 122, .38) 0%, transparent 62%),
    radial-gradient(900px 480px at 104% -6%, rgba(66, 43, 112, .28) 0%, transparent 58%),
    #0b0d13;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

a {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid rgba(107, 140, 255, .9);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  z-index: 1100;
  top: .5rem;
  left: .5rem;
}

.min-w-0 {
  min-width: 0;
}

/* ------------------------------------------------------------- botones */

.btn-primary {
  --bs-btn-bg: #5b7cf6;
  --bs-btn-border-color: #5b7cf6;
  --bs-btn-hover-bg: #4b6ceb;
  --bs-btn-hover-border-color: #4b6ceb;
  --bs-btn-active-bg: #3f5fdd;
  --bs-btn-active-border-color: #3f5fdd;
  --bs-btn-disabled-bg: #2c3a63;
  --bs-btn-disabled-border-color: #2c3a63;
  --bs-btn-focus-shadow-rgb: 107, 140, 255;
}

.btn-outline-secondary {
  --bs-btn-color: #b6bed0;
  --bs-btn-border-color: #394155;
  --bs-btn-hover-bg: #1d2230;
  --bs-btn-hover-color: #e7eaf3;
  --bs-btn-hover-border-color: #4a5470;
  --bs-btn-active-bg: #232a3b;
  --bs-btn-active-border-color: #4a5470;
}

/* ---------------------------------------------------------------- login */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 412px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #151926 0%, #0f121a 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
}

.login-card .form-control {
  background-color: #0d1017;
  border-color: #2a3042;
}

.login-card .form-control:focus {
  background-color: #0d1017;
  border-color: rgba(107, 140, 255, .7);
  box-shadow: 0 0 0 .22rem rgba(107, 140, 255, .18);
}

/* --------------------------------------------------------------- marca */

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--ink);
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #0b0d13;
  background: linear-gradient(135deg, #7c9bff 0%, #9a7bff 100%);
  box-shadow: 0 4px 14px rgba(107, 140, 255, .28);
}

.brand-lg .brand-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 11px;
}

.brand-lg .brand-name {
  font-size: 1.3rem;
}

/* -------------------------------------------------------------- header */

.app-header {
  background: rgba(11, 13, 19, .84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 1030;
}

.app-tabs {
  gap: .2rem;
}

.app-tabs .nav-link {
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: .38rem .85rem;
  font-size: .92rem;
  font-weight: 500;
}

.app-tabs .nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
}

.app-tabs .nav-link.active {
  color: #fff;
  background: rgba(107, 140, 255, .16);
  border-color: rgba(107, 140, 255, .38);
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
  padding: .22rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.health-badge .dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, .15);
}

.health-badge.is-ok .dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}

.health-badge.is-warn .dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .16);
}

.health-badge.is-err .dot {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .16);
}

.user-chip {
  font-size: .8rem;
  color: #c3c9d7;
  padding: .22rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------- roles */

.role-badge {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .3em .55em;
  border-radius: 6px;
  border: 1px solid transparent;
  vertical-align: middle;
}

.role-badge.role-admin {
  color: #d3ddff;
  background: rgba(107, 140, 255, .18);
  border-color: rgba(107, 140, 255, .42);
}

.role-badge.role-user {
  color: #c2e7df;
  background: rgba(56, 217, 192, .1);
  border-color: rgba(56, 217, 192, .28);
}

/* --------------------------------------------------------------- cards */

.card {
  --bs-card-bg: var(--panel);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: 14px;
  --bs-card-inner-border-radius: 13px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
}

.card-footer {
  background: transparent;
  border-top: 1px solid var(--line);
}

.panel-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .2rem;
}

.panel-hint {
  font-size: .76rem;
  color: var(--faint);
  margin-bottom: 1rem;
}

.form-label {
  font-size: .82rem;
  font-weight: 550;
  color: #c8cedd;
  margin-bottom: .3rem;
}

.form-text {
  font-size: .72rem;
  color: var(--faint);
}

.form-control,
.form-select {
  background-color: #0d1017;
  border-color: #2a3042;
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  background-color: #0d1017;
  color: var(--ink);
  border-color: rgba(107, 140, 255, .7);
  box-shadow: 0 0 0 .2rem rgba(107, 140, 255, .18);
}

/* ------------------------------------------------------------ dropzone */

.dropzone {
  position: relative;
  border: 2px dashed #2b3348;
  border-radius: 16px;
  padding: 2.1rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, .012);
  transition: border-color .15s ease, background .15s ease;
}

.dropzone:hover {
  border-color: #3d4a68;
  background: rgba(255, 255, 255, .02);
}

.dropzone.is-over {
  border-color: var(--accent);
  background: rgba(107, 140, 255, .08);
}

.dropzone-icon {
  color: var(--accent);
  opacity: .95;
  margin-bottom: .5rem;
  line-height: 0;
}

.dropzone-title {
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 .2rem;
}

.dropzone-sub {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 .55rem;
}

.dropzone-help {
  color: var(--faint);
  font-size: .74rem;
  margin: 0;
}

.link-accent {
  color: #9db2ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------- cola */

.queue-count {
  font-size: .76rem;
  color: var(--faint);
}

.queue {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .7rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.queue-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0a0c12;
  color: var(--muted);
}

.queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.queue-thumb-file,
.queue-thumb-x {
  font-size: .68rem;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--faint);
}

.queue-thumb-x {
  color: #ff8b8b;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.queue-main {
  flex: 1 1 auto;
  min-width: 0;
}

.queue-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.queue-name {
  font-size: .88rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  font-size: .74rem;
  color: var(--muted);
  margin-top: .05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-progress-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .45rem;
}

.queue-progress {
  height: 5px;
  flex: 1 1 auto;
  background: #1b2030;
}

.queue-progress .progress-bar {
  background: linear-gradient(90deg, #5b7cf6, #8f7bff);
  transition: width .12s linear;
}

.queue-pct {
  font-size: .7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 3.2ch;
  text-align: right;
}

.queue-error {
  font-size: .76rem;
  color: #ff9a9a;
  margin-top: .2rem;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.queue-actions .btn {
  font-size: .74rem;
  padding: .2rem .5rem;
}

.icon-btn {
  line-height: 1.1;
}

/* -------------------------------------------------------------- badges */

.status-badge {
  font-weight: 600;
  font-size: .66rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .28em .55em;
  border-radius: 6px;
}

/* ------------------------------------------------------------ historial */

.history-toolbar .card-body {
  background: rgba(255, 255, 255, .012);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .9rem;
}

.job-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .15s ease, transform .15s ease;
}

.job-card:hover {
  border-color: #35415f;
}

.job-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background-color: #0a0c12;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .028) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .028) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .028) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .028) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.job-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.job-thumb .status-badge {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  z-index: 2;
}

.job-thumb .spinner-border {
  width: 1.5rem;
  height: 1.5rem;
  color: #5b6a8f;
  border-width: .16em;
}

.job-thumb-fallback {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--faint);
}

.job-check {
  position: absolute;
  top: .5rem;
  right: .5rem;
  z-index: 3;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  background-color: rgba(10, 12, 18, .8);
  border-color: #4a5670;
  cursor: pointer;
}

.job-check:checked {
  background-color: #5b7cf6;
  border-color: #5b7cf6;
}

.job-check:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.job-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  flex: 1 1 auto;
  padding: .7rem .8rem .75rem;
}

.job-name {
  font-size: .87rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta,
.job-dims {
  font-size: .74rem;
  color: var(--muted);
}

.job-dims {
  color: var(--faint);
}

.job-error {
  font-size: .74rem;
  color: #ff9a9a;
  margin: .15rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .35rem;
  font-size: .71rem;
  color: var(--faint);
}

.job-owner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: auto;
  padding-top: .55rem;
}

.job-actions .btn {
  font-size: .73rem;
  padding: .2rem .5rem;
}

.history-sentinel {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 64px;
  padding: 1rem 0;
}

/* ---------------------------------------------------------- vacíos */

.empty-state {
  border: 1px dashed #262d3f;
  border-radius: 14px;
  padding: 2.2rem 1.2rem;
  text-align: center;
  color: #b8c0d2;
  background: rgba(255, 255, 255, .008);
}

/* ---------------------------------------------------------- métricas */

.kpi .card-body {
  padding: .95rem 1rem;
}

.kpi-label {
  font-size: .71rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  margin-top: .2rem;
  line-height: 1.15;
}

.kpi-sub {
  font-size: .72rem;
  color: var(--faint);
  margin-top: .15rem;
}

#chartWrap {
  position: relative;
  width: 100%;
  min-height: 220px;
}

#chart {
  display: block;
  width: 100%;
  height: 220px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .85rem;
  color: var(--faint);
}

.chart-note {
  font-size: .72rem;
  color: var(--faint);
  margin: .55rem 0 0;
}

.chart-legend {
  display: inline-flex;
  gap: 1rem;
  font-size: .72rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
  margin-right: .3rem;
}

.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.bar-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  font-size: .8rem;
}

.bar-label {
  color: #cfd5e4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: .76rem;
}

/* ------------------------------------------------------------ tabla */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: rgba(255, 255, 255, .028);
  --bs-table-hover-color: var(--ink);
  font-size: .83rem;
}

.table thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  border-bottom-color: var(--line);
  white-space: nowrap;
}

.table > :not(caption) > * > * {
  padding: .55rem .75rem;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .79rem;
}

.nowrap {
  white-space: nowrap;
}

/* ------------------------------------------------------------ usuarios */

.user-name {
  font-weight: 550;
}

.you-tag {
  margin-left: .45rem;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .06rem .42rem;
  vertical-align: middle;
}

.user-created {
  color: var(--muted);
  font-size: .78rem;
}

.role-select {
  width: auto;
  min-width: 7.2rem;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  justify-content: flex-end;
}

.user-actions .btn {
  font-size: .73rem;
  padding: .22rem .5rem;
}

.user-cards {
  display: flex;
  flex-direction: column;
}

.user-card {
  padding: .85rem 1rem;
  border-top: 1px solid var(--line);
}

.user-card:first-child {
  border-top: 0;
}

.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.user-card-head .user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
}

.user-card-meta {
  font-size: .74rem;
  color: var(--faint);
  margin-top: .2rem;
}

.user-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .7rem;
}

.user-card-actions .btn {
  font-size: .75rem;
  padding: .26rem .6rem;
}

.user-state {
  padding: 1.7rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* ----------------------------------------------------------------- pdf */

.pdf-total {
  font-size: .76rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  border-radius: 999px;
  padding: .25rem .7rem;
  white-space: nowrap;
}

.pdf-quick {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
}

.pdf-quick-label {
  font-size: .72rem;
  color: var(--faint);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.pdf-quick .btn {
  font-size: .72rem;
  padding: .18rem .5rem;
}

.pdf-inline-empty {
  font-size: .8rem;
  color: var(--faint);
  margin: 0 0 .6rem;
}

.pdf-filter-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem;
  margin: 0 0 .55rem;
  padding: .35rem .55rem;
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: 8px;
  background: rgba(251, 191, 36, .07);
  font-size: .76rem;
  color: #e8d9a8;
}

.pdf-filter-note .btn {
  font-size: .76rem;
  color: #ffe08a;
}

.pdf-job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .6rem;
}

.pdf-job {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1017;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.pdf-job:hover {
  border-color: #38445f;
}

.pdf-job.is-selected {
  border-color: rgba(107, 140, 255, .6);
  background: rgba(107, 140, 255, .07);
}

.pdf-job-thumb {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0a0c12;
}

.pdf-job-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pdf-job-fallback {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--faint);
}

.pdf-job-name {
  padding: .4rem .5rem 0;
  font-size: .76rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-job-dims {
  padding: .05rem .5rem .45rem;
  font-size: .68rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-job-check {
  position: absolute;
  top: .4rem;
  right: .4rem;
  z-index: 2;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  background-color: rgba(10, 12, 18, .88);
  border-color: #6b7793;
  cursor: pointer;
}

.pdf-job.is-selected .pdf-job-check {
  background-color: #5b7cf6;
  border-color: #5b7cf6;
}

.pdf-job-num {
  position: absolute;
  top: .4rem;
  left: .4rem;
  z-index: 2;
  min-width: 1.25rem;
  padding: .02rem .3rem;
  border-radius: 6px;
  background: rgba(91, 124, 246, .92);
  color: #f2f5ff;
  font-size: .66rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pdf-drop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
  padding: .85rem .95rem;
  border: 1.5px dashed #2b3348;
  border-radius: 12px;
  background: rgba(255, 255, 255, .012);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.pdf-drop:hover,
.pdf-drop.is-over {
  border-color: var(--accent);
  background: rgba(107, 140, 255, .07);
}

.pdf-drop-icon {
  color: var(--accent);
  line-height: 0;
}

.pdf-drop-text {
  font-size: .84rem;
  color: #c8cedd;
}

.pdf-drop-text strong {
  color: var(--ink);
  font-weight: 600;
}

.pdf-drop-help {
  margin-left: auto;
  font-size: .72rem;
  color: var(--faint);
}

.pdf-file-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin: .7rem 0 0;
}

.pdf-file-list:empty {
  display: none;
}

.pdf-file {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  padding: .4rem .45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.pdf-file-thumb {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a0c12;
}

.pdf-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdf-file-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pdf-file-name {
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-file-meta {
  font-size: .7rem;
  color: var(--faint);
}

.pdf-file .btn {
  flex: 0 0 auto;
  font-size: .72rem;
  padding: .15rem .42rem;
}

.pdf-order-hint {
  font-size: .72rem;
  color: var(--faint);
  margin: 0 0 .6rem;
}

.pdf-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.pdf-order-list:empty {
  display: none;
}

.pdf-order-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  font-size: .8rem;
}

.pdf-order-num {
  flex: 0 0 1.5rem;
  padding: .02rem 0;
  border: 1px solid rgba(107, 140, 255, .32);
  border-radius: 6px;
  background: rgba(107, 140, 255, .16);
  color: #cdd7f5;
  font-size: .68rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pdf-order-item.is-file .pdf-order-num {
  border-color: rgba(56, 217, 192, .3);
  background: rgba(56, 217, 192, .14);
  color: #bff0e7;
}

.pdf-order-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-order-tag {
  flex: 0 0 auto;
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--faint);
}

.pdf-order-item .btn {
  flex: 0 0 auto;
  font-size: .7rem;
  padding: .02rem .38rem;
}

.pdf-options {
  position: sticky;
  top: 84px;
}

.pdf-margin-row {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.pdf-margin-row .form-range {
  flex: 1 1 auto;
  min-width: 0;
}

.pdf-margin-val {
  flex: 0 0 auto;
  font-size: .72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 4.2ch;
  text-align: right;
}

.pdf-options .form-check-label {
  font-size: .82rem;
  color: #c8cedd;
}

.pdf-options .form-check .form-text {
  margin-left: 0;
}

.pdf-estimate {
  font-size: .74rem;
  color: var(--muted);
  margin: .2rem 0 .6rem;
}

.pdf-progress {
  margin-top: .55rem;
  font-size: .74rem;
  color: var(--muted);
  min-height: 1.05rem;
}

/* ------------------------------------------------------------ toasts */

.toast-container {
  z-index: 1090;
}

/* En el celular el toast abajo tapaba la cola: arriba se lee igual y no estorba. */
@media (max-width: 575.98px) {
  .toast-container {
    top: 0;
    bottom: auto !important;
    left: 0;
    right: 0;
    width: 100%;
  }
}

.toast {
  border-radius: 10px;
}

/* ------------------------------------------------------------ varios */

hr {
  border-color: var(--line);
  opacity: 1;
}

::selection {
  background: rgba(107, 140, 255, .35);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2c3446 transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: #2c3446;
  border-radius: 999px;
  border: 3px solid #0b0d13;
}

@media (max-width: 575.98px) {
  #healthText {
    display: none;
  }

  .health-badge {
    padding: .32rem;
  }

  .queue-item {
    flex-wrap: wrap;
  }

  .queue-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 60px;
  }

  .login-card .card-body {
    padding: 1.6rem !important;
  }

  .pdf-job-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-drop-help {
    margin-left: 0;
    width: 100%;
  }

  .pdf-order-tag {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .app-tabs {
    order: 3;
    width: 100%;
  }

  .pdf-options {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
