/* Vistun UI components */

/* === Buttons === */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-body);
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition: background-color var(--transition),
                border-color var(--transition),
                color var(--transition),
                box-shadow var(--transition),
                transform var(--transition);
}

.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover  { background: var(--accent-hover);  color: var(--text-on-accent); }
.btn-primary:active { background: var(--accent-active); color: var(--text-on-accent); transform: scale(0.98); }

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover  { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:active { color: var(--text-primary); transform: scale(0.98); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover  { color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost:active { color: var(--text-primary); transform: scale(0.98); }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover  { background: var(--danger-dim); color: var(--danger); }
.btn-danger:active { color: var(--danger); transform: scale(0.98); }

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-icon:hover  { color: var(--text-primary); border-color: var(--border-strong); }
.btn-icon:active { color: var(--text-primary); transform: scale(0.94); }

.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: var(--text-caption); }
.btn-lg { height: 48px; padding: 0 var(--space-6); font-weight: 700; }

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled,
.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === Cards === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5);
}
@media (max-width: 768px) {
    .card { padding: var(--space-4); }
}

.card-raised {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.card-interactive {
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}
.card-interactive:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.card-header {
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-h3);
    font-weight: 600;
    line-height: var(--leading-h3);
}

/* === Inputs === */
.input,
input.input,
textarea.input,
select.input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-3);
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-body);
    transition: border-color var(--transition), box-shadow var(--transition);
}
textarea.input {
    height: auto;
    min-height: 96px;
    padding: var(--space-3);
    resize: vertical;
    line-height: var(--leading-body);
}
.input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.input:disabled {
    border-color: var(--border-disabled);
    color: var(--text-disabled);
    cursor: not-allowed;
}
.input.has-error { border-color: var(--danger); }
.input.has-error:focus { box-shadow: 0 0 0 3px var(--danger-ring); }

.label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.error-text {
    margin-top: var(--space-1);
    font-size: var(--text-caption);
    color: var(--danger);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-info    { background: var(--info-dim);    color: var(--info); }

.badge-tag {
    background: var(--surface-raised);
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: var(--text-caption);
    border: 1px solid var(--border);
}

/* === Empty / Error states === */
.empty-no-items,
.empty-filtered,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-7) var(--space-5);
}

.empty-no-items .icon {
    color: var(--accent);
    filter: drop-shadow(0 0 24px var(--focus-ring));
    margin-bottom: var(--space-4);
}
.empty-no-items .title { font-size: var(--text-h2); font-weight: 600; margin-bottom: var(--space-2); }
.empty-no-items .desc  { color: var(--text-muted); margin-bottom: var(--space-5); max-width: 360px; }

.empty-filtered .icon  { color: var(--text-muted); margin-bottom: var(--space-3); }
.empty-filtered .title { font-size: var(--text-h3); font-weight: 600; margin-bottom: var(--space-2); }
.empty-filtered .desc  { color: var(--text-muted); }

.error-state .title { font-size: var(--text-h2); font-weight: 600; margin-bottom: var(--space-2); }
.error-state .desc  { color: var(--text-muted); margin-bottom: var(--space-5); }

/* === Toasts === */
.toast-container {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: toast-in 200ms ease;
}
.toast-error   { border-color: var(--danger); }
.toast-success { border-color: var(--success); }
.toast-warning { border-color: var(--warning); }
.toast-info    { border-color: var(--info); }

.toast .toast-icon { flex-shrink: 0; }
.toast-error   .toast-icon { color: var(--danger); }
.toast-success .toast-icon { color: var(--success); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

.toast .toast-text  { flex: 1; font-size: var(--text-body); }
.toast .toast-close { color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.toast .toast-close:hover { color: var(--text-primary); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* === Skeleton (existing pattern) === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
.animate-pulse { animation: pulse 1.8s ease-in-out infinite; }

/* === List skeleton rows + pager (shared: clients / payments / expenses / services index) === */
.skel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.skel-row { display: flex; align-items: center; gap: var(--space-3); padding: 11px var(--space-4); border-bottom: 1px solid var(--border); }
.skel-row:last-child { border-bottom: none; }
.skel-av { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-hover-strong); flex-shrink: 0; }
.skel-line { border-radius: 4px; background: var(--surface-hover-strong); }

.pag { display: none; align-items: center; justify-content: space-between; margin-top: var(--space-2); }
.pag button { padding: 6px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-muted); transition: color var(--transition), border-color var(--transition); }
.pag button:hover:not(:disabled) { color: var(--accent); border-color: var(--border-accent); }
.pag button:disabled { opacity: 0.35; cursor: default; }
.pag-info { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* === Analytics Widgets (universal renderer) === */
.aw { padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: var(--space-2); min-height: 92px; }
.aw-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.aw-value { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.aw-msg { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.aw--loading .aw-skel { height: 32px; background: var(--surface-raised); border-radius: 6px; animation: aw-pulse 1.5s ease-in-out infinite; }
@keyframes aw-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.aw--error { border-color: var(--danger-dim); }
.aw--error .aw-msg { color: var(--danger); }
.aw--locked, .aw--unknown { background: repeating-linear-gradient(45deg, transparent 0, transparent 9px, var(--surface-hover) 9px, var(--surface-hover) 10px); }
.aw-lock-icon { font-size: 18px; opacity: 0.6; }
.aw--progress .aw-bar { height: 4px; background: var(--surface-raised); border-radius: 2px; overflow: hidden; }
.aw--progress .aw-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; }
.aw-progress-text { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.aw-dist-list { display: flex; flex-direction: column; gap: 6px; }
.aw-dist-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2); align-items: center; font-size: 11px; }
.aw-dist-name { color: var(--text-primary); font-weight: 500; }
.aw-dist-bar { height: 6px; background: var(--surface-raised); border-radius: 3px; overflow: hidden; }
.aw-dist-fill { display: block; height: 100%; background: var(--accent); }
.aw-dist-val { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* === Пейджер усередині віджета (shared: витрати — теги, клієнти — джерела) ===
 * Віджети мають фіксовану висоту, а списки в них — ні: без сторінок довгий
 * список просто вилазить за картку. Гортання, а не «топ-5 і крапка», бо
 * решта джерел/тегів тоді зникає без сліду. */
.w-pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; }
.w-pager button {
    width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-muted); font-size: 12px; line-height: 1; padding: 0;
    transition: color var(--transition), border-color var(--transition);
}
.w-pager button:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border-strong); }
.w-pager button:disabled { opacity: 0.3; cursor: default; }
.w-pager span { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* === Перемикач сторінок віджета (shared: витрати — Категорії/Теги,
 * записи — Найближчі/7 днів) === */
.w-switch { display: flex; gap: 4px; margin-top: 6px; }
.w-switch button {
    padding: 4px 10px; font-size: 10px; font-weight: 700;
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: transparent; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.w-switch button:hover { color: var(--text-primary); }
.w-switch button.active { color: var(--accent); border-color: var(--border-accent); background: var(--accent-dim); }

/* === Accordion list (shared: services / appointments / payments) ===
 * Uniform list+row baseline + expandable panel. Row inner content and panel
 * body are domain-specific (each page renders its own); the shell, sizing,
 * tab strip and confirm modal live here so all lists look and size the same.
 */

/* Shared list container — identical params on every module (fixed-height
 * column fills + internal scroll); only the rows inside differ. Lives in one
 * place so all module lists size and scroll the same. */
.acc-list {
    flex: 0 1 auto; min-height: 0; overflow-y: auto;
    background: var(--surface); border-radius: var(--radius);
    /* Shrinks to content: the unfilled part of the fixed-height column stays
     * page background, so the block "hides" when the list is short/empty. */
}

/* Item + row — fixed height + status rail (game "database entry" style).
 * The 3px left rail is coloured per status (--acc-rail set by an s-* tone
 * class on the item); it brightens + emits on hover/open. Row height is fixed
 * so 1-line and 2-line rows align across every page.
 */
.acc-item {
    position: relative;
    border-bottom: 1px solid var(--border);
    --acc-rail: var(--border-strong);
}
.acc-item:last-child { border-bottom: none; }
.acc-item.s-accent  { --acc-rail: var(--accent); }
.acc-item.s-success { --acc-rail: var(--success); }
.acc-item.s-warning { --acc-rail: var(--warning); }
.acc-item.s-info    { --acc-rail: var(--info); }
.acc-item.s-danger  { --acc-rail: var(--danger); }
.acc-item.s-muted   { --acc-rail: var(--text-muted); }
.acc-row {
    position: relative;
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 58px; box-sizing: border-box;
    padding: 11px var(--space-4) 11px calc(var(--space-4) + 10px);
    color: inherit; cursor: pointer; user-select: none;
    transition: background var(--transition);
}
/* Status rail — lives on the ROW only, never on the open panel */
.acc-row::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--acc-rail); opacity: 0.5;
    transition: opacity var(--transition), box-shadow var(--transition);
    pointer-events: none;
}
.acc-row:hover::before,
.acc-item.is-open > .acc-row::before { opacity: 1; box-shadow: 0 0 10px var(--acc-rail); }
.acc-row:hover { background: var(--surface-hover); }
.acc-item.is-open > .acc-row { z-index: 2; background: var(--surface-hover); }
.acc-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acc-row-arrow { color: var(--text-muted); opacity: 0.35; flex-shrink: 0; transition: transform var(--transition), opacity var(--transition), color var(--transition); }
.acc-row:hover .acc-row-arrow { opacity: 0.9; color: var(--accent); }
.acc-item.is-open .acc-row-arrow { transform: rotate(90deg); opacity: 0.9; color: var(--accent); }

