/* =====================================================================
   JAF INVESTMENTS - Estilos del Panel CRM (admin.css)
   ---------------------------------------------------------------------
   Identidad del CRM: marino oscuro + acento turquesa, Plus Jakarta Sans.
   Soporta tema claro (por defecto) y oscuro mediante [data-tema="oscuro"]
   en el elemento <html>. Tokens segun disenoweb.md (Parte A).

   Base de la Fase 1 (login, layout, roles). Fases posteriores amplian
   con componentes especificos (dashboard, kanban, POS, etc.).
   ===================================================================== */

/* ------------------------------------------------------------------ */
/*  Tokens de color - TEMA CLARO (por defecto)                         */
/* ------------------------------------------------------------------ */
:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --text: #1F2937;
  --text2: #6B7280;
  --border: #EAECEF;
  --hover: #F4F6FA;
  --sidebar: #16213E;
  --sb-text: #AEB8CC;
  --sb-hover: #22315A;
  --sb-label: #5B6B8C;
  --topbar: #FFFFFF;
  --shadow: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);

  /* Acentos (ambos temas) */
  --primario: #0DCAA8;
  --primario2: #00B894;
  --grad-primario: linear-gradient(135deg, #0DCAA8, #00B894);
  --azul: #3B82F6;
  --purpura: #8B5CF6;
  --ambar: #F59E0B;
  --verde: #10B981;
  --rojo: #EF4444;
  --cian: #06B6D4;
  --gris: #94A3B8;

  --radio: 16px;
  --radio-sm: 11px;
  --sidebar-w: 264px;
  --topbar-h: 66px;
}

/* ------------------------------------------------------------------ */
/*  Tokens de color - TEMA OSCURO                                      */
/* ------------------------------------------------------------------ */
html[data-tema="oscuro"] {
  --bg: #0B1220;
  --surface: #16213E;
  --text: #F1F5F9;
  --text2: #94A3B8;
  --border: #243049;
  --hover: #1E2A45;
  --sidebar: #0E1830;
  --sb-text: #AEB8CC;
  --sb-hover: #22315A;
  --sb-label: #5B6B8C;
  --topbar: #16213E;
  --shadow: 0 1px 3px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.45);
}

/* ------------------------------------------------------------------ */
/*  Reset / base                                                       */
/* ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(120,130,150,.4); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

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

/* -------- Sidebar -------- */
.jaf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
}
.jaf-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
}
.jaf-brand-logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--grad-primario);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(13,202,168,.4);
  color: #fff; font-size: 21px;
}
.jaf-brand-text { line-height: 1.1; }
.jaf-brand-text .n1 { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.jaf-brand-text .n2 { color: var(--primario); font-weight: 700; font-size: 11px; letter-spacing: 1.5px; }

.jaf-nav { flex: 1; overflow-y: auto; padding: 4px 12px 24px; }
.jaf-nav-label {
  padding: 16px 12px 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--sb-label); text-transform: uppercase;
}
.jaf-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 3px;
  border-radius: 10px; text-decoration: none;
  font-size: 14px; font-weight: 600; color: var(--sb-text);
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.jaf-nav-item i { width: 20px; text-align: center; font-size: 16px; }
.jaf-nav-item:hover { background: var(--sb-hover); color: #fff; }
.jaf-nav-item.activo {
  background: rgba(13,202,168,.16);
  color: #fff; font-weight: 700;
  border-left-color: var(--primario);
}
.jaf-nav-item.activo i { color: var(--primario); }
.jaf-nav-badge {
  margin-left: auto; background: var(--rojo); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 9px;
}

/* -------- Columna principal -------- */
.jaf-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* -------- Topbar -------- */
.jaf-topbar {
  height: var(--topbar-h); flex-shrink: 0;
  position: sticky; top: 0; z-index: 30;
  background: var(--topbar); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.jaf-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--radio-sm); padding: 9px 14px; width: 340px; max-width: 34vw;
}
.jaf-search input {
  border: none; background: transparent; outline: none; width: 100%;
  font-family: inherit; font-size: 13.5px; color: var(--text);
}
.jaf-iconbtn {
  position: relative; width: 40px; height: 40px; border: none;
  border-radius: 10px; background: var(--hover); color: var(--text);
  cursor: pointer; font-size: 17px; display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.jaf-iconbtn:hover { background: var(--border); }
.jaf-iconbtn .dot-badge {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 9px; background: var(--rojo); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.jaf-burger { display: none; }
.jaf-sep { width: 1px; height: 30px; background: var(--border); }

.jaf-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.jaf-avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #8B5CF6, #6366F1);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0; overflow: hidden;
}
.jaf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.jaf-user-meta { line-height: 1.2; }
.jaf-user-meta .nm { font-weight: 700; font-size: 13.5px; color: var(--text); }
.jaf-user-meta .rl { font-size: 11.5px; color: var(--text2); }

/* -------- Contenido -------- */
.jaf-content {
  flex: 1; overflow-y: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 20px;
}
.jaf-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.jaf-page-head h1 {
  margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.5px; color: var(--text);
}
.jaf-page-head p { margin: 4px 0 0; color: var(--text2); font-size: 14px; }

/* ------------------------------------------------------------------ */
/*  Componentes: tarjetas                                              */
/* ------------------------------------------------------------------ */
.jaf-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radio); box-shadow: var(--shadow); padding: 20px;
}
.jaf-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.jaf-card-head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text); }
.jaf-card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text2); }

