/* ============================================================================
   VIEW SETTINGS  (assets/css/view-settings.css)
   Shared HubSpot-style View settings panel, bottom bar, Export view dialog
   and table display options. Uses the CRM tokens from base.css.
   ============================================================================ */
.vs-spacer { flex: 1; }
.vs-help { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); }
.vs-help--dark { color: var(--text); font-size: 14px; line-height: 1.6; }
.vs-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--brand); cursor: pointer; }
.vs-link:hover, .vs-link:focus-visible { text-decoration: underline; outline: none; }
.vs-kbd { font: inherit; font-size: 13px; color: var(--text-muted); letter-spacing: .04em; background: none; border: 0; padding: 0; box-shadow: none; }
.vs-round { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text); cursor: pointer; flex: none; }
.vs-round:hover, .vs-round:focus-visible { background: var(--surface-hover); outline: none; }
.vs-round:focus-visible { box-shadow: var(--focus-ring); }
.vs-round--plain { border-color: transparent; }
.vs-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.vs-pill:hover, .vs-pill:focus-visible { background: var(--surface-hover); outline: none; }
.vs-split { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); overflow: hidden; }
.vs-split button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 34px; padding: 0; background: var(--surface); border: 0; color: var(--text); cursor: pointer; }
.vs-split button + button { border-left: 1px solid var(--border-strong); }
.vs-split button:hover, .vs-split button:focus-visible { background: var(--surface-hover); outline: none; }
[data-vs-open].is-on { background: var(--surface-hover); border-color: var(--text-muted); }

/* ---------------------------------------------------------------- bottom bar */
.vs-foot { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.vs-foot__count { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--surface-hover); font-size: 13.5px; font-weight: 600; }

/* ---------------------------------------------------------------- panel */
.vs-panel { position: fixed; right: 0; top: var(--header-h, 64px); bottom: 0; z-index: 90; width: 340px; max-width: 100vw; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0, 0, 0, .06); }
.vs-panel[hidden] { display: none; }
@media (min-width: 1200px) { body.vs-is-open .app__main { padding-right: 352px; } }
.vs-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 16px 24px; border-bottom: 1px solid var(--border); }
.vs-panel__head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.vs-panel__body { flex: 1; overflow-y: auto; padding: 0 20px 16px 24px; scrollbar-width: thin; }
.vs-sec { padding: 16px 0; border-bottom: 1px solid var(--border); }
.vs-sec--last { border-bottom: 0; }
.vs-label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.vs-name { width: 100%; height: 40px; }
.vs-name[readonly] { background: var(--surface-2); color: var(--text-muted); }
.vs-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.vs-types button { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text); cursor: pointer; }
.vs-types button:hover, .vs-types button:focus-visible { background: var(--surface-hover); outline: none; }
.vs-types button:focus-visible { box-shadow: var(--focus-ring); }
.vs-types button[aria-pressed="true"] { background: var(--surface-3, var(--surface-hover)); border-color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--text-muted); }
.vs-row { display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); min-height: 40px; margin: 0 -8px; padding: 6px 8px; background: none; border: 0; border-radius: var(--radius-sm); font: inherit; font-size: 15px; color: var(--text); text-align: left; cursor: pointer; }
.vs-row:hover:not(:disabled), .vs-row:focus-visible { background: var(--surface-hover); outline: none; }
.vs-row:disabled { color: var(--text-subtle); cursor: not-allowed; }
.vs-row--box { width: 100%; margin: 0; padding: 8px 12px; background: var(--surface-2); }
.vs-row > svg { flex: none; color: var(--text-muted); }
.vs-row > svg:last-child { color: var(--text); }
.vs-row:disabled > svg { color: var(--text-subtle); }
.vs-row__lbl { flex: 1; min-width: 0; }
.vs-row__val { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- popover */
.vs-pop { position: fixed; z-index: 1400; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.vs-pop[hidden] { display: none; }
.vs-pop__title { margin: 0 16px 8px; font-size: 14px; font-weight: 700; }
.vs-pop__sec { margin: 4px 16px 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.vs-pop__help { margin: 0 16px 6px; font-size: 13px; color: var(--text-muted); }
.vs-pop__pad { padding: 0 16px; display: grid; gap: 8px; }
.vs-pop__pad .input { height: 36px; width: 100%; }
.vs-list { display: flex; flex-direction: column; }
.vs-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 16px; background: none; border: 0; font: inherit; font-size: 14px; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.vs-item:hover, .vs-item:focus-visible { background: var(--surface-hover); outline: none; }
.vs-item[aria-checked="true"] { background: var(--surface-hover); font-weight: 600; }
.vs-item--back { font-weight: 600; }
.vs-item--link { color: var(--brand); font-weight: 600; }
.vs-item--danger { color: var(--danger); }
.vs-item[disabled] { opacity: .5; cursor: default; background: none; }
.vs-list--menu { padding: 6px 0; }
.vs-list--menu .vs-item { padding: 11px 18px; font-size: 15px; }
.vs-list--menu .vs-switchrow .vs-kbd { margin-left: 10px; }
.vs-item__val { font-size: 12.5px; color: var(--text-muted); }
.vs-rule { height: 1px; margin: 6px 0; background: var(--border); }
.vs-seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); overflow: hidden; }
.vs-seg button { flex: 1; height: 32px; background: var(--surface); border: 0; font: inherit; font-size: 12px; color: var(--text); cursor: pointer; }
.vs-seg button + button { border-left: 1px solid var(--border-strong); }
.vs-seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink, var(--brand)); font-weight: 600; }
.vs-switchrow { cursor: pointer; }
.vs-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vs-switch { position: relative; width: 52px; height: 28px; border-radius: 8px; background: var(--surface-3, var(--border-strong)); border: 1px solid var(--border-strong); flex: none; transition: background var(--fast, .15s); }
.vs-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border-strong); transition: left var(--fast, .15s); }
.vs-switch__input:checked + .vs-switch { background: var(--text); border-color: var(--text); }
.vs-switch__input:checked + .vs-switch::after { left: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); background-size: 14px; background-position: center; background-repeat: no-repeat; }
.vs-switch__input:focus-visible + .vs-switch { box-shadow: var(--focus-ring); }