/* Panel — animated unfold; indented from the left and flush to the right edge,
 * so the open block reads as a nested "database entry". Flat top, no colour rail.
 */
.acc-panel {
    display: grid; grid-template-rows: 0fr;
    background: var(--bg);
    padding-left: 40px;
    transition: grid-template-rows 260ms cubic-bezier(.4, 0, .2, 1);
}
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
/* Frame — ONE cohesive surface block holding actions + details (so buttons read
 * as part of the panel, not floating). Clips smoothly while the row collapses,
 * and carries the cyber cuts: concave bottom-right corner + a shallow RECTANGULAR
 * notch bitten out of the left edge a bit above the bottom (Cyberpunk menu). */
.acc-panel-frame {
    min-height: 0; overflow: hidden;
    background: var(--surface);
    clip-path: polygon(
        0 0, 100% 0,
        100% calc(100% - 16px), calc(100% - 16px) 100%,
        0 100%, 0 calc(100% - 12px),
        5px calc(100% - 12px), 5px calc(100% - 30px), 0 calc(100% - 30px)
    );
}

/* Actions — top row of thin parallelogram buttons (edit + status change).
 * Default neutral; on hover/active the TEXT takes the status colour (--st-color),
 * no fill. Cyberpunk slant via skewX (inner text un-skewed). */
.acc-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 16px 2px; }
.acc-act {
    flex: 0 0 auto; cursor: pointer; text-decoration: none; font-family: inherit;
    background: var(--surface-hover); border: 1px solid var(--border);
    transform: skewX(-11deg);
}
.acc-act-inner {
    display: inline-block; transform: skewX(11deg);
    padding: 4px 11px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-muted); transition: color var(--transition);
}
/* Hover + active: only the TEXT takes the status colour; border stays neutral. */
.acc-act:hover .acc-act-inner { color: var(--st-color, var(--accent)); }
.acc-act.is-active .acc-act-inner { color: var(--st-color); }
.acc-act:disabled { opacity: 0.45; cursor: not-allowed; }

/* Split layout — content (body) on the left, action buttons on the right.
 * Used where there are few buttons (payments / services); appointments keep the
 * default (buttons as a right-aligned top row, body below). */
.acc-panel-frame--split { display: flex; align-items: flex-start; justify-content: flex-end; }
.acc-panel-frame--split .acc-body { order: 1; flex: 1 1 auto; min-width: 0; }
.acc-panel-frame--split .acc-acts { order: 2; flex: 0 0 auto; max-width: 55%; }
.acc-act.t-accent  { --st-color: var(--accent); }
.acc-act.t-success { --st-color: var(--success); }
.acc-act.t-warning { --st-color: var(--warning); }
.acc-act.t-danger  { --st-color: var(--danger); }
.acc-act.t-muted   { --st-color: var(--text-secondary); }

/* Body — sits inside the shared surface frame (no own bg) */
.acc-body { padding: 14px 18px 16px; }
.acc-body-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); margin-bottom: 6px; }

/* Info lines inside a body */
.acc-info { display: flex; flex-direction: column; gap: 8px; }
.acc-info-line { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.acc-info-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); min-width: 70px; flex-shrink: 0; }
.acc-info-val { color: var(--text-primary); min-width: 0; }
.acc-info-val.muted { color: var(--text-muted); }

/* Confirm modal — shared, created lazily by accordion.js */
.acc-modal-bd { position: fixed; inset: 0; z-index: 9000; background: rgba(8,10,18,0.66); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; padding: 20px; }
.acc-modal-bd.is-open { display: flex; animation: accModalFade 0.18s ease; }
@keyframes accModalFade { from { opacity: 0; } to { opacity: 1; } }
.acc-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; max-width: 420px; width: 100%; color: var(--text-primary); box-shadow: 0 18px 60px rgba(0,0,0,0.5); animation: accModalPop 0.18s ease; }
@keyframes accModalPop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.acc-modal-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 10px; }
.acc-modal-body { font-size: 0.86rem; line-height: 1.5; color: var(--text-muted); margin: 0 0 18px; }
.acc-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.acc-modal-btn { font-size: 0.82rem; font-weight: 700; padding: 9px 18px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; transition: background var(--transition), border-color var(--transition); }
.acc-modal-cancel { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border); }
.acc-modal-cancel:hover { border-color: var(--border-strong); }
.acc-modal-confirm { background: var(--danger); color: #fff; }
.acc-modal-confirm:hover { filter: brightness(0.92); }

@media (max-width: 600px) {
    .acc-act-inner { padding: 9px 4px; font-size: 9px; letter-spacing: 0.02em; }
    .acc-body { padding: 14px 16px; }
}
@media (max-width: 560px) {
    .acc-row { padding: 10px var(--space-3); gap: var(--space-2); }
}

/* ───────────────────────── Line items (service cart) + adjustments ─────────
   Shared by appointment / payment add+edit forms (static/js/line-items.js).
   Uses theme tokens so it themes with the rest of the app. */
.li-palette { display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow-y: auto; padding: 2px; }
.li-empty { font-size: 13px; color: var(--text-muted); padding: 8px 4px; }
.li-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.li-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--radius-pill);
  background: var(--surface-hover); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all var(--transition);
}
.li-chip:hover { background: var(--surface-hover-strong); color: var(--text-primary); border-color: var(--border-strong); }
.li-chip-price { font-weight: 700; opacity: 0.75; font-variant-numeric: tabular-nums; }
.li-chip-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: var(--radius-pill);
  background: var(--accent-dim); color: var(--accent);
}

.li-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.li-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-hover); border: 1px solid var(--border);
}
.li-row-main { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.li-row-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.li-variant-wrap { max-width: 260px; }
.li-variant {
  width: 100%; box-sizing: border-box; appearance: none; cursor: pointer;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 30px 8px 11px;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary);
  outline: none;
}
.li-qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.li-qty-btn {
  width: 28px; height: 32px; border-radius: 7px;
  background: var(--surface-hover); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 16px; font-weight: 700; line-height: 1;
  cursor: pointer; transition: all var(--transition);
}
.li-qty-btn:hover { background: var(--surface-hover-strong); border-color: var(--border-strong); }
.li-qty-input {
  width: 44px; text-align: center; box-sizing: border-box;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 4px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-primary);
  outline: none;
}
.li-price { position: relative; flex-shrink: 0; }
.li-price-input, .li-adj-amount {
  width: 96px; box-sizing: border-box;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 26px 8px 11px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-primary);
  outline: none;
}
.li-cur {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: var(--text-muted); pointer-events: none;
}
.li-sub {
  min-width: 78px; text-align: right; flex-shrink: 0;
  font-size: 13px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums;
}
.li-remove {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 7px;
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer; transition: color var(--transition);
}
.li-remove:hover { color: var(--danger); }
.li-variant:focus, .li-qty-input:focus, .li-price-input:focus,
.li-adj-amount:focus, .li-adj-note:focus {
  border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Adjustments (tips / discounts) */
.li-adj-list { display: flex; flex-direction: column; gap: 8px; }
.li-adj-list:not(:empty) { margin-bottom: 12px; }
/* Рядок коригування за правилом: назва правила замість списку причин, відсоток
   з підписом «= 85 ₴» (спринт 24.09, частина B) */
.li-adj-name { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; flex-shrink: 1; }
.li-adj-calc { font-size: 12px; font-weight: 700; color: var(--text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.li-adj-percent { width: 88px; }
/* Меню «+ Коригування»: заголовки груп (Знижки / Надбавки) */
.dd-menu .dd-head { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px 2px; }
.dd-menu .dd-head:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; }
.li-adj {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-hover); border: 1px solid var(--border);
}
.li-adj-kind {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill);
}
/* Знижка — рожева, як у списку й віджетах Оплат (червоний — за упущеними грошима, Fiobs 2026-09-27) */
.li-adj-kind.discount { background: color-mix(in srgb, var(--pink) 12%, transparent); color: var(--pink); border: 1px solid color-mix(in srgb, var(--pink) 35%, transparent); }
.li-adj-kind.tip { background: var(--success-dim); color: var(--success); border: 1px solid var(--border-success); }
.li-adj-note {
  flex: 1 1 140px; min-width: 0; box-sizing: border-box;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary);
  outline: none;
}