/* ------------------------------------------------------------------ */
/*  Componentes: botones                                               */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radio-sm);
  padding: 10px 16px; font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primario {
  background: var(--grad-primario); color: #fff;
  box-shadow: 0 8px 16px rgba(13,202,168,.32);
}
.btn-primario:hover { filter: brightness(1.05); }
.btn-secundario { background: var(--hover); color: var(--text); border-color: var(--border); }
.btn-secundario:hover { background: var(--border); }
.btn-peligro { background: var(--rojo); color: #fff; }
.btn-peligro:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ */
/*  Componentes: formularios                                           */
/* ------------------------------------------------------------------ */
.form-grupo { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 7px;
}
.form-control {
  width: 100%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: var(--radio-sm); padding: 11px 14px;
  font-family: inherit; font-size: 14px; outline: none; transition: border .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(13,202,168,.15);
}
.form-control::placeholder { color: var(--text2); }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text2); margin-top: 6px; }
.form-input-icono { position: relative; }
.form-input-icono i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text2); font-size: 16px;
}
.form-input-icono .form-control { padding-left: 42px; }

/* ------------------------------------------------------------------ */
/*  Componentes: tablas                                                */
/* ------------------------------------------------------------------ */
.jaf-tabla-wrap { overflow-x: auto; border-radius: var(--radio); }
.jaf-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.jaf-tabla thead th {
  text-align: left; padding: 12px 14px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; color: var(--text2);
  background: var(--hover); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.jaf-tabla tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle;
}
.jaf-tabla tbody tr:hover { background: var(--hover); }
.jaf-tabla tbody tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ */
/*  Componentes: badges de estado                                      */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
}
.badge-verde  { background: rgba(16,185,129,.14);  color: #059669; }
.badge-azul   { background: rgba(59,130,246,.14);   color: #2563EB; }
.badge-morado { background: rgba(139,92,246,.14);   color: #7C3AED; }
.badge-ambar  { background: rgba(245,158,11,.16);   color: #B45309; }
.badge-cian   { background: rgba(6,182,212,.14);    color: #0891B2; }
.badge-rojo   { background: rgba(239,68,68,.14);    color: #DC2626; }
.badge-gris   { background: rgba(148,163,184,.18);  color: #64748B; }

/* ------------------------------------------------------------------ */
/*  Avisos contextuales                                                */
/* ------------------------------------------------------------------ */
.jaf-alert {
  display: flex; align-items: center; gap: 14px;
  border-radius: 14px; padding: 13px 18px; font-size: 13.5px; font-weight: 600;
}
.jaf-alert i.lead-ico { font-size: 18px; flex-shrink: 0; }
.jaf-alert-info { background: linear-gradient(90deg, rgba(13,202,168,.14), rgba(13,202,168,.04)); border: 1px solid rgba(13,202,168,.3); color: var(--text); }
.jaf-alert-ambar { background: rgba(245,158,11,.10); border: 1px solid rgba(245,158,11,.35); color: var(--text); }
.jaf-alert-rojo { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); color: var(--text); }

/* ------------------------------------------------------------------ */
/*  Mensajes flash / toasts                                            */
/* ------------------------------------------------------------------ */
.jaf-flash-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.jaf-flash {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--gris);
  border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 600; color: var(--text);
  animation: jafFlashIn .25s ease;
}
.jaf-flash.success { border-left-color: var(--verde); }
.jaf-flash.error   { border-left-color: var(--rojo); }
.jaf-flash.warning { border-left-color: var(--ambar); }
.jaf-flash.info    { border-left-color: var(--azul); }
.jaf-flash i { font-size: 18px; }
.jaf-flash.success i { color: var(--verde); }
.jaf-flash.error i   { color: var(--rojo); }
.jaf-flash.warning i { color: var(--ambar); }
.jaf-flash.info i    { color: var(--azul); }
@keyframes jafFlashIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ */
/*  Footer                                                             */
/* ------------------------------------------------------------------ */
.jaf-footer {
  padding: 14px 22px; color: var(--text2); font-size: 12px;
  border-top: 1px solid var(--border); display: flex;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ------------------------------------------------------------------ */
/*  Pestañas (tabs por estado)                                         */
/* ------------------------------------------------------------------ */
.jaf-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.jaf-tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text2);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.jaf-tab:hover { color: var(--text); }
.jaf-tab.activo { color: var(--primario2); border-bottom-color: var(--primario2); font-weight: 700; }
.jaf-tab .cnt {
  background: var(--hover); color: var(--text2); border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px;
}
.jaf-tab.activo .cnt { background: rgba(13,202,168,.16); color: var(--primario2); }

/* -------- Tarjeta de propiedad (grid) -------- */
.prop-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.prop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.prop-card .ph { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--hover); }
.prop-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.prop-card .ph .op {
  position: absolute; top: 10px; left: 10px; background: var(--primario2); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px;
}
.prop-card .ph .st { position: absolute; top: 10px; right: 10px; }
.prop-card .bd { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prop-card .ti { font-weight: 700; font-size: 14.5px; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prop-card .lo { font-size: 12.5px; color: var(--text2); }
.prop-card .sp { display: flex; gap: 14px; font-size: 12.5px; color: var(--text2); padding: 6px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.prop-card .pr { font-size: 18px; font-weight: 800; color: var(--primario2); }
.prop-card .ac { display: flex; gap: 8px; margin-top: auto; }

/* Miniatura en tabla */
.prop-thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--hover); }

/* Switch de publicacion */
.jaf-switch { position: relative; display: inline-block; width: 38px; height: 21px; }
.jaf-switch input { opacity: 0; width: 0; height: 0; }
.jaf-switch .sl { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: .2s; }
.jaf-switch .sl:before { content: ""; position: absolute; height: 15px; width: 15px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.jaf-switch input:checked + .sl { background: var(--primario2); }
.jaf-switch input:checked + .sl:before { transform: translateX(17px); }

/* ------------------------------------------------------------------ */
/*  Formulario por secciones (acordeon de propiedad)                   */
/* ------------------------------------------------------------------ */
.jaf-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio); margin-bottom: 14px; overflow: hidden; }
.jaf-section > summary {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer;
  font-weight: 700; font-size: 15px; color: var(--text); list-style: none; user-select: none;
}
.jaf-section > summary::-webkit-details-marker { display: none; }
.jaf-section > summary .num {
  width: 28px; height: 28px; border-radius: 9px; background: var(--grad-primario); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.jaf-section > summary .chev { margin-left: auto; transition: transform .2s; color: var(--text2); }
.jaf-section[open] > summary .chev { transform: rotate(180deg); }
.jaf-section .body { padding: 4px 18px 20px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ */
/*  Kanban (embudo de Leads)                                           */
/* ------------------------------------------------------------------ */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { flex: 0 0 270px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.kanban-col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-col-head .ti { font-weight: 700; font-size: 13px; }
.kanban-col-head .cnt { margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 8px; color: var(--text2); }
.kanban-body { padding: 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-body.dragover { background: rgba(13,202,168,.08); border-radius: 10px; }
.lead-card { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow); }
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: .5; }
.lead-card .nm { font-weight: 700; font-size: 13.5px; }
.lead-card .meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.lead-card .foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.lead-score { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(13,202,168,.14); color: var(--primario2); }

/* ------------------------------------------------------------------ */
/*  Bandeja de mensajes (3 columnas)                                   */
/* ------------------------------------------------------------------ */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } }
.inbox-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; max-height: calc(100vh - 200px); overflow-y: auto; }
.inbox-item { display: flex; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; cursor: pointer; }
.inbox-item:hover { background: var(--hover); }
.inbox-item.activo { background: rgba(13,202,168,.08); border-left: 3px solid var(--primario2); }
.inbox-item.no-leida .nm { font-weight: 800; }
.inbox-item .nm { font-weight: 600; font-size: 13.5px; }
.inbox-item .pre { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primario2); flex-shrink: 0; margin-top: 6px; }

/* ------------------------------------------------------------------ */
/*  Barra de presupuesto (Proyectos / POS)                             */
/* ------------------------------------------------------------------ */
.barra-presupuesto { height: 14px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.barra-presupuesto > span { display: block; height: 100%; transition: width .4s ease, background .3s ease; width: 0; }
.nivel-ok    { background: linear-gradient(90deg, #0DCAA8, #00B894); }
.nivel-medio { background: #F59E0B; }
.nivel-alto  { background: #EF4444; }

/* -------- POS (punto de gastos) -------- */
.pos-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 992px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-cat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border); margin-bottom: 8px; background: var(--surface);
}
.pos-cat-item .nm { flex: 1; min-width: 0; }
.pos-cat-item .nm .t { font-weight: 700; font-size: 13.5px; }
.pos-cat-item .nm .s { font-size: 12px; color: var(--text2); }
.pos-cat-item input.qty { width: 64px; text-align: center; }
.pos-ticket-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.pos-ticket-item .nm { flex: 1; min-width: 0; }
.pos-ticket-item .nm .t { font-weight: 600; font-size: 13.5px; }
.pos-ticket-item .nm .s { font-size: 12px; color: var(--text2); }
.pos-ticket-item .sub { font-weight: 700; color: var(--primario2); white-space: nowrap; }
.pos-sticky { position: sticky; top: calc(var(--topbar-h) + 16px); }

/* Cabecera de proyecto en grid */
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.proj-card .ph { display: block; height: 180px; position: relative; background: var(--hover); overflow: hidden; }
.proj-card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-card .bd { padding: 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

/* ------------------------------------------------------------------ */
/*  Selector de idioma (EN | ES)                                       */
/* ------------------------------------------------------------------ */
.jaf-lang { display: inline-flex; align-items: center; gap: 2px;
  background: var(--hover); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.jaf-lang-opt {
  font-size: 12px; font-weight: 700; letter-spacing: .3px; color: var(--text2);
  text-decoration: none; padding: 5px 9px; border-radius: 7px; line-height: 1; transition: .15s;
}
.jaf-lang-opt:hover { color: var(--text); }
.jaf-lang-opt.activo { background: var(--grad-primario); color: #fff; }
.jaf-lang.simple { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.jaf-lang.simple .jaf-lang-opt { color: rgba(255,255,255,.85); }
.jaf-lang.simple .jaf-lang-opt.activo { background: #fff; color: var(--primario2); }

/* ------------------------------------------------------------------ */
/*  Backdrop movil                                                     */
/* ------------------------------------------------------------------ */
.jaf-backdrop { display: none; }

/* ================================================================== */
/*  DASHBOARD (Fase 2)                                                 */
/* ================================================================== */

/* Rejillas reutilizables */
.jaf-grid { display: grid; gap: 16px; }
.jaf-grid-4 { grid-template-columns: repeat(4, 1fr); }
.jaf-grid-3 { grid-template-columns: repeat(3, 1fr); }
.jaf-grid-2 { grid-template-columns: repeat(2, 1fr); }
.jaf-flex { display: flex; gap: 16px; align-items: flex-start; }
.jaf-col { flex: 1; min-width: 0; }

/* -------- Tarjeta KPI del dia (formato "x de y") -------- */
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radio); box-shadow: var(--shadow); padding: 18px;
  display: flex; flex-direction: column; gap: 12px; text-decoration: none;
  transition: transform .15s, box-shadow .15s; color: inherit;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; color: #fff;
}
.kpi-ico.grad { background: var(--grad-primario); box-shadow: 0 8px 18px rgba(13,202,168,.32); }
.kpi-ico.azul { background: linear-gradient(135deg, #60A5FA, #3B82F6); }
.kpi-ico.purpura { background: linear-gradient(135deg, #A78BFA, #8B5CF6); }
.kpi-ico.ambar { background: linear-gradient(135deg, #FBBF24, #F59E0B); }
.kpi-trend { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.kpi-trend.up { background: rgba(16,185,129,.14); color: #059669; }
.kpi-trend.down { background: rgba(239,68,68,.14); color: #DC2626; }
.kpi-val { font-size: 27px; font-weight: 800; line-height: 1; color: var(--text); }
.kpi-val small { font-size: 16px; font-weight: 700; color: var(--text2); }
.kpi-label { font-size: 13px; color: var(--text2); margin-top: 2px; }
.kpi-bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.kpi-bar > span { display: block; height: 100%; background: var(--grad-primario); border-radius: 999px; transition: width .5s ease; }

/* -------- KPI grandes (negocio, mes vs mes) -------- */
.kpi-row6 { display: grid; gap: 16px; grid-template-columns: repeat(6, 1fr); }
.kpi.kpi-lg { padding: 20px; }
.kpi.kpi-lg .kpi-ico { width: 52px; height: 52px; border-radius: 15px; font-size: 24px; }
.kpi.kpi-lg .kpi-val { font-size: 25px; }
.kpi-trend i { font-size: 11px; }
.kpi-sub { font-size: 11.5px; color: var(--text2); margin-top: 5px; }
@media (max-width: 1180px) { .kpi-row6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .kpi-row6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px)  { .kpi-row6 { grid-template-columns: 1fr; } }

/* -------- Mini-KPIs -------- */
.mini {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.mini-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.mini .v { font-size: 19px; font-weight: 800; line-height: 1; color: var(--text); }
.mini .l { font-size: 12px; color: var(--text2); margin-top: 3px; }

/* -------- Listas (tareas, captaciones, consultas) -------- */
.jaf-lista { display: flex; flex-direction: column; }
.jaf-lista-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.jaf-lista-item:last-child { border-bottom: none; }
.jaf-lista-item:hover { background: var(--hover); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.jaf-lista-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.jaf-lista-main { flex: 1; min-width: 0; }
.jaf-lista-main .t { font-weight: 700; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jaf-lista-main .s { font-size: 12px; color: var(--text2); margin-top: 1px; }
.jaf-lista-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.jaf-empty { text-align: center; color: var(--text2); padding: 28px 10px; font-size: 13px; }
.jaf-empty i { display: block; font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* -------- Calendario mensual -------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text2); padding: 4px 0; text-transform: uppercase; letter-spacing: .5px; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); position: relative; cursor: default;
}
.cal-day.otro { color: var(--text2); opacity: .4; }
.cal-day:hover { background: var(--hover); }
.cal-day.hoy { background: var(--grad-primario); color: #fff; font-weight: 800; }
.cal-day .ev-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ambar); position: absolute; bottom: 6px; }
.cal-day.hoy .ev-dot { background: #fff; }

/* -------- Accesos rapidos (tarjetas con icono) -------- */
.quick {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none;
  color: inherit; transition: transform .15s, box-shadow .15s;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primario); }
.quick-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: #fff; }
.quick .qt { font-weight: 700; font-size: 14px; color: var(--text); }
.quick .qs { font-size: 12px; color: var(--text2); }

/* -------- Widget de uso del plan -------- */
.plan-bar { height: 8px; border-radius: 999px; background: var(--hover); overflow: hidden; margin: 10px 0 6px; }
.plan-bar > span { display: block; height: 100%; background: var(--grad-primario); border-radius: 999px; }

/* -------- Mejores inmuebles -------- */
.top-prop { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.top-prop:last-child { border-bottom: none; }
.top-prop .rank { width: 26px; height: 26px; border-radius: 8px; background: var(--hover); color: var(--text2); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.top-prop .rank.oro { background: rgba(245,158,11,.18); color: #B45309; }

/* ------------------------------------------------------------------ */
/*  Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .jaf-flex { flex-direction: column; }
  .jaf-col { width: 100%; }
  .jaf-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .jaf-sidebar {
    position: fixed; top: 0; left: 0;
    transform: translateX(-100%); transition: transform .26s ease;
  }
  .jaf-sidebar.open { transform: translateX(0); }
  .jaf-burger { display: inline-flex; }
  .jaf-search { display: none; }
  .jaf-hide-sm { display: none !important; }
  .jaf-backdrop.open {
    display: block; position: fixed; inset: 0;
    background: rgba(8,12,24,.45); z-index: 55;
  }
  .jaf-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .jaf-grid-4, .jaf-grid-3, .jaf-grid-2 { grid-template-columns: 1fr; }
}

/* ================================================================== */
/*  FASE 1 — Sistema de diseno de formularios y componentes premium    */
/* ================================================================== */

/* --- 1.1 Secciones de formulario: subtitulo + iconos ------------- */
.jaf-section > summary .sec-tt { display: flex; flex-direction: column; gap: 1px; }
.jaf-section > summary .sec-tt small { font-weight: 500; font-size: 12px; color: var(--text2); }
.jaf-section > summary .num i { font-size: 14px; }
.jaf-section > summary:hover { background: var(--hover); }

/* --- 1.2 Barra de acciones fija ARRIBA del formulario ----------- */
.form-actions-bar {
  position: sticky; top: 0; z-index: 21;
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radio); box-shadow: 0 6px 18px rgba(16,24,40,.08);
  padding: 12px 16px; margin-bottom: 16px;
}
.form-actions-bar .spacer { margin-right: auto; color: var(--text); font-size: 14px; font-weight: 700; }
/* Los formularios del CRM ocupan todo el ancho disponible */
.jaf-form { width: 100%; max-width: 100%; }

/* --- 1.3 Inputs y labels premium ------------------------------- */
.form-control { padding: 12px 14px; }
.form-control-lg { padding: 14px 16px; font-size: 15px; border-radius: var(--radio-sm); }
textarea.form-control { resize: vertical; min-height: 88px; }
.form-label-up {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text2); margin-bottom: 7px;
}
.form-label .req, .form-label-up .req { color: var(--rojo); margin-left: 2px; }

/* Input con prefijo/sufijo (add-ons) */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--radio-sm); border-bottom-left-radius: var(--radio-sm); }
.input-group > :last-child  { border-top-right-radius: var(--radio-sm); border-bottom-right-radius: var(--radio-sm); }
.input-affix {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--hover); border: 1px solid var(--border); color: var(--text2);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.input-group .form-control:focus { position: relative; z-index: 1; }

/* --- 1.4 Checkboxes / radios personalizados -------------------- */
.form-check, .form-radio {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--text); user-select: none;
}
.form-check input, .form-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-check .box, .form-radio .box {
  width: 19px; height: 19px; flex-shrink: 0; border: 2px solid var(--border);
  background: var(--surface); display: grid; place-items: center; transition: .15s;
}
.form-check .box { border-radius: 6px; }
.form-radio .box { border-radius: 50%; }
.form-check .box::after {
  content: "\F26E"; font-family: "bootstrap-icons"; font-size: 13px; color: #fff;
  transform: scale(0); transition: transform .15s;
}
.form-radio .box::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .15s;
}
.form-check input:checked + .box, .form-radio input:checked + .box { background: var(--grad-primario); border-color: var(--primario2); }
.form-check input:checked + .box::after, .form-radio input:checked + .box::after { transform: scale(1); }
.form-check input:focus-visible + .box, .form-radio input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(13,202,168,.25); }
/* Tarjeta de check seleccionable (caracteristicas) */
.check-card {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radio-sm); cursor: pointer; transition: .15s;
}
.check-card:hover { border-color: var(--primario); }
.check-card:has(input:checked) { border-color: var(--primario2); background: rgba(13,202,168,.07); }

/* --- 1.5 Estados de validacion --------------------------------- */
.form-control.is-error { border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.form-control.is-ok    { border-color: var(--verde); }
.form-error { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rojo); margin-top: 6px; }

/* --- 1.6 Slider de precio (input range) ------------------------ */
.jaf-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: var(--border); outline: none; }
.jaf-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--grad-primario); cursor: pointer; box-shadow: 0 2px 6px rgba(13,202,168,.5); border: 2px solid #fff; }
.jaf-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #0DCAA8; cursor: pointer; border: 2px solid #fff; }
.jaf-range-vals { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-top: 6px; }

/* --- 1.6 Paginador completo ------------------------------------ */
.jaf-paginador { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.jaf-paginador .pinfo { margin-right: auto; color: var(--text2); font-size: 12.5px; }
.jaf-paginador a, .jaf-paginador span.pg {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text); text-decoration: none;
  font-size: 13px; font-weight: 600; background: var(--surface); transition: .15s;
}
.jaf-paginador a:hover { border-color: var(--primario); color: var(--primario2); }
.jaf-paginador .pg.activa { background: var(--grad-primario); color: #fff; border-color: transparent; }
.jaf-paginador .pg.disabled { opacity: .4; pointer-events: none; }
.jaf-perpage { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text2); }
.jaf-perpage select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* --- 1.6 Barra de acciones masivas ----------------------------- */
.jaf-bulkbar {
  display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(13,202,168,.10); border: 1px solid rgba(13,202,168,.35);
  border-radius: var(--radio); padding: 10px 14px; margin-bottom: 12px;
}
.jaf-bulkbar.show { display: flex; }
.jaf-bulkbar .count { font-weight: 800; color: var(--primario2); }

/* --- 1.6 Menu de acciones (dropdown) --------------------------- */
.jaf-menu { position: relative; display: inline-block; }
.jaf-menu > .jaf-menu-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); cursor: pointer; display: grid; place-items: center;
}
.jaf-menu > .jaf-menu-btn:hover { background: var(--hover); color: var(--text); }
.jaf-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 184px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.jaf-menu.open .jaf-menu-list { display: block; }
.jaf-menu-list a, .jaf-menu-list button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none; color: var(--text); font: inherit;
  font-size: 13px; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.jaf-menu-list a:hover, .jaf-menu-list button:hover { background: var(--hover); }
.jaf-menu-list .danger { color: var(--rojo); }
.jaf-menu-list .sep { height: 1px; background: var(--border); margin: 5px 2px; }

/* Menu de usuario en el topbar: el toggle usa .jaf-user (no el icon-btn 32x32) */
.jaf-menu > .jaf-user.jaf-menu-btn {
  width: auto; height: auto; border: none; background: transparent; padding: 4px 6px;
  border-radius: 10px; place-items: initial;
  display: flex; align-items: center; gap: 10px; text-align: left; font-family: inherit;
}
.jaf-menu > .jaf-user.jaf-menu-btn:hover { background: var(--hover); }
.jaf-user-menu .jaf-user-meta { display: flex; flex-direction: column; align-items: flex-start; }
.jaf-user-menu .jaf-menu-list { min-width: 200px; }

/* --- 1.6 Chip de referencia monoespaciado ---------------------- */
.jaf-chip-ref {
  display: inline-block; font-family: Consolas, "SF Mono", monospace; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 7px; background: rgba(13,202,168,.12); color: var(--primario2);
}

/* --- 1.6 Panel de filtros lateral (listados) ------------------- */
.jaf-filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio); padding: 16px; position: sticky; top: 84px; }
.jaf-filters h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--text); }
.jaf-filters .fgroup { margin-bottom: 16px; }
.jaf-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.jaf-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--hover); border: 1px solid var(--border); font-size: 12px; color: var(--text); cursor: pointer;
}
.jaf-chip.activo { background: rgba(13,202,168,.12); border-color: var(--primario2); color: var(--primario2); font-weight: 700; }
.jaf-chip .x { cursor: pointer; opacity: .7; }

/* --- 1.7 Micro-interacciones y accesibilidad ------------------- */
.btn-primario:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 12px 22px rgba(13,202,168,.4); }
.btn { transition: .15s, transform .15s; }
.quick:hover, .kpi:hover { transform: translateY(-2px); }
:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; border-radius: 4px; }
.jaf-iconbtn:focus-visible, .btn:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; }

