/* ══════════════════════════════════════════
   CARPINTERÍA 360 – Login & Role Styles
   ══════════════════════════════════════════ */

/* ── OPTIMIZACIONES TÁCTILES MÓVILES ── */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button, .btn, .chip, .nav-item, .menu-mas-btn, a, [onclick] {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
  cursor: pointer;
}

/* Feedback visual inmediato al tocar */
button:active, .btn:active, .chip:active, .nav-item:active, .menu-mas-btn:active, [onclick]:active {
  opacity: 0.7;
  transition: opacity 0.1s ease;
}

/* Prevenir zoom accidental en inputs */
input, select, textarea {
  font-size: 16px !important; /* Previene zoom automático en iOS */
}

/* Scroll suave en móviles */
.scroll-area {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── LOGIN SCREEN ── */
.login-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #0D0D0D 0%, #1A1510 50%, #0D0D0D 100%);
  overflow-y: auto;
}

.login-header {
  padding: 48px 24px 24px;
  text-align: center;
}

.login-brand {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 4px;
  color: #fff;
}
.login-brand span { color: var(--orange); }

.login-brand-img {
  display: block;
  max-width: 320px;
  width: 84%;
  height: auto;
  margin: 0 auto;
  background: #000;
  border-radius: 6px;
  padding: 6px 10px;
}

.login-sub {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  margin-top: 6px;
}

