/* custom.css — hoja compartida por las tres marcas.
 *
 * 2026-07-23: hasta hoy existian CUATRO copias de este archivo (shared/css/ y
 * <marca>/web/css/ x3). deploy-web copia shared/css y despues sobreescribe con
 * <marca>/web/css/*, asi que la copia de marca SIEMPRE ganaba y la compartida
 * no llegaba a ningun navegador. Las tres copias de marca eran identicas entre
 * si y estaban adelantadas respecto a la compartida: un fork por accidente, no
 * una personalizacion.
 *
 * Editar shared/css/custom.css y no ver ningun cambio era el sintoma. Se
 * consolido aqui y se borraron las tres copias. Lo que SI es de marca vive en
 * brand.css y landing.css, que siguen por marca.
 *
 * gate-css-single-source.sh falla si alguien reintroduce <marca>/web/css/custom.css.
 */

/* App-wide custom styles (brand-agnostic; per-product overrides via /css/) */

/* Anti-FOUC: hide body until theme.js removes 'js' sentinel */
html.js body { visibility: hidden; }

/* Landing nav mobile-menu slide-down animation */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-down { animation: fadeInDown 0.3s ease-out forwards; }

/* Prevent layout shift from scrollbar appearing/disappearing between pages */
html {
    scrollbar-gutter: stable;
}

/* ==========================================================================
   SPA Shell — Anti-flicker + HTMX transitions
   ==========================================================================
   Layer 1 (blocking script in <head>):
     document.documentElement.classList.add('js')
     → hides #page-content immediately before any rendering happens
   Layer 2 (HTMX swap timing):
     hx-swap="innerHTML swap:100ms" gives htmx-swapping CSS time to fade out
   Layer 3 (htmx:afterSettle):
     Removes opacity:0 after first load, starting the CSS transition
   ========================================================================== */

/* Initial hide — script in <head> adds 'js' class synchronously */
html.js #page-content {
    opacity: 0;
}

/* Content area: default transition (fade-in after settle).
   2026-06-21 — founder reported flicker en cot-create/dop-create. La fade-out
   + fade-in producía un visible flash blanco. Bajamos a transición casi
   instantánea para minimizar el efecto sin perder completamente la sensación
   de transición. */
#page-content {
    transition: opacity 0.06s linear;
    will-change: opacity;
}

/* HTMX adds this class during the swap:Xms delay — triggers fade-out */
#page-content.htmx-swapping {
    opacity: 0;
    transition: opacity 0.03s linear;
}

/* Generic HTMX: fade-in for newly added elements (hx-get append, OOB swaps) */
.htmx-added { opacity: 0; }
.htmx-added.htmx-settling { opacity: 1; transition: opacity 0.2s ease; }

/* ==========================================================================
   Collapsible Sidebar
   ========================================================================== */
#app-sidebar {
    width: 256px;          /* 16rem — expanded */
    transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
    overflow-x: hidden;
    flex-shrink: 0;
}
#app-sidebar.sidebar-collapsed {
    width: 68px;           /* icon only */
}

/* Nav labels: fade out when collapsing */
#app-sidebar .sidebar-label {
    transition: opacity 0.15s ease, max-width 0.22s ease;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
}
#app-sidebar.sidebar-collapsed .sidebar-label {
    opacity: 0;
    max-width: 0;
}

/* Section headings: hide when collapsed */
#app-sidebar .sidebar-section-title {
    transition: opacity 0.12s ease;
}
#app-sidebar.sidebar-collapsed .sidebar-section-title {
    opacity: 0;
    pointer-events: none;
}

/* Toggle button chevron rotation */
#sidebar-toggle-icon {
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
#app-sidebar.sidebar-collapsed #sidebar-toggle-icon {
    transform: rotate(180deg);
}