@media (max-width: 768px) {
  .jaf-filters { position: static; }
  .form-actions-bar { flex-wrap: wrap; }
}

/* =====================================================================
   FASE 4 - Subida real de archivos (dropzone, galeria, avatar)
   ===================================================================== */

/* --- Dropzone --- */
.jaf-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: var(--radio);
  background: var(--hover); padding: 26px 18px; margin-bottom: 12px;
  transition: border-color .15s, background .15s, transform .1s;
}
.jaf-dropzone:hover { border-color: var(--primario2); background: rgba(13,202,168,.06); }
.jaf-dropzone.over { border-color: var(--primario2); background: rgba(13,202,168,.12); transform: scale(1.005); }
.jaf-dropzone i { font-size: 30px; color: var(--primario2); }
.jaf-dropzone .dz-title { font-weight: 700; font-size: 14px; color: var(--text); }
.jaf-dropzone .dz-sub { font-size: 12px; color: var(--text2); }
.jaf-dropzone-sm { padding: 16px 14px; }
.jaf-dropzone-sm i { font-size: 22px; }

/* --- Galeria de miniaturas (fotos / planos) --- */
.jaf-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 12px;
}
.jaf-gallery:empty { display: none; }
.gal-item {
  position: relative; margin: 0; aspect-ratio: 4/3; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border); background: var(--hover);
  box-shadow: 0 2px 6px rgba(16,24,40,.05);
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-item.dragging { opacity: .5; outline: 2px dashed var(--primario2); }
.gal-item.is-main { outline: 3px solid var(--primario2); }
.gal-item[draggable="true"] { cursor: grab; }
.gal-item .gal-del, .gal-item .gal-star {
  position: absolute; top: 6px; width: 26px; height: 26px; border: 0; cursor: pointer;
  border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: rgba(8,12,24,.62); color: #fff; opacity: 0; transition: opacity .15s, background .15s;
}
.gal-item:hover .gal-del, .gal-item:hover .gal-star { opacity: 1; }
.gal-item .gal-del { right: 6px; }
.gal-item .gal-del:hover { background: var(--rojo); }
.gal-item .gal-star { left: 6px; }
.gal-item .gal-star:hover { background: #F59E0B; }
.gal-item.is-main .gal-star { opacity: 1; background: #F59E0B; }
.gal-item .gal-badge {
  position: absolute; bottom: 6px; left: 6px; display: none;
  background: var(--primario2); color: #042c25; font-size: 10px; font-weight: 800;
  letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 6px;
}
.gal-item.is-main .gal-badge { display: inline-block; }
.gal-item .gal-handle {
  position: absolute; bottom: 6px; right: 6px; color: #fff; opacity: 0;
  background: rgba(8,12,24,.5); border-radius: 6px; padding: 1px 3px; font-size: 13px;
}
.gal-item:hover .gal-handle { opacity: .9; }
.gal-item .gal-new-tag {
  position: absolute; top: 6px; left: 6px; background: #2563EB; color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .4px; padding: 2px 6px; border-radius: 6px;
}
.gal-item[data-new] { outline: 2px dashed #2563EB; }

/* --- Anadir por URL --- */
.jaf-url-add { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

/* --- Subida de logo / avatar --- */
.jaf-avatar-up { display: flex; gap: 16px; align-items: center; }
.jaf-avatar-up .av-preview {
  width: 92px; height: 92px; flex: 0 0 92px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: var(--hover);
  display: grid; place-items: center; color: var(--text2); font-size: 34px;
}
.jaf-avatar-up .av-preview.av-round { border-radius: 50%; }
.jaf-avatar-up .av-preview img { width: 100%; height: 100%; object-fit: cover; }
.jaf-avatar-up .av-controls { display: flex; flex-direction: column; gap: 2px; }

/* ================================================================
   FASE 14 · Accesibilidad y pulido (WCAG AA)
   ================================================================ */
/* Enlace "saltar al contenido" (skip link) — visible solo al enfocarlo */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 9999; background: var(--primario);
  color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px; font-weight: 700; font-size: 14px;
  text-decoration: none; transition: top .2s ease; }
.skip-link:focus { top: 0; }

/* Texto solo para lectores de pantalla */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Respetar la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ================================================================
   Overlay de modales reutilizable (RRHH y otros modulos)
   ================================================================ */
.jaf-modal-ov {
  display: none; position: fixed; inset: 0; z-index: 120;
  background: rgba(8,12,24,.55); align-items: center; justify-content: center; padding: 20px;
}
.jaf-modal-ov > .jaf-card { max-height: 92vh; overflow-y: auto; }

/* ================================================================
   Proyectos · badge de estado SOLIDO (siempre visible sobre la foto)
   ================================================================ */
.proj-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .2px; color: #fff;
  box-shadow: 0 4px 12px rgba(8,12,24,.35); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: saturate(1.2);
}
.proj-badge.progreso { background: #F59E0B; }
.proj-badge.abierto  { background: #3B82F6; }
.proj-badge.cerrado  { background: #64748B; }

/* ================================================================
   Proyecto · Rediseño POS (catalogo + carrito)
   ================================================================ */
.pos-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pos-toolbar .form-input-icono { flex: 1; min-width: 200px; margin: 0; }

/* Rail de "categorias" (tipos de item) */
.pos-rail { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pos-railbtn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text2);
  font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s;
}
.pos-railbtn:hover { border-color: var(--primario2); color: var(--text); }
.pos-railbtn.activo { background: linear-gradient(135deg, #0DCAA8, #00B894); border-color: #0DCAA8; color: #fff; box-shadow: 0 6px 14px rgba(13,202,168,.3); }
.pos-railbtn .cnt { background: var(--hover); color: var(--text2); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 8px; }
.pos-railbtn.activo .cnt { background: rgba(255,255,255,.25); color: #fff; }

/* Grid de tarjetas del catalogo */
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.pos-group-h { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--primario2); margin: 6px 2px 0; }
.pos-card { display: flex; flex-direction: column; gap: 9px; padding: 13px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.pos-card:hover { transform: translateY(-2px); border-color: #0DCAA8; box-shadow: 0 8px 18px rgba(13,202,168,.16); }
.pos-card .ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(13,202,168,.12); color: #0DCAA8; font-size: 19px; }
.pos-card .t { font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--text); }
.pos-card .meta { font-size: 11.5px; color: var(--text2); }
.pos-card .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; }
.pos-card .foot input.qty { width: 100%; text-align: center; padding: 8px; }
.pos-card .add { flex-shrink: 0; width: 36px; height: 36px; border: none; border-radius: 9px; background: #0DCAA8; color: #fff; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(13,202,168,.3); transition: .15s; }
.pos-card .add:hover { background: #00B894; }
.pos-card .add:disabled { background: var(--border); box-shadow: none; cursor: not-allowed; }

/* Carrito (derecha) */
.pos-cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pos-cart-head .ti { font-weight: 800; font-size: 16px; }
.pos-section-h { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text2); margin: 16px 0 8px; }

