/* 
   VIMEDIA INTECAP NORTE  Design System v2
   Dashboard moderno tipo escritorio
    */

:root {
  --font: 'Geist', 'Sora', system-ui, -apple-system, sans-serif;
  --ink: #0f172a;
  --ink-light: #334155;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.10);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Accent  se sobreescribe por centro */
  --accent: #4052d6;
  --accent-light: #e8edff;
  --accent-hover: #3240a8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }
input, textarea, select { font-family: var(--font); -webkit-user-select: text; user-select: text; }

.hidden { display: none !important; }

/*  LOGIN SCREEN  */

.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, var(--accent) 100%);
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-screen::before, .login-screen::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.3; pointer-events: none;
}
.login-screen::before { width: 50vw; height: 50vw; background: var(--accent-light); top: -20%; left: -10%; animation: drift 20s infinite alternate; }
.login-screen::after { width: 40vw; height: 40vw; background: var(--accent); bottom: -20%; right: -10%; animation: drift 15s infinite alternate-reverse; }

@keyframes drift { 0% { transform: translate(0,0); } 100% { transform: translate(30px, 30px); } }

.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 48px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  position: relative; z-index: 2;
  animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.login-icon {
  width: 72px; height: 72px; margin: 0 auto 20px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff; font-size: 22px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.login-title { text-align: center; font-size: 24px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.login-sub { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 32px; }
.login-badge {
  display: flex; justify-content: center; margin-bottom: 24px;
}
.login-badge span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent);
  font-size: 12px; font-weight: 700;
}

.login-back {
  display: flex; justify-content: center; margin-top: 20px;
}
.login-back a {
  font-size: 13px; color: var(--muted); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.2s;
}
.login-back a:hover { color: var(--accent); }

/*  FORM ELEMENTS  */

.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: none; letter-spacing: 0;
}
.input, .textarea, .select {
  width: 100%; border: 2px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 15px; font-weight: 500;
  color: var(--ink); background: var(--bg);
  outline: none; transition: all var(--transition);
}
.textarea { resize: vertical; min-height: 120px; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 4px var(--accent-light);
}
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.helper-text { font-size: 12px; color: var(--muted); margin-top: 6px; }

/*  BUTTONS  */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border: 0; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
}
.btn-block { width: 100%; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.btn-secondary { background: var(--bg); color: var(--ink); border: 2px solid var(--line); }
.btn-secondary:hover { background: #fff; border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-warning { background: #eab308; color: #fff; }
.btn-warning:hover { background: #ca8a04; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-icon {
  width: 40px; height: 40px; padding: 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--muted);
  display: grid; place-items: center; font-size: 16px; cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-icon.wsp:hover { border-color: #25D366; color: #25D366; background: #e8f9ef; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/*  DASHBOARD LAYOUT  */

.app-layout {
  min-height: 100vh;
}

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; margin-bottom: 24px;
}
.sidebar-brand-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; font-size: 14px; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
}
.sidebar-brand-text { font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.sidebar-brand-sub { font-size: 11px; color: var(--muted); font-weight: 600; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all var(--transition); border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; }

.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: none; letter-spacing: 0;
  color: var(--subtle); padding: 14px 12px 4px; user-select: none;
}
.nav-sub {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 24px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all var(--transition); border: none; background: none; width: 100%; text-align: left;
}
.nav-sub:hover { background: var(--bg); color: var(--ink); }
.nav-sub.active { color: var(--accent); font-weight: 700; }
.nav-sub-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--bg); color: var(--muted); padding: 1px 7px; border-radius: 999px;
}
.nav-sub.active .nav-sub-count { background: var(--accent-light); color: var(--accent); }

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px; margin-top: auto;
}

/* Sidebar typewriter banner */
.sidebar-banner {
  margin: 12px 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--accent-light, #e0e7ff), transparent);
  border: 1px solid var(--accent, #6366f1)30;
  border-left: 3px solid var(--accent, #6366f1);
  border-radius: 10px;
  min-height: 56px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-banner-label {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: none; color: var(--accent, #6366f1); opacity: 0.7;
}
.sidebar-banner-text {
  font-size: 11.5px; font-weight: 600; color: var(--ink);
  line-height: 1.4; transition: opacity 0.4s; min-height: 16px;
}
.sidebar-banner-cursor {
  color: var(--accent, #6366f1); font-weight: 700; font-size: 14px;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.main-content {
  margin-left: var(--sidebar-w);
  padding: 24px 32px;
  max-width: 1200px;
}

/* F62: en monitores grandes (≥1400px), el contenido principal usa todo el ancho disponible.
   En laptop/celular se mantiene el max-width: 1200px de arriba (sin cambios). */
@media (min-width: 1400px) {
  .main-content { max-width: none; }
}

/*  HEADER  */

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/*  STAT PILLS (reemplaza KPI cards) */

.stat-pills { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 18px; border-radius: 12px; cursor: pointer; border: none;
  background: var(--bg-card); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm); transition: all var(--transition); min-width: 76px;
}
.stat-pill:hover { box-shadow: var(--shadow-md); border-color: var(--pill-color, var(--accent)); transform: translateY(-1px); }
.stat-pill.c-blue  { --pill-color: #3b82f6; }
.stat-pill.c-purple{ --pill-color: var(--accent); }
.stat-pill.c-green { --pill-color: #22c55e; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--pill-color, var(--ink)); line-height: 1; }
.stat-label { font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); margin-top: 3px; white-space: nowrap; }

/*  SEARCH + FILTERS  */

.toolbar { display: flex; gap: 8px; margin-bottom: 18px; align-items: center; flex-wrap: wrap; }
.toolbar .input { flex: 1; min-width: 180px; height: 40px; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--bg-card); color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/*  REQUEST CARDS  */

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }

.request-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--card-accent, var(--line));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 7px 10px 7px 11px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.request-card:hover { box-shadow: var(--shadow-md); border-left-color: var(--card-accent, var(--accent)); }

/* Flat row layout */
.card-row { display: flex; align-items: center; gap: 10px; }
.card-info { flex: 1; min-width: 0; }
.card-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.request-card .card-right [data-action="eliminar"] { opacity: 0; transition: opacity 0.2s; }
.request-card:hover .card-right [data-action="eliminar"] { opacity: 1; }

.request-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); align-items: center; margin-top: 1px; }
.request-meta span { display: flex; align-items: center; gap: 3px; }

.badge {
  padding: 2px 8px; border-radius: 5px; flex-shrink: 0;
  font-weight: 700; font-size: 10px; text-transform: none; letter-spacing: 0;
}
.badge-count {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--bg); color: var(--muted);
}