/* Collapsed: reduce horizontal padding so icons are visible and centered */
#app-sidebar.sidebar-collapsed .glass-card {
    padding-left: 4px;
    padding-right: 4px;
    margin-left: 6px;
    margin-right: 6px;
}
#app-sidebar.sidebar-collapsed nav a {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
#app-sidebar.sidebar-collapsed .sidebar-toggle-header {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* Tooltip on hover when collapsed */
#app-sidebar.sidebar-collapsed nav a {
    position: relative;
}
#app-sidebar.sidebar-collapsed nav a .sidebar-label {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand-tooltip-bg);
    color: #f1f5f9;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 8px;
    opacity: 0;
    max-width: none;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.15s ease;
}
#app-sidebar.sidebar-collapsed nav a:hover .sidebar-label {
    opacity: 1;
}

/* SPA loading progress bar (top of viewport) */
#htmx-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--brand-progress-gradient);
    z-index: 9999;
    pointer-events: none;
    width: 0%;
    opacity: 0;
}

/* Active nav item indicator */
.nav-item-active {
    background-color: var(--brand-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px -3px var(--brand-nav-shadow);
}
.nav-item-active i { color: #fff !important; }

/* Dark mode scrollbar */
.dark {
    color-scheme: dark;
}
.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Brand logo link sizing (each product loads its own logo via brand-config.js) */
.brand-logo-link { min-width: 210px; }

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.dark .glass-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Period selector active state */
.active-period {
    background: white;
    color: var(--brand-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.dark .active-period {
    background: var(--brand-dark-card);
    color: var(--brand-primary);
}

/* ==========================================================================
   Sub-page headers inside the SPA shell
   ==========================================================================
   When a sub-page is loaded inside the dashboard shell, its internal <header>
   would create a second top-bar alongside the shell's own header. On desktop
   the sidebar handles navigation, so inner headers are hidden entirely.
   On mobile (<lg) the inner header with its back-arrow is still needed.
   In standalone mode (direct URL, no shell #main-wrapper) the header renders
   normally — the ancestor selector ensures this rule only fires inside the SPA.
   ========================================================================== */

/* Desktop (lg+): hide inner page headers — SPA shell already provides top nav */
@media (min-width: 1024px) {
    #main-wrapper #page-content > #spa-content > header,
    #main-wrapper #page-content > #spa-content > #main-wrapper > header {
        display: none !important;
    }
}

/* Mobile (<lg): show inner header but strip sticky/bg so it sits below the
   shell's own top bar without conflicting visually */
@media (max-width: 1023px) {
    #main-wrapper #page-content > #spa-content > header,
    #main-wrapper #page-content > #spa-content > #main-wrapper > header {
        position: static !important;
        box-shadow: none !important;
    }
}

/* AI chat bubbles — used in ai-copilot.html and dashboard widget */
.chat-bubble { max-width: 80%; padding: 0.875rem 1rem; border-radius: 1.5rem; position: relative; font-size: 0.9rem; line-height: 1.5; }
.chat-user { background-color: var(--brand-chat-user-bg); color: #fff; margin-left: auto; border-bottom-right-radius: 0.25rem; }
.chat-ai { background-color: #f1f5f9; color: #1e293b; margin-right: auto; border-bottom-left-radius: 0.25rem; }
.dark .chat-ai { background-color: #1e293b; color: #e2e8f0; }

/* ===========================================================================
   WCAG AA contrast overrides (Lighthouse color-contrast audit fix — 2026-06-03).
   ===========================================================================
   text-slate-500 sobre bg-dark/bg-dark-card daba contraste 3.75-4.23 (need ≥4.5).
   En dark mode lo subimos a slate-400 (#94a3b8) que alcanza ~5.7 sobre #020617.
   En light mode dejamos slate-500 intacto (contraste suficiente sobre fondo claro).

   text-primary (#6366f1 indigo en RL, varía per brand) sobre bg-dark daba 3.99.
   En dark mode forzamos un primary más claro definido por --brand-primary-light
   con fallback al primary actual; brands sin esa var quedan igual hasta que
   los brand-config la sienten.
*/
.dark .text-slate-500 { color: rgb(148 163 184); }   /* slate-400 */
.dark .text-slate-600 { color: rgb(148 163 184); }   /* same boost */

.dark .text-primary {
    color: rgb(var(--brand-primary-light-rgb, var(--brand-primary-rgb)) / 1);
}

/* Tailwind CDN doesn't always JIT-generate peer-checked utilities used by
   segmented radio controls in enterprise-settings ("Sí, recurrente programada" /
   "No, cobranza al momento"). Inline them here so the visual flip on the
   active option is guaranteed; the SPA HTMX shell strips inline <style> tags
   from swapped-in page heads, so /css/custom.css is the canonical place for
   cross-cutting CSS that must survive every navigation. */
.peer:checked ~ .peer-checked\:font-black { font-weight: 900; }
.peer:checked ~ .peer-checked\:text-primary {
    color: rgb(var(--brand-primary-rgb));
}
.peer:checked ~ .peer-checked\:bg-white { background-color: #ffffff; }
.peer:checked ~ .peer-checked\:shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.06); }
/* v2 founder 2026-06-20: in dark mode the original dark-card (slate-900) was
   nearly indistinguishable from the unchecked tray (slate-800). Use slate-600
   instead so the active option is unambiguously visible. */
.dark .peer:checked ~ .peer-checked\:dark\:bg-dark-card { background-color: #475569; }

/* v2 founder 2026-06-20: Step 3 timing segments. The label wraps the radio
   so peer-checked (sibling selector) doesn't work — :has() is the right tool. */
.af-seg:has(input:checked) {
    background-color: #ffffff;
    font-weight: 900;
    color: rgb(var(--brand-primary-rgb));
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.dark .af-seg:has(input:checked) {
    background-color: #475569;   /* slate-600 — clearly distinct from slate-800 tray */
    color: #ffffff;              /* white text on dark active chip reads better */
}

/* ============================================================================
   Form polish (2026-06-21) — sits on top of @tailwindcss/forms (strategy:class).
   Plugin resets defaults; these rules add brand-aware styling so inputs feel
   consistent across the app + dark mode without each page declaring its own.
   ========================================================================== */

/* Inputs, selects, textareas baseline */
.form-input,
.form-select,
.form-multiselect,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.875rem;            /* rounded-2xl-ish */
    background-color: rgb(248 250 252); /* slate-50 */
    border: 1.5px solid rgb(226 232 240);/* slate-200 */
    color: rgb(15 23 42);                /* slate-900 */
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-input:focus,
.form-select:focus,
.form-multiselect:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgb(var(--brand-primary-rgb));
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgb(var(--brand-primary-rgb) / 0.18);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: rgb(148 163 184);    /* slate-400 */
    font-weight: 400;
}
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: rgb(241 245 249);
    color: rgb(148 163 184);
    cursor: not-allowed;
}

/* Dark mode */
.dark .form-input,
.dark .form-select,
.dark .form-multiselect,
.dark .form-textarea {
    background-color: rgb(15 23 42);    /* slate-900 */
    border-color: rgb(51 65 85);         /* slate-700 */
    color: rgb(226 232 240);             /* slate-200 */
}
.dark .form-input:focus,
.dark .form-select:focus,
.dark .form-multiselect:focus,
.dark .form-textarea:focus {
    background-color: rgb(2 6 23);
    border-color: rgb(var(--brand-primary-rgb));
    box-shadow: 0 0 0 3px rgb(var(--brand-primary-rgb) / 0.25);
}
.dark .form-input::placeholder,
.dark .form-textarea::placeholder {
    color: rgb(100 116 139);    /* slate-500 */
}
.dark .form-input:disabled,
.dark .form-select:disabled,
.dark .form-textarea:disabled {
    background-color: rgb(30 41 59);
    color: rgb(100 116 139);
}

/* Selects keep the caret rendered by the plugin but in brand color */
.form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    -webkit-appearance: none;
    appearance: none;
}
.dark .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
}

/* Textareas: comfortable min height */
.form-textarea {
    min-height: 6rem;
    line-height: 1.5;
}

/* Date / time / datetime-local: fix dark-mode picker icon (Chrome paints it
   black on dark bg by default — we invert it so it's visible). */
.dark .form-input[type="date"]::-webkit-calendar-picker-indicator,
.dark .form-input[type="time"]::-webkit-calendar-picker-indicator,
.dark .form-input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 1;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23111827'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM9 14H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm-8 4H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2z'/%3E%3C/svg%3E");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    width: 20px;
    height: 20px;
}

/* Date input placeholder: cuando empty, text gris claro (distinguible de un
   valor real); cuando focused o con valor, text inherit (normal). JS marca
   data-empty="true|false" en input + change events. */
input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit {
    color: rgb(148 163 184); /* slate-400 */
}
input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-text,
input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-month-field,
input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-day-field,
input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-year-field {
    color: rgb(148 163 184);
    font-style: italic;
    font-weight: 400;
}
.dark input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit,
.dark input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-text,
.dark input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-month-field,
.dark input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-day-field,
.dark input[type="date"][data-empty="true"]:not(:focus)::-webkit-datetime-edit-year-field {
    color: rgb(100 116 139); /* slate-500 — menos contraste en dark mode */
}

/* Checkboxes + radios in brand color */
.form-checkbox,
.form-radio {
    height: 1rem;
    width: 1rem;
    border: 1.5px solid rgb(148 163 184);  /* slate-400 */
    background-color: #ffffff;
    color: rgb(var(--brand-primary-rgb));
    transition: background-color .12s, border-color .12s, box-shadow .12s;
    cursor: pointer;
}
.form-checkbox { border-radius: 0.25rem; }
.form-radio    { border-radius: 9999px; }
.form-checkbox:focus,
.form-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(var(--brand-primary-rgb) / 0.25);
}
.form-checkbox:checked,
.form-radio:checked {
    background-color: rgb(var(--brand-primary-rgb));
    border-color: rgb(var(--brand-primary-rgb));
}
.dark .form-checkbox,
.dark .form-radio {
    background-color: rgb(30 41 59);
    border-color: rgb(71 85 105);
}
.dark .form-checkbox:checked,
.dark .form-radio:checked {
    background-color: rgb(var(--brand-primary-rgb));
    border-color: rgb(var(--brand-primary-rgb));
}

