/*
 * HomeFlow Design System v1.0 — estilos de componentes (prefijo hf-).
 * Copia literal del design system de Félix Agosto (Engine Creative Studio), 26/10/2026.
 * NO editar a mano: los ajustes para que convivan con Velzon/Bootstrap van en theme.css.
 */
.hf, .hf *, .hf *::before, .hf *::after { box-sizing: border-box; }
body { font-family: var(--font-body); color: var(--text-primary); background: var(--bg-canvas); -webkit-font-smoothing: antialiased; }
.hf { font-family: var(--font-body); color: var(--text-primary); font-size: 14px; line-height: 20px; }
.hf h1, .hf h2, .hf h3, .hf h4, .hf h5, .hf h6, .hf .hf-display { font-family: var(--font-display); color: var(--text-heading); margin: 0; text-wrap: balance; }
.hf p { margin: 0; }
.hf-num { font-variant-numeric: tabular-nums; }
.overline { text-transform: uppercase; }
.kpi-lg, .kpi-md { font-variant-numeric: tabular-nums; }
.hf :focus-visible { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.hf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hf-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.hf-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.hf-icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Button ---------- */
.hf-btn { --_h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--_h); padding: 0 var(--space-4); border-radius: var(--radius-md); border: var(--border-width) solid transparent; font: 600 15px/20px var(--font-body); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }
.hf-btn:focus-visible { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.hf-btn-sm { --_h: 32px; padding: 0 var(--space-3); font-size: 14px; }
.hf-btn-lg { --_h: 48px; padding: 0 var(--space-6); font-size: 16px; }
.hf-btn-full { width: 100%; }
.hf-btn-primary { background: var(--action); color: var(--on-action); }
.hf-btn-primary:hover { background: var(--action-hover); }
.hf-btn-primary:active { background: var(--action-pressed); }
.hf-btn-secondary { background: var(--bg-surface); color: var(--text-heading); border-color: var(--border-control); box-shadow: var(--shadow-xs); }
.hf-btn-secondary:hover { background: var(--action-subtle); border-color: var(--border-strong); }
.hf-btn-secondary:active { background: var(--bg-selected); }
.hf-btn-tertiary { background: var(--bg-selected); color: var(--text-link); }
.hf-btn-tertiary:hover { background: var(--action-subtle); box-shadow: inset 0 0 0 1px var(--brand-primary); }
.hf-btn-ghost { background: transparent; color: var(--text-secondary); }
.hf-btn-ghost:hover { background: var(--bg-surface-muted); color: var(--text-primary); }
.hf-btn-ghost:active { background: var(--action-subtle); }
.hf-btn-destructive { background: var(--status-error); color: var(--on-danger); }
.hf-btn-destructive:hover { filter: brightness(0.92); }
.hf-btn[disabled], .hf-btn[aria-disabled="true"]:not(.hf-btn-loading) { background: var(--disabled-bg); color: var(--disabled-text); border-color: transparent; box-shadow: none; cursor: not-allowed; filter: none; }
.hf-btn-loading { cursor: progress; }
.hf-spinner { width: 16px; height: 16px; border-radius: var(--radius-full); border: 2px solid currentColor; border-right-color: transparent; animation: hf-spin 0.7s linear infinite; }
@keyframes hf-spin { to { transform: rotate(360deg); } }
.hf-iconbtn { width: var(--_h); padding: 0; }

/* ---------- Form fields ---------- */
.hf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hf-label { font: 500 14px/20px var(--font-body); color: var(--text-primary); }
.hf-label .hf-req { color: var(--status-error); margin-left: 2px; }
.hf-hint { font: 400 12px/16px var(--font-body); color: var(--text-muted); }
.hf-error-text { font: 500 12px/16px var(--font-body); color: var(--status-error); display: flex; gap: var(--space-1); align-items: center; }
.hf-control { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-3); background: var(--bg-surface); border: var(--border-width) solid var(--border-control); border-radius: var(--radius-md); color: var(--text-muted); transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }
.hf-control:hover { border-color: var(--border-strong); }
.hf-control:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px var(--bg-selected); }
.hf-control input, .hf-control select, .hf-control textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: 400 15px/22px var(--font-body); padding: 9px 0; }
.hf-control textarea { resize: vertical; min-height: 88px; }
.hf-control input::placeholder, .hf-control textarea::placeholder { color: var(--text-muted); }
.hf-control select { appearance: none; cursor: pointer; padding-right: 24px; }
.hf-control-select { position: relative; }
.hf-control-select .hf-icon { position: absolute; right: 12px; pointer-events: none; }
.hf-field-error .hf-control { border-color: var(--status-error); }
.hf-field-error .hf-control:focus-within { box-shadow: 0 0 0 3px var(--status-error-subtle); }
.hf-field-disabled .hf-control { background: var(--disabled-bg); border-color: var(--border-subtle); }
.hf-field-disabled .hf-control input, .hf-field-disabled .hf-control select { color: var(--disabled-text); cursor: not-allowed; }
.hf-affix { font: 500 14px/20px var(--font-body); color: var(--text-muted); }
.hf-kbd { font: 600 11px/16px var(--font-body); color: var(--text-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 0 6px; }

/* Checkbox / Radio / Switch */
.hf-check { display: inline-flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; min-height: 24px; }
.hf-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hf-check-box { flex: none; width: 20px; height: 20px; margin-top: 0; border: 1.5px solid var(--border-control); border-radius: var(--radius-sm); background: var(--bg-surface); display: grid; place-items: center; color: var(--on-action); transition: background var(--duration-instant) var(--ease-standard), border-color var(--duration-instant); }
.hf-check-radio .hf-check-box { border-radius: var(--radius-full); }
.hf-check:hover .hf-check-box { border-color: var(--border-strong); }
.hf-check input:checked + .hf-check-box, .hf-check input:indeterminate + .hf-check-box { background: var(--action); border-color: var(--action); }
.hf-check-radio input:checked + .hf-check-box { background: var(--bg-surface); border: 6px solid var(--action); }
.hf-check input:focus-visible + .hf-check-box { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.hf-check input:disabled + .hf-check-box { background: var(--disabled-bg); border-color: var(--border-subtle); }
.hf-check-disabled { cursor: not-allowed; color: var(--disabled-text); }
.hf-check-text { display: flex; flex-direction: column; font: 400 15px/20px var(--font-body); color: var(--text-primary); }
.hf-check-text small { font-size: 13px; color: var(--text-muted); }
.hf-check-disabled .hf-check-text, .hf-check-disabled .hf-check-text small { color: var(--disabled-text); }
.hf-radiogroup { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.hf-radiogroup legend { padding: 0; margin-bottom: var(--space-2); }
.hf-switch { display: inline-flex; align-items: center; gap: var(--space-3); background: none; border: 0; padding: 0; cursor: pointer; font: 400 15px/20px var(--font-body); color: var(--text-primary); }
.hf-switch-track { width: 40px; height: 24px; border-radius: var(--radius-full); background: var(--border-control); position: relative; transition: background var(--duration-base) var(--ease-standard); flex: none; }
.hf-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: var(--radius-full); background: var(--brand-white); box-shadow: var(--shadow-xs); transition: transform var(--duration-base) var(--ease-standard); }
.hf-switch[aria-checked="true"] .hf-switch-track { background: var(--action); }
.hf-switch[aria-checked="true"] .hf-switch-thumb { transform: translateX(16px); }
.hf-switch:focus-visible { outline: none; }
.hf-switch:focus-visible .hf-switch-track { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.hf-switch[disabled] { cursor: not-allowed; color: var(--disabled-text); }
.hf-switch[disabled] .hf-switch-track { background: var(--disabled-bg); }

/* ---------- Tabs ---------- */
.hf-tabs { display: flex; gap: var(--space-6); border-bottom: var(--border-width) solid var(--border-subtle); overflow-x: auto; }
.hf-tab { position: relative; background: none; border: 0; padding: var(--space-3) 0; font: 500 14px/20px var(--font-body); color: var(--text-secondary); cursor: pointer; display: inline-flex; gap: var(--space-2); align-items: center; white-space: nowrap; }
.hf-tab:hover { color: var(--text-primary); }
.hf-tab[aria-selected="true"] { color: var(--text-link); font-weight: 600; }
.hf-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--action); }
.hf-tab-count { font: 600 12px/16px var(--font-body); padding: 0 6px; border-radius: var(--radius-full); background: var(--bg-surface-muted); color: var(--text-secondary); }
.hf-tabs-pill { border: 0; gap: var(--space-1); background: var(--bg-surface-muted); padding: 4px; border-radius: var(--radius-md); display: inline-flex; }
.hf-tabs-pill .hf-tab { padding: 6px var(--space-3); border-radius: var(--radius-sm); }
.hf-tabs-pill .hf-tab[aria-selected="true"] { background: var(--bg-surface); color: var(--text-heading); box-shadow: var(--shadow-xs); }
.hf-tabs-pill .hf-tab[aria-selected="true"]::after { display: none; }

/* ---------- Breadcrumbs ---------- */
.hf-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; font: 400 14px/20px var(--font-body); }
.hf-crumbs a { color: var(--text-muted); text-decoration: none; border-radius: var(--radius-sm); }
.hf-crumbs a:hover { color: var(--text-link); text-decoration: underline; }
.hf-crumbs [aria-current] { color: var(--text-primary); font-weight: 500; }
.hf-crumbs .hf-icon { color: var(--text-muted); }

