/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #4f8ef7;
  --blue-dark: #2563eb;
  --blue-light: #1e3a5f;
  --green: #22c55e;
  --green-light: #14291e;
  --yellow: #fbbf24;
  --yellow-light: #2d2008;
  --red: #f87171;
  --red-light: #2d0f0f;
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1a2336;
  --surface-3: #1e2d45;
  --border: #1e3358;
  --border-2: #2a4470;
  --text: #f0f4ff;
  --text-muted: #7a90b8;
  --text-dim: #c5d0e8;
  --shadow: 0 2px 8px rgba(0,0,0,.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  --radius: 10px;
  --radius-lg: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(11,17,32,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 500;
  transition: all .15s;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: rgba(79,142,247,.15); color: var(--blue); border: 1px solid rgba(79,142,247,.3); }

/* ===== LAYOUT ===== */
.container {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 16px;
}

/* ===== CARD ===== */
.card {
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 -3px 16px rgba(59,130,246,.45);
  border: 1px solid rgba(255,255,255,.1);
  border-top: 4px solid #3b82f6;
}
.form-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.form-logo {
  height: 64px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 0 0 white);
  -webkit-filter: brightness(0) invert(1);
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.card-subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }
.form-group > label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.sublabel {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
input.invalid, select.invalid, textarea.invalid {
  border-color: var(--red);
}
textarea { resize: vertical; }
select option { background: var(--surface); color: var(--text); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .two-col { grid-template-columns: 1fr; }
}

.medidas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .medidas-grid { grid-template-columns: repeat(2, 1fr); }
}

.error-msg {
  display: block;
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface-2);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
}
.upload-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.upload-content p { color: var(--text-dim); font-size: 14px; margin-bottom: 4px; }
.upload-hint { color: var(--text-muted) !important; font-size: 12px !important; }
.link-btn {
  background: none; border: none; color: var(--blue);
  cursor: pointer; font-size: inherit; padding: 0;
  text-decoration: underline; font-weight: 500;
}

.file-preview { display: flex; align-items: center; gap: 16px; text-align: left; }
.file-preview img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-3);
}
.file-info { flex: 1; }
.file-info span { display: block; font-weight: 500; font-size: 14px; word-break: break-all; color: var(--text); }
.remove-btn {
  background: none; border: none; color: var(--red);
  cursor: pointer; font-size: 13px; margin-top: 6px;
  padding: 0; font-weight: 500;
}

