
.dashboard-meter {
    --meter-tone: var(--accent);
    display: grid;
    gap: 0.4rem;
}

.dashboard-meter-blue { --meter-tone: oklch(58% 0.18 255); }
.dashboard-meter-green { --meter-tone: oklch(67% 0.18 155); }
.dashboard-meter-amber { --meter-tone: oklch(74% 0.16 82); }
.dashboard-meter-rose { --meter-tone: oklch(63% 0.18 18); }

.dashboard-meter-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
}

.dashboard-meter-track {
    height: 0.8rem;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in oklch, var(--meter-tone) 9%, var(--surface-soft));
}

.dashboard-meter-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        color-mix(in oklch, var(--meter-tone) 88%, white 12%) 0%,
        color-mix(in oklch, var(--meter-tone) 70%, white 30%) 100%
    );
}

.dashboard-funnel {
    display: grid;
    gap: 0.75rem;
}

.dashboard-funnel-step {
    --funnel-tone: var(--accent);
    width: var(--funnel-width, 100%);
    min-width: 9rem;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    color: var(--text);
    background: linear-gradient(
        90deg,
        color-mix(in oklch, var(--funnel-tone) 14%, var(--surface-soft)) 0%,
        color-mix(in oklch, var(--funnel-tone) 6%, var(--surface)) 100%
    );
    border: 1px solid color-mix(in oklch, var(--funnel-tone) 18%, var(--border));
}

.dashboard-funnel-step-cyan { --funnel-tone: oklch(66% 0.15 225); }
.dashboard-funnel-step-violet { --funnel-tone: oklch(60% 0.2 310); }

.map-details {
    margin-top: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in oklch, var(--surface-soft) 72%, transparent);
}

.map-details summary {
    cursor: pointer;
    padding: 0.85rem 0.95rem;
    font-weight: 600;
}

.map-embed-stack {
    display: grid;
    gap: 0.75rem;
    padding: 0 0.95rem 0.95rem;
}

.map-embed-frame {
    width: 100%;
    min-height: 260px;
    border: 0;
    border-radius: 14px;
    background: color-mix(in oklch, var(--surface-soft) 85%, transparent);
}

.paperwork-collections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.paperwork-workflow-trail {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: color-mix(in oklch, var(--surface-soft) 82%, transparent);
}

.paperwork-workflow-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.paperwork-workflow-row .paperwork-workflow-trail {
    flex: 1;
    min-width: 0;
}

.paperwork-workflow-help {
    flex: none;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    background: var(--surface);
    font-size: 0.8rem;
    line-height: 1;
}

.paperwork-workflow-help:hover,
.paperwork-workflow-help:focus-visible {
    color: var(--text);
    border-color: var(--accent);
}

.paperwork-workflow-dialog {
    max-width: min(38rem, calc(100vw - 2rem));
}

.paperwork-workflow-dialog .dialog-card {
    padding: 1.5rem;
}

.paperwork-workflow-definitions {
    display: grid;
    grid-template-columns: minmax(8rem, 0.35fr) 1fr;
    gap: 0.65rem 1rem;
    margin: 0;
}

.paperwork-workflow-definitions dt { font-weight: 700; }
.paperwork-workflow-definitions dd { margin: 0; }

@media (max-width: 38rem) {
    .paperwork-workflow-dialog .dialog-card { padding: 1rem; }
    .paperwork-workflow-definitions { grid-template-columns: 1fr; gap: 0.2rem; }
    .paperwork-workflow-definitions dd { margin-bottom: 0.6rem; }
}

.paperwork-workflow-step {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.35rem;
    padding: 0.45rem 1.65rem 0.45rem 1.35rem;
    color: var(--muted);
    text-decoration: none;
    --workflow-step-bg: var(--surface);
    background: var(--workflow-step-bg);
}

.paperwork-workflow-step:not(:last-child) {
    border-right: 1px solid var(--border);
}

.paperwork-workflow-step:hover,
.paperwork-workflow-step.is-active {
    color: var(--text);
    text-decoration: none;
    --workflow-step-bg: color-mix(in oklch, var(--accent) 12%, var(--surface));
    background: var(--workflow-step-bg);
}

.paperwork-workflow-step strong {
    color: var(--text);
    font-size: 0.85rem;
}

.paperwork-workflow-separator {
    position: absolute;
    top: 50%;
    right: -0.7rem;
    z-index: 3;
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: color-mix(in oklch, var(--muted) 82%, var(--accent));
    background: color-mix(in oklch, var(--surface-soft) 88%, var(--surface));
    transform: translateY(-50%);
    pointer-events: none;
}

.paperwork-workflow-separator svg {
    width: 0.9rem;
    height: 0.9rem;
    stroke-width: 2.4;
}

.paperwork-workflow-separator.is-alternative {
    color: var(--muted);
    background: color-mix(in oklch, var(--surface) 92%, var(--surface-soft));
}

.paperwork-collection-card {
    display: inline-flex;
    align-items: baseline;
    gap: 0.55rem;
    min-height: 2.45rem;
    padding: 0.52rem 0.8rem;
    border: 1px solid color-mix(in oklch, var(--border) 88%, transparent);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    background: color-mix(in oklch, var(--surface-soft) 78%, transparent);
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.paperwork-collection-card.is-active {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
}

.paperwork-collection-card:hover {
    text-decoration: none;
    border-color: color-mix(in oklch, var(--surface-strong) 54%, var(--border));
    background: color-mix(in oklch, var(--surface-strong) 72%, var(--surface-soft));
    transform: translateY(-1px);
}

.paperwork-collection-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.paperwork-collection-count {
    font-size: 0.95rem;
    line-height: 1;
    color: var(--text);
}

.table-subline {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
}

.form-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.form-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-stack {
    display: grid;
    gap: var(--space-lg);
}

.form-shell {
    padding: clamp(1rem, 2.4vw, 1.5rem);
    border: 1px solid color-mix(in oklch, var(--border) 84%, transparent);
    border-radius: var(--radius);
    background: color-mix(in oklch, var(--surface) 86%, transparent);
    box-shadow: 0 10px 28px color-mix(in oklch, var(--shadow-color) 8%, transparent);
}

.form-required-note {
    width: fit-content;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in oklch, var(--surface-strong) 44%, transparent);
}

.form-section {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in oklch, var(--surface-soft) 70%, transparent);
    display: grid;
    align-content: start;
    gap: var(--space-md);
}

.form-section legend {
    padding: 0 0.4rem;
    font-weight: 700;
    color: var(--text);
}

details.form-section summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--text);
}

details.form-section > .section-help {
    margin-top: 0.65rem;
}

.section-summary {
    display: grid;
    gap: 0;
}

.section-summary[open] {
    gap: var(--space-md);
}

.section-summary summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 800;
    color: var(--text);
    list-style: none;
}

.section-summary summary::-webkit-details-marker {
    display: none;
}

.section-summary summary::after {
    content: "";
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 1.2rem;
    background: currentColor;
    opacity: 0.72;
    transform: scale(1);
    transform-origin: center;
    mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%23000%22%3E%3Cpath%20d%3D%22M480-80%20240-320l57-57%20183%20183%20183-183%2057%2057L480-80ZM298-584l-58-56%20240-240%20240%20240-58%2056-182-182-182%20182Z%22/%3E%3C/svg%3E");
    -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%23000%22%3E%3Cpath%20d%3D%22M480-80%20240-320l57-57%20183%20183%20183-183%2057%2057L480-80ZM298-584l-58-56%20240-240%20240%20240-58%2056-182-182-182%20182Z%22/%3E%3C/svg%3E");
}

