/* ============================================================================
   Sistema de Stock — Pañol E.E.S.T. N° 3 Benavidez
   Hoja de estilos principal
   ============================================================================ */

:root {
  --navy: #0f1e4d;
  --navy-dark: #0a1638;
  --navy-light: #1a2d63;
  --blue: #2f5fe0;
  --blue-dark: #2249c0;
  --blue-50: #eaf0ff;
  --blue-100: #dbe6ff;

  --green: #17a367;
  --green-50: #e6f8ef;
  --green-100: #d1f2e2;

  --orange: #f2994a;
  --orange-50: #fff2e6;
  --orange-100: #ffe6cc;

  --red: #e34d4d;
  --red-50: #fdecec;
  --red-100: #fbd8d8;

  --purple: #8b5fe0;
  --purple-50: #f1ecfd;

  --gray-50: #f7f8fb;
  --gray-100: #eef1f6;
  --gray-200: #e3e7ee;
  --gray-400: #9aa3b5;
  --gray-500: #6b7385;
  --gray-700: #3d4457;
  --gray-900: #1c2233;

  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 77, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 30, 77, 0.08);

  --sidebar-w: 260px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---------- Layout general ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

.page-content {
  padding: 28px 32px;
  flex: 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 22px;
}

.sidebar-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.sidebar-brand-text .brand-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand-text .brand-subtitle {
  font-size: 12.5px;
  color: #aab4da;
  margin-top: 2px;
}

.nav-group-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #7482ab;
  font-weight: 700;
  margin: 18px 10px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: #c7cfe8;
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg { flex-shrink: 0; width: 19px; height: 19px; }

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(47, 95, 224, 0.4);
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11.5px; color: #93a0c7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-logout { flex-shrink: 0; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--blue);
  color: #fff;
  border: none;
  display: none; /* solo tiene sentido en mobile, donde el sidebar se puede ocultar */
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-titles { margin-right: auto; }
.topbar-title { font-size: 21px; font-weight: 700; margin: 0; }
.topbar-subtitle { font-size: 13.5px; color: var(--gray-500); margin: 2px 0 0; }

.topbar-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
}

.topbar-icon-btn .badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  z-index: 100;
}
.notif-dropdown-header {
  font-size: 13px; font-weight: 700; padding: 14px 16px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; font-size: 13px; color: var(--gray-900);
  border-bottom: 1px solid var(--gray-100);
}
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--gray-500); }

/* ---------- Global search dropdown ---------- */
.search-wrapper { position: relative; flex: 1; max-width: 420px; }
.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  z-index: 100;
}
.search-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gray-400); padding: 12px 16px 6px;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 13.5px; color: var(--gray-900);
  cursor: pointer; transition: background 0.1s ease;
}
.search-result-item:hover { background: var(--gray-50); }
.search-result-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-50); color: var(--blue);
}
.search-result-icon svg { width: 15px; height: 15px; }

/* ---------- Combobox de búsqueda de herramienta (nuevo préstamo) ---------- */
.tool-combobox { position: relative; }
.tool-combobox-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 60;
}
.tool-combobox-item {
  padding: 9px 12px;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tool-combobox-item:hover { background: var(--gray-50); }
.tool-combobox-item .disp { color: var(--gray-400); font-size: 12px; flex-shrink: 0; }
.tool-combobox-empty { padding: 10px 12px; font-size: 13px; color: var(--gray-500); }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-100);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  min-width: 320px;
  color: var(--gray-500);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.topbar-search:focus-within {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-50);
}
.topbar-search svg { flex-shrink: 0; width: 17px; height: 17px; }

.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  flex: 1;
  color: var(--gray-900);
}