/* File input — make the "Choose file" button look like our primary button */
.form-input[type="file"]::-webkit-file-upload-button,
.form-input[type="file"]::file-selector-button {
    background-color: rgb(var(--brand-primary-rgb));
    color: #ffffff;
    border: 0;
    border-radius: 0.625rem;
    padding: 0.4rem 0.875rem;
    font-weight: 700;
    font-size: 0.75rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: filter .12s;
}
.form-input[type="file"]::-webkit-file-upload-button:hover,
.form-input[type="file"]::file-selector-button:hover {
    filter: brightness(1.08);
}

/* Form labels — small caps, semibold, slate */
.form-label {
    display: block;
    font-size: 0.6875rem;        /* 11px */
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    margin-bottom: 0.375rem;
}
.dark .form-label { color: rgb(148 163 184); }

/* Error state on inputs */
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: rgb(239 68 68);
    background-color: rgb(254 242 242);
}
.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus {
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.18);
}
.dark .form-input.is-invalid,
.dark .form-select.is-invalid,
.dark .form-textarea.is-invalid {
    background-color: rgb(127 29 29 / 0.2);
    border-color: rgb(248 113 113);
}

/* ─────────────────────────────────────────────────────────────────────────
   Densidad de Settings (2026-07-23)

   El problema medido: un Tax ID de 10 caracteres ocupaba 741px y el nombre
   legal 1582px, porque cada input traia w-full sobre un contenedor de 1632px.
   Y cada dato suelto venia envuelto en su propia caja con borde y radio: la
   seccion de contabilidad acumulaba 30 marcos con 3 niveles de anidamiento.

   Dos reglas:
   1. El ancho de un campo dice cuanto se espera que escribas. Un campo que
      admite 200 caracteres cuando esperas 10 miente sobre el dato.
   2. Un borde tiene que ganarse el lugar. Agrupar con espacio o una linea de
      un pixel comunica igual y no compite con el contenido.
   ───────────────────────────────────────────────────────────────────────── */

