/* ==========================================================================
   Tema Conecta Digital: fondo degradado morado/azul, paneles translúcidos
   (glassmorphism), barra lateral plegable y botones verdes de acción.
   Se carga después de styles.css y solo sobrescribe lo visual.
   ========================================================================== */
:root {
  --bg-1: #170F3B;
  --bg-2: #2B1A6E;
  --bg-3: #173572;
  --bg-4: #0C3C5E;
  --glass-dark: rgba(16, 10, 44, .55);
  --glass-dark-line: rgba(255, 255, 255, .12);
  --glass: rgba(255, 255, 255, .86);
  --glass-strong: rgba(255, 255, 255, .94);
  --glass-soft: rgba(255, 255, 255, .55);
  --glass-line: rgba(255, 255, 255, .55);
  --on-bg: #F5F3FF;
  --on-bg-muted: rgba(229, 225, 255, .78);
  --green: #4ADE80;
  --green-hover: #22C55E;
  --on-green: #052E16;
  --side-w: 232px;
  --side-w-collapsed: 68px;
  --top-h: 64px;
  --bg: transparent;
  --surface: var(--glass-strong);
}

html { background: var(--bg-1); }
body { background: transparent; min-height: 100vh; }

/* Fondo: degradado + manchas de luz abstractas (solo CSS) */
.app-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 12% 18%, rgba(139, 92, 246, .45), transparent 70%),
    radial-gradient(35vw 35vw at 88% 12%, rgba(20, 184, 166, .28), transparent 70%),
    radial-gradient(45vw 45vw at 75% 92%, rgba(59, 130, 246, .35), transparent 70%),
    radial-gradient(30vw 30vw at 30% 85%, rgba(236, 72, 153, .18), transparent 70%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 38%, var(--bg-3) 72%, var(--bg-4) 100%);
}
.app-bg::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- Barra lateral ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: var(--side-w);
  display: flex; flex-direction: column; gap: 6px; padding: 12px 10px;
  background: var(--glass-dark); border-right: 1px solid var(--glass-dark-line);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: width .2s ease, transform .2s ease; overflow: hidden;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 14px; text-decoration: none; color: #fff; white-space: nowrap; }
