/* ============================================================
   ARGOS MONALDI WORK STATION — COMPONENTES
   Tarjetas, botones, tablas, formularios, badges, pestañas.
   ============================================================ */

/* ── CARD (superficie protagonista) ── */
.card{
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.card-flush{ padding: 0; overflow: hidden; }
.card-header{
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.card-header h2, .card-header h3{ font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.card-header .meta{ font-size: 11px; color: var(--cream-faint); }

.card-accent-top{
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--brass-dark), var(--brass-light), var(--brass-dark)) 1;
}

/* ── BOTONES ── */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
  line-height: 1;
}
.btn:active{ transform: translateY(0); }
.btn-primary{
  background: linear-gradient(160deg, var(--brass-light), var(--brass-dark) 55%, var(--brass-deeper));
  color: var(--text-on-brass);
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  border-color: rgba(255,255,255,.08);
}
.btn-primary:hover{ transform: translateY(-1px); }
.btn-secondary{
  border-color: var(--brass);
  background: rgba(7,9,13,.35);
  color: var(--brass-light);
}
.btn-secondary:hover{ background: rgba(201,154,99,.1); }
.btn-ghost{
  background: transparent; color: var(--cream-dim); border-color: var(--panel-line);
}
.btn-ghost:hover{ color: var(--brass-light); border-color: var(--brass); }
.btn-danger{
  background: transparent; color: var(--danger); border-color: rgba(180,93,82,.5);
}
.btn-danger:hover{ background: var(--danger-bg); }
.btn-sm{ padding: 7px 13px; font-size: 10.5px; }
.btn-block{ width: 100%; }
.btn:disabled{ opacity: .45; cursor: default; transform: none; }
.btn-icon{ padding: 9px; }
.btn-icon img{ width: 14px; height: 14px; }

/* ── FORMULARIOS ── */
.field{ display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label{
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brass);
}
.field .hint{ font-size: 10.5px; color: var(--cream-faint); }
input[type=text], input[type=search], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=tel], select, textarea{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(196,148,88,.28);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color .15s ease, background-color .15s ease;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(196,148,88,.7);
  background: rgba(255,255,255,.06);
}
input::placeholder, textarea::placeholder{ color: #5a564f; }
textarea{ resize: vertical; min-height: 90px; }
select{ cursor: pointer; }
.form-row{ display: flex; gap: 14px; }
.form-row > .field{ flex: 1; }
.checkline{ display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--cream-dim); }
.checkline input{ width: 16px; height: 16px; cursor: pointer; }

/* ── TABLA ── */
.table-wrap{ overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--panel-line); }
table.data{ width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data thead tr{ background: rgba(196,148,88,.08); }
table.data th{
  padding: 12px 14px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brass); border-bottom: 1px solid var(--panel-line); white-space: nowrap;
}
table.data td{
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--cream-dim); vertical-align: middle;
}
table.data tbody tr{ transition: background-color .12s ease; }
table.data tbody tr:hover{ background: rgba(196,148,88,.05); }
table.data tbody tr:last-child td{ border-bottom: none; }
table.data td.num, table.data th.num{ text-align: right; font-variant-numeric: tabular-nums; }
table.data td strong{ color: var(--cream); }
.row-link{ cursor: pointer; }