/* Medida legible para un formulario de configuracion. */
.set-form { max-width: 44rem; }

/* Campo dimensionado a lo que se espera escribir, no al ancho del contenedor. */
.set-field      { width: 100%; max-width: 24rem; }
.set-field-sm   { width: 100%; max-width: 13rem; }   /* tax id, telefono */
.set-field-wide { width: 100%; max-width: 34rem; }   /* selects de cuentas contables */

/* Mejora progresiva: donde el navegador lo soporte, el campo se ajusta a su
   contenido real. Sin soporte (Firefox hoy) queda el max-width de arriba, que
   ya es un tamano sensato — por eso el fallback no necesita una linea de codigo.
   field-sizing NO es Baseline widely available; se usa asi a proposito. */


/* Fila etiqueta/campo: en pantalla ancha la etiqueta va al lado y no encima.
   Recupera altura vertical sin apretar nada. */
.set-row { display: grid; gap: .35rem; }
@media (min-width: 768px) {
  .set-row {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: .2rem 2rem;
    align-items: center;
  }
}

/* Dato de solo lectura: etiqueta + valor, sin caja. Reemplaza los
   bg-slate-50 rounded-2xl que envolvian un "Conectado desde: hoy". */
.set-stat       { display: flex; flex-direction: column; gap: .05rem; }
.set-stat-label { font-size: 10px; font-weight: 900; letter-spacing: .1em;
                  text-transform: uppercase; color: rgb(148 163 184); }

