/* ==========================================================================
   Valoriom design system — visual language inspired by Frappe CRM:
   gray sidebar, white canvas, black primary buttons, borderless gray inputs,
   ring-dot status indicators, Inter + Lucide icons. Built on Bootstrap 5
   (grid, utilities, dropdowns) — component classes use the `vl-` prefix.
   ========================================================================== */

@font-face {
  font-family: "InterVar";
  src: url("../vendor/inter/Inter.var.00a2276243e3.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Valoriom draws its own light and dark mode: "only" forbids the browser's forced dark mode
     (Chrome and Brave on Android) from recolouring the light one. Dark mode sets "dark" below. */
  color-scheme: only light;
  /* Light mode: a warm white ("blanco roto"), never cream. The light end of the scale carries a
     faint warm tint so sidebar, inputs and hovers sit with the canvas; text stays nearly neutral. */
  --gray-50: #f4f2ed;
  --gray-100: #eeebe5;
  --gray-200: #e6e2db;
  --gray-300: #d9d4cc;
  --gray-400: #c1bcb3;
  --gray-500: #97938c;
  --gray-600: #74716b;
  --gray-700: #51504c;
  --gray-800: #373634;
  --gray-900: #181817;

  --bg: #faf8f4;            /* canvas: warm white */
  --on-solid: #ffffff;      /* text on solid (black) buttons and toasts */
  --mix-ink: #000000;       /* used to darken indicator text */
  --ink: var(--gray-800);
  --ink-strong: var(--gray-900);
  --ink-muted: var(--gray-600);
  --line: #ddd8cf;          /* borders of cards, panels, header and sidebar */
  --line-soft: #e8e4dc;     /* separators between rows inside a card or table */

  --c-gray: #999999;
  --c-blue: #2490ef;
  --c-green: #30a66d;
  --pos-ink: #1a7f4b;       /* a gain written in green (.text-pos): --c-green is too pale on the canvas */
  --c-orange: #f98b3f;
  --c-red: #e03636;
  --c-purple: #8b5cf6;
  --c-teal: #14b8a6;
  --c-pink: #e34aa6;

  /* Chart series (validated for colour blindness on the light and dark canvas). */
  --viz-1: #2490ef;
  --viz-2: #e06c1f;

  /* Brand: navy + electric blue (logo from scripts/build_brand.py). */
  --brand-navy: #0a2a5c;
  --brand-blue: #1fa0ea;
  --brand-from: #1460e0;    /* gradients and glows (landing, emails) */
  --brand-to: #12a5f4;
  --brand-ink: var(--brand-navy);  /* wordmark of the logo */
  --accent: #1d6fd8;               /* primary buttons, checked boxes, badges: same blue in light and dark */
  --accent-hover: #1862c2;
  --on-accent: #ffffff;
  --accent-ink: #0b62c9;           /* blue for icons, underlines and focus on the canvas */
  --focus-ring: color-mix(in srgb, var(--accent-ink) 28%, transparent);

  --sidebar-w: 220px;
  --sidebar-w-collapsed: 52px;
  --header-h: 48px;
  --panel-w: 400px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);

  --bs-body-font-family: "InterVar", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: 14px;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-body-bg: var(--bg);
  --bs-link-color-rgb: 23, 23, 23;
  --bs-link-hover-color-rgb: 56, 56, 56;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { text-decoration: none; }

.vl-icon { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.vl-icon.sm { width: 14px; height: 14px; }
.vl-icon.lg { width: 20px; height: 20px; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.vl-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1030;
  display: flex; flex-direction: column; background: var(--gray-50);
  border-right: 1px solid var(--line); transition: width 0.2s ease, transform 0.2s ease; overflow: hidden;
}
.vl-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left 0.2s ease; }
html.sidebar-collapsed .vl-sidebar { width: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .vl-main { margin-left: var(--sidebar-w-collapsed); }
/* Collapsing: the icons stay where they are (no jump to the centre), labels fade out and are clipped
   by the narrowing sidebar, and the site picker and group titles fold away smoothly. */
.vl-sidebar .sb-label, .vl-sidebar .sb-org-text, .vl-sidebar .sb-org > .vl-icon { transition: opacity 0.15s ease 0.08s; }
html.sidebar-collapsed .vl-sidebar .sb-label, html.sidebar-collapsed .vl-sidebar .sb-org-text,
html.sidebar-collapsed .vl-sidebar .sb-org > .vl-icon { transition-delay: 0s; }
html.sidebar-collapsed .vl-sidebar .sb-label,
html.sidebar-collapsed .vl-sidebar .sb-org-text,
html.sidebar-collapsed .vl-sidebar .sb-org > .vl-icon { opacity: 0; pointer-events: none; }
html.sidebar-collapsed .vl-sidebar .sb-site { max-height: 0; padding-bottom: 0; opacity: 0; pointer-events: none; }
html.sidebar-collapsed .vl-sidebar .sb-group { margin-top: 6px; }
html.sidebar-collapsed .vl-sidebar .sb-group > summary { height: 7px; opacity: 0; pointer-events: none; }
html.sidebar-collapsed .vl-sidebar .sb-group + .sb-group,
html.sidebar-collapsed .vl-sidebar .sb-link + .sb-group { border-top: 1px solid var(--line); padding-top: 6px; }
html.sidebar-collapsed .vl-sidebar .sb-org { padding-left: 2px; padding-right: 2px; }
html.sidebar-collapsed .vl-sidebar .sb-link { padding-left: 10px; padding-right: 10px; }
html.sidebar-collapsed .vl-sidebar .sb-link:hover { background: var(--gray-100); }

/* Org switcher */
.sb-top { padding: 8px; }
.sb-org { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border: 0; transition: padding 0.2s ease;
  border-radius: var(--radius); background: transparent; text-align: left; color: var(--ink-strong); }
.sb-org:hover, .sb-org[aria-expanded="true"] { background: var(--gray-200); }
.sb-org-text { min-width: 0; }
.sb-logo { width: 32px; height: 32px; flex-shrink: 0; display: block;
  background: url("../img/logo-mark.64f19d81b77e.svg") center / 84% auto no-repeat; }
html[data-theme="dark"] .sb-logo { background-image: url("../img/logo-mark-dark.ad186c5f5c86.svg"); }
.vl-logo { display: block; width: auto; height: 28px; color: var(--brand-ink); }
.sb-org-name { font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-org-user { font-size: 12px; color: var(--ink-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-org > .vl-icon { margin-left: auto; color: var(--gray-600); }
/* Red «PRE» mark on pre.valoriom.com (partials/_env_badge.html): top right of the org switcher,
   above the chevron, out of the flow so nothing moves; on the logo's corner when collapsed. */
.vl-env-badge { display: inline-block; padding: 1px 5px; border-radius: 4px; background: var(--c-red); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1.4; letter-spacing: 0.04em; pointer-events: none; }
.sb-org { position: relative; }
.sb-org .vl-env-badge { position: absolute; top: -3px; right: 3px; }
.sb-org.is-pre .sb-org-name { padding-right: 18px; }
html.sidebar-collapsed .vl-sidebar .sb-org .vl-env-badge { top: -4px; right: -6px; padding: 0 3px; font-size: 9px; }
.sb-site { padding: 0 8px 4px; max-height: 44px; overflow: hidden; transition: max-height 0.2s ease, padding 0.2s ease, opacity 0.15s ease; }
.sb-site select { width: 100%; text-overflow: ellipsis; }

/* Nav */
.sb-nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 4px 8px; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-nav:hover { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
.sb-link { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; margin-bottom: 2px;
  border-radius: 6px; color: var(--ink); font-size: 14px; white-space: nowrap; transition: padding 0.2s ease; }
.sb-link .vl-icon { color: var(--gray-700); }
.sb-link .sb-label { min-width: 0; overflow: hidden; text-overflow: clip; }
.sb-link:hover { background: var(--gray-100); color: var(--ink-strong); }
.sb-link.active { background: var(--bg); box-shadow: var(--shadow-sm); color: var(--ink-strong); }
.sb-link.active .vl-icon { color: var(--accent-ink); }
.sb-link.disabled { color: var(--gray-500); pointer-events: none; }
.sb-link.disabled .vl-icon { color: var(--gray-400); }
.sb-soon { margin-left: auto; font-size: 11px; color: var(--gray-500); }
.sb-group { margin-top: 12px; transition: margin 0.2s ease, padding 0.2s ease; }
.sb-group > summary { list-style: none; display: flex; align-items: center; gap: 4px; height: 26px;
  padding: 0 4px; font-size: 13px; color: var(--ink-muted); cursor: pointer; user-select: none;
  overflow: hidden; white-space: nowrap; transition: height 0.2s ease, opacity 0.15s ease; }
.sb-group > summary::-webkit-details-marker { display: none; }
.sb-group > summary .vl-icon { transition: transform 0.15s; }
.sb-group:not([open]) > summary .vl-icon { transform: rotate(-90deg); }
/* You are on a page of a group you folded: it stays folded (app.js) and its title says you are there. */
.sb-group:not([open]):has(.sb-link.active) > summary { color: var(--ink-strong); font-weight: 600; }
.sb-group:not([open]):has(.sb-link.active) > summary::after { content: ""; width: 6px; height: 6px; margin-left: 2px;
  border-radius: 50%; background: var(--accent-ink); flex-shrink: 0; }
.sb-bottom { padding: 8px; border-top: 1px solid var(--line); }
.sb-bottom .sb-link { color: var(--ink-muted); width: 100%; border: 0; background: transparent; }
.sb-bottom .sb-link:hover, .sb-bottom .sb-link:focus-visible { background: var(--gray-100); color: var(--ink-strong); }
/* «Contraer»: a «<» that turns round into «>» as the sidebar narrows (same 0.2s plus a small
   overshoot), and leans the way it will move on hover. */
.sb-toggle-icon { display: inline-flex; transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.sb-toggle:hover .sb-toggle-icon { transform: translateX(-2px); }
html.sidebar-collapsed .sb-toggle-icon { transform: rotate(180deg); }
html.sidebar-collapsed .sb-toggle:hover .sb-toggle-icon { transform: rotate(180deg) translateX(-2px); }
@media (prefers-reduced-motion: reduce) { .sb-toggle-icon { transition: none; } }

/* Header bar */
.vl-header { position: sticky; top: 0; z-index: 1020; height: var(--header-h); display: flex; align-items: center;
  gap: 12px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.vl-crumbs { display: flex; align-items: center; gap: 6px; font-size: 18px; min-width: 0; overflow: hidden; color: var(--ink-strong); }
/* When the header is tight, the steps before the page shorten first («CMP-0… / OT-000012»), never under the buttons. */
.vl-crumbs > a, .vl-crumbs .vl-trail-item { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 3; }
.vl-crumbs .sep { flex-shrink: 0; }
.vl-crumbs .current { min-width: 3ch; }
.vl-crumbs a { color: var(--gray-600); white-space: nowrap; }
.vl-crumbs a:hover { color: var(--ink); }
.vl-crumbs .sep { color: var(--gray-400); }
.vl-crumbs .current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-crumbs a.shrink { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vl-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* ‹ 62 de 302 › on a record's page: previous/next record of the list it came from. */
.vl-pager { display: flex; align-items: center; flex-shrink: 0; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.vl-pager .vl-btn { flex-shrink: 0; }
/* On phones the header has no room: the arrows float at the bottom, within thumb's reach. */
@media (max-width: 575.98px) {
  .vl-pager { position: fixed; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1025; gap: 2px;
    margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
  .vl-pager .vl-btn.icon { width: 36px; height: 36px; border-radius: 999px; }
  .vl-pager .vl-pager-pos { display: inline; font-size: 12px; }
}
.vl-pager-pos { font-size: 13px; color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 4px; }
.vl-pager-pos:hover { color: var(--ink); }
.vl-menu-btn { display: none !important; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.vl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--radius); border: 1px solid transparent; font-size: 14px; line-height: 1;
  white-space: nowrap; cursor: pointer; transition: background 0.12s; color: var(--ink); background: var(--gray-100); }
.vl-btn:hover { background: var(--gray-200); color: var(--ink-strong); }
.vl-btn.solid { background: var(--accent); color: var(--on-accent); }
.vl-btn.solid:hover { background: var(--accent-hover); color: var(--on-accent); }
.vl-btn.ghost { background: transparent; }
.vl-btn.ghost:hover { background: var(--gray-100); }
.vl-btn.outline { background: var(--bg); border-color: var(--gray-300); }
.vl-btn.outline:hover { background: var(--gray-50); }
.vl-btn.danger { color: var(--c-red); }
.vl-btn.icon { width: 28px; padding: 0; }
.vl-btn.lg { height: 36px; padding: 0 14px; }

/* ── Form controls (also restyles Bootstrap .form-control/.form-select) ─ */
.vl-input, .form-control, .form-select {
  height: 28px; padding: 0 8px; font-size: 14px; color: var(--ink-strong); background-color: var(--gray-100);
  border: 1px solid var(--gray-100); border-radius: 6px; box-shadow: none; transition: background 0.12s, border 0.12s;
}
.form-select { padding-right: 28px; background-position: right 8px center; background-size: 12px 10px; }
textarea.form-control { height: auto; padding: 6px 8px; }
.form-control[type="file"] { padding: 3px 8px; }
.vl-input:hover, .form-control:hover, .form-select:hover { background-color: var(--gray-200); border-color: var(--gray-200); }
.vl-input:focus, .form-control:focus, .form-select:focus { background-color: var(--bg); border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--focus-ring); outline: 0; }
.form-control::placeholder { color: var(--gray-500); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--c-red); background-image: none; padding-right: 8px; }
.form-check-input { width: 16px; height: 16px; border-color: var(--gray-400); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-switch .form-check-input { width: 28px; margin: 0; flex-shrink: 0; }
.vl-check { display: flex; align-items: center; gap: 8px; min-height: 28px; margin: 0; padding: 0; }
.vl-check-row .vl-help { margin-left: 36px; }
.vl-check .form-check-label { color: var(--ink-strong); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--focus-ring); border-color: var(--accent-ink); }
.vl-label { display: block; font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.vl-label .req { color: var(--c-red); }
.vl-help { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.vl-error { font-size: 12px; color: var(--c-red); margin-top: 4px; }
.vl-form-error { padding: 8px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--c-red) 12%, var(--bg)); color: color-mix(in srgb, var(--c-red) 75%, var(--mix-ink)); margin-bottom: 16px; }
.vl-form-warn { padding: 8px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--c-orange) 14%, var(--bg)); color: color-mix(in srgb, var(--c-orange) 55%, var(--mix-ink)); margin-bottom: 16px; font-size: 13px; }
.vl-form-warn a { color: inherit; text-decoration: underline; }
/* «X te ha respondido»: list of possible customers and their page, until the reply is answered. */
.vl-reply-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-orange) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--c-orange) 35%, var(--bg));
  color: var(--gray-900); font-size: 13px; text-decoration: none; }
a.vl-reply-alert:hover { background: color-mix(in srgb, var(--c-orange) 18%, var(--bg)); color: var(--gray-900); }
.vl-reply-alert > svg { color: var(--c-orange); flex: none; }
.vl-reply-alert > span:first-of-type { flex: 1 1 260px; }
.vl-reply-alert-go { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 500; }
.vl-reply-alert-go form { margin: 0; }

/* Long dropdowns with a search box (js/combo.js): the real select stays underneath, invisible. */
.vl-combo { position: relative; }
.vl-combo-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.vl-combo-input { width: 100%; cursor: text; text-overflow: ellipsis; }
.vl-combo-input::placeholder { color: var(--gray-500); }
.vl-combo.open .vl-combo-input { background-color: var(--bg); border-color: var(--gray-500); box-shadow: 0 0 0 2px var(--gray-300); }
.vl-combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1070; margin: 0; padding: 4px;
  list-style: none; max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.vl-combo.up .vl-combo-list { top: auto; bottom: calc(100% + 4px); }
.vl-combo-opt { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 14px; color: var(--ink-strong); white-space: normal; overflow-wrap: anywhere; }
.vl-combo-opt small { font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-combo-opt.is-empty { color: var(--ink-muted); }
.vl-combo-opt.active, .vl-combo-opt:hover { background: var(--gray-100); }
.vl-combo-opt[aria-disabled="true"] { color: var(--gray-500); cursor: default; }
/* Second column (<select data-aside-head>): e.g. the parent of each asset in «Añadir hijo» */
.vl-combo-head, .vl-combo-opt.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 38%); gap: 12px; }
.vl-combo-head { position: sticky; top: -4px; z-index: 1; margin: -4px -4px 4px; padding: 8px 12px 6px; background: var(--bg);
  border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-muted); }