/* ---------- Badge / Avatar / Tooltip ---------- */
.hf-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 10px; border-radius: var(--radius-full); font: 600 12px/16px var(--font-body); letter-spacing: 0.01em; white-space: nowrap; }
.hf-badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.hf-badge-neutral { background: var(--status-neutral-subtle); color: var(--status-neutral); }
.hf-badge-info { background: var(--status-info-subtle); color: var(--status-info); }
.hf-badge-success { background: var(--status-success-subtle); color: var(--status-success); }
.hf-badge-warning { background: var(--status-warning-subtle); color: var(--status-warning); }
.hf-badge-error { background: var(--status-error-subtle); color: var(--status-error); }
.hf-badge-brand { background: var(--bg-sidebar); color: var(--text-inverse); }
.hf-badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-subtle); color: var(--text-secondary); }
.hf-avatar { --_s: 32px; position: relative; flex: none; width: var(--_s); height: var(--_s); border-radius: var(--radius-full); background: var(--bg-selected); color: var(--text-link); display: inline-grid; place-items: center; font: 600 calc(var(--_s) * 0.38)/1 var(--font-body); overflow: visible; }
.hf-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.hf-avatar-status { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 8px; min-height: 8px; border-radius: var(--radius-full); border: 2px solid var(--bg-surface); }
.hf-avatar-group { display: inline-flex; }
.hf-avatar-group .hf-avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.hf-avatar-group .hf-avatar + .hf-avatar { margin-left: -8px; }
.hf-tip { position: relative; display: inline-flex; }
.hf-tip-bubble { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); background: var(--brand-navy); color: var(--brand-white); font: 500 12px/16px var(--font-body); padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard); z-index: var(--z-tooltip); box-shadow: var(--shadow-md); }
.hf-tip-bottom .hf-tip-bubble { bottom: auto; top: calc(100% + 8px); }
.hf-tip:hover .hf-tip-bubble, .hf-tip:focus-within .hf-tip-bubble, .hf-tip-open .hf-tip-bubble { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .hf-tip-bubble { background: var(--bg-surface-raised); color: var(--text-primary); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--border-subtle); }