/* Chip de proveedor de contabilidad. Antes cada uno era un tile de 4rem con
   icono de 2xl en columna; seis de esos comian una franja entera de pantalla
   para lo que es, en el fondo, un radio button. Toque minimo 44px de alto
   (regla de touch target), no mas. */
.acc-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .5rem .75rem;
  border: 1px solid rgb(226 232 240);
  border-radius: .75rem;
  font-size: 12px; font-weight: 800; line-height: 1;
  color: rgb(71 85 105);
  background: transparent;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.dark .acc-chip { border-color: rgb(51 65 85); color: rgb(148 163 184); }
.acc-chip:hover { border-color: rgb(148 163 184); }
.acc-chip svg, .acc-chip i { flex: 0 0 auto; }
.acc-chip[aria-pressed="true"] {
  border-color: rgb(var(--brand-primary-rgb));
  background: rgb(var(--brand-primary-rgb) / .1);
  color: rgb(var(--brand-primary-rgb));
}
.acc-chip:focus-visible {
  outline: 2px solid rgb(var(--brand-primary-rgb));
  outline-offset: 2px;
}

/* custom.css carga DESPUES de tailwind.css, asi que cualquier clase de acá que
   fije `display` le gana a `.hidden` — misma especificidad (0,1,0), gana la
   ultima. Resultado: classList.add('hidden') queda mudo y el elemento sigue en
   pantalla. Fue exactamente lo que paso con el boton de Sage: el gate por pais
   corria bien, marcaba la clase, y el boton se seguia viendo 80x44.

   NO se arregla con un `.hidden { display: none }` global al final del archivo:
   eso tambien le ganaria a `hidden md:inline` / `hidden lg:flex`, el patron
   responsive de Tailwind (oculto por defecto, visible desde un breakpoint), y
   se llevaria por delante la barra lateral y medio header. Medido en vivo: de
   63 elementos con .hidden en la pagina, 3 son ese patron y 1 era el bug.

   Por eso va acotado a las clases de este archivo que fijan display. Si agregas
   una clase nueva con `display`, agregala tambien acá. */