.vl-combo-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vl-combo-aside { align-self: center; min-width: 0; font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
.vl-combo-none { padding: 8px; font-size: 13px; color: var(--ink-muted); }
.vl-combo-opt.is-text { color: var(--ink-muted); font-style: italic; }
.vl-suggest .form-control { width: 100%; }
.vl-m .vl-combo-opt { padding: 10px; font-size: 16px; }
html[data-theme="dark"] .vl-combo-list { background: var(--gray-50); }

/* ── Indicators (status) ───────────────────────────────────────────────── */
.vl-ind { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vl-ind::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--ind, var(--c-gray)); flex-shrink: 0; }
.ind-gray { --ind: var(--c-gray); } .ind-blue { --ind: var(--c-blue); } .ind-green { --ind: var(--c-green); }
.ind-orange { --ind: var(--c-orange); } .ind-red { --ind: var(--c-red); } .ind-purple { --ind: var(--c-purple); }
.ind-teal { --ind: var(--c-teal); } .ind-pink { --ind: var(--c-pink); }
.vl-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius);
  font-size: 14px; border: 0; background: color-mix(in srgb, var(--ind) 12%, var(--bg)); color: color-mix(in srgb, var(--ind) 70%, var(--mix-ink)); }
.vl-pill:hover { background: color-mix(in srgb, var(--ind) 20%, var(--bg)); }
.vl-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 12px;
  background: var(--gray-100); color: var(--ink-muted); }

/* ── List view ─────────────────────────────────────────────────────────── */
.vl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; }
.vl-toolbar .vl-search { width: 220px; }
.vl-toolbar .form-select { width: auto; max-width: 200px; }
.vl-toolbar .spacer { flex: 1; }
.vl-list-wrap { padding: 0 20px; overflow-x: auto; }
.vl-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.vl-table thead th { height: 32px; padding: 0 10px; font-weight: 400; color: var(--ink-muted); background: var(--gray-100);
  white-space: nowrap; text-align: left; }
.vl-table thead th:first-child { border-radius: 6px 0 0 6px; }
.vl-table thead th:last-child { border-radius: 0 6px 6px 0; }
.vl-table tbody td { height: 40px; padding: 0 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.vl-table tbody tr[data-href] { cursor: pointer; }
.vl-table tbody tr[data-href]:hover td { background: var(--gray-50); }
/* The record you came back from (list memory, apps/core/list_memory.py). */
.vl-table tbody tr.vl-row-last td { background: var(--gray-100); }
.vl-table tbody tr.vl-row-last td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.vl-table .strong { color: var(--ink-strong); }
.vl-table .muted { color: var(--ink-muted); }
.vl-table .actions { text-align: right; width: 1%; }
.vl-empty { padding: 56px 0; text-align: center; color: var(--ink-muted); white-space: normal !important; }
.vl-empty .vl-icon { width: 28px; height: 28px; color: var(--gray-400); margin-bottom: 8px; display: block; margin-inline: auto; }
.vl-avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gray-100);
  color: var(--gray-700); font-size: 11px; font-weight: 600; margin-right: 8px; flex-shrink: 0; vertical-align: middle; }
/* People: one colour per person (`|avatar_hue`), the same on every screen. */
.vl-avatar[style*="--av-h"] { background: hsl(var(--av-h) 70% 92%); color: hsl(var(--av-h) 50% 32%); }
html[data-theme="dark"] .vl-avatar[style*="--av-h"] { background: hsl(var(--av-h) 35% 24%); color: hsl(var(--av-h) 75% 80%); }
.vl-avatar.lg { width: 56px; height: 56px; border-radius: 12px; font-size: 22px; margin: 0; }
.vl-avatar.lg .vl-icon { width: 24px; height: 24px; }
.vl-list-footer { display: flex; align-items: center; gap: 12px; padding: 10px 20px; margin-top: auto; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-muted); }
.vl-seg { display: inline-flex; padding: 2px; border-radius: var(--radius); background: var(--gray-100); }
.vl-seg a { white-space: nowrap; padding: 3px 10px; border-radius: 6px; color: var(--ink); font-size: 13px; }
.vl-seg a.active { background: var(--bg); box-shadow: var(--shadow-sm); color: var(--ink-strong); }
/* Buttons as a segmented choice: the pressed one is the chosen. */
.vl-seg button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 3px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.vl-seg button[aria-pressed="true"] { background: var(--bg); box-shadow: var(--shadow-sm); color: var(--ink-strong); }
.vl-seg button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }

/* ── Record (detail) view ──────────────────────────────────────────────── */
.vl-record { display: flex; flex: 1; }
.vl-record-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vl-record-panel { width: var(--panel-w); flex-shrink: 0; border-left: 1px solid var(--line); }
.vl-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.vl-tabs::-webkit-scrollbar { display: none; }
.vl-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 8px; border: 0; background: none;
  color: var(--ink-muted); font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.vl-tabs button:hover { color: var(--ink-strong); }
.vl-tabs button.active { color: var(--ink-strong); box-shadow: inset 0 -2px 0 var(--accent-ink); }
.vl-tabs .vl-badge { height: 18px; font-size: 11px; }
.vl-tab-body { padding: 24px 40px; }
.vl-tab-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.vl-section-title { font-size: 20px; font-weight: 600; color: var(--ink-strong); margin: 0; }
.vl-panel-head { height: var(--header-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line);
  font-size: 18px; font-weight: 600; color: var(--ink-strong); }
.vl-profile { display: flex; gap: 16px; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.vl-profile-name { font-size: 20px; font-weight: 600; color: var(--ink-strong); line-height: 1.25; margin-bottom: 8px; }
.vl-profile-actions { display: flex; gap: 6px; }
.vl-profile-actions form { margin: 0; }
.vl-panel-section { border-bottom: 1px solid var(--line); padding: 10px 20px 14px; }
.vl-panel-section > summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 32px; cursor: pointer;
  font-weight: 600; color: var(--ink-strong); }