.section-summary[open] summary::after {
    opacity: 0.92;
    transform: scale(1.08);
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%23000%22%3E%3Cpath%20d%3D%22m356-160-56-56%20180-180%20180%20180-56%2056-124-124-124%20124Zm124-404L300-744l56-56%20124%20124%20124-124%2056%2056-180%20180Z%22/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%23000%22%3E%3Cpath%20d%3D%22m356-160-56-56%20180-180%20180%20180-56%2056-124-124-124%20124Zm124-404L300-744l56-56%20124%20124%20124-124%2056%2056-180%20180Z%22/%3E%3C/svg%3E");
}

.section-summary summary:hover::after,
.section-summary summary:focus-visible::after {
    opacity: 1;
}

.section-summary-body {
    margin-top: 0.75rem;
}

.section-help {
    margin-top: -0.2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-actions.align-start {
    justify-content: flex-start;
}

.field-help-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.field-help-text {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.field-help-text.is-custom {
    color: color-mix(in oklch, var(--text) 82%, var(--accent));
}

.paperwork-service-date-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.paperwork-service-date-warning[hidden] {
    display: none;
}

.paperwork-service-date-warning .icon-inline {
    flex: 0 0 auto;
    margin-top: 0.08rem;
}

.btn-inline-text {
    min-height: 2rem;
    padding: 0.28rem 0.6rem;
    font-size: 0.82rem;
    line-height: 1.2;
}

.danger-zone {
    padding: 0.85rem 0 0 0.9rem;
    border-left: 3px solid color-mix(in oklch, var(--danger) 44%, var(--border));
}

.danger-zone .muted {
    max-width: 44rem;
}

.paperwork-lines-list {
    display: grid;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
    border-top: 1px solid color-mix(in oklch, var(--border) 78%, transparent);
    border-bottom: 1px solid color-mix(in oklch, var(--border) 78%, transparent);
}

.paperwork-lines-scroll-hint {
    display: none;
}

.wide-scroll-hint {
    display: none;
}

.paperwork-lines-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    flex-wrap: wrap;
}

.paperwork-lines-toolbar-block {
    display: grid;
    gap: 0.4rem;
    align-content: start;
    min-width: min(24rem, 100%);
    flex: 1 1 18rem;
}

.paperwork-lines-toolbar-block-compact {
    flex: 0 1 auto;
    min-width: 14rem;
}

.paperwork-lines-toolbar-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.paperwork-lines-toolbar-help {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.paperwork-lines-toolbar [data-paperwork-line-add] {
    width: fit-content;
}

.card .paperwork-lines-editor {
    padding-left: 0 !important;
    border-left: 0 !important;
    background: transparent !important;
}

.paperwork-lines-header,
.paperwork-line-row {
    display: grid;
    grid-template-columns: 2.2rem minmax(6rem, 0.7fr) minmax(14rem, 2fr) minmax(5.5rem, 0.7fr) minmax(5rem, 0.55fr) minmax(6rem, 0.65fr) minmax(4.5rem, 0.5fr) minmax(7rem, 0.75fr) 2.4rem;
    align-items: center;
    gap: 0.45rem;
}

.paperwork-lines-header {
    padding: 0 0.45rem 0.45rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.paperwork-line-row {
    padding: 0.55rem 0.45rem;
    border: 0;
    border-bottom: 1px solid color-mix(in oklch, var(--border) 62%, transparent);
    border-radius: 0;
    background: transparent;
}

.paperwork-line-row:last-child {
    border-bottom: 0;
}

.paperwork-line-row:hover {
    background: color-mix(in oklch, var(--surface-strong) 32%, transparent);
}

.paperwork-line-row label {
    display: block;
}

.paperwork-line-row input {
    min-height: 2.35rem;
    padding: 0.55rem 0.6rem;
}

.paperwork-line-number,
.paperwork-line-total {
    font-weight: 800;
}

.paperwork-line-number {
    color: var(--muted);
    text-align: center;
}

.paperwork-line-total {
    white-space: nowrap;
    font-size: 0.9rem;
}

.paperwork-form-totals {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.8rem 0;
    border-top: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
    border-bottom: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
}

.paperwork-form-totals > div {
    display: grid;
    gap: 0.2rem;
    min-width: min(13rem, 100%);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.paperwork-form-totals span {
    color: var(--muted);
    font-size: 0.82rem;
}

.paperwork-form-total-strong {
    color: var(--accent);
}

.payment-prefill-actions {
    display: flex;
    align-items: center;
    align-self: end;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-height: 2.75rem;
}

.field-full {
    grid-column: 1 / -1;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-actions {
    align-items: stretch;
}

.admin-actions > .btn-link,
.admin-actions > .inline-form,
.admin-actions > .inline-form > button {
    min-height: 2.75rem;
}

.admin-actions > .inline-form {
    display: flex;
}

.admin-actions > .btn-link,
.admin-actions > .inline-form > button {
    justify-content: center;
}

.admin-create-panel > .section-summary-body {
    margin-top: 0;
}

.search-inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-inline-actions input {
    flex: 1 1 auto;
}

.search-inline-actions button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.agenda-toolbar {
    align-items: center;
    gap: 0.75rem;
}

.agenda-toolbar-filters {
    justify-content: flex-end;
}

.agenda-period-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.agenda-period-nav-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 0.25rem;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
}

.agenda-period-nav-label input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
}

.agenda-filter-choice {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
}

.agenda-filter-choice-toggle {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0.08rem;
}

.agenda-filter-choice-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.14rem;
    min-width: 0;
}

.agenda-filter-choice-copy strong {
    display: block;
}

.agenda-filter-choice-copy small {
    display: block;
    min-width: 0;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.agenda-period-nav-side {
    display: flex;
}

.agenda-period-nav-side.is-left {
    justify-content: flex-start;
}

.agenda-period-nav-side.is-right {
    justify-content: flex-end;
}

.inline-form {
    display: inline-flex;
}

.inline-feedback {
    font-size: 0.88rem;
}

.searchable-select-native.is-enhanced {
    display: none;
}

.searchable-select {
    position: relative;
    display: grid;
    gap: 0.35rem;
    transition: filter 160ms ease, opacity 160ms ease;
}

.searchable-select::after {
    content: "";
    position: absolute;
    top: 0.72rem;
    right: 0.72rem;
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid color-mix(in oklch, var(--muted) 35%, transparent);
    border-top-color: var(--accent);
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.searchable-select.is-loading::after {
    opacity: 1;
    animation: searchable-select-spin 0.8s linear infinite;
    transform: scale(1);
}

.searchable-select.is-loading .searchable-select-input {
    background: color-mix(in oklch, var(--surface-strong) 82%, var(--surface));
}

.searchable-select-input {
    width: 100%;
    padding-right: 2.75rem;
}

.searchable-select-clear {
    position: absolute;
    top: 0.58rem;
    right: 0.75rem;
    z-index: 2;
    width: 1.4rem;
    height: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: color-mix(in oklch, var(--surface-strong) 85%, transparent);
    color: var(--muted);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.searchable-select-clear:hover,
.searchable-select-clear:focus-visible {
    background: color-mix(in oklch, var(--surface-strong) 76%, var(--surface));
    color: var(--text);
}

.searchable-select.is-loading .searchable-select-clear {
    right: 2.25rem;
    opacity: 0.72;
}

.field-large-input input[type="email"],
.field-large-input input[type="url"] {
    min-height: 3rem;
    font-size: 1rem;
    padding-block: 0.8rem;
}

.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    gap: 0.2rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    max-height: 18rem;
    overflow: auto;
}

.searchable-select-dropdown[hidden] {
    display: none;
}

.searchable-select-option,
.searchable-select-empty {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
}

.searchable-select-option {
    display: grid;
    gap: 0.18rem;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.is-active {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.searchable-select-option strong {
    font-size: 0.95rem;
}

.searchable-select-option small,
.searchable-select-empty {
    color: var(--muted);
    font-size: 0.8rem;
}

.searchable-select-empty.is-loading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.searchable-select-empty.is-loading::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid color-mix(in oklch, var(--muted) 45%, transparent);
    border-top-color: var(--accent);
    border-radius: 999px;
    animation: searchable-select-spin 0.8s linear infinite;
}

@keyframes searchable-select-spin {
    to {
        transform: rotate(360deg);
    }
}

.inline-feedback.is-error {
    color: var(--danger);
}

.inline-feedback.is-success {
    color: var(--ok);
}

.sirene-results {
    display: grid;
    gap: 0.4rem;
}

.sirene-results[hidden] {
    display: none;
}

.sirene-results-list {
    display: grid;
    gap: 0.4rem;
}

.sirene-result-item {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in oklch, var(--surface-soft) 65%, transparent);
    color: var(--text);
    display: grid;
    gap: 0.15rem;
}

.sirene-result-item strong {
    font-size: 0.9rem;
}

.sirene-result-item small {
    color: var(--muted);
}

.sirene-result-item:hover {
    border-color: color-mix(in oklch, var(--surface-strong) 58%, var(--border));
    background: color-mix(in oklch, var(--surface-strong) 72%, var(--surface-soft));
}

.table-wrap {
    overflow-x: auto;
}

.table-wrap.admin-tenants-table-wrap {
    overflow-x: visible;
}

.admin-tenants-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.78rem;
}

.admin-tenants-table th,
.admin-tenants-table td {
    padding-inline: 0.3rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-tenants-table code {
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-tenant-metrics-heading,
.admin-tenant-storage-heading {
    vertical-align: top;
}

.admin-tenant-metric-sort,
.admin-tenant-storage-sort {
    display: grid;
    gap: 0.12rem 0.35rem;
    margin-top: 0.22rem;
    font-size: 0.64rem;
    font-weight: 500;
}

.admin-tenant-metric-sort {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-tenant-storage-sort {
    grid-template-columns: 1fr;
}

.admin-tenant-metrics,
.admin-tenant-storage {
    display: grid;
    gap: 0.16rem;
    margin: 0;
}

.admin-tenant-metrics > div,
.admin-tenant-storage > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
}

.admin-tenant-metrics dt,
.admin-tenant-storage dt {
    color: var(--muted);
    font-size: 0.67rem;
}

.admin-tenant-metrics dd,
.admin-tenant-storage dd {
    margin: 0;
    font-weight: 750;
    white-space: nowrap;
}

.admin-tenant-billing-state {
    display: grid;
    justify-items: start;
    gap: 0.3rem;
}

.admin-tenant-billing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.admin-tenant-billing-state .status-chip {
    padding: 0.2rem 0.45rem;
    font-size: 0.69rem;
    line-height: 1.1;
    white-space: normal;
}

.admin-tenant-billing-state small {
    font-size: 0.67rem;
    line-height: 1.25;
}

@media (min-width: 821px) {
    .admin-tenants-table th:first-child,
    .admin-tenants-table td:first-child {
        width: 2.25rem;
    }

    .admin-tenants-table th:last-child,
    .admin-tenants-table td:last-child {
        width: 5.25rem;
    }
}

.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.bulk-actions-bar-start,
.bulk-actions-bar-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bulk-actions-bar-end {
    margin-left: auto;
}

.bulk-actions-select-label {
    display: inline-flex;
    align-items: center;
}

.bulk-select-col,
.bulk-select-cell {
    width: 3.2rem;
}

.bulk-select-cell input,
.bulk-select-col input {
    width: 1rem;
    height: 1rem;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding-top: 0.35rem;
}

.pagination-summary {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pagination-link {
    min-height: 2.35rem;
    min-width: 2.35rem;
    padding: 0.45rem 0.75rem;
}

.pagination-link.is-active {
    cursor: default;
}

.pagination-link.is-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    color: var(--muted);
}

.timeline-filters {
    margin-bottom: 0.35rem;
}

.timeline-filters .secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.timeline-filters .secondary.is-active {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
    color: var(--text);
}

.timeline-filters .secondary .badge {
    background: color-mix(in oklch, var(--surface) 78%, transparent);
}

.touchpoint-section-tools {
    align-items: end;
}

.touchpoint-card.is-overdue {
    border-color: color-mix(in oklch, var(--danger) 35%, var(--border));
    background: color-mix(in oklch, var(--danger-soft) 60%, var(--surface));
}

.touchpoint-card.is-upcoming {
    border-color: color-mix(in oklch, oklch(58% 0.11 75) 30%, var(--border));
    background: color-mix(in oklch, oklch(58% 0.07 78) 24%, var(--surface));
}

.touchpoint-card.is-done {
    border-color: color-mix(in oklch, var(--ok) 24%, var(--border));
}

.contact-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.contact-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.contact-crm-strip .info-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.contact-page-header {
    align-items: flex-start;
}

.contact-detail-shell {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

.contact-record-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: var(--space-md);
    padding-bottom: 0.15rem;
}

.contact-record-actions {
    display: flex;
    width: 100%;
    margin-left: auto;
    justify-content: flex-end;
}

.contact-identity-sidebar {
    position: sticky;
    top: calc(var(--space-md) + 0.5rem);
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.contact-sidebar-section {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.contact-sidebar-section:last-child {
    border-bottom: 0;
}

.contact-sidebar-section h2 {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-sidebar-hero {
    gap: 0.55rem;
    background: color-mix(in oklch, var(--surface-soft) 70%, var(--surface));
}

.contact-sidebar-identity {
    display: flex;
    flex-direction: row;
    gap: 0.85rem;
    align-items: flex-start;
    min-width: 0;
}

.contact-sidebar-avatar {
    width: 4.25rem;
    min-width: 4.25rem;
    max-width: 4.25rem;
    height: 4.25rem;
    min-height: 4.25rem;
    max-height: 4.25rem;
    font-size: 1.35rem;
}

.contact-sidebar-identity > .stack {
    min-width: 0;
}

.contact-sidebar-hero h1 {
    margin: 0;
    font-size: clamp(1.45rem, 1.2rem + 0.7vw, 1.5rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.contact-sidebar-entity {
    margin: 0;
    color: var(--text);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.contact-sidebar-chips,
.contact-sidebar-groups {
    gap: 0.4rem;
}

.contact-sidebar-list,
.contact-sidebar-definition-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

.contact-sidebar-line {
    display: grid;
    grid-template-columns: 1.1rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    min-width: 0;
    color: var(--text);
}

.contact-sidebar-line a,
.contact-sidebar-line span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.contact-sidebar-value {
    min-width: 0;
}

.contact-sidebar-value .copy-inline-value {
    min-width: 0;
}

.contact-sidebar-copy {
    opacity: 0.78;
}

.contact-sidebar-line:hover .contact-sidebar-copy,
.contact-sidebar-copy:focus-visible {
    opacity: 1;
}

.contact-sidebar-address {
    line-height: 1.35;
}

.contact-sidebar-address .contact-sidebar-value {
    align-items: flex-start;
    white-space: normal;
}

.contact-sidebar-address .copy-inline-value {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.contact-sidebar-definition-list div {
    display: grid;
    grid-template-columns: minmax(6.5rem, 42%) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
}

.contact-sidebar-definition-list dt {
    color: var(--muted);
    font-size: 0.88rem;
}

.contact-sidebar-definition-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.contact-legal-value {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.contact-legal-link {
    width: fit-content;
    font-weight: 600;
}

.contact-sidebar-actions .btn-link {
    justify-content: flex-start;
    width: 100%;
}

.project-sidebar-document-link {
    display: grid;
    gap: 0.8rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    background: color-mix(in oklch, var(--surface-soft) 58%, transparent);
}

.project-sidebar-document-link:hover,
.project-sidebar-document-link:focus-visible {
    border-color: color-mix(in oklch, var(--accent) 36%, var(--border));
    background: color-mix(in oklch, var(--accent) 7%, var(--surface-soft));
}

.project-sidebar-document-main {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.project-sidebar-document-main > strong {
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--accent-link);
    font-size: 0.98rem;
    line-height: 1.25;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.project-sidebar-document-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.project-sidebar-document-amount {
    display: grid;
    gap: 0.12rem;
    padding-top: 0.65rem;
    border-top: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
}

.project-sidebar-document-amount span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-sidebar-document-amount strong {
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.15;
}

.contact-detail-main {
    display: grid;
    gap: var(--space-lg);
    min-width: 0;
}

.contact-header-actions {
    align-items: center;
    justify-content: flex-end;
}

.contact-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.contact-kpi {
    min-height: 0;
}

.contact-overview-grid .contact-kpi:first-child,
.contact-overview-grid .contact-kpi:nth-child(2),
.contact-overview-grid .contact-kpi:nth-child(3) {
    border-left-color: color-mix(in oklch, var(--accent) 42%, var(--border));
}

.contact-kpi .stat-value-small {
    font-size: 1.4rem;
    line-height: 1.2;
}

.contact-tab-nav {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.paperwork-tabbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.paperwork-tab-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.paperwork-context-groups {
    display: grid;
    gap: var(--space-md);
}

.paperwork-context-group {
    display: grid;
    gap: 0.75rem;
}

.paperwork-context-group h3 {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paperwork-context-grid {
    display: grid;
    gap: var(--space-md);
}

.paperwork-context-grid-relation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.paperwork-live-summary {
    gap: 0.55rem;
}

.paperwork-live-summary h2 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.paperwork-live-summary .section-help {
    font-size: 0.84rem;
}

.paperwork-live-summary-grid {
    display: grid;
    gap: 0.55rem 0.85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paperwork-live-summary .info-tile {
    gap: 0.12rem;
    min-height: 0;
    padding: 0.2rem 0 0.2rem 0.7rem;
    border-left: 3px solid color-mix(in oklch, var(--surface-strong) 72%, var(--border));
}

.paperwork-live-summary .info-label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.paperwork-live-summary .info-value {
    font-size: 0.94rem;
    line-height: 1.25;
}

.paperwork-context-grid-amounts {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.paperwork-detail-page {
    --paperwork-card-radius: 0.65rem;
}

.paperwork-document-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

.paperwork-document-title {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}

.paperwork-document-title h1 {
    margin: 0;
    font-size: 2.55rem;
    overflow-wrap: anywhere;
    line-height: 0.95;
    letter-spacing: 0;
}

.paperwork-back-link {
    width: fit-content;
    font-weight: 650;
    text-decoration: none;
}

.paperwork-document-meta,
.paperwork-document-relation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0;
}

.paperwork-document-meta {
    color: var(--muted);
}

.paperwork-document-meta strong {
    color: var(--text);
}

.paperwork-document-relation {
    color: var(--muted);
    font-weight: 650;
}

.paperwork-document-relation-date {
    flex-basis: 100%;
    text-align: left;
    white-space: normal;
}

.paperwork-document-relation span + span::before {
    content: "·";
    margin-right: 0.55rem;
    color: var(--muted-soft);
}

.paperwork-document-relation .paperwork-document-relation-date::before {
    content: none;
    margin-right: 0;
}

.paperwork-header-actions {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    gap: 0.75rem;
    justify-items: end;
    justify-self: end;
    min-width: 0;
    max-width: 100%;
}

.paperwork-next-actions {
    justify-content: flex-end;
}

.paperwork-overview-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: start;
}

.paperwork-context-card {
    align-self: start;
}

.paperwork-context-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.paperwork-context-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 0.75fr);
    gap: var(--space-md);
}

.paperwork-document-facts {
    display: grid;
    gap: var(--space-md);
}

.paperwork-document-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-md);
}

@media (max-width: 760px) {
    .paperwork-document-dates {
        grid-template-columns: minmax(0, 1fr);
    }
}

.paperwork-project-facts {
    display: grid;
    gap: var(--space-md);
}

.paperwork-project-management-link {
    justify-self: end;
}

.paperwork-context-columns .stack,
.paperwork-document-dates > .stack,
.paperwork-project-facts .stack {
    align-self: start;
    align-content: start;
    justify-items: start;
}

.paperwork-field-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.paperwork-value-source {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
}

.paperwork-value-source-trigger,
.paperwork-value-source-trigger:hover,
.paperwork-value-source-trigger:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    transform: none;
    cursor: help;
}

.paperwork-value-source-trigger:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 2px;
}

.paperwork-value-source-trigger svg {
    width: 0.9rem;
    height: 0.9rem;
}

.paperwork-value-source-tooltip {
    position: absolute;
    z-index: 5;
    top: 100%;
    right: 0;
    width: max-content;
    max-width: 12rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    background: var(--surface-strong);
    color: var(--text);
    visibility: hidden;
    text-transform: none;
    letter-spacing: normal;
}

.paperwork-value-source:hover .paperwork-value-source-tooltip,
.paperwork-value-source:focus-within .paperwork-value-source-tooltip {
    visibility: visible;
}

@media (max-width: 980px) {
    .paperwork-document-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .paperwork-header-actions {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        justify-items: stretch;
    }

    .paperwork-header-actions .inline-actions {
        justify-content: flex-start;
    }
}

.paperwork-finance-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--paperwork-card-radius);
    background: var(--surface);
}

.paperwork-finance-item {
    display: grid;
    gap: 0.35rem;
    align-content: center;
    min-height: 6.1rem;
    padding: 1rem 1.15rem;
    border-right: 1px solid var(--border);
}

.paperwork-finance-item:last-child {
    border-right: 0;
}

.paperwork-finance-item span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.paperwork-finance-item strong {
    font-size: 1.1rem;
}

.paperwork-finance-ttc {
    background: var(--surface-soft);
}

.paperwork-finance-remaining {
    background: var(--surface-soft);
}

.paperwork-finance-ttc strong,
.paperwork-finance-remaining strong {
    color: var(--text);
    font-size: 1.32rem;
}

.paperwork-finance-remaining form {
    margin-top: 0.25rem;
}

.paperwork-terms-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}

.paperwork-terms-grid > div {
    padding-right: var(--space-md);
    border-right: 1px solid var(--border);
}

.paperwork-terms-grid > div:last-child {
    padding-right: 0;
    border-right: 0;
}

.paperwork-document-lines-table th,
.paperwork-document-lines-table td {
    vertical-align: top;
}

.paperwork-document-lines-table {
    table-layout: fixed;
    width: 100%;
}

.paperwork-line-col-designation {
    width: 52%;
}

.paperwork-line-col-quantity {
    width: 9%;
}

.paperwork-line-col-price {
    width: 15%;
}

.paperwork-line-col-vat {
    width: 9%;
}

.paperwork-line-col-total {
    width: 15%;
}

.paperwork-document-lines-table td:first-child {
    display: table-cell;
}

.paperwork-document-lines-table th:not(:first-child),
.paperwork-document-lines-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.paperwork-document-lines-table td:first-child strong,
.paperwork-document-lines-table td:first-child small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.paperwork-document-lines-table td:first-child small {
    margin-top: 0.18rem;
}

.paperwork-document-lines-table tfoot td {
    font-weight: 800;
    border-top: 1px solid var(--border);
}

.paperwork-document-lines-table tfoot td:first-child {
    text-align: right;
    color: var(--text);
}

.paperwork-document-lines-table tfoot td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.paperwork-payment-remaining {
    margin: 0;
    color: var(--muted);
}

.paperwork-payment-remaining strong {
    color: var(--ok);
}

.paperwork-payment-empty {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.paperwork-payment-form-disclosure {
    display: grid;
    gap: var(--space-md);
}

.paperwork-payment-form-disclosure summary {
    width: fit-content;
    cursor: pointer;
    list-style: none;
}

.paperwork-payment-form-disclosure summary::-webkit-details-marker {
    display: none;
}

.paperwork-payment-form-disclosure[open] summary {
    margin-bottom: var(--space-md);
}

.paperwork-payments-table {
    width: 100%;
}

.paperwork-payment-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.paperwork-payment-dialog {
    inline-size: min(30rem, calc(100vw - 2rem));
}

.contact-tab-nav .secondary {
    margin: 0;
}

.contact-tab-edit {
    margin-left: auto;
    flex: 0 0 auto;
}

.contact-tab-nav .secondary.is-active {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
    color: var(--text);
}

.contact-tab-panels > [data-tab-panel][hidden] {
    display: none;
}

.contact-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
}

.contact-next-action-card {
    border-color: color-mix(in oklch, var(--accent) 28%, var(--border));
    background: color-mix(in oklch, var(--accent) 5%, var(--surface));
}

.contact-recent-activity .dashboard-list-item:first-child {
    border-left-color: color-mix(in oklch, var(--accent) 42%, var(--border));
}

.contact-mobile-actions {
    display: none;
}

.compact-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.compact-info-grid .field-full {
    grid-column: 1 / -1;
}

.dot-separator {
    margin-inline: 0.35rem;
    opacity: 0.55;
}

.contact-followup-head {
    align-items: flex-start;
    gap: 1rem;
}

.entity-card-headline {
    font-weight: 600;
    line-height: 1.35;
}

.entity-card-snippet {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.contact-dialog-head {
    align-items: flex-start;
}

.crm-followups-page .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.pipeline-view-switch {
    margin-bottom: var(--space-sm);
}

.pipeline-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(220px, 1fr));
    gap: 0.55rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.pipeline-column {
    min-width: 220px;
    padding: 0.5rem;
    background: color-mix(in oklch, var(--surface-soft) 52%, var(--surface));
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.pipeline-column.is-drop-target {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
    background: color-mix(in srgb, var(--accent) 6%, var(--surface-soft));
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent),
        0 18px 32px -28px color-mix(in srgb, var(--accent) 28%, transparent);
}

.pipeline-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.pipeline-column-head h2 {
    margin-bottom: 0.1rem;
    font-size: 1rem;
    line-height: 1.15;
}

.pipeline-column-head .muted {
    font-size: 0.8rem;
    line-height: 1.2;
}

.pipeline-column-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pipeline-column-drop-hint {
    font-size: 0.82rem;
    margin-top: -0.1rem;
    margin-bottom: 0.1rem;
}

.pipeline-cards {
    display: grid;
    gap: 0.42rem;
}

.pipeline-card {
    position: relative;
    padding: 0.5rem 0.58rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: grab;
    transition: opacity 140ms ease, transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.pipeline-card::before {
    content: "";
    position: absolute;
    top: 0.42rem;
    left: 0.42rem;
    width: 0.44rem;
    height: 0.44rem;
    border-radius: 999px;
    background:
        radial-gradient(circle, currentColor 0 1px, transparent 1.2px) 0 0 / 0.26rem 0.26rem;
    opacity: 0.18;
    pointer-events: none;
}

.pipeline-card:active {
    cursor: grabbing;
}

.pipeline-card.is-dragging {
    opacity: 0.45;
    transform: scale(0.985);
}

.pipeline-card.is-just-moved {
    animation: pipelineCardDropIn 420ms ease;
}

.pipeline-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    padding-left: 0.56rem;
    min-height: 1.8rem;
}

.pipeline-card-identity {
    min-width: 0;
}

.pipeline-card-identity p {
    overflow-wrap: anywhere;
}

.pipeline-card-identity strong {
    font-size: 0.88rem;
    line-height: 1.14;
}

.pipeline-card-identity .muted {
    font-size: 0.75rem;
    line-height: 1.14;
}

.pipeline-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.pipeline-card-select {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
}

.pipeline-card-select:hover,
.pipeline-card-select:focus-within {
    background: color-mix(in oklch, var(--surface-strong) 76%, var(--surface));
}

.pipeline-card-icon-button {
    width: 2rem;
    height: 2rem;
    min-width: 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease;
}

.pipeline-card-icon-button:hover,
.pipeline-card-icon-button:focus-visible {
    color: var(--text);
    border-color: color-mix(in oklch, var(--surface-strong) 56%, var(--border));
    background: color-mix(in oklch, var(--surface-strong) 76%, var(--surface));
    transform: translateY(-1px);
}

.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu summary {
    list-style: none;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.paperwork-download-group {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
}

.paperwork-download-group > form {
    display: flex;
    margin: 0;
}

.paperwork-download-group.has-options > form > button {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.paperwork-download-menu .paperwork-download-toggle {
    height: 100%;
    min-width: 2.6rem;
    padding: 0.72rem 0.65rem;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    letter-spacing: normal;
}

.action-menu-trigger {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.action-menu[open] .action-menu-trigger {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.action-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 20;
    min-width: 12.5rem;
    padding: 0.35rem;
    border-radius: 0.9rem;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 16px 40px color-mix(in oklch, var(--shadow-color) 22%, transparent);
    display: grid;
    gap: 0.2rem;
    justify-items: stretch;
}

.action-menu-dropdown > a,
.action-menu-dropdown > form {
    width: 100%;
}

.action-menu-dropdown form {
    display: block;
    margin: 0;
    width: 100%;
}

.action-menu-form-inline {
    display: inline-flex;
    margin: 0;
}

.action-menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: 1.15rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 0.7rem;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

.action-menu-item-inline {
    width: auto;
    white-space: nowrap;
}

.action-menu-item .icon-inline {
    justify-self: center;
    color: color-mix(in srgb, var(--accent) 78%, var(--text));
}

.action-menu-item > span:last-child {
    min-width: 0;
    text-align: left;
}

.action-menu-item:hover,
.action-menu-item:focus-visible {
    background: color-mix(in oklch, var(--surface-strong) 74%, var(--surface));
    color: var(--text);
    text-decoration: none;
}

.action-menu-item.is-danger,
.action-menu-item.is-danger .icon-inline {
    color: var(--danger);
}

.action-menu-item.is-danger:hover,
.action-menu-item.is-danger:focus-visible {
    background: color-mix(in oklch, var(--danger) 10%, var(--surface));
}

.pipeline-card-detail-modal-content {
    display: grid;
    gap: 0.55rem;
}

.pipeline-card p {
    margin: 0;
}

@keyframes pipelineCardDropIn {
    0% {
        transform: translateY(-6px) scale(0.985);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 32%, transparent);
    }
    100% {
        transform: translateY(0) scale(1);
        box-shadow: none;
    }
}

.pipeline-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pipeline-list-table {
    min-width: 1120px;
}

.pipeline-list-table td,
.pipeline-list-table th {
    vertical-align: top;
}

.pipeline-list-table .actions {
    white-space: nowrap;
}

.pipeline-list-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.pipeline-list-stack {
    display: grid;
    gap: 0.55rem;
    min-width: 12rem;
}

.pipeline-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pipeline-list-metric {
    display: grid;
    gap: 0.15rem;
}

.pipeline-list-metric strong {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pipeline-list-progress-list {
    display: grid;
    gap: 0.6rem;
    min-width: 13rem;
}

.pipeline-list-progress-item {
    display: grid;
    gap: 0.3rem;
}

.pipeline-list-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.86rem;
}

.pipeline-modal {
    inline-size: min(32rem, calc(100vw - 2rem));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.pipeline-modal::backdrop {
    background: rgba(7, 10, 14, 0.42);
}

.pipeline-modal-form {
    padding: 1rem;
    color: var(--text);
}

.pipeline-modal h1,
.pipeline-modal h2,
.pipeline-modal h3,
.pipeline-modal label,
.pipeline-modal legend {
    color: var(--text);
}

.pipeline-modal .muted,
.pipeline-modal .section-help {
    color: var(--muted);
}

.pipeline-secondary-panels {
    margin-top: 0.25rem;
}

.pipeline-panel {
    padding: 0.9rem 1rem;
}

.pipeline-panel > summary {
    list-style: none;
}

.pipeline-panel > summary::-webkit-details-marker {
    display: none;
}

.pipeline-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.pipeline-overview-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in oklch, var(--surface-soft) 54%, var(--surface));
}

.pipeline-overview-card .stat-value {
    margin-top: 0;
}

.pipeline-overview-card .muted {
    font-size: 0.85rem;
}

.pipeline-overview-card .dashboard-mini-progress {
    margin-top: auto;
}

.pipeline-stage-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pipeline-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
}

.pipeline-forecast-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in oklch, var(--surface-soft) 58%, var(--surface));
}

.pipeline-forecast-card p {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 0.6rem;
    margin: 0;
}

.pipeline-forecast-card p > span {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.forecast-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-sm);
}

.forecast-bars-month {
    display: grid;
    gap: 0.7rem;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in oklch, var(--surface-soft) 56%, var(--surface));
}

.forecast-bars-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.forecast-bar-row {
    display: grid;
    gap: 0.35rem;
}

.forecast-bar-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    font-size: 0.92rem;
}

.forecast-bar-meta strong,
.forecast-matrix-head strong {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.forecast-bar-track {
    position: relative;
    overflow: hidden;
    block-size: 0.72rem;
    border-radius: 999px;
    background: color-mix(in oklch, var(--surface-soft) 74%, var(--surface));
}

.forecast-bar-fill {
    display: block;
    block-size: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.forecast-bar-fill.is-potential {
    background: color-mix(in srgb, var(--accent) 72%, white);
}

.forecast-bar-fill.is-quoted {
    background: oklch(0.79 0.12 98);
}

.forecast-bar-fill.is-confirmed {
    background: oklch(0.77 0.13 55);
}

.forecast-bar-fill.is-invoiced {
    background: oklch(0.72 0.14 196);
}

.forecast-bar-fill.is-paid {
    background: oklch(0.69 0.16 148);
}

.forecast-conversion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-sm);
}

.forecast-conversion-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in oklch, var(--surface-soft) 58%, var(--surface));
}