.side-brand .brand-mark { flex: 0 0 36px; color: #fff; }
.side-brand .brand-name { font-size: 18px; color: #fff; }
.side-brand .brand-name strong { color: #5EEAD4; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.side-nav a, .side-toggle {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--on-bg-muted); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.side-nav a:hover, .side-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.side-nav .ic, .side-toggle .ic { flex: 0 0 20px; }
.side-count {
  margin-left: auto; background: var(--coral); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  padding: 0 7px; line-height: 18px;
}
.side-count:empty { display: none; }
.side-toggle { border: 0; background: none; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.side-toggle .ic { transition: transform .2s ease; }

body.side-collapsed .sidebar { width: var(--side-w-collapsed); }
body.side-collapsed .side-label { display: none; }
body.side-collapsed .side-toggle .ic { transform: rotate(180deg); }
body.side-collapsed .side-count { position: absolute; top: 4px; right: 4px; padding: 0 5px; font-size: 10px; }
body.side-collapsed .side-nav a, body.side-collapsed .side-toggle { justify-content: center; padding: 10px; }

.side-backdrop { display: none; }

/* ---------- Contenido y barra superior ---------- */
.main { margin-left: var(--side-w); min-height: 100vh; transition: margin-left .2s ease; display: flex; flex-direction: column; }
body.side-collapsed .main { margin-left: var(--side-w-collapsed); }

.topbar {
  position: sticky; top: 0; z-index: 50; min-height: var(--top-h); padding: 8px 20px; gap: 10px 16px;
  display: flex; flex-wrap: nowrap; align-items: center;
  background: var(--glass-dark); border-bottom: 1px solid var(--glass-dark-line);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.top-title { display: flex; align-items: center; gap: 6px 18px; min-width: 0; flex: 1; flex-wrap: wrap; }
.top-title h2 { margin: 0; color: #fff; font-size: 18px; white-space: nowrap; }
.subnav { display: flex; gap: 2px; flex-wrap: wrap; }
.subnav a {
  color: var(--on-bg-muted); text-decoration: none; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 999px;
}
.subnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.subnav a.active { color: #fff; background: rgba(255, 255, 255, .18); }

.icon-round {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; position: relative; flex: 0 0 auto;
}
.icon-round:hover { background: rgba(255, 255, 255, .18); }
.menu-btn { display: none; }
.bell { opacity: 1; font-size: inherit; padding: 0; }
.bell-count { top: -2px; right: -2px; }

.global-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 0 1 340px; min-width: 0;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 0 12px; color: var(--on-bg-muted); }
.global-search:focus-within { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); }
.global-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: inherit; padding: 9px 0; }
.global-search input::placeholder { color: var(--on-bg-muted); }
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; left: 0; min-width: 300px; z-index: 70; max-height: 420px; overflow-y: auto;
  background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 12px; padding: 6px;
  box-shadow: 0 20px 50px rgba(10, 6, 40, .45); backdrop-filter: blur(18px);
}
.search-results a { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-results a.sel, .search-results a:hover { background: #EDE9FE; }
.search-results b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results small { grid-column: 2; color: var(--muted); }
.sr-type { grid-row: span 2; align-self: center; font-size: 10px; font-weight: 800; text-transform: uppercase; color: #6D28D9; background: #EDE9FE; border-radius: 6px; padding: 3px 6px; }
.sr-empty { margin: 8px; color: var(--muted); }

.avatar-wrap { position: relative; flex: 0 0 auto; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); cursor: pointer;
  background: linear-gradient(135deg, #8B5CF6, #14B8A6); color: #fff; font-weight: 800; font: inherit; font-weight: 800;
  display: grid; place-items: center;
}
.avatar.big { width: 44px; height: 44px; flex: 0 0 44px; cursor: default; }
.avatar-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 260px; padding: 8px;
  background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 12px; box-shadow: 0 20px 50px rgba(10, 6, 40, .45);
  display: flex; flex-direction: column; gap: 2px;
}
.avatar-head { display: flex; gap: 10px; align-items: center; padding: 6px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.avatar-head b { display: block; color: var(--navy); }
.avatar-head small { color: var(--muted); }
.avatar-menu a, .avatar-menu button { text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font: inherit; color: var(--text); text-decoration: none; cursor: pointer; }
.avatar-menu a:hover, .avatar-menu button:hover { background: #EDE9FE; }

#view { flex: 1; }

/* ---------- Botones ---------- */
.btn.primary { background: var(--green); color: var(--on-green); }
.btn.primary:hover { background: var(--green-hover); color: var(--on-green); }
.btn.ghost { background: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .6); }
.btn.ghost:hover { background: #fff; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid #A78BFA; outline-offset: 2px; }

/* ---------- Paneles translúcidos ---------- */
.panel, .tile, .column-head, .card, .login-card, .tabs button:not(.on) {
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.panel, .tile { background: var(--glass); border-color: var(--glass-line); box-shadow: 0 10px 30px rgba(10, 6, 40, .18); }
table.data th { background: rgba(248, 250, 252, .7); }
.column { background: var(--glass-soft); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.column-head { background: var(--glass-strong); }
.card { background: var(--glass-strong); }
.add-inline { color: #334155; border-color: rgba(51, 65, 85, .35); }
.calendar { background: rgba(255, 255, 255, .35); border-color: rgba(255, 255, 255, .35); }
.cal-day { background: var(--glass-strong); }
.cal-day.other { background: rgba(241, 245, 249, .8); }
.cal-head { background: rgba(248, 250, 252, .85); }
.agenda { background: var(--glass-strong); }
.ag-head { background: rgba(255, 255, 255, .96); }
dialog { background: #fff; }
.toolbar input, .toolbar select, #agDate, .pipeline-select { background: rgba(255, 255, 255, .92); border-color: rgba(255, 255, 255, .6); }
.seg { background: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .6); }
.seg button.on { background: #4C1D95; }
.tabs button { background: rgba(255, 255, 255, .88); border-color: rgba(255, 255, 255, .6); }
.tabs button.on { background: #4C1D95; border-color: #4C1D95; }
.stage-bar button { background: rgba(255, 255, 255, .75); color: #334155; }
.stage-bar .stage-gear { background: rgba(255, 255, 255, .85); display: grid; place-items: center; text-decoration: none; padding: 0 12px; }
.banner { background: rgba(255, 247, 237, .95); }
.add-pipeline { border-color: rgba(255, 255, 255, .4); color: var(--on-bg-muted); }
.add-pipeline:hover { border-color: var(--green); color: #fff; }
.tunnel-label rect { fill: #fff; }

/* ---------- Texto sobre el fondo oscuro (fuera de paneles) ---------- */
.view-bar h1, .page > h1, .funnels-top h1, .detail-title h1, .channels > h1 { color: #fff; }
.summary, .list-count, .agenda-title, .title-group .muted, .detail-title .muted,
.page > p.muted, .page-pad > p.muted, .funnels-page > p.muted, .channels > p.muted { color: var(--on-bg-muted); }
.summary b { color: #fff; }
.back, .page > .back, .funnels-top .back { color: #A7F3D0; }
.big-amount { color: #86EFAC; }
.links a { color: #A7F3D0; }
.toolbar > .check, .toolbar label.inline, .pipeline-pick, .view-bar label.inline { color: var(--on-bg-muted); }
.page > p:not(.muted), .page > .panel ~ p { color: var(--on-bg); }
.page > p a, .detail-title a, .page > p.small a { color: #A7F3D0; }
.funnels-page .connector-demo { border-color: #5EEAD4; background: transparent; }
.chat-empty a { color: var(--teal-dark); }

/* ---------- Inicio de sesión ---------- */
body.login-mode .sidebar, body.login-mode .main { display: none; }
.login { background: transparent; }
.login-card { background: var(--glass-strong); border: 1px solid var(--glass-line); }

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .sidebar { width: 264px; transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  body.side-collapsed .sidebar { width: 264px; }
  body.side-collapsed .side-label { display: inline; }
  body.side-collapsed .side-nav a, body.side-collapsed .side-toggle { justify-content: flex-start; padding: 10px 12px; }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(5, 3, 20, .55); }
  .side-toggle { display: none; }
  .main, body.side-collapsed .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .top-title { order: 1; flex: 1 1 calc(100% - 200px); }
  .topbar .bell, .avatar-wrap { order: 2; }
  .global-search { order: 5; flex: 1 1 100%; }
  .subnav { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
  .top-title { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .top-title h2 { font-size: 16px; }
  .subnav { flex: 1 1 100%; }
}

/* Los elementos con el atributo hidden deben ocultarse aunque tengan display propio */
.avatar-menu[hidden], .search-results[hidden], .qr-menu[hidden] { display: none; }
/* Enlaces dentro de paneles claros: color oscuro para buen contraste */
.panel .links a, .panel .back, .panel p a, dialog a { color: var(--teal-dark); }
.subnav a { white-space: nowrap; }
@media (max-width: 900px) {
  .top-title { flex-direction: column; align-items: flex-start; gap: 4px; }
  .subnav { width: 100%; }
}

/* ---------- Pestañas del CRM, contadores y botón Crear ---------- */
.crm-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 4px 20px 0; }
.view-tabs { display: flex; gap: 2px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 3px; }
.view-tabs button { border: 0; background: none; color: var(--on-bg-muted); font: inherit; font-weight: 700; padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.view-tabs button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.view-tabs button.on { background: rgba(255, 255, 255, .92); color: #3B0764; }
.quick-counters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.counter {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08);
  color: var(--on-bg); font: inherit; font-weight: 600; border-radius: 999px; padding: 5px 6px 5px 14px; cursor: pointer;
}
.counter b { background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 1px 9px; }
.counter b.hot { background: var(--coral); }
.counter:hover { background: rgba(255, 255, 255, .16); }
.counter.on { background: rgba(255, 255, 255, .92); color: #3B0764; border-color: transparent; }
.counter.on b { background: #EDE9FE; color: #3B0764; }
.clear-quick { color: #A7F3D0; }
.split-btn { position: relative; display: inline-flex; }
.split-btn > .btn:first-child { border-radius: 8px 0 0 8px; display: inline-flex; align-items: center; gap: 6px; }
.split-btn > .caret { border-radius: 0 8px 8px 0; border-left: 1px solid rgba(5, 46, 22, .25); padding: 8px 10px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; padding: 6px;
  background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 12px; box-shadow: 0 20px 50px rgba(10, 6, 40, .4);
  display: flex; flex-direction: column;
}
.dropdown[hidden] { display: none; }
.dropdown button { border: 0; background: none; text-align: left; font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.dropdown button:hover { background: #EDE9FE; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-bar .cal-title { color: #fff; }
.cal-bar .muted { color: var(--on-bg-muted); }
.cal-item.deal { display: block; text-decoration: none; background: color-mix(in srgb, var(--c) 18%, white); border-left: 3px solid var(--c); color: var(--navy); }
.cal-day a.cal-item { cursor: pointer; }

/* ---------- Tareas e inventario ---------- */
.done-text { text-decoration: line-through; color: var(--muted); }
.on-bg { color: var(--on-bg-muted); }
.task-desc { white-space: pre-wrap; margin: 0 0 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 600; font-size: 12px; }
.facts dd { margin: 0; }
.facts a { text-decoration: none; font-weight: 600; margin-right: 8px; }
.progress { height: 8px; background: #EEF2F7; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; background: var(--green-hover); border-radius: 999px; }
.checklist { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.task-card .meta { gap: 4px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #F1F5F9; padding: 1px 5px; border-radius: 4px; }

/* ---------- Marketing y sitios ---------- */
.notice { background: rgba(255, 255, 255, .9); border: 1px solid var(--glass-line); border-radius: 12px; padding: 12px 16px; color: var(--text); margin: 0 0 14px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cards-grid .panel { margin: 0; }
.big-num { font-size: 34px; font-weight: 800; color: #4C1D95; margin: 4px 0; }
.big-num small { font-size: 13px; font-weight: 600; color: var(--muted); }
.site-thumb { height: 110px; border-radius: 10px; margin-bottom: 12px; display: grid; place-items: center; padding: 12px; text-align: center;
  background: linear-gradient(135deg, #1B1446, var(--c)); color: #fff; font-weight: 800; font-size: 15px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.preview-col { position: sticky; top: calc(var(--top-h) + 12px); }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; color: #fff; margin-bottom: 6px; }
.preview-head .muted { color: var(--on-bg-muted); }
#preview { width: 100%; height: calc(100vh - var(--top-h) - 70px); border: 0; border-radius: 14px; background: #fff; box-shadow: 0 20px 50px rgba(10, 6, 40, .4); }
.block-item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.block-item summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; }
.block-item summary::-webkit-details-marker { display: none; }
.block-item[open] summary { border-bottom: 1px solid var(--line); }
.block-item .grid { padding: 12px; }
.block-item .grid label textarea, .block-item .grid label input { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.block-btns { display: flex; gap: 2px; flex: 0 0 auto; }
#addBlock { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
@media (max-width: 1000px) { .editor-grid { grid-template-columns: 1fr; } .preview-col { position: static; } #preview { height: 70vh; } }

/* ---------- Messenger, Feed y Documentos ---------- */
.im-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  color: #fff; background: linear-gradient(135deg, #8B5CF6, #14B8A6); }
.im-avatar.general { background: linear-gradient(135deg, #F59E0B, #EC4899); font-size: 17px; }
.im-avatar.small { flex-basis: 28px; width: 28px; height: 28px; font-size: 11px; }
.feed { max-width: 760px; }
.post-head { display: flex; gap: 10px; align-items: flex-start; }
.post-head textarea { flex: 1; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; }
.post { margin-bottom: 14px; }
.post-text { white-space: pre-wrap; word-break: break-word; margin: 12px 0; font-size: 15px; }
.post-actions { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.post-actions .liked { color: #6D28D9; }
.comments { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comments li { display: flex; gap: 8px; align-items: flex-start; }
.comment-bubble { background: #F1F5F9; border-radius: 12px; padding: 6px 12px; flex: 1; word-break: break-word; }
.file-btn { cursor: pointer; }

/* ---------- Asistente Conecta ---------- */
.assistant { max-width: 900px; }
.chat-panel { padding: 0; display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 150px); min-height: 420px; overflow: hidden; }
.chat-panel .chat-msgs { background: transparent; }
.ai-welcome { margin: auto; text-align: center; max-width: 520px; padding: 20px; }
.ai-orb { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle at 30% 30%, #C4B5FD, #7C3AED 60%, #14B8A6); box-shadow: 0 10px 30px rgba(124, 58, 237, .45); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.ai-msg.in { background: #F5F3FF; border-color: #DDD6FE; }
.ai-msg.pending .msg-text { color: var(--muted); font-style: italic; }
#aiCfg[hidden] { display: none; }

/* ---------- Sección 11: Kanban estilo flechas ---------- */
.board-wrap { position: relative; padding: 0 20px 20px; }
.board-wrap .board { padding: 0 0 12px; gap: 0; scroll-behavior: smooth; }
.board-scroll {
  position: absolute; top: 4px; z-index: 6; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: #3B0764; font-size: 22px; line-height: 1; box-shadow: 0 6px 18px rgba(10, 6, 40, .35);
}
.board-scroll.left { left: 8px; } .board-scroll.right { right: 8px; }
.board-scroll[hidden] { display: none; }
.board-wrap .column { background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; flex: 0 0 280px; padding: 0 8px; position: relative; }
.board-wrap .column + .column::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px dashed rgba(255, 255, 255, .28); }
.board-wrap .column-head { background: none; border: 0; padding: 0 0 8px; backdrop-filter: none; -webkit-backdrop-filter: none; }
.stage-arrow {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 22px 0 12px; background: var(--stage-color); color: var(--stage-text);
  font-weight: 700; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); border-radius: 6px 0 0 6px;
}
.stage-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-arrow .count { background: rgba(255, 255, 255, .28); color: inherit; border-radius: 999px; padding: 0 8px; font-size: 12px; flex: 0 0 auto; }
.stage-add { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .28); color: inherit; font-weight: 800; cursor: pointer; flex: 0 0 auto; }
.stage-add:hover { background: rgba(255, 255, 255, .5); }
.amount-pill { display: inline-block; margin-top: 8px; background: rgba(255, 255, 255, .9); color: #0F2A4A; font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.column-tools { padding: 0 0 6px; }
.quick-btn { border: 1px dashed rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .1); color: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 700; width: 30px; height: 30px; }
.quick-btn.wide { width: 100%; text-align: left; padding: 0 12px; }
.quick-btn:hover { background: rgba(255, 255, 255, .2); }
.board-wrap .column-body { padding: 0; min-height: 60px; }
.board-wrap .column.drag-over .column-body { border-radius: 10px; }
.board-wrap .empty { color: var(--on-bg-muted); }
.quick-deal { display: flex; flex-direction: column; gap: 6px; cursor: default; }
.quick-deal input { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.quick-deal .actions { margin-top: 4px; justify-content: flex-end; }
.welcome-card { position: relative; cursor: default; border-left: 4px solid #8B5CF6; }
.welcome-card .title { padding-right: 24px; }
.welcome-close { position: absolute; top: 6px; right: 6px; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.source { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 4px; font: inherit; font-size: 11px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.source span { font-size: 18px; }
.source:hover { border-color: #8B5CF6; background: #F5F3FF; }

/* Caja de búsqueda con chip de filtro */
.search-box { position: relative; display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .95); border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 10px; padding: 3px 4px 3px 6px; min-width: min(460px, 100%); flex: 1 1 360px; }
.search-box #search { border: 0; outline: none; background: none; flex: 1; min-width: 120px; padding: 6px 4px; width: auto; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; background: #EDE9FE; color: #3B0764; border-radius: 6px; padding: 3px 4px 3px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.filter-chip button { border: 0; background: none; cursor: pointer; color: #6D28D9; font-size: 12px; padding: 0 2px; }
.preset-toggle { border: 0; background: none; cursor: pointer; color: #6D28D9; font-size: 14px; padding: 4px 6px; }
.preset-menu { left: 0; right: auto; top: calc(100% + 6px); }
.preset-menu button.on { background: #EDE9FE; font-weight: 700; }
.dropdown-title { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: 6px 10px 4px; }

/* Importación */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 8px 0; }
.map-grid label { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.map-col { font-weight: 700; font-size: 13px; display: flex; flex-direction: column; }
.map-col small { font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-grid select, .inline-select select { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 5px; }
.inline-select { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-weight: 600; font-size: 13px; }
.import-dlg h4 { margin: 14px 0 4px; }

/* ---------- Grupos de la barra lateral ---------- */
.side-group-head { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--on-bg-muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-align: left; }
.side-group-head:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-group-head .ic { flex: 0 0 20px; }
.side-group-head .caret { margin-left: auto; transition: transform .2s ease; }
.side-group:not(.open) .side-group-items { display: none; }
.side-group:not(.open) .caret { transform: rotate(-90deg); }
.side-group.open > .side-group-head > .side-count { display: none; }
.side-nav a.in-group { padding-left: 24px; }
body.side-collapsed .side-nav a.in-group { padding-left: 10px; }
body.side-collapsed .side-group-head { justify-content: center; padding: 10px; }

/* ---------- Barra derecha de accesos rápidos ---------- */
.quickbar { position: fixed; right: 0; top: var(--top-h); bottom: 0; z-index: 45; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 0; background: var(--glass-dark); border-left: 1px solid var(--glass-dark-line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.quickbar a { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--on-bg-muted); }
.quickbar a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.quickbar a.active { background: rgba(255, 255, 255, .18); color: #fff; }
.quickbar .side-count { position: absolute; top: -2px; right: -4px; margin: 0; font-size: 10px; padding: 0 5px; }
.main { margin-right: 56px; }
body.login-mode .quickbar { display: none; }

/* ---------- Control de jornada ---------- */
.workday { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1);
  color: #fff; border-radius: 999px; padding: 6px 14px 6px 8px; font: inherit; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.workday .wd-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--on-green); font-size: 11px; }
.workday.running { border-color: rgba(74, 222, 128, .6); background: rgba(74, 222, 128, .15); }
.workday.running .wd-icon { background: #FBBF24; color: #422006; }
.workday:hover { background: rgba(255, 255, 255, .18); }

/* ---------- Empleados, BI, conocimientos y aplicaciones ---------- */
.emp-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.emp-head h3 { margin: 0; }
.emp-head .chip { margin-left: auto; }
.im-avatar.big { flex-basis: 48px; width: 48px; height: 48px; font-size: 16px; }
.emp-card .toolbar { margin-top: 10px; }
.wd-table td, .wd-table th { white-space: nowrap; }
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.bi-grid .panel { margin: 0; }
.bi-card.wide { grid-column: 1 / -1; }
.bi-card .bar-row { grid-template-columns: 150px 1fr auto; }
.kb-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.kb-item { display: block; margin: 0; text-decoration: none; color: inherit; }
.kb-item:hover { box-shadow: 0 0 0 2px #A78BFA; }
.kb-item p { margin: 6px 0; }
.kb-page { max-width: 900px; }
.kb-title { color: var(--navy) !important; margin: 6px 0 2px; font-size: 26px; }
.kb-body { line-height: 1.65; font-size: 15px; word-break: break-word; }
.kb-body h2 { font-size: 20px; color: var(--navy); margin: 18px 0 8px; }
.kb-body h3 { font-size: 16px; color: var(--navy); margin: 14px 0 6px; }
.kb-body blockquote { border-left: 4px solid #A78BFA; margin: 10px 0; padding: 6px 14px; background: #F5F3FF; border-radius: 0 8px 8px 0; }
.kb-body a { color: #6D28D9; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 6px; padding: 6px; background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.rte-toolbar button { min-width: 34px; height: 32px; border: 1px solid transparent; background: none; border-radius: 6px; cursor: pointer; font: inherit; }
.rte-toolbar button:hover { background: #EDE9FE; border-color: #DDD6FE; }
.rte { min-height: 320px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 14px 16px; background: #fff; outline: none; }
.rte:focus { box-shadow: 0 0 0 3px rgba(167, 139, 250, .45); }
.app-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.app-card h3 { margin: 0; }
.app-card.soon { opacity: .75; }
.app-icon { font-size: 30px; }

@media (max-width: 900px) {
  .quickbar { display: none; }
  .main { margin-right: 0; }
  .workday { padding: 4px 10px 4px 4px; }
  .bi-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .topbar .workday { order: 2; } }

/* ---------- Panel del avatar ---------- */
.avatar-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - var(--top-h) - 20px); overflow-y: auto;
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--glass-line); border-radius: 16px; box-shadow: 0 24px 60px rgba(10, 6, 40, .5);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.ap-head { display: flex; align-items: center; gap: 12px; }
.ap-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ap-name { font-weight: 800; font-size: 16px; color: var(--navy); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-name:hover { text-decoration: underline; }
.ap-sub { color: var(--muted); font-size: 12px; }
.role-tag { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: #EDE9FE; color: #5B21B6; white-space: nowrap; }
.role-tag.role-admin { background: #FEE2E2; color: #991B1B; }
.role-tag.role-vendedor { background: #DCFCE7; color: #166534; }
.ap-workday { background: linear-gradient(135deg, #EEF2FF, #F5F3FF); border: 1px solid #E0E7FF; border-radius: 14px; padding: 12px; }
.ap-wd-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ap-wd-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--navy); }
.dot-state { width: 9px; height: 9px; border-radius: 50%; background: #94A3B8; }
.dot-state.s-trabajando { background: #16A34A; box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); }
.dot-state.s-pausa { background: #F59E0B; }
.ap-wd-time { font-size: 26px; font-weight: 800; color: #1E3A8A; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.ap-wd-sched { margin: 2px 0 10px; }
.ap-wd-btn { display: flex; width: 100%; }
.ap-wd-btn > .btn:first-child { flex: 1; justify-content: center; padding: 10px; font-size: 15px; }
.btn.blue { background: #2563EB; color: #fff; }
.btn.blue:hover { background: #1D4ED8; }
.ap-wd-btn .caret { border-left: 1px solid rgba(255, 255, 255, .35); }
.ap-wd-btn .dropdown { left: 0; right: 0; }
.ap-wd-btn .dropdown button[hidden] { display: none; }
.ap-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-card { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; font: inherit; color: var(--text); text-decoration: none; cursor: pointer; }
.ap-card span { font-size: 20px; }
.ap-card small { color: var(--muted); }
.ap-card:hover { border-color: #A78BFA; background: #FAF5FF; }
.ap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ap-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.ap-list li:last-child { border-bottom: 0; }
.ap-list li > button:first-child { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: none; font: inherit; padding: 10px 4px; cursor: pointer; color: var(--text); text-align: left; }
.ap-list li > button:first-child:hover { color: #6D28D9; }
.ap-swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--sw); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); margin-right: 6px; }
.ap-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.ap-pulse b { font-size: 12px; color: var(--navy); }
.ap-pulse-body { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.sec-sessions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; background: #F8FAFC; border-radius: 10px; }
.qr-box { text-align: center; }
.qr-img { width: 240px; height: 240px; margin: 10px auto; display: block; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }
.qr-img.expired { opacity: .2; filter: grayscale(1); }
.install-help ol { padding-left: 20px; line-height: 1.7; }
.theme-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.theme-opt { position: relative; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; font-size: 13px; }
.theme-opt:has(input:checked) { border-color: #7C3AED; box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }
.theme-opt input { position: absolute; opacity: 0; }
.theme-prev { height: 54px; border-radius: 8px; }
.tp-gradient { background: linear-gradient(135deg, #170F3B, #2B1A6E 45%, #173572); }
.tp-dark { background: #0E0F1A; border: 1px solid #262838; }
.tp-light { background: #EEF1F8; border: 1px solid #D5DBE8; }
.accent-opts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 10px; }
.accent { position: relative; cursor: pointer; }
.accent input[type=radio] { position: absolute; opacity: 0; }
.accent span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.accent input:checked + span { box-shadow: 0 0 0 3px #7C3AED; }
.accent.custom input { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.workday.paused { border-color: rgba(251, 191, 36, .6); }

/* ---------- Tema oscuro sólido ---------- */
body[data-theme="dark"] .app-bg { background: #0E0F1A; }
body[data-theme="dark"] .app-bg::after { opacity: 0; }
body[data-theme="dark"] { --glass-dark: rgba(22, 23, 38, .92); }

/* ---------- Tema claro ---------- */
body[data-theme="light"] {
  --glass-dark: rgba(255, 255, 255, .82); --glass-dark-line: rgba(15, 42, 74, .1);
  --on-bg: #0F172A; --on-bg-muted: #475569;
}
body[data-theme="light"] .app-bg { background: linear-gradient(180deg, #EEF1F8, #E4E9F4); }
body[data-theme="light"] .app-bg::after { background-image: radial-gradient(rgba(15, 42, 74, .06) 1px, transparent 1px); }
body[data-theme="light"] .side-brand, body[data-theme="light"] .side-brand .brand-name, body[data-theme="light"] .top-title h2,
body[data-theme="light"] .view-bar h1, body[data-theme="light"] .page > h1, body[data-theme="light"] .funnels-top h1, body[data-theme="light"] .detail-title h1,
body[data-theme="light"] .channels > h1, body[data-theme="light"] .summary b, body[data-theme="light"] .cal-bar .cal-title, body[data-theme="light"] .preview-head { color: #0F172A; }
body[data-theme="light"] .side-brand .brand-name strong { color: #0D9488; }
body[data-theme="light"] .side-nav a:hover, body[data-theme="light"] .side-toggle:hover, body[data-theme="light"] .side-group-head:hover,
body[data-theme="light"] .subnav a:hover, body[data-theme="light"] .quickbar a:hover { background: rgba(15, 42, 74, .06); color: #0F172A; }
body[data-theme="light"] .side-nav a.active, body[data-theme="light"] .subnav a.active, body[data-theme="light"] .quickbar a.active { background: rgba(109, 40, 217, .1); color: #3B0764; }
body[data-theme="light"] .icon-round { background: rgba(15, 42, 74, .06); color: #0F172A; }
body[data-theme="light"] .global-search { background: #fff; border-color: #D5DBE8; color: #64748B; }
body[data-theme="light"] .global-search input { color: #0F172A; }
body[data-theme="light"] .global-search input::placeholder { color: #64748B; }
body[data-theme="light"] .workday { color: #0F172A; background: #fff; border-color: #D5DBE8; }
body[data-theme="light"] .back, body[data-theme="light"] .links a, body[data-theme="light"] .page > p a, body[data-theme="light"] .clear-quick { color: #0D7A6E; }
body[data-theme="light"] .big-amount { color: #0D7A55; }
body[data-theme="light"] .quick-btn { color: #334155; border-color: #B8C4D4; background: rgba(255, 255, 255, .6); }
body[data-theme="light"] .board-wrap .column + .column::before { border-left-color: rgba(15, 42, 74, .18); }
body[data-theme="light"] .counter { color: #0F172A; border-color: #D5DBE8; background: #fff; }
body[data-theme="light"] .counter b { background: #EEF2F7; }
body[data-theme="light"] .counter b.hot { background: var(--coral); color: #fff; }
body[data-theme="light"] .view-tabs { background: #fff; border-color: #D5DBE8; }
body[data-theme="light"] .view-tabs button { color: #475569; }
body[data-theme="light"] .view-tabs button.on { background: #4C1D95; color: #fff; }
body[data-theme="light"] .add-pipeline { color: #475569; border-color: #B8C4D4; }
body[data-theme="light"] .panel, body[data-theme="light"] .tile { box-shadow: 0 6px 20px rgba(15, 42, 74, .08); }
.avatar-panel { background: rgba(255, 255, 255, .97); }

/* Barra lateral compacta: ☰ visible también en escritorio y nombres como tooltip */
.menu-btn { display: grid; }
body.side-collapsed .side-nav [data-tip], body.side-collapsed .side-group-head[data-tip] { position: relative; }
body.side-collapsed .side-nav [data-tip]:hover::after, body.side-collapsed .side-nav [data-tip]:focus-visible::after {
  content: attr(data-tip); position: fixed; left: calc(var(--side-w-collapsed) + 6px); margin-top: -2px; z-index: 90;
  background: #0F172A; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35); pointer-events: none;
}
body.side-collapsed .side-group:not(.open) .side-group-items { display: none; }
body.side-collapsed .side-group.open .side-group-items a { padding-left: 10px; }
body[data-theme="light"].side-collapsed .side-nav [data-tip]:hover::after { background: #1E293B; }
body[data-theme="light"] .sidebar { color: #0F172A; }
.preset-actions { display: flex; flex-direction: column; gap: 6px; }
.preset-actions .btn { text-align: left; }
.proc-icon { font-size: 30px; }
.stage-dots { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.proc-card .toolbar { margin-top: 6px; }

/* ===== Sección 12: menú Ventas, facturas y cotizaciones ===== */
.subnav-drop { position: relative; display: inline-flex; }
.subnav-drop > button { font: inherit; border: 0; cursor: pointer; background: transparent; color: rgba(255, 255, 255, .78); padding: 7px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.subnav-drop > button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.subnav-drop > button.active, .subnav-drop > button[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, .18); }
.subnav-menu { position: fixed; z-index: 60; min-width: 280px; max-width: calc(100vw - 16px); background: rgba(255, 255, 255, .98); border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 23, 42, .28); padding: 6px; display: grid; }
.subnav-menu[hidden] { display: none; }
.subnav-menu a { display: flex; gap: 10px; align-items: center; color: #1E293B; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.subnav-menu a span { width: 20px; text-align: center; }
.subnav-menu a:hover, .subnav-menu a:focus-visible { background: #F1F5F9; }
.subnav-menu a.active { background: #EDE9FE; color: #4C1D95; font-weight: 600; }
body[data-theme="dark"] .subnav-menu { background: #1E1B2E; }
body[data-theme="dark"] .subnav-menu a { color: #E2E8F0; }
body[data-theme="dark"] .subnav-menu a:hover { background: rgba(255, 255, 255, .08); }
body[data-theme="light"] .subnav-drop > button { color: #334155; }
body[data-theme="light"] .subnav-drop > button.active { background: rgba(109, 40, 217, .1); color: #3B0764; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); white-space: nowrap; }
.billing-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi-mini { background: rgba(255, 255, 255, .94); border-radius: 12px; padding: 10px 14px; border-left: 4px solid var(--c); display: grid; gap: 2px; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.kpi-mini span { font-size: 12px; color: #64748B; }
.kpi-mini b { font-size: 20px; color: #0F172A; }
.kpi-mini small { color: #475569; }
.billing-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.bk-col { background: rgba(255, 255, 255, .55); border-radius: 12px; min-height: 260px; display: flex; flex-direction: column; }
.bk-col header { background: var(--c); color: #fff; border-radius: 12px 12px 0 0; padding: 9px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bk-col header span { opacity: .92; white-space: nowrap; }
.bk-cards { padding: 8px; display: grid; gap: 8px; align-content: start; flex: 1; }
.bk-card { display: grid; gap: 3px; background: #fff; border-radius: 10px; padding: 10px 12px; color: #1E293B; text-decoration: none; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); border-left: 3px solid var(--c); cursor: grab; }
.bk-card:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, .16); }
.bk-num { font-size: 12px; color: #64748B; font-weight: 600; }
.bk-total { font-weight: 800; }
.doc-actions { flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.doc-totals { margin: 12px 0 0 auto; max-width: 320px; display: grid; gap: 2px; }
.doc-totals div { display: flex; justify-content: space-between; padding: 3px 6px; }
.doc-totals .grand { font-weight: 800; font-size: 17px; border-top: 2px solid #1E293B; margin-top: 4px; padding-top: 6px; }
.doc-totals .balance { font-weight: 700; color: #B45309; }
.plain-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 6px; }
.plain-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bill-list .num { margin-left: auto; }
.copy-field { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid #CBD5E1; border-radius: 8px; background: #F8FAFC; }
.sales-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 12px 0; }
.sales-card { display: grid; gap: 8px; align-content: start; }
.sales-card h3 { margin: 0; }
.sc-icon { font-size: 28px; }
.sc-status { display: flex; flex-wrap: wrap; gap: 6px; }
.conn { font-size: 12px; border-radius: 999px; padding: 2px 9px; background: #F1F5F9; color: #64748B; }
.conn.ok { background: #DCFCE7; color: #166534; font-weight: 600; }
.method-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.method-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 10px; }
.pre { white-space: pre-wrap; }
.script-text { white-space: pre-wrap; background: #F8FAFC; border-left: 3px solid #7C3AED; border-radius: 8px; padding: 10px 12px; font-size: 14px; max-height: 220px; overflow: auto; }
.script-stage span { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.script-stage .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.call-analysis { background: #F8FAFC; border-radius: 10px; padding: 12px; font-size: 14px; line-height: 1.5; margin-top: 8px; }
.ai-status { display: block; }
.ai-result { margin: 8px 0; }
.tl-call details summary { cursor: pointer; font-weight: 600; }
@media (max-width: 700px) {
  .billing-kanban { grid-auto-columns: 82%; }
  .doc-totals { max-width: none; }
  .method-list li { flex-direction: column; }
}

/* ===== Análisis de ventas (CRM) ===== */
.bi-preset { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; margin-bottom: 14px; }
.bi-preset > div { flex: 1; }
.sbi-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 14px; }
.sbi-filters label { display: grid; gap: 4px; font-size: 12.5px; color: #475569; min-width: 150px; }
.sbi-filters label[hidden] { display: none; }
.sbi-range { margin-left: auto; align-self: center; }
.sbi-mine { align-self: center; }
.sbi-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sbi-kpi { text-align: left; font: inherit; cursor: pointer; border: 0; background: rgba(255, 255, 255, .96); border-radius: 12px; padding: 12px 14px; border-top: 4px solid var(--c); display: grid; gap: 2px; box-shadow: 0 4px 14px rgba(15, 23, 42, .1); color: #0F172A; }
.sbi-kpi:hover, .sbi-kpi:focus-visible { box-shadow: 0 8px 20px rgba(15, 23, 42, .18); outline: none; }
.sbi-kpi span { font-size: 12.5px; color: #475569; }
.sbi-kpi b { font-size: 22px; }
.sbi-kpi small { color: #64748B; }
.sbi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.sbi-card.wide { grid-column: 1 / -1; }
.sbi-card h3 { margin: 0 0 6px; }
.sbi-card h4 { margin: 14px 0 6px; font-size: 13px; color: #475569; }
.sbi-bars { display: grid; gap: 6px; }
.sbi-bar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; font: inherit; font-size: 13px; color: #1E293B; background: transparent; border: 0; padding: 3px 4px; border-radius: 8px; text-align: left; cursor: pointer; }
.sbi-bar.static { cursor: default; }
.sbi-bar:not(.static):hover, .sbi-bar:focus-visible { background: #F1F5F9; outline: none; }
.sbi-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbi-track { height: 16px; background: #EEF2F7; border-radius: 6px; overflow: hidden; display: flex; }
.sbi-fill { display: block; height: 100%; border-radius: 6px; }
.sbi-seg { border: 0; padding: 0; height: 100%; cursor: pointer; display: block; }
.sbi-seg + .sbi-seg { box-shadow: inset 2px 0 0 #fff; }
.sbi-seg:hover, .sbi-seg:focus-visible { filter: brightness(1.12); outline: none; }
.sbi-val { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sbi-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: #475569; margin-bottom: 6px; }
.sbi-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sbi-svg { width: 100%; height: auto; max-height: 280px; display: block; }
.sbi-svg .sbi-axis { font-size: 11px; fill: #64748B; }
.sbi-svg .sbi-num { font-size: 10.5px; fill: #1E293B; font-weight: 700; }
.sbi-col { cursor: pointer; }
.sbi-col:hover { filter: brightness(1.15); }
.sbi-stack-total { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: #EEF2F7; margin: 6px 0 10px; }
.sbi-inv-nums { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.sbi-drill .table-wrap { max-height: 60vh; overflow: auto; }
body[data-theme="dark"] .sbi-kpi { background: #1E1B2E; color: #F1F5F9; }
body[data-theme="dark"] .sbi-kpi span, body[data-theme="dark"] .sbi-kpi small { color: #CBD5E1; }
@media (max-width: 700px) {
  .sbi-grid { grid-template-columns: 1fr; }
  .sbi-bar { grid-template-columns: minmax(70px, 34%) 1fr auto; }
  .sbi-range { margin-left: 0; }
}
@media print {
  #sidebar, #topbar, .quickbar, .sbi-noprint, #sideBackdrop, .toast { display: none !important; }
  body, .app, main, #view { background: #fff !important; }
  .sales-bi .panel, .sbi-kpi { box-shadow: none !important; border: 1px solid #CBD5E1; break-inside: avoid; }
  .sbi-filters select, .sbi-filters input { border: 0; appearance: none; background: transparent; }
  .sbi-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Menú superior personalizable y "Más" ===== */
@media (min-width: 901px) {
  .top-title:has(.subnav.custom) { flex-wrap: nowrap; }
  .subnav.custom { flex-wrap: nowrap; flex: 1; min-width: 0; overflow: hidden; align-items: center; }
}
.subnav-more .subnav-menu { min-width: 260px; max-height: min(70vh, 560px); overflow: auto; }
.more-head, .more-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #64748B; padding: 8px 12px 4px; }
.more-row { display: flex; align-items: center; gap: 6px; }
.more-row > a { flex: 1; }
.more-group a.sub { padding-left: 22px; }
.more-sep { height: 1px; background: #E2E8F0; margin: 6px 4px; }
.more-overflow:empty { display: none; }
.more-show { font: inherit; font-size: 12px; border: 1px solid #C4B5FD; color: #4C1D95; background: #F5F3FF; border-radius: 999px; padding: 3px 10px; cursor: pointer; margin-right: 6px; }
.more-action { font: inherit; font-size: 14px; text-align: left; border: 0; background: transparent; color: #1E293B; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.more-action:hover { background: #F1F5F9; }
.more-action.primary { color: #166534; font-weight: 700; }
.nav-item.editing { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 13px; padding: 5px 8px 5px 6px; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); cursor: grab; white-space: nowrap; user-select: none; }
.nav-item.editing:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.nav-item .grip { opacity: .7; letter-spacing: -2px; }
.nav-item.dragging { opacity: .45; }
.nav-item.drop-before { box-shadow: -3px 0 0 var(--green); }
.nav-item.drop-after { box-shadow: 3px 0 0 var(--green); }
.nav-hide { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 13px; padding: 0 2px; line-height: 1; }
.nav-hide:hover { color: #FCA5A5; }
.nav-editing-hint { color: rgba(255, 255, 255, .7); font-size: 12px; white-space: nowrap; margin-left: 6px; }
.subnav.custom.editing { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
.nav-finish { font: inherit; font-size: 12.5px; font-weight: 700; border: 0; border-radius: 999px; padding: 5px 12px; background: var(--green); color: var(--on-green); cursor: pointer; margin-left: 6px; }
body[data-theme="light"] .nav-item.editing { color: #1E293B; border-color: #94A3B8; background: #fff; }
body[data-theme="light"] .nav-editing-hint { color: #475569; }
/* Mis actividades */
.my-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.my-group h3 { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.my-group .count { font-size: 12px; background: #EEF2F7; border-radius: 999px; padding: 1px 9px; color: #334155; }
.my-group.overdue h3 { color: #B91C1C; }
.my-group.today h3 { color: #1D4ED8; }
.my-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.my-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #E2E8F0; border-radius: 10px; }
.my-item.done .my-body b { text-decoration: line-through; color: #64748B; }
.my-check { width: 18px; height: 18px; accent-color: #16A34A; flex: none; }
.my-body { flex: 1; display: grid; min-width: 0; }
/* Historial y papelera */
.data.hist td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.changes .old { color: #B91C1C; text-decoration: line-through; }
.changes .new { color: #15803D; font-weight: 600; }
.trash-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.settings-card { text-decoration: none; color: inherit; }
.settings-card:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, .18); }
@media (min-width: 901px) {
  .topbar:has(.subnav.custom) .global-search { flex: 0 1 240px; }
  .topbar:has(.subnav.custom) .global-search:focus-within { flex-basis: 340px; }
}

/* ===== Panel CRM Analytics ===== */
body.cra-open { overflow: hidden; }
.cra { position: fixed; top: 0; bottom: 0; right: 0; left: calc(var(--side-w-collapsed, 72px) - 8px); z-index: 65; display: grid; grid-template-columns: 240px minmax(0, 1fr);
  background: #EEF1F6; border-radius: 22px 0 0 0; box-shadow: -20px 0 60px rgba(5, 3, 30, .45); color: #1E293B; animation: craIn .22s ease; }
@keyframes craIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cra-close { position: absolute; left: -46px; top: 18px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #3B82F6; color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.cra-nav { background: #fff; border-radius: 22px 0 0 0; padding: 22px 12px; overflow-y: auto; }
.cra-nav h2 { margin: 0 12px 16px; font-size: 20px; color: #0F172A; }
.cra-nav-select { display: none; }
.cra-links { display: grid; gap: 2px; }
.cra-links a { text-decoration: none; color: #334155; padding: 8px 12px; border-radius: 999px; font-size: 14px; line-height: 1.3; }
.cra-links a.cra-i { padding-left: 26px; }
.cra-links .cra-g.head { color: #0F172A; font-weight: 600; padding: 12px 12px 6px; font-size: 14px; }
.cra-links a:hover { background: #F1F5F9; }
.cra-links a.on { background: #2563EB; color: #fff; font-weight: 600; }
.cra-main { overflow-y: auto; padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 14px; }
.cra-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cra-top h1 { margin: 0; font-size: 24px; font-weight: 500; color: #0F172A; }
.cra-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cra-chip { display: inline-flex; align-items: center; gap: 6px; background: #DBEAFE; border-radius: 8px; padding: 2px 8px; }
.cra-chip select { border: 0; background: transparent; font: inherit; font-size: 14px; padding: 6px 2px; color: #1E3A8A; font-weight: 600; }
#craSearch { flex: 1 1 220px; border: 0; background: transparent; font: inherit; font-size: 14px; padding: 8px; outline: none; }
.cra-card h3 { margin: 0; font-weight: 500; font-size: 17px; }
.cra-card { display: grid; gap: 12px; }
.cra-funnel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cra-conv { text-align: right; } .cra-conv small { display: block; color: #64748B; } .cra-conv b { font-size: 30px; font-weight: 400; }
.cra-owner { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #475569; }
.cra-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(72px, 1fr); gap: 8px; align-items: end; min-height: 230px; border-left: 1px solid #CBD5E1; border-bottom: 1px solid #CBD5E1; padding: 8px 8px 0; overflow-x: auto; }
.cra-col { display: grid; grid-template-rows: auto 170px auto; gap: 6px; border: 0; background: transparent; cursor: pointer; padding: 0; font: inherit; color: #1E293B; }
.cra-col:hover .cra-col-bar span, .cra-col:focus-visible .cra-col-bar span { filter: brightness(1.12); }
.cra-col-val { font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; }
.cra-col-bar { display: flex; align-items: flex-end; height: 170px; }
.cra-col-bar span { display: block; width: 100%; border-radius: 6px 6px 0 0; }
.cra-col-label { font-size: 12.5px; text-align: center; color: #475569; padding-bottom: 6px; overflow-wrap: anywhere; }
.cra-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cra-kpi { text-align: left; font: inherit; border: 1px solid #E2E8F0; background: #fff; border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; cursor: pointer; color: #0F172A; }
.cra-kpi[disabled] { cursor: default; opacity: 1; }
.cra-kpi span { font-weight: 600; font-size: 14px; } .cra-kpi b { font-size: 26px; font-weight: 400; } .cra-kpi small { color: #64748B; }
.cra-table td.cra-empty { text-align: center; padding: 40px 10px; color: #94A3B8; font-size: 16px; }
.cra-table td.cra-empty span { font-size: 48px; }
.cra-table .up { color: #15803D; font-weight: 700; } .cra-table .down { color: #B91C1C; font-weight: 700; }
.cra-prog { display: inline-block; width: 140px; max-width: 100%; height: 10px; background: #E2E8F0; border-radius: 999px; overflow: hidden; vertical-align: middle; }
.cra-prog span { display: block; height: 100%; background: #16A34A; }
.cra-goal { width: 130px; text-align: right; }
.cra-steps { padding-left: 20px; display: grid; gap: 6px; }
@media (max-width: 900px) {
  .cra { left: 0; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: auto 1fr; top: 0; z-index: 75; }
  .cra-close { left: auto; right: 10px; top: 8px; width: 44px; height: 44px; }
  .cra-nav { border-radius: 0; padding: 12px 64px 12px 12px; overflow: visible; }
  .cra-nav h2 { margin: 6px 4px 10px; font-size: 18px; }
  .cra-links { display: none; }
  .cra-nav-select { display: block; width: 100%; }
  .cra-main { padding: 14px 12px 32px; }
  .cra-col-val, .cra-col-label { font-size: 14px; }
  .cra-cols { grid-auto-columns: 96px; }
}

/* ===== Papelera de reciclaje ===== */
.trash-bar { align-items: center; gap: 16px; }
.trash-search { position: relative; display: flex; align-items: center; gap: 6px; flex: 1 1 420px; max-width: 760px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); border-radius: 12px; padding: 4px 10px 4px 4px; }
.trash-chip { display: inline-flex; align-items: center; gap: 10px; max-width: 60%; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .22); color: #fff; font: inherit; font-size: 15px; padding: 7px 12px; cursor: pointer; }
.trash-chip span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-chip .x { opacity: .85; padding: 0 2px; }
#trashQ { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: 15px; padding: 8px 6px; outline: none; }
#trashQ::placeholder { color: rgba(255, 255, 255, .7); }
.trash-ic { color: rgba(255, 255, 255, .8); }
.trash-types { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; background: #fff; color: #1E293B; border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 23, 42, .3); padding: 10px 14px; display: grid; gap: 4px; min-width: 240px; }
.trash-types[hidden] { display: none; }
.trash-types .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.trash-note { text-align: right; margin: 0 0 12px; font-size: 14px; }
.trash-note .link { color: #fff; text-decoration: underline; }
.trash-panel { border-radius: 16px; overflow: hidden; }
.trash-table th { font-weight: 500; color: #334155; font-size: 15px; padding: 16px 12px; }
.trash-table td { padding: 12px; }
.trash-table .cb { width: 44px; text-align: center; }
.trash-table tr.sel td { background: #EFF6FF; }
.trash-empty { text-align: center; padding: 50px 10px 60px !important; color: #CBD5E1; font-size: 34px; font-weight: 300; }
.trash-empty-ic { font-size: 72px; line-height: 1; margin-bottom: 18px; color: #D7DDE6; }
.trash-bulk { position: sticky; bottom: 12px; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; color: #1E293B; border-radius: 14px; padding: 10px 14px; box-shadow: 0 12px 30px rgba(15, 23, 42, .25); }
.trash-bulk[hidden] { display: none; }
body[data-theme="light"] .trash-search { background: #fff; border-color: #CBD5E1; }
body[data-theme="light"] .trash-chip { background: #DBEAFE; color: #1E3A8A; }
body[data-theme="light"] #trashQ { color: #0F172A; }
body[data-theme="light"] #trashQ::placeholder, body[data-theme="light"] .trash-ic { color: #64748B; }
body[data-theme="light"] .trash-note .link { color: inherit; }
@media (max-width: 640px) {
  .trash-search { flex-basis: 100%; }
  .trash-chip { max-width: 55%; }
  .trash-note { text-align: left; }
}

/* ===== Reserva online: encabezado, herramientas, mini calendario y paneles ===== */
.ag-bar { align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.ag-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ag-title h1 { margin: 0; }
.ag-date { color: rgba(255, 255, 255, .78); font-size: 26px; font-weight: 300; text-transform: capitalize; }
.ag-stats { display: grid; gap: 2px; color: #fff; font-size: 15px; }
.ag-stats span { border-bottom: 1px dashed rgba(255, 255, 255, .55); width: max-content; }
.ag-filter { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 380px; }
.ag-filter input { width: 100%; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 10px; padding: 10px 40px 10px 14px; font: inherit; font-size: 15px; }
.ag-filter input::placeholder { color: rgba(255, 255, 255, .75); }
.ag-filter span { position: absolute; right: 12px; opacity: .8; pointer-events: none; }
.ag-flags { display: inline-flex; gap: 2px; background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 3px; margin-left: auto; }
.ag-flags button { border: 0; background: none; color: #fff; font: inherit; font-size: 15px; padding: 7px 12px; border-radius: 9px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.ag-flags button b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 13px; }
.ag-flags button.on { background: rgba(255, 255, 255, .24); }
.ag-shell { position: relative; overflow: hidden; border-radius: 18px; background: #fff; }
.ag-shell.ag-maxed { position: fixed; inset: 0; z-index: 90; border-radius: 0; }
.ag-shell:fullscreen { background: #fff; overflow: auto; }
.ag-tools { border-bottom: 1px solid #E2E8F0; }
.ag-tool-row { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 56px; padding: 6px 12px 6px 0; }
.ag-tool-row + .ag-tool-row { border-top: 1px solid #EEF2F7; min-height: 48px; }
.ag-tool-row > .ag-ico:first-child { width: 64px; align-self: stretch; border-radius: 0; background: #F8FAFC; color: #2563EB; font-size: 18px; }
.ag-ico { border: 0; background: transparent; color: #64748B; font: inherit; font-size: 16px; min-width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; }
.ag-ico:hover { background: #F1F5F9; color: #1E293B; }
.ag-add { border: 0; background: #F0F9FF; color: #475569; font: inherit; font-size: 16px; padding: 10px 18px 10px 10px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; }
.ag-add .plus { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #DBEAFE; color: #2563EB; font-size: 20px; }
.ag-add:hover { background: #E0F2FE; }
.ag-add-pkg { border: 0; background: none; color: #475569; font: inherit; font-size: 15px; cursor: pointer; padding: 8px 4px; }
.ag-add-pkg:hover { color: #2563EB; }
.ag-pkg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #CBD5E1; background: #fff; color: #1E293B; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.ag-pkg.on { background: #2563EB; color: #fff; border-color: #2563EB; }
.ag-pkg .x { opacity: .6; margin-left: 2px; }
.ag-nav { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ag-filter-pop { position: absolute; left: 12px; top: calc(100% + 4px); z-index: 20; background: #fff; border-radius: 14px; box-shadow: 0 18px 40px rgba(15, 23, 42, .25); padding: 12px 16px; display: grid; gap: 6px; min-width: 260px; color: #1E293B; }
.ag-filter-pop[hidden] { display: none; }
.ag-filter-pop hr { border: 0; border-top: 1px solid #E2E8F0; margin: 6px 0; width: 100%; }
.ag-pkg-pop { min-width: 320px; }
.ag-pkg-pop .check { font-size: 15px; }
.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.ag-layout .agenda { border-radius: 0; max-height: calc(100vh - 300px); overflow: auto; }
.ag-body { position: relative; }
.ag-now { position: absolute; left: 56px; right: 0; height: 0; border-top: 2px solid #F87171; z-index: 4; pointer-events: none; }
.ag-now span { position: absolute; left: -54px; top: -10px; background: #fff; color: #DC2626; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.agenda.filtering .ag-block[data-id]:not(.match) { opacity: .22; }
.agenda.filtering .ag-block.match { box-shadow: 0 0 0 2px #2563EB; }
.ag-cal { position: sticky; top: 0; margin: 12px; border: 1px solid #E2E8F0; border-radius: 14px; padding: 10px; background: #fff; }
.mc-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.mc-head b { font-weight: 500; font-size: 16px; color: #1E293B; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-grid span { font-size: 12px; color: #94A3B8; padding: 4px 0; }
.mc-grid button { position: relative; border: 0; background: none; font: inherit; font-size: 14px; color: #1E293B; aspect-ratio: 1; border-radius: 50%; cursor: pointer; }
.mc-grid button:hover { background: #F1F5F9; }
.mc-grid button.we { color: #EF4444; }
.mc-grid button.out { color: #CBD5E1; }
.mc-grid button.today { background: #0EA5E9; color: #fff; }
.mc-grid button.sel:not(.today) { box-shadow: inset 0 0 0 2px #0EA5E9; }
.mc-grid button.has::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #16A34A; }
.mc-grid button.today.has::after { background: #fff; }
.ag-zoom { position: absolute; left: 76px; bottom: 14px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(15, 23, 42, .12); }
.ag-zoom .link { border-bottom: 1px dashed #94A3B8; color: #64748B; padding: 0 4px; }
.ag-zoom-val { color: #64748B; font-size: 14px; min-width: 46px; text-align: center; }
body[data-theme="light"] .ag-date { color: #475569; }
body[data-theme="light"] .ag-stats { color: #0F172A; }
body[data-theme="light"] .ag-filter input { background: #fff; color: #0F172A; border-color: #CBD5E1; }
body[data-theme="light"] .ag-filter input::placeholder { color: #64748B; }
body[data-theme="light"] .ag-flags { background: #E2E8F0; }
body[data-theme="light"] .ag-flags button { color: #0F172A; }

/* Panel lateral (Nuevo recurso) */
body.sheet-open { overflow: hidden; }
.side-sheet { position: fixed; inset: 0; z-index: 85; background: rgba(8, 6, 40, .55); display: flex; justify-content: flex-end; animation: sheetFade .18s ease; }
@keyframes sheetFade { from { opacity: 0; } to { opacity: 1; } }
.sheet-box { position: relative; width: min(940px, calc(100vw - 80px)); height: 100%; overflow-y: auto; background: #EEF2F7; border-radius: 26px 0 0 0; padding: 22px 28px 40px; color: #1E293B; animation: sheetIn .22s ease; }
@keyframes sheetIn { from { transform: translateX(60px); } to { transform: none; } }
.sheet-close { position: absolute; left: -62px; top: 26px; width: 54px; height: 54px; border: 0; border-radius: 27px 0 0 27px; background: #3B82F6; color: #fff; font-size: 20px; cursor: pointer; }
.sheet-box h1 { margin: 0 0 18px; font-size: 32px; font-weight: 300; color: #0F172A; }
.sheet-box h1 small { font-size: 18px; color: #64748B; }
.sheet-card { background: #fff; border-radius: 16px; overflow: hidden; }
.sheet-intro { background: #F8FAFC; padding: 26px 30px; }
.sheet-intro h2 { margin: 0 0 10px; font-weight: 500; font-size: 24px; }
.sheet-intro p { margin: 0; font-size: 17px; color: #334155; }
.sector-list { list-style: none; margin: 0; padding: 12px 16px 16px; }
.sector-list li + li { border-top: 1px solid #E2E8F0; }
.sector-list button { width: 100%; display: flex; align-items: center; gap: 22px; padding: 16px 18px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; border-radius: 14px; color: #1E293B; }
.sector-list button:hover, .sector-list button:focus-visible { background: #F0F9FF; outline: none; }
.sector-ic { flex: none; width: 56px; height: 56px; display: grid; place-items: center; font-size: 30px; color: #0EA5E9; }
.sector-txt { flex: 1; display: grid; gap: 2px; }
.sector-txt b { font-weight: 500; font-size: 19px; }
.sector-txt small { color: #64748B; font-size: 15px; }
.sector-go { color: #94A3B8; font-size: 22px; }
.sector-list button:hover .sector-go { color: #0EA5E9; }
.sheet-form { padding: 22px 26px; display: grid; gap: 14px; }
.sugg { display: grid; gap: 6px; }

@media (max-width: 900px) {
  .ag-layout { grid-template-columns: minmax(0, 1fr); }
  .ag-cal { position: static; order: -1; }
  .ag-layout .agenda { max-height: none; }
  .ag-date { font-size: 20px; }
  .ag-flags { margin-left: 0; }
  .ag-zoom { position: static; margin: 10px 12px; }
  .ag-tool-row > .ag-ico:first-child { width: 48px; }
  .mc-grid span { font-size: 14px; }
  .sheet-box { width: 100%; border-radius: 0; padding: 16px 14px 32px; }
  .sheet-close { left: auto; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%; }
  .sheet-box h1 { font-size: 24px; padding-right: 56px; }
  .sector-list button { gap: 12px; padding: 12px 8px; }
  .sector-ic { width: 44px; height: 44px; font-size: 24px; }
  .sector-txt b { font-size: 17px; }
  .sheet-intro { padding: 18px; }
}

/* Reservas: colores por estado (verde confirmada, azul sin confirmar, naranja con franjas = llega tarde) */
.ag-block.s-confirmada { background: #DCFCE7; border-left-color: #16A34A; }
.ag-block.s-confirmada .ag-status { color: #15803D; }
.ag-block.s-pendiente { background: #DBEAFE; border-left-color: #2563EB; }
.ag-block.s-pendiente .ag-status { color: #1D4ED8; }
.ag-block.late { background: repeating-linear-gradient(135deg, #FED7AA, #FED7AA 8px, #FFEDD5 8px, #FFEDD5 16px); border-left-color: #EA580C; }
.ag-block.late .ag-status::after { content: ' · con retraso'; color: #C2410C; }
.ag-flags button b { background: rgba(255, 255, 255, .22); }
.ag-flags button b.hot { background: #EF4444; }
/* Cabecera de recurso con batería de ocupación e ingresos */
.ag-colhead { display: flex; align-items: center; gap: 8px; justify-content: flex-start; text-align: left; }
.ag-colname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ag-colinc { font-size: 12.5px; color: #15803D; font-weight: 700; border: 1px solid #BBF7D0; background: #F0FDF4; border-radius: 6px; padding: 1px 6px; }
.ag-batt { position: relative; flex: none; width: 24px; height: 12px; border: 2px solid #94A3B8; border-radius: 3px; padding: 0; background: #fff; cursor: help; }
.ag-batt::after { content: ''; position: absolute; right: -5px; top: 2px; width: 3px; height: 4px; border-radius: 0 2px 2px 0; background: #94A3B8; }
.ag-batt span { display: block; height: 100%; background: #22C55E; }
.ag-batt.mid span { background: #EAB308; }
.ag-batt.full span { background: #EF4444; }
/* Filtro de recursos */
.fp-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-top: 4px; font-size: 13px; color: #475569; }
.fp-head .link { font-size: 12.5px; }
.fp-search { width: 100%; padding: 8px 10px; border: 1px solid #CBD5E1; border-radius: 8px; font: inherit; }
.fp-list { display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.fp-list label[hidden] { display: none; }
.fp-reset { justify-self: center; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #64748B; margin-top: 6px; }
/* Lista de espera */
.ag-side { display: grid; gap: 0; align-content: start; }
.ag-wait { margin: 0 12px 12px; border: 1px solid #E2E8F0; border-radius: 14px; padding: 10px 12px; background: #fff; }
.aw-head { display: flex; align-items: center; gap: 8px; }
.aw-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; background: #E2E8F0; font-size: 12px; font-weight: 700; }
.aw-add { margin-left: auto; border: 0; background: #DBEAFE; color: #1D4ED8; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.aw-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.aw-list li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; border-top: 1px solid #EEF2F7; padding-top: 8px; }
.aw-list li > div { display: grid; min-width: 0; }
.aw-list small { color: #475569; }
.aw-acts { display: inline-flex; gap: 4px; align-items: center; }
.aw-empty { margin: 8px 0 2px; }
@media (max-width: 900px) { .ag-colinc { font-size: 14px; } .ag-wait { margin: 0 12px 12px; } }

/* ===== Messenger ===== */
.im-wrap { display: grid; grid-template-columns: 100px 340px minmax(0, 1fr); height: calc(100vh - var(--top-h) - 24px); margin: 12px 20px; border-radius: 20px; overflow: hidden; background: #fff; color: #1E293B; box-shadow: 0 12px 40px rgba(10, 6, 40, .3); }
.im-rail { background: #F8FAFC; border-right: 1px solid #E2E8F0; display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; overflow-y: auto; }
.im-rail button { display: grid; justify-items: center; gap: 4px; border: 0; background: none; font: inherit; font-size: 12.5px; color: #475569; padding: 10px 4px; border-radius: 14px; cursor: pointer; text-align: center; line-height: 1.2; }
.im-rail button span { font-size: 22px; }
.im-rail button:hover { background: #EEF2F7; }
.im-rail button.on { background: #E0F2FE; color: #0369A1; font-weight: 600; }
.im-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #E2E8F0; }
.im-search { display: flex; gap: 8px; padding: 14px 14px 8px; }
.im-q { flex: 1; display: flex; align-items: center; gap: 8px; background: #F1F5F9; border-radius: 999px; padding: 0 14px; }
.im-q input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; padding: 10px 0; outline: none; }
.im-new { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #E0F2FE; color: #0369A1; font-size: 18px; cursor: pointer; }
.im-new:hover { background: #BAE6FD; }
.im-tabs { display: flex; gap: 8px; padding: 4px 14px 10px; border-bottom: 1px solid #EEF2F7; }
.im-tabs button { border: 1px solid #CBD5E1; background: #fff; color: #475569; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.im-tabs button.on { border-color: #0EA5E9; color: #0369A1; background: #F0F9FF; }
.im-chats { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.im-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; cursor: pointer; }
.im-item:hover, .im-item:focus-visible { background: #F1F5F9; outline: none; }
.im-item.on { background: #0EA5E9; color: #fff; }
.im-item.on .im-text, .im-item.on .im-top span { color: rgba(255, 255, 255, .88); }
.im-main { flex: 1; min-width: 0; }
.im-top { display: flex; justify-content: space-between; gap: 8px; }
.im-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.im-top span { color: #94A3B8; font-size: 12.5px; flex: none; }
.im-text { color: #64748B; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.im-item.unread .im-top b { font-weight: 800; }
.im-none { padding: 20px; text-align: center; }
.im-avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #8B5CF6; color: #fff; font-weight: 700; font-size: 17px; }
.im-avatar.im-notes { background: #0EA5E9; font-size: 22px; }
.im-avatar.im-news { background: #22C55E; border-radius: 14px; font-size: 24px; }
.im-avatar.im-general { background: #06B6D4; border-radius: 14px; font-size: 24px; }
.im-chat { display: flex; flex-direction: column; min-height: 0; background: linear-gradient(160deg, #BAE6FD, #DDD6FE); }
.im-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #fff; border-bottom: 1px solid #E2E8F0; }
.im-head .chat-who { flex: 1; display: grid; min-width: 0; }
.im-head .chat-who b { font-size: 17px; color: #0F172A; }
.im-find { display: flex; align-items: center; gap: 6px; background: #F1F5F9; border-radius: 999px; padding: 0 12px; }
.im-find input { border: 0; background: transparent; font: inherit; font-size: 14px; padding: 8px 0; width: 160px; outline: none; }
.im-msgs { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 8px; }
.im-msgs .msg { max-width: min(680px, 80%); background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); align-self: flex-start; }
.im-msgs .msg.out { align-self: flex-end; background: #DCFCE7; }
.im-msgs .msg.hit { box-shadow: 0 0 0 2px #0EA5E9; }
.im-msgs .msg.dim { opacity: .35; }
.msg-from { display: block; color: #0369A1; font-size: 14px; margin-bottom: 2px; }
.im-msgs .msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.im-msgs .msg-meta { text-align: right; color: #94A3B8; font-size: 12px; }
.im-day { align-self: center; background: rgba(255, 255, 255, .7); color: #475569; border-radius: 999px; padding: 3px 14px; font-size: 13px; text-transform: capitalize; }
.im-compose { display: flex; gap: 10px; align-items: flex-end; margin: 0 18px 16px; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .1); }
.im-compose textarea { flex: 1; border: 0; resize: none; font: inherit; font-size: 15px; outline: none; min-height: 44px; }
.im-send { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #0EA5E9; color: #fff; font-size: 18px; cursor: pointer; }
.im-send:hover { background: #0284C7; }
.im-readonly { margin: 0 18px 16px; text-align: center; background: rgba(255, 255, 255, .8); border-radius: 14px; padding: 12px; color: #475569; }
.im-empty { margin: auto; text-align: center; color: #475569; padding: 30px; }
.im-empty > span { font-size: 48px; }
.im-pick { list-style: none; margin: 10px 0; padding: 0; max-height: 50vh; overflow-y: auto; display: grid; gap: 4px; }
.im-pick li[hidden] { display: none; }
.im-pick button { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 8px; border-radius: 12px; text-align: left; font: inherit; cursor: pointer; }
.im-pick button:hover { background: #F1F5F9; }
.im-pick button span:last-child { display: grid; } .im-pick small { color: #64748B; }
.im-pick-q { width: 100%; padding: 10px 12px; border: 1px solid #CBD5E1; border-radius: 10px; font: inherit; }
@media (max-width: 1100px) { .im-wrap { grid-template-columns: 84px 300px minmax(0, 1fr); } .im-find { display: none; } }
@media (max-width: 860px) {
  .im-wrap { grid-template-columns: 1fr; margin: 0; border-radius: 0; height: calc(100dvh - 60px); }
  .im-rail { flex-direction: row; border-right: 0; border-bottom: 1px solid #E2E8F0; overflow-x: auto; padding: 6px; }
  .im-rail button { min-width: 76px; font-size: 13px; padding: 6px 4px; }
  .im-rail button span { font-size: 18px; }
  .im-wrap.has-chat .im-rail, .im-wrap.has-chat .im-list { display: none; }
  .im-wrap:not(.has-chat) .im-chat { display: none; }
  .im-list { border-right: 0; min-height: 0; }
  .im-msgs { padding: 12px; }
  .im-msgs .msg { max-width: 88%; }
  .im-compose { margin: 0 8px 8px; }
  .im-text, .im-top span { font-size: 14px; }
}

/* ===== Sitios web: barra, menú Crear, tarjeta de ayuda y catálogo de plantillas ===== */
.sites-bar { align-items: center; gap: 14px; flex-wrap: wrap; }
.create-wrap { position: relative; }
.create-btn { background: #22C55E; color: #052E16; font-weight: 700; border: 2px solid #86EFAC; }
.create-btn:hover { background: #16A34A; color: #fff; }
.create-menu { position: absolute; left: 0; top: calc(100% + 10px); z-index: 30; background: #fff; border-radius: 16px; box-shadow: 0 18px 40px rgba(15, 23, 42, .3); padding: 8px; display: grid; min-width: 290px; }
.create-menu[hidden] { display: none; }
.create-menu::before { content: ''; position: absolute; left: 26px; top: -7px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }
.create-menu button { border: 0; background: none; text-align: left; font: inherit; font-size: 16px; color: #1E293B; padding: 12px 14px; border-radius: 10px; cursor: pointer; }
.create-menu button:hover, .create-menu button:focus-visible { background: #F1F5F9; outline: none; }
.btn.ghost-light { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .24); }
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; align-items: start; }
.sites-grid .panel { margin: 0; }
.site-help { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 22px; padding: 22px; text-align: center; display: grid; gap: 10px; justify-items: center; backdrop-filter: blur(8px); }
.site-help h3 { margin: 0; font-size: 22px; }
.site-help-ic { font-size: 64px; line-height: 1.2; }
.site-help p { margin: 0; font-size: 15px; }
body[data-theme="light"] .site-help, body[data-theme="light"] .btn.ghost-light { background: #fff; color: #1E293B; border-color: #CBD5E1; }

.tpl-bar { align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.tpl-bar .back { width: 100%; }
.tpl-cats { flex-wrap: wrap; }
.tpl-top { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px; margin-bottom: 16px; }
.tpl-hero { position: relative; border: 0; padding: 0; border-radius: 20px; overflow: hidden; cursor: pointer; min-height: 300px; }
.tpl-hero .tpl-thumb { height: 100%; border-radius: 0; }
.tpl-hero-txt { position: absolute; left: 18px; bottom: 16px; color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.tpl-hero-txt small { opacity: .8; font-weight: 400; }
.tpl-row { margin: 0 0 16px; padding: 16px 18px; border-radius: 20px; }
.tpl-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tpl-row-head h3 { margin: 0; } .tpl-row-head small { color: #94A3B8; font-weight: 400; }
.tpl-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tpl-grid .tpl-card { background: #fff; border-radius: 16px; padding: 10px; }
.tpl-card { scroll-snap-align: start; color: #1E293B; }
.tpl-open { position: relative; display: block; width: 100%; border: 0; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; }
.tpl-open:hover .tpl-thumb, .tpl-open:focus-visible .tpl-thumb { transform: scale(1.03); }
.tpl-free { position: absolute; left: 8px; bottom: 8px; background: #84CC16; color: #1A2E05; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.tpl-info { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.tpl-fav { border: 0; background: none; font-size: 20px; color: #94A3B8; cursor: pointer; min-width: 36px; min-height: 36px; }
.tpl-fav.on { color: #E11D48; }
.tpl-card p { margin: 2px 0 0; }
.tpl-thumb { position: relative; height: 150px; border-radius: 12px; background: linear-gradient(135deg, var(--g1), var(--g2)); display: grid; align-content: center; gap: 8px; padding: 18px; transition: transform .2s ease; overflow: hidden; }
.tpl-thumb::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.tpl-thumb.big { min-height: 300px; }
.tpl-ic { font-size: 40px; }
.tpl-thumb.big .tpl-ic { font-size: 84px; }
.tpl-line { display: block; height: 9px; border-radius: 6px; background: rgba(255, 255, 255, .7); }
.tpl-line.w1 { width: 70%; } .tpl-line.w2 { width: 45%; opacity: .7; }
.tpl-btn { display: block; width: 72px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .9); }
@media (max-width: 900px) {
  .tpl-top { grid-template-columns: 1fr; }
  .tpl-hero { min-height: 200px; } .tpl-thumb.big { min-height: 200px; }
  .tpl-scroll { grid-auto-columns: 78%; }
  .tpl-free { font-size: 14px; }
  .create-menu { min-width: 260px; }
}

@media (min-width: 901px) {
  .top-title { flex-wrap: nowrap; min-width: 0; }
  .subnav:not(.custom) { flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .subnav:not(.custom)::-webkit-scrollbar { display: none; }
}
.sites-bar .spacer { flex: 1; }

@media (min-width: 901px) {
  .top-title { flex: 1 1 auto; overflow: hidden; }
  .top-title h2 { flex: none; }
  .subnav:not(.custom) { flex: 1 1 auto; }
}
@media (min-width: 901px) and (max-width: 1280px) {
  .global-search { flex: 0 1 220px; }
  .global-search:focus-within { flex-basis: 320px; }
}