.login-body {
  flex: 1;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 2px;
  margin-bottom: 18px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-error {
  color: var(--red);
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
}

/* ── SWITCH LOGIN / REGISTRO ── */
.auth-switch {
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}
.auth-switch a {
  color: var(--orange);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.auth-switch a:active { opacity: .7; }

/* ── SELECTOR DE ROL (formulario de registro) ── */
.role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.role-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: var(--r);
  border: 1.5px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  transition: all .2s;
}
.role-tab:active { transform: scale(.97); }

.role-tab-cliente.active { border-color: #1565C0; background: rgba(21,101,192,.18); }
.role-tab-carpintero.active { border-color: var(--orange); background: rgba(245,130,10,.18); }
.role-tab-distribuidor.active { border-color: #2E7D32; background: rgba(46,125,50,.18); }

.role-tab .role-icon {
  font-size: 1.4rem;
}
.role-tab .role-name {
  font-weight: 700;
  font-size: .72rem;
  color: #fff;
}

.role-tab-desc {
  text-align: center;
  font-size: .7rem;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
}

.login-footer {
  text-align: center;
  padding: 16px;
  font-size: .65rem;
  color: rgba(255,255,255,.35);
  letter-spacing: .5px;
  line-height: 1.8;
}

.login-footer .credito {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
}


/* ── ROLE-SPECIFIC DASHBOARD CARDS ── */

/* Cliente dashboard */
.cliente-welcome {
  background: linear-gradient(135deg, #1565C0, #0D47A1);
  border-radius: var(--r);
  padding: 20px;
  color: #fff;
  margin: 14px;
}
.cliente-welcome .welcome-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 2px;
}
.cliente-welcome .welcome-sub {
  font-size: .75rem;
  opacity: .7;
  margin-top: 4px;
}

/* Carpintero dashboard - reuse existing KPI styles */

/* Distribuidor dashboard */
.dist-welcome {
  background: linear-gradient(135deg, #2E7D32, #1B5E20);
  border-radius: var(--r);
  padding: 20px;
  color: #fff;
  margin: 14px;
}
.dist-welcome .welcome-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 2px;
}
.dist-welcome .welcome-sub {
  font-size: .75rem;
  opacity: .7;
  margin-top: 4px;
}


/* ── SHARED COMPONENTS ── */

/* Chat module */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .85rem;
  line-height: 1.4;
}
.chat-msg.sent {
  align-self: flex-end;
  background: var(--orange);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.received {
  align-self: flex-start;
  background: var(--card);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}
.chat-msg .msg-time {
  font-size: .6rem;
  opacity: .6;
  margin-top: 4px;
  text-align: right;
}
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: .85rem;
  outline: none;
  background: var(--bg);
}
.chat-input-bar button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* Project status timeline (Cliente) */
.project-timeline {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  position: relative;
}
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 38px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  background: var(--bone);
  border: 2px solid var(--border);
}
.timeline-dot.done {
  background: var(--green-bg);
  border-color: var(--green);
}
.timeline-dot.active {
  background: var(--orange-glow);
  border-color: var(--orange);
}
.timeline-content {
  flex: 1;
}
.timeline-title {
  font-weight: 700;
  font-size: .85rem;
}
.timeline-sub {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Order status pills (Distribuidor) */
.order-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
}
.order-status.preparando { background: #FFF3E0; color: #E65100; }
.order-status.despachado { background: #E3F2FD; color: #1565C0; }
.order-status.en_ruta { background: #F3E5F5; color: #6A1B9A; }
.order-status.entregado { background: #E8F5E9; color: #2E7D32; }
/* Antes faltaban estos 2: "Nuevo" (estado inicial de todo pedido) y
   "Cancelado" caían al estilo base sin color, sin distinguirse visualmente
   de los demás estados. */
.order-status.nuevo { background: #ECEFF1; color: #455A64; }
.order-status.cancelado { background: #FFEBEE; color: #C62828; }

/* Quick action grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  cursor: pointer;
  border: none;
  transition: transform .15s;
  font-family: var(--font-body);
}
.quick-action-btn:active { transform: scale(.96); }
.quick-action-btn .qa-icon { font-size: 1.5rem; }
.quick-action-btn .qa-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--muted);
  text-align: center;
}

/* Cotización card (Cliente) */
.cot-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0 14px 10px;
  box-shadow: var(--shadow);
}
.cot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.cot-card-title {
  font-weight: 700;
  font-size: .88rem;
}
.cot-card-sub {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
}
.cot-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Pedido card (Distribuidor) */
.pedido-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0 14px 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--orange);
}
.pedido-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.pedido-card-title {
  font-weight: 700;
  font-size: .88rem;
}
.pedido-card-sub {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Section headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
}
.section-title {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.section-link {
  font-size: .7rem;
  font-weight: 600;
  color: var(--orange);
  cursor: pointer;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: .5;
}
.empty-title {
  font-weight: 800;
  font-size: .9rem;
  margin-bottom: 4px;
}
.empty-sub {
  font-size: .78rem;
  color: var(--muted);
}

/* Entity cards (shared) */
.entity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 0 14px 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.entity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bone);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .82rem;
  color: var(--muted);
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.entity-info { flex: 1; min-width: 0; }
.entity-name { font-weight: 700; font-size: .85rem; }
.entity-sub { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.entity-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; font-size: .68rem; }

/* Field rows (shared) */
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.field-row:last-child { border-bottom: none; }
.field-row label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}
.field-val {
  font-size: .82rem;
  font-weight: 600;
}

/* Tags */
.tag { padding: 3px 9px; border-radius: 20px; font-size: .62rem; font-weight: 700; display: inline-block; }
.tag-green { background: rgba(76,175,80,.15); color: #4CAF50; }
.tag-red { background: rgba(229,57,53,.15); color: #E53935; }
.tag-blue { background: rgba(21,101,192,.15); color: #1565C0; }
.tag-orange { background: rgba(245,130,10,.15); color: #F5820A; }
.tag-purple { background: rgba(106,27,154,.15); color: #6A1B9A; }
.tag-amber { background: rgba(230,81,0,.15); color: #E65100; }
.tag-teal { background: rgba(0,105,92,.15); color: #00695C; }
.tag-wood { background: rgba(139,94,60,.15); color: #8B5E3C; }
.tag-muted { background: var(--border); color: var(--muted); }

/* Horizontal tabs */
.htabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.htab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.htab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* Progress bars */
.prog-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.prog-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 50px;
  transition: width .5s;
}
.prog-bar.green { background: var(--green); }

/* OF card (shared from existing) */
.of-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0 14px 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.of-code { font-size: .65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.of-title { font-weight: 700; font-size: .9rem; margin: 4px 0; }
.of-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.of-progress { margin-top: 10px; }
.of-prog-labels { display: flex; justify-content: space-between; font-size: .65rem; color: var(--muted); margin-bottom: 4px; }

/* Agenda items (shared) */
.agenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 0 14px 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.agenda-time-block { text-align: center; flex-shrink: 0; }
.agenda-time { font-family: var(--font-display); font-size: 1rem; letter-spacing: 1px; }
.agenda-ampm { font-size: .55rem; color: var(--muted); text-transform: uppercase; }
.agenda-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.agenda-dot.green { background: var(--green); }
.agenda-dot.blue { background: var(--blue); }
.agenda-dot.purple { background: var(--purple); }
.agenda-content { flex: 1; min-width: 0; }
.agenda-title { font-weight: 700; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-sub { font-size: .68rem; color: var(--muted); margin-top: 2px; }

/* KPI grid (shared) */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}
.kpi-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 1px; margin: 4px 0 2px; }
.kpi-sub { font-size: .65rem; color: var(--muted); }
.kpi-trend { font-size: .68rem; font-weight: 700; margin-top: 2px; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-green { border-left: 3px solid var(--green); }
.kpi-blue { border-left: 3px solid var(--blue); }
.kpi-purple { border-left: 3px solid var(--purple); }
.kpi-amber { border-left: 3px solid var(--amber); }
.kpi-teal { border-left: 3px solid var(--teal); }

/* Mini chart */
.mini-chart-wrap {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px;
  margin: 0 14px 12px;
  box-shadow: var(--shadow);
}
.mini-chart-title { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 70px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--orange); min-height: 4px; }
.bar.dim { opacity: .4; }
.bar-lbl { font-size: .55rem; color: var(--muted); font-weight: 600; }

/* Section head */
.sec-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; }
.sec-title { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.sec-link { font-size: .7rem; font-weight: 600; color: var(--orange); cursor: pointer; }

/* Stat row */
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 14px; }
.stat-col { background: var(--card); border-radius: var(--r); padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat-col-num { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 1px; }
.stat-col-label { font-size: .6rem; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-top: 2px; }

/* Report card */
.report-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 0 14px 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.report-icon { font-size: 1.4rem; flex-shrink: 0; }
.report-info { flex: 1; min-width: 0; }
.report-name { font-weight: 700; font-size: .82rem; }
.report-desc { font-size: .68rem; color: var(--muted); margin-top: 2px; }

/* Menu-mas buttons (shared) */
.menu-mas-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; background: var(--bone); border-radius: 12px;
  font-size: 1.3rem; color: var(--text); cursor: pointer; border: none;
  transition: background .15s; font-family: var(--font-body);
  text-decoration: none; /* el botón "Guía de uso" es un <a>, no un <button> */
}
.menu-mas-btn:active { background: var(--border); }
.menu-mas-btn span { font-size: .55rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }

/* Modal (shared) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 400; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-sheet { background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0; width: 100%; max-width: 480px; padding: 16px 18px 32px; animation: slideUp .22s ease; }
.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 50px; margin: 0 auto 14px; }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 1.5px; margin-bottom: 14px; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Toast */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--dark); color: #fff; padding: 10px 20px; border-radius: 50px; font-size: .82rem; font-weight: 600; opacity: 0; transition: all .25s; z-index: 500; white-space: nowrap; max-width: 90%; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Chips */
.chips { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; flex-shrink: 0; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 6px 14px; border-radius: 50px; background: var(--border); font-size: .72rem; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; letter-spacing: .3px; transition: all .2s; }
.chip.active { background: var(--orange); color: #fff; }

/* Search */
.search-wrap { display: flex; align-items: center; gap: 10px; background: var(--card); padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-icon { font-size: 1rem; }
.search-input { flex: 1; border: none; background: none; font-size: .88rem; outline: none; color: var(--text); }

/* Bottom nav */
.bottom-nav .nav-item { font-size: .45rem; padding: 7px 2px 5px; }

/* Nav item font size for 6 items */
.bottom-nav .nav-item { font-size: .45rem; padding: 7px 2px 5px; }

/* Project cards */
.proj-card { background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.proj-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.proj-name { font-weight: 700; font-size: .9rem; }
.proj-sub { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.proj-meta { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); margin-top: 6px; }
.proj-progress { margin-top: 8px; }
.proj-bar { height: 6px; background: var(--orange); border-radius: 50px; transition: width .5s; }

/* Material cards */
.mat-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.mat-swatch { width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.mat-info { flex: 1; min-width: 0; }
.mat-name { font-size: .82rem; font-weight: 700; line-height: 1.3; margin-bottom: 2px; }
.mat-brand { font-size: .68rem; color: var(--muted); margin-bottom: 4px; }
.mat-desc { font-size: .7rem; color: var(--muted); line-height: 1.4; margin-bottom: 6px; }
.mat-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.mat-price { font-family: var(--font-display); font-size: .95rem; color: var(--orange); }

/* Badges */
.badge { padding: 3px 9px; border-radius: 20px; font-size: .62rem; font-weight: 700; display: inline-block; }
.badge-green { background: rgba(76,175,80,.15); color: #4CAF50; }
.badge-red { background: rgba(229,57,53,.15); color: #E53935; }

/* Result boxes (calculadora) */
.result-box { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-top: 4px; }
.result-title { font-family: var(--font-display); font-size: .8rem; letter-spacing: 1.5px; margin-bottom: 12px; color: var(--muted); }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.result-row:last-of-type { border-bottom: none; }
.result-label { font-size: .74rem; color: var(--muted); }
.result-value { font-size: .8rem; font-weight: 600; }
.result-total { font-family: var(--font-display); font-size: 1rem; color: var(--orange); }

/* Inventory items */
.inv-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--r);
  padding: 12px 14px; margin: 0 14px 8px;
  box-shadow: var(--shadow); cursor: pointer;
}
.inv-icon { font-size: 1.4rem; flex-shrink: 0; }
.inv-info { flex: 1; min-width: 0; }
.inv-name { font-weight: 700; font-size: .82rem; }
.inv-sku { font-size: .65rem; color: var(--muted); }
.inv-stock-wrap { text-align: center; flex-shrink: 0; }
.inv-stock { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 1px; }
.inv-stock.inv-ok { color: var(--green); }
.inv-stock.inv-alert { color: var(--red); }
.inv-unit { font-size: .6rem; color: var(--muted); }

/* Marketplace grid */
.mkt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.mkt-card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.mkt-card-img { height: 70px; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--bone); }
.mkt-card-body { padding: 10px; }
.mkt-name { font-weight: 700; font-size: .78rem; line-height: 1.3; margin-bottom: 4px; }
.mkt-price { font-family: var(--font-display); font-size: 1rem; color: var(--orange); margin: 4px 0; }
.mkt-meta { font-size: .62rem; color: var(--muted); }

/* Biblioteca cards */
.bib-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border-radius: var(--r);
  padding: 12px 14px; margin: 0 14px 8px;
  box-shadow: var(--shadow); cursor: pointer;
}
.bib-icon { font-size: 1.4rem; flex-shrink: 0; }
.bib-title { font-weight: 700; font-size: .82rem; }
.bib-desc { font-size: .68rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* Checklist items */
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; cursor: pointer;
}
.check-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
  transition: all .2s;
}
.check-item.done .check-box { background: var(--green); border-color: var(--green); color: #fff; }
.check-text { font-size: .82rem; }
.check-item.done .check-text { text-decoration: line-through; color: var(--muted); }

/* Pieza rows */
.pieza-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.pieza-num { width: 24px; font-size: .68rem; font-weight: 800; color: var(--orange); text-align: center; }
.pieza-info { flex: 1; }
.pieza-name { font-size: .78rem; font-weight: 600; }
.pieza-dims { font-size: .65rem; color: var(--muted); }
.pieza-qty { font-size: .78rem; font-weight: 700; text-align: right; }

/* Gantt chart */
.gantt-wrap { display: flex; flex-direction: column; gap: 6px; }
.gantt-row { display: flex; align-items: center; gap: 8px; }
.gantt-label { width: 80px; font-size: .65rem; font-weight: 600; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-track { flex: 1; height: 8px; background: var(--border); border-radius: 50px; position: relative; overflow: hidden; }
.gantt-bar { height: 100%; border-radius: 50px; position: absolute; left: 0; top: 0; }
.gantt-dates { width: 30px; font-size: .6rem; color: var(--muted); text-align: right; flex-shrink: 0; }