.forecast-conversion-row {
    display: grid;
    gap: 0.3rem;
}

.forecast-conversion-caption {
    margin: 0;
    font-size: 0.88rem;
}

.forecast-matrix-table td,
.forecast-matrix-table th {
    min-width: 190px;
}

.forecast-matrix-cell {
    display: grid;
    gap: 0.45rem;
}

.forecast-matrix-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.forecast-matrix-bar {
    display: grid;
    grid-template-columns: auto minmax(72px, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
}

.forecast-matrix-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.forecast-matrix-value {
    font-size: 0.82rem;
    font-weight: 700;
}

.forecast-numeric-table th:not(:first-child),
.forecast-numeric-table td:not(:first-child) {
    text-align: right;
}

.forecast-numeric-table td:not(:first-child) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.crm-followups-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-md);
}

.crm-filters-card {
    display: grid;
    gap: 0.85rem;
}

.crm-filters-primary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(11rem, 0.7fr));
    gap: var(--space-md);
    align-items: end;
}

.crm-filters-primary-single {
    grid-template-columns: minmax(0, 1fr);
}

.crm-filters-advanced {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in oklch, var(--surface-soft) 66%, var(--surface));
    padding: 0.75rem 0.9rem;
}

.crm-filters-advanced summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
}

.crm-filters-advanced summary::-webkit-details-marker {
    display: none;
}