/* ── BADGES / ESTADOS ── */
.badge{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-ok{ background: var(--ok-bg); color: var(--ok); }
.badge-warn{ background: var(--warn-bg); color: var(--warn); }
.badge-danger{ background: var(--danger-bg); color: var(--danger); }
.badge-info{ background: var(--info-bg); color: var(--info); }
.badge-neutral{ background: rgba(255,255,255,.06); color: var(--cream-faint); }
.badge-confirmed{ background: rgba(111,158,106,.16); color: #8fbf88; border: 1px solid rgba(111,158,106,.35); }

/* ── PESTAÑAS (para el pipeline de pedidos: referenciando/presupuesto/recepción/embalaje/paletizado/completo) ── */
.tabs{ display: flex; gap: 4px; border-bottom: 1px solid var(--panel-line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a, .tabs button{
  background: none; border: none; cursor: pointer;
  padding: 10px 16px; font-family: var(--font-body);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cream-faint); border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.tabs a.active, .tabs button.active{ color: var(--brass); border-color: var(--brass); }
.tabs .count{
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.08); font-size: 9.5px;
}

/* ── ALERTAS / AVISOS ── */
.notice{
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid; font-size: 12.5px; line-height: 1.55;
  margin-bottom: 20px;
}
.notice strong{ display: block; margin-bottom: 2px; }
.notice-warn{ background: var(--warn-bg); border-color: rgba(196,149,74,.35); color: #e0c393; }
.notice-danger{ background: var(--danger-bg); border-color: rgba(180,93,82,.4); color: #dba49c; }
.notice-info{ background: var(--info-bg); border-color: rgba(106,142,166,.35); color: #a8c3d6; }
.notice-ok{ background: var(--ok-bg); border-color: rgba(111,158,106,.35); color: #a9cca5; }

/* ── STAT TILE ── */
.stat{
  padding: 18px 20px; border-radius: var(--radius-md);
  background: rgba(255,255,255,.02); border: 1px solid var(--panel-line);
}
.stat .stat-label{ font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-faint); margin-bottom: 8px; }
.stat .stat-value{ font-family: var(--font-title); font-size: 28px; color: var(--brass); }
.stat .stat-sub{ font-size: 11px; color: var(--cream-faint); margin-top: 4px; }

/* ── LISTA VACÍA ── */
.empty-state{
  text-align: center; padding: 56px 24px; color: var(--cream-faint);
}
.empty-state .icon{ width: 40px; height: 40px; margin: 0 auto 14px; opacity: .55; }
.empty-state h3{ color: var(--cream-dim); font-size: 14px; margin-bottom: 6px; text-transform: none; }
.empty-state p{ font-size: 12px; max-width: 340px; margin: 0 auto; }

/* ── DIVIDER decorativo (usa activo real de latón) ── */
.brass-rule{ height: 1px; border: none; margin: 24px 0; background: rgba(196,148,88,.22); position: relative; }
.brass-rule img{
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 160px; opacity: .55;
}

/* ── MODAL ── */
.modal-overlay{
  position: fixed; inset: 0; background: rgba(5,6,8,.72);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 24px;
}
.modal-overlay.open{ display: flex; }
.modal{
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--panel-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 26px;
}
.modal-head{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3{ font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.modal-close{
  background: none; border: 1px solid var(--panel-line); color: var(--cream-faint);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1;
}
.modal-close:hover{ color: var(--brass); border-color: var(--brass); }
.modal-actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── TOAST ── */
#toast-stack{
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast{
  padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--panel-raised); border: 1px solid var(--panel-line);
  box-shadow: var(--shadow-soft); font-size: 12.5px; color: var(--cream);
  max-width: 320px;
}
.toast-ok{ border-color: rgba(111,158,106,.4); }
.toast-error{ border-color: rgba(180,93,82,.4); }

/* ── PAGINACIÓN ── */
.pagination{ display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination button{
  min-width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: none; border: 1px solid var(--panel-line); color: var(--cream-dim);
  cursor: pointer; font-size: 12px;
}
.pagination button:hover{ border-color: var(--brass); color: var(--brass-light); }
.pagination button.active{ background: var(--brass); color: var(--text-on-brass); border-color: var(--brass); font-weight: 700; }
.pagination button:disabled{ opacity: .35; cursor: default; }

/* ── SPINNER (estático, sin destellos — solo giro discreto) ── */
.spinner{
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(196,148,88,.25); border-top-color: var(--brass);
  animation: spin .8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.loading-row{ display: flex; align-items: center; gap: 10px; padding: 24px; color: var(--cream-faint); font-size: 12px; }

/* ── AVATAR SELLO (para confianza de despiece) ── */
.confidence-pill{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
}
.confidence-high{ background: var(--ok-bg); color: #8fbf88; border: 1px solid rgba(111,158,106,.4); }
.confidence-none{ background: var(--warn-bg); color: #dcb877; border: 1px solid rgba(196,149,74,.4); }

/* ── SEARCH BAR ── */
.search-bar{ position: relative; }
.search-bar input{ padding-left: 40px; }
.search-bar .icon{
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; opacity: .6;
}

/* ── KV LIST (fichas) ── */
.kv{ display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 12.5px; }
.kv dt{ color: var(--cream-faint); text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; padding-top: 2px; }
.kv dd{ color: var(--cream); }

/* Iconos glifo (latón sobre transparente) */
.glyph{ width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.55)); }
.glyph-sm{ width: 18px; height: 18px; }