/* ── Selected service chip (filled accent) ── */
.li-chip.selected { background: var(--accent-dim); border-color: var(--border-accent-strong); color: var(--accent); }
.li-chip.selected::before { content: "\2713"; font-weight: 700; margin-right: 1px; }

/* ── Custom dropdown (theme-stable replacement for native <select>) ── */
.dd { position: relative; }
.dd-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 14px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-primary); cursor: pointer;
}
.dd-btn .dd-chev { margin-left: auto; font-size: 13px; color: var(--text-muted); transition: transform var(--transition); }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-menu {
  display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 60; min-width: 100%;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 9px;
  overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.dd.open .dd-menu { display: block; }
.dd-menu button {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 10px 14px;
  background: none; border: none; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-primary); cursor: pointer; text-align: left;
}
.dd-menu button:hover { background: var(--surface-hover-strong); }

/* ── Collapsible section bar (optional fields) ── */
.fold-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; cursor: pointer; transition: border-color var(--transition);
}
.fold-bar:hover { border-color: var(--border-strong); }
.fold-bar .fold-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fold-bar .fold-opt { font-size: 12px; color: var(--text-muted); }
.fold-bar .fold-badge { font-size: 11px; font-weight: 700; color: var(--accent); margin-left: 4px; }
.fold-bar .fold-chev { margin-left: auto; font-size: 16px; color: var(--text-muted); transition: transform var(--transition); }
.fold-bar.open .fold-chev { transform: rotate(180deg); }
.fold-bar.open { border-radius: 12px 12px 0 0; }
.fold-panel {
  background: var(--surface); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 12px 12px; padding: 18px;
}

/* ── Shared modal (tags, confirmations) ──
   Fade/pop reuse the acc-modal keyframes — same 0.18s motion everywhere. */
.modal-bd { position: fixed; inset: 0; z-index: 9000; background: rgba(8,10,18,0.66); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bd.is-open { display: flex; animation: accModalFade 0.18s ease; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; max-width: 440px; width: 100%; color: var(--text-primary); box-shadow: 0 18px 60px rgba(0,0,0,0.5); animation: accModalPop 0.18s ease; }
.modal-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 14px; color: var(--text-primary); }
.modal-body { font-size: 0.86rem; line-height: 1.5; color: var(--text-muted); margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn { font-family: inherit; font-size: 0.82rem; font-weight: 700; padding: 9px 18px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; transition: background var(--transition), border-color var(--transition); }
.modal-cancel { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border); }
.modal-cancel:hover { border-color: var(--border-strong); }
.modal-confirm { background: var(--danger); color: #fff; }
.modal-confirm:hover { filter: brightness(0.92); }
/* Ствердна дія модалки (створити, зберегти, готово) — акцент; червоний лишається за видаленням. */
.modal-confirm.is-accent { background: var(--accent); color: var(--text-on-accent); }

/* ── Перемикачі кадрів: підписи-кнопки над кадром + стрілки на кадрі ──
   Слайди «до / після» на /changelog/ і сторінки модалки «Що нового» (2026-09-30: винесено зі
   сторінки changelog — другий споживач). Стрілка ставиться в контейнер з position: relative. */
.slide-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.slide-tab {
    padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: none;
    font: 600 12px var(--font-sans); color: var(--text-muted); cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}
.slide-tab:hover { color: var(--text-primary); }
.slide-tab.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-dim); }
.slide-step {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18);
    background: rgba(8,10,18,0.72); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
    opacity: 0.85; transition: opacity var(--transition);
}
.slide-step:hover { opacity: 1; }
.slide-step:disabled { opacity: 0; pointer-events: none; }
.slide-step.is-prev { left: 10px; }
.slide-step.is-next { right: 10px; }

/* ── Compact "+ add" meta buttons (tags / notes) ── */
.pay-meta-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-meta-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-hover); color: var(--text-primary);
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color var(--transition);
}
.pay-meta-btn:hover { border-color: var(--border-strong); }

/* ── Adjustments subsection (inside services block) ── */
.li-adj-section { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
/* Підказка «Постійна знижка клієнта 10 % · Застосувати» під коригуваннями (форми оплати) */
.personal-hint { font-size: 0.8rem; color: var(--text-muted); margin: 6px 0 0; }
.personal-hint b { color: var(--text-primary); }
.personal-hint a { color: var(--accent); font-weight: 700; text-decoration: none; }
.personal-hint a:hover { text-decoration: underline; }

/* ── Service group (a selected service with 1+ variant rows) ── */
.li-group { background: var(--surface-hover); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.li-group-head { display: flex; align-items: center; margin-bottom: 6px; }
.li-group-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.li-group-head .li-remove { margin-left: auto; }
.li-vrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.li-vrow + .li-vrow { border-top: 1px dashed var(--border); }
/* Push qty / price / subtotal / × to the right edge in both simple and variant rows. */
.li-row .li-qty, .li-vrow .li-qty { margin-left: auto; }
.li-add-variant {
  margin-top: 8px; background: none; border: 1px dashed var(--border); border-radius: 8px;
  padding: 6px 12px; color: var(--accent); font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: border-color var(--transition);
}
.li-add-variant:hover { border-color: var(--accent); }

/* ── Compact line items / adjustments (форма оплати, 2026-09-28) ──
   Модифікатор `.li-compact` на контейнері: контроли 28–30px замість 40, вужчі
   відступи — три обрані послуги більше не займають пів екрана (Fiobs: «воно
   виглядає над масивним… давить»). Форми записів лишаються на базових розмірах. */
.li-compact .li-row, .li-compact .li-adj { padding: 5px 8px 5px 12px; gap: 8px; border-radius: 8px; }
.li-compact .li-row-name, .li-compact .li-group-name { font-size: 13px; }
.li-compact.li-lines { gap: 6px; margin-top: 10px; }
.li-compact.li-adj-list { gap: 6px; }
.li-compact .li-qty-btn { width: 24px; height: 28px; font-size: 14px; border-radius: 6px; }
.li-compact .li-qty-input { width: 38px; padding: 5px 2px; font-size: 12.5px; border-radius: 6px; }
.li-compact .li-price-input, .li-compact .li-adj-amount { width: 86px; padding: 5px 22px 5px 9px; font-size: 12.5px; border-radius: 6px; }
.li-compact .li-adj-percent { width: 72px; }
.li-compact .li-cur { right: 8px; font-size: 11px; }
.li-compact .li-sub { min-width: 68px; font-size: 12.5px; }
.li-compact .li-remove { width: 24px; height: 24px; font-size: 16px; }
.li-compact .li-adj-note { padding: 5px 9px; font-size: 12.5px; border-radius: 6px; }
.li-compact .li-adj-kind { font-size: 10px; padding: 3px 8px; }
.li-compact .li-adj-name { font-size: 12px; }
.li-compact .li-variant { padding: 5px 26px 5px 9px; font-size: 12.5px; border-radius: 6px; }
.li-compact .li-variant-wrap { max-width: 220px; }
.li-compact .li-group { padding: 6px 10px; border-radius: 8px; }
.li-compact .li-group-head { margin-bottom: 2px; }
.li-compact .li-vrow { padding: 4px 0; gap: 8px; }
.li-compact .li-add-variant { margin-top: 4px; padding: 4px 10px; font-size: 11.5px; }
.li-palette.li-compact { gap: 6px; max-height: 96px; }
.li-palette.li-compact .li-chip { padding: 5px 10px; font-size: 12.5px; gap: 5px; }
.li-palette.li-compact .li-chip-tag { font-size: 8.5px; padding: 1px 5px; }

/* ── Flat rows (форма оплати, 2026-09-28): без «блоку в блоці» — рядки послуг,
   внесків і коригувань розділяє лише лінія, а не власна рамка з фоном (Fiobs). */
.li-flat .li-row, .li-flat .li-adj, .li-flat .li-group { background: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); padding: 7px 0; }
.li-flat .li-row:last-child, .li-flat .li-adj:last-child, .li-flat .li-group:last-child { border-bottom: 0; }
.li-flat.li-lines, .li-flat.li-adj-list { gap: 0; }
.li-flat .li-group { padding: 6px 0; }
.li-row-link { color: var(--text-primary); text-decoration: none; font-weight: 700; }
.li-row-link:hover { color: var(--accent); }
.li-row-link .li-ext { font-size: 10px; margin-left: 3px; opacity: 0.6; }
.li-unit { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.li-quick-title { flex-basis: 100%; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin: 2px 0 2px; }
/* Коригування: основний рядок + розкривний коментар під ним */
.li-adj { display: block; }
.li-adj-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-adj-note-row { margin-top: 6px; }
.li-adj-note-row .li-adj-note { width: 100%; }
.li-adj-note-btn {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; color: var(--text-muted); cursor: pointer; transition: color var(--transition), border-color var(--transition);
}
.li-adj-note-btn:hover { color: var(--text-primary); border-color: var(--border); }
.li-adj-note-btn.has-note { color: var(--accent); }
.li-adj-main .li-adj-name { flex: 1 1 auto; max-width: none; }
.li-adj-main .li-adj-calc { margin-right: auto; }
/* Знижка — рожева, надбавка — світлий зелений (--success-soft; глибокий — за отриманими грошима) */
.li-adj-kind.tip { background: color-mix(in srgb, var(--success-soft) 14%, transparent); color: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success-soft) 35%, transparent); }
/* «?» біля підпису поля форми — спільна підказка Tip.mount(data-tip) */
.f-info {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px; vertical-align: -2px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-muted); font-size: 9px; font-weight: 800; font-family: inherit; cursor: help; padding: 0;
}
.f-info:hover { color: var(--text-primary); border-color: var(--border-focus); }
.pay-bar-stat .s .adj-tip { color: var(--success-soft); }