.vl-panel-section > summary::-webkit-details-marker { display: none; }
.vl-panel-section > summary .vl-icon { transition: transform 0.15s; color: var(--ink-muted); }
.vl-panel-section:not([open]) > summary .vl-icon { transform: rotate(-90deg); }
.vl-field { display: flex; align-items: baseline; gap: 12px; min-height: 34px; padding: 6px 0 6px 4px; font-size: 14px; }
.vl-field-label { width: 40%; flex-shrink: 0; color: var(--ink-muted); }
.vl-field-value { flex: 1; min-width: 0; color: var(--ink-strong); overflow-wrap: anywhere; }
.vl-field-value.empty { color: var(--gray-400); }

/* Activity timeline */
.vl-timeline { list-style: none; padding: 0; margin: 16px 0 0; position: relative; }
.vl-timeline::before { content: ""; position: absolute; left: 13px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.vl-timeline li { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.vl-tl-icon { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink-muted);
  position: relative; z-index: 1; flex-shrink: 0; }
.vl-tl-body { flex: 1; padding-top: 4px; color: var(--ink-muted); }
.vl-tl-body strong { font-weight: 500; color: var(--ink-strong); }
.vl-tl-body .vl-ind { color: var(--ink-strong); }
.vl-tl-time { padding-top: 4px; color: var(--ink-muted); font-size: 13px; white-space: nowrap; }
.vl-tl-note { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius); background: var(--gray-50); color: var(--ink); }

.vl-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--gray-50); font-size: 14px; margin: 16px 0 24px; }
.vl-path a { color: var(--ink-muted); }
.vl-path a:hover { color: var(--ink-strong); }
.vl-path .vl-icon { color: var(--gray-400); }
.vl-subtable { margin-top: 8px; }
/* Tables inside a record or a card scroll sideways on a phone instead of widening the page. */
.vl-table-scroll { overflow-x: auto; }
.vl-subtable td { max-width: none; }
/* Several tables with the same columns one under another (one per bank in Bancos): fixed widths
   so their columns line up. The widths go on the header cells (`style="width: …"`); the column
   without one takes the rest, and a long text ends in «…». */
.vl-table-aligned { table-layout: fixed; }
@media (max-width: 767.98px) { .vl-table-aligned tbody td { white-space: normal; padding-top: 8px; padding-bottom: 8px; } }

/* ── Dropdown menus (Bootstrap) ────────────────────────────────────────── */
.dropdown-menu { --bs-dropdown-font-size: 14px; --bs-dropdown-border-color: transparent; --bs-dropdown-border-radius: 10px;
  --bs-dropdown-link-active-bg: var(--gray-100); --bs-dropdown-link-active-color: var(--ink-strong);
  --bs-dropdown-link-hover-bg: var(--gray-100); --bs-dropdown-link-color: var(--ink);
  padding: 6px; box-shadow: var(--shadow-lg); min-width: 200px; }
.dropdown-item { display: flex; align-items: center; gap: 8px; border-radius: 6px; padding: 6px 8px; }
.dropdown-item .vl-icon { color: var(--gray-700); }
.dropdown-item .check { margin-left: auto; }
.theme-check { visibility: hidden; }
html[data-theme-pref="light"] [data-theme-set="light"] .theme-check,
html[data-theme-pref="dark"] [data-theme-set="dark"] .theme-check,
html[data-theme-pref="system"] [data-theme-set="system"] .theme-check { visibility: visible; }
.dropdown-header { font-size: 12px; color: var(--ink-muted); padding: 6px 8px 4px; }
.dropdown-menu form { margin: 0; }
.dropdown-divider { margin: 4px 0; border-color: var(--line); }

/* ── Cards, settings, forms pages ──────────────────────────────────────── */
.vl-page { padding: 20px; }
.vl-card { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.vl-kpi { display: block; padding: 16px; color: var(--ink); }
.vl-kpi:hover { background: var(--gray-50); color: var(--ink); }
.vl-kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.vl-kpi-value { font-size: 24px; font-weight: 600; color: var(--ink-strong); margin-top: 6px; }
.vl-onboarding { max-width: 640px; }
.vl-onboarding h2 { display: flex; align-items: center; gap: 8px; }
.vl-onboarding ul { list-style: none; margin: 0; padding: 6px 16px 10px; }
.vl-onboarding li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.vl-onboarding li + li { border-top: 1px solid var(--line-soft); }
.vl-onboarding li > .vl-icon { flex-shrink: 0; margin-top: 2px; color: var(--gray-400); }
.vl-onboarding li.done > .vl-icon { color: var(--c-green); }
.vl-onboarding li > span { display: flex; flex-direction: column; }
.vl-onboarding a { color: var(--ink-strong); font-weight: 500; text-decoration: none; }
.vl-onboarding a:hover { text-decoration: underline; text-underline-offset: 3px; }
.vl-onboarding li.done a { color: var(--ink-muted); font-weight: 400; text-decoration: line-through; }
.vl-onboarding .muted { color: var(--ink-muted); font-size: 13px; }
.vl-form { max-width: 820px; padding: 24px 20px 40px; }
.vl-form-section + .vl-form-section { margin-top: 28px; }
.vl-form-section h2 { font-size: 16px; font-weight: 600; color: var(--ink-strong); margin-bottom: 14px; }
.vl-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.vl-settings { display: flex; flex: 1; }
.vl-settings-nav { width: 220px; flex-shrink: 0; padding: 12px 8px; border-right: 1px solid var(--line); }
.vl-settings-nav h6 { font-size: 12px; font-weight: 500; color: var(--ink-muted); padding: 4px 8px; margin: 4px 0; }
.vl-settings-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vl-settings-intro { padding: 16px 20px 0; color: var(--ink-muted); max-width: 760px; margin: 0; }
.vl-subtitle { font-size: 15px; font-weight: 600; color: var(--ink-strong); margin: 8px 0 4px; }
.vl-roles { max-width: 820px; padding: 0 20px 40px; margin: -16px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.vl-roles dt { font-weight: 500; color: var(--ink-strong); }
.vl-roles dd { margin: 0; color: var(--ink-muted); }
/* People picker and mailings (Configuración → Grupos / Correos) */
.vl-people-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.vl-people-head .vl-label { flex: 1 0 auto; }
.vl-people-search { max-width: 260px; height: 30px; }
@media (max-width: 576px) {
  .vl-people-head .vl-label { flex-basis: 100%; }
  .vl-people-search { flex: 1; max-width: none; }
}
.vl-people-list { border: 1px solid var(--line); border-radius: var(--radius); max-height: 320px; overflow-y: auto; }
.vl-person { display: flex; align-items: center; gap: 8px; padding: 7px 12px; margin: 0; cursor: pointer; }
.vl-person[hidden] { display: none; }
.vl-person + .vl-person { border-top: 1px solid var(--line); }
.vl-person:hover { background: var(--gray-50); }
.vl-person input { flex: none; accent-color: var(--accent); }
.vl-person .vl-avatar { margin: 0; }
.vl-person-name { color: var(--ink-strong); font-weight: 500; white-space: nowrap; }
.vl-person-meta { color: var(--ink-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vl-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; margin: 0; }
.vl-chip:has(input:checked) { border-color: var(--ink-strong); background: var(--gray-50); }
.vl-chip input { accent-color: var(--accent); }
.vl-recipients { font-size: 13px; color: var(--ink-muted); margin: -6px 0 16px; }
.vl-mail { max-width: 760px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 8px; }
.vl-mail-subject { font-weight: 600; color: var(--ink-strong); margin-bottom: 8px; }
.vl-mail-body p:last-child { margin-bottom: 0; }
.vl-group-row td { background: var(--gray-50); color: var(--ink-muted) !important; font-size: 13px; height: 32px !important; }
.vl-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--ink-strong);
  background: var(--gray-100); border-radius: 4px; padding: 1px 5px; }

/* Toasts */
.vl-alerts { position: fixed; right: 20px; bottom: 20px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.vl-toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--gray-900);
  color: var(--on-solid); box-shadow: var(--shadow-lg); font-size: 14px; animation: vl-in 0.2s ease; }
.vl-toast.error { background: var(--c-red); color: #fff; }
.vl-toast button { margin-left: auto; border: 0; background: none; color: inherit; opacity: 0.7; padding: 0; }
@keyframes vl-in { from { transform: translateY(8px); opacity: 0; } }

/* Auth */
.vl-auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.vl-auth-box { width: 100%; max-width: 360px; }
.vl-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; text-align: center; }
.vl-auth-brand .sb-logo { width: 44px; height: 44px; }
.vl-auth-logo { display: block; border-radius: 10px; }
.vl-auth-logo:hover .sb-logo { opacity: .85; }
.vl-auth-logo:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }
.vl-auth-brand h1 { font-size: 20px; font-weight: 600; color: var(--ink-strong); margin: 0; }
.vl-auth-brand p { color: var(--ink-muted); margin: 0; }
.vl-auth .form-control { height: 32px; }
.vl-auth-alt { text-align: center; color: var(--ink-muted); margin-top: 20px; }
.vl-auth-alt a { color: var(--ink-strong); }

/* Error pages (404, 403, 500): a message inside the app with a way back */
.vl-error-box { max-width: 460px; margin: 64px auto; text-align: center; }
.vl-auth .vl-error-box { margin: 0 auto 28px; }
.vl-error-icon { width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gray-100); color: var(--ink-muted); }
.vl-error-box h1 { font-size: 18px; font-weight: 600; color: var(--ink-strong); margin: 0 0 8px; }
.vl-error-box p { color: var(--ink-muted); margin: 0 0 20px; line-height: 1.5; }
.vl-error-box p strong { color: var(--ink-strong); font-weight: 500; }
.vl-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vl-error-actions form { margin: 0; }
.vl-error-code { margin-top: 24px; font-size: 12px; color: var(--gray-400); }
@media (max-width: 575.98px) { .vl-error-box { margin: 32px auto; } }
.vl-auth-lead { color: var(--ink-muted); text-align: center; margin: -12px 0 20px; }
.vl-auth-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 20px; }
.vl-auth-card .muted { color: var(--ink-muted); font-size: 13px; }


/* ── Dark mode ─────────────────────────────────────────────────────────────
   The gray ramp is inverted, so every rule written with gray tokens adapts.
   Theme is set on <html data-theme="dark|light"> by a tiny inline script
   (stored per browser, defaults to the OS preference). */
html[data-theme="dark"] {
  color-scheme: dark;
  /* Dark mode: greys with a faint tint of the brand navy (like GitHub or VS Code), not neutral grey. */
  --bg: #12151b;
  --on-solid: #12151b;
  --mix-ink: #ffffff;
  --gray-50: #171b22;
  --gray-100: #1e232c;
  --gray-200: #272d37;
  --gray-300: #323945;
  --gray-400: #465061;
  --gray-500: #6b7484;
  --gray-600: #9aa2b1;
  --gray-700: #b8bfcb;
  --gray-800: #dce0e7;
  --gray-900: #f1f3f6;
  --line: #2a313c;
  --line-soft: #20262f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --bs-body-bg: var(--bg);
  --bs-link-color-rgb: 241, 243, 246;
  --bs-link-hover-color-rgb: 220, 224, 231;
  --brand-ink: #ffffff;
  /* --accent is the same blue as in light mode; only the blue for icons and text is lighter. */
  --accent-hover: #2b80ea;
  --accent-ink: #4fb0f5;
  --pos-ink: #30a66d;
}
html[data-theme="dark"] .form-check-input { background-color: var(--gray-100); }
html[data-theme="dark"] .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
html[data-theme="dark"] .dropdown-menu { --bs-dropdown-bg: var(--gray-50); }
html[data-theme="dark"] .sb-link.active { background: var(--gray-200); }
html[data-theme="dark"] .vl-seg a.active { background: var(--gray-300); }
html[data-theme="dark"] .vl-seg button[aria-pressed="true"] { background: var(--gray-300); }
html[data-theme="dark"] .vl-tl-icon { background: var(--bg); }