/* ---------- Menu ---------- */
.hf-menu-wrap { position: relative; display: inline-block; }
.hf-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--bg-surface-raised); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: var(--z-dropdown); list-style: none; margin: 0; }
.hf-menu-static { position: static; }
.hf-menu-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); font: 400 14px/20px var(--font-body); color: var(--text-primary); text-align: left; cursor: pointer; }
.hf-menu-item:hover, .hf-menu-item:focus-visible { background: var(--bg-surface-muted); outline: none; }
.hf-menu-item .hf-icon { color: var(--text-muted); }
.hf-menu-item-danger, .hf-menu-item-danger .hf-icon { color: var(--status-error); }
.hf-menu-item kbd { margin-left: auto; font: 500 12px/16px var(--font-body); color: var(--text-muted); }
.hf-menu-sep { height: 1px; background: var(--border-subtle); margin: 6px 0; }

/* ---------- Card / KPI ---------- */
.hf-card { background: var(--bg-surface); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.hf-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-6) 0; }
.hf-card-head h3 { font: 600 16px/24px var(--font-display); letter-spacing: -0.005em; }
.hf-card-head p { font-size: 13px; color: var(--text-muted); }
.hf-card-body { padding: var(--space-5) var(--space-6) var(--space-6); }
.hf-card-flush .hf-card-body { padding: var(--space-4) 0 0; }
.hf-kpi { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.hf-kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font: 500 13px/18px var(--font-body); }
.hf-kpi-ico { width: 32px; height: 32px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--bg-selected); color: var(--text-link); }
.hf-kpi-value { font: 700 28px/34px var(--font-display); letter-spacing: -0.015em; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.hf-kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.hf-delta { display: inline-flex; align-items: center; gap: 2px; font: 600 13px/18px var(--font-body); font-variant-numeric: tabular-nums; }
.hf-delta-up { color: var(--status-success); }
.hf-delta-down { color: var(--status-error); }
.hf-delta-note { color: var(--text-muted); font: 400 12px/16px var(--font-body); }

/* ---------- Table ---------- */
.hf-table-wrap { overflow-x: auto; border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.hf-table { width: 100%; border-collapse: collapse; font: 400 14px/20px var(--font-body); font-variant-numeric: tabular-nums; }
.hf-table th { position: sticky; top: 0; background: var(--bg-surface-muted); color: var(--text-secondary); font: 600 13px/18px var(--font-body); letter-spacing: 0.01em; text-align: left; padding: 10px var(--space-5); white-space: nowrap; border-bottom: var(--border-width) solid var(--border-subtle); z-index: 1; }
.hf-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.hf-table th button:focus-visible { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.hf-table td { padding: 14px var(--space-5); border-bottom: var(--border-width) solid var(--border-subtle); color: var(--text-primary); vertical-align: middle; }
.hf-table tr:last-child td { border-bottom: 0; }
.hf-table tbody tr:hover td { background: var(--bg-surface-muted); }
.hf-table tbody tr[aria-selected="true"] td { background: var(--bg-selected); }
.hf-table-dense td { padding: 8px var(--space-4); }
.hf-right { text-align: right !important; }
.hf-cell-main { font-weight: 600; color: var(--text-heading); }
.hf-cell-sub { font-size: 13px; color: var(--text-muted); }
.hf-cell-person { display: flex; align-items: center; gap: var(--space-3); }

/* ---------- Pagination / Filter ---------- */
.hf-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.hf-pager-pages { display: flex; gap: 4px; }
.hf-page { min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-sm); border: 0; background: none; font: 500 14px/20px var(--font-body); color: var(--text-secondary); cursor: pointer; font-variant-numeric: tabular-nums; }
.hf-page:hover { background: var(--bg-surface-muted); }
.hf-page[aria-current="page"] { background: var(--bg-selected); color: var(--text-link); font-weight: 600; }
.hf-page:disabled { color: var(--disabled-text); cursor: not-allowed; background: none; }
.hf-filterbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.hf-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-full); border: var(--border-width) solid var(--border-control); background: var(--bg-surface); font: 500 13px/18px var(--font-body); color: var(--text-secondary); cursor: pointer; }
.hf-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.hf-chip[aria-pressed="true"] { background: var(--bg-selected); border-color: var(--brand-primary); color: var(--text-link); }
.hf-chip b { color: var(--text-primary); font-weight: 600; }
.hf-chip[aria-pressed="true"] b { color: var(--text-link); }