/* ── Service picker: пошук + список замість палітри всіх послуг (форма оплати) ──
   Каталог до `chipLimit` послуг ще й показується чипами (один клік), більший —
   лише через це поле: групи за першим тегом послуги («класифікація як у
   каталозі»), фільтр по назві й тегах, стрілки/Enter/Esc. */
.svc-pick { position: relative; }
.svc-pick-input.add-input { padding-left: 38px; }
.svc-pick-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.svc-pick-menu {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70;
  max-height: 300px; overflow-y: auto; padding: 4px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.svc-pick.open .svc-pick-menu { display: block; }
.svc-pick-head { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px 3px; }
.svc-pick-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 7px;
  border: none; background: none; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-primary); cursor: pointer; text-align: left;
}
.svc-pick-item:hover, .svc-pick-item.is-active { background: var(--surface-hover-strong); }
.svc-pick-item.selected { color: var(--accent); }
.svc-pick-item.selected::before { content: "\2713"; font-weight: 700; }
.svc-pick-item .svc-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-pick-item .svc-pick-price { font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-pick-empty { padding: 10px; font-size: 13px; color: var(--text-muted); }
[data-theme="light"] .svc-pick-menu { box-shadow: 0 8px 32px rgba(18, 20, 28, 0.14); }

/* ── Блок «Послуги» форм оплати і запису (один вигляд, 2026-09-28) ──
   «Обрані» ліворуч (назва веде в картку послуги, лише кількість — ціна зі знімка),
   «Часто беруть» + пошук праворуч; на вузькому — пошук згори. */
.svc-halves { display: grid; grid-template-columns: 1fr; gap: 16px; }
.svc-half-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.svc-chosen, .svc-find { min-width: 0; }
.svc-find .li-palette { margin-top: 10px; max-height: none; }
.svc-empty { font-size: 12.5px; color: color-mix(in srgb, var(--text-muted) 70%, transparent); padding: 6px 0; }
/* Порожній стан — лише .svc-empty (без другого «Послуги не додані» від LineItems) */
.svc-chosen .li-empty { display: none; }
@media (min-width: 1000px) { .svc-halves { grid-template-columns: 1fr 1fr; } }
@media (max-width: 999px) { .svc-find { order: -1; } }
/* Обрана послуга — один рядок: назва стискається з трикрапкою, «×» не переносяться */
.svc-chosen .li-row { flex-wrap: nowrap; }
.svc-chosen .li-row-main { flex: 1 1 auto; min-width: 0; }
.svc-chosen .li-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-chosen .li-row .li-qty { margin-left: 0; }
/* Суми рядків спокійні — не сперечаються з «Разом за послугами» */
.svc-chosen .li-sub { color: var(--text-secondary); font-weight: 700; }
.total-row {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.total-row-label { font-size: 0.8rem; color: var(--text-muted); }
.total-row-val { font-size: 0.92rem; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ── Sticky summary bar of the payment forms (2026-09-28) ──
   Стан, «Разом» з розкладкою знижок/надбавок, «Отримано» і «Залишок» з
   гривневим еквівалентом та кнопки — завжди на екрані, поки форма прокручується;
   в кінці сторінки лягає на своє місце (sticky, не fixed — не треба знати
   ширину меню). На телефоні тримається над нижнім меню. */
.pay-bar {
  position: sticky; bottom: 12px; z-index: 50;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 16px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .pay-bar { box-shadow: 0 12px 36px rgba(18, 20, 28, 0.12); }
.pay-bar-stats { display: flex; gap: 22px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; align-items: flex-start; }
.pay-bar-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pay-bar-stat .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.pay-bar-stat .v { font-size: 15px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-bar-stat.is-accent .v { color: var(--accent); }
.pay-bar-stat .s { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-bar-stat .s:empty { display: none; }
.pay-bar-stat .s .adj-discount { color: var(--pink); }
.pay-bar-stat .s .adj-tip { color: var(--success); }
.pay-bar-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.pay-bar-err { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--danger); }
.pay-bar-err:empty { display: none; }
@media (max-width: 768px) {
  .pay-bar { bottom: calc(64px + env(safe-area-inset-bottom) + 8px); padding: 10px 12px; gap: 8px 12px; }
  .pay-bar > .pay-status-badge { align-self: flex-start; }   /* сам у першому ряду: наступний блок займає 100% */
  .pay-bar-stats { gap: 14px; flex: 1 1 100%; flex-wrap: nowrap; }
  .pay-bar-stat { flex: 1 1 0; }
  .pay-bar-stat .v { font-size: 14px; }
  .pay-bar .f-info { display: none; }
  .pay-bar-actions { width: 100%; margin-left: 0; }
  .pay-bar-actions .add-submit-btn { flex: 1 1 auto; }
}

/* === Пов'язані записи картками (shared: картка клієнта — «Платежі» / «Записи»,
   «Детальніше» оплати — «Послуги»). Уся картка — посилання; іконка · назва з
   підрядком · сума справа. === */
.rel-section { margin-top: 18px; }
.rel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 4px; }
.rel-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.02em; }
.rel-count { font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rel-empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--text-muted); font-size: 0.78rem; }
.rel-list { display: flex; flex-direction: column; gap: 8px; }
.rel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; transition: border-color 0.15s; text-decoration: none; color: inherit; }
a.rel-card:hover { border-color: var(--border-accent); }
.rel-card-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rel-card-when { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rel-card-main { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-card-side { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.rel-card-amount { font-size: 0.92rem; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rel-card-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rel-card-icon.pay  { background: var(--success-dim); color: var(--success); }
.rel-card-icon.appt { background: var(--accent-dim); color: var(--accent); }
.rel-card-icon.svc  { background: var(--success-dim); color: var(--success); }

/* === Add/Edit form kit (shared: appointments / payments / clients / expenses forms) ===
   Compact form pattern (еталон — expenses/form.html): breadcrumb, картка, поля,
   сабміт. .add-wrap лишається у шаблоні — ширина сторінки різна per модуль. */
.add-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; font-size: 0.82rem; }
.add-breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.add-breadcrumb a:hover { color: var(--text-primary); }
.add-breadcrumb-sep { color: var(--border-strong); }
.add-breadcrumb-cur { color: var(--text-primary); font-weight: 600; }
.add-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 28px; }
.add-error-banner { display: none; background: var(--danger-dim); border: 1px solid var(--border-danger); border-radius: 9px; padding: 11px 16px; font-size: 0.84rem; color: var(--danger); margin-bottom: 20px; }
.add-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 14px; }
.add-section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }
.add-field { margin-bottom: 16px; }
.add-field:last-child { margin-bottom: 0; }
.add-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.add-label .opt { font-weight: 500; color: color-mix(in srgb, var(--text-muted) 60%, transparent); }
.add-label .req { color: var(--danger); }
.add-input, .add-select, .add-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 14px;
  font-family: var(--font-sans); font-size: 0.87rem; font-weight: 500; color: var(--text-primary);
  outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}
.add-input:focus, .add-select:focus, .add-textarea:focus { border-color: var(--border-accent-strong); box-shadow: 0 0 0 3px var(--accent-dim); }
.add-input::placeholder, .add-textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 50%, transparent); }
.add-textarea { resize: vertical; min-height: 72px; }
.add-field-error { display: none; margin-top: 6px; font-size: 0.76rem; color: var(--danger); font-weight: 600; }
.add-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.add-actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.add-submit-btn {
  padding: 11px 28px; border-radius: 9px;
  background: var(--accent); color: var(--text-on-accent);
  font-family: var(--font-sans); font-size: 0.87rem; font-weight: 800;
  border: none; cursor: pointer;
  box-shadow: 0 0 20px var(--accent-glow);
  transition: all 0.18s;
}
.add-submit-btn:hover { background: var(--accent-hover); box-shadow: 0 0 32px var(--accent-glow); transform: translateY(-1px); }
.add-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.add-cancel-link { font-size: 0.84rem; color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.add-cancel-link:hover { color: var(--text-primary); }

/* Form field helpers (date / time / amount) */
.date-field-wrap { position: relative; }
.time-wrap { display: flex; align-items: center; gap: 6px; }
.time-seg { width: 56px; text-align: center; flex-shrink: 0; padding: 10px 6px; }
.time-sep { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); }
.amount-wrap { position: relative; }
.amount-input { padding-left: 28px !important; }