/* ── Dialogs (app.js): confirmations and the image/PDF viewer ── */
.vl-dialog { padding: 0; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow-lg); }
.vl-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.vl-dialog[open] { animation: vl-in 0.15s ease; }
.vl-confirm { width: min(440px, calc(100vw - 32px)); }
.vl-confirm form { padding: 24px; margin: 0; }
.vl-confirm-text { white-space: pre-line; margin: 0 0 24px; font-size: 16px; line-height: 1.5; color: var(--ink-strong); }
.vl-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.vl-confirm-actions [hidden] { display: none; }
/* Text on red reads white in both themes. */
.vl-btn.danger-solid, .vl-btn.danger-solid:hover { background: var(--c-red); color: #fff; }
.vl-btn.danger-solid:hover { filter: brightness(0.92); }
.vl-viewer { width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); display: none; flex-direction: column; overflow: hidden; }
.vl-viewer[open] { display: flex; }
.vl-viewer.is-pdf { height: calc(100dvh - 32px); }
.vl-viewer-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.vl-viewer-title { flex: 1; min-width: 0; font-weight: 500; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--gray-50); overflow: auto; }
.vl-viewer-body img { display: block; max-width: 100%; max-height: calc(100dvh - 32px - 49px); object-fit: contain; }
.vl-viewer-body iframe { width: 100%; height: 100%; border: 0; background: var(--bg); }
@media (max-width: 575.98px) { .vl-viewer-head .vl-btn span { display: none; } }
.vl-frame-dialog { height: calc(100dvh - 32px); }
.vl-frame-dialog.is-sm { width: min(420px, calc(100vw - 32px)); height: min(460px, calc(100dvh - 32px)); }
/* Global search (search.js): «Buscar» in the header, Ctrl+K dialog and /buscar/ page. */
.vl-search-btn { color: var(--ink-muted); }
.vl-search-btn kbd, .vl-search-foot kbd { font: inherit; font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 4px;
  background: var(--gray-100); border: 1px solid var(--line); color: var(--ink-muted); }
/* ── Avisos (campana) y notificaciones ─────────────────────────────────── */
.vl-bell { position: relative; }
.vl-bell-btn { position: relative; }
.vl-bell-count, .vl-m-nav-count { position: absolute; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--c-red); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
  font-style: normal; font-variant-numeric: tabular-nums; pointer-events: none; }
.vl-bell-count { top: -4px; right: -5px; }
.vl-bell-count[hidden], .vl-m-nav-count[hidden] { display: none; }
.vl-notices-menu { width: 380px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.vl-notices-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line); min-height: 44px; }
.vl-notices-menu .vl-notices-list { max-height: min(420px, 60vh); overflow-y: auto; }
.vl-notices-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 12px; color: var(--ink-muted); font-size: 14px; }
.vl-notices-all { display: block; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; text-align: center;
  color: var(--accent-ink); }
.vl-notices-all:hover { background: var(--gray-50); }
.vl-notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line); }
.vl-notices-list > .vl-notice:last-child { border-bottom: 0; }
.vl-notice:hover { background: var(--gray-50); color: var(--ink-strong); }
.vl-notice-icon { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-100); color: var(--ink-muted); }
.vl-notice.unread .vl-notice-icon { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent-ink); }
.vl-notice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vl-notice-title { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.vl-notice.unread .vl-notice-title { font-weight: 600; color: var(--ink-strong); }
.vl-notice-body { font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vl-notice-meta { font-size: 12px; color: var(--gray-500); }
.vl-notice-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; background: var(--accent); }
.vl-notices-page { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.vl-notices-page .vl-empty { padding: 40px 16px; }
.vl-notices-pages { display: flex; gap: 8px; justify-content: space-between; }

.vl-push { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--gray-50); padding: 12px; }
.vl-push:not(.ready) { display: none; }
.vl-push[hidden] { display: none; }
.vl-notices-menu .vl-push { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.vl-push-state { display: flex; align-items: flex-start; gap: 10px; }
.vl-push-state[hidden] { display: none; }
.vl-push-state > div { flex: 1; min-width: 0; font-size: 14px; }
.vl-push-state p { margin: 2px 0 0; color: var(--ink-muted); font-size: 13px; }
.vl-push-state > .vl-btn, .vl-push-actions { flex-shrink: 0; align-self: center; }
.vl-push-actions { display: flex; gap: 4px; }
.vl-push-icon { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-100); color: var(--ink-muted); }
.vl-push-icon.on { background: color-mix(in srgb, var(--c-green) 16%, var(--bg)); color: var(--c-green); }
.vl-push-steps { margin: 6px 0 4px; padding-left: 20px; font-size: 13px; color: var(--ink); }
.vl-push-steps li { margin: 3px 0; }
.vl-push-steps .vl-icon { vertical-align: -2px; color: var(--accent-ink); }
.vl-push-devices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 13px; }
.vl-push-device { display: inline-flex; align-items: center; gap: 2px; padding-left: 8px; border-radius: 6px; background: var(--gray-100); }
.vl-push-prompt { padding-right: 34px; margin-bottom: 12px; }
.vl-push-close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); }
.vl-push-close:hover { background: var(--gray-100); }
@media (max-width: 600px) {
  .vl-push-state { flex-wrap: wrap; }
  .vl-push-state > .vl-btn, .vl-push-actions { margin-left: 42px; }
}

/* App del técnico: «Avisos» en la barra de abajo y su lista. */
.vl-m-nav-notices { position: relative; }
.vl-m-nav-count { top: 6px; left: calc(50% + 4px); }
.vl-m-notices { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.vl-m .vl-push { margin-bottom: 12px; }
.vl-m .vl-notices-pages { margin-top: 12px; }
.vl-m-read-all { margin: 0 0 0 auto; }
.vl-m-read-all button { border: 0; background: transparent; padding: 0; }

.vl-search-dialog { width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 24vh)); margin: 12vh auto auto;
  display: none; flex-direction: column; overflow: hidden; }
.vl-search-dialog[open] { display: flex; }
.vl-search-field { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); color: var(--ink-muted); }
.vl-search-field input { flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink-strong); }
.vl-search-field input::-webkit-search-cancel-button { display: none; }
.vl-search-results { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.vl-search-group + .vl-search-group { margin-top: 6px; }
.vl-search-group-label { display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px; font-size: 12px; color: var(--ink-muted); }
.vl-search-item { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; column-gap: 12px; align-items: baseline;
  padding: 7px 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.vl-search-item.is-active, .vl-search-page .vl-search-item:hover { background: var(--gray-100); color: var(--ink-strong); }
.vl-search-code { font-weight: 500; color: var(--ink-strong); white-space: nowrap; }
.vl-search-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-search-sub { grid-column: 2; font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-search-empty { margin: 0; padding: 20px 10px; text-align: center; color: var(--ink-muted); }
.vl-search-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-muted); }
.vl-search-foot kbd { margin-right: 2px; }
.vl-search-page { max-width: 720px; }
.vl-search-page .vl-search-field { border: 0; border-radius: var(--radius); background: var(--gray-100); margin-bottom: 12px; }
@media (max-width: 575.98px) {
  .vl-search-dialog { margin: 16px auto auto; max-height: calc(100dvh - 32px); }
  .vl-search-item { grid-template-columns: 1fr; }
  .vl-search-sub { grid-column: 1; }
}
.vl-frame-dialog .vl-viewer-body iframe { background: transparent; }
/* Page shown inside a dialog (?embed=1): no sidebar, menu or breadcrumbs. */
html.vl-embed .vl-main, html.vl-embed.sidebar-collapsed .vl-main { margin-left: 0; }
html.vl-embed .vl-menu-btn, html.vl-embed .vl-crumbs { display: none !important; }
.vl-export { width: min(440px, calc(100vw - 32px)); }
.vl-export-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.vl-export-body p { margin: 0 0 4px; font-size: 13px; }
.vl-export-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink-strong); text-decoration: none; }
.vl-export-option:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--ink-strong); }
.vl-export-option > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.vl-export-option strong { font-size: 14px; font-weight: 600; }
.vl-row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.vl-row-actions form { margin: 0; }
.vl-file-chip { display: inline-flex; align-items: center; gap: 2px; }

/* ── Reports (charts are plain HTML: bars sized in %, hover tip from data-tip) ── */
.vl-indicators { display: grid; grid-template-columns: repeat(4, 1fr); }
.vl-indicators > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; font-size: 12px; }
.vl-indicators > div + div { border-left: 1px solid var(--line); }
.vl-indicators strong { font-size: 20px; font-weight: 600; color: var(--ink-strong); }
@media (max-width: 767.98px) {
  .vl-indicators { grid-template-columns: 1fr 1fr; }
  .vl-indicators > div:nth-child(3) { border-left: 0; }
  .vl-indicators > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.vl-kpi-sub { margin-top: 2px; font-size: 12px; color: var(--ink-muted); }
.vl-chart { padding: 12px 16px 16px; }
.vl-legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-muted); margin-bottom: 8px; }
.vl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vl-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw-created { background: var(--viz-1); }
.sw-done { background: var(--viz-2); }
.vl-cols { position: relative; display: flex; align-items: stretch; gap: 2px; height: 200px; padding: 0 0 22px 28px; }
.vl-cols-grid { position: absolute; inset: 0 0 22px 28px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vl-cols-grid span { border-top: 1px solid var(--line); position: relative; }
.vl-cols-grid span[data-v]::before { content: attr(data-v); position: absolute; left: -28px; top: -8px; width: 22px;
  text-align: right; font-size: 11px; color: var(--ink-muted); }
.vl-col { position: relative; flex: 1; display: flex; flex-direction: column; border-radius: 6px; }
.vl-col:hover { background: var(--gray-50); }
.vl-col-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.vl-col-bars .bar { width: min(14px, 35%); min-height: 0; border-radius: 4px 4px 0 0; position: relative; z-index: 1; }
.vl-col-x { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; z-index: 10; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  width: max-content; max-width: 240px; padding: 6px 8px; border-radius: 6px; background: var(--gray-900); color: var(--on-solid);
  font-size: 12px; line-height: 1.3; white-space: normal; box-shadow: var(--shadow-lg); pointer-events: none; }
.vl-col[data-tip]:hover::after { bottom: auto; top: 0; }
.vl-col:nth-child(-n+4)[data-tip]:hover::after { left: 0; transform: none; }
.vl-col:nth-last-child(-n+3)[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.vl-chart-table { margin-top: 28px; }
.vl-chart-table summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); cursor: pointer; }
.vl-hbars { list-style: none; margin: 0; padding: 8px 16px 12px; display: grid;
  grid-template-columns: fit-content(60%) minmax(60px, 1fr) auto; column-gap: 12px; }
.vl-hbars li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.vl-hbars li.muted { display: block; padding: 16px 0; color: var(--ink-muted); }
.vl-hbar { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; min-height: 32px;
  color: var(--ink); border-radius: 6px; }
.vl-hbar:hover { background: var(--gray-50); color: var(--ink-strong); }
.vl-hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-hbar-track { height: 12px; }
.vl-hbar-fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--viz-1); }
.vl-hbar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.vl-hbar[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.vl-reports .vl-table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
  .vl-col:nth-child(odd) .vl-col-x { visibility: hidden; }
  .vl-header-actions .vl-seg a { padding: 3px 6px; font-size: 12px; }
}