.crm-filters-advanced-body {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--space-md);
    margin-top: 0.85rem;
}

.crm-filters-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.crm-followups-search {
    min-width: min(100%, 24rem);
    flex: 1 1 20rem;
}

.crm-followups-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.pipeline-bulk-form {
    padding: 0;
}

.pipeline-bulk-title,
.pipeline-bulk-subtitle {
    margin: 0;
}

.pipeline-bulk-title {
    font-size: 1rem;
}

.pipeline-bulk-subtitle {
    font-size: 0.95rem;
}

.pipeline-bulk-panel {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid color-mix(in oklch, var(--border) 78%, transparent);
}

.pipeline-bulk-opportunity-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pipeline-bulk-opportunity-fields label {
    display: grid;
    gap: 0.35rem;
}

.pipeline-bulk-opportunity-fields input {
    min-width: 0;
}

.pipeline-bulk-opportunity-fields button {
    justify-self: start;
}

.pipeline-funnel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-sm);
}

.pipeline-funnel-step {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in oklch, var(--surface-soft) 60%, var(--surface));
}

.pipeline-funnel-step span {
    font-size: 1.05rem;
    font-weight: 700;
}

.pipeline-funnel-bars {
    display: grid;
    gap: 0.7rem;
}

.pipeline-funnel-bar-row {
    display: grid;
    gap: 0.35rem;
}