.card-footer { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 3px; }
.card-footer:has(.card-actions-primary) { justify-content: space-between; }
.card-actions { display: flex; align-items: center; gap: 5px; }
.primary-actions, .secondary-actions { display: flex; gap: 5px; }

/* FICHA MODAL LAYOUT */
.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ── MODAL UNIFICADO DE SOLICITUD ── */
.sol-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: 8px;
}
.sol-modal-title { font-size: 15px; font-weight: 800; color: var(--ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sol-modal-badge { font-size: 10px; font-weight: 700; text-transform: none; padding: 3px 10px; border-radius: 999px; letter-spacing: 0; flex-shrink: 0; }
.sol-modal-tabs {
  display: flex; gap: 2px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.sol-modal-tab {
  padding: 11px 16px; font-size: 12px; font-weight: 700;
  color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  font-family: var(--font); transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.sol-modal-tab:hover { color: var(--ink); }
.sol-modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.sol-modal-tab-count {
  font-size: 10px; font-weight: 800; background: var(--accent-light);
  color: var(--accent); padding: 1px 7px; border-radius: 999px;
}
.sol-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.sol-tab-panel { display: none; }
.sol-tab-panel.active { display: block; }

/* Estado badge colors en header modal */
.sol-badge-recibido   { background: #fee2e2; color: #ef4444; }
.sol-badge-en_diseno  { background: #fef3c7; color: #d97706; }
.sol-badge-en_revision{ background: #dbeafe; color: #2563eb; }
.sol-badge-aprobado   { background: #dcfce7; color: #15803d; }
.sol-badge-programado { background: #e0e7ff; color: #4f46e5; }
.sol-badge-publicado  { background: #dcfce7; color: #15803d; }
.sol-badge-rechazado         { background: #fce7f3; color: #db2777; }
.sol-badge-revision_mercadeo { background: #ffedd5; color: #ea580c; }
.sol-badge-cambios_mercadeo  { background: #fef9c3; color: #a16207; }

/* ── Fase 27.1: Semáforo pulsante de cupos (empleados + portales centros) ── */
.pulse-semaforo {
  box-shadow: 0 0 0 0 var(--pulse-color, #22c55e);
  animation: pulse-semaforo-ring 1.8s cubic-bezier(.66,0,.34,1) infinite;
}
.pulse-semaforo .pulse-dot {
  animation: pulse-semaforo-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-semaforo-ring {
  0%   { box-shadow: 0 0 0 0 var(--pulse-color, #22c55e); }
  70%  { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
@keyframes pulse-semaforo-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .3; transform: scale(.85); }
}
.sol-card-semaforo[style*="#ef4444"] { animation-duration: 1.2s !important; }
.sol-card-semaforo[style*="#eab308"] { animation-duration: 1.6s !important; }

/* ── Fase 27.3: Selector de semáforo en modal de catálogo (empleados) ── */
.cat-sem-selector .cat-sem-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border: 2px solid var(--line, #e2e8f0);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  color: #334155;
}
.cat-sem-selector .cat-sem-btn:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.cat-sem-selector .cat-sem-btn.active {
  border-color: var(--ink, #0f172a);
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
  transform: translateY(-1px);
}
.cat-sem-selector .cat-sem-btn small {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}
.cat-sem-selector .cat-sem-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
/* Badge semáforo en cards del catálogo (empleados) */
.cat-card-sem {
  position: absolute;
  top: 10px; right: 10px;
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.2);
  z-index: 2;
}
.cat-card-sem.verde    { background: #22c55e; }
.cat-card-sem.amarillo { background: #eab308; }
.cat-card-sem.rojo     { background: #ef4444; }

/* ── NAV BADGE ROJO (Pedidos con recibidas) ── */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 10px; font-weight: 800;
  background: #ef4444; color: #fff; margin-left: auto; flex-shrink: 0;
}
.nav-badge.neutral { background: var(--bg); color: var(--muted); }

/*  MODALS  */

.modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(12px);
  z-index: 999; display: none; place-items: center; padding: 20px;
}
.modal.show { display: grid; }

.modal-content {
  background: var(--bg-card); width: 100%; max-width: 920px;
  border-radius: var(--radius-xl); overflow: hidden;
  display: flex; flex-direction: column; max-height: 90vh;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 16px; font-weight: 800; }
.modal-body { padding: 24px; overflow-y: auto; }

/*  FICHA LAYOUT  */

.ficha-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.panel {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-card);
}
.panel-header {
  padding: 12px 16px; font-weight: 700; color: var(--ink);
  background: var(--bg); border-bottom: 1.5px solid var(--line);
  font-size: 13px; text-transform: none; letter-spacing: 0;
  display: flex; align-items: center; gap: 8px;
}
.panel-body { padding: 16px; }

.media-frame {
  width: 100%; border-radius: 10px;
  background: var(--bg); overflow: hidden;
}
.media-frame img { width: 100%; height: auto; display: block; border-radius: 10px; }
.media-frame video { width: 100%; height: auto; display: block; }
.media-frame iframe { width: 100%; height: 60vh; border: 0; background: #fff; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 14px; }
.preview-card {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 6px; background: var(--bg-card); cursor: pointer; transition: all var(--transition);
}
.preview-card:hover { border-color: var(--accent); }
.preview-thumb {
  width: 100%; height: 90px; border-radius: 8px;
  background: var(--bg); display: grid; place-items: center; overflow: hidden;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.preview-thumb img, .preview-thumb video { width: 100%; height: 100%; object-fit: cover; }
.preview-meta {
  margin-top: 6px; font-size: 11px; color: var(--muted); font-weight: 500;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}

/*  VIEWER MODAL  */

.viewer-body { background: #000; padding: 0; display: grid; place-items: center; }
.viewer-body img, .viewer-body video, .viewer-body iframe { width: 100%; height: 80vh; object-fit: contain; border: 0; }

/*  CATALOG / STORE SELECTOR  */

.catalog-modal .modal-content { max-width: 680px; }

/* Area grid (Step 1) */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.area-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg-card);
  transition: all var(--transition); text-align: center;
}
.area-card:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.area-card-icon { font-size: 24px; color: var(--accent); }
.area-card-name { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.area-card-count { font-size: 10px; color: var(--muted); font-weight: 600; }
.area-card.manual { border-style: solid; }
.area-card.manual .area-card-icon { color: var(--muted); }

/* Course list (Step 2) */
.catalog-search { margin-bottom: 12px; }
.catalog-search .input { height: 44px; font-size: 14px; }

.course-list { max-height: 340px; overflow-y: auto; }
.course-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  transition: all var(--transition); border: 1.5px solid transparent;
  cursor: pointer;
}
.course-item:hover { background: var(--accent-light); border-color: var(--accent); }
.course-item.in-use { opacity: 0.5; cursor: not-allowed; }
.course-item.in-use:hover { background: transparent; border-color: transparent; }
.course-item.selected { background: var(--accent-light); border-color: var(--accent); }

.course-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; color: transparent; transition: all 0.2s; }
.course-item.selected .course-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.course-item.in-use .course-check { background: var(--bg); border-color: var(--line); }

.course-info { flex: 1; min-width: 0; }
.course-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.course-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.course-badge { padding: 2px 7px; border-radius: 5px; font-size: 9.5px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.course-badge.available { background: #f0fdf4; color: #16a34a; }
.course-badge.busy { background: #fef3c7; color: #d97706; }

/* Cart bar (bottom of step 2) */
.cart-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--line);
}
.cart-bar .btn { min-width: 180px; }

/* Confirm list (Step 3) */
.confirm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink);
}
.confirm-item:last-child { border-bottom: none; }
.confirm-item i { color: var(--accent); font-size: 11px; }

/* Confirm step — editable ficha cards */
.confirm-ficha-card {
  border: 2px solid var(--line); border-radius: 16px; padding: 20px;
  margin-bottom: 16px; background: var(--bg-card);
  transition: border-color 0.2s; box-shadow: var(--shadow-sm);
}
.confirm-ficha-card:focus-within { border-color: var(--accent); }
.confirm-ficha-card:last-child { margin-bottom: 0; }
.confirm-ficha-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 16px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1.5px solid var(--line);
}

.catalog-empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* CONTACT CHIPS (form) */
.contact-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.contact-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--bg); border: 1.5px solid var(--line); color: var(--muted);
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.contact-chip:hover { border-color: var(--accent); color: var(--accent); }
.contact-chip.added { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.contact-chip i { font-size: 11px; }

/* CONTACT CONFIG MODAL */
.contact-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: none; }
.contact-row-icon { width: 28px; text-align: center; color: var(--accent); font-size: 14px; }
.contact-row-text { flex: 1; font-size: 13px; color: var(--ink); }
.contact-row-type { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: none; }
.contact-row .btn-icon { width: 28px; height: 28px; font-size: 12px; color: #dc2626; }

/*  EMPTY STATE  */

.empty-state {
  text-align: center; padding: 40px;
  background: var(--bg); border-radius: var(--radius); color: var(--muted);
}

/*  MOBILE MENU  */

.mobile-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 200;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); cursor: pointer;
  font-size: 18px; color: var(--ink);
  place-items: center;
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 90;
}

/*  RESPONSIVE  */

@media (max-width: 768px) {
  .app-layout { display: block; overflow-x: hidden; width: 100%; }
  .main-content { margin-left: 0 !important; padding: 16px; padding-top: 68px; width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .mobile-toggle { display: grid; }
  .ficha-layout { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; }

  .modal-content { max-width: 100% !important; border-radius: 16px; max-height: 95vh; }
  .modal { padding: 10px; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-title { font-size: 15px; }

  .media-frame { border-radius: 8px; }
  .media-frame img, .media-frame video { width: 100%; height: auto; }
  .media-frame iframe { height: 40vh; }

  .panel-header { font-size: 12px; padding: 10px 14px; }
  .panel-body { padding: 12px; }

  .preview-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
  .preview-thumb { height: 70px; }

  .btn-row { flex-wrap: wrap; }
  .btn-sm { height: 34px; padding: 0 12px; font-size: 12px; }
  .btn-icon { width: 36px; height: 36px; }

  .list { grid-template-columns: 1fr; }
  .request-card { padding: 10px 12px 10px 11px; }
  .request-title { font-size: 12.5px; }
  .card-footer { flex-wrap: wrap; gap: 5px; }
  .card-actions { flex-wrap: wrap; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .input { min-width: 100%; }
  .chips { overflow-x: auto; flex-wrap: nowrap; }

  .ficha-grid { grid-template-columns: 1fr; }
  .textarea { min-height: 140px !important; font-size: 13px !important; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-pills { width: 100%; }
  .stat-pill { flex: 1; }
}

/*  ALERT BANNER (admin)  */

.alert-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--accent-light); border-left: 3px solid var(--accent);
  margin-bottom: 18px; cursor: pointer; transition: all var(--transition);
}
.alert-banner:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.alert-banner-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.alert-banner-text { font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; }
.alert-banner-count {
  font-size: 12px; font-weight: 800; color: #fff; background: #ef4444;
  padding: 2px 10px; border-radius: 999px;
}

/*  CENTRO SUMMARY (admin overview)  */

.centro-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.centro-summary-card {
  background: var(--bg-card); border: 1.5px solid var(--line);
  border-left: 4px solid var(--card-color, var(--line));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.centro-summary-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-left-color: var(--card-color); }
.centro-summary-name { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.centro-summary-stats { display: flex; gap: 12px; }
.centro-summary-stat { text-align: center; }
.centro-summary-num { font-size: 18px; font-weight: 800; line-height: 1; }
.centro-summary-label { font-size: 9px; font-weight: 600; text-transform: none; color: var(--muted); margin-top: 2px; }

/*  CENTRO TABS (admin sidebar)  */

.centro-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 10px; margin: 0 4px 6px; }
.centro-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 6px; border-radius: 8px; border: none; background: none;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.centro-tab:hover { background: var(--bg-card); color: var(--ink); }
.centro-tab.active { background: var(--bg-card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.centro-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/*  TIERED CARD ACTIONS (admin)  */

.card-right .btn-icon { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }

@media (max-width: 768px) {
  .centro-summary-grid { grid-template-columns: 1fr; }
  .centro-tabs { flex-wrap: wrap; }
  .card-actions-secondary { flex-wrap: wrap; }
  .card-actions-secondary [data-action="eliminar"] { opacity: 1 !important; }
  .alert-banner { font-size: 12px; padding: 10px 12px; }
}

@media (max-width: 480px) {
  .login-card { padding: 32px 20px; border-radius: 20px; }
  .login-icon { width: 60px; height: 60px; font-size: 18px; border-radius: 14px; }
  .login-title { font-size: 20px; }
  .chip { padding: 5px 10px; font-size: 11px; }
  .stat-num { font-size: 18px; }
}

/* ── KPI CARDS ── */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi-card { background: var(--bg-card); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; margin-bottom: 6px; }
.kpi-num { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* ── REGISTRO CARDS ── */
.registro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 600px; }
.registro-card { background: var(--bg-card); border: 1.5px solid var(--line); border-radius: 16px; padding: 24px 20px; cursor: pointer; transition: all var(--transition); display: flex; flex-direction: column; gap: 6px; }
.registro-card:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.registro-card-icon { font-size: 28px; color: var(--accent); margin-bottom: 4px; }
.registro-card-title { font-size: 14px; font-weight: 800; color: var(--ink); }
.registro-card-desc { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.4; }

/* ── GLOBAL SEARCH DROPDOWN ── */
/* Barra de búsqueda persistente */
.smart-search-bar {
  display: flex; align-items: center; padding: 12px 0 8px;
  position: sticky; top: 0; z-index: 150; background: var(--bg);
}
.search-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.15); z-index: 9999; max-height: 380px; overflow-y: auto; }
.search-group-label { font-size: 10px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); padding: 10px 14px 4px; }
.search-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 500; transition: background .12s; }
.search-item:hover { background: var(--bg); }
.search-empty { padding: 16px 14px; font-size: 13px; color: var(--muted); text-align: center; }
/* Badges de estado en búsqueda */
.search-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  white-space: nowrap; flex-shrink: 0;
}
.search-badge-recibido { background: #fee2e2; color: #dc2626; }
.search-badge-en_diseno { background: #fef3c7; color: #d97706; }
.search-badge-en_revision { background: #dbeafe; color: #2563eb; }
.search-badge-revision_mercadeo { background: #ffedd5; color: #ea580c; }
.search-badge-aprobado { background: #dcfce7; color: #16a34a; }
.search-badge-programado { background: #e0e7ff; color: #4f46e5; }
.search-badge-publicado { background: #d1fae5; color: #059669; }
.search-badge-rechazado { background: #fef2f2; color: #ef4444; }

@media (max-width: 560px) {
  .registro-grid { grid-template-columns: 1fr; }
}

/* ── CATÁLOGO TIPO TIENDA ── */
.catalogo-courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.catalogo-course-card { background: var(--bg-card); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; transition: all var(--transition); }
.catalogo-course-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.catalogo-course-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.catalogo-course-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; flex: 1; }
.catalogo-course-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.catalogo-course-actions { display: flex; gap: 6px; }

/* ── PORTAL BANNER ── */
@keyframes banner-slide-in { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes banner-marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.portal-banner { width: calc(100% + 64px); margin: -24px -32px 20px; padding: 0; animation: banner-slide-in 0.4s ease; position: relative; }
.portal-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px; min-height: 48px; }
.portal-banner-content { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.5; white-space: normal; word-break: break-word; }
@media (max-width: 600px) { .portal-banner { width: calc(100% + 32px); margin: -16px -16px 16px; } .portal-banner-inner { padding: 10px 16px; } }
.portal-banner-content.marquee { animation: banner-marquee 18s linear infinite; display: inline-block; padding-right: 60px; }
.portal-banner-close { background: rgba(255,255,255,0.25); border: none; color: inherit; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 14px; font-weight: 700; line-height: 1; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.portal-banner-close:hover { background: rgba(255,255,255,0.4); }

/* ── CONTADOR DE POSTS ── */
.counter-widget { background: var(--bg-card); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 20px; position: relative; overflow: hidden; }
.counter-widget::before { content: ''; position: absolute; right: -20px; top: -20px; width: 100px; height: 100px; border-radius: 50%; background: var(--accent-light, #f0fdf4); opacity: 0.6; }
.counter-widget-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-light, #f0fdf4); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent); flex-shrink: 0; }
.counter-widget-body { flex: 1; }
.counter-widget-label { font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); margin-bottom: 2px; }
.counter-widget-number { font-size: 32px; font-weight: 900; color: var(--ink); line-height: 1; }
.counter-widget-number.low { color: #ef4444; }
.counter-widget-number.mid { color: #f59e0b; }
.counter-widget-detail { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.counter-widget-period { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.counter-widget-vencido { display: inline-block; background: #fef2f2; color: #dc2626; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; margin-left: 6px; }

/* ── CONFIG ADMIN (Banner + Contador) ── */
.config-card { background: var(--bg-card); border: 1.5px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 20px; }
.config-card-title { font-size: 15px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.config-card-title i { color: var(--accent); }
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle-switch input[type=checkbox] { width: 38px; height: 22px; appearance: none; background: var(--line); border-radius: 11px; position: relative; cursor: pointer; transition: background 0.2s; outline: none; }
.toggle-switch input[type=checkbox]:checked { background: var(--accent); }
.toggle-switch input[type=checkbox]::before { content: ''; position: absolute; width: 16px; height: 16px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input[type=checkbox]:checked::before { transform: translateX(16px); }
.toggle-switch-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.banner-preview { border-radius: 10px; padding: 12px 16px; margin-top: 12px; font-size: 13px; font-weight: 600; min-height: 40px; }
.contador-centro-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.contador-centro-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.contador-centro-label { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.contador-centro-name { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.contador-stat { font-size: 11px; color: var(--muted); }

/* ── SOLICITUD GRID TIENDA-STYLE ── */
.sol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.sol-card {
  position: relative; aspect-ratio: 3/4;
  border-radius: 14px; overflow: hidden;
  background: var(--bg-card); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  display: flex; /* Needed so glass fills height */
  /* F61: aislar layout/paint de cada card → scroll fluido aun con 28+ cards */
  contain: layout paint style;
}
.sol-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.sol-card-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  transition: transform 0.4s ease;
  overflow: hidden;
}
/* Fase 50: <img loading="lazy"> dentro de .sol-card-bg replica el comportamiento
   de background-image (cover + center) pero permite descarga diferida. */
.sol-card-bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.sol-card:hover .sol-card-bg { transform: scale(1.05); }
.sol-card-glass {
  position: relative; z-index: 1; /* In-flow above bg */
  flex: 1; min-height: 240px; /* Fallback height if aspect-ratio fails */
  display: flex; flex-direction: column;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
  padding: 10px;
}
.sol-card:not(.sol-card-has-bg) .sol-card-glass {
  background: none;
}
/* No-bg card: full white card look */
.sol-card:not(.sol-card-has-bg) { background: var(--bg-card); }
.sol-card:not(.sol-card-has-bg) .sol-card-glass {
  justify-content: space-between;
}
.sol-card-top { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.sol-card-badge {
  padding: 3px 8px; border-radius: 999px;
  font-size: 9px; font-weight: 800; text-transform: none; letter-spacing: 0;
}
/* F61: sin backdrop-filter (~3x más rápido en scroll con muchas cards). Más opacidad mantiene legibilidad. */
.sol-card-has-bg .sol-card-badge { background: rgba(15,23,42,0.55); color: #fff; }
.sol-card-centro {
  font-size: 9px; font-weight: 700; text-transform: none; letter-spacing: 0;
  padding: 2px 6px; border-radius: 999px;
}
.sol-card-has-bg .sol-card-centro { background: rgba(15,23,42,0.5); color: rgba(255,255,255,0.95); }
.sol-card:not(.sol-card-has-bg) .sol-card-centro { background: var(--accent-light); color: var(--accent); }
.sol-card-bottom { display: flex; flex-direction: column; gap: 5px; }
.sol-card-title {
  font-size: 12px; font-weight: 800; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sol-card-has-bg .sol-card-title { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.sol-card:not(.sol-card-has-bg) .sol-card-title { color: var(--ink); }
.sol-card-meta { font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sol-card-has-bg .sol-card-meta { color: rgba(255,255,255,0.65); }
.sol-card:not(.sol-card-has-bg) .sol-card-meta { color: var(--muted); }
.sol-card-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.sol-card-btn {
  height: 26px; padding: 0 9px; border-radius: 7px; border: none;
  font-family: var(--font); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.sol-card-has-bg .sol-card-btn-primary { background: rgba(255,255,255,0.9); color: #0f172a; }
.sol-card-has-bg .sol-card-btn-primary:hover { background: #fff; }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-primary { background: var(--accent); color: #fff; }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-primary:hover { background: var(--accent-hover); }
.sol-card-btn-icon {
  width: 30px; height: 30px; padding: 0; border-radius: 50%; border: none;
  font-family: var(--font); font-size: 12px; cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sol-card-has-bg .sol-card-btn-icon { background: rgba(15,23,42,0.55); color: rgba(255,255,255,0.95); }
.sol-card-has-bg .sol-card-btn-icon:hover { background: rgba(255,255,255,0.3); }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-icon { background: var(--bg); color: var(--muted); }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-icon:hover { background: var(--line); color: var(--ink); }
.sol-card-has-bg .sol-card-btn-danger { background: rgba(239,68,68,0.25); color: rgba(255,255,255,0.85); }
.sol-card-has-bg .sol-card-btn-danger:hover { background: rgba(239,68,68,0.55); }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-danger { background: #fef2f2; color: #ef4444; }
.sol-card [data-action="eliminar"] { opacity: 0; transition: opacity 0.2s; }
.sol-card:hover [data-action="eliminar"] { opacity: 1; }
/* F101: botón Republicar con fondo verde sólido para contraste sobre fondo de imagen */
.sol-card-has-bg .sol-card-btn-republicar { background: rgba(22,163,74,0.85); color: #fff; }
.sol-card-has-bg .sol-card-btn-republicar:hover { background: #16a34a; }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-republicar { background: #dcfce7; color: #16a34a; }
.sol-card:not(.sol-card-has-bg) .sol-card-btn-republicar:hover { background: #bbf7d0; }
@media (max-width: 768px) {
  .sol-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .sol-card [data-action="eliminar"] { opacity: 1; }
}
@media (max-width: 480px) { .sol-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── FASE 5 — Catálogo como fuente de verdad ── */
.catalogo-centro-tabs { display: flex; gap: 6px; padding: 0 0 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.catalogo-tab-btn { display: flex; align-items: center; gap: 7px; padding: 7px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.catalogo-tab-btn .tab-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.catalogo-tab-btn:hover { border-color: var(--accent); color: var(--ink); }
.catalogo-tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.catalogo-tab-btn.active .tab-dot { background: rgba(255,255,255,0.7) !important; }

.area-card-crear { border: 2px solid var(--line) !important; background: transparent !important; color: var(--muted); }
.area-card-crear:hover { border-color: var(--accent) !important; color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent) !important; }
.area-card-crear .area-card-icon { background: transparent; }

/* ── Home centro cards ── */
#centro-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { #centro-summary { grid-template-columns: 1fr; } }
.home-centro-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; border-top: 4px solid var(--centro-accent); }
.home-centro-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.home-centro-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.home-centro-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.home-centro-name { font-size: 16px; font-weight: 800; color: var(--ink); flex: 1; }
.home-centro-badge { font-size: 11px; background: #fee2e2; color: #ef4444; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.home-centro-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.home-centro-stat { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.home-centro-num { font-size: 28px; font-weight: 900; color: var(--ink); line-height: 1; }
.home-centro-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: none; margin-top: 4px; letter-spacing: 0; }
.home-centro-contador { border-top: 1px solid var(--line); padding-top: 14px; }

.catalogo-crear-inline { padding: 12px 0 4px; }
.catalogo-crear-inline button { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; transition: background 0.15s; }
.catalogo-crear-inline button:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ═══════════════════════════════════════════════
   MOBILE FIXES — revisión general responsive
   ═══════════════════════════════════════════════ */

/* ── Inputs con ancho fijo en page-header → full width en móvil ── */
@media (max-width: 768px) {
  #global-search,
  #catalogo-search { width: 100% !important; box-sizing: border-box; }
  .page-header > div:last-child,
  .page-header > input { width: 100%; }
  .page-header { gap: 10px; }
}

/* ── Catálogo de cursos → 1 col en pantalla pequeña ── */
@media (max-width: 560px) {
  .catalogo-courses-grid { grid-template-columns: 1fr; }
}

/* ── KPI grid → 1 col en teléfono muy pequeño ── */
@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
}

/* ── Catalogo centro tabs → scroll horizontal en mobile ── */
@media (max-width: 600px) {
  .catalogo-centro-tabs {
    overflow-x: auto; flex-wrap: nowrap;
    padding-bottom: 8px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .catalogo-centro-tabs::-webkit-scrollbar { display: none; }
  .catalogo-tab-btn { flex-shrink: 0; }
}

/* ── Cart bar → wrap + sin min-width fija ── */
@media (max-width: 560px) {
  .cart-bar { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .cart-bar .btn { min-width: 0 !important; flex: 1; }
}

/* ── Tabs del modal solicitud → scroll horizontal ── */
@media (max-width: 540px) {
  .sol-modal-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sol-modal-tabs::-webkit-scrollbar { display: none; }
  .sol-modal-tab { flex-shrink: 0; white-space: nowrap; padding: 10px 10px; font-size: 11px; }
}

/* ── Counter config grids (sidebar empleados) → apilar en móvil ── */
@media (max-width: 580px) {
  .cnt-grid-row { grid-template-columns: 1fr 1fr !important; }
  .cnt-grid-row input[type="number"] { width: 100% !important; }
}
@media (max-width: 380px) {
  .cnt-grid-row { grid-template-columns: 1fr !important; }
}

/* ── Grids de 2 columnas en modales → apilar en móvil ── */
@media (max-width: 480px) {
  .grid-2col-form { grid-template-columns: 1fr !important; }
}

/* ── Textareas grandes → altura reducida en móvil ── */
@media (max-width: 768px) {
  #ficha-text   { min-height: 220px !important; }
  #cc-texto     { min-height: 180px !important; }
  #import-text  { min-height: 200px !important; }
  .confirm-ficha-text { min-height: 180px !important; }
}

/* ── Chips de filtro estado → scroll horizontal ── */
/* F96 (2026-05-06): unificado para TODOS los .chips en mobile, no solo #pedidos-estado-chips.
   Resuelve: en celular los chips de Recibidas/En diseño/En revisión/Rechazadas/etc. quedaban
   cortados sin slider visible.
   Causas combinadas:
     1. flex-shrink no estaba aplicado a todos los chips (los últimos se cortaban)
     2. width del container no estaba limitado (en toolbar align-items:stretch los chips
        empujaban el ancho del container más allá del padre)
     3. .main-content tiene overflow-x:hidden — cuando el .chips no tiene su propio
        overflow:auto efectivo, el contenido excedente queda recortado por main-content
   Fix: width:100% + max-width:100% + min-width:0 + overflow-x:auto explícito + flex-shrink:0
   en hijos. Selectores con !important para vencer cualquier override desktop heredado.
   Patrón válido para .chips, .chips[id] (cualquier instancia con id) y descendientes. */
@media (max-width: 768px) {
  .chips,
  .chips[id] {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .chips::-webkit-scrollbar,
  .chips[id]::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  .chips > .chip,
  .chips[id] > .chip {
    flex-shrink: 0 !important;
    flex: 0 0 auto !important;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  /* Cuando .chips está dentro de .toolbar (que en mobile es flex-column align-items:stretch),
     asegurar que el chips no rompa el layout vertical. */
  .toolbar > .chips,
  .toolbar > .chips[id] {
    align-self: stretch;
  }
}

/* ── Botones Ficha (Copiar / WhatsApp / Link) → wrap en muy pequeño ── */
@media (max-width: 420px) {
  #btn-copy, #btn-wsp, #btn-link, #btn-guardar-ficha { flex: 1; justify-content: center; min-width: 0; font-size: 11px; padding: 0 8px; }
}

/* ── Botón de descarga plantilla → full width en móvil ── */
@media (max-width: 480px) {
  .btn-dl-plantilla { width: 100% !important; }
}

/* ── Counter widget → apilado en teléfono pequeño ── */
@media (max-width: 380px) {
  .counter-widget { flex-direction: column; text-align: center; padding: 16px; }
  .counter-widget-number { font-size: 26px; }
}

/* ── Nueva solicitud: btn-row ocupa todo el ancho ── */
@media (max-width: 480px) {
  form .btn-row { flex-direction: column; }
  form .btn-row .btn { width: 100%; justify-content: center; }
}

/* ── Sol-grid tienda → 2 col exactas en teléfonos medianos ── */
@media (max-width: 600px) and (min-width: 481px) {
  .sol-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ── Registro-grid portal landing → 1 col en pequeño ── */
@media (max-width: 400px) {
  .registro-grid { grid-template-columns: 1fr; }
}

/* ══ REGISTRO DE PUBLICACIONES ══════════════════════════════ */
.pub-periodo-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.pub-periodo-icon {
  width: 44px; height: 44px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--accent); flex-shrink: 0;
}
.pub-periodo-body { flex: 1; min-width: 0; }
.pub-periodo-label { font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); }
.pub-periodo-count { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.1; }
.pub-periodo-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pub-periodo-dates { font-size: 11px; color: var(--muted); margin-top: 2px; }

.pub-progress-wrap { margin-bottom: 20px; }
.pub-progress-bar {
  height: 8px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.pub-progress-fill {
  height: 100%; background: var(--accent); border-radius: 99px;
  transition: width .4s ease;
}
.pub-progress-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-top: 4px;
}

/* ── Calendario de publicaciones ── */
.pub-cal-nav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.pub-cal-month {
  font-size: 16px; font-weight: 800; color: var(--text);
  min-width: 160px; text-align: center;
}
.pub-cal-header {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px;
}
.pub-cal-header span {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: none; padding: 6px 0;
}
.pub-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 20px;
}
.pub-cal-day {
  position: relative; text-align: center; padding: 10px 4px;
  font-size: 13px; font-weight: 600; color: var(--text);
  border-radius: 10px; cursor: default; transition: background .15s;
  min-height: 40px; display: flex; align-items: center; justify-content: center;
}
.pub-cal-day.other-month { color: var(--border); }
.pub-cal-day.today {
  outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px;
}
.pub-cal-day.has-pub { cursor: pointer; background: var(--accent-light, #f0fdf4); }
.pub-cal-day.has-pub:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.pub-cal-day.has-pub::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.pub-cal-day.has-pub.multi::after {
  width: 14px; height: 6px; border-radius: 3px;
}
.pub-cal-day.selected {
  background: var(--accent) !important; color: #fff !important;
}
.pub-cal-day.selected::after { background: #fff; }

/* Lista de publicaciones */
.pub-cal-list-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: none; letter-spacing: 0;
  padding: 8px 0; border-bottom: 1.5px solid var(--border); margin-bottom: 8px;
}
.pub-cal-entry {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); margin-bottom: 6px;
  transition: box-shadow .15s;
}
.pub-cal-entry:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.pub-cal-hora {
  font-size: 12px; font-weight: 700; color: var(--accent);
  white-space: nowrap; min-width: 42px;
}
.pub-cal-curso {
  font-size: 13px; font-weight: 700; color: var(--text); flex: 1; min-width: 0;
}
.pub-cal-area {
  font-size: 11px; color: var(--accent); font-weight: 600; white-space: nowrap;
}
.pub-cal-fecha-label {
  font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap;
}

/* Registro pub tabs (admin config) */
.registro-pub-tab { background: var(--bg); border: 1.5px solid var(--border); color: var(--muted); font-weight: 600; }
.registro-pub-tab.active { background: var(--surface); border-color: var(--tab-accent, var(--accent)); color: var(--tab-accent, var(--accent)); }

@media (max-width: 600px) {
  .pub-cal-day { padding: 8px 2px; font-size: 12px; min-height: 36px; }
  .pub-cal-entry { flex-wrap: wrap; gap: 4px; }
  .pub-cal-area { width: 100%; }
}

/* Fase 18: barra de emojis para editor de redes sociales */
.emoji-bar {
  overflow-x: auto;
}
.emoji-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 18px;
  line-height: 1.4;
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.emoji-btn:hover {
  background: #f1f5f9;
  border-color: var(--accent);
  transform: scale(1.1);
}
.emoji-btn:active { transform: scale(0.95); }
@media (max-width: 600px) {
  .emoji-btn { font-size: 16px; padding: 2px 4px; }
}


/* ═══════════════════════════════════════════════════════════
   FASE 28.16 — MOBILE FIXES GLOBALES (INTECAP + MARCAS)
   Corrige superposición de sidebar, search bar fuera de lugar,
   y mejora general de UX en celular.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Sidebar siempre por encima de todo en móvil */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 84vw !important;
    max-width: 320px;
    z-index: 300 !important;
    background: #fff;
    box-shadow: 0 0 0 rgba(0,0,0,0);
    transition: transform .28s ease, box-shadow .28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open,
  .sidebar.mobile-open {
    box-shadow: 0 0 50px rgba(0,0,0,0.35);
  }

  /* Overlay oscuro detrás del sidebar */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    z-index: 250;
    display: none;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.show { display: block; }

  /* Botón hamburguesa bien visible */
  .mobile-toggle {
    display: grid !important;
    place-items: center;
    position: fixed;
    top: 10px; left: 10px;
    width: 42px; height: 42px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    color: #334155;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 120;
    cursor: pointer;
  }

  /* Search bar: no debe estar por encima del sidebar ni flotar raro */
  .smart-search-bar {
    position: relative !important;
    z-index: 1 !important;
    margin: 10px 0 8px !important;
    padding: 0 !important;
  }
  .smart-search-bar input,
  #global-search {
    width: 100%;
    box-sizing: border-box;
  }

  /* Main content: respeta el hamburguesa arriba */
  .main-content {
    padding: 64px 14px 24px !important;
    margin-left: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Cards de home: 1 columna en móvil chico, 2 en tablet */
  .kpi-grid,
  .home-centros-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Page header más compacto */
  .page-header,
  .page-title {
    font-size: 18px !important;
  }

  /* Chips / botones con mejor touch */
  .chip, .nav-chip, .btn, .btn-sm {
    min-height: 36px;
  }

  /* Tablas → scroll horizontal en vez de romper */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Modal: más ancho, menos padding */
  .modal { padding: 8px !important; }
  .modal-content {
    max-width: 96vw !important;
    max-height: 94vh !important;
    border-radius: 14px !important;
  }
  .modal-body { padding: 14px !important; }

  /* Form fields: labels y inputs más legibles */
  .form-label { font-size: 12px; }
  .input, .textarea, select {
    font-size: 15px; /* evita zoom en iOS */
  }

  /* Nav-badge más chico */
  .nav-badge { font-size: 10px; padding: 1px 6px; }
}

/* Móvil chico (<500px): más compacto */
@media (max-width: 500px) {
  .main-content { padding: 60px 10px 20px !important; }
  .wm-modos-row { grid-template-columns: 1fr !important; }
  .home-centros-grid { grid-template-columns: 1fr !important; }
  .kpi-card { padding: 12px !important; }
  .kpi-value { font-size: 22px !important; }
}


/* ── BARRIDO 28/07 · paginador de bandejas (kit: compacto, un acento implícito) ── */
.bandeja-pager {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 18px 0 6px; margin-top: 4px;
}
.pager-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line, #e3e4e7); border-radius: 9px;
  background: #fff; color: var(--ink, #111214);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; transition: background .18s ease, border-color .18s ease;
}
.pager-btn:hover:not(:disabled) { background: #f7f7f8; border-color: #a2a4aa; }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-btn i { font-size: 11px; }
.pager-info { font-size: 12.5px; font-weight: 600; color: var(--muted, #6a6c72); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .bandeja-pager { gap: 8px; } .pager-btn { padding: 0 11px; } }


/* ══ KIT diseno-vimedia (28/07/26) · tooltip: todo solo-ícono dice su nombre ══ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: #2a2b2f; color: #fff;
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  padding: 7px 11px; border-radius: 8px;
  opacity: 0; pointer-events: none; z-index: 1200;
  transition: opacity .18s ease, transform .18s ease;
}
[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #2a2b2f; border-bottom: none;
  opacity: 0; pointer-events: none; z-index: 1200;
  transition: opacity .18s ease;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-tip]:hover::before { opacity: 1; }
.sol-card-btn-icon:active { transform: scale(.92); }