/* Shortcut to the technician app (/m/), shown only on phone-sized screens. */
.vl-app-banner { display: none; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); line-height: 1.35; }
.vl-app-banner > span { flex: 1; }
.vl-app-banner .muted { font-size: 13px; color: var(--ink-muted); }

/* General notices from the Valoriom operators (Consola → Comunicados), above every page. */
.vl-announcement { display: flex; align-items: flex-start; gap: 10px; margin: 12px 20px 0; padding: 10px 8px 10px 12px;
  border-radius: var(--radius); background: color-mix(in srgb, var(--ind) 10%, var(--bg));
  color: var(--ink); line-height: 1.4; }
.vl-announcement-icon { display: inline-flex; padding-top: 1px; color: color-mix(in srgb, var(--ind) 75%, var(--mix-ink)); }
.vl-announcement-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vl-announcement-text strong { color: var(--ink-strong); }
.vl-announcement-text a { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px;
  color: color-mix(in srgb, var(--ind) 75%, var(--mix-ink)); text-decoration: underline; text-underline-offset: 2px; }
.vl-announcement form { margin: -4px 0; }
.vl-announcement.m, .vl-auth-box .vl-announcement, .vl-announcement-preview .vl-announcement { margin: 0 0 12px; }
.vl-announcement + .vl-announcement { margin-top: 8px; }
.vl-auth-box .vl-announcement + .vl-announcement, .vl-announcement.m + .vl-announcement.m { margin-top: 0; }

/* Demo from the home page («Prueba una demo», apps/demos): a bar above every page and the guide. */
.vl-demo-bar { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 6px 12px 6px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg)); line-height: 1.35; }
.vl-demo-bar-icon { display: inline-flex; color: var(--accent-ink); }
.vl-demo-bar-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 13px; }
.vl-demo-bar-text strong { color: var(--ink-strong); }
.vl-demo-bar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.vl-demo-bar.m { margin: 0 0 12px; padding: 8px 8px 8px 12px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--radius); }
.vl-demo-bar.m .vl-demo-bar-text { flex-direction: column; }
.vl-demo-bar.m .vl-demo-bar-sector { display: none; }
.vl-demo-guide { max-width: 860px; }
.vl-demo-guide h1 { font-size: 24px; font-weight: 650; color: var(--ink-strong); letter-spacing: -0.01em; }
.vl-demo-guide > div > p.muted { max-width: 680px; }
.vl-demo-qr { border-radius: 8px; }
.vl-demo-guide-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.vl-demo-guide-steps a { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.vl-demo-guide-steps a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.vl-demo-guide-steps .num { flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.vl-demo-guide-steps strong { display: block; color: var(--ink-strong); font-weight: 600; margin-bottom: 2px; }
.vl-demo-guide-steps span.muted { font-size: 13px; color: var(--ink-muted); }
.vl-demo-highlights { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vl-demo-highlights li { padding: 10px 12px; border-radius: var(--radius); background: var(--gray-50); font-size: 13px; color: var(--ink-muted); }
.vl-demo-highlights strong { display: block; color: var(--ink-strong); font-size: 14px; }
.vl-demo-next { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }

/* Pages that fill the window (Mapa, Planificación): the page never scrolls; the content takes what is
   left under the header and any bar above it (notices, the demo bar) and scrolls inside itself. */
@media (min-width: 992px) {
  .vl-main:has(> .vl-map-layout:not(.simple)), .vl-main:has(> .vl-week-page) { height: 100vh; height: 100dvh; min-height: 0; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
.vl-show-sm { display: none; }
@media (max-width: 991.98px) {
  .vl-record { flex-direction: column; }
  .vl-record-panel { width: 100%; border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
  .vl-tab-body { padding: 20px; }
  .vl-settings { flex-direction: column; }
  .vl-settings-nav { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .vl-settings-nav h6 { display: none; }
}
@media (max-width: 767.98px) {
  .vl-app-banner { display: flex; }
  .vl-sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
  html.sidebar-open .vl-sidebar { transform: none; }
  /* Dim the page behind the open menu; a tap outside closes it (app.js). */
  .vl-main::before { content: ""; position: fixed; inset: 0; z-index: 1025; background: rgba(0, 0, 0, 0.45);
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  html.sidebar-open .vl-main::before { opacity: 1; pointer-events: auto; }
  .vl-sidebar [data-sidebar-toggle] { display: none; }  /* «Contraer» means nothing in the phone menu */
  .vl-kpi { padding: 12px; }
  .vl-kpi-value { font-size: 20px; margin-top: 2px; }
  /* The phone menu always opens full width, so the collapsed look never applies there. */
  html.sidebar-collapsed .vl-sidebar .sb-label, html.sidebar-collapsed .vl-sidebar .sb-group > summary,
  html.sidebar-collapsed .vl-sidebar .sb-site, html.sidebar-collapsed .vl-sidebar .sb-org-text,
  html.sidebar-collapsed .vl-sidebar .sb-org > .vl-icon { opacity: 1; pointer-events: auto; }
  html.sidebar-collapsed .vl-sidebar .sb-site { max-height: 44px; padding-bottom: 4px; }
  html.sidebar-collapsed .vl-sidebar .sb-group > summary { height: 26px; }
  html.sidebar-collapsed .vl-sidebar .sb-group { margin-top: 12px; border-top: 0; padding-top: 0; }
  html.sidebar-collapsed .vl-sidebar .sb-org { padding: 6px; }
  html.sidebar-collapsed .vl-sidebar .sb-org .vl-env-badge { top: -3px; right: 3px; padding: 1px 5px; font-size: 10px; }
  html.sidebar-collapsed .vl-sidebar .sb-link { padding-left: 8px; padding-right: 8px; }
  html.sidebar-collapsed .vl-sidebar .sb-link.sb-sub { padding-left: 20px; }
  .vl-main, html.sidebar-collapsed .vl-main { margin-left: 0; }
  .vl-menu-btn { display: inline-flex !important; }
  .vl-header { padding: 0 12px; gap: 8px; }
  .vl-crumbs { font-size: 16px; }
  .vl-toolbar, .vl-list-wrap { padding-left: 12px; padding-right: 12px; }
  .vl-toolbar .vl-search { width: 100%; }
  .vl-hide-sm { display: none; }
  .vl-show-sm { display: inline; }
  .vl-demo-bar:not(.m) { padding: 6px 8px 6px 12px; }
  .vl-demo-bar-sector { display: none; }
  .vl-demo-bar-text { flex-direction: column; }
}
.min-w-0 { min-width: 0; }

/* Column header filters */
.vl-th { display: inline-flex; align-items: center; gap: 4px; margin: 0 -6px; padding: 2px 6px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font: inherit; cursor: pointer; }
.vl-th:hover, .vl-th[aria-expanded="true"] { background: var(--gray-200); color: var(--ink-strong); }
.vl-th.active { color: var(--ink-strong); font-weight: 500; }
.vl-th-pop { width: 260px; padding: 12px; }
.vl-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 8px; border-radius: var(--radius);
  background: var(--gray-100); font-size: 13px; color: var(--ink-strong); white-space: nowrap; }
.vl-chip .muted { color: var(--ink-muted); }
.vl-chip a { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: var(--ink-muted); }
.vl-chip a:hover { background: var(--gray-200); color: var(--ink-strong); }
.vl-table thead th { overflow: visible; }
.vl-sort { display: flex; flex-direction: column; gap: 2px; }
.vl-sort a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--ink); }
.vl-sort a:hover { background: var(--gray-100); }
.vl-sort a.active { background: var(--gray-100); color: var(--ink-strong); font-weight: 500; }
/* «Columnas»: choose and order the columns of a list */
.vl-btn.vl-on { background: var(--gray-200); color: var(--ink-strong); }
.vl-cols-pop { width: 300px; }
.vl-col-list { list-style: none; margin: 0; padding: 0; max-height: min(360px, 55vh); overflow-y: auto; }
.vl-col-row { display: flex; align-items: center; gap: 2px; padding: 1px 2px; border-radius: 6px; }
.vl-col-row:hover { background: var(--gray-100); }
.vl-col-row.dragging { background: var(--gray-100); box-shadow: 0 0 0 1px var(--gray-300); }
.vl-col-dragging, .vl-col-dragging * { cursor: grabbing !important; user-select: none; }
.vl-col-grip { display: inline-grid; place-items: center; width: 20px; height: 28px; color: var(--ink-muted); cursor: grab; touch-action: none; user-select: none; }
.vl-col-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; padding: 4px; cursor: pointer; }
.vl-col-name .form-check-input { margin: 0; flex: none; }
.vl-col-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-col-row .vl-btn.icon { width: 24px; height: 24px; padding: 0; }
.vl-col-row:first-child [data-col-move="up"], .vl-col-row:last-child [data-col-move="down"] { visibility: hidden; }

/* Work orders */
.text-overdue { color: var(--c-red) !important; }
.vl-composer { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0 8px; }
.vl-composer textarea { flex: 1; }
.vl-inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.vl-inline-form .form-control, .vl-inline-form .form-select { width: auto; min-width: 0; flex: 1 1 140px; }
.vl-inline-form .form-select[name="level"] { flex: 3 1 280px; }
.vl-failure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.vl-failure-grid label { display: block; }
.vl-failure-grid .form-select:disabled { opacity: .55; }
@media (max-width: 767.98px) { .vl-failure-grid { grid-template-columns: 1fr; } }
.vl-ftree { list-style: none; margin: 0; padding: 0; }
.vl-ftree .vl-ftree { margin-left: 22px; padding-left: 14px; border-left: 1px solid var(--line); }
.vl-ftree-row { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--line-soft); }
.vl-ftree-row.inactive .vl-ftree-code, .vl-ftree-row.inactive .vl-ftree-desc { color: var(--ink-muted); }
.vl-ftree-level { width: 64px; flex-shrink: 0; font-size: 12px; color: var(--ink-muted); }
.vl-ftree-code { font-weight: 600; color: var(--ink-strong); white-space: nowrap; }
.vl-ftree-desc { flex: 1; min-width: 0; color: var(--ink); }
.vl-ftree-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.vl-ftree-row:hover .vl-ftree-actions, .vl-ftree-row:focus-within .vl-ftree-actions { opacity: 1; }
@media (hover: none) { .vl-ftree-actions { opacity: 1; } }
.vl-ftree-add { margin: 4px 0 8px 0; }
.vl-ftree-add > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--ink-muted); padding: 4px 0; }
.vl-ftree-add > summary::-webkit-details-marker { display: none; }
.vl-ftree-add > summary:hover { color: var(--ink-strong); }
.vl-ftree-add .vl-inline-form { margin: 4px 0 8px; }
.vl-inline-form .vl-ftree-code-input { flex: 0 1 160px; }
.vl-subsection-title { font-size: 14px; font-weight: 600; color: var(--ink-strong); margin: 20px 0 6px; }
.vl-dropdown-form { min-width: 260px; }

.vl-tasks { list-style: none; padding: 0; margin: 12px 0 0; }
.vl-task { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--line-soft); }
.vl-task form { margin: 0; }
.vl-task-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--gray-400); background: var(--bg);
  display: grid; place-items: center; padding: 0; color: var(--on-solid); }