/* ---------- Charts ---------- */
.hf-chart { position: relative; width: 100%; }
.hf-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.hf-chart text { font: 400 11px var(--font-body); fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.hf-chart .hf-grid { stroke: var(--chart-grid); stroke-width: 1; }
.hf-chart .hf-base { stroke: var(--border-strong); stroke-width: 1; }
.hf-chart-tip { position: absolute; pointer-events: none; background: var(--bg-surface-raised); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px 10px; font: 400 12px/16px var(--font-body); color: var(--text-primary); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: var(--z-tooltip); }
.hf-chart-tip b { display: block; font-weight: 600; margin-bottom: 2px; }
.hf-chart-tip span { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.hf-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font: 500 12px/16px var(--font-body); color: var(--text-secondary); margin-bottom: var(--space-3); }
.hf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hf-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hf-spark { display: block; }

/* ---------- Feed / Timeline / Progress ---------- */
.hf-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hf-feed li { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); padding: 10px 0; position: relative; }
.hf-feed li:not(:last-child)::before { content: ""; position: absolute; left: 15.5px; top: 44px; bottom: -6px; width: 1px; background: var(--border-subtle); }
.hf-feed-ico { width: 32px; height: 32px; border-radius: var(--radius-full); display: grid; place-items: center; background: var(--bg-surface-muted); color: var(--text-secondary); }
.hf-feed-ico.hf-tone-success { background: var(--status-success-subtle); color: var(--status-success); }
.hf-feed-ico.hf-tone-info { background: var(--status-info-subtle); color: var(--status-info); }
.hf-feed-ico.hf-tone-warning { background: var(--status-warning-subtle); color: var(--status-warning); }
.hf-feed-ico.hf-tone-error { background: var(--status-error-subtle); color: var(--status-error); }
.hf-feed-text { font-size: 14px; line-height: 20px; color: var(--text-secondary); min-width: 0; }
.hf-feed-text b { color: var(--text-primary); font-weight: 600; }
.hf-feed-time { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hf-timeline { list-style: none; margin: 0; padding: 0; }
.hf-timeline li { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--space-3); padding-bottom: var(--space-5); position: relative; }
.hf-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--border-subtle); }
.hf-timeline li.hf-done:not(:last-child)::before { background: var(--action); }
.hf-tl-dot { width: 24px; height: 24px; border-radius: var(--radius-full); display: grid; place-items: center; border: 2px solid var(--border-control); background: var(--bg-surface); color: var(--on-action); }
.hf-done .hf-tl-dot { background: var(--action); border-color: var(--action); }
.hf-current .hf-tl-dot { border-color: var(--action); box-shadow: 0 0 0 4px var(--bg-selected); }
.hf-current .hf-tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--action); }
.hf-tl-label { font: 600 14px/20px var(--font-body); color: var(--text-primary); }
.hf-upcoming .hf-tl-label { color: var(--text-secondary); font-weight: 500; }
.hf-tl-detail { font-size: 13px; color: var(--text-muted); }
.hf-tl-date { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hf-progress { display: flex; flex-direction: column; gap: 6px; }
.hf-progress-head { display: flex; justify-content: space-between; font: 500 13px/18px var(--font-body); color: var(--text-secondary); }
.hf-progress-head b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.hf-progress-track { height: 8px; border-radius: var(--radius-full); background: var(--bg-surface-muted); overflow: hidden; }
.hf-progress-fill { height: 100%; border-radius: inherit; background: var(--action); transition: width var(--duration-slow) var(--ease-flow); }
.hf-progress-success .hf-progress-fill { background: var(--status-success); }
.hf-progress-warning .hf-progress-fill { background: var(--status-warning); }
.hf-progress-sm .hf-progress-track { height: 4px; }

/* ---------- Kanban / Calendar ---------- */
.hf-kcol { display: flex; flex-direction: column; gap: var(--space-3); background: var(--bg-surface-muted); border-radius: var(--radius-lg); padding: var(--space-3); min-width: 0; }
.hf-kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; }
.hf-kcol-head h4 { font: 600 14px/20px var(--font-display); display: flex; gap: var(--space-2); align-items: center; }
.hf-kcol-head h4 i { width: 8px; height: 8px; border-radius: var(--radius-full); }
.hf-kcol-total { font: 500 12px/16px var(--font-body); color: var(--text-secondary); font-variant-numeric: tabular-nums; padding: 0 4px; }
.hf-kcard { background: var(--bg-surface); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-xs); cursor: grab; transition: box-shadow var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.hf-kcard:hover { box-shadow: var(--shadow-md); }
.hf-kcard:focus-visible { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: 2px; }
.hf-kcard-dragging { transform: rotate(-1.5deg); box-shadow: var(--shadow-lg); }
.hf-kcard-title { font: 600 14px/20px var(--font-body); color: var(--text-heading); }
.hf-kcard-client { font-size: 13px; color: var(--text-muted); }
.hf-kcard-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.hf-kcard-value { font: 700 15px/20px var(--font-display); color: var(--text-heading); font-variant-numeric: tabular-nums; }
.hf-kcard-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.hf-kcard-meta.hf-late { color: var(--status-error); font-weight: 600; }
.hf-event { display: flex; gap: var(--space-3); padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-surface); border: var(--border-width) solid var(--border-subtle); min-width: 0; }
.hf-event-bar { width: 4px; border-radius: 2px; flex: none; background: var(--action); }
.hf-event-bar.hf-tone-success { background: var(--status-success); }
.hf-event-bar.hf-tone-warning { background: var(--status-warning); }
.hf-event-bar.hf-tone-neutral { background: var(--border-control); }
.hf-event-bar.hf-tone-teal { background: var(--chart-2); }
.hf-event-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hf-event-time { font: 600 12px/16px var(--font-body); color: var(--text-link); font-variant-numeric: tabular-nums; }
.hf-event-title { font: 600 14px/20px var(--font-body); color: var(--text-heading); }
.hf-event-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hf-event-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Alert / Toast / Modal ---------- */
.hf-alert { display: grid; grid-template-columns: 20px 1fr auto; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); border: var(--border-width) solid; font-size: 14px; line-height: 20px; }
.hf-alert-title { font-weight: 600; color: var(--text-primary); }
.hf-alert-body { color: var(--text-secondary); }
.hf-alert-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.hf-alert-info { background: var(--status-info-subtle); border-color: var(--status-info); }
.hf-alert-info > .hf-icon { color: var(--status-info); }
.hf-alert-success { background: var(--status-success-subtle); border-color: var(--status-success); }
.hf-alert-success > .hf-icon { color: var(--status-success); }
.hf-alert-warning { background: var(--status-warning-subtle); border-color: var(--status-warning); }
.hf-alert-warning > .hf-icon { color: var(--status-warning); }
.hf-alert-error { background: var(--status-error-subtle); border-color: var(--status-error); }
.hf-alert-error > .hf-icon { color: var(--status-error); }
.hf-alert .hf-alert-body, .hf-alert .hf-alert-title { color: var(--text-primary); }
.hf-x { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--text-secondary); display: grid; place-items: center; cursor: pointer; }
.hf-x:hover { background: var(--bg-surface-muted); color: var(--text-primary); }
.hf-toast { display: grid; grid-template-columns: 20px 1fr auto; gap: var(--space-3); align-items: start; width: 380px; max-width: 100%; padding: var(--space-4); background: var(--bg-surface-raised); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); animation: hf-rise var(--duration-slow) var(--ease-enter); }
.hf-toast-title { font: 600 14px/20px var(--font-body); color: var(--text-primary); }
.hf-toast-desc { font-size: 13px; color: var(--text-secondary); }
.hf-toast-action { margin-top: 6px; background: none; border: 0; padding: 0; font: 600 13px/18px var(--font-body); color: var(--text-link); cursor: pointer; }
.hf-toast > .hf-icon.hf-tone-success { color: var(--status-success); }
.hf-toast > .hf-icon.hf-tone-error { color: var(--status-error); }
.hf-toast > .hf-icon.hf-tone-info { color: var(--status-info); }
.hf-toast > .hf-icon.hf-tone-warning { color: var(--status-warning); }
@keyframes hf-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hf-modal-scrim { position: fixed; inset: 0; background: var(--bg-overlay); display: grid; place-items: center; padding: var(--space-4); z-index: var(--z-overlay); }
.hf-modal-scrim.hf-inline { position: relative; inset: auto; border-radius: var(--radius-lg); min-height: 100%; padding: var(--space-8) var(--space-4); }
.hf-modal { width: 520px; max-width: 100%; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; z-index: var(--z-modal); animation: hf-rise var(--duration-slow) var(--ease-enter); }
.hf-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding: var(--space-6) var(--space-6) 0; }
.hf-modal-head h2 { font: 600 20px/28px var(--font-display); letter-spacing: -0.01em; }
.hf-modal-head p { margin-top: 4px; font-size: 14px; color: var(--text-secondary); }
.hf-modal-body { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.hf-modal-foot { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: var(--border-width) solid var(--border-subtle); background: var(--bg-surface-muted); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }

/* ---------- Skeleton / Empty ---------- */
.hf-skel { display: block; background: var(--skeleton); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.hf-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent); animation: hf-shimmer 1.4s var(--ease-standard) infinite; }
[data-theme="dark"] .hf-skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); }
@keyframes hf-shimmer { to { transform: translateX(100%); } }
.hf-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-10) var(--space-6); }
.hf-empty-art { width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--bg-selected); color: var(--text-link); display: grid; place-items: center; margin-bottom: var(--space-2); }
.hf-empty h3 { font: 600 18px/26px var(--font-display); }
.hf-empty p { max-width: 380px; color: var(--text-secondary); font-size: 14px; }