/* ---------------------------------------------------------------- dialogs */
.vs-dialog { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .45); }
.vs-dialog[hidden] { display: none; }
.vs-dialog__box { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.vs-dialog__box > form { display: flex; flex-direction: column; min-height: 0; }
.vs-dialog__box--wide { max-width: 640px; }
.vs-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.vs-dialog__head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.vs-dialog__body { padding: 20px 24px; overflow-y: auto; }
.vs-dialog__body .field { margin-bottom: 14px; }
.vs-dialog__foot { display: flex; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--border); }
.vs-fieldset { margin: 0 0 14px; padding: 0; border: 0; }
.vs-fieldset legend { padding: 0; margin-bottom: 6px; }
.vs-radio, .vs-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.vs-radio input, .vs-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); flex: none; }
.vs-radio small { color: var(--text-muted); font-size: 12.5px; }
.vs-radio:has(input:disabled) { color: var(--text-subtle); cursor: not-allowed; }
.vs-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 16px; margin: 6px 0 10px; }
.vs-tip { display: inline-flex; vertical-align: -2px; color: var(--text-muted); }

/* export view */
.vs-x__sec { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.vs-x__sec h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.vs-x__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vs-x__summary { margin: 0 0 12px; font-size: 15px; }
.vs-x__summary strong { margin-right: 6px; }
.vs-x__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.vs-x__grid .input { height: 40px; }
.vs-x__h4 { margin: 6px 0 6px; font-size: 15px; font-weight: 700; }
.vs-x__list { margin: 0; padding-left: 22px; font-size: 14.5px; line-height: 1.8; list-style: disc; }
.vs-x__list li { display: list-item; list-style: disc; }
.vs-x__more { padding: 10px 0; border-bottom: 1px solid var(--border); }
.vs-x__more:last-child { border-bottom: 0; }
.vs-x__more summary { display: flex; align-items: center; gap: 10px; list-style: none; font-size: 17px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.vs-x__more summary::-webkit-details-marker { display: none; }
.vs-x__more summary svg { transition: transform var(--fast, .15s); }
.vs-x__more[open] summary svg { transform: rotate(90deg); }
.vs-x__more summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.vs-x__more > *:not(summary) { margin-top: 10px; }
.vs-x__hist { margin: 0; padding: 0; list-style: none; }
.vs-x__hist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.vs-x__hist li span { color: var(--text-muted); white-space: nowrap; }
@media (max-width: 560px) { .vs-x__grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- table display options (on the table's wrapper) */
.vs-rows-short table tbody td, .vs-rows-short table tbody th { height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.vs-rows-tall table tbody td, .vs-rows-tall table tbody th { height: 56px; padding-top: 14px; padding-bottom: 14px; }
.vs-zebra table tbody tr:nth-child(even):not(.evl-exp) > td, .vs-zebra table tbody tr:nth-child(even):not(.evl-exp) > th { background-color: var(--surface-2); }

/* ==========================================================================
   Buttons use the CRM button style (.btn-crm in base.css): 8px corners,
   brand-blue primary, bordered outline. No pill or circle buttons.
   ========================================================================== */
.vs-round, .vs-pill, .vs-split, .vs-seg, .vs-types button { border-radius: var(--radius-sm, 8px); }
.vs-pill { font-weight: 600; }