.acc-chip.hidden,
.form-label.hidden,
.set-row.hidden,
.set-stat.hidden,
.set-inline.hidden,
.set-stats.hidden,
.set-fields.hidden { display: none; }

/* Utilidades de layout que el Tailwind precompilado NO trae.
   Verificado 2026-07-23: flex-wrap, items-baseline y TODOS los gap-x-*/gap-y-*
   estan ausentes de vendor/tailwind.css. Usarlas en el HTML no rompe nada
   visible al escribirlas — simplemente no aplican, y el sintoma aparece
   despues como texto pegado ("ConnectedDemo Company"). Por eso viven aca como
   clases propias, que no dependen del contenido del build. */
.set-inline { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; }
.set-stats  { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; }
.set-fields { display: flex; flex-wrap: wrap; gap: .75rem 2rem; }
/* min-w-[110px] no existe en el build precompilado (payment-channels). */
.set-minw-110 { min-width: 110px; }

/* ── Campos sin marco (2026-07-23, founder) ──────────────────────────────────
   El borde, el fondo y el radio no aportaban nada en un formulario de
   configuracion: la etiqueta ya dice que es un campo y la posicion ya lo separa
   del resto. Queda el valor, y en los desplegables el gancho a la derecha.

   Lo que NO se va es el foco. Un campo sin marco que ademas no marca el foco
   deja a quien navega con teclado sin saber donde esta parado, asi que el
   subrayado de 2px en color de marca aparece al enfocar (y mas tenue al pasar
   el mouse, para que el campo siga siendo descubrible).
   Se escribe .form-input.set-bare para ganarle en especificidad a la base. */
.form-input.set-bare,
.form-select.set-bare,
.form-textarea.set-bare,
.dark .form-input.set-bare,
.dark .form-select.set-bare,
.dark .form-textarea.set-bare {
    background-color: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
    box-shadow: none;
}
.form-input.set-bare:hover,
.form-select.set-bare:hover,
.form-textarea.set-bare:hover {
    border-bottom-color: rgb(203 213 225);          /* slate-300 */
}
.dark .form-input.set-bare:hover,
.dark .form-select.set-bare:hover,
.dark .form-textarea.set-bare:hover {
    border-bottom-color: rgb(51 65 85);             /* slate-700 */
}
.form-input.set-bare:focus,
.form-select.set-bare:focus,
.form-textarea.set-bare:focus,
.dark .form-input.set-bare:focus,
.dark .form-select.set-bare:focus,
.dark .form-textarea.set-bare:focus {
    outline: none;
    background-color: transparent;
    box-shadow: none;
    border-bottom-color: rgb(var(--brand-primary-rgb));
}

/* El desplegable pierde la caja nativa y se queda con el gancho. El espacio a
   la derecha lo reserva el padding, no un borde. */
select.set-bare {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.4rem;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 1rem 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}
.dark select.set-bare {
    /* slate-400, no slate-500: sobre el fondo oscuro el 500 no se distinguia. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}
select.set-bare:focus,
select.set-bare:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}
/* Las opciones del desplegable las pinta el sistema: se fuerza fondo solido
   para que no hereden el transparent del control y queden ilegibles. */
select.set-bare option { background-color: rgb(255 255 255); color: rgb(15 23 42); }
.dark select.set-bare option { background-color: rgb(15 23 42); color: rgb(226 232 240); }


/* Va al final a proposito: pisa el width:100% de set-field-wide. */
@supports (field-sizing: content) {
  .set-field-auto {
    field-sizing: content;
    width: auto;
    min-inline-size: 12ch;
    max-inline-size: 34rem;
    justify-self: start;
  }
}