.pipeline-funnel-bar-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    font-size: 0.94rem;
}

.pipeline-funnel-bar-track {
    position: relative;
    overflow: hidden;
    block-size: 0.8rem;
    border-radius: 999px;
    background: color-mix(in oklch, var(--surface-soft) 74%, var(--surface));
}

.pipeline-funnel-bar-fill {
    display: block;
    block-size: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.pipeline-funnel-bar-fill.is-quoted {
    background: oklch(0.79 0.12 98);
}

.pipeline-funnel-bar-fill.is-confirmed {
    background: oklch(0.77 0.13 55);
}

.pipeline-funnel-bar-fill.is-invoiced {
    background: oklch(0.72 0.14 196);
}

.pipeline-funnel-bar-fill.is-paid {
    background: oklch(0.69 0.16 148);
}

.crm-followups-touchpoint-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
}

.crm-followups-check {
    display: flex;
    align-items: center;
    padding-top: 0.15rem;
}

.crm-followups-check input {
    inline-size: 1rem;
    block-size: 1rem;
}

.followups-subsection {
    padding: 0.9rem 0 0 0;
    border-top: 1px solid var(--border);
}

.followups-subsection:first-child {
    padding-top: 0;
    border-top: 0;
}

.is-col-hidden {
    display: none !important;
}

