/* Panel de pedidos y página de estado. Usa los tokens de styles.css. */

.admin-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.admin #logout { margin-left: auto; }

.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

.login { display: grid; place-items: center; min-height: calc(100dvh - var(--topbar-h)); padding: 24px 0; }
.login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 380px);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 30px; font-weight: 800; }

.orders { max-width: 1200px; margin: 0 auto; padding: 32px 0 64px; }
.orders-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.orders-head h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
.filters { margin-bottom: 16px; }
.chip .count { margin-left: 4px; opacity: 0.6; font-variant-numeric: tabular-nums; }

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.orders-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.orders-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.orders-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.orders-table tbody tr { cursor: pointer; transition: background 0.12s; }
.orders-table tbody tr:hover, .orders-table tbody tr:focus-visible { background: var(--paper); }
.orders-table tbody tr:last-child td { border-bottom: 0; }
.orders-table a { color: var(--ink); font-weight: 700; text-decoration: none; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.empty { padding: 32px; color: var(--muted); text-align: center; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill[data-status='en_impresion'] { background: var(--warn-soft); color: var(--warn); }
.pill[data-status='listo'] { background: var(--accent-soft); color: var(--accent); }
.pill[data-status='entregado'] { background: var(--ok-soft); color: var(--ok); }

/* Detalle del pedido */

.drawer {
  width: min(100%, 520px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: -20px 0 60px -20px rgba(29, 29, 27, 0.35);
}
.drawer::backdrop { background: rgba(29, 29, 27, 0.35); }
.drawer[open] { animation: drawer-in 0.28s var(--ease); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }

.drawer-inner { display: grid; gap: 20px; padding: 20px var(--gutter) 40px; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head h2 { font-size: 28px; font-weight: 800; }
.drawer-head .btn-icon { flex: none; width: 44px; }

.d-mockup {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.d-mockup img { display: block; width: 100%; height: 100%; object-fit: cover; }

.d-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.d-section h3 { font: 700 17px/1.2 var(--font-display); }
.d-notes { padding: 12px; border-radius: var(--radius-sm); background: var(--paper); white-space: pre-wrap; }

.files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.file {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.file:hover { background: var(--paper); border-color: var(--line-strong); }
.file .icon { color: var(--accent); }
.file span { display: grid; min-width: 0; }
.file small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-form { display: grid; gap: 14px; }
.status-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-options .choice span { min-height: 44px; font-size: 14px; }

.timeline { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.timeline li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.timeline time { color: var(--muted); font-size: 13px; }
.timeline p { flex-basis: 100%; color: var(--ink-2); font-size: 14px; }

/* Página de estado para el cliente */

.track { max-width: 560px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 0; display: grid; gap: 20px; }
.track h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 800; }
.track-shot { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.track-shot img { display: block; width: 100%; height: auto; }

.progress-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.progress-steps li {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 22px;
  color: var(--muted);
  font-weight: 600;
}
.progress-steps li::before {
  content: '';
  flex: none;
  width: 18px; height: 18px;
  margin-top: 2px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
}
.progress-steps li::after {
  content: '';
  position: absolute;
  left: 8px; top: 22px; bottom: 2px;
  width: 2px;
  background: var(--line);
}
.progress-steps li:last-child::after { display: none; }
.progress-steps li.is-done { color: var(--ink); }
.progress-steps li.is-done::before { border-color: var(--ok); background: var(--ok); }
.progress-steps li.is-done::after { background: var(--ok); }
.progress-steps li.is-current { color: var(--ink); }
.progress-steps li.is-current::before { border-color: var(--cyan-ink); background: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-soft); }
.progress-steps time { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }

@media (max-width: 560px) {
  .orders-table th:nth-child(2), .orders-table td:nth-child(2),
  .orders-table th:nth-child(4), .orders-table td:nth-child(4) { display: none; }
  .admin-tag { display: none; }
}

.pill[data-status='a_confirmar'] { background: var(--paper-2); color: var(--ink-2); }
.pill[data-status='pendiente'] { background: var(--cyan-soft); color: #00628c; }
.pill[data-status='cancelado'] { background: var(--bad-soft); color: var(--bad); }
.pill[data-status='deposit'] { background: var(--yellow-soft); color: var(--ink); }
.pill[data-status='priority'] { background: var(--accent-soft); color: var(--accent); }
.pill-sm { padding: 2px 8px; font-size: 12px; }

.track-id { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.track-notice {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--yellow-soft);
  border: 1px solid #efe08a;
}

/* Barra superior de seguimiento y cuenta */
.topbar-end { margin-left: auto; }

/* Seguimiento: productos y pago */
.track-items { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.track-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.track-item img { display: block; width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper-2); }
.track-notice.is-ok { background: var(--ok-soft); border-color: #b9dfc9; color: var(--ok); font-weight: 600; }
.track-notice.is-bad { background: var(--bad-soft); border-color: #f1c4bf; color: var(--bad); font-weight: 600; }
@media (max-width: 420px) {
  .track-item { grid-template-columns: 64px minmax(0, 1fr); }
  .track-item img { width: 64px; height: 64px; }
  .track-item .cart-line { grid-column: 2; }
}

/* Cuenta */
.account-card { width: min(100%, 420px); }
.seg-wide { display: flex; width: 100%; }
.seg-wide button { flex: 1; width: auto; height: 42px; font-weight: 700; }
.seg-wide button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 16px; }
.auth-form h1 { font-size: 28px; font-weight: 800; }
.auth-form .btn-link { justify-self: center; }
.form-ok { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.profile-form { gap: 14px; }
.history { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.history-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.history-top, .history-bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.history-bottom { align-items: center; }
.history-id { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-summary { font-weight: 700; }
.history-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.history-thumbs img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper-2); }
.history-bottom strong { font-variant-numeric: tabular-nums; }
.pill[data-pay='aprobado'] { background: var(--ok-soft); color: var(--ok); }
.pill[data-pay='pendiente'], .pill[data-pay='rechazado'] { background: var(--bad-soft); color: var(--bad); }
.pill[data-pay='en_proceso'] { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 880px) { .account-grid { grid-template-columns: 1fr; } }

/* Panel: productos y pago del pedido */
.d-items { display: grid; gap: 16px; }
.d-item { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.d-item:last-child { border-bottom: 0; padding-bottom: 0; }
.d-item-head { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.d-item-shot { width: 96px; height: 96px; overflow: hidden; border-radius: var(--radius-sm); background: var(--paper-2); }
.d-item-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Mundo «Orden de trabajo»: sellos de goma y tickets ─────────────────── */

/* Sello: contorno = pendiente o en curso · lleno = hecho · tachado = cancelado */
.pill {
  border: 2px solid currentColor;
  border-radius: 2px;
  background: transparent;
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pill[data-status='a_confirmar'] { background: transparent; color: var(--ink-2); border-style: dashed; }
.pill[data-status='pendiente'] { background: transparent; color: var(--cyan-ink); }
.pill[data-status='en_impresion'] { background: transparent; color: var(--warn); }
.pill[data-status='listo'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill[data-status='entregado'] { background: var(--ok); border-color: var(--ok); color: #fff; }
.pill[data-status='cancelado'] { background: transparent; color: var(--bad); text-decoration: line-through; }
.pill[data-status='deposit'] { background: var(--yellow); border-color: var(--ink); color: var(--ink); }
.pill[data-status='priority'] { background: transparent; color: var(--accent); }
.pill[data-pay='aprobado'] { background: var(--ok); border-color: var(--ok); color: #fff; }
.pill[data-pay='pendiente'], .pill[data-pay='rechazado'] { background: transparent; color: var(--bad); }
.pill[data-pay='en_proceso'] { background: transparent; color: var(--warn); }



.track-id { color: var(--ink); font-family: var(--font-mono); font-size: 14px; }
.track-item, .history-item, .table-wrap, .login-card, .profile-form { border-color: var(--rule); border-radius: var(--radius); }
.track-item img, .history-thumbs img, .d-item-shot { border-radius: 0; }
.track-notice { border-radius: 0; border-style: dashed; }
.login-card { border-top: 4px solid var(--rule); border-radius: 0; box-shadow: none; }
.login-card h1, .auth-form h1, .orders-head h1 { text-transform: uppercase; letter-spacing: -0.025em; }
.history-id { color: var(--ink); font-family: var(--font-mono); font-size: 13px; }
.history-summary { font-weight: 800; text-transform: uppercase; }
.seg-wide { border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); }
.seg-wide button { border-radius: 2px; font-stretch: 85%; letter-spacing: 0.06em; text-transform: uppercase; }
.seg-wide button[aria-selected='true'] { background: var(--ink); color: #fff; box-shadow: none; }
.orders-table th { color: var(--ink); font-stretch: 85%; letter-spacing: 0.08em; text-transform: uppercase; }
.orders-table td.mono a, .mono { font-family: var(--font-mono); font-size: 14px; }
.admin-tag { border-radius: 2px; background: var(--yellow); color: var(--ink); font-stretch: 85%; letter-spacing: 0.06em; text-transform: uppercase; }
.drawer { border-left: 1px solid var(--rule); }
.drawer-head h2 { font-family: var(--font-mono); font-size: 24px; }
.track-code { font: 700 12px/1 var(--font-mono); letter-spacing: 0.04em; margin-bottom: 4px; }
.track .stamp-title { margin-top: 12px; }

/* Panel: mismo sistema de tickets que la web */
.pill[data-status='priority'] { color: var(--ink); background: var(--yellow-soft); border-color: var(--ink); }
.file { border-color: var(--rule); border-radius: var(--radius-sm); }
.file .icon { color: var(--ink); }
.d-mockup { border-color: var(--rule); border-radius: 0; }
.d-section { border-color: var(--rule); border-radius: var(--radius); }
.d-section h3 { font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }

/* Stock */
.stock-list { display: grid; gap: 0; }
.stock-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--line-strong); }
.stock-name { font-weight: 800; text-transform: uppercase; }
.stock-name .mono { margin-right: 6px; font-weight: 700; }
.stock-single input { max-width: 160px; text-align: center; font-weight: 700; }
.stock-sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