.vl-task.done .vl-task-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vl-task-text { flex: 1; color: var(--ink-strong); }
.vl-task.done .vl-task-text { color: var(--ink-muted); text-decoration: line-through; }
.vl-task-meta { font-size: 12px; color: var(--ink-muted); }
.vl-task-text.has-sub { display: flex; flex-direction: column; padding: 6px 0; min-width: 0; }
.vl-task.done .vl-task-text.has-sub { text-decoration: none; }
.vl-task.done .vl-task-main { text-decoration: line-through; }
a.vl-task-main { color: inherit; text-decoration-color: var(--gray-300); }
a.vl-task-main:hover { text-decoration: underline; }
.vl-task-sub { font-size: 12px; color: var(--ink-muted); }
/* Tasks with a result: «Correcto / No correcto» or a measured value. */
.vl-task { padding: 6px 0; }
.vl-task-body { flex: 1 1 0; min-width: 0; }
.vl-task-result, .vl-task > .vl-ind { flex-shrink: 0; }
.vl-task-body .vl-task-text { margin-right: 6px; }
.vl-task-body .vl-task-meta { display: flex; flex-wrap: wrap; gap: 0 10px; }
.vl-task-body .vl-task-meta:empty { display: none; }
.vl-task.has-result.done .vl-task-text { color: var(--ink-strong); text-decoration: none; }
.vl-task.failed .vl-task-check { background: var(--c-red); border-color: var(--c-red); color: var(--on-solid); }
.vl-task-req { background: color-mix(in srgb, var(--c-orange) 16%, var(--bg)); color: color-mix(in srgb, var(--c-orange) 55%, var(--mix-ink)); }
.vl-task-error { font-size: 12px; color: var(--c-red); }
.vl-task-value { font-weight: 600; color: var(--ink-strong); }
.vl-task-result { display: flex; align-items: center; gap: 6px; }
.vl-passfail { display: inline-flex; padding: 2px; border-radius: var(--radius); background: var(--gray-100); }
.vl-passfail button { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 0;
  border-radius: 6px; background: none; color: var(--ink); font-size: 13px; white-space: nowrap; }
.vl-passfail button:hover { color: var(--ink-strong); }
.vl-passfail button[aria-pressed="true"] { background: var(--bg); box-shadow: var(--shadow-sm); color: var(--ink-strong); font-weight: 500; }
.vl-passfail .ok[aria-pressed="true"] .vl-icon { color: var(--c-green); }
.vl-passfail .nok[aria-pressed="true"] .vl-icon { color: var(--c-red); }
html[data-theme="dark"] .vl-passfail button[aria-pressed="true"] { background: var(--gray-300); }
.vl-measure .form-control { width: 90px; height: 30px; }
.vl-task-form { display: flex; flex-direction: column; gap: 8px; }
.vl-task-form-row { display: flex; gap: 8px; }
.vl-task-form-row .form-select { flex: 0 0 200px; width: auto; }
.vl-task-form-row[data-show-if] .form-control { flex: 1 1 0; min-width: 0; }
.vl-check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.vl-check-inline .form-check-input { margin: 0; }
@media (max-width: 640px) {
  .vl-task { flex-wrap: wrap; }
  .vl-task-body { flex-basis: calc(100% - 80px); }
  .vl-task-result { margin-left: 28px; }
  .vl-task-form-row:first-child { flex-wrap: wrap; }
  .vl-task-form-row:first-child .form-control { flex-basis: 100%; }
  .vl-task-form-row .form-select { flex: 1 1 0; }
}
.sb-link.sb-sub { padding-left: 20px; }
/* Views under a menu entry (Asignadas a mí, Bajo mínimo, saved views…) only show on that entry's
   screen: they unfold and fold with the same 0.2s ease as the sidebar (partials/_sidebar_subs_js.html
   animates the change between screens). Hidden ones can't be tabbed to. A count on a hidden view
   moves up to its entry (.sb-count-up). */
.sb-subs { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows 0.2s ease, opacity 0.15s ease, visibility 0s linear 0.2s; }
.sb-subs > div { min-height: 0; overflow: hidden; }
.sb-item.open > .sb-subs { grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows 0.2s ease, opacity 0.15s ease 0.05s, visibility 0s; }
.sb-count-up { transition: opacity 0.15s ease; }
.sb-item.open > .sb-link .sb-count-up { opacity: 0; }
.sb-still .sb-subs, .sb-still .sb-count-up { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .sb-subs, .sb-count-up { transition: none !important; } }
.sb-link.sb-default .vl-icon { fill: currentColor; }
html.sidebar-collapsed .vl-sidebar .sb-link.sb-sub { padding-left: 10px; }
.vl-card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.vl-card-head h2 { font-size: 16px; font-weight: 600; color: var(--ink-strong); margin: 0; }
.vl-card .vl-table tbody td:first-child { padding-left: 16px; }
@media (max-width: 1499.98px) { .vl-hide-lg { display: none; } }
.vl-table tbody td.vl-empty { padding: 40px 10px 32px; height: auto; }

/* Bulk selection */
.vl-table .vl-check-cell { width: 36px; padding-right: 0; }
.vl-table thead .vl-check-cell .form-check-input, .vl-table tbody .vl-check-cell .form-check-input { margin: 0; vertical-align: middle; }
.vl-table tbody tr.selected td { background: var(--gray-50); }
.vl-bulkbar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1040; display: flex; align-items: center;
  gap: 8px; padding: 8px 10px 8px 16px; border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-lg); }
.vl-bulkbar[hidden] { display: none; }
.vl-bulk-count { color: var(--ink-muted); margin-right: 8px; white-space: nowrap; }
.vl-bulk-count strong { color: var(--ink-strong); }
.vl-bulkbar .dropdown-menu { max-height: 320px; overflow-y: auto; }
.vl-bulkbar { width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
.vl-bulk-search { position: sticky; top: -8px; margin-top: -8px; padding: 8px 8px 4px; background: var(--bg); z-index: 1; }
.vl-bulk-search .form-control { height: 32px; }
.vl-bulk-field { min-width: 240px; padding: 12px; }
.vl-bulk-field .form-control { height: 36px; }
@media (max-width: 575.98px) {
  .vl-bulkbar { bottom: 12px; padding: 8px; gap: 6px; }
  .vl-bulk-count { width: 100%; text-align: center; margin-right: 0; }
}
.vl-view-row { display: flex; align-items: center; gap: 2px; }
.vl-view-row .dropdown-item { flex: 1; min-width: 0; }
.vl-view-row .dropdown-item span:not(.vl-badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-view-row .dropdown-item span.vl-view-name { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; overflow: visible; white-space: normal; }
.vl-view-name small { font-size: 12px; line-height: 1.2; color: var(--accent-ink); }
.vl-view-row .dropdown-item .vl-badge { flex-shrink: 0; }
.vl-th-pop.vl-views-pop { width: 300px; }
.vl-view-star { color: var(--gray-500); }
.vl-view-star.on { color: var(--accent-ink); }
.vl-view-star.on .vl-icon { fill: currentColor; }

/* Service requests & QR landing */
.vl-form-narrow { max-width: 560px; }
.vl-form-narrow .form-control, .vl-form-narrow .form-select { height: 36px; }
.vl-form-narrow textarea.form-control { height: auto; }
.vl-asset-banner { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 20px; border-radius: 10px; background: var(--gray-50); }
.vl-asset-banner .vl-avatar.lg { width: 44px; height: 44px; }
.vl-qr-landing { max-width: 420px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.vl-qr-landing h1 { font-size: 22px; font-weight: 600; color: var(--ink-strong); margin: 16px 0 4px; }
.vl-qr-landing .vl-btn.lg { height: 48px; font-size: 16px; }
.vl-subtitle { font-size: 15px; font-weight: 600; color: var(--ink-strong); margin: 24px 0 10px; }
.vl-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: var(--on-accent);
  font-size: 11px; display: inline-grid; place-items: center; }

/* Map */
.vl-map-layout { display: flex; flex: 1; min-height: 0; }
.vl-map { flex: 1; min-height: 320px; background: var(--gray-100); z-index: 0; }
.vl-map-panel { width: 340px; flex-shrink: 0; border-left: 1px solid var(--line); overflow-y: auto; }
/* Map in a record's dialog: only the map, filling the frame (no header, legend or search). */
html.vl-embed body:has(.vl-map-layout.simple) .vl-header { display: none; }
.vl-map-layout.simple, .vl-map-layout.simple .vl-map { min-height: 100vh; }
.vl-map-toggle { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; color: var(--ink-strong); }
.vl-map-toggle .form-check-input { margin: 0; }
.vl-map-unlocated { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border-radius: 6px; color: var(--ink); }
.vl-map-unlocated:hover { background: var(--gray-100); }
.vl-map-unlocated .muted { margin-left: auto; font-size: 12px; color: var(--ink-muted); }
.vl-marker { background: none; border: 0; }
.vl-pin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 4px solid var(--ind, var(--c-gray));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.vl-map-toggle .vl-pin { width: 14px; height: 14px; border-width: 3px; box-shadow: none; }
.vl-pin.inherited { border-style: dotted; }
/* The point whose card is open in the map panel. */
.vl-marker.selected .vl-pin, .vl-marker.selected .vl-pin-loc { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent-ink); }
.vl-pin-loc { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--gray-900);
  color: var(--on-solid); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.vl-map-toggle .vl-pin-loc { width: 18px; height: 18px; border-radius: 5px; box-shadow: none; }
.vl-map-toggle .vl-pin-loc .vl-icon { width: 12px; height: 12px; }
.marker-cluster { background: color-mix(in srgb, var(--gray-900) 25%, transparent); border-radius: 50%; }
.marker-cluster div { width: 30px; height: 30px; margin: 5px; border-radius: 50%; background: var(--gray-900); color: var(--on-solid);
  display: grid; place-items: center; font: 600 12px/1 var(--bs-body-font-family); }
.leaflet-container { font-family: var(--bs-body-font-family); }
html[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
.vl-picker-map { height: 260px; border-radius: 10px; overflow: hidden; z-index: 0; }
@media (max-width: 991.98px) {
  .vl-map-layout { flex-direction: column; }
  .vl-map { min-height: 60vh; }
  .vl-map-panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
}

/* Floor plans */
.vl-plan { background: var(--gray-50); }
.vl-plan.armed { cursor: crosshair; }
.vl-plan.editing .leaflet-marker-draggable { cursor: move; }
.vl-plan-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 6px; margin-bottom: 2px; border: 1px solid transparent;
  border-radius: 8px; background: none; text-align: left; color: var(--ink); cursor: pointer; }
.vl-plan-item:hover { background: var(--gray-100); }
.vl-plan-item.armed { background: var(--gray-100); border-color: var(--gray-900); }
.vl-plan-item[draggable="true"] { cursor: grab; }
.vl-plan-item .strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-strong); }
.vl-plan-item .muted { font-size: 12px; color: var(--ink-muted); }
.vl-plan-item .vl-pin { width: 14px; height: 14px; border-width: 3px; box-shadow: none; flex-shrink: 0; }
.vl-plan-item .vl-pin-loc { width: 18px; height: 18px; border-radius: 5px; box-shadow: none; flex-shrink: 0; }
.vl-plan-item .vl-pin-loc .vl-icon { width: 12px; height: 12px; }
.vl-pin-loc.has-plan { background: var(--c-blue); color: #fff; }
.leaflet-tooltip { font-family: var(--bs-body-font-family); font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.vl-plan-preview { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); background: var(--gray-50); }

/* Related-record links and navigation trail */
.vl-field-link { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--gray-300);
  text-underline-offset: 3px; }