/* ---------- App shell: Sidebar / TopNav / MobileNav ---------- */
.hf-sidebar { width: var(--sidebar-width); background: var(--bg-sidebar); color: var(--text-inverse); display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-5) var(--space-3); flex: none; min-height: 100%; }
.hf-sidebar-collapsed { width: var(--sidebar-collapsed); align-items: center; }
.hf-sidebar-brand { padding: 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.hf-sidebar-brand img { height: 28px; width: auto; }
.hf-nav { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }
.hf-nav-group { font: 600 11px/16px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-inverse-muted); padding: var(--space-3) var(--space-3) var(--space-1); }
.hf-nav-item { display: flex; align-items: center; gap: var(--space-3); height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-inverse-muted); text-decoration: none; font: 500 14px/20px var(--font-body); border: 0; background: none; width: 100%; cursor: pointer; text-align: left; }
.hf-nav-item:hover { background: rgba(255,255,255,0.07); color: var(--text-inverse); }
.hf-nav-item[aria-current="page"] { background: rgba(45,128,244,0.22); color: var(--text-inverse); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(45,128,244,0.45); }
.hf-nav-item[aria-current="page"] .hf-icon { color: var(--brand-primary); }
.hf-nav-item:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.hf-nav-count { margin-left: auto; font: 600 11px/16px var(--font-body); padding: 0 6px; border-radius: var(--radius-full); background: var(--brand-primary); color: var(--brand-deep); }
.hf-sidebar-collapsed .hf-nav-item { width: 44px; justify-content: center; padding: 0; }
.hf-sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-top: 1px solid rgba(255,255,255,0.1); }
.hf-sidebar-foot b { display: block; font: 600 13px/18px var(--font-body); color: var(--text-inverse); }
.hf-sidebar-foot small { font-size: 12px; color: var(--text-inverse-muted); }
.hf-sidebar .hf-avatar { box-shadow: none; background: var(--brand-royal); color: var(--brand-white); }
.hf-topnav { height: var(--topnav-height); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-6); background: var(--bg-surface); border-bottom: var(--border-width) solid var(--border-subtle); position: sticky; top: 0; z-index: var(--z-sticky); }
.hf-topnav-title { display: flex; flex-direction: column; min-width: 0; }
.hf-topnav-title h1 { font: 700 20px/28px var(--font-display); letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-topnav-search { margin-left: auto; width: 320px; max-width: 40%; }
.hf-topnav-actions { display: flex; align-items: center; gap: var(--space-2); }
.hf-bell { position: relative; }
.hf-bell::after { content: ""; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--status-error); box-shadow: 0 0 0 2px var(--bg-surface); }
.hf-mnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-surface); border-top: var(--border-width) solid var(--border-subtle); padding: 6px var(--space-2) calc(6px + env(safe-area-inset-bottom, 0px)); }
.hf-mnav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; border: 0; background: none; font: 500 11px/14px var(--font-body); color: var(--text-muted); border-radius: var(--radius-md); cursor: pointer; }
.hf-mnav-item[aria-current="page"] { color: var(--text-link); font-weight: 600; }
.hf-mnav-fab { width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--action); color: var(--on-action); display: grid; place-items: center; margin: -18px auto 0; box-shadow: var(--shadow-md); border: 0; cursor: pointer; }

/* ---------- Logo ---------- */
.hf-logo { display: inline-block; height: var(--_lh, 32px); width: auto; max-width: 100%; object-fit: contain; object-position: left center; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .hf *, .hf *::before, .hf *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .hf-skel::after { display: none; }
}
@media (max-width: 767px) {
  .hf-topnav { padding: 0 var(--space-4); }
  .hf-topnav-search { display: none; }
  .hf-card-head { padding: var(--space-4) var(--space-4) 0; }
  .hf-card-body { padding: var(--space-4); }
}
