/* ═══════════════════════════════════════════
   FRITITRUCK — Componentes reutilizables
   (Cards, Tablas, Badges, Botones, Modales,
    Formularios, Toast, Carrito)
   ═══════════════════════════════════════════ */

/* ── Auth ─────────────────────────────── */
#auth-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.auth-card {
  background: #fff; border-radius: 16px;
  padding: 2.5rem 2rem; width: 100%; max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.auth-logo            { display: flex; align-items: center; gap: 10px; margin-bottom: 2rem; }
.auth-logo-icon       { width: 44px; height: 44px; background: var(--green); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.auth-logo h1         { font-size: 20px; font-weight: 700; color: var(--green); }
.auth-logo span       { font-size: 12px; color: var(--gray-400); display: block; font-weight: 400; }
.auth-card h2         { font-size: 16px; font-weight: 600; margin-bottom: 1.5rem; color: var(--gray-900); }
.auth-error           { background: var(--red-light); color: var(--red); font-size: 12px; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 1rem; display: none; }
.auth-link            { text-align: center; margin-top: 1.5rem; font-size: 13px; color: var(--gray-600); }
.auth-link a          { color: var(--green); font-weight: 600; text-decoration: none; cursor: pointer; }
.auth-link a:hover    { text-decoration: underline; }

/* ── Formularios ─────────────────────── */
.field            { margin-bottom: 1rem; }
.field label      { display: block; font-size: 12px; font-weight: 500; color: var(--gray-600); margin-bottom: 5px; }
.field input,
.field select     { width: 100%; padding: 10px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: border-color 0.15s; background: #fff; }
.field input:focus,
.field select:focus { border-color: var(--green); }

.field-sm               { margin-bottom: 12px; }
.field-sm label         { font-size: 12px; font-weight: 500; color: var(--gray-600); display: block; margin-bottom: 4px; }
.field-sm input,
.field-sm select,
.field-sm textarea      { width: 100%; padding: 9px 11px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 13px; outline: none; transition: border-color 0.15s; background: #fff; font-family: inherit; }
.field-sm input:focus,
.field-sm select:focus,
.field-sm textarea:focus { border-color: var(--green); }
.form-row               { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Botones ─────────────────────────── */
.btn-primary          { width: 100%; padding: 11px; background: var(--green); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-primary:hover    { background: var(--green-mid); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn              { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.12s; display: inline-flex; align-items: center; gap: 6px; }
.btn-green        { background: var(--green); color: #fff; }
.btn-green:hover  { background: var(--green-mid); }
.btn-green:disabled { background: #999; cursor: not-allowed; }
.btn-sm           { padding: 5px 10px; font-size: 12px; }
.btn-outline      { background: transparent; border: 1.5px solid var(--gray-200); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--gray-400); color: var(--gray-900); }
.btn-danger       { background: var(--red-light); color: var(--red); border: 1.5px solid #f5c6c0; }
.btn-danger:hover { background: #f8d7d3; }
.btn-logout       { width: 100%; padding: 8px; background: transparent; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 13px; color: var(--gray-600); cursor: pointer; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Stats / Cards ────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.stat-card  { background: #fff; border-radius: var(--radius); padding: 1rem 1.25rem; border: 1px solid var(--gray-100); }
.stat-label { font-size: 11px; color: var(--gray-400); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--gray-900); }
.stat-sub   { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.stat-card.green .stat-value  { color: var(--green); }
.stat-card.orange .stat-value { color: var(--orange); }

/* ── Tablas ──────────────────────────── */
.card        { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-100); overflow: hidden; margin-bottom: 1.5rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); }
.card-title  { font-size: 12px; font-weight: 700; color: var(--gray-900); text-transform: uppercase; letter-spacing: 0.5px; }
table        { width: 100%; border-collapse: collapse; }
th  { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 16px; text-align: left; background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
td  { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--gray-50); color: var(--gray-900); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td      { background: var(--gray-50); }
.empty-row td    { text-align: center; color: var(--gray-400); padding: 2rem; }

/* ── Badges ──────────────────────────── */
.badge        { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; }
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-red    { background: var(--red-light); color: var(--red); }
.badge-blue   { background: var(--blue-light); color: var(--blue); }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* ── Modal ───────────────────────────── */
.modal-overlay        { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 200; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open   { display: flex; }
.modal                { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.15); }
.modal-header         { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.modal-title          { font-size: 15px; font-weight: 700; }
.modal-close          { background: none; border: none; font-size: 20px; color: var(--gray-400); cursor: pointer; line-height: 1; padding: 2px 6px; }
.modal-close:hover    { color: var(--gray-900); }
.modal-body           { padding: 1.5rem; }
.modal-footer         { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Toast ───────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--gray-900); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; z-index: 999;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#toast.show { opacity: 1; }

/* ── Clientes / Puntos ────────────────── */
.puntos-bar   { display: flex; align-items: center; gap: 8px; }
.puntos-track { flex: 1; height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.puntos-fill  { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }
.stock-low    { color: var(--orange); font-weight: 600; }
.stock-ok     { color: var(--green); }

/* ── Modal premio ─────────────────────── */
.modal-premio-icon { font-size: 56px; }