.vl-field-link:hover { text-decoration-color: var(--ink-strong); }
.vl-directions-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vl-field-directions { align-items: center; }
.vl-crumbs .vl-trail, .vl-crumbs .vl-trail-step { display: contents; }
/* On a phone the path keeps only the record you came from and the one you are on. */
@media (max-width: 767.98px) { .vl-crumbs .vl-trail-step:not(:last-child) { display: none; } }

/* Planning */
.vl-steps-list { list-style: decimal; padding-left: 22px; margin: 12px 0 0; }
.vl-steps-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-strong); }
.vl-steps-list li > span { display: inline-block; min-width: 0; }
.vl-steps-list li form { float: right; margin: -4px 0 0; }
.vl-steps-list li.vl-empty { list-style: none; margin-left: -22px; }
.vl-step-edit > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.vl-step-edit > summary::-webkit-details-marker { display: none; }
.vl-step-edit > summary > span { flex: 1; min-width: 0; }
.vl-step-edit > summary .vl-icon { color: var(--ink-muted); opacity: 0; }
.vl-step-edit > summary:hover .vl-icon, .vl-step-edit > summary:focus-visible .vl-icon, .vl-step-edit[open] > summary .vl-icon { opacity: 1; }
@media (hover: none) { .vl-step-edit > summary .vl-icon { opacity: 1; } }
.vl-steps-list .vl-step-edit form { float: none; margin: 10px 0 4px; }
.vl-forecast { list-style: none; padding: 0; margin: 12px 0 0; max-width: 520px; }
.vl-forecast li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; }
.vl-forecast li + li { border-top: 1px solid var(--line-soft); border-radius: 0; }
.vl-forecast li.next { background: var(--gray-50); }
.vl-forecast li.overdue .vl-forecast-date { color: var(--c-red); }
.vl-forecast-date { color: var(--ink-strong); font-weight: 500; }


/* ── Legal pages ───────────────────────────────────────────────────────── */
.vl-legal { min-height: 100vh; background: var(--bg); padding: 24px 20px 64px; }
.vl-legal-head { max-width: 760px; margin: 0 auto 32px; display: flex; flex-direction: column; gap: 16px; }
.vl-legal-brand { display: inline-flex; align-items: center; text-decoration: none; }
.vl-legal-brand .vl-logo { height: 24px; }
.vl-legal-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.vl-legal-nav a { color: var(--ink-muted); text-decoration: none; }
.vl-legal-nav a:hover, .vl-legal-nav a.active { color: var(--ink-strong); }
.vl-legal-nav a.active { font-weight: 600; }
.vl-legal-doc { max-width: 760px; margin: 0 auto; color: var(--ink); line-height: 1.6; }
.vl-legal-doc h1 { font-size: 24px; font-weight: 600; color: var(--ink-strong); margin-bottom: 4px; }
.vl-legal-doc h2 { font-size: 16px; font-weight: 600; color: var(--ink-strong); margin: 28px 0 8px; }
.vl-legal-doc a { color: var(--ink-strong); }
.vl-legal-date { color: var(--ink-muted); margin-bottom: 24px; }
.vl-legal-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; }
.vl-legal-table th, .vl-legal-table td { border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; text-align: left; vertical-align: top; }
.vl-legal-table th { color: var(--ink-muted); font-weight: 500; }
@media (max-width: 600px) { .vl-legal-table { display: block; overflow-x: auto; } }
.vl-legal-todo { background: var(--gray-100); color: var(--ink-strong); padding: 0 4px; border-radius: 4px; }
.vl-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 28px; font-size: 12px; }
.vl-legal-links a { color: var(--ink-muted); text-decoration: none; }
.vl-legal-links a:hover { color: var(--ink-strong); }
.vl-auth-legal { font-size: 12px; color: var(--ink-muted); text-align: center; margin-top: 12px; }
.vl-auth-legal a { color: var(--ink-strong); }
.vl-danger-box { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-top: 16px; max-width: 560px; }

/* Console: trial and internal notes of an organization */
.vl-card-body { padding: 12px 16px 16px; }
.vl-card-body .vl-composer { margin-top: 0; }
.vl-notes { max-height: 420px; overflow-y: auto; }
.vl-notes li > form { padding-top: 2px; }
/* A tab of its own (history, emails): the list grows with the page, no scroll inside. */
.vl-notes.vl-notes-full { max-height: none; overflow: visible; }

/* Console: possible customers (funnel above the list, search results) */
.vl-funnel { display: flex; gap: 8px; padding: 12px 20px 0; overflow-x: auto; }
.vl-funnel-step { display: flex; flex-direction: column; gap: 4px; min-width: 120px; flex: 1 0 auto; padding: 10px 12px;
  border-radius: var(--radius); background: var(--gray-50); color: var(--ink); text-decoration: none; font-size: 13px; }
.vl-funnel-step:hover { background: var(--gray-100); color: var(--ink); }
.vl-funnel-step strong { font-size: 20px; font-weight: 600; }
.vl-text { white-space: pre-line; }
.vl-usage-nums { font-size: 14px; margin-bottom: 8px; }
.vl-usage-nums strong { font-size: 20px; font-weight: 600; }
.vl-usage-bar { height: 10px; border-radius: 5px; background: var(--gray-100); overflow: hidden; }
.vl-usage-bar > span { display: block; height: 100%; min-width: 2px; background: var(--ind); border-radius: 5px; }
.vl-usage-form { align-items: center; }
.vl-usage-form .form-control { flex: 0 0 110px; }

/* Consola → posible cliente → «Su web» */
.vl-web-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.vl-web-hints { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.vl-web-hints li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--gray-50); }
.vl-web-hints .muted { font-size: 13px; }
.vl-web-apply td.vl-text { white-space: pre-line; overflow-wrap: anywhere; min-width: 160px; }
.vl-web-apply td.actions { width: 1%; white-space: nowrap; }
/* Research: findings of a prospect and the import preview, long texts wrap. */
.vl-research td.vl-text { white-space: normal; overflow-wrap: anywhere; min-width: 200px; }
.vl-research td.actions { width: 1%; white-space: nowrap; }
.vl-research .vl-ind { margin-left: 4px; }
.vl-mail-preview { width: 100%; max-width: 760px; height: 900px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }

/* Audio recorder (partials/_recorder.html, js/recorder.js): voice notes and call recordings. */
.vl-recorder { display: flex; flex-direction: column; gap: 8px; }
.vl-rec-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vl-rec-bar [data-rec-start][aria-busy] { cursor: progress; opacity: 0.75; }
.vl-rec-bar [data-rec-start][aria-busy] .vl-icon { animation: vl-rec-blink 1.2s ease-in-out infinite; }
.vl-rec-live { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; height: 32px; border-radius: var(--radius); background: color-mix(in srgb, var(--c-red) 12%, var(--bg)); color: color-mix(in srgb, var(--c-red) 75%, var(--mix-ink)); font-variant-numeric: tabular-nums; font-weight: 500; }
.vl-recorder [hidden], .vl-recorder[hidden] { display: none !important; }
.vl-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-red); animation: vl-rec-blink 1.2s ease-in-out infinite; }
.vl-rec-live.is-paused .vl-rec-dot { animation: none; opacity: 0.4; }
@keyframes vl-rec-blink { 50% { opacity: 0.25; } }
/* What the microphone hears, along the bottom edge of the red pill. */
.vl-rec-live { position: relative; overflow: hidden; }
.vl-rec-level { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--c-red) 20%, var(--bg)); }
.vl-rec-level i { display: block; height: 100%; width: calc(var(--level, 0) * 100%); background: var(--c-red); transition: width 0.1s linear; }
.vl-rec-live.is-paused .vl-rec-level { opacity: 0.4; }
@media (prefers-reduced-motion: reduce) { .vl-rec-dot, .vl-rec-bar [data-rec-start][aria-busy] .vl-icon { animation: none; } }
/* A call recorded in this computer: one level for the microphone and one for the call's sound. */
.vl-rec-meters { display: inline-flex; align-items: center; gap: 12px; }
.vl-rec-meter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.vl-rec-meter i { position: relative; width: 56px; height: 6px; border-radius: 3px; background: var(--gray-200); overflow: hidden; }
.vl-rec-meter i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--level, 0) * 100%); background: var(--accent); transition: width 0.1s linear; }
.vl-recorder [data-state="paused"] .vl-rec-meter, .vl-recorder[data-state="paused"] .vl-rec-meter { opacity: 0.5; }
.vl-rec-hint { margin: 0; max-width: 62ch; }
.vl-rec-warn { margin: 0; padding: 6px 10px; border-radius: var(--radius); font-size: 13px; background: color-mix(in srgb, var(--c-red) 10%, var(--bg)); color: color-mix(in srgb, var(--c-red) 75%, var(--mix-ink)); }
@media (max-width: 575.98px) { .vl-rec-source .vl-seg { display: flex; } .vl-rec-source .vl-seg button { flex: 1; justify-content: center; white-space: normal; text-align: center; } }
.vl-rec-meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--ink-muted); }
.vl-rec-meta form { display: inline; }
.vl-rec-info .vl-icon { vertical-align: -3px; margin-right: 2px; }
.vl-viewer.is-audio { width: min(520px, calc(100vw - 32px)); }
/* In the technician's app the recorder's buttons are as big as «Hacer foto». */
.vl-m-voice { margin-top: 8px; }
.vl-m-voice [data-rec-start], .vl-m-voice [data-rec-save] { flex: 1 1 100%; justify-content: center; height: 44px; font-size: 15px; }
.vl-m-voice [data-rec-stop] { flex: 1; justify-content: center; height: 44px; }

/* Audio player (VL.player in js/recorder.js): the same in every browser and theme. */
.vl-player { display: flex; align-items: center; gap: 8px; width: min(420px, 100%); height: 44px; padding: 0 8px; border-radius: 22px; background: var(--gray-100); color: var(--ink-strong); }
.vl-player[hidden] { display: none; }
.vl-player.is-loading { opacity: 0.6; cursor: progress; }
.vl-player-btn { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.vl-player-btn:hover { background: var(--gray-200); }
.vl-player-time { flex: none; min-width: 36px; font-size: 14px; font-variant-numeric: tabular-nums; }
.vl-player-bar { flex: 1; min-width: 0; height: 4px; margin: 0 4px; border-radius: 2px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: linear-gradient(to right, var(--ink-strong) var(--p, 0%), var(--gray-300) var(--p, 0%)); }
.vl-player-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-strong); border: 0; }
.vl-player-bar::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-strong); border: 0; }
.vl-recorder .vl-player { flex: 1 1 0; width: auto; min-width: 0; max-width: 320px; height: 36px; }
.vl-viewer-body .vl-player { width: 100%; margin: 24px 16px; background: var(--bg); }
.vl-m-voice .vl-player { flex: 1; width: auto; min-width: 0; }

/* Settings: the irreversible action sits apart, at the end and in red. */
.vl-settings-nav h6.vl-danger-head { color: var(--c-red); margin-top: 12px; }
.vl-settings-nav .vl-danger-link, .vl-settings-nav .vl-danger-link .vl-icon { color: var(--c-red); }