/* ---------- Cards & stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  padding: 20px;
  display: flex;
  gap: 14px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }

.stat-icon.blue { background: var(--blue-100); color: var(--blue); }
.stat-icon.green { background: var(--green-100); color: var(--green); }
.stat-icon.orange { background: var(--orange-100); color: var(--orange); }
.stat-icon.red { background: var(--red-100); color: var(--red); }
.stat-icon.purple { background: var(--purple-50); color: var(--purple); }
.stat-card { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  text-transform: uppercase;
}

.stat-value { font-size: 27px; font-weight: 800; margin: 2px 0 3px; }
.stat-hint { font-size: 12px; color: var(--gray-500); }
.stat-hint.positive { color: var(--green); font-weight: 600; }
.stat-hint.warning { color: var(--red); font-weight: 600; }
.stat-hint a { color: var(--blue); font-weight: 600; }

/* ---------- Panels ---------- */
.panel {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h2 { font-size: 16.5px; margin: 0; font-weight: 700; }

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Botones de acción con solo ícono (editar/eliminar/cerrar sesión/cerrar modal):
   tamaño fijo, fondo sutil y hover claro para que siempre se vean como clicables. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--gray-100);
  color: var(--gray-700);
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--gray-200); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: var(--red-50); }
.icon-btn.on-dark { background: rgba(255, 255, 255, 0.08); color: #c7cfe8; }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.actions-cell { display: flex; gap: 6px; align-items: center; }

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gray-400);
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--gray-200);
}
.data-table tbody td { padding: 12px 10px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-50); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.cell-title { font-weight: 600; }
.cell-subtitle { font-size: 12px; color: var(--gray-500); }
.cell-tool { display: flex; align-items: center; gap: 10px; }
.cell-tool-icon {
  width: 34px; height: 34px; border-radius: 8px; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.badge-orange { background: var(--orange-100); color: #b5610f; }
.badge-green { background: var(--green-100); color: #0d7d4f; }
.badge-red { background: var(--red-100); color: #b52323; }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-blue { background: var(--blue-100); color: var(--blue-dark); }

/* ---------- Quick actions ---------- */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 10px; border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: #fff;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.quick-action:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.quick-action-icon {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 4px 10px rgba(16, 30, 77, 0.18);
}
.quick-action-icon svg { width: 22px; height: 22px; }
.quick-action span { font-size: 13px; font-weight: 600; color: var(--gray-700); text-align: center; }

/* ---------- Activity feed ---------- */
.activity-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--gray-100); }
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.activity-text { font-size: 13px; color: var(--gray-900); }
.activity-time { font-size: 11.5px; color: var(--gray-400); margin-left: auto; white-space: nowrap; padding-left: 10px; }
.activity-row { display: flex; align-items: center; width: 100%; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600; border: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(47, 95, 224, 0.28); }
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(47, 95, 224, 0.34); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--red-50); color: var(--red); }
.btn-danger:hover { background: var(--red-100); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--gray-700); }
.form-control {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--gray-200); font-size: 13.5px; outline: none;
  font-family: inherit; background: #fff; color: var(--gray-900);
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* ---------- Toast feedback ---------- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--gray-900); color: #fff; padding: 12px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.2s ease;
}
.toast.success { background: #0d7d4f; }
.toast.error { background: #b52323; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 30, 77, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 150; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--gray-100); color: var(--gray-500); font-size: 20px; }
.modal-close:hover { background: var(--gray-200); color: var(--gray-900); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Toolbar (search/filter rows on list pages) ---------- */
.list-toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.list-toolbar .form-control { max-width: 260px; }
.list-toolbar-spacer { flex: 1; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-500); }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 60%, #060d24 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand img { width: 78px; height: 78px; margin-bottom: 12px; }
.login-brand h1 { font-size: 20px; margin: 0 0 3px; }
.login-brand p { font-size: 13px; color: var(--gray-500); margin: 0; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: none; border: none; color: var(--gray-400);
  transition: background 0.15s ease, color 0.15s ease;
}
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle:hover { background: var(--gray-100); color: var(--gray-700); }
.login-error {
  background: var(--red-50); color: var(--red); font-size: 13px; padding: 10px 14px;
  border-radius: var(--radius-md); margin-bottom: 16px; display: none;
}
.login-error.visible { display: block; }
.login-demo { margin-top: 20px; font-size: 11.5px; color: var(--gray-400); text-align: center; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .search-wrapper { display: none; }
  .topbar-toggle { display: flex; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-content { padding: 18px; }
  .topbar { padding: 14px 18px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Listas con carga por partes (IntersectionObserver) ---------- */
.lazy-sentinel { height: 1px; }
.list-status { text-align: center; font-size: 12.5px; color: var(--gray-500); padding: 12px 0 2px; min-height: 18px; }
.list-status-loading::before {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--gray-200); border-top-color: var(--blue); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.list-status-error { color: var(--red); margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-scroll { width: 100%; overflow-x: auto; }

/* Toolbar con búsqueda + filtros */
.list-toolbar .search-field { flex: 1 1 260px; max-width: 380px; }
.list-toolbar .date-field { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gray-500); }
.list-toolbar .date-field .form-control { max-width: 160px; }
mark.hl { background: #fff2b3; color: inherit; padding: 0 1px; border-radius: 3px; }

/* ---------- Devolución en 2 etapas ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 16px; }
.step-pill {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius-md); background: var(--gray-100); color: var(--gray-500);
  font-size: 12.5px; font-weight: 600;
}
.step-pill .step-num {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; font-size: 12px;
}
.step-pill.active { background: var(--blue-50); color: var(--blue-dark); }
.step-pill.active .step-num { background: var(--blue); color: #fff; }
.step-pill.done .step-num { background: #0d7d4f; color: #fff; }
.return-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100);
}
.return-item:last-child { border-bottom: none; }
.return-item .form-control { width: 84px; padding: 8px 10px; }
.return-item input[type="checkbox"] { width: 17px; height: 17px; }
.return-item.disabled { opacity: 0.55; }
.return-qty { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gray-500); }
.segmented { display: inline-flex; border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; }
.segmented label { padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; margin: 0; color: var(--gray-700); }
.segmented label { position: relative; }
/* Oculto a la vista pero accesible con teclado (Tab + flechas). */
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: -2px; }
.segmented label:has(input:checked) { background: var(--blue); color: #fff; }
.return-summary {
  background: var(--gray-50); border-radius: var(--radius-md); padding: 10px 12px; font-size: 13px; margin-top: 12px;
}
.progress-mini { font-size: 12px; color: var(--gray-500); }

.data-table td .btn { white-space: nowrap; }