/* ===== BUTTONS ===== */
.form-actions { display: flex; gap: 12px; margin-top: 28px; }
.btn {
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary {
  background: var(--surface); color: var(--text-dim);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ===== NAV USER ===== */
.nav-user {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.nav-username { font-size: 14px; font-weight: 500; color: var(--text-dim); }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.count-badge {
  background: var(--blue); color: white;
  font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}

/* ===== READONLY INPUT ===== */
.input-readonly {
  background: var(--surface-3) !important;
  color: var(--text-muted) !important;
  cursor: default;
}

/* ===== DASHBOARD HEADER ===== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.dashboard-header h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  min-width: 80px;
}
.stat-box.pending  { border-left-color: var(--yellow); }
.stat-box.progress { border-left-color: var(--blue); }
.stat-box.done     { border-left-color: var(--green); }
.stat-num   { display: block; font-size: 24px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.filter-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  width: auto;
}

/* ===== PEDIDOS LIST ===== */
.pedidos-list { display: flex; flex-direction: column; gap: 14px; }

.pedido-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  transition: box-shadow .15s;
}
.pedido-card:hover { box-shadow: var(--shadow-md); }
.pedido-card.estado-Pendiente  { border-left-color: var(--yellow); }
.pedido-card.estado-En-proceso { border-left-color: var(--blue); }
.pedido-card.estado-Completado { border-left-color: var(--green); }

.pedido-top {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.pedido-montador { font-size: 17px; font-weight: 700; color: var(--text); }
.pedido-id   { color: var(--text-muted); font-size: 12px; }
.pedido-fecha { color: var(--text-muted); font-size: 12px; }

.medidas-row {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.medida-item {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.medida-item span { color: var(--text-muted); font-weight: 400; }

.pedido-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.badge {
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}
.badge-yellow  { background: rgba(251,191,36,.15);  color: #fbbf24; }
.badge-blue    { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-green   { background: rgba(34,197,94,.15);   color: #4ade80; }
.badge-indigo  { background: rgba(99,102,241,.15);  color: #818cf8; }
.badge-teal    { background: rgba(20,184,166,.15);  color: #2dd4bf; }
.badge-emerald { background: rgba(16,185,129,.15);  color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.badge-gray    { background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border); }

.thumb-preview {
  width: 54px; height: 54px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
  cursor: pointer;
}
.has-file-icon { font-size: 40px; cursor: pointer; }

.pedido-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.select-estado {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; cursor: pointer;
  background: var(--surface); color: var(--text);
  font-family: inherit; outline: none;
}
.select-estado:focus { border-color: var(--blue); }
.action-row { display: flex; gap: 6px; }
.icon-btn {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px;
  cursor: pointer; font-size: 14px; transition: all .15s; color: var(--text-dim);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.del:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
}
.empty-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.empty-state p { font-size: 16px; margin-bottom: 20px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface);
}
.modal-header h2 { font-size: 18px; color: var(--text); }
.modal-close {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--text-muted); padding: 4px 8px;
  border-radius: var(--radius); transition: all .15s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 20px 24px; }

.detail-row { margin-bottom: 14px; }
.detail-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.detail-value { font-size: 15px; font-weight: 500; color: var(--text); }

.modal-img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); margin-top: 8px;
}

/* ===== LOGIN PAGE ===== */
.auth-body {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 28px; display:flex; flex-direction:column; align-items:center; }
.auth-brand svg { color: var(--blue); margin-bottom: 8px; }
.auth-brand h1 { font-size: 24px; font-weight: 700; color: var(--blue); }
.auth-brand p  { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  padding: 14px; background: none; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
  border-bottom: 2px solid transparent;
}
.auth-tab:hover { color: var(--text); background: var(--surface-2); }
.auth-tab.active { color: var(--blue); border-bottom-color: var(--blue); background: var(--surface); }

.auth-form { display: none; padding: 28px; }
.auth-form.active { display: block; }

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px;
  color: var(--text-muted); line-height: 1;
}
.toggle-pass:hover { color: var(--text); }

.btn-full { width: 100%; justify-content: center; margin-top: 4px; }
.form-error { margin-bottom: 12px; font-size: 13px; min-height: 0; }
.auth-hint { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; }

/* ===== BI FILTER BAR ===== */
.bi-filterbar {
  background: rgba(11,17,32,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  position: sticky;
  top: 62px;
  z-index: 90;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.bi-filters-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.bi-filter-item { display: flex; flex-direction: column; gap: 4px; }
.bi-filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.bi-select, .bi-date {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  min-width: 130px;
}
.bi-select:focus, .bi-date:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.bi-date { min-width: 140px; }

.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(79,142,247,.12); color: var(--blue);
  border: 1px solid rgba(79,142,247,.3);
  border-radius: 99px; padding: 3px 10px;
  font-size: 12px; font-weight: 500;
}
.chip-x {
  background: none; border: none; cursor: pointer;
  color: var(--blue); font-size: 15px; line-height: 1;
  padding: 0; font-weight: 700;
}
.chip-x:hover { color: var(--blue-dark); }

/* ===== BI CONTAINER ===== */
.bi-container {
  max-width: 1280px;
  margin: 28px auto;
  padding: 0 20px;
}

/* ===== KPI ROW ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 600px) { .kpi-row { grid-template-columns: 1fr; } }

.kpi-card {
  background: linear-gradient(135deg, #131f35 0%, #0f1a2e 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 3px solid var(--border);
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}
.kpi-card:hover { transform: translateY(-2px); }

.kpi-card.kpi-yellow  { border-top-color: #fbbf24; box-shadow: 0 0 28px rgba(251,191,36,.18), 0 4px 16px rgba(0,0,0,.4); }
.kpi-card.kpi-yellow .kpi-num  { color: #fbbf24; text-shadow: 0 0 20px rgba(251,191,36,.5); }
.kpi-card.kpi-yellow .kpi-icon { background: rgba(251,191,36,.1); color: #fbbf24; }

.kpi-card.kpi-blue    { border-top-color: #4f8ef7; box-shadow: 0 0 28px rgba(79,142,247,.18), 0 4px 16px rgba(0,0,0,.4); }
.kpi-card.kpi-blue .kpi-num    { color: #4f8ef7; text-shadow: 0 0 20px rgba(79,142,247,.5); }
.kpi-card.kpi-blue .kpi-icon   { background: rgba(79,142,247,.1); color: #4f8ef7; }

.kpi-card.kpi-green   { border-top-color: #10b981; box-shadow: 0 0 28px rgba(16,185,129,.18), 0 4px 16px rgba(0,0,0,.4); }
.kpi-card.kpi-green .kpi-num   { color: #10b981; text-shadow: 0 0 20px rgba(16,185,129,.5); }
.kpi-card.kpi-green .kpi-icon  { background: rgba(16,185,129,.1); color: #10b981; }

.kpi-card.kpi-indigo  { border-top-color: #818cf8; box-shadow: 0 0 28px rgba(129,140,248,.18), 0 4px 16px rgba(0,0,0,.4); }
.kpi-card.kpi-indigo .kpi-num  { color: #818cf8; text-shadow: 0 0 20px rgba(129,140,248,.5); }
.kpi-card.kpi-indigo .kpi-icon { background: rgba(129,140,248,.1); color: #818cf8; }

.kpi-card.kpi-teal    { border-top-color: #2dd4bf; box-shadow: 0 0 28px rgba(45,212,191,.18), 0 4px 16px rgba(0,0,0,.4); }
.kpi-card.kpi-teal .kpi-num    { color: #2dd4bf; text-shadow: 0 0 20px rgba(45,212,191,.5); }
.kpi-card.kpi-teal .kpi-icon   { background: rgba(45,212,191,.1); color: #2dd4bf; }

.kpi-card.kpi-emerald { border-top-color: #34d399; box-shadow: 0 0 28px rgba(52,211,153,.18), 0 4px 16px rgba(0,0,0,.4); }
.kpi-card.kpi-emerald .kpi-num { color: #34d399; text-shadow: 0 0 20px rgba(52,211,153,.5); }
.kpi-card.kpi-emerald .kpi-icon { background: rgba(52,211,153,.1); color: #34d399; }

.kpi-icon { display:flex; align-items:center; justify-content:center; width:50px; height:50px; border-radius:12px; background:rgba(255,255,255,.05); flex-shrink:0; color:var(--text-muted); }
.kpi-icon svg { width:24px; height:24px; stroke-width:1.6; }
.kpi-body { display: flex; flex-direction: column; gap: 4px; }
.kpi-num  { font-size: 36px; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kpi-pct  { font-size: 12px; color: var(--text-muted); }

/* ===== CHARTS GRID ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: linear-gradient(135deg, #131f35 0%, #0f1a2e 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.chart-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.chart-hint  { font-size: 11px; color: var(--text-muted); }
.chart-wrap  { position: relative; height: 220px; }
.chart-wrap-sm { height: 240px; }

/* ===== TABLE CARD ===== */
.table-card {
  background: linear-gradient(135deg, #131f35 0%, #0f1a2e 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
  overflow: hidden;
  margin-bottom: 40px;
}
.table-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.table-count { font-size: 13px; color: var(--text-muted); margin-top: 2px; display: block; }

.table-wrap { overflow-x: auto; }
.bi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bi-table th {
  background: rgba(11,17,32,.6);
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.bi-table th.sortable { cursor: pointer; }
.bi-table th.sortable:hover { background: var(--surface-3); color: var(--text); }
.bi-table th.sort-asc::after  { content: ' ↑'; color: var(--blue); }
.bi-table th.sort-desc::after { content: ' ↓'; color: var(--blue); }

.bi-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.bi-table tr:last-child td { border-bottom: none; }
.bi-table tr:hover td { background: rgba(79,142,247,.05); }

.td-id    { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.td-sm    { font-size: 12px; white-space: nowrap; }
.td-medidas { white-space: nowrap; }
.mini-badge {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
}
.table-thumb {
  width: 36px; height: 36px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--border);
  cursor: pointer; display: block; margin: 0 auto;
}
.estado-select-table {
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px; cursor: pointer;
  background: var(--surface); color: var(--text);
  font-family: inherit; outline: none;
}

/* ===== DELIVERY PIPELINE ===== */
.delivery-pipeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 18px 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.pipeline-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}
.pipeline-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 60%;
}
.pipeline-step {
  display: flex; align-items: center; flex: 1; min-width: 120px;
}
.pipeline-card {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  transition: box-shadow .15s;
}
.pipeline-card:hover { box-shadow: var(--shadow-md); }
.pipeline-card .kpi-icon { width:34px; height:34px; border-radius:8px; }
.pipeline-card .kpi-icon svg { width:18px; height:18px; }
.pipeline-card .kpi-num   { font-size: 22px; }
.pipeline-card .kpi-label { font-size: 11px; }
.pipeline-card.kpi-indigo  { border-left: 3px solid #6366f1; }
.pipeline-card.kpi-teal    { border-left: 3px solid #0d9488; }
.pipeline-card.kpi-emerald { border-left: 3px solid #059669; }
.pipeline-arrow {
  font-size: 20px; color: var(--border-2);
  padding: 0 10px; flex-shrink: 0;
}

/* KPI default (total) */
.kpi-card:not([class*="kpi-"]):not(.kpi-yellow):not(.kpi-green):not(.kpi-blue):not(.kpi-indigo):not(.kpi-teal):not(.kpi-emerald) {
  border-top-color: #4f8ef7;
  box-shadow: 0 0 28px rgba(79,142,247,.12), 0 4px 16px rgba(0,0,0,.4);
}

/* ===== PROGRESS STEPPER ===== */
.stepper {
  display: flex;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  gap: 0;
}
.step {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex-shrink: 0;
}
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 2px solid var(--border);
  background: var(--surface-3); color: var(--text-muted);
  transition: all .2s;
}
.step-label {
  font-size: 10px; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; text-align: center; max-width: 64px;
}
.step-line {
  flex: 1; height: 2px; background: var(--border);
  min-width: 16px; margin-bottom: 16px; transition: background .2s;
}
.step-line.line-done { background: #10b981; }

.step-done .step-circle {
  background: #ecfdf5; border-color: #10b981;
  color: #059669;
}
.step-done .step-label { color: #059669; }

.step-active .step-circle {
  background: var(--blue); border-color: var(--blue);
  color: white; box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
.step-active .step-label { color: var(--blue); font-weight: 700; }

/* Active overrides per status */
.step-active-taller    .step-circle { background: #6366f1; border-color: #6366f1; }
.step-active-entmontador .step-circle { background: #0d9488; border-color: #0d9488; }
.step-active-entcliente .step-circle { background: #059669; border-color: #059669; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 12px 24px; border-radius: 99px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  z-index: 300; white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; }