.agenda-year-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.agenda-year-month {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem;
    background: color-mix(in oklch, var(--surface-soft) 55%, var(--surface));
    display: grid;
    gap: 0.45rem;
}

.agenda-year-month-head a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.agenda-year-month-head a:hover {
    color: var(--accent);
}

.agenda-year-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.agenda-year-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
}

.agenda-year-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.agenda-year-day {
    min-height: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    display: grid;
    place-items: center;
    gap: 0.1rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.agenda-year-day em {
    font-style: normal;
    font-size: 0.68rem;
    color: var(--accent);
    font-weight: 700;
}

.agenda-year-day.is-outside {
    color: color-mix(in oklch, var(--muted) 70%, transparent);
    background: color-mix(in oklch, var(--surface-soft) 78%, transparent);
}

.agenda-year-day.is-outside em {
    color: color-mix(in oklch, var(--muted) 66%, transparent);
}

.agenda-year-day.is-today {
    border-color: color-mix(in oklch, var(--accent) 72%, var(--border));
    background: color-mix(in oklch, var(--accent) 14%, var(--surface));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent);
}

.agenda-month-view {
    display: grid;
    gap: 0.35rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.agenda-filter-summary {
    padding: 0.25rem 0;
}

.agenda-filter-form {
    gap: 0.9rem;
}

.agenda-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.55rem;
}

.agenda-filter-choice {
    padding: 0.75rem;
    border: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
    border-radius: 0.85rem;
    background: color-mix(in oklch, var(--surface-soft) 54%, transparent);
}

.agenda-filter-choice:hover {
    border-color: color-mix(in oklch, var(--accent) 28%, var(--border));
    background: color-mix(in oklch, var(--accent) 5%, var(--surface-soft));
}

.agenda-filter-choice input {
    margin: 0;
    flex: 0 0 auto;
}

.agenda-filter-choice span {
    display: grid;
    gap: 0.22rem;
    min-width: 0;
}