/* Client autocomplete dropdown (форми Оплат/Записів; JS поки per-page — IDEAS E3) */
.client-drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 9px;
  overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 50; max-height: 220px; overflow-y: auto; display: none;
}
.client-drop-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; transition: background 0.12s; }
.client-drop-item:hover { background: var(--surface-hover); }
.client-drop-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.client-drop-name { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.client-drop-phone { font-size: 0.75rem; color: var(--text-muted); }
.client-drop-searching { padding: 12px 14px; font-size: 0.82rem; color: var(--text-muted); }

/* Tags preview + suggestions (форми Оплат/Витрат/Клієнтів) */
.pay-tags-preview, .exp-tags-preview { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pay-tags-preview:empty, .exp-tags-preview:empty { display: none; }
.tag-suggest-title { margin: 14px 0 0; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag-suggest-pill {
  font-size: 0.68rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tag-suggest-pill:hover { color: var(--accent); border-color: var(--border-accent); background: var(--accent-dim); }

/* === Period filter (shared: appointments / payments / future modules) ===
   Chip button + popup: preset rows on top, monobank-style range calendar below.
   Behaviour lives in static/js/period-filter.js (global PeriodFilter). */
.pf-wrap { position: relative; flex-shrink: 0; }
.pf-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.pf-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.pf-btn-dates { margin-left: 4px; font-weight: 500; color: var(--text-muted); }
@media (max-width: 480px) { .pf-btn-dates { display: none; } }
.pf-btn.has-range { color: var(--accent); border-color: var(--border-accent); background: var(--accent-dim); }
.pf-wrap.is-open .pf-btn { color: var(--accent); border-color: var(--border-accent); }
/* Попап відкривається ПРАВИМ краєм під кнопкою: кнопка періоду — завжди остання
   у subbar, а прихований попап (opacity: 0) усе одно займає місце в layout — з
   left: 0 він вилазив за viewport і давав сторінці горизонтальний скрол на
   вузьких десктопах (кейс дошки Проєктів, Fiobs 2026-09-11). У формах (.pf-field)
   поле широке — там лівий край. */
.pf-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 120; width: 292px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45); padding: 12px;
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
}
.pf-wrap.is-open .pf-pop { opacity: 1; pointer-events: auto; transform: translateY(0); }
.pf-bd { display: none; }
.pf-presets { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pf-preset {
  background: var(--surface-hover); border: 1px solid transparent; border-radius: 7px;
  padding: 6px 10px; font-family: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.pf-preset:hover { color: var(--text-primary); }
.pf-preset.active { color: var(--accent); background: var(--accent-dim); border-color: var(--border-accent); }
.pf-cal { padding-top: 12px; }
.pf-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pf-cal-title { font-size: 13px; font-weight: 800; color: var(--text-primary); }
/* Рік-селект у single-date режимі (форми) — стилізований під заголовок */
.pf-year {
  appearance: none; -webkit-appearance: none;
  background: none; border: none; padding: 0 2px;
  font-family: inherit; font-size: 13px; font-weight: 800; color: var(--text-primary);
  cursor: pointer;
}
.pf-year:focus { outline: none; color: var(--accent); }
.pf-nav {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: none;
  font-size: 16px; line-height: 1; color: var(--text-muted); cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.pf-nav:hover { color: var(--text-primary); border-color: var(--border-strong); }
.pf-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pf-dow {
  text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); padding: 4px 0 6px;
}
.pf-day {
  height: 32px; border: none; border-radius: 8px; background: none;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-primary);
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.pf-day:hover { background: var(--surface-hover); }
.pf-day.is-today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.pf-day.in-range { background: var(--accent-dim); color: var(--accent); border-radius: 0; }
.pf-day.is-sel { background: var(--accent); color: var(--text-on-accent); font-weight: 800; }
@media (max-width: 768px) {
  .pf-wrap.is-open .pf-bd {
    display: block; position: fixed; inset: 0; z-index: 199; background: rgba(0, 0, 0, 0.6);
  }
  .pf-pop {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 200; width: auto;
    border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(12px);
  }
  .pf-day { height: 38px; }
}

/* Single-date mode as a form field (add/edit forms): the chip stretches to
   the .add-input dimensions so the picker sits naturally in a form row. */
.pf-wrap.pf-field { display: block; }
.pf-wrap.pf-field .pf-pop { right: auto; left: 0; }
.pf-wrap.pf-field .pf-btn {
  width: 100%; height: auto; justify-content: flex-start;
  padding: 10px 14px; border-radius: 9px;
  background: var(--input-bg, var(--surface-hover));
  font-size: 0.87rem; font-weight: 600;
}
.pf-wrap.pf-field .pf-btn.has-range { color: var(--text-primary); background: var(--input-bg, var(--surface-hover)); border-color: var(--border); }
.pf-wrap.pf-field.is-open .pf-btn { border-color: var(--border-accent-strong); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── Tag pill: live preview + remove badge (× top-right, on hover) ── */
.pay-tag-pill {
  position: relative;
  font-size: 0.68rem; font-weight: 700; padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}
.pay-tag-pill.preview { opacity: 0.5; border-style: dashed; }
.pay-tag-pill .tag-x {
  display: none; position: absolute; top: -6px; right: -6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border);
  align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; cursor: pointer; padding: 0; opacity: 0.85;
}
.pay-tag-pill:hover .tag-x { display: flex; }
.pay-tag-pill .tag-x:hover { opacity: 1; color: var(--text-primary); }

/* === List subbar — пошук + фільтри + сортування + період ===
   Спільний контрол-бар усіх list-сторінок (еталон — links/index.html).
   Сторінка дає лише вміст popover/sheet і доменні tone-класи чипів. */
.subbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.subbar .pf-btn { height: 36px; }
.subbar .push-right { margin-left: auto; }

.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-input {
    width: 100%; height: 40px;
    padding: 0 var(--space-5) 0 40px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-body);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-clear {
    display: none;
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    font-size: 18px; line-height: 1; cursor: pointer; padding: 4px;
}
.search-clear:hover { color: var(--text-primary); }

.filter-wrap { position: relative; flex-shrink: 0; }
.filter-btn {
    display: inline-flex; align-items: center; gap: var(--space-2);
    height: 40px; padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--text-body); font-weight: 600;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}
.filter-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.filter-btn.is-open { color: var(--accent); border-color: var(--border-accent); }
.filter-btn .badge-n {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--accent); color: var(--text-on-accent);
    border-radius: var(--radius-pill);
    font-size: 10px; font-weight: 800;
}
.filter-btn .badge-n.is-empty { display: none; }

.filter-popover {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
    width: 320px;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: var(--space-4);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transform: translateY(-4px);
    transition: opacity var(--transition), transform var(--transition);
    display: flex; flex-direction: column; gap: var(--space-4);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.filter-popover.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.sort-pop { width: 230px; }

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-title {
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 4px;
}
.filter-popover hr, .sheet hr { border: none; border-top: 1px solid var(--border); margin: 0; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
    padding: 6px 11px;
    font-size: 11px; font-weight: 700;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.chip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.chip.active { color: var(--accent); border-color: var(--border-accent); background: var(--accent-dim); }

/* Mobile: popover ховається, фільтри живуть у bottom-sheet */
.sheet-bd { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.sheet-bd.is-open { display: block; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
    background: var(--surface-raised);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: var(--space-5);
    max-height: 85vh; overflow-y: auto;
    transform: translateY(100%);
    transition: transform 240ms ease;
    display: flex; flex-direction: column; gap: var(--space-4);
}
.sheet.is-open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--text-muted); opacity: 0.4; margin: 0 auto var(--space-3); }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.sheet-title { font-size: var(--text-h3); font-weight: 700; color: var(--text-primary); }

@media (max-width: 900px) {
    .filter-popover { display: none !important; }
}
@media (max-width: 560px) {
    .subbar .search-wrap { flex-basis: 100%; }
}

/* === Підказка data-tip (shared: Проєкти, Записи — static/js/tip.js) ===
 * Один fixed-елемент на сторінку (Tip.mount), той самий вигляд, що у ::after-підказок
 * Оплат/Клієнтів, але не обрізається overflow-контейнерами (смуга аналітики, списки зі скролом). */
.ui-tip {
    position: fixed; z-index: 1000; pointer-events: none;
    background: var(--surface-raised); border: 1px solid var(--border-strong);
    color: var(--text-primary); padding: 8px 12px; border-radius: var(--radius-sm, 8px);
    font-size: 11px; font-weight: 500; line-height: 1.45; text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    opacity: 0; transform: translateY(-4px);
    transition: opacity 0.18s, transform 0.18s;
}
.ui-tip.is-on { opacity: 1; transform: translateY(0); }

/* ── Модуль «Проєкти»: спільне для список / форма / картка / портал (static/js/projects.js) ── */
/* Повідомлення про результат дії (projNotify) — знизу по центру, зникає саме. */
.pj-notify {
    position: fixed; left: 50%; bottom: 24px; z-index: 1200; transform: translate(-50%, 12px);
    background: var(--surface-raised); border: 1px solid var(--border-strong); color: var(--text-primary);
    padding: 10px 16px; border-radius: var(--radius-md, 10px); font-size: 12.5px; font-weight: 600;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45); opacity: 0; pointer-events: none;
    transition: opacity 0.18s, transform 0.18s; max-width: min(480px, 92vw);
}
.pj-notify.is-on { opacity: 1; transform: translate(-50%, 0); }
.pj-notify.is-danger { border-color: var(--danger); color: var(--danger); }
.pj-notify.is-success { border-color: var(--success); color: var(--success); }

/* === Смуга аналітики над областю взаємодії (shared: Проєкти — «Дошка», Записи — «Календар») ===
 * Режим сторінки переносить ТІ САМІ вузли віджетів у .an-strip-cells і ставить їм
 * .is-compact (одна розмітка, одні дані; рішення Fiobs 2026-09-10 п. 1–2). Секція —
 * один блок із hex-бейджем «Аналітика», клітинки розділені лініями, заголовок
 * клітинки — рейка кольору модуля (--mod) замість бейджа. Показ/сховання і
 * кількість колонок — справа сторінки. Селектори з префіксом .an-strip: сторінкові
 * .w / .w-header / .ovr-* оголошені пізніше (у <style> шаблону) з тією ж вагою. */
.an-strip {
    --mod: var(--accent); --wbg: var(--surface);
    position: relative; margin-top: 10px;   /* місце під hex-бейдж */
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.an-strip:hover { border-color: color-mix(in srgb, var(--mod) 26%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--mod) 8%, transparent); }
.an-strip:hover > .w-header { background: color-mix(in srgb, var(--mod) 38%, transparent); }
/* Бейдж — правіше за заголовок першої клітинки, щоб не накривав «Огляд» (Fiobs 2026-09-24). */
.an-strip > .w-header { left: 112px; }
.an-strip-cells { display: grid; grid-template-columns: repeat(var(--an-cols, 4), minmax(0, 1fr)); }
.an-strip .an-strip-cells > .w {
    height: auto; min-height: 204px; background: none; border: none; border-radius: 0; box-shadow: none;
    border-right: 1px solid var(--border); padding: 22px var(--space-3) var(--space-3); overflow: hidden;
}
.an-strip .an-strip-cells > .w:last-child { border-right: none; }
.an-strip .an-strip-cells > .w:hover { border-color: var(--border); box-shadow: none; }
.an-strip .an-strip-cells > .w > .w-header {
    position: static; transform: none; background: none; clip-path: none; padding: 0;
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.an-strip .an-strip-cells > .w > .w-header::before {
    content: ""; width: 3px; height: 12px; border-radius: 2px; flex-shrink: 0;
    background: var(--mod); box-shadow: 0 0 10px color-mix(in srgb, var(--mod) 55%, transparent);
}
.an-strip .an-strip-cells > .w > .w-header .w-header-inner { background: none; clip-path: none; padding: 0; }
.an-strip .an-strip-cells > .w > .w-info { top: 20px; right: 10px; }
/* Смуга статусів у клітинці «Огляду» (shared: Проєкти — проєкти за статусами, Оплати — «Не отримано»):
   ширина сегмента — частка, клік — фільтр списку; один суцільний бар без зазорів (Fiobs 2026-09-11) */
.ovr-bar { display: flex; width: 100%; max-width: 150px; height: 6px; margin-top: 2px; }
.ovr-seg { flex: 1 1 0; min-width: 5px; border: none; padding: 0; cursor: pointer; transition: opacity var(--transition), transform var(--transition); }
.ovr-seg:first-child { border-radius: 3px 0 0 3px; }
.ovr-seg:last-child { border-radius: 0 3px 3px 0; }
.ovr-seg:hover { transform: scaleY(1.6); }

/* Компактний «Огляд»: чотири рядки у стовпчик — іконка · підпис/підрядок · значення · «?» */
.an-strip .an-strip-cells > .w-overview { padding: 12px 0 0; }
.an-strip .an-strip-cells > .w-overview > .w-header { padding: 0 var(--space-3); }
.an-strip .an-strip-cells .ovr-cells { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); }
.an-strip .an-strip-cells .ovr-cell {
    display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 15px;
    grid-template-areas: "icon label value info" "icon sub value info";
    column-gap: 10px; row-gap: 2px; align-items: center; text-align: left;
    padding: 2px var(--space-3); min-height: 0; overflow: hidden;
    border-right: none; border-bottom: 1px solid var(--border);
}
.an-strip .an-strip-cells .ovr-cell:last-child { border-bottom: none; }
.an-strip .ovr-icon { grid-area: icon; width: 20px; height: 20px; }
.an-strip .ovr-label { grid-area: label; font-size: 9px; align-self: end; }
.an-strip .ovr-value { grid-area: value; font-size: 16px !important; }
.an-strip .ovr-delta { grid-area: sub; align-self: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-strip .ovr-bar { grid-area: sub; margin-top: 0; max-width: none; align-self: start; }
.an-strip .ovr-cell.has-bar .ovr-delta { display: none; }
.an-strip .an-strip-cells .ovr-info { position: relative; top: auto; right: auto; grid-area: info; width: 13px; height: 13px; font-size: 8px; }
@media (max-width: 900px) {
    .an-strip-cells { grid-template-columns: 1fr; }
    .an-strip .an-strip-cells > .w { border-right: none; border-bottom: 1px solid var(--border); min-height: 0; }
    .an-strip .an-strip-cells > .w.w-overview { min-height: 204px; }   /* сітка 2×2 має flex-basis 0 — без висоти клітинка стискається до заголовка */
    .an-strip .an-strip-cells > .w:first-child { padding-top: 34px; }   /* запас під hex-бейдж «Аналітика» */
    .an-strip .an-strip-cells > .w:last-child { border-bottom: none; }
}

/* === Календар (shared: Записи, картка проєкту — static/js/calendar.js) ===
 * «Тиждень» на ПК — шкала часу (дні рядками, години згори), «Місяць» — повні тижні
 * з понеділка; на ПК обидва — однакової фіксованої висоти (--cal-body-h). Вузький
 * контейнер (.is-narrow) — компактний місяць (число + кількість записів, список
 * обраного дня) і стрічка тижня (сім днів + список).
 * Тон події задає --c через .cal-tone-* (фон і рамка — похідні, обидві теми). */
.cal { position: relative; }
.cal-tone-accent  { --c: var(--accent); }
.cal-tone-warning { --c: var(--warning); }
.cal-tone-success { --c: var(--success); }
.cal-tone-danger  { --c: var(--danger); }
.cal-tone-info    { --c: var(--info); }
.cal-tone-muted   { --c: var(--text-muted); }
.cal.is-loading .cal-body { opacity: 0.55; transition: opacity 0.2s; }
/* Фіксована висота на ПК — тиждень і місяць одного розміру (Fiobs 2026-09-24: «піджени під місяць») */
.cal:not(.is-narrow) .cal-body { height: var(--cal-body-h, 680px); }
/* «усього N» — кількість записів дня словом під записами: гола цифра в кутку губилась серед чисел */
.cal-total { font-size: 10.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Панель — одне місце для всього: [Тиждень | Місяць] ‹ діапазон › · «До сьогодні» (лише поза поточним періодом) */
.cal-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; padding: 0 0 10px; }
.cal-nav { display: inline-flex; align-items: center; gap: 4px; }
.cal-nav button {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: 600 14px var(--font-sans); color: var(--text-muted); cursor: pointer;
    transition: color var(--transition), background-color var(--transition);
}
.cal-nav button:hover { color: var(--text-primary); background: var(--surface-hover); }
.cal-title { min-width: 118px; padding: 0 var(--space-2); text-align: center; font-size: var(--text-body); font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.cal-back {
    height: 32px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--radius-sm);
    background: var(--accent-dim); font: 600 12.5px var(--font-sans); color: var(--accent); cursor: pointer;
}
.cal-back:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.cal-views {
    display: inline-flex; gap: 2px; padding: 3px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.cal-views button {
    padding: 5px 12px; border: none; background: none; border-radius: var(--radius-sm);
    font: 600 12.5px var(--font-sans); color: var(--text-muted); cursor: pointer;
    transition: color var(--transition), background-color var(--transition);
}
.cal-views button:hover { color: var(--text-primary); }
.cal-views button.active { background: var(--accent-dim); color: var(--accent); }

/* Тиждень (ПК): шкала часу */
.cal-tl, .cal-tl-scroll { height: 100%; }
.cal-tl-scroll { overflow-x: auto; overflow-y: hidden; }
.cal-tl-inner { height: 100%; min-width: calc(76px + var(--cal-hours) * 56px); display: grid; grid-template-rows: auto repeat(7, minmax(0, 1fr)); }
.cal-tl-head, .cal-tl-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); }
.cal-tl-head { border-bottom: 1px solid var(--border); }
.cal-tl-corner { border-right: 1px solid var(--border); }
.cal-tl-hours { display: grid; grid-template-columns: repeat(var(--cal-hours), minmax(0, 1fr)); }
.cal-tl-hour { padding: 8px 0 6px 5px; border-left: 1px solid var(--border); font-size: 10.5px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cal-tl-hour:first-child { border-left: none; }
.cal-tl-row { border-bottom: 1px solid var(--border); }
.cal-tl-row:last-child { border-bottom: none; }
.cal-tl-row.is-today { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.cal-tl-day {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
    padding: 6px 10px; border: none; border-right: 1px solid var(--border); background: none;
    font-family: var(--font-sans); color: var(--text-muted); text-align: left; cursor: pointer;
    transition: background-color var(--transition);
}
.cal-tl-day:hover { background: var(--surface-hover); }
.cal-tl-dow { font-size: var(--text-label); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.cal-tl-num { font-size: 17px; font-weight: 800; line-height: 1.1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cal-tl-day .cal-total { margin-top: 3px; }
.cal-tl-row.is-today .cal-tl-dow, .cal-tl-row.is-today .cal-tl-num { color: var(--accent); }
.cal-tl-row.is-sel .cal-tl-day { box-shadow: inset 3px 0 0 var(--accent); }
.cal-tl-line {
    --lanes: 1; position: relative; min-width: 0; cursor: pointer;
    background-image: repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(100% / var(--cal-hours)));
}
.cal-ev {
    position: absolute; z-index: 1; box-sizing: border-box; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 2px 6px;
    background: color-mix(in srgb, var(--c) 15%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); border-left: 3px solid var(--c);
    border-radius: var(--radius-sm); cursor: pointer; -webkit-user-select: none; user-select: none;
    transition: box-shadow var(--transition);
}
.cal-ev:hover, .cal-ev:focus-visible { z-index: 3; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28); }
/* Доріжки ділять висоту рядка, але не товщі за 44px — смуги однакові в усіх днях, група
   доріжок по центру рядка; від трьох накладок — час і ім'я в один рядок */
.cal-ev--tl {
    --lane-h: min(44px, (100% - 8px) / var(--lanes));
    top: calc((100% - var(--lanes) * var(--lane-h)) / 2 + var(--lane, 0) * var(--lane-h) + 2px);
    height: calc(var(--lane-h) - 4px);
}
.cal-tl-line.is-tight .cal-ev--tl { flex-direction: row; align-items: center; justify-content: flex-start; gap: 5px; }
.cal-tl-line.is-tight .cal-ev-time { flex-shrink: 0; }
.cal-ev-time { font-size: 10.5px; font-weight: 700; line-height: 1.2; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.cal-ev-title { font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.cal-tone-muted, .cal-chip.cal-tone-muted { opacity: 0.6; }
.cal-ev.cal-tone-muted .cal-ev-title, .cal-chip.cal-tone-muted .cal-chip-title { text-decoration: line-through; }
.cal-ev.is-draggable, .cal-chip.is-draggable { cursor: grab; }
/* Ручка «⋮⋮» при наведенні — видно, що саме цей запис можна перетягнути */
.cal-ev.is-draggable::after, .cal-chip.is-draggable::after {
    content: ""; position: absolute; top: 50%; right: 4px; width: 6px; height: 10px; margin-top: -5px;
    background: radial-gradient(circle, var(--text-muted) 1px, transparent 1.4px) 0 0 / 3px 3.33px;
    opacity: 0; transition: opacity var(--transition); pointer-events: none;
}
.cal-ev.is-draggable:hover::after, .cal-chip.is-draggable:hover::after { opacity: 1; }
.cal-ev.is-draggable:hover, .cal-chip.is-draggable:hover { padding-right: 14px; }
.cal-chip.is-draggable { position: relative; }
/* Поки тягнемо — ніде на сторінці не виділяється текст (Safari розуміє лише -webkit-) */
html.cal-drag-lock, html.cal-drag-lock * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }
.cal-ev.is-drag-src, .cal-chip.is-drag-src { opacity: 0.4; outline: 1px dashed color-mix(in srgb, var(--c) 70%, transparent); outline-offset: -1px; }
.cal-ev.is-drag-src::after, .cal-chip.is-drag-src::after { opacity: 0; }
.cal-ev.is-ghost {
    z-index: 6; pointer-events: none; transform: scale(1.04);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent);
    transition: left 90ms ease-out, width 90ms ease-out;
}
.cal-ev.is-landed, .cal-chip.is-landed { animation: cal-land 0.5s ease-out; }
@keyframes cal-land {
    from { transform: scale(1.06); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 55%, transparent); }
    to { transform: none; box-shadow: 0 0 0 0 transparent; }
}
.cal-now { position: absolute; top: 0; bottom: 0; z-index: 4; width: 2px; margin-left: -1px; background: var(--danger); pointer-events: none; }
.cal-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cal-slot {
    position: absolute; top: 4px; bottom: 4px; z-index: 0; overflow: hidden; padding: 3px 5px;
    border-radius: var(--radius-sm); pointer-events: none; white-space: nowrap;
    background: var(--accent-dim); color: var(--accent); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Місяць (ПК) */
.cal-mo-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-mo-dows span { padding: 8px 10px; font-size: var(--text-label); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.cal:not(.is-narrow) .cal-month { height: 100%; display: flex; flex-direction: column; }
.cal-mo-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--cal-weeks, 5), minmax(0, 1fr)); }
.cal-mo-cell {
    position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 5px 6px 6px;
    border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer;
    transition: background-color var(--transition);
}
.cal-mo-cell:nth-child(7n) { border-right: none; }
.cal-mo-cell:nth-last-child(-n + 7) { border-bottom: none; }
.cal-mo-cell:hover { background: var(--surface-hover); }
.cal-mo-cell.is-out { background: color-mix(in srgb, var(--bg) 35%, transparent); }
.cal-mo-cell.is-out .cal-mo-num, .cal-mo-cell.is-out .cal-chip, .cal-mo-cell.is-out .cal-total { opacity: 0.5; }
.cal-mo-cell .cal-total { margin-top: auto; padding: 0 2px; }
.cal-mo-cell.is-sel { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.cal-mo-cell.is-drop { background: var(--accent-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.cal-mo-num {
    align-self: flex-start; flex-shrink: 0; min-width: 24px; height: 24px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.cal-mo-cell.is-today .cal-mo-num { background: var(--accent); color: var(--text-on-accent); }
.cal-chip {
    flex-shrink: 0; display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 6px;
    border-radius: 5px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
    font-size: 11px; line-height: 1.35; cursor: pointer; -webkit-user-select: none; user-select: none;
}
.cal-chip:hover { background: color-mix(in srgb, var(--c) 24%, transparent); }
.cal-chip-time { flex-shrink: 0; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cal-chip-title { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.is-ghost {
    position: fixed; z-index: 1000; pointer-events: none; background: var(--surface-raised); transform: rotate(-1.5deg) scale(1.04);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent);
}

/* Місяць компактний: число + кількість записів, під сіткою — список обраного дня */
.cal-mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-mc-dow { padding: 2px 0 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; color: var(--text-muted); }
.cal-mc-day {
    height: 44px; padding-top: 5px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: none; border-radius: 8px; background: none; font-family: var(--font-sans); cursor: pointer; touch-action: manipulation;
}
.cal-mc-day:hover { background: var(--surface-hover); }
.cal-mc-day.is-out { opacity: 0.3; cursor: default; }
.cal-mc-day.is-out:hover { background: none; }
.cal-mc-num { font-size: 13px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cal-mc-day.has .cal-mc-num { font-weight: 700; color: var(--text-primary); }
.cal-mc-day.is-today .cal-mc-num { font-weight: 800; color: var(--accent); }
.cal-mc-day.is-sel { background: var(--accent-dim); }
.cal-mc-count { min-height: 14px; font-size: 10.5px; font-weight: 800; line-height: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Тиждень у вузькому контейнері: стрічка з семи днів із кількістю */
.cal-ws-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-ws-day {
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 8px 0 6px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: none;
    font-family: var(--font-sans); color: var(--text-muted); cursor: pointer; touch-action: manipulation;
}
.cal-ws-dow { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.cal-ws-num { font-size: 15px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cal-ws-count { min-height: 14px; font-size: 10.5px; font-weight: 800; line-height: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }
.cal-ws-day.is-today .cal-ws-dow, .cal-ws-day.is-today .cal-ws-num { color: var(--accent); }
.cal-ws-day.is-sel { background: var(--accent-dim); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* Список дня (під сіткою і в попапі) */
.cal-dl { margin-top: 8px; border-top: 1px solid var(--border); }
.cal-dl-head { padding: 10px 2px 4px; font-size: var(--text-label); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.cal-dl-row {
    display: flex; align-items: flex-start; gap: 10px; margin: 3px 0; padding: 9px 10px;
    border-left: 3px solid var(--c); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c) 9%, transparent);
    color: inherit; text-decoration: none; cursor: pointer; transition: background-color var(--transition);
}
.cal-dl-row:hover { background: color-mix(in srgb, var(--c) 17%, transparent); }
.cal-dl-time { flex-shrink: 0; min-width: 42px; padding-top: 1px; font-size: 12px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cal-dl-time small { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.cal-dl-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cal-dl-title { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dl-meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dl-row.cal-tone-muted .cal-dl-title { text-decoration: line-through; color: var(--text-muted); }
.cal-dl-empty { padding: 12px 2px 4px; font-size: 12px; color: var(--text-muted); }

/* Попап: деталі події / список дня; на телефоні — bottom-sheet */
.cal-pop {
    position: fixed; z-index: 1100; width: 300px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto;
    padding: 16px 16px 14px; background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    opacity: 0; transform: translateY(4px); transition: opacity 0.16s ease, transform 0.16s ease;
}
.cal-pop.is-open { opacity: 1; transform: none; }
.cal-pop.is-sheet {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom));
    transform: translateY(100%);
}
.cal-pop.is-sheet.is-open { transform: none; }
.cal-pop-bd { position: fixed; inset: 0; z-index: 1099; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.16s; }
.cal-pop-bd.is-open { opacity: 1; }
.cal-pop-x {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: none; border-radius: 50%;
    background: none; font-size: 18px; line-height: 1; color: var(--text-muted); cursor: pointer;
}
.cal-pop-x:hover { background: var(--surface-hover); color: var(--text-primary); }
.cal-pop-head { margin: 0 30px 8px 0; font-size: var(--text-label); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.cal-pop-link { margin-left: 8px; padding: 0; border: none; background: none; font: 700 11px var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--accent); cursor: pointer; }
.cal-pop-when { margin-right: 30px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.cal-pop-title { margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.cal-pop-meta { margin-top: 3px; font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
.cal-pop-status { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.cal-pop-status button {
    padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: none;
    font: 700 11px var(--font-sans); color: var(--text-muted); cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}
.cal-pop-status button:hover { color: var(--text-primary); border-color: var(--border-strong); }
.cal-pop-status button.is-on { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
.cal-pop-status button:disabled { opacity: 0.5; cursor: default; }
.cal-pop-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cal-pop-add {
    width: 100%; margin-top: 8px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
    background: none; font: 600 12px var(--font-sans); color: var(--text-muted); cursor: pointer;
}
.cal-pop-add:hover { color: var(--accent); border-color: var(--accent); }
.cal-pop-hint { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }
.cal-toast { align-items: center; }
.cal-toast .cal-undo { flex-shrink: 0; padding: 0; border: none; background: none; font: 700 var(--text-body) var(--font-sans); color: var(--accent); cursor: pointer; }
.cal-toast .toast-close { padding: 0 0 0 4px; border: none; background: none; font-size: 18px; line-height: 1; }

/* === Вкладки сторінки модуля: «Модуль» · «Про модуль» · «Налаштування» (partials/module_tabs.html) ===
   Шаблон вкладок «Бізнесу» (.bs-tabs), але посиланнями — кожна вкладка окрема сторінка (Fiobs 2026-09-25) */
.page-tabs {
    display: flex; gap: 2px; margin: calc(var(--space-2) * -1) 0 var(--space-5);
    border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
    flex-shrink: 0; margin-bottom: -1px; padding: 9px 18px;
    border-bottom: 2px solid transparent;
    font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-decoration: none; white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}
.page-tab:hover { color: var(--text-primary); }
.page-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 768px) { .page-tab { padding: 9px 14px; } }

/* === Гейт тарифу (етап 3 спринту 2026-10-09; логіка — navbar.html, ACCESS) ===
   .page-lock — смужка над вкладками модуля поза тарифом («лише перегляд — керування на тарифі X»);
   body.is-readonly — режим перегляду (Free): кнопки дій пригашені, клік дає підказку; білінг, меню
   і модальні вікна лишаються живими. */
.page-lock {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 0 0 var(--space-4); padding: 9px 14px;
    border-radius: var(--radius-sm);
    background: var(--warning-dim); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
    font-size: var(--text-caption); font-weight: 600; color: var(--text-primary);
}
.page-lock[hidden] { display: none; }
.page-lock a { color: var(--warning); font-weight: 800; white-space: nowrap; text-decoration: none; }
.page-lock a:hover { text-decoration: underline; }
body.is-readonly :is(.btn-primary, .btn-danger, .board-action) { opacity: 0.5; }
body.is-readonly :is(#billing-plans, #billing-checkout, #billing-subscription, #billing-points, .hub-sidebar, .hub-topbar, .hub-drawer, .hub-readonly, .modal-bd) :is(.btn-primary, .btn-danger),
body.is-readonly [data-allow-readonly] { opacity: 1; }

/* ── Смужка «немає підключення до інтернету» (#net-offline, navbar.html; логіка — push.js; S7, KAN-37) ── */
.net-offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: calc(8px + env(safe-area-inset-top)) var(--space-4) 8px;
  background: var(--warning); color: #1A1300;
  font-family: var(--font-sans); font-size: var(--text-caption); font-weight: 600; line-height: 1.35; text-align: center;
}
.net-offline[hidden] { display: none; }
.net-offline svg { flex-shrink: 0; }

/* ── Перемикач-«тумблер» (.notif-switch): налаштування модулів і «Центр сповіщень» (KAN-37) ── */
.notif-switch { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; padding: var(--space-2) 0; }
.notif-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.notif-switch-track { position: relative; flex-shrink: 0; width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--border); transition: background-color var(--transition); }
.notif-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform var(--transition), background-color var(--transition); }
.notif-switch input:checked + .notif-switch-track { background: var(--accent); border-color: var(--accent); }
.notif-switch input:checked + .notif-switch-track::after { transform: translateX(16px); background: #fff; }
.notif-switch input:disabled + .notif-switch-track { opacity: 0.5; }
.notif-switch-text { font-size: var(--text-body); color: var(--text-secondary); }

/* ── «?» з розгорнутим поясненням (.mod-help-btn + .mod-help): налаштування модулів і «Центр сповіщень» ── */
/* «?» біля назви блоку налаштувань — розгортає довге пояснення на місці,
   а не ховає його в тултіп: тут не підказка на два слова, а вибір підходу. */
.mod-help-btn {
    width: 16px; height: 16px; margin-left: 6px; padding: 0; border-radius: 50%;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    font-size: 10px; font-weight: 700; line-height: 1; cursor: pointer; vertical-align: middle;
    transition: color var(--transition), border-color var(--transition);
}
.mod-help-btn:hover, .mod-help-btn.open { color: var(--accent); border-color: rgba(34,211,238,0.35); }
.mod-help {
    margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4);
    background: var(--surface-hover); border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.74rem; color: var(--text-secondary); line-height: 1.55;
}
.mod-help p { margin: 0 0 8px; }
.mod-help p:last-child { margin-bottom: 0; }
.mod-help b { color: var(--text-primary); font-weight: 700; }

/* ── Контакти автора і документи (partials/contacts.html — сторінка «Відгук», Fiobs 2026-10-12) ── */
.contacts-card { margin-top: var(--space-5); padding: 20px 24px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 24px; }
.contacts-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 8px; }
.contacts-lead { margin: 0 0 14px; font-size: 0.85rem; line-height: 1.5; color: var(--text-secondary); }
.contacts-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.contacts-link {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: var(--radius-pill);
    border: 1px solid var(--border); background: var(--surface-hover); color: var(--text-primary);
    font-size: 0.82rem; font-weight: 700; text-decoration: none; transition: border-color var(--transition), color var(--transition);
}
.contacts-link:hover { border-color: var(--border-accent); color: var(--accent); }
.contacts-docs { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.contacts-docs a { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.contacts-docs a:hover { color: var(--accent); }

/* ── Знижка, що чекає наступної оплати: «Тарифи», «Карби» (Fiobs 2026-10-12: «не зрозуміло, чи маю зараз знижку») ── */
.bill-discount {
    display: flex; align-items: flex-start; gap: 10px; margin: var(--space-3) 0 var(--space-4);
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--accent-dim); border: 1px solid var(--border-accent);
    font-size: var(--text-caption); line-height: 1.5; color: var(--text-primary);
}
.bill-discount[hidden] { display: none; }
.bill-discount svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.bill-discount p { margin: 0; }
.bill-discount strong { color: var(--accent); }
.bill-discount-badge {
    align-self: flex-start; margin: 6px 0 2px; padding: 3px 9px; border-radius: var(--radius-pill);
    background: var(--accent-dim); color: var(--accent); font-size: var(--text-label); font-weight: 800; letter-spacing: 0.01em;
}
