/* ============================================================
   NH GROUP — ERP · Sistema de diseño Claymorfismo
   Completamente distinto al sitio público (editorial/terracota).
   Aquí: volumen, sombras suaves duales, botones que se hunden.
   ============================================================ */

:root{
  /* Base "clay" — arcilla clara, cálida, distinta del sitio */
  --clay:#e9e6df; --clay-l:#f4f2ec; --clay-d:#dcd8cf;
  --clay-shadow-d:rgba(163,153,130,.55); --clay-shadow-l:rgba(255,255,255,.9);
  --surface:#f1efe8; --surface-2:#e4e1d8;
  --card:#edeae2;

  /* Acento de marca (mismo ADN que el sitio, distinto tratamiento) */
  --brand:#b45309; --brand-d:#8a3f07; --brand-l:#d97706;
  --accent:#3a6b63; --accent-l:#4f8a80; /* verde salvia — distingue ERP del sitio */
  --info:#2f6fa8; --warn:#c2760b; --danger:#b3261e; --ok:#2f7d4f;

  --ink:#241f19; --ink-2:#3a332a; --muted:#6f6657; --faint:#948a78;
  --line:rgba(120,108,80,.18);

  --r-sm:14px; --r-md:20px; --r-lg:28px; --r-pill:999px;
  --sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;

  --dur:.18s; --ease:cubic-bezier(.22,.61,.36,1);

  /* Sombras claymorphism: doble sombra (luz arriba-izq, oscuro abajo-der) */
  --clay-out-sm: 5px 5px 10px var(--clay-shadow-d), -5px -5px 10px var(--clay-shadow-l);
  --clay-out-md: 8px 8px 18px var(--clay-shadow-d), -8px -8px 18px var(--clay-shadow-l);
  --clay-out-lg: 14px 14px 32px var(--clay-shadow-d), -10px -10px 26px var(--clay-shadow-l);
  --clay-in-sm: inset 4px 4px 8px var(--clay-shadow-d), inset -4px -4px 8px var(--clay-shadow-l);
  --clay-in-md: inset 6px 6px 14px var(--clay-shadow-d), inset -6px -6px 14px var(--clay-shadow-l);

  --topbar-h:68px; --sidebar-w:250px; --sidebar-w-collapsed:88px; --bottomnav-h:64px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body.erp{
  margin:0; min-height:100vh; background:var(--surface);
  color:var(--ink); font-family:var(--sans); font-size:15.5px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.erp img,.erp svg{ display:block; max-width:100%; }
.erp a{ color:inherit; text-decoration:none; }
.erp button{ font-family:inherit; }
.erp ::selection{ background:var(--brand-l); color:#fff; }
.erp :focus-visible{ outline:2px solid var(--brand-l); outline-offset:2px; border-radius:6px; }

/* ---------- Scrollbars discretos ---------- */
.erp *{ scrollbar-width:thin; scrollbar-color:var(--clay-d) transparent; }
.erp *::-webkit-scrollbar{ width:8px; height:8px; }
.erp *::-webkit-scrollbar-thumb{ background:var(--clay-d); border-radius:99px; }

/* ============================================================
   LAYOUT — sidebar de escritorio + bottom-nav/drawer en móvil
   ============================================================ */
.erp-shell{ display:flex; min-height:100vh; }

.erp-sidebar{
  width:var(--sidebar-w); flex-shrink:0; background:var(--clay-l);
  border-right:1px solid var(--line); display:flex; flex-direction:column;
  padding:20px 14px; position:sticky; top:0; height:100vh; overflow-y:auto;
  z-index:40;
}
.erp-logo{
  display:flex; align-items:center; gap:12px; padding:6px 8px 22px;
}
.erp-logo-mark{
  width:52px; height:52px; border-radius:var(--r-md); background:var(--clay);
  box-shadow:var(--clay-out-md); display:flex; align-items:center; justify-content:center;
  flex-shrink:0; padding:9px;
}
.erp-logo-mark img{ width:100%; height:100%; object-fit:contain; }
.erp-logo-text{ font-weight:800; font-size:1.02rem; letter-spacing:-.01em; color:var(--ink); }
.erp-logo-text small{ display:block; font-weight:600; font-size:.68rem; color:var(--muted); letter-spacing:.06em; text-transform:uppercase; margin-top:1px; }

.erp-nav{ display:flex; flex-direction:column; gap:7px; flex:1; }
.erp-nav-item{
  display:flex; align-items:center; gap:13px; padding:12px 14px; border-radius:var(--r-md);
  color:var(--muted); font-weight:600; font-size:.88rem; cursor:pointer; position:relative;
  transition:background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.erp-nav-item svg{ width:19px; height:19px; flex-shrink:0; }
.erp-nav-item:hover{ background:var(--clay); box-shadow:var(--clay-out-sm); color:var(--ink); }
.erp-nav-item.active{ background:var(--clay); box-shadow:var(--clay-in-sm); color:var(--brand); }
.erp-nav-item .badge-dot{ margin-left:auto; width:8px; height:8px; border-radius:50%; background:var(--brand-l); }

.erp-sidebar-foot{ padding-top:14px; border-top:1px solid var(--line); margin-top:10px; }

/* Contenido principal */
.erp-main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.erp-topbar{
  height:var(--topbar-h); flex-shrink:0; display:flex; align-items:center; gap:16px;
  padding:0 26px; background:var(--surface); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:30;
}
.erp-topbar h1{ font-size:1.15rem; font-weight:800; margin:0; letter-spacing:-.01em; }
.erp-topbar-spacer{ flex:1; }
.erp-content{ flex:1; padding:26px; max-width:1400px; width:100%; margin:0 auto; }

/* Usuario / avatar */
.erp-user{ display:flex; align-items:center; gap:10px; padding:6px 10px 6px 6px; border-radius:var(--r-pill); background:var(--clay); box-shadow:var(--clay-out-sm); cursor:pointer; }
.erp-avatar{ width:34px; height:34px; border-radius:50%; background:var(--brand); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:.82rem; flex-shrink:0; }
.erp-user-meta{ line-height:1.25; }
.erp-user-meta .name{ font-size:.82rem; font-weight:700; }
.erp-user-meta .role{ font-size:.68rem; color:var(--muted); text-transform:capitalize; }

/* ---------- Mobile: bottom nav + drawer (NUNCA sidebar encogida) ---------- */
.erp-mobile-topbar{ display:none; }
.erp-bottomnav{ display:none; }
.erp-drawer-scrim{ display:none; }
.erp-drawer{ display:none; }

@media (max-width: 880px){
  .erp-sidebar{ display:none; }
  .erp-shell{ flex-direction:column; }
  .erp-mobile-topbar{
    display:flex; align-items:center; gap:12px; height:60px; padding:0 16px;
    background:var(--clay-l); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:45;
  }
  .erp-mobile-topbar .erp-logo{ padding:0; }
  .erp-mobile-topbar .erp-logo-mark{ width:38px; height:38px; padding:6px; }
  .erp-topbar{ display:none; }
  .erp-content{ padding:16px 14px 90px; }

  .erp-bottomnav{
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:50;
    background:var(--clay-l); border-top:1px solid var(--line);
    height:var(--bottomnav-h); padding:6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow:0 -8px 24px rgba(60,50,30,.10);
  }
  .erp-bottomnav-item{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:3px; border-radius:var(--r-sm); color:var(--muted); font-size:.62rem; font-weight:700;
  }
  .erp-bottomnav-item svg{ width:20px; height:20px; }
  .erp-bottomnav-item.active{ color:var(--brand); background:var(--clay); box-shadow:var(--clay-in-sm); margin:2px; }
  .erp-bottomnav-item.more{ color:var(--accent); }

  .erp-drawer-scrim{
    display:block; position:fixed; inset:0; background:rgba(30,25,15,.4); z-index:59;
    opacity:0; pointer-events:none; transition:opacity var(--dur) var(--ease);
  }
  .erp-drawer-scrim.open{ opacity:1; pointer-events:auto; }
  .erp-drawer{
    display:block;
    position:fixed; right:0; top:0; bottom:0; width:min(84vw,340px); background:var(--clay-l);
    z-index:60; transform:translateX(100%); transition:transform .28s var(--ease);
    padding:20px 16px; overflow-y:auto; box-shadow:-14px 0 40px rgba(30,25,15,.25);
  }
  .erp-drawer.open{ transform:translateX(0); }
}

/* ============================================================
   COMPONENTES CLAY
   ============================================================ */
.clay-card{
  background:var(--card); border-radius:var(--r-lg); box-shadow:var(--clay-out-md);
  padding:22px; border:1px solid rgba(255,255,255,.4);
}
.clay-card.flat{ box-shadow:var(--clay-out-sm); padding:16px; }
.clay-card.pressed{ box-shadow:var(--clay-in-md); }

.clay-btn{
  appearance:none; border:none; cursor:pointer; font-family:inherit;
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:13px 22px; border-radius:var(--r-pill); font-weight:700; font-size:.85rem;
  background:var(--clay); color:var(--ink); box-shadow:var(--clay-out-sm);
  transition:box-shadow .12s var(--ease), transform .12s var(--ease), color .12s var(--ease), background .12s var(--ease);
}
.clay-btn:hover{ transform:translateY(-1px); }
.clay-btn:active, .clay-btn.is-pressed{ box-shadow:var(--clay-in-sm); transform:translateY(0); }
.clay-btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; box-shadow:var(--clay-out-sm); }

.clay-btn-primary{ background:linear-gradient(145deg,var(--brand-l),var(--brand)); color:#fff; box-shadow:6px 6px 14px rgba(138,63,7,.35), -4px -4px 10px rgba(255,255,255,.5); }
.clay-btn-primary:active{ box-shadow:inset 4px 4px 10px rgba(90,40,4,.5), inset -3px -3px 8px rgba(255,180,110,.3); }

.clay-btn-accent{ background:linear-gradient(145deg,var(--accent-l),var(--accent)); color:#fff; box-shadow:6px 6px 14px rgba(30,60,55,.35), -4px -4px 10px rgba(255,255,255,.4); }
.clay-btn-accent:active{ box-shadow:inset 4px 4px 10px rgba(15,35,32,.5), inset -3px -3px 8px rgba(150,200,190,.3); }

.clay-btn-danger{ background:linear-gradient(145deg,#d1453a,var(--danger)); color:#fff; box-shadow:6px 6px 14px rgba(120,30,25,.35), -4px -4px 10px rgba(255,255,255,.4); }
.clay-btn-ghost{ background:transparent; box-shadow:none; color:var(--muted); }
.clay-btn-ghost:hover{ background:var(--clay); box-shadow:var(--clay-out-sm); color:var(--ink); }
.clay-btn-sm{ padding:9px 16px; font-size:.78rem; }
.clay-btn-icon{ padding:11px; border-radius:50%; }

.clay-fab{
  position:fixed; right:20px; bottom:calc(var(--bottomnav-h) + 20px); z-index:40;
  width:56px; height:56px; border-radius:50%; background:linear-gradient(145deg,var(--brand-l),var(--brand));
  color:#fff; box-shadow:8px 8px 18px rgba(138,63,7,.4), -4px -4px 12px rgba(255,255,255,.5);
  display:flex; align-items:center; justify-content:center; border:none; cursor:pointer;
}
@media (min-width:881px){ .clay-fab{ bottom:26px; right:34px; } }

/* Inputs — hundidos (inset) por defecto: se "presionan" al usarlos */
.clay-field{ margin-bottom:16px; }
.clay-field label{ display:block; font-size:.78rem; font-weight:700; color:var(--ink-2); margin-bottom:7px; }
.clay-input, .clay-select, .clay-textarea{
  width:100%; border:none; background:var(--clay); border-radius:var(--r-md);
  padding:13px 16px; font-size:.9rem; font-family:inherit; color:var(--ink);
  box-shadow:var(--clay-in-sm); transition:box-shadow var(--dur) var(--ease);
}
.clay-input:focus, .clay-select:focus, .clay-textarea:focus{ box-shadow:inset 4px 4px 8px var(--clay-shadow-d), inset -4px -4px 8px var(--clay-shadow-l), 0 0 0 2px var(--brand-l); outline:none; }
.clay-textarea{ resize:vertical; min-height:90px; }
.clay-hint{ font-size:.72rem; color:var(--faint); margin-top:5px; }
.clay-error{ font-size:.72rem; color:var(--danger); margin-top:5px; font-weight:600; }

.clay-checkbox, .clay-switch{ display:inline-flex; align-items:center; gap:8px; cursor:pointer; user-select:none; }
.clay-switch-track{ width:44px; height:25px; border-radius:99px; background:var(--clay); box-shadow:var(--clay-in-sm); position:relative; transition:background .18s; flex-shrink:0; }
.clay-switch-track::after{ content:''; position:absolute; top:3px; left:3px; width:19px; height:19px; border-radius:50%; background:var(--card); box-shadow:var(--clay-out-sm); transition:transform .18s var(--ease); }
.clay-switch input{ display:none; }
.clay-switch input:checked + .clay-switch-track{ background:var(--accent-l); }
.clay-switch input:checked + .clay-switch-track::after{ transform:translateX(19px); }

/* Badges / chips */
.clay-badge{ display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:var(--r-pill); font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.03em; background:var(--clay); box-shadow:var(--clay-out-sm); color:var(--muted); }
.clay-badge.ok{ color:var(--ok); } .clay-badge.warn{ color:var(--warn); } .clay-badge.danger{ color:var(--danger); } .clay-badge.info{ color:var(--info); } .clay-badge.brand{ color:var(--brand); }

/* Métricas dashboard */
.metric-card{ display:flex; flex-direction:column; gap:6px; }
.metric-card .metric-label{ font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.metric-card .metric-value{ font-size:1.9rem; font-weight:800; letter-spacing:-.02em; }
.metric-card .metric-sub{ font-size:.76rem; color:var(--faint); }
.metric-icon{ width:44px; height:44px; border-radius:var(--r-md); background:var(--clay); box-shadow:var(--clay-out-sm); display:flex; align-items:center; justify-content:center; color:var(--brand); margin-bottom:8px; }

.grid{ display:grid; gap:18px; }
.grid-4{ grid-template-columns:repeat(4,1fr); } .grid-3{ grid-template-columns:repeat(3,1fr); } .grid-2{ grid-template-columns:repeat(2,1fr); }
@media (max-width:1100px){ .grid-4{ grid-template-columns:repeat(2,1fr); } .grid-3{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:620px){ .grid-4,.grid-3,.grid-2{ grid-template-columns:1fr; } }

/* Tablas */
.clay-table-wrap{ border-radius:var(--r-lg); overflow:hidden; box-shadow:var(--clay-out-sm); background:var(--card); }
.clay-table{ width:100%; border-collapse:collapse; font-size:.85rem; }
.clay-table th{ text-align:left; padding:13px 16px; font-size:.68rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:800; background:var(--clay-d); }
.clay-table td{ padding:13px 16px; border-top:1px solid var(--line); }
.clay-table tr:hover td{ background:rgba(180,83,9,.05); }
.clay-table .row-link{ cursor:pointer; }

/* Modal */
.clay-modal-scrim{ position:fixed; inset:0; background:rgba(30,25,15,.45); z-index:80; display:flex; align-items:center; justify-content:center; padding:20px; opacity:0; pointer-events:none; transition:opacity .18s; }
.clay-modal-scrim.open{ opacity:1; pointer-events:auto; }
.clay-modal{ background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--clay-out-lg); max-width:560px; width:100%; max-height:88vh; overflow-y:auto; padding:26px; }
.clay-modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.clay-modal-head h3{ margin:0; font-size:1.1rem; font-weight:800; }

/* Toast */
.clay-toast-wrap{ position:fixed; top:16px; right:16px; z-index:100; display:flex; flex-direction:column; gap:10px; }
.clay-toast{ background:var(--card); box-shadow:var(--clay-out-md); border-radius:var(--r-md); padding:13px 18px; font-size:.82rem; font-weight:600; max-width:320px; border-left:4px solid var(--accent); }
.clay-toast.err{ border-left-color:var(--danger); }
.clay-toast.ok{ border-left-color:var(--ok); }

/* Estado vacío / no configurado */
.clay-empty{ text-align:center; padding:50px 20px; color:var(--faint); }
.clay-empty svg{ width:48px; height:48px; margin:0 auto 14px; opacity:.5; }
.not-configured{ display:inline-flex; align-items:center; gap:6px; font-size:.7rem; font-weight:700; color:var(--warn); background:rgba(194,118,11,.12); padding:4px 10px; border-radius:var(--r-pill); }

/* Loading skeleton */
.clay-skel{ background:linear-gradient(100deg,var(--clay) 30%,var(--clay-l) 50%,var(--clay) 70%); background-size:200% 100%; animation:claySkel 1.3s ease-in-out infinite; border-radius:var(--r-sm); }
@keyframes claySkel{ 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* Kanban */
.kanban-board{ display:flex; gap:16px; overflow-x:auto; padding-bottom:12px; align-items:flex-start; }
.kanban-col{ flex:0 0 270px; background:var(--clay-l); border-radius:var(--r-lg); box-shadow:var(--clay-out-sm); padding:14px; min-height:120px; }
.kanban-col-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; font-weight:800; font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.kanban-count{ background:var(--clay); box-shadow:var(--clay-in-sm); border-radius:99px; padding:2px 9px; font-size:.72rem; }
.kanban-card{ background:var(--card); border-radius:var(--r-md); box-shadow:var(--clay-out-sm); padding:13px; margin-bottom:10px; cursor:grab; font-size:.82rem; }
.kanban-card:active{ cursor:grabbing; }
.kanban-card.dragging{ opacity:.5; }
.kanban-col.drag-over{ box-shadow:var(--clay-in-md); }

.u-flex{ display:flex; } .u-flex-col{ display:flex; flex-direction:column; }
.u-items-center{ align-items:center; } .u-justify-between{ justify-content:space-between; }
.u-gap-8{ gap:8px; } .u-gap-12{ gap:12px; } .u-gap-16{ gap:16px; }
.u-mt-8{margin-top:8px;} .u-mt-16{margin-top:16px;} .u-mt-24{margin-top:24px;}
.u-muted{ color:var(--muted); } .u-faint{ color:var(--faint); } .u-small{ font-size:.78rem; }
.u-w-full{ width:100%; }

.erp-page-head{ margin-bottom:22px; }
.erp-page-head h2{ font-size:1.5rem; font-weight:800; margin:0 0 4px; letter-spacing:-.01em; }
.erp-page-head p{ color:var(--muted); margin:0; font-size:.88rem; }

.erp-loading-screen{ position:fixed; inset:0; background:var(--surface); display:flex; align-items:center; justify-content:center; z-index:200; }
.erp-spinner{ width:44px; height:44px; border-radius:50%; background:var(--clay); box-shadow:var(--clay-out-md); position:relative; }
.erp-spinner::after{ content:''; position:absolute; inset:8px; border-radius:50%; border:3px solid transparent; border-top-color:var(--brand); animation:erpSpin .8s linear infinite; }
@keyframes erpSpin{ to{ transform:rotate(360deg); } }

/* ============================================================
   v5 — componentes compartidos: autocompletado, expediente,
   constructor de etapas, pestañas, calendario de citas
   ============================================================ */
.seg-autocomplete{ position:relative; }
.seg-ac-results{ position:absolute; top:100%; left:0; right:0; background:var(--card); border-radius:var(--r-md); box-shadow:var(--clay-out-md); margin-top:6px; max-height:240px; overflow-y:auto; z-index:40; }
.seg-ac-item{ padding:10px 14px; cursor:pointer; font-size:.85rem; }
.seg-ac-item:hover{ background:var(--clay); }
.perfil-box{ background:var(--clay); box-shadow:var(--clay-in-sm); border-radius:var(--r-md); padding:12px 14px; font-size:.78rem; margin-top:10px; }
.perfil-box dt{ font-weight:700; color:var(--muted); display:inline; }
.perfil-box dd{ display:inline; margin:0; }
.perfil-box .fila{ margin-bottom:4px; }
.clay-modal{ max-height:92vh; overflow-y:auto; }

.nh-tabs{ display:flex; gap:6px; margin-bottom:16px; flex-wrap:wrap; }
.nh-tab{ padding:8px 15px; border-radius:var(--r-pill); font-size:.78rem; font-weight:700; cursor:pointer; background:var(--clay); box-shadow:var(--clay-out-sm); color:var(--muted); border:0; font-family:inherit; }
.nh-tab.active{ box-shadow:var(--clay-in-sm); color:var(--brand); }
.nh-pane{ display:none; } .nh-pane.active{ display:block; }

/* Stepper de etapas del expediente */
.exp-stepper{ display:flex; gap:6px; overflow-x:auto; padding:4px 2px 10px; }
.exp-step{ flex:1 0 110px; border:0; font-family:inherit; text-align:left; background:var(--clay); box-shadow:var(--clay-out-sm); border-radius:var(--r-md); padding:10px 12px; cursor:pointer; color:var(--muted); font-size:.72rem; font-weight:700; position:relative; }
.exp-step .num{ display:block; font-size:.62rem; opacity:.7; margin-bottom:2px; }
.exp-step .bar{ height:5px; border-radius:99px; background:var(--clay-d); margin-top:8px; overflow:hidden; }
.exp-step .bar i{ display:block; height:100%; background:var(--ok); }
.exp-step.done{ color:var(--ok); }
.exp-step.current{ box-shadow:var(--clay-in-sm); color:var(--brand); }
.exp-step:disabled{ cursor:default; }
.exp-etapa{ border-radius:var(--r-md); background:var(--clay-l); box-shadow:var(--clay-out-sm); margin-bottom:12px; }
.exp-etapa > summary{ list-style:none; cursor:pointer; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:800; font-size:.85rem; }
.exp-etapa > summary::-webkit-details-marker{ display:none; }
.exp-etapa[open] > summary{ border-bottom:1px solid var(--line); }
.exp-paso{ display:grid; grid-template-columns:28px 1fr auto; gap:10px; align-items:start; padding:10px 16px; border-bottom:1px solid var(--line); }
.exp-paso:last-child{ border-bottom:0; }
.exp-check{ width:24px; height:24px; border-radius:50%; border:0; background:var(--clay); box-shadow:var(--clay-in-sm); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.75rem; color:#fff; padding:0; }
.exp-check.completado{ background:var(--ok); box-shadow:none; }
.exp-check.en_proceso{ background:var(--info); box-shadow:none; }
.exp-check.omitido{ background:var(--faint); box-shadow:none; }
.exp-check:disabled{ cursor:default; }
.exp-paso-name{ font-size:.84rem; font-weight:700; }
.exp-paso-meta{ font-size:.72rem; color:var(--faint); margin-top:3px; }
.exp-paso-actions{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.exp-paso-actions .clay-select{ width:auto; padding:5px 28px 5px 10px; font-size:.72rem; }
.color-dot{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.progress-mini{ height:6px; border-radius:99px; background:var(--clay-d); overflow:hidden; margin-top:8px; }
.progress-mini i{ display:block; height:100%; background:linear-gradient(90deg,var(--brand-l),var(--brand)); }

/* Constructor de etapas */
.bld-etapa{ background:var(--clay-l); border-radius:var(--r-md); box-shadow:var(--clay-out-sm); padding:12px 14px; margin-bottom:14px; }
.bld-etapa.dragging, .bld-paso.dragging{ opacity:.45; }
.bld-etapa.drag-over{ box-shadow:var(--clay-in-md); }
.bld-head{ display:flex; align-items:center; gap:10px; }
.bld-handle{ cursor:grab; color:var(--faint); font-size:1rem; user-select:none; padding:0 4px; }
.bld-pasos{ margin:10px 0 4px 26px; min-height:10px; }
.bld-paso{ display:flex; align-items:center; gap:10px; background:var(--card); border-radius:var(--r-sm); box-shadow:var(--clay-out-sm); padding:8px 12px; margin-bottom:8px; font-size:.82rem; }
.bld-paso.inactivo, .bld-etapa.inactivo > .bld-head{ opacity:.55; }
.bld-paso .grow, .bld-head .grow{ flex:1; min-width:0; }

/* Calendario / agenda de citas */
.cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:10px; flex-wrap:wrap; }
.cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
.cal-dow{ font-size:.64rem; font-weight:800; color:var(--muted); text-align:center; text-transform:uppercase; }
.cal-day{ min-height:96px; background:var(--card); border-radius:var(--r-md); box-shadow:var(--clay-out-sm); padding:8px; }
.cal-day.other-month{ opacity:.35; } .cal-day.today{ box-shadow:var(--clay-in-sm); }
.cal-daynum{ font-weight:800; font-size:.75rem; margin-bottom:5px; }
.cal-evt{ display:block; border-radius:8px; padding:3px 7px; margin-bottom:3px; font-size:.62rem; font-weight:700; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:var(--clay); color:var(--ink-2); }
.cal-evt.vencido{ background:rgba(179,38,30,.14); color:var(--danger); }
.cal-evt.hoy{ background:rgba(194,118,11,.16); color:var(--warn); }
.cal-evt.proximo{ background:rgba(47,111,168,.14); color:var(--info); }
.cal-evt.cita{ background:rgba(58,107,99,.16); color:var(--accent); }
.cal-evt.tramite{ background:rgba(180,83,9,.14); color:var(--brand-d); }
@media (max-width:880px){ .cal-day{ min-height:60px; } .cal-evt{ font-size:.58rem; } }
.funnel-row{ display:grid; grid-template-columns:160px repeat(4, 1fr); gap:8px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); font-size:.8rem; }
.funnel-row.hdr{ font-weight:800; color:var(--muted); font-size:.68rem; text-transform:uppercase; }
@media (max-width:620px){ .funnel-row{ grid-template-columns:110px repeat(4,1fr); font-size:.72rem; } }
@media (max-width:700px){
  .bld-head, .bld-paso{ flex-wrap:wrap; }
  .bld-head .grow, .bld-paso .grow{ flex:1 1 calc(100% - 40px); }
  .bld-pasos{ margin-left:0; }
  .exp-paso{ grid-template-columns:28px 1fr; }
  .exp-paso-actions{ grid-column:2; justify-content:flex-start; }
}