.agenda-filter-choice strong {
    line-height: 1.15;
}

.agenda-filter-choice small {
    font-size: 0.76rem;
    line-height: 1.22;
}

.agenda-month-weekdays {
    display: grid;
    grid-template-columns: 3rem repeat(7, minmax(0, 1fr));
    gap: 0;
    min-width: 860px;
}

.agenda-month-weekdays span {
    padding: 0.5rem 0.6rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklch, var(--surface-soft) 70%, transparent);
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
}

.agenda-month-grid {
    display: grid;
    grid-template-columns: 3rem repeat(7, minmax(0, 1fr));
    min-width: 860px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.agenda-month-weekday-spacer,
.agenda-month-week-number {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.agenda-month-week-number {
    min-height: 150px;
    border-top: 1px solid var(--border);
    background: color-mix(in oklch, var(--surface-soft) 52%, transparent);
}

.agenda-month-week-number a,
.agenda-month-week-number span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.agenda-month-week-number a:hover,
.agenda-month-week-number a:focus-visible {
    text-decoration: underline;
}

.agenda-month-day {
    min-height: 150px;
    display: grid;
    grid-template-rows: auto 1fr;
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.agenda-month-day.is-outside {
    background: color-mix(in oklch, var(--surface-soft) 88%, transparent);
    color: color-mix(in oklch, var(--muted) 78%, transparent);
}

.agenda-month-day.is-outside .agenda-day-number {
    color: color-mix(in oklch, var(--muted) 84%, transparent);
}

.agenda-month-day.is-today,
.agenda-week-day.is-today {
    border-color: color-mix(in oklch, var(--accent) 76%, var(--border));
    background:
        linear-gradient(180deg, color-mix(in oklch, var(--accent) 13%, var(--surface)) 0%, var(--surface) 86%);
    box-shadow: inset 0 0 0 2px color-mix(in oklch, var(--accent) 38%, transparent);
}

.agenda-month-day.is-today .agenda-day-number {
    background: var(--accent);
    color: var(--accent-contrast);
}

.agenda-day-head {
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: space-between;
}

.agenda-day-number {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.agenda-day-head-actions,
.agenda-week-head-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.agenda-day-add-button,
.agenda-row-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    min-height: 1.7rem;
    padding: 0;
}

.agenda-month-day.is-today .agenda-day-add-button,
.agenda-week-day.is-today .agenda-day-add-button {
    color: var(--accent);
    border-color: color-mix(in oklch, var(--accent) 46%, var(--border));
    background: color-mix(in oklch, var(--surface) 88%, white);
    box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 12%, transparent);
}

.agenda-month-day.is-today .agenda-day-add-button:hover,
.agenda-week-day.is-today .agenda-day-add-button:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

.agenda-day-events {
    padding: 0 0.35rem 0.45rem;
    display: grid;
    gap: 0.28rem;
    align-content: start;
}

.agenda-day-count-button {
    display: none;
    min-height: 2rem;
    padding: 0 0.8rem;
    border-radius: 999px;
    font-size: 0.9rem;
    line-height: 1;
}

.agenda-event-chip {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem;
    align-items: baseline;
    border-radius: 8px;
    padding: 0.28rem 0.4rem;
    background: color-mix(in srgb, var(--accent) 7%, var(--surface-soft));
    color: var(--text);
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
    font-size: 0.8rem;
}

.agenda-event-chip:hover {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
}

.agenda-event-chip strong {
    font-size: 0.72rem;
    color: var(--muted);
}

.agenda-event-chip small {
    grid-column: 1 / -1;
    font-size: 0.67rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.agenda-event-chip.is-site {
    background: color-mix(in srgb, var(--accent) 7%, var(--surface-soft));
    border-color: color-mix(in srgb, var(--accent) 10%, var(--border));
}

.agenda-event-chip.is-ical {
    background: color-mix(in oklch, oklch(54% 0.07 245) 60%, var(--surface-soft));
    border-color: color-mix(in oklch, oklch(68% 0.07 245) 18%, var(--border));
}

.agenda-event-chip.is-paperwork {
    background: color-mix(in oklch, oklch(56% 0.08 132) 60%, var(--surface-soft));
    border-color: color-mix(in oklch, oklch(70% 0.09 135) 18%, var(--border));
}

.agenda-event-chip.is-project {
    background: color-mix(in oklch, oklch(62% 0.12 72) 62%, var(--surface-soft));
    border-color: color-mix(in oklch, oklch(72% 0.13 78) 20%, var(--border));
}

.agenda-event-chip.is-agenda-estimates-expired {
    background: #FDBABA;
    border-color: color-mix(in oklch, #FDBABA 76%, var(--border));
    color: oklch(24% 0.045 24);
}

.agenda-event-chip.is-agenda-projects-waiting {
    background: #FEFDBA;
    border-color: color-mix(in oklch, #FEFDBA 76%, var(--border));
    color: oklch(25% 0.045 94);
}

.agenda-event-chip.is-agenda-projects-in-progress {
    background: #DAB0F0;
    border-color: color-mix(in oklch, #DAB0F0 76%, var(--border));
    color: oklch(25% 0.055 308);
}

.agenda-event-chip.is-agenda-projects-cancelled {
    background: #FDBABA;
    border-color: color-mix(in oklch, #FDBABA 76%, var(--border));
    color: oklch(24% 0.045 24);
}

.agenda-event-chip.is-agenda-estimates {
    background: #FEFDBA;
    border-color: color-mix(in oklch, #FEFDBA 76%, var(--border));
    color: oklch(25% 0.045 94);
}

.agenda-event-chip.is-agenda-estimates-expired strong,
.agenda-event-chip.is-agenda-estimates-expired small,
.agenda-event-chip.is-agenda-projects-waiting strong,
.agenda-event-chip.is-agenda-projects-waiting small,
.agenda-event-chip.is-agenda-projects-in-progress strong,
.agenda-event-chip.is-agenda-projects-in-progress small,
.agenda-event-chip.is-agenda-projects-cancelled strong,
.agenda-event-chip.is-agenda-projects-cancelled small,
.agenda-event-chip.is-agenda-estimates strong,
.agenda-event-chip.is-agenda-estimates small {
    color: color-mix(in oklch, currentColor 76%, transparent);
}

.agenda-project-paid-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.06rem 0.38rem;
    font-size: 0.62rem;
    line-height: 1;
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: color-mix(in srgb, var(--accent) 11%, var(--surface));
    color: color-mix(in oklch, var(--text) 86%, var(--accent));
    vertical-align: middle;
}

.agenda-event-chip.is-touchpoint {
    background: color-mix(in oklch, oklch(62% 0.15 26) 45%, var(--surface-soft));
    border-color: color-mix(in oklch, oklch(68% 0.15 26) 20%, var(--border));
}

.agenda-event-chip.detailed {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.45rem 0.5rem;
}

.agenda-event-chip.detailed small {
    color: var(--muted);
}

.agenda-more {
    margin: 0;
    padding: 0.2rem 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.agenda-day-dialog {
    width: min(34rem, calc(100vw - 2rem));
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
}

.agenda-day-dialog::backdrop {
    background: color-mix(in oklch, oklch(0% 0 0) 46%, transparent);
}

.dialog-card {
    min-width: 0;
}

.agenda-week-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.agenda-week-view {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.6rem;
    min-width: 1020px;
}

.agenda-week-day {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 0.55rem;
    display: grid;
    gap: 0.5rem;
    align-content: start;
}

.agenda-week-day.is-today {
    border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.agenda-week-day.is-outside {
    color: color-mix(in oklch, var(--muted) 78%, transparent);
    background: color-mix(in oklch, var(--surface-soft) 84%, transparent);
}

.agenda-week-day.is-outside .muted {
    color: color-mix(in oklch, var(--muted) 66%, transparent);
}

    .agenda-week-head h2 {
        margin: 0;
        font-size: 0.95rem;
        min-width: 0;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

.agenda-week-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.agenda-date-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.agenda-week-events {
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

table {
    width: 100%;
    border-collapse: collapse;
}

tbody tr {
    transition: background-color 140ms ease;
}

tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

th,
td {
    text-align: left;
    padding: 0.65rem 0.4rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.actions {
    white-space: nowrap;
    text-align: right;
}

.numeric-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}


td.actions,
th.actions {
    text-align: right;
}

td.actions > *:first-child,
th.actions > *:first-child {
    margin-left: 0;
}

td.actions form {
    margin-left: auto;
}

.copy-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.copy-inline-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-inline-button {
    width: 1.8rem;
    height: 1.8rem;
    min-width: 1.8rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    white-space: nowrap;
    flex: 0 0 1.8rem;
}

.copy-inline-button svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    background: color-mix(in oklch, var(--surface-soft) 78%, var(--surface));
}

.search-result-summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.avatar-col,
.avatar-cell {
    width: 3.2rem;
}

.contact-avatar {
    --avatar-hue: 220deg;
    flex: 0 0 2rem;
    width: 2rem;
    min-width: 2rem;
    max-width: 2rem;
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: oklch(80% 0.11 var(--avatar-hue));
    color: oklch(30% 0.05 var(--avatar-hue));
    border: 1px solid color-mix(in oklch, oklch(56% 0.13 var(--avatar-hue)) 40%, var(--border));
}

.contact-summary-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
}

.contact-summary-link:hover strong {
    text-decoration: underline;
}

.contact-summary-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
}

.contact-summary-text strong,
.contact-summary-text small {
    display: block;
    line-height: 1.15;
}

.contact-summary-text small {
    color: var(--muted);
}

.paperwork-next-references {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.paperwork-next-reference-item {
    display: grid;
    gap: 0.15rem;
}

.paperwork-next-reference-item span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.paperwork-next-reference-item strong {
    font-size: 1rem;
}

.contacts-list-tools {
    margin-bottom: 0.8rem;
}

.contacts-columns-panel {
    margin-bottom: 0.8rem;
    padding: 0.75rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: color-mix(in oklch, var(--surface-soft) 72%, transparent);
    display: grid;
    gap: 0.55rem;
}

.contacts-columns-panel[hidden] {
    display: none;
}

.contacts-columns-grid {
    display: grid;
    gap: 0.45rem 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.contact-group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.contact-group-tags-preview {
    position: relative;
    z-index: 1;
}

.contact-group-tag {
    --group-hue: 220deg;
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    border: 1px solid color-mix(in oklch, oklch(54% 0.12 var(--group-hue)) 35%, var(--border));
    background: oklch(87% 0.09 var(--group-hue));
    color: oklch(34% 0.06 var(--group-hue));
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.contact-group-tags-preview .contact-group-tag-hidden {
    display: none;
}

.contact-group-tags-preview:has(.contact-group-tag-more:is(:hover, :focus, :focus-visible)) .contact-group-tag-hidden,
.contact-group-tags-preview:has(.contact-group-tag-hidden:is(:hover, :focus, :focus-visible)) .contact-group-tag-hidden,
.contact-group-tags-preview:focus-within .contact-group-tag-hidden {
    display: inline-flex;
}

@supports not selector(:has(*)) {
    .contact-group-tags-preview:hover .contact-group-tag-hidden,
    .contact-group-tags-preview:focus-within .contact-group-tag-hidden {
        display: inline-flex;
    }
}

.contact-group-tag-more {
    --group-hue: 220deg;
    position: relative;
    z-index: 2;
    color: var(--muted);
    cursor: default;
    background: color-mix(in oklch, var(--surface-soft) 72%, var(--surface));
}

a.contact-group-tag:hover,
a.contact-group-tag:focus-visible {
    color: oklch(28% 0.08 var(--group-hue));
    border-color: color-mix(in oklch, oklch(48% 0.14 var(--group-hue)) 58%, var(--border));
    background: oklch(82% 0.11 var(--group-hue));
    text-decoration: none;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

.choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
}

.choice-line {
    display: flex;
    align-items: start;
    gap: 1rem;
    flex-wrap: wrap;
}

.choice-field {
    display: grid;
    align-self: start;
    align-content: start;
    justify-content: start;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--text);
}

.choice-field legend {
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.choice-field-stacked .choice-line {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    justify-content: start;
    gap: 0.5rem;
}

.choice-field-stacked .choice-control {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    width: 100%;
}

.choice-control,
.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

label.choice-control,
label.checkbox-line {
    cursor: pointer;
}

input[type='checkbox'],
input[type='radio'] {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    background: color-mix(in oklch, var(--surface-strong) 42%, var(--surface));
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input[type='color'][name='theme_accent_hex'] {
    min-height: 2em;
    height: 2.25em;
    padding: 3px;
}

input[type='radio'] {
    border-radius: 999px;
    position: relative;
}

input[type='checkbox'] {
    border-radius: 0.24rem;
    position: relative;
}

input[type='checkbox']:checked,
input[type='radio']:checked {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    background: color-mix(in srgb, var(--accent) 28%, var(--surface));
    box-shadow: none;
}

input[type='radio']::after {
    content: "";
    position: absolute;
    inset: 0.32rem;
    border-radius: inherit;
    background: transparent;
    transform: scale(0.4);
    opacity: 0;
    transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease;
}

input[type='radio']:checked::after {
    background: var(--text);
    opacity: 1;
    transform: scale(1);
}

input[type='checkbox']::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 0.34rem;
    height: 0.72rem;
    margin: auto;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg) translate(-0.02rem, -0.04rem);
    opacity: 0;
    transition: opacity 120ms ease, border-color 120ms ease;
}

input[type='checkbox']:checked::after {
    border-color: var(--text);
    opacity: 1;
}

input[type='checkbox']:focus-visible,
input[type='radio']:focus-visible {
    outline: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    outline-offset: 1px;
}

.choice-control span,
.checkbox-line span {
    line-height: 1.2;
}

.groups-checklist {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.entity-list {
    display: grid;
    gap: var(--space-md);
}

.entity-card {
    display: grid;
    gap: var(--space-md);
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in oklch, var(--surface-soft) 65%, transparent);
}

.entity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.entity-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.info-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.info-tile {
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in oklch, var(--surface-soft) 70%, transparent);
}

.info-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.info-value {
    font-weight: 600;
}

.info-inline-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.info-inline-meta .status-chip {
    font-size: 0.78rem;
    padding: 0.18rem 0.5rem;
}

.card .entity-card,
.card .info-tile {
    border-radius: 0;
    border: 0;
    border-left: 3px solid color-mix(in oklch, var(--surface-strong) 72%, var(--border));
    background: transparent;
    padding: 0.35rem 0 0.35rem 0.85rem;
}

.agenda-legend {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.agenda-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.agenda-legend-items .agenda-event-chip {
    display: inline-block;
}

a.agenda-event-chip {
    cursor: pointer;
}

a.agenda-event-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.agenda-sharing-dialog {
    width: min(640px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
}

.agenda-sharing-dialog::backdrop {
    background: rgb(0 0 0 / 45%);
}

.agenda-sharing-link {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.agenda-sharing-link input {
    flex: 1 1 16rem;
    min-width: 0;
}

.agenda-sharing-dialog fieldset {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}

.agenda-sharing-dialog [hidden] {
    display: none;
}

.agenda-sharing-dialog .dialog-card {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.agenda-sharing-dialog .dialog-card > header {
    position: sticky;
    top: -1px;
    z-index: 1;
    background: var(--surface);
    padding-block: 0.4rem;
}

.agenda-sharing-dialog .choice-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.6rem;
}

.agenda-sharing-dialog .choice-line input {
    flex-shrink: 0;
}

.paperwork-form-page [data-paperwork-date-types][hidden] {
    display: none;
}