/* Customer signature on the work report (OT ficha, phone): navy ink on transparent, lightened in dark mode */
.vl-sign-done { display: flex; gap: 12px; align-items: center; }
.vl-sign-done img { width: 120px; height: 48px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
html[data-theme="dark"] .vl-sign-done img { filter: invert(1) hue-rotate(180deg); }

/* Customer signature (parte de trabajo): js/signature.js */
.vl-sign { color: var(--ink-strong); }
.vl-sign-pad { position: relative; border: 1.5px dashed var(--gray-300); border-radius: 12px; background: var(--bg); }
.vl-sign-pad canvas { display: block; width: 100%; aspect-ratio: 5 / 2; touch-action: none; cursor: crosshair; }
.vl-sign-pad::after { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 14px; pointer-events: none; }
.vl-sign.is-empty .vl-sign-pad::after { content: "Firme aquí"; }
.vl-sign-line { position: absolute; left: 8%; right: 8%; bottom: 22%; border-bottom: 1px solid var(--line); pointer-events: none; }
.vl-sign-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0 10px; }
.vl-sign-dialog { width: min(640px, calc(100vw - 32px)); }

/* «Añadir sin salir» (apps/core/dialogs.py, partials/_add_dialog.html): add a row to a table of a
   record's page without leaving it, choosing an existing record or creating one */
.vl-add-dialog { width: min(560px, calc(100vw - 32px)); overflow: visible; }
.vl-add-dialog.lg { width: min(760px, calc(100vw - 32px)); }
@media (max-height: 760px) { .vl-add-dialog { overflow: auto; max-height: calc(100vh - 32px); } }
@media (max-height: 900px) { .vl-add-dialog.lg { overflow: auto; max-height: calc(100vh - 32px); } }
.vl-add-body { padding: 16px 20px 20px; }
.vl-add-new { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.vl-add-new > summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--ink-strong); font-weight: 500; }
.vl-add-new > summary::-webkit-details-marker { display: none; }
.vl-add-new > summary .vl-icon { transform: rotate(-90deg); transition: transform 0.15s; }
.vl-add-new[open] > summary .vl-icon { transform: none; }
.vl-sign-body { padding: 16px 20px 20px; }
.vl-sign-body .form-label { display: block; margin-top: 8px; }
.vl-sign-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Pending next step of a possible customer (console/_next_step_alert.html): blue while it is
   ahead, orange (like a pending reply) from its day on. */
.vl-reply-alert.is-step { background: color-mix(in srgb, var(--c-blue) 10%, var(--bg)); border-color: color-mix(in srgb, var(--c-blue) 30%, var(--bg)); }
.vl-reply-alert.is-step > svg { color: var(--c-blue); }
/* «Pendiente»: what Claude prepared waits for review (prospect page) */
.vl-reply-alert.is-review { background: color-mix(in srgb, var(--c-pink) 9%, var(--bg)); border-color: color-mix(in srgb, var(--c-pink) 30%, var(--bg)); align-items: flex-start; }
.vl-reply-alert.is-review > svg { color: var(--c-pink); margin-top: 2px; }
.vl-review-note { display: block; margin-top: 4px; color: var(--gray-700); overflow-wrap: anywhere; }
/* «Añadir al calendario» → Google Calendar: name, then «Ver» and «Guardar ya» as icon buttons. */
.vl-cal-row { display: flex; align-items: center; gap: 2px; padding-right: 4px; }
.vl-cal-row .vl-cal-name { display: inline-flex; align-items: center; gap: 8px; flex: 1; padding: 6px 8px; white-space: nowrap; }
.vl-cal-row .vl-cal-name .vl-icon { color: var(--gray-700); }
.vl-cal-row form { margin: 0; }
.vl-cal-row .vl-btn.icon { color: var(--accent-ink); }

/* Admin → Personal → Finanzas (apps/personal) */
.text-neg { color: var(--c-red) !important; }
/* A gain in green, a loss in red (personal.gain_class). --c-green on the warm white is too pale
   for text (2,9:1), so text uses --pos-ink: a deeper green in light mode (4,7:1), the same in dark. */
.text-pos { color: var(--pos-ink) !important; }
.vl-table tr.is-current td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.vl-table td.num, .vl-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vl-kpi-main .vl-kpi-value { font-size: 28px; }
.vl-finance .vl-table td:first-child { white-space: normal; }
/* Inversiones → Por año: the taxes of each year and where they come from (personal/_tax_dialog.html). */
/* Admin → Sistema → «Copiar PROD a PRE»: what the NAS said about one copy. */
.vl-precopy-out { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.vl-precopy-out[open] { display: flex; flex-direction: column; }
.vl-precopy-body { padding: 12px 16px 16px; overflow: auto; }
.vl-precopy-body pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.vl-tax-cell { display: inline-flex; align-items: center; gap: 4px; }
.vl-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-muted); cursor: pointer; }
.vl-info-btn:hover, .vl-info-btn:focus-visible { background: var(--gray-100); color: var(--accent-ink); }
.vl-tax { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.vl-tax[open] { display: flex; flex-direction: column; }
.vl-tax-body { padding: 12px 16px 16px; overflow: auto; font-size: 13px; }
.vl-tax-body h3 { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.vl-tax-body p { margin: 0 0 4px; }
.vl-tax-body ul { margin: 0; padding-left: 18px; }
.vl-tax-table { width: 100%; border-collapse: collapse; }
.vl-tax-table td { padding: 3px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.vl-tax-table td.num { padding-left: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vl-tax-table tr.total td { font-weight: 600; color: var(--ink-strong); }
/* Inversiones: the price chart of a product (personal/_price_chart.html, js/price_chart.js). */
/* The button at the end of each row of «Cartera»: an action in blue with room from the last figure. */
.vl-table td.vl-pchart-col, .vl-table th.vl-pchart-col { position: relative; width: 1%; padding-left: 12px; padding-right: 6px; text-align: right; }
.vl-pchart-col .vl-btn { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.vl-pchart-col .vl-btn:hover, .vl-pchart-col .vl-btn:focus-visible { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.vl-pchart { width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.vl-pchart[open] { display: flex; flex-direction: column; }
.vl-pchart-body { padding: 12px 16px 14px; overflow: auto; }
.vl-pchart-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.vl-pchart-price { font-size: 24px; font-weight: 600; color: var(--ink-strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.vl-pchart-change { font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.vl-pchart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vl-pchart-ranges button { padding: 3px 9px; font-variant-numeric: tabular-nums; }
.vl-pchart-kinds button { padding: 3px 7px; }
.vl-pchart-plot { position: relative; height: 300px; touch-action: pan-y; user-select: none; }
.vl-pchart-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vl-pchart-plot.is-loading svg { opacity: 0.45; transition: opacity 0.2s; }
.vl-pchart-plot .grid { stroke: var(--line-soft); stroke-width: 1; }
.vl-pchart-plot .axis { fill: var(--ink-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.vl-pchart-plot .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vl-pchart-plot .fill-top { stop-color: var(--accent); stop-opacity: 0.16; }
.vl-pchart-plot .fill-bottom { stop-color: var(--accent); stop-opacity: 0; }
.vl-pchart-plot .ref { stroke-width: 1.5; stroke-dasharray: 4 4; }
.vl-pchart-plot .ref.close { stroke: var(--ink-muted); }
.vl-pchart-plot .ref.avg { stroke: var(--viz-2); }
.vl-pchart-plot .edge { fill: var(--ink); font-size: 11px; }
.vl-pchart-plot .trade { stroke: var(--bg); stroke-width: 2; }
.vl-pchart-plot .trade.buy { fill: var(--viz-2); }
.vl-pchart-plot .trade.sell { fill: var(--bg); stroke: var(--viz-2); }
/* Candle colours as TradingView's (Tzvetan's model): mint and coral on dark, a deeper green on the light canvas. */
.vl-pchart { --candle-up: #089981; --candle-down: #f23645; }
html[data-theme="dark"] .vl-pchart { --candle-up: #4cd7a2; }
.vl-pchart-plot .candle { stroke: none; }
.vl-pchart-plot .candle.up { fill: var(--candle-up); }
.vl-pchart-plot .candle.down { fill: var(--candle-down); }
.vl-pchart-plot .hair { stroke: var(--ink-muted); stroke-width: 1; }
.vl-pchart-plot .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.vl-pchart-tip { position: absolute; top: -6px; z-index: 1; padding: 6px 9px; border-radius: var(--radius); background: var(--bg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12px; color: var(--ink); white-space: nowrap;
  pointer-events: none; font-variant-numeric: tabular-nums; }
.vl-pchart-tip strong { color: var(--ink-strong); font-weight: 600; }
.vl-pchart-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  text-align: center; color: var(--ink-muted); font-size: 13px; }
.vl-pchart-msg[hidden] { display: none; }
.vl-pchart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; min-height: 18px; margin-top: 6px; font-size: 12px; color: var(--ink); }
.vl-pchart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vl-pchart-legend .key { display: inline-block; width: 16px; height: 0; border-top: 1.5px dashed var(--ink-muted); }
.vl-pchart-legend .key.avg { border-top-color: var(--viz-2); }
.vl-pchart-legend .key.buy, .vl-pchart-legend .key.sell { width: 9px; height: 9px; border: 2px solid var(--viz-2); border-radius: 50%; }
.vl-pchart-legend .key.buy { background: var(--viz-2); }
.vl-pchart-legend .key.up, .vl-pchart-legend .key.down { width: 7px; height: 12px; border: 0; border-radius: 0; background: var(--candle-up); }
.vl-pchart-legend .key.down { background: var(--candle-down); }
.vl-pchart-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.vl-pchart-links { display: inline-flex; gap: 14px; }
.vl-pchart-links a { display: inline-flex; align-items: center; gap: 4px; }
.vl-pchart-links a[hidden] { display: none; }
/* Admin → Personal → Inversiones: the latest news of a product (static/js/security_news.js), as Google Finance
   lists them: medium · how long ago, then the headline. The head and the language buttons stay; the list scrolls. */
.vl-pchart-col .vl-btn + .vl-btn { margin-left: 4px; }
.vl-pchart-col { white-space: nowrap; }
.vl-news { width: min(680px, calc(100vw - 32px)); height: min(760px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); }
.vl-news[open] { display: flex; flex-direction: column; }
.vl-news-bar { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.vl-news-bar .vl-seg button .muted { font-variant-numeric: tabular-nums; }
.vl-news-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.vl-news-list { margin: 0; padding: 0; list-style: none; }
.vl-news-list li + li { border-top: 1px solid var(--line-soft); }
.vl-news-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.vl-news-item:hover, .vl-news-item:focus-visible { background: var(--gray-50); }
.vl-news-item:visited .vl-news-title { color: var(--ink-muted); }
.vl-news-meta { font-size: 12px; color: var(--ink-muted); }
.vl-news-source { color: var(--ink); font-weight: 500; }
.vl-news-title { color: var(--ink-strong); font-size: 14px; font-weight: 500; line-height: 1.4; }
.vl-news-msg { padding: 40px 16px; text-align: center; color: var(--ink-muted); font-size: 13px; }
.vl-news-msg[hidden] { display: none; }
.vl-news-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 575.98px) {
  .vl-news-bar .vl-seg { display: flex; }
  .vl-news-bar .vl-seg button { flex: 1; justify-content: center; padding: 3px 4px; }
}
@media (max-width: 575.98px) {
  .vl-pchart-plot { height: 220px; }
  .vl-pchart-price { font-size: 20px; }
  .vl-pchart-controls { width: 100%; }
  .vl-pchart-ranges { flex: 1; justify-content: space-between; }
  .vl-pchart-ranges button { padding: 3px 6px; }
}
.vl-table tfoot td { height: 36px; padding: 0 10px; color: var(--ink); }
.vl-table tfoot tr:first-child td { border-top: 1px solid var(--line); font-weight: 600; }
