/* HomeTrees CRM � Design system (from UIUX.md tokens) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --background: 0 0% 100%;
    --foreground: 220 20% 10%;
    --card: 0 0% 100%;
    --card-foreground: 220 20% 10%;
    --primary: 220 20% 10%;
    --primary-foreground: 0 0% 100%;
    --muted: 220 14% 96%;
    --muted-foreground: 220 10% 50%;
    --border: 220 14% 90%;
    --destructive: 0 84% 60%;
    --payix-purple: 260 70% 60%;
    --payix-purple-light: 260 60% 96%;
    --payix-green: 145 60% 50%;
    --payix-orange: 25 90% 55%;
    --radius: 0.75rem;
    --sidebar-width: 16rem;
    --right-panel-width: 20rem;
    --topbar-height: 4rem;
    --crm-contact-btn-height: 2.5rem;
    --crm-contact-btn-height-mobile: 2.25rem;
}

.crm-dashboard-toggle {
    display: inline-flex;
    gap: 0.5rem;
}

.crm-dashboard-toggle .crm-btn.is-active {
    outline: 2px solid hsl(var(--payix-purple) / 0.35);
    outline-offset: 1px;
}

.crm-dashboard-activity__stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    background: hsl(var(--muted) / 0.25);
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
}

@media (min-width: 640px) {
    .crm-dashboard-activity__stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.crm-dashboard-activity__value {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.crm-dashboard-activity__chart {
    height: 16rem;
    margin-top: 1rem;
}

.crm-dashboard-activity__chart svg {
    width: 100%;
    height: 100%;
}

*, *::before, *::after { box-sizing: border-box; }

.crm-app {
    min-height: 100vh;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Shell offsets */
.crm-main-wrap {
    min-height: 100vh;
    transition: padding 0.3s ease;
}

@media (min-width: 1024px) {
    .crm-main-wrap {
        padding-left: var(--sidebar-width);
    }

    .crm-main-wrap--dashboard {
        padding-right: 0;
    }
}

@media (min-width: 1280px) {
    .crm-main-wrap--dashboard {
        padding-right: var(--right-panel-width);
    }
}

/* Mobile overlay */
.crm-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    z-index: 50;
}

.crm-sidebar-overlay.is-open {
    display: block;
}

@media (min-width: 1024px) {
    .crm-sidebar-overlay { display: none !important; }
}

/* Sidebar wrapper */
.crm-sidebar-wrap {
    position: fixed;
    inset-block: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.crm-sidebar-wrap.is-open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .crm-sidebar-wrap {
        transform: translateX(0);
        z-index: 40;
    }
}

.crm-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    background: hsl(var(--muted) / 0.3);
    border-right: 1px solid hsl(var(--border));
}

.crm-sidebar__logo {
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.crm-sidebar__brand-mark {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 0.55rem;
    border: 1px solid hsl(var(--border));
    background: #fff;
    box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
}

.crm-sidebar__logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: hsl(var(--payix-purple));
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-sidebar__badge-wrap {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-sidebar__badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    background: hsl(var(--payix-purple) / 0.1);
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(var(--payix-purple));
}

.crm-sidebar__nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.crm-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.crm-nav-link:hover {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--foreground));
}

.crm-nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple));
}

.crm-nav-link.is-active {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    font-weight: 600;
}

.crm-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.crm-nav-group__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.crm-nav-group__toggle:hover {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--foreground));
}

.crm-nav-group__toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple));
}

.crm-nav-group.is-active > .crm-nav-group__toggle,
.crm-nav-group.is-open > .crm-nav-group__toggle {
    color: hsl(var(--foreground));
    font-weight: 600;
}

.crm-nav-group.is-active > .crm-nav-group__toggle {
    background: hsl(var(--muted));
}

.crm-nav-group__label {
    flex: 1;
}

.crm-nav-group__chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.crm-nav-group.is-open .crm-nav-group__chevron {
    transform: rotate(180deg);
}

.crm-nav-group__children {
    display: none;
    flex-direction: column;
    gap: 0.125rem;
    padding-left: 0.5rem;
    margin-left: 0.75rem;
    border-left: 1px solid hsl(var(--border));
}

.crm-nav-group.is-open > .crm-nav-group__children {
    display: flex;
}

.crm-nav-link--child {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
}

.crm-nav-link__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Inline SVG icons (badges, buttons, timeline markers) */
.crm-icon-inline {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: -0.125em;
}

.crm-icon-inline--lg {
    width: 1.5rem;
    height: 1.5rem;
}

.crm-icon-inline--warning {
    color: rgb(185 28 28);
}

.crm-icon-inline--muted {
    color: hsl(var(--muted-foreground));
}

.crm-lead-badge .crm-icon-inline,
.crm-followup-state .crm-icon-inline,
.crm-visit-state .crm-icon-inline {
    margin-right: 0.25rem;
}

.crm-lead-type-option__icon .crm-icon-inline--lg {
    display: block;
    margin: 0 auto 0.5rem;
}

.crm-dashboard-task__icon .crm-icon-inline,
.crm-timeline-item__marker .crm-icon-inline,
.crm-followup-card__type-icon .crm-icon-inline,
.crm-visit-card__type-icon .crm-icon-inline {
    width: 1.125rem;
    height: 1.125rem;
}

.crm-btn .crm-icon-inline {
    margin-right: 0.25rem;
}

/* Mobile menu button */
.crm-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(4px);
    cursor: pointer;
    color: hsl(var(--foreground));
}

.crm-menu-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--payix-purple));
}

@media (min-width: 1024px) {
    .crm-menu-btn { display: none; }
}

/* Top bar — UIUX.md §6.2 */
.crm-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--border));
    box-shadow: 0 1px 0 hsl(var(--border) / 0.6), 0 4px 16px hsl(220 20% 10% / 0.04);
}

.crm-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

@media (max-width: 1023px) {
    .crm-topbar__inner {
        padding-left: 3.5rem;
    }
}

@media (min-width: 1024px) {
    .crm-topbar__inner { padding: 1rem 2rem; }
}

.crm-topbar__date {
    display: none;
    font-size: 0.875rem;
    font-weight: 300;
    color: hsl(var(--muted-foreground));
    letter-spacing: 0.01em;
}

@media (min-width: 768px) {
    .crm-topbar__date { display: block; }
}

.crm-topbar__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    position: relative;
}

.crm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: hsl(var(--payix-purple) / 0.1);
    color: hsl(var(--payix-purple));
    font-size: 0.875rem;
    font-weight: 500;
    flex-shrink: 0;
}

.crm-topbar__name {
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .crm-topbar__name { display: block; }
}

.crm-topbar__user-menu {
    position: relative;
}

.crm-topbar__user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.crm-topbar__user-trigger:hover {
    background: hsl(var(--muted) / 0.7);
}

.crm-topbar__user-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple) / 0.45);
}

.crm-topbar__chevron {
    width: 1rem;
    height: 1rem;
    color: hsl(var(--muted-foreground));
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.crm-topbar__user-trigger[aria-expanded="true"] .crm-topbar__chevron {
    transform: rotate(180deg);
}

.crm-topbar__user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 55;
    width: 12rem;
    padding: 0.25rem 0;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    background: hsl(var(--card));
    box-shadow: 0 10px 30px hsl(220 20% 10% / 0.1), 0 2px 8px hsl(220 20% 10% / 0.06);
}

.crm-topbar__user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem 0.875rem 0.625rem;
}

.crm-topbar__user-meta-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
}

.crm-topbar__user-divider {
    height: 1px;
    margin: 0.125rem 0;
    background: hsl(var(--border));
}

.crm-topbar__user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    background: transparent;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.crm-topbar__user-item:hover {
    background: hsl(var(--muted) / 0.5);
}

.crm-topbar__user-item:focus-visible {
    outline: none;
    background: hsl(var(--muted) / 0.5);
    box-shadow: inset 0 0 0 2px hsl(var(--payix-purple) / 0.35);
}

.crm-topbar__user-item-icon {
    width: 1rem;
    height: 1rem;
    color: hsl(var(--muted-foreground));
}

.crm-city-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    background: hsl(var(--payix-purple) / 0.1);
    color: hsl(var(--payix-purple));
    font-size: 0.75rem;
    font-weight: 600;
}

.crm-city-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    flex-shrink: 0;
}

.crm-city-switcher__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}

.crm-city-switcher__icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: hsl(var(--payix-purple));
}

.crm-city-switcher__select {
    min-width: 9.5rem;
    height: 2.25rem;
    padding: 0 2rem 0 0.75rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card))
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
        no-repeat right 0.65rem center;
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-city-switcher__select:hover,
.crm-city-switcher__select:focus {
    border-color: hsl(var(--payix-purple) / 0.55);
    box-shadow: 0 0 0 2px hsl(var(--payix-purple) / 0.1);
    outline: none;
}

.crm-city-switcher--page {
    padding: 0.375rem 0.625rem 0.375rem 0.75rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
}

.crm-page-header-row__actions .crm-city-switcher--page {
    margin-right: 0.125rem;
}

/* Main content */
.crm-main {
    padding: 1rem;
}

@media (min-width: 640px) {
    .crm-main { padding: 1.5rem; }
}

@media (min-width: 1024px) {
    .crm-main { padding: 2rem; }
}

.crm-main--dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .crm-main--dashboard { gap: 2rem; }
}

/* Right panel */
.crm-right-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 30;
    width: var(--right-panel-width);
    height: 100vh;
    overflow-y: auto;
    background: hsl(var(--muted) / 0.2);
    border-left: 1px solid hsl(var(--border));
}

@media (min-width: 1280px) {
    .crm-right-panel { display: flex; flex-direction: column; }
}

.crm-right-panel__inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.crm-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow:
        0 4px 20px -4px hsl(var(--foreground) / 0.08),
        0 8px 40px -8px hsl(var(--payix-purple) / 0.1);
}

.crm-card--list {
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.crm-card--hover {
    transition: box-shadow 0.2s, transform 0.2s;
}

.crm-card--hover:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.crm-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
}

/* Stat / KPI cards */
.crm-kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .crm-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .crm-kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}

.crm-stat-card {
    position: relative;
    padding: 1.25rem;
}

@media (min-width: 1024px) {
    .crm-kpi-grid .crm-stat-card { padding: 1.5rem; }
}

.crm-stat-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.crm-stat-card__arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    opacity: 0;
    transition: opacity 0.15s ease;
}

.crm-stat-card--link:hover .crm-stat-card__arrow,
.crm-stat-card--link:focus-visible .crm-stat-card__arrow {
    opacity: 1;
}

.crm-stat-card--green .crm-stat-card__value { color: hsl(var(--payix-green)); }
.crm-stat-card--orange .crm-stat-card__value { color: rgb(194 65 12); }
.crm-stat-card--red .crm-stat-card__value { color: rgb(185 28 28); }
.crm-stat-card--blue .crm-stat-card__value { color: hsl(217 91% 45%); }

.crm-dashboard-section {
    margin-top: 1.5rem;
}

.crm-dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .crm-dashboard-page { gap: 2rem; }
}

.crm-dashboard-section__title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.75rem;
}

.crm-dashboard-section__note {
    font-size: 0.8125rem;
    margin: -0.25rem 0 0.75rem;
}

.crm-dashboard-kpi-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-dashboard-workload__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .crm-dashboard-workload__grid { grid-template-columns: repeat(4, 1fr); }
}

.crm-dashboard-workload .crm-counter-card {
    text-decoration: none;
    color: inherit;
}

.crm-counter-card--alert {
    animation: none;
    box-shadow: 0 0 0 2px rgb(185 28 28 / 0.25);
}

.crm-dashboard-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
}

.crm-dashboard-alert--overdue {
    background: rgb(254 242 242);
    border: 1px solid rgb(254 202 202);
    color: rgb(185 28 28);
}

.crm-dashboard-alert__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.crm-dashboard-alert__link {
    color: rgb(185 28 28);
    text-decoration: none;
    font-size: 0.8125rem;
}

.crm-dashboard-alert__link:hover {
    text-decoration: underline;
}

.crm-dashboard-quick-actions__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .crm-dashboard-quick-actions__grid { grid-template-columns: repeat(4, 1fr); }
}

/* Phase 8 Task 7: quick actions remain visible on desktop */

.crm-dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .crm-dashboard-action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.crm-dashboard-action-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
}

.crm-dashboard-action-card:hover {
    background: hsl(var(--muted) / 0.35);
}

.crm-dashboard-action-card__value {
    font-size: 1.375rem;
    font-weight: 700;
}

.crm-dashboard-action-card__label {
    font-weight: 700;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.crm-dashboard-action-card__hint {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: hsl(var(--muted-foreground));
}

.crm-dashboard-action-card--danger {
    border-color: hsl(var(--destructive) / 0.35);
    background: hsl(var(--destructive) / 0.08);
}

.crm-dashboard-action-card--warning {
    border-color: rgb(254 215 170);
    background: rgb(255 247 237 / 0.6);
}

@media (max-width: 390px) {
    .crm-dashboard-action-grid {
        grid-template-columns: 1fr;
    }
}

.crm-dashboard-task-list,
.crm-dashboard-hot-lead-list {
    display: flex;
    flex-direction: column;
}

.crm-dashboard-task {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    border-left: 3px solid transparent;
}

.crm-dashboard-task:last-child {
    border-bottom: none;
}

.crm-dashboard-task--overdue {
    border-left-color: rgb(185 28 28);
    background: rgb(254 242 242 / 0.3);
}

.crm-dashboard-task--due-today {
    border-left-color: rgb(161 98 7);
    background: rgb(254 252 232 / 0.35);
}

.crm-dashboard-task__main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.crm-dashboard-task__icon {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

.crm-dashboard-task__body {
    min-width: 0;
}

.crm-dashboard-task__name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-dashboard-task__name:hover {
    color: hsl(var(--payix-purple));
}

.crm-dashboard-task__notes {
    font-size: 0.8125rem;
    margin-top: 0.125rem;
    line-height: 1.45;
}

.crm-dashboard-task__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.375rem;
}

.crm-dashboard-task__staff {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.crm-dashboard-task__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.crm-dashboard-hot-lead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    transition: background 0.2s ease;
}

.crm-dashboard-hot-lead:hover {
    background: hsl(var(--muted) / 0.35);
}

.crm-dashboard-hot-lead:last-child {
    border-bottom: none;
}

.crm-dashboard-hot-lead__body {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.crm-dashboard-hot-lead__header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.crm-dashboard-hot-lead__name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.crm-dashboard-hot-lead__body:hover .crm-dashboard-hot-lead__name {
    color: hsl(var(--payix-purple));
}

.crm-dashboard-hot-lead__details {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    line-height: 1.45;
}

.crm-dashboard-hot-lead__staff {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.375rem;
}

.crm-dashboard-hot-lead__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.crm-dashboard-alert--lifecycle {
    background: rgb(255 251 235);
    border-color: rgb(253 230 138);
}

.crm-dashboard-alert--lifecycle .crm-dashboard-alert__text {
    color: rgb(146 64 14);
}

.crm-dashboard-task--critical {
    border-left: 3px solid rgb(234 88 12);
    background: rgb(255 247 237);
}

.crm-dashboard-lifecycle-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .crm-dashboard-lifecycle-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.crm-dashboard-lifecycle-panel__title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: hsl(var(--foreground));
}

.crm-dashboard-lifecycle-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.crm-dashboard-lifecycle-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-dashboard-lifecycle-item:last-child {
    border-bottom: none;
}

.crm-dashboard-lifecycle-item__main {
    flex: 1 1 12rem;
    min-width: 0;
}

.crm-dashboard-lifecycle-item__uid {
    font-weight: 600;
    font-size: 0.875rem;
}

.crm-dashboard-lifecycle-item__meta {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.crm-dashboard-lifecycle-item__badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-right: 0.375rem;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.crm-dashboard-lifecycle-item__badge--renewal_needed {
    background: rgb(241 245 249);
    color: rgb(71 85 105);
}

.crm-dashboard-lifecycle-item__badge--recently_renewed {
    background: rgb(220 252 231);
    color: rgb(22 101 52);
}

.crm-dashboard-lifecycle-item__badge--recently_terminated {
    background: rgb(254 226 226);
    color: rgb(153 27 27);
}

.crm-dashboard-lifecycle-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.crm-society-kpi-row--secondary .crm-kpi-mini {
    opacity: 0.9;
}

.crm-society-operational__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-kpi-mini--occupied .crm-kpi-mini__value {
    color: rgb(22 101 52);
}

.crm-kpi-mini--warning .crm-kpi-mini__value {
    color: rgb(194 65 12);
}

@media (max-width: 390px) {
    .crm-dashboard-task__actions,
    .crm-dashboard-lifecycle-item__actions {
        width: 100%;
    }

    .crm-dashboard-task__actions .crm-btn,
    .crm-dashboard-lifecycle-item__actions .crm-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .crm-society-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .crm-dashboard-workload__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.crm-right-panel__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-tasks-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    background: rgb(255 247 237);
    border: 1px solid rgb(254 215 170);
}

.crm-tasks-banner--overdue {
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
}

.crm-tasks-banner__title {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    color: rgb(194 65 12);
}

.crm-tasks-banner--overdue .crm-tasks-banner__title {
    color: rgb(185 28 28);
}

.crm-tasks-banner__overdue {
    font-weight: 600;
}

.crm-tasks-banner__link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(185 28 28);
    text-decoration: none;
}

.crm-tasks-banner__link:hover {
    text-decoration: underline;
}

.crm-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid hsl(var(--border));
    text-decoration: none;
    color: inherit;
}

.crm-task-item:last-child {
    border-bottom: none;
}

.crm-task-item:hover {
    background: hsl(var(--muted) / 0.25);
}

.crm-task-item__main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.crm-task-item__icon {
    font-size: 1.125rem;
    line-height: 1;
}

.crm-task-item__name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.crm-task-item__notes {
    font-size: 0.8125rem;
    margin-top: 0.125rem;
}

.crm-task-item__meta {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
    text-align: right;
}

.crm-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.crm-hot-lead-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-hot-lead-item:last-child {
    border-bottom: none;
}

.crm-hot-lead-item__body {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.crm-hot-lead-item__body:hover .crm-hot-lead-item__name {
    color: hsl(217 91% 45%);
}

.crm-hot-lead-item__name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.crm-empty-state-inline {
    padding: 0.5rem 0;
    margin: 0;
}

@media (max-width: 639px) {
    .crm-task-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .crm-task-item__meta {
        text-align: left;
    }

    .crm-hot-lead-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .crm-dashboard-task,
    .crm-dashboard-hot-lead {
        flex-direction: column;
    }

    .crm-dashboard-task__actions,
    .crm-dashboard-hot-lead__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .crm-dashboard-workload__grid {
        grid-template-columns: 1fr;
    }

    .crm-dashboard-quick-actions__grid {
        grid-template-columns: 1fr;
    }
}

.crm-stat-card__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
}

.crm-stat-card__value {
    font-size: 1.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

@media (min-width: 768px) {
    .crm-stat-card__value { font-size: 2.25rem; }
}

/* Page header */
.crm-page-header { margin-bottom: 1.5rem; }

.crm-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .crm-page-header__title { font-size: 1.875rem; }
}

.crm-page-header__subtitle {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* Alerts */
.crm-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    border: 1px solid;
}

.crm-alert--success {
    border-color: hsl(var(--payix-green) / 0.2);
    background: hsl(var(--payix-green) / 0.05);
    color: hsl(var(--payix-green));
}

.crm-alert--info {
    border-color: hsl(var(--payix-purple) / 0.2);
    background: hsl(var(--payix-purple) / 0.05);
    color: hsl(var(--foreground));
}

.crm-alert--warning {
    border-color: rgb(234 179 8 / 0.2);
    background: rgb(234 179 8 / 0.05);
    color: rgb(202 138 4);
}

.crm-alert--error {
    border-color: rgb(239 68 68 / 0.2);
    background: rgb(239 68 68 / 0.05);
    color: rgb(185 28 28);
}

/* Badges */
.crm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.crm-badge--active {
    background: hsl(var(--payix-green) / 0.1);
    color: hsl(var(--payix-green));
    border-color: hsl(var(--payix-green) / 0.2);
}

.crm-badge--inactive {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
}

/* Buttons */
.crm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.crm-btn--primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.crm-btn--primary:hover {
    background: hsl(var(--primary) / 0.9);
}

.crm-btn--outline {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.crm-btn--outline:hover {
    background: hsl(var(--muted));
}

.crm-btn--full {
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    height: auto;
}

.crm-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple));
}

/* CRM contact action buttons (Call / WhatsApp) */
.crm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
    line-height: 1.2;
}

.crm-action-btn--md {
    padding: 0.5rem 0.875rem;
    min-height: 2.25rem;
}

.crm-action-btn--sm {
    padding: 0.375rem 0.625rem;
    min-height: 2rem;
    font-size: 0.8125rem;
}

.crm-action-btn__icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.crm-action-btn--whatsapp {
    background: #25D366;
    color: #fff;
}

.crm-action-btn--whatsapp:hover {
    background: #1fb855;
}

.crm-action-btn--call {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.crm-action-btn--call:hover {
    background: hsl(var(--muted));
}

.crm-action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple));
}

.crm-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 639px) {
    .crm-action-btn--md {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }
}

/* Unified contact action rows (Call / WA Lead / WA Owner) */
.crm-contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.375rem;
    width: 100%;
}

.crm-contact-actions--compact {
    flex: 1 1 auto;
    min-width: 0;
}

.crm-contact-actions > .inv-card-btn-call,
.crm-contact-actions > .inv-card-btn-wa,
.crm-contact-actions > .crm-wa-send,
.crm-contact-actions > .crm-contact-action-host,
.crm-contact-actions > a.crm-action-btn {
    flex: 1 1 0;
    min-width: 5.5rem;
}

.crm-contact-action-host {
    display: flex;
    flex: 1 1 0;
    min-width: 5.5rem;
    min-height: var(--crm-contact-btn-height);
}

.crm-contact-action-host > div:first-child {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.crm-contact-action-host .visit-card__wa-owner-wrap {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.crm-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    min-height: var(--crm-contact-btn-height);
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    box-sizing: border-box;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}

.crm-contact-btn--whatsapp {
    background: #25D366;
    color: #fff;
    border: 1px solid #25D366;
}

.crm-contact-btn--whatsapp:hover {
    background: #1fb855;
    border-color: #1fb855;
    color: #fff;
}

.crm-contact-actions .inv-card-btn-call,
.crm-contact-actions .inv-card-btn-wa.crm-action-btn,
.crm-contact-actions .visit-card__wa-owner-btn,
.crm-contact-actions .crm-wa-send__toggle--icon,
.crm-contact-actions .crm-wa-send__toggle {
    width: 100%;
    min-height: var(--crm-contact-btn-height);
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    justify-content: center;
}

.crm-contact-actions .inv-card-btn-call {
    border: 1.5px solid #E5E5E5;
    background: #fff;
    color: #111;
}

.crm-contact-actions .inv-card-btn-call:hover {
    border-color: #111;
    background: #FAFAFA;
}

.crm-contact-actions .inv-card-btn-call svg,
.crm-contact-actions .inv-card-btn-call .crm-nav-link__icon,
.crm-contact-actions .visit-card__wa-owner-btn .crm-action-btn__icon,
.crm-contact-actions .inv-card-btn-wa .crm-action-btn__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.crm-contact-actions .crm-wa-send {
    display: flex;
    min-width: 0;
}

.crm-contact-actions .crm-wa-send__toggle--icon {
    border: none;
    cursor: pointer;
}

.crm-contact-actions .lead-profile-hero__edit-btn {
    flex: 0 0 auto;
    min-height: var(--crm-contact-btn-height);
    display: inline-flex;
    align-items: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

.crm-sticky-below-topbar {
    position: sticky;
    top: var(--topbar-height);
    z-index: 25;
}

@media (max-width: 767px) {
    .crm-contact-actions--compact .inv-card-btn-call,
    .crm-contact-actions--compact .inv-card-btn-wa,
    .crm-contact-actions--compact .crm-wa-send,
    .crm-contact-actions--compact .crm-contact-action-host,
    .crm-contact-actions--compact .crm-contact-btn,
    .crm-contact-actions--compact .visit-card__wa-owner-btn {
        min-height: var(--crm-contact-btn-height-mobile);
    }
}

@media (max-width: 480px) {
    .crm-contact-actions--scroll {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.125rem;
    }

    .crm-contact-actions--scroll::-webkit-scrollbar {
        display: none;
    }

    .crm-contact-actions--scroll > * {
        flex: 0 0 auto;
        min-width: 5.5rem;
    }
}

/* Tables */
.crm-table-wrap {
    overflow-x: auto;
}

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

.crm-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    border-bottom: 1px solid hsl(var(--border));
}

.crm-table td {
    padding: 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-table tbody tr:hover {
    background: hsl(var(--muted) / 0.3);
    transition: background 0.2s;
}

/* Login (minimal, separate from marketing) */
.crm-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: hsl(var(--background));
}

.crm-auth__card {
    width: 100%;
    max-width: 24rem;
    padding: 2rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    box-shadow:
        0 4px 20px -4px hsl(var(--foreground) / 0.08),
        0 8px 40px -8px hsl(var(--payix-purple) / 0.1);
}

.crm-form-group {
    margin-bottom: 1rem;
}

.crm-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: hsl(var(--foreground));
}

.crm-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: hsl(var(--foreground));
}

.crm-checkbox {
    width: 1rem;
    height: 1rem;
    margin-right: 0.375rem;
    vertical-align: -2px;
    accent-color: hsl(var(--payix-purple));
}

.crm-permissions-section {
    margin-top: 1rem;
}

.crm-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

.crm-input:focus {
    outline: none;
    border-color: hsl(var(--payix-purple));
    box-shadow: 0 0 0 3px hsl(var(--payix-purple) / 0.15);
}

.crm-form-error {
    font-size: 0.8125rem;
    color: hsl(var(--destructive));
    margin-top: 0.25rem;
}

.crm-form-hint {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
}

.crm-input.is-invalid,
.crm-select.is-invalid,
.crm-textarea.is-invalid {
    border-color: hsl(var(--destructive));
}

.crm-input.is-invalid:focus,
.crm-select.is-invalid:focus,
.crm-textarea.is-invalid:focus {
    box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.15);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lead management */
.crm-page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.crm-mb-4 { margin-bottom: 1rem; }
.crm-mb-3 { margin-bottom: 0.75rem; }
.crm-mt-3 { margin-top: 0.75rem; }
.crm-mt-4 { margin-top: 1rem; }
.crm-mt-6 { margin-top: 1.5rem; }
.crm-text-muted { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

.crm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.crm-filter-search { flex: 1 1 200px; min-width: 0; }

.crm-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

.crm-select--inline { max-width: 10rem; font-size: 0.8125rem; padding: 0.375rem 0.5rem; }

.crm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.crm-filter-chip {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.crm-filter-chip.is-active,
.crm-filter-chip:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.crm-list-count {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
}

.crm-lead-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Template C � list page */
.crm-list-page { display: flex; flex-direction: column; gap: 1rem; }

.crm-filter-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .crm-filter-toolbar {
        flex-direction: row;
        align-items: stretch;
    }
}

.crm-filter-toolbar__search {
    flex: 1;
    min-width: 0;
}

.crm-filter-toolbar__selects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-filter-panel {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    background: hsl(var(--background));
}

.crm-filter-panel__summary {
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    color: hsl(var(--foreground));
}

.crm-filter-panel__summary::-webkit-details-marker { display: none; }

.crm-filter-panel[open] .crm-filter-panel__summary { margin-bottom: 0.5rem; }

.crm-list-card {
    border-radius: 0.75rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    padding: 1rem;
}

@media (min-width: 768px) {
    .crm-list-card { padding: 1.5rem; }
}

.crm-list-card.is-dimmed { opacity: 0.55; pointer-events: none; }

.crm-list-page__filters.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.crm-list-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted) / 0.5);
    border-radius: var(--radius);
}

.crm-lead-card {
    position: relative;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.25rem;
    background: hsl(var(--card));
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.crm-lead-card:hover {
    border-color: hsl(var(--border) / 0.85);
    box-shadow:
        0 4px 16px -4px hsl(var(--foreground) / 0.06),
        0 2px 8px -2px hsl(var(--foreground) / 0.04);
}

.crm-lead-card--hot::before,
.crm-lead-card--overdue::before {
    content: "";
    position: absolute;
    top: 1.35rem;
    left: 0.625rem;
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

.crm-lead-card--hot {
    padding-left: 1.5rem;
}

.crm-lead-card--hot::before {
    background: hsl(0 72% 51%);
}

.crm-lead-card--overdue {
    padding-left: 1.5rem;
}

.crm-lead-card--overdue::before {
    background: hsl(25 90% 52%);
}

.crm-lead-card__identity { min-width: 0; }

.crm-lead-card__uid {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.125rem;
}

.crm-lead-card__assignee {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.crm-lead-card__next-action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(217 91% 40%);
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    background: hsl(217 91% 97%);
}

.crm-lead-card__next-action--overdue {
    color: rgb(185 28 28);
    background: rgb(254 242 242);
}

.crm-lead-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
}

.crm-lead-card__actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.crm-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: hsl(var(--muted-foreground));
}

.crm-empty-state--inline {
    padding: 0.75rem 0;
    text-align: left;
}

.crm-empty-state__title {
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.25rem;
}

.crm-empty-state__description {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.45;
}

.crm-empty-state__actions {
    margin-top: 1rem;
}

.crm-empty-state--inline .crm-empty-state__title {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0;
}

.crm-staff-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: hsl(var(--payix-purple) / 0.12);
    color: hsl(var(--payix-purple));
    font-weight: 700;
    flex-shrink: 0;
}

.crm-staff-avatar--sm { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.crm-staff-avatar--md { width: 2rem; height: 2rem; font-size: 0.75rem; }

.crm-detail-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.crm-detail-summary__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.crm-detail-summary__title-row .crm-page-header__title { margin-bottom: 0; }

.crm-detail-summary__assignee {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.crm-detail-summary__actions { align-self: flex-start; }

.crm-pipeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.crm-pipeline__step {
    padding: 0.375rem 0.625rem;
    border-radius: 9999px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.crm-pipeline__step.is-current {
    background: hsl(var(--payix-purple) / 0.12);
    border-color: hsl(var(--payix-purple) / 0.3);
    color: hsl(var(--payix-purple));
}

.crm-pipeline__step.is-available:hover {
    background: hsl(var(--muted));
}

.crm-pipeline__step.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.crm-heat-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-heat-toggle__btn {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.crm-heat-toggle__btn.is-active.crm-heat-toggle__btn--hot {
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
    color: rgb(185 28 28);
}

.crm-heat-toggle__btn.is-active.crm-heat-toggle__btn--warm {
    background: rgb(255 247 237);
    border-color: rgb(254 215 170);
    color: rgb(194 65 12);
}

.crm-heat-toggle__btn.is-active.crm-heat-toggle__btn--cold {
    background: rgb(239 246 255);
    border-color: rgb(191 219 254);
    color: rgb(29 78 216);
}

.crm-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.crm-timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-timeline-item:last-child { border-bottom: none; }

.crm-timeline-item__marker {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: hsl(var(--muted));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.crm-timeline-item__time {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.125rem;
}

.crm-timeline-item__body {
    font-size: 0.875rem;
    line-height: 1.45;
}

.crm-timeline-item--compact .crm-timeline-item__marker {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8125rem;
    background: transparent;
}

.crm-form-page {
    max-width: 56rem;
}

.crm-btn--danger {
    border-color: hsl(var(--destructive));
    color: hsl(var(--destructive));
}

.crm-btn--danger:hover {
    background: hsl(var(--destructive) / 0.08);
}

.crm-lead-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.625rem;
}

.crm-lead-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-lead-card__name:hover { color: hsl(var(--payix-purple)); }

.crm-lead-card__phone { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

.crm-lead-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: flex-end;
    align-items: center;
    max-width: 55%;
}

@media (max-width: 640px) {
    .crm-lead-card__badges {
        max-width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .crm-lead-card__header {
        flex-direction: column;
    }
}

.crm-lead-card__meta,
.crm-lead-card__sub {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.45;
}

.crm-lead-card__meta {
    margin-bottom: 0.375rem;
}

.crm-lead-card__sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.375rem;
}

.crm-lead-card__summary {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.45;
    margin-bottom: 0.375rem;
}

.crm-lead-card__summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
}

.crm-lead-card__summary-line span:not(:last-child)::after {
    content: '·';
    margin-left: 0.65rem;
    color: hsl(var(--border));
}

.crm-lead-card__phone-link {
    color: inherit;
    text-decoration: none;
}

.crm-lead-card__phone-link:hover {
    color: hsl(var(--payix-purple));
}

.crm-lead-card__actions { margin-top: 0.75rem; }

/* Shared chip system (leads, clients, inventory) */
.crm-lead-badge,
.crm-tag,
.crm-inventory-status,
.crm-inventory-units-badge,
.crm-occupancy-badge.crm-lead-badge,
.crm-badge--creation-website,
.crm-badge--creation-walking,
.crm-badge--creation-property {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    background: hsl(var(--muted) / 0.7);
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

.crm-lead-badge--dot::before,
.crm-inventory-status:not(.crm-inventory-status--muted)::before,
.crm-inventory-units-badge:not(.crm-inventory-units-badge--muted)::before,
.crm-occupancy-badge.crm-lead-badge--dot::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--chip-dot, hsl(var(--muted-foreground)));
    flex: none;
}

.crm-lead-badge--neutral,
.crm-lead-badge--default {
    /* plain gray tag — no dot */
}

.crm-lead-badge--hot { --chip-dot: hsl(0 72% 51%); }
.crm-lead-badge--warm { --chip-dot: hsl(25 90% 52%); }
.crm-lead-badge--cold { --chip-dot: hsl(217 80% 56%); }
.crm-lead-badge--new { --chip-dot: hsl(260 60% 60%); }
.crm-lead-badge--called { --chip-dot: hsl(142 60% 42%); }
.crm-lead-badge--interested { --chip-dot: hsl(25 90% 52%); }
.crm-lead-badge--visit { --chip-dot: hsl(217 80% 56%); }
.crm-lead-badge--negotiation { --chip-dot: hsl(260 60% 60%); }
.crm-lead-badge--won { --chip-dot: hsl(142 60% 42%); }
.crm-lead-badge--lost { --chip-dot: hsl(220 10% 60%); }

.crm-inventory-status--green { --chip-dot: hsl(142 60% 42%); }
.crm-inventory-status--orange { --chip-dot: hsl(25 90% 52%); }
.crm-inventory-status--blue { --chip-dot: hsl(217 80% 56%); }
.crm-inventory-status--purple { --chip-dot: hsl(260 60% 60%); }
.crm-inventory-status--dark { --chip-dot: hsl(220 10% 45%); }
.crm-inventory-units-badge--green { --chip-dot: hsl(142 60% 42%); }
.crm-inventory-units-badge--orange { --chip-dot: hsl(25 90% 52%); }

.crm-lead-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.crm-lead-detail-header__badges,
.crm-detail-summary__title-row .crm-lead-detail-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    margin-top: 0.5rem;
}

.crm-back-link {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.crm-lead-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .crm-lead-detail-grid { grid-template-columns: 1.2fr 0.8fr; }
}

.crm-stack-gap { display: flex; flex-direction: column; gap: 1rem; }

.crm-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.crm-subsection-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
}

.crm-detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
}

.crm-detail-list dt { color: hsl(var(--muted-foreground)); font-weight: 500; }
.crm-detail-list dd { text-align: right; margin: 0; }

.crm-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .crm-form-grid { grid-template-columns: repeat(2, 1fr); }
}

.crm-form-group--full { grid-column: 1 / -1; }

.crm-form-stack { display: flex; flex-direction: column; gap: 1rem; }

.crm-form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.crm-textarea { min-height: 5rem; resize: vertical; }

.crm-radio-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.crm-radio-label { font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.375rem; }

.crm-activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
}

.crm-activity-item__time { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.25rem; }

.crm-tab-panel summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.5rem 0;
}

.crm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, 5vh) 1rem;
    overscroll-behavior: contain;
    overflow-y: auto;
}

body.crm-modal-open {
    overflow: hidden;
}

.crm-modal {
    width: 100%;
    max-width: 24rem;
    max-height: 70vh;
    overflow-y: auto;
    margin: auto;
}

.crm-call-modal {
    text-align: center;
}

.crm-call-modal__hint {
    margin: 0.25rem 0 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.crm-call-modal__number {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.35);
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    word-break: break-word;
}

.crm-call-modal .crm-action-group {
    justify-content: center;
}

.crm-call-picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.crm-call-picker-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.2);
    color: hsl(var(--foreground));
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.crm-call-picker-item:hover {
    background: hsl(var(--muted) / 0.4);
    border-color: hsl(var(--foreground) / 0.15);
}

.crm-call-picker-item__number {
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.crm-call-picker-item--owner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
}

.crm-call-picker-item__icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: hsl(var(--muted) / 0.45);
    font-size: 0.875rem;
}

.crm-call-picker-item__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.crm-call-picker-item__property {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.35;
}

.crm-owner-wa-picker__list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    max-height: 18rem;
    overflow-y: auto;
}

.crm-owner-wa-picker__item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 0.9rem;
    border: none;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    text-align: left;
    cursor: pointer;
}

.crm-owner-wa-picker__item:last-child {
    border-bottom: none;
}

.crm-owner-wa-picker__item:hover,
.crm-owner-wa-picker__item:focus {
    background: hsl(var(--muted) / 0.35);
}

.crm-owner-wa-picker__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: hsl(var(--muted) / 0.45);
    color: hsl(var(--muted-foreground));
}

.crm-owner-wa-picker__main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.crm-owner-wa-picker__owner {
    font-weight: 600;
    line-height: 1.3;
}

.crm-owner-wa-picker__property {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.crm-owner-wa-picker__action {
    flex-shrink: 0;
    color: #25d366;
}

/* WhatsApp picker sheets — message list + owner list */
.crm-wa-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.crm-wa-icon--header {
    width: 1.35rem;
    height: 1.35rem;
}

.crm-wa-sheet-backdrop {
    align-items: flex-end;
    padding: 0;
}

.crm-wa-sheet {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    border-radius: 1rem 1rem 0 0;
    max-height: min(88vh, 40rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.crm-wa-sheet__handle {
    width: 2.5rem;
    height: 0.25rem;
    border-radius: 999px;
    background: hsl(var(--border));
    margin: 0.65rem auto 0;
    flex-shrink: 0;
}

.crm-wa-message-picker__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    flex-shrink: 0;
}

.crm-wa-message-picker__header-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: hsl(142 76% 36% / 0.12);
    color: #128c41;
}

.crm-wa-message-picker__header-text {
    min-width: 0;
    flex: 1;
}

.crm-wa-message-picker__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    color: hsl(var(--foreground));
}

.crm-wa-message-picker__subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: hsl(var(--muted-foreground));
}

.crm-wa-message-picker__section-label {
    margin: 0;
    padding: 0.5rem 1rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    flex-shrink: 0;
}

.crm-wa-message-picker__section-label--custom {
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
    margin-top: 0.25rem;
}

.crm-wa-message-picker__list,
.crm-wa-owner-picker__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 1rem 0.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-wa-message-picker__list--custom {
    padding-top: 0.25rem;
}

.crm-wa-message-picker__card,
.crm-wa-owner-picker__card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    background: hsl(var(--card));
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-wa-message-picker__card:hover,
.crm-wa-message-picker__card:focus-visible,
.crm-wa-owner-picker__card:hover,
.crm-wa-owner-picker__card:focus-visible {
    border-color: hsl(142 55% 45% / 0.55);
    background: hsl(142 76% 36% / 0.04);
    box-shadow: 0 1px 3px hsl(0 0% 0% / 0.06);
    outline: none;
}

.crm-wa-message-picker__card:active,
.crm-wa-owner-picker__card:active {
    transform: scale(0.995);
}

.crm-wa-message-picker__card-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: hsl(142 76% 36% / 0.14);
    color: #128c41;
}

.crm-wa-message-picker__card-icon--custom {
    background: hsl(var(--muted) / 0.45);
    color: hsl(var(--muted-foreground));
}

.crm-wa-message-picker__card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.crm-wa-message-picker__card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crm-wa-message-picker__card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: hsl(var(--foreground));
}

.crm-wa-message-picker__card-hint {
    font-size: 0.75rem;
    line-height: 1.4;
    color: hsl(var(--muted-foreground));
}

.crm-wa-message-picker__badge {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: hsl(142 76% 36% / 0.14);
    color: #128c41;
}

.crm-wa-message-picker__badge--city {
    background: hsl(var(--payix-purple) / 0.12);
    color: hsl(var(--payix-purple));
}

.crm-wa-message-picker__card-chevron {
    flex-shrink: 0;
    color: hsl(var(--muted-foreground) / 0.65);
    display: flex;
    align-items: center;
}

.crm-wa-message-picker__card-chevron .crm-nav-link__icon {
    width: 1rem;
    height: 1rem;
}

.crm-wa-message-picker__card--custom {
    border-style: dashed;
}

.crm-wa-owner-picker__card-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: hsl(var(--muted) / 0.4);
    color: hsl(var(--muted-foreground));
}

.crm-wa-owner-picker__card-icon .crm-nav-link__icon {
    width: 1.125rem;
    height: 1.125rem;
}

.crm-wa-owner-picker__card-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    flex: 1;
}

.crm-wa-owner-picker__property {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: hsl(var(--foreground));
}

.crm-wa-owner-picker__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.crm-wa-owner-picker__owner-name {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.35;
}

.crm-wa-owner-picker__owner-name::before {
    content: 'Owner: ';
    font-weight: 600;
    color: hsl(var(--muted-foreground) / 0.85);
}

.crm-wa-owner-picker__wa-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
}

.crm-wa-owner-picker__wa-icon .crm-wa-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.crm-wa-sheet__footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--card));
}

.crm-btn--block {
    width: 100%;
    justify-content: center;
}

@media (min-width: 640px) {
    .crm-wa-sheet-backdrop {
        align-items: center;
        padding: max(1rem, 5vh) 1rem;
    }

    .crm-wa-sheet {
        border-radius: 1rem;
        max-height: min(85vh, 36rem);
    }

    .crm-wa-sheet__handle {
        display: none;
    }
}

@media (max-width: 639px) {
    .crm-wa-message-picker__card,
    .crm-wa-owner-picker__card {
        min-height: 3.5rem;
        padding: 0.9rem 0.95rem;
    }

    .crm-wa-message-picker__title {
        font-size: 1rem;
    }
}

.crm-call-picker-item__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crm-call-picker-item__number {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.crm-inline-control { display: inline-flex; }

.crm-pagination-wrap { margin-top: 1rem; }

.crm-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.crm-pagination__btn,
.crm-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    min-width: 2.25rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.crm-pagination__btn:hover,
.crm-pagination__page:hover {
    border-color: hsl(var(--foreground) / 0.25);
    background: hsl(var(--muted) / 0.35);
    color: hsl(var(--foreground));
}

.crm-pagination__btn--disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.crm-pagination__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.crm-pagination__page.is-active {
    background: hsl(var(--foreground));
    border-color: hsl(var(--foreground));
    color: hsl(var(--background));
    font-weight: 600;
}

.crm-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
}

.crm-pagination__summary {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.crm-pagination__summary strong {
    color: hsl(var(--foreground));
    font-weight: 600;
}

/* Fallback: constrain any legacy Tailwind pagination SVGs if they slip through */
.crm-pagination-wrap svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.crm-btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.crm-followup-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 639px) {
    .crm-followup-counters { grid-template-columns: 1fr; }
}

.crm-counter-card {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    text-align: center;
    border: 1px solid hsl(var(--border));
    width: 100%;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
    font: inherit;
    color: inherit;
}

.crm-counter-card:hover {
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

.crm-counter-card.is-active {
    box-shadow: 0 0 0 2px hsl(var(--payix-purple) / 0.35);
    transform: translateY(-1px);
}

.crm-counter-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .crm-counter-card__value { font-size: 2rem; }
}

.crm-counter-card__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

.crm-counter-card--today {
    background: rgb(254 252 232);
    color: rgb(161 98 7);
    border-color: rgb(254 240 138);
}

.crm-counter-card--overdue {
    background: rgb(254 242 242);
    color: rgb(185 28 28);
    border-color: rgb(254 202 202);
}

.crm-counter-card--done {
    background: hsl(var(--payix-green) / 0.08);
    color: hsl(var(--payix-green));
    border-color: hsl(var(--payix-green) / 0.2);
}

.crm-followup-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.5);
    font-size: 0.8125rem;
    font-weight: 600;
}

.crm-followup-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-followup-card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    background: hsl(var(--card));
    border-left-width: 3px;
    border-left-color: hsl(var(--border));
}

.crm-followup-card--overdue {
    border-left-color: rgb(185 28 28);
    background: rgb(254 242 242 / 0.35);
}

.crm-followup-card--due-today {
    border-left-color: rgb(161 98 7);
    background: rgb(254 252 232 / 0.45);
}

.crm-followup-card--done {
    border-left-color: hsl(var(--payix-green));
    opacity: 0.92;
}

.crm-followup-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.crm-followup-card__identity { min-width: 0; }

.crm-followup-card__name {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-followup-card__name:hover { color: hsl(var(--payix-purple)); }

.crm-followup-card__type-icon { font-size: 1.125rem; line-height: 1; }

.crm-followup-card__phone {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.125rem;
}

.crm-followup-card__schedule {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
}

.crm-followup-card__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    flex-shrink: 0;
}

.crm-followup-card__notes {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
    line-height: 1.45;
}

.crm-followup-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.crm-followup-card__staff {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.crm-followup-card__outcome {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid hsl(var(--border));
}

.crm-followup-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
}

.crm-followup-card__actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.crm-followup-state {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.crm-followup-state--overdue {
    color: rgb(185 28 28);
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
}

.crm-followup-state--due_tomorrow {
    background: #eef2ff;
    color: #4338ca;
}

.crm-followup-state--due_today {
    color: rgb(161 98 7);
    background: rgb(254 252 232);
    border-color: rgb(254 240 138);
}

.crm-followup-state--done {
    color: hsl(var(--payix-green));
    background: hsl(var(--payix-green) / 0.1);
    border-color: hsl(var(--payix-green) / 0.2);
}

.crm-followup-state--pending { color: hsl(var(--muted-foreground)); }

.crm-priority-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid;
}

.crm-priority-badge--high { background: rgb(254 242 242); color: rgb(185 28 28); border-color: rgb(254 202 202); }
.crm-priority-badge--medium { background: rgb(255 247 237); color: rgb(194 65 12); border-color: rgb(254 215 170); }
.crm-priority-badge--low { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }

.crm-modal__context {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: hsl(var(--foreground));
}

.crm-timeline-item--overdue {
    background: rgb(254 242 242 / 0.25);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius);
}

.crm-timeline-item--due-today {
    background: rgb(254 252 232 / 0.35);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius);
}

@media (max-width: 639px) {
    .crm-followup-card__header {
        flex-direction: column;
    }

    .crm-followup-card__badges {
        flex-direction: row;
        align-items: center;
    }

    .crm-followup-card__actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-modal {
        width: calc(100% - 1rem);
        max-height: 70vh;
        overflow-y: auto;
    }
}

.crm-modal--wide { max-width: 32rem; }

.crm-modal--constrained {
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
    padding: 0;
}

.crm-modal--constrained .crm-modal__header {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-modal--constrained .crm-modal__header .crm-card__title {
    margin-bottom: 0.25rem;
}

.crm-modal--constrained .crm-modal__header .crm-text-muted {
    margin-bottom: 0;
}

.crm-modal--constrained .crm-modal__form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.crm-modal--constrained .crm-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    min-height: 0;
    overscroll-behavior: contain;
}

.crm-modal--constrained .crm-modal__footer {
    flex-shrink: 0;
    padding: 0.75rem 1.5rem 1.25rem;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--card));
}

.crm-password-field {
    position: relative;
}

.crm-password-field .crm-input {
    padding-right: 2.75rem;
    width: 100%;
}

.crm-password-toggle {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-password-toggle:hover {
    color: hsl(var(--foreground));
}

.crm-visit-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 639px) {
    .crm-visit-counters { grid-template-columns: 1fr; }
}

.crm-visit-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.5);
    font-size: 0.8125rem;
    font-weight: 600;
}

.crm-visit-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-visit-card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    background: hsl(var(--card));
    border-left-width: 3px;
    border-left-color: hsl(217 91% 60%);
}

.crm-visit-card--overdue {
    border-left-color: rgb(185 28 28);
    background: rgb(254 242 242 / 0.35);
}

.crm-visit-card--due-today {
    border-left-color: rgb(161 98 7);
    background: rgb(254 252 232 / 0.45);
}

.crm-visit-card--done {
    border-left-color: hsl(var(--payix-green));
    opacity: 0.92;
}

.crm-visit-card--cancelled {
    border-left-color: hsl(var(--destructive));
    opacity: 0.85;
}

.crm-visit-card--rescheduled {
    border-left-color: hsl(var(--muted-foreground));
    opacity: 0.75;
}

.crm-visit-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.crm-visit-card__identity { min-width: 0; }

.crm-visit-card__name {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-visit-card__name:hover { color: hsl(217 91% 45%); }

.crm-visit-card__type-icon { font-size: 1.125rem; line-height: 1; }

.crm-visit-card__phone {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.125rem;
}

.crm-visit-card__datetime {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
}

.crm-visit-card__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    flex-shrink: 0;
}

.crm-visit-state {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.crm-visit-state--overdue {
    color: rgb(185 28 28);
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
}

.crm-visit-state--due_today {
    color: rgb(161 98 7);
    background: rgb(254 252 232);
    border-color: rgb(254 240 138);
}

.crm-visit-state--done {
    color: hsl(var(--payix-green));
    background: hsl(var(--payix-green) / 0.1);
    border-color: hsl(var(--payix-green) / 0.2);
}

.crm-visit-state--cancelled {
    color: hsl(var(--destructive));
    background: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive) / 0.2);
}

.crm-visit-state--rescheduled,
.crm-visit-state--scheduled {
    color: hsl(217 91% 35%);
    background: hsl(217 91% 95%);
    border-color: hsl(217 91% 85%);
}

.crm-visit-status {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.crm-visit-status--scheduled {
    background: hsl(217 91% 95%);
    color: hsl(217 91% 35%);
}

.crm-visit-status--done {
    background: hsl(var(--payix-green) / 0.12);
    color: hsl(var(--payix-green));
}

.crm-visit-status--cancelled {
    background: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

.crm-visit-status--rescheduled {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.crm-visit-card__property {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.5);
    margin-bottom: 0.5rem;
}

.crm-visit-card__property-info { min-width: 0; }

.crm-visit-card__notes {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
    line-height: 1.45;
}

.crm-visit-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.crm-visit-card__staff {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.crm-visit-card__outcome {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid hsl(var(--border));
}

.crm-visit-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
}

.crm-visit-card__actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.crm-link-btn {
    background: none;
    border: none;
    color: hsl(217 91% 45%);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.crm-link-btn:hover {
    text-decoration: underline;
}

.crm-property-search__selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background: hsl(var(--muted) / 0.3);
}

.crm-property-search__results {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    max-height: 16rem;
    overflow-y: auto;
    background: hsl(var(--card));
}

.crm-property-search__result-item {
    border-bottom: 1px solid hsl(var(--border));
}

.crm-property-search__result-item:last-child {
    border-bottom: none;
}

.crm-property-search__result {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: hsl(var(--card));
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.crm-property-search__result:hover,
.crm-property-search__result:focus {
    background: hsl(var(--muted) / 0.35);
}

.crm-property-search__result-media {
    flex-shrink: 0;
}

.crm-property-search__thumb {
    display: block;
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    object-fit: cover;
    background: hsl(var(--muted) / 0.5);
}

.crm-property-search__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    background: hsl(var(--muted) / 0.45);
    color: hsl(var(--muted-foreground));
}

.crm-property-search__thumb-placeholder svg,
.crm-property-search__thumb-placeholder .crm-nav-link__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.crm-property-search__result-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.crm-property-search__result-title {
    font-weight: 600;
    line-height: 1.3;
}

.crm-property-search__result-meta {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.35;
}

.crm-property-search__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-property-search__item:last-child {
    border-bottom: none;
}

.crm-property-search__item:hover {
    background: hsl(var(--muted) / 0.5);
}

.crm-select--inline {
    width: auto;
    min-width: 8rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

@media (max-width: 639px) {
    .crm-visit-card__header {
        flex-direction: column;
    }

    .crm-visit-card__badges {
        flex-direction: row;
        align-items: center;
    }

    .crm-visit-card__actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-visit-card__property {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-select--inline {
        width: 100%;
    }

    .crm-modal {
        width: calc(100% - 1rem);
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Toast notifications */
.crm-toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.crm-toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.crm-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.crm-toast--success {
    border-color: hsl(var(--payix-green) / 0.35);
    background: hsl(var(--payix-green) / 0.08);
}

.crm-toast--warning {
    border-color: rgb(254 215 170);
    background: rgb(255 247 237);
    color: rgb(194 65 12);
}

.crm-toast--error {
    border-color: hsl(var(--destructive) / 0.35);
    background: hsl(var(--destructive) / 0.08);
    color: hsl(var(--destructive));
}

/* Data tables */
.crm-table-wrap {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crm-table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
}

.crm-table th,
.crm-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
}

.crm-table th {
    background: hsl(var(--muted) / 0.35);
    color: hsl(var(--muted-foreground));
    font-weight: 600;
    white-space: nowrap;
}

.crm-table tbody tr:last-child td {
    border-bottom: none;
}

.crm-table__empty {
    text-align: center;
    color: hsl(var(--muted-foreground));
    padding: 2rem 1rem !important;
}

.crm-table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

/* Right panel account */
.crm-account-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.crm-account-header__avatar {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

.crm-account-header__name {
    font-size: 0.875rem;
    font-weight: 600;
}

.crm-account-header__uid {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-family: ui-monospace, monospace;
}

.crm-account-meta {
    border-top: 1px solid hsl(var(--border));
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    gap: 0.75rem;
}

.crm-meta-row__label {
    color: hsl(var(--muted-foreground));
}

.crm-meta-row__value {
    font-weight: 500;
    text-align: right;
}

.crm-staff-grid > .crm-empty-state {
    grid-column: 1 / -1;
}

/* Inventory list */
.crm-inventory-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.crm-inventory-tab {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border-radius: 999px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.crm-inventory-tab.is-active,
.crm-inventory-tab:hover {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.08);
    color: hsl(var(--primary));
}

.crm-inventory-price-range {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-inventory-price-range .crm-input {
    flex: 1 1 8rem;
    min-width: 0;
}

.crm-inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-inventory-card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.25rem;
    background: hsl(var(--card));
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.crm-inventory-card:hover {
    border-color: hsl(var(--border) / 0.85);
    box-shadow:
        0 4px 16px -4px hsl(var(--foreground) / 0.06),
        0 2px 8px -2px hsl(var(--foreground) / 0.04);
}

.crm-inventory-card--with-image {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

@media (min-width: 640px) {
    .crm-inventory-card--with-image {
        flex-direction: row;
        align-items: stretch;
    }
}

.crm-inventory-card__media {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
}

.crm-inventory-card__image {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

@media (min-width: 640px) {
    .crm-inventory-card__image {
        width: 120px;
        height: 100%;
        min-height: 120px;
    }
}

.crm-inventory-card__image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 140px;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.crm-inventory-card__image-placeholder svg {
    width: 2rem;
    height: 2rem;
    opacity: 0.45;
}

@media (min-width: 640px) {
    .crm-inventory-card__image-placeholder {
        width: 120px;
        height: 100%;
        min-height: 120px;
    }
}

.crm-inventory-card__body {
    flex: 1;
    min-width: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-inventory-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}

@media (min-width: 640px) {
    .crm-inventory-card__header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.crm-inventory-card__identity {
    min-width: 0;
}

.crm-inventory-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-inventory-card__title:hover {
    color: hsl(var(--primary));
}

.crm-inventory-card__meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-inventory-card__uid {
    font-family: ui-monospace, monospace;
}

.crm-inventory-card__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.crm-inventory-card__leads-badge {
    text-decoration: none;
}

.crm-inventory-card__price {
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-inventory-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0;
}

.crm-tag {
    /* inherits shared chip base from .crm-lead-badge group */
}

.crm-inventory-status {
    /* inherits shared chip base; semantic statuses use ::before dot */
}

.crm-inventory-status--green,
.crm-inventory-status--orange,
.crm-inventory-status--blue,
.crm-inventory-status--purple,
.crm-inventory-status--dark {
    /* dot colors defined above */
}

.crm-inventory-status--muted {
    /* plain neutral — no dot */
}

.crm-inventory-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.crm-inventory-card__asked {
    font-size: 0.8125rem;
    font-weight: 500;
}

.crm-inventory-card__asked--done {
    color: rgb(21 128 61);
}

.crm-inventory-card__status-select {
    display: inline-flex;
    align-items: center;
}

.crm-select--sm {
    min-height: 2rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.crm-inventory-detail__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

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

.crm-subsection-title {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--crm-text-secondary, #64748b);
}

.crm-media-feature {
    display: inline-block;
    max-width: 100%;
    border-radius: var(--crm-radius-md, 8px);
    overflow: hidden;
    border: 1px solid var(--crm-border, rgba(0, 0, 0, 0.08));
}

.crm-media-feature img {
    display: block;
    max-width: min(100%, 420px);
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: cover;
}

.crm-media-feature--sm img {
    max-width: min(100%, 240px);
    max-height: 160px;
}

.crm-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.crm-media-gallery__item {
    display: block;
    border-radius: var(--crm-radius-md, 8px);
    overflow: hidden;
    border: 1px solid var(--crm-border, rgba(0, 0, 0, 0.08));
}

.crm-media-gallery__item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.crm-document-list {
    margin: 0;
    padding-left: 1.25rem;
}

.crm-document-list li + li {
    margin-top: 0.35rem;
}

.crm-media-video {
    display: block;
    width: 100%;
    max-width: 560px;
    border-radius: var(--crm-radius-md, 8px);
    background: #000;
}

.crm-translation-block + .crm-translation-block {
    padding-top: 1rem;
    border-top: 1px solid var(--crm-border, rgba(0, 0, 0, 0.08));
}

.crm-social-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgb(29 78 216);
    background: #fff;
    border: 1px solid rgb(147 197 253);
}

.crm-social-id-badge--inline {
    font-size: 0.75rem;
}

.crm-inventory-card__meta-line {
    align-items: center;
}

.crm-copy-btn {
    padding-inline: 0.375rem;
    min-height: 1.75rem;
}

.crm-inventory-units-badge {
    /* inherits shared chip base */
}

.crm-inventory-units-badge--muted {
    /* plain neutral — no dot */
}

.crm-inventory-identity__social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.crm-property-units__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .crm-property-units__summary {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.crm-property-units__stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
}

.crm-property-units__stat-label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-property-units__stat--green strong { color: rgb(21 128 61); }
.crm-property-units__stat--blue strong { color: rgb(29 78 216); }
.crm-property-units__stat--purple strong { color: rgb(126 34 206); }
.crm-property-units__stat--orange strong { color: rgb(194 65 12); }

.crm-property-units__toolbar {
    margin-bottom: 1rem;
}

.crm-property-units__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crm-property-units__row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.crm-property-units__notes-row td {
    padding-top: 0;
    font-size: 0.8125rem;
}

.crm-property-units__exhausted-banner {
    font-size: 0.875rem;
}

.crm-property-units__internal-address {
    max-width: 16rem;
    word-break: break-word;
}

.crm-property-search__selected {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background: hsl(var(--muted) / 0.35);
}

.crm-property-search__selected-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.crm-property-search__selected-meta {
    font-size: 0.8125rem;
}

/* property-search result row styles defined earlier in this file */

.crm-lead-card__property {
    margin-bottom: 0.35rem;
}

.crm-lead-card__property-link {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(29 78 216);
    text-decoration: none;
}

.crm-lead-card__property-link:hover {
    text-decoration: underline;
}

.crm-wa-dual-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.375rem;
}

.crm-payix .crm-wa-owner-btn.crm-action-btn--whatsapp {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}

.crm-payix .crm-wa-owner-btn.crm-action-btn--whatsapp:hover {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

.crm-wa-owner-btn__error {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.crm-linked-leads-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crm-linked-leads {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-linked-lead-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

@media (min-width: 640px) {
    .crm-linked-lead-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.crm-linked-lead-row:last-child {
    border-bottom: none;
}

.crm-linked-lead-row__name {
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-linked-lead-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Matching recommendation panels (lead ? inventory intelligence) */
.crm-match-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-match-list--compact {
    gap: 0.5rem;
}

.crm-match-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-match-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (min-width: 640px) {
    .crm-match-row {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.crm-match-row--property {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0;
}

.crm-match-row--property.crm-match-row--linked {
    padding: 0.75rem;
}

.crm-match-row__media {
    flex-shrink: 0;
}

.crm-match-row__thumb {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.3);
}

.crm-match-row__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.45);
    color: hsl(var(--muted-foreground));
}

.crm-match-row__thumb-placeholder svg,
.crm-match-row__thumb-placeholder .crm-nav-link__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.crm-match-row--property .crm-match-row__main {
    flex: 1;
    min-width: 0;
}

.crm-match-row--property .crm-match-row__actions {
    align-self: center;
}

@media (min-width: 768px) {
    .crm-match-row__thumb,
    .crm-match-row__thumb-placeholder {
        width: 64px;
        height: 64px;
    }

    .crm-match-row--property {
        gap: 1rem;
        padding: 0.875rem 0;
    }
}

.crm-match-row--linked {
    background: hsl(var(--muted) / 0.35);
    margin: 0 -0.75rem;
    padding: 0.875rem 0.75rem;
    border-radius: var(--radius);
    border-bottom: none;
}

.crm-match-row--compact {
    padding: 0.5rem 0;
}

.crm-match-row__title {
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-match-row__title:hover {
    text-decoration: underline;
}

.crm-match-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.crm-match-row__actions .crm-btn {
    min-height: 2.25rem;
}

.crm-match-row__reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.crm-match-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.crm-match-row__linked-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--primary));
}

/* �� Societies (Phase 4) �� */
.crm-society-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-society-card {
    padding: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
}

.crm-society-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.crm-society-card__title {
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-society-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.75rem 0;
}

.crm-society-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-society-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.crm-society-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .crm-society-kpi-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

.crm-kpi-mini {
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    text-align: center;
}

.crm-kpi-mini__label {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-kpi-mini__value {
    font-size: 1.25rem;
    font-weight: 600;
}

.crm-tabs .crm-tab-panel + .crm-tab-panel {
    margin-top: 1rem;
}

.crm-society-building {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.crm-society-building__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: hsl(var(--muted) / 0.35);
}

.crm-society-building__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
    flex: 1;
}

.crm-society-building__chevron {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-society-building__body {
    padding: 1rem;
}

.crm-society-unit-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crm-society-unit-table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.crm-society-unit-table th,
.crm-society-unit-table td {
    padding: 0.5rem 0.375rem;
    border-bottom: 1px solid hsl(var(--border));
    vertical-align: top;
}

.crm-society-unit-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: hsl(var(--muted-foreground));
    text-align: left;
}

.crm-society-unit-table__actions {
    white-space: nowrap;
}

.crm-society-units__toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .crm-society-units__toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.crm-society-units__search {
    flex: 1;
    min-width: 0;
}

.crm-society-units__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-select--sm {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    min-width: 7rem;
}

.crm-society-documents {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-society-document-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-society-document-row__actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.crm-society-property-search {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
}

.crm-society-property-search__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: hsl(var(--muted) / 0.4);
    border-radius: var(--radius);
    margin-bottom: 0.375rem;
    cursor: pointer;
    font: inherit;
}

.crm-linked-inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-linked-inventory-row {
    display: block;
    padding: 0.625rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    text-decoration: none;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
}

.crm-inline-form-panel summary {
    cursor: pointer;
    list-style: none;
}

.crm-inline-form-panel summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 767px) {
    .crm-society-unit-table thead {
        display: none;
    }

    .crm-society-unit-table tr {
        display: block;
        padding: 0.875rem 0.875rem;
        margin-bottom: 0.75rem;
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius);
        background: hsl(var(--card));
    }

    .crm-society-unit-table td {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        border: none;
        padding: 0.25rem 0;
    }

    .crm-society-unit-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: hsl(var(--muted-foreground));
    }

    .crm-society-unit-table__actions {
        white-space: normal;
    }

    .crm-society-unit-table__actions .crm-btn,
    .crm-society-unit-table__actions form {
        width: 100%;
    }

    .crm-society-unit-table__actions .crm-btn {
        justify-content: center;
    }
}

/* �� Agreements (Phase 4 Task 4) �� */
.crm-agreement-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-agreement-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.crm-agreement-stat {
    display: block;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.crm-agreement-stat.is-active {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 1px;
}

.crm-agreement-stat--green { background: hsl(142 76% 36% / 0.12); }
.crm-agreement-stat--orange { background: hsl(32 95% 44% / 0.12); }
.crm-agreement-stat--red { background: hsl(0 72% 51% / 0.1); }

.crm-agreement-stat__label {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-agreement-stat__value {
    font-size: 1.375rem;
    font-weight: 600;
}

.crm-agreement-card {
    padding: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
}

.crm-agreement-card__tenant {
    font-weight: 600;
    font-size: 1rem;
}

.crm-agreement-card__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.crm-agreement-card__financial {
    font-weight: 500;
    margin: 0.5rem 0;
}

.crm-agreement-card__dates {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.crm-agreement-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
}

.crm-agreement-operational__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.crm-agreement-operational__title {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.crm-agreement-operational__meta {
    font-size: 0.875rem;
    margin-top: 0.375rem;
}

.crm-agreement-operational__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.crm-agreement-days {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.crm-agreement-days--ok { color: hsl(142 76% 36%); }
.crm-agreement-days--soon { color: hsl(32 95% 44%); }
.crm-agreement-days--overdue { color: hsl(0 72% 51%); }

.crm-agreement-detail-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.crm-agreement-rent-highlight {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.crm-wizard-steps {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.crm-wizard-steps span.is-active {
    color: hsl(var(--foreground));
    font-weight: 600;
}

.crm-search-dropdown {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    max-height: 12rem;
    overflow-y: auto;
}

.crm-search-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.crm-search-dropdown button:hover {
    background: hsl(var(--muted) / 0.5);
}

@media (max-width: 767px) {
    .crm-agreement-stat-row {
        grid-template-columns: 1fr;
    }

    .crm-agreement-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-agreement-card__actions .crm-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====================================================================== */
/* Payix dashboard replica (Dashboard-only overrides, high specificity)     */
/* ====================================================================== */
.crm-payix *,
.crm-payix-dashboard * {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

.crm-payix .crm-app,
.crm-payix-dashboard .crm-app {
    background: hsl(var(--background)) !important;
}

.crm-payix .crm-main,
.crm-payix-dashboard .crm-main {
    padding: 1rem !important;
}

@media (min-width: 640px) {
    .crm-payix .crm-main,
    .crm-payix-dashboard .crm-main { padding: 1.5rem !important; }
}

@media (min-width: 1024px) {
    .crm-payix .crm-main,
    .crm-payix-dashboard .crm-main { padding: 2rem !important; }
}

/* Payix shell surfaces (dashboard-only) */
.crm-payix .crm-sidebar,
.crm-payix-dashboard .crm-sidebar {
    background: hsl(var(--muted) / 0.3) !important;
    border-right: 1px solid hsl(var(--border)) !important;
}

.crm-payix .crm-right-panel,
.crm-payix-dashboard .crm-right-panel {
    background: hsl(var(--muted) / 0.2) !important;
    border-left: 1px solid hsl(var(--border)) !important;
}

.crm-payix .crm-topbar,
.crm-payix-dashboard .crm-topbar {
    background: hsl(var(--background) / 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border-bottom: 1px solid hsl(var(--border)) !important;
}

.crm-payix .crm-sidebar__logo-text,
.crm-payix-dashboard .crm-sidebar__logo-text {
    color: hsl(var(--payix-purple)) !important;
    font-weight: 700 !important;
}

.crm-payix .crm-nav-link.is-active,
.crm-payix-dashboard .crm-nav-link.is-active {
    background: hsl(var(--muted)) !important;
    color: hsl(var(--foreground)) !important;
    font-weight: 600 !important;
}

.crm-payix .crm-nav-link:hover,
.crm-payix-dashboard .crm-nav-link:hover {
    background: hsl(var(--muted) / 0.5) !important;
}

.crm-payix .crm-avatar,
.crm-payix-dashboard .crm-avatar {
    background: hsl(var(--payix-purple) / 0.1) !important;
    color: hsl(var(--payix-purple)) !important;
    font-weight: 500 !important;
}

.crm-payix .crm-sidebar__badge,
.crm-payix-dashboard .crm-sidebar__badge {
    background: hsl(var(--payix-purple-light)) !important;
    color: hsl(var(--payix-purple)) !important;
    border-color: hsl(var(--payix-purple) / 0.12) !important;
}

/* Universal Payix card baseline (white cards, soft shadow) */
.crm-payix .crm-card,
.crm-payix .crm-list-card,
.crm-payix .crm-stat-card,
.crm-payix .crm-counter-card,
.crm-payix .crm-dashboard-action-card,
.crm-payix .crm-right-panel .crm-card,
.crm-payix .crm-dashboard-alert,
.crm-payix .crm-tasks-banner,
.crm-payix-dashboard .crm-card,
.crm-payix-dashboard .crm-list-card,
.crm-payix-dashboard .crm-stat-card,
.crm-payix-dashboard .crm-counter-card,
.crm-payix-dashboard .crm-dashboard-action-card,
.crm-payix-dashboard .crm-right-panel .crm-card,
.crm-payix-dashboard .crm-dashboard-alert,
.crm-payix-dashboard .crm-tasks-banner {
    background: hsl(var(--card)) !important;
    color: hsl(var(--foreground)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 1rem !important;
    box-shadow:
        0 4px 20px -4px hsl(var(--foreground) / 0.08),
        0 8px 40px -8px hsl(var(--payix-purple) / 0.10) !important;
    transition: all 0.25s ease !important;
}

.crm-payix .crm-counter-card,
.crm-payix .crm-dashboard-action-card,
.crm-payix-dashboard .crm-counter-card,
.crm-payix-dashboard .crm-dashboard-action-card {
    padding: 1.5rem !important;
    text-align: left !important;
}

.crm-payix .crm-card--hover:hover,
.crm-payix .crm-stat-card--link:hover,
.crm-payix .crm-counter-card:hover,
.crm-payix .crm-dashboard-action-card:hover,
.crm-payix-dashboard .crm-card--hover:hover,
.crm-payix-dashboard .crm-stat-card--link:hover,
.crm-payix-dashboard .crm-counter-card:hover,
.crm-payix-dashboard .crm-dashboard-action-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px -6px hsl(var(--foreground) / 0.10),
        0 16px 60px -12px hsl(var(--payix-purple) / 0.18) !important;
}

/* Kill all colored fills/rings for dashboard-only Payix skin */
.crm-payix .crm-counter-card--today,
.crm-payix .crm-counter-card--overdue,
.crm-payix .crm-counter-card--alert,
.crm-payix .crm-counter-card--done,
.crm-payix .crm-dashboard-action-card--danger,
.crm-payix .crm-dashboard-action-card--warning,
.crm-payix .crm-dashboard-alert--lifecycle,
.crm-payix .crm-dashboard-alert--overdue,
.crm-payix .crm-tasks-banner--overdue,
.crm-payix-dashboard .crm-counter-card--today,
.crm-payix-dashboard .crm-counter-card--overdue,
.crm-payix-dashboard .crm-counter-card--alert,
.crm-payix-dashboard .crm-counter-card--done,
.crm-payix-dashboard .crm-dashboard-action-card--danger,
.crm-payix-dashboard .crm-dashboard-action-card--warning,
.crm-payix-dashboard .crm-dashboard-alert--lifecycle,
.crm-payix-dashboard .crm-dashboard-alert--overdue,
.crm-payix-dashboard .crm-tasks-banner--overdue {
    background: hsl(var(--card)) !important;
    color: hsl(var(--foreground)) !important;
    border-color: hsl(var(--border)) !important;
    box-shadow:
        0 4px 20px -4px hsl(var(--foreground) / 0.08),
        0 8px 40px -8px hsl(var(--payix-purple) / 0.10) !important;
    animation: none !important;
}

.crm-payix .crm-counter-card--alert,
.crm-payix .crm-counter-card.is-active,
.crm-payix-dashboard .crm-counter-card--alert,
.crm-payix-dashboard .crm-counter-card.is-active {
    box-shadow:
        0 4px 20px -4px hsl(var(--foreground) / 0.08),
        0 8px 40px -8px hsl(var(--payix-purple) / 0.10) !important;
}

/* Section titles and labels (remove uppercase tracking-wide) */
.crm-payix .crm-dashboard-section__title,
.crm-payix .crm-section-title,
.crm-payix-dashboard .crm-dashboard-section__title,
.crm-payix-dashboard .crm-section-title {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: hsl(var(--foreground)) !important;
}

.crm-payix .crm-counter-card__label,
.crm-payix .crm-stat-card__label,
.crm-payix .crm-dashboard-action-card__label,
.crm-payix-dashboard .crm-counter-card__label,
.crm-payix-dashboard .crm-stat-card__label,
.crm-payix-dashboard .crm-dashboard-action-card__label {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: hsl(var(--muted-foreground)) !important;
}

.crm-payix .crm-counter-card__value,
.crm-payix .crm-stat-card__value,
.crm-payix .crm-dashboard-action-card__value,
.crm-payix-dashboard .crm-counter-card__value,
.crm-payix-dashboard .crm-stat-card__value,
.crm-payix-dashboard .crm-dashboard-action-card__value {
    font-weight: 600 !important;
    color: hsl(var(--foreground)) !important;
}

/* KPI grids like Payix SummaryCards (1 -> 2 -> 3) */
.crm-payix .crm-kpi-grid--payix,
.crm-payix .crm-dashboard-workload__grid,
.crm-payix .crm-dashboard-action-grid,
.crm-payix-dashboard .crm-kpi-grid--payix,
.crm-payix-dashboard .crm-dashboard-workload__grid,
.crm-payix-dashboard .crm-dashboard-action-grid {
    gap: 1rem !important;
    grid-template-columns: 1fr !important;
}

@media (min-width: 640px) {
    .crm-payix .crm-dashboard-workload__grid,
    .crm-payix .crm-dashboard-action-grid,
    .crm-payix-dashboard .crm-dashboard-workload__grid,
    .crm-payix-dashboard .crm-dashboard-action-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 768px) {
    .crm-payix .crm-kpi-grid--payix,
    .crm-payix-dashboard .crm-kpi-grid--payix {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    .crm-payix .crm-dashboard-workload__grid,
    .crm-payix .crm-dashboard-action-grid,
    .crm-payix-dashboard .crm-dashboard-workload__grid,
    .crm-payix-dashboard .crm-dashboard-action-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

.crm-payix .crm-dashboard-page,
.crm-payix-dashboard .crm-dashboard-page {
    gap: 1.25rem !important;
}

/* Stat card label+icon row (mirrors Payix) */
.crm-payix .crm-stat-card__top,
.crm-payix-dashboard .crm-stat-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.crm-payix .crm-stat-card__icon svg,
.crm-payix-dashboard .crm-stat-card__icon svg {
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.45;
}

.crm-payix .crm-counter-card__top,
.crm-payix .crm-dashboard-action-card__top,
.crm-payix-dashboard .crm-counter-card__top,
.crm-payix-dashboard .crm-dashboard-action-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.crm-payix .crm-counter-card__icon svg,
.crm-payix .crm-dashboard-action-card__icon svg,
.crm-payix-dashboard .crm-counter-card__icon svg,
.crm-payix-dashboard .crm-dashboard-action-card__icon svg {
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.45;
}

.crm-payix .crm-counter-card__icon--danger,
.crm-payix .crm-dashboard-action-card__icon--danger,
.crm-payix .crm-dashboard-action-card__icon--warning,
.crm-payix-dashboard .crm-counter-card__icon--danger,
.crm-payix-dashboard .crm-dashboard-action-card__icon--danger,
.crm-payix-dashboard .crm-dashboard-action-card__icon--warning {
    color: hsl(var(--payix-orange)) !important;
}

.crm-payix .crm-counter-card--done .crm-counter-card__icon,
.crm-payix-dashboard .crm-counter-card--done .crm-counter-card__icon {
    color: hsl(var(--payix-green)) !important;
}

.crm-payix .crm-counter-card__icon--muted,
.crm-payix .crm-dashboard-action-card__icon--muted,
.crm-payix-dashboard .crm-counter-card__icon--muted,
.crm-payix-dashboard .crm-dashboard-action-card__icon--muted {
    color: hsl(var(--muted-foreground)) !important;
}

.crm-payix .crm-dashboard-toggle .crm-btn.is-active,
.crm-payix-dashboard .crm-dashboard-toggle .crm-btn.is-active {
    outline: 2px solid hsl(var(--payix-purple) / 0.35) !important;
    outline-offset: 1px !important;
}

.crm-payix .crm-dashboard-activity__chart,
.crm-payix-dashboard .crm-dashboard-activity__chart {
    height: 18rem !important;
}

.crm-payix .crm-dashboard-activity__stats-wrap,
.crm-payix-dashboard .crm-dashboard-activity__stats-wrap {
    background: hsl(var(--muted) / 0.3) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 0.75rem !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
}

.crm-payix .crm-dashboard-activity__stats,
.crm-payix-dashboard .crm-dashboard-activity__stats {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
}

@media (min-width: 640px) {
    .crm-payix .crm-dashboard-activity__stats,
    .crm-payix-dashboard .crm-dashboard-activity__stats {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.crm-payix .crm-dashboard-activity__value,
.crm-payix-dashboard .crm-dashboard-activity__value {
    font-weight: 600 !important;
}

.crm-payix .crm-dashboard-activity__legend,
.crm-payix-dashboard .crm-dashboard-activity__legend {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1.5rem !important;
    padding-top: 0.75rem !important;
    color: hsl(var(--muted-foreground)) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.crm-payix .crm-dashboard-activity__legend-item,
.crm-payix-dashboard .crm-dashboard-activity__legend-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.crm-payix .crm-dashboard-activity__swatch,
.crm-payix-dashboard .crm-dashboard-activity__swatch {
    width: 1rem;
    height: 0.125rem;
    border-radius: 999px;
}

.crm-payix .crm-dashboard-activity__swatch--in,
.crm-payix-dashboard .crm-dashboard-activity__swatch--in { background: hsl(var(--payix-purple)); }
.crm-payix .crm-dashboard-activity__swatch--out,
.crm-payix-dashboard .crm-dashboard-activity__swatch--out { background: hsl(var(--payix-orange)); }

/* Payix primitives (all CRM pages) */
.crm-payix .crm-btn--outline:hover {
    background: hsl(var(--muted) / 0.5) !important;
}

.crm-payix .crm-btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple)) !important;
}

.crm-payix .crm-table th {
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.crm-payix .crm-table tbody tr:hover {
    background: hsl(var(--muted) / 0.3) !important;
}

/* �� Inventory ? Agreement integration (Phase 4 Task 5) �� */
.crm-occupancy-badge {
    /* inherits shared chip base when combined with .crm-lead-badge */
}

.crm-occupancy-badge.crm-lead-badge--dot.crm-occupancy-badge--blue { --chip-dot: hsl(217 80% 56%); }
.crm-occupancy-badge.crm-lead-badge--dot.crm-occupancy-badge--orange { --chip-dot: hsl(25 90% 52%); }
.crm-occupancy-badge.crm-lead-badge--dot.crm-occupancy-badge--red { --chip-dot: hsl(0 72% 51%); }
.crm-occupancy-badge.crm-lead-badge--neutral { /* plain gray */ }

.crm-occupancy-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-occupancy-legend__label {
    font-size: 0.8125rem;
}

.crm-occupancy-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-occupancy-panel__quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 390px) {
    .crm-occupancy-panel__quick-actions .crm-btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.crm-occupancy-badge__link {
    color: inherit;
    text-decoration: underline;
}

.crm-occupancy-badge__days {
    font-weight: 500;
    opacity: 0.85;
}

.crm-occupancy-panel__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-agreement-summary-card {
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.2);
}

.crm-agreement-summary-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-agreement-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-agreement-history-list li {
    padding: 0.375rem 0;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
}

/* Phase 5 � Super Admin executive dashboard */
.crm-super-dashboard__filter-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid hsl(var(--payix-green) / 0.35);
    border-radius: var(--radius);
    background: hsl(var(--payix-green) / 0.08);
    font-size: 0.875rem;
}

.crm-super-dashboard__filters {
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.crm-super-dashboard__filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.crm-kpi-grid--super {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-kpi-grid--dense {
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .crm-kpi-grid--super {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .crm-kpi-grid--super {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .crm-kpi-grid--dense {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-kpi-trend-card {
    padding: 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 6.5rem;
}

.crm-kpi-trend-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
}

.crm-kpi-trend-card__value {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.1;
    color: hsl(var(--foreground));
}

.crm-kpi-trend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.crm-kpi-trend__hint {
    font-weight: 400;
    color: hsl(var(--muted-foreground));
}

.crm-kpi-trend--up { color: hsl(var(--payix-green)); }
.crm-kpi-trend--down { color: rgb(185 28 28); }
.crm-kpi-trend--neutral { color: hsl(var(--muted-foreground)); }

.crm-super-city-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .crm-super-city-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .crm-super-city-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.crm-super-city-card {
    padding: 1rem 1.125rem;
}

.crm-super-city-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.crm-super-city-card__name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.crm-super-city-card__stats,
.crm-super-city-card__line,
.crm-super-city-card__performer {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.45;
}

.crm-super-city-card__performer {
    margin-top: 0.5rem;
    color: hsl(var(--foreground));
    font-weight: 500;
}

.crm-super-charts-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-super-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-analytics-chart-card {
    padding: 1rem;
    min-height: 16rem;
}

.crm-analytics-chart-card__title {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.crm-analytics-chart-card__canvas-wrap {
    position: relative;
    width: 100%;
}

.crm-analytics-chart-card__locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 10rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.crm-super-dashboard__split {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1100px) {
    .crm-super-dashboard__split {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: start;
    }
}

.crm-super-activity-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-super-activity-feed__item {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-super-activity-feed__item:last-child {
    border-bottom: none;
}

.crm-super-activity-feed__icon {
    color: hsl(var(--payix-green));
    font-weight: 700;
    line-height: 1.4;
}

.crm-super-activity-feed__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.crm-super-activity-feed__meta {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.crm-table--compact th,
.crm-table--compact td {
    padding: 0.5rem 0.65rem;
    font-size: 0.8125rem;
}

@media (max-width: 767px) {
    .crm-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .crm-super-dashboard__filter-form .crm-form-group {
        flex: 1 1 100%;
    }
}

/* Phase 5 � City Admin enhanced dashboard */
.crm-kpi-grid--city {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .crm-kpi-grid--city {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-city-monitor-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .crm-city-monitor-grid {
        grid-template-columns: 1fr;
    }
}

.crm-city-monitor-card {
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
}

.crm-city-monitor-card--danger .crm-city-monitor-card__value {
    color: rgb(185 28 28);
}

.crm-city-monitor-card--warning .crm-city-monitor-card__value {
    color: rgb(194 65 12);
}

.crm-city-monitor-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.crm-city-monitor-card__label {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.crm-city-monitor-panels {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .crm-city-monitor-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-city-panel {
    padding: 1rem 1.125rem;
}

.crm-city-panel__list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.crm-city-panel__list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
}

.crm-city-panel__list li:last-child {
    border-bottom: none;
}

.crm-city-panel__list a {
    color: hsl(var(--foreground));
    text-decoration: none;
    font-weight: 500;
}

.crm-city-panel__list a:hover {
    color: hsl(var(--payix-green));
}

.crm-city-funnel-layout {
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .crm-city-funnel-layout {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
}

.crm-city-funnel-bars {
    padding: 1rem;
}

.crm-city-funnel-row {
    margin-bottom: 0.75rem;
}

.crm-city-funnel-row:last-child {
    margin-bottom: 0;
}

.crm-city-funnel-row__label {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 0.35rem;
}

.crm-city-funnel-row__count {
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}

.crm-city-funnel-row__track {
    height: 0.5rem;
    background: hsl(var(--muted) / 0.5);
    border-radius: 999px;
    overflow: hidden;
}

.crm-city-funnel-row__bar {
    height: 100%;
    border-radius: 999px;
    min-width: 4px;
}

.crm-city-expiry-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-city-expiry-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--border));
}

.crm-city-expiry-list__item:last-child {
    border-bottom: none;
}

.crm-city-expiry-list__days {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(194 65 12);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-city-expiry-list__title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.15rem;
}

.crm-city-expiry-list__meta {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.crm-city-expiry-list__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Notifications — UIUX.md §6.2 admin dropdown */
.crm-notification-bell {
    position: relative;
    z-index: 60;
}

.crm-notification-bell__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.crm-notification-bell__trigger:hover,
.crm-notification-bell__trigger--active {
    background: hsl(var(--muted) / 0.7);
}

.crm-notification-bell__trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--payix-purple) / 0.45);
}

.crm-notification-bell__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.crm-notification-bell__dot {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: hsl(var(--payix-orange));
    box-shadow: 0 0 0 2px hsl(var(--background));
}

.crm-notification-bell__backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
    border: none;
    background: hsl(222 47% 11% / 0.28);
    backdrop-filter: blur(2px);
    cursor: default;
    animation: crm-notification-fade-in 0.18s ease;
}

.crm-notification-bell__dropdown {
    position: absolute;
    top: calc(100% + 0.625rem);
    right: 0;
    z-index: 51;
    width: min(24rem, calc(100vw - 2rem));
    max-height: min(25rem, 70vh);
    display: flex;
    flex-direction: column;
    border: 1px solid hsl(var(--border));
    border-radius: 0.875rem;
    background: hsl(var(--card));
    box-shadow: 0 20px 50px hsl(220 20% 10% / 0.12), 0 4px 12px hsl(220 20% 10% / 0.06);
    overflow: hidden;
    animation: crm-notification-panel-in 0.2s ease;
}

@keyframes crm-notification-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes crm-notification-panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.crm-notification-bell__dropdown-header,
.crm-notification-bell__dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.8125rem;
    background: hsl(var(--muted) / 0.35);
    flex-shrink: 0;
}

.crm-notification-bell__header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.crm-notification-bell__header-title strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.crm-notification-bell__unread-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: hsl(var(--payix-orange) / 0.12);
    color: hsl(var(--payix-orange));
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-notification-bell__mark-all {
    border: none;
    background: transparent;
    color: hsl(var(--payix-purple));
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.375rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.crm-notification-bell__mark-all:hover {
    background: hsl(var(--payix-purple) / 0.08);
}

.crm-notification-bell__dropdown-footer {
    border-bottom: none;
    border-top: 1px solid hsl(var(--border));
    justify-content: center;
    background: hsl(var(--background));
}

.crm-notification-bell__view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.crm-notification-bell__view-all:hover {
    background: hsl(var(--muted) / 0.5);
    border-color: hsl(var(--muted-foreground) / 0.25);
}

.crm-notification-bell__list {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
    scrollbar-width: thin;
}

.crm-notification-bell__item {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid hsl(var(--border));
    border-left: 3px solid transparent;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    transition: background-color 0.15s ease;
}

.crm-notification-bell__item:hover {
    background: hsl(var(--muted) / 0.4);
}

.crm-notification-bell__item--unread {
    background: hsl(var(--muted) / 0.22);
    border-left-color: hsl(var(--payix-orange));
}

.crm-notification-bell__item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    flex-shrink: 0;
    color: #fff;
}

.crm-notification-bell__item-icon-svg {
    width: 1rem;
    height: 1rem;
    color: inherit;
    stroke: currentColor;
}

.crm-notification-tone--info .crm-notification-bell__item-icon {
    background: hsl(217 91% 55%);
}

.crm-notification-tone--warning .crm-notification-bell__item-icon {
    background: hsl(var(--payix-orange));
}

.crm-notification-tone--danger .crm-notification-bell__item-icon {
    background: hsl(0 72% 50%);
}

.crm-notification-tone--success .crm-notification-bell__item-icon {
    background: hsl(var(--payix-green));
}

.crm-notification-tone--muted .crm-notification-bell__item-icon {
    background: hsl(220 10% 55%);
}

/* Full-page notification list still uses pastel chips */
.crm-notification-tone__chip {
    border: 1px solid transparent;
}

.crm-notification-tone--info .crm-notification-tone__chip {
    background: hsl(217 91% 96%);
    color: hsl(217 91% 40%);
    border-color: hsl(217 91% 88%);
}

.crm-notification-tone--warning .crm-notification-tone__chip {
    background: hsl(38 92% 95%);
    color: hsl(32 95% 38%);
    border-color: hsl(38 92% 85%);
}

.crm-notification-tone--danger .crm-notification-tone__chip {
    background: hsl(0 84% 96%);
    color: hsl(0 72% 42%);
    border-color: hsl(0 84% 88%);
}

.crm-notification-tone--success .crm-notification-tone__chip {
    background: hsl(142 76% 95%);
    color: hsl(142 64% 32%);
    border-color: hsl(142 76% 85%);
}

.crm-notification-tone--muted .crm-notification-tone__chip {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
}

.crm-notification-tone--info.crm-notification-item--unread { border-left-color: hsl(217 91% 45%); }
.crm-notification-tone--warning.crm-notification-item--unread { border-left-color: hsl(32 95% 44%); }
.crm-notification-tone--danger.crm-notification-item--unread { border-left-color: hsl(0 72% 46%); }
.crm-notification-tone--success.crm-notification-item--unread { border-left-color: hsl(142 64% 36%); }

.crm-notification-bell__item-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.crm-notification-bell__item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.crm-notification-bell__item-type {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
}

.crm-notification-bell__item-title {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    color: hsl(var(--foreground));
}

.crm-notification-bell__item-unread-dot {
    width: 0.375rem;
    height: 0.375rem;
    margin-top: 0.35rem;
    border-radius: 9999px;
    background: hsl(var(--payix-orange));
    flex-shrink: 0;
}

.crm-notification-bell__item-meta {
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
    flex-shrink: 0;
}

.crm-notification-bell__item-text {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crm-notification-bell__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.25rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.crm-notification-empty__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.75rem;
    border-radius: 9999px;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.crm-notification-empty__icon-wrap .crm-notification-empty__icon,
.crm-notification-empty__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.crm-notification-empty__title {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.crm-notification-empty__text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    max-width: 16rem;
}

.crm-notification-empty--center {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.crm-notification-center__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.crm-notification-center__summary-text {
    min-width: 0;
}

.crm-notification-center__mark-all {
    flex-shrink: 0;
    align-self: center;
    white-space: nowrap;
    min-height: 2.5rem;
    box-sizing: border-box;
}

.crm-notification-center__heading {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
}

.crm-notification-center__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.crm-filter-tabs--pill .crm-filter-tab {
    border-radius: 999px;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.crm-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.crm-filter-tab {
    padding: 0.4375rem 0.875rem;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--background));
    font-size: 0.8125rem;
    line-height: 1;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
}

.crm-filter-tab.is-active {
    border-color: hsl(var(--payix-green));
    background: hsl(var(--payix-green) / 0.1);
    color: hsl(var(--foreground));
    font-weight: 600;
}

.crm-notification-center__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.crm-notification-center__toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.5rem;
}

.crm-notification-center__toolbar-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

.crm-notification-center__type-filter {
    margin-left: auto;
}

.crm-notification-center__type-select {
    min-width: 11.5rem;
    height: 2.5rem;
    margin: 0;
}

.crm-notification-center__list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.crm-notification-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem 1.25rem;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    border-left: 3px solid transparent;
    transition: background 0.15s ease;
}

.crm-notification-item:last-child {
    border-bottom: none;
}

.crm-notification-item--unread {
    background: hsl(var(--muted) / 0.14);
    border-left-color: hsl(var(--payix-green));
}

.crm-notification-item__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
}

.crm-notification-item__icon-svg {
    width: 1.125rem;
    height: 1.125rem;
}

.crm-notification-item__content {
    min-width: 0;
}

.crm-notification-item__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 0.35rem;
}

.crm-notification-item__main {
    min-width: 0;
    flex: 1;
}

.crm-notification-item__type-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
}

.crm-notification-item__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: hsl(var(--foreground));
    min-width: 0;
    flex: 1;
}

.crm-notification-item__time {
    flex-shrink: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}

.crm-notification-item__text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: hsl(var(--muted-foreground));
}

.crm-notification-item__expand {
    margin-top: 0.35rem;
}

.crm-notification-item__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
    align-self: center;
}

.crm-notification-item__action-btn {
    box-sizing: border-box;
    min-width: 5.75rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.875rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-width: 1px;
}

@media (max-width: 768px) {
    .crm-notification-center__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-notification-center__type-filter {
        margin-left: 0;
    }

    .crm-notification-center__toolbar-group {
        flex-wrap: wrap;
    }

    .crm-notification-center__type-select {
        flex: 1;
        min-width: 0;
    }

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

    .crm-notification-item__actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: flex-end;
        padding-left: calc(2.5rem + 1rem);
        align-self: stretch;
    }

    .crm-notification-item__title-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .crm-topbar__actions {
        flex-wrap: wrap;
    }

    .crm-notification-bell__dropdown {
        right: -0.5rem;
        width: min(20rem, calc(100vw - 1.5rem));
    }

    .crm-notification-center__summary {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-notification-center__mark-all {
        width: 100%;
        justify-content: center;
    }

    .crm-notification-item__actions {
        padding-left: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .crm-notification-item__action-btn {
        width: 100%;
    }
}

/* Phase 5 � Automation job history */
.crm-job-run-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.crm-job-run-form {
    margin: 0;
}

.crm-badge--success {
    background: hsl(var(--payix-green) / 0.15);
    color: hsl(var(--payix-green));
}

.crm-badge--danger {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
}

.crm-badge--info {
    background: hsl(217 91% 95%);
    color: hsl(217 91% 40%);
}

.crm-dialog {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    max-width: 32rem;
}

@media (max-width: 640px) {
    .crm-city-expiry-list__item {
        flex-direction: column;
        align-items: flex-start;
    }

    .crm-city-expiry-list__actions {
        width: 100%;
    }

    .crm-city-expiry-list__actions .crm-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Phase 5 Task 6 � Revenue analytics dashboard */
.crm-revenue-dashboard__filters {
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
}

.crm-revenue-dashboard__filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.crm-kpi-grid--revenue {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .crm-kpi-grid--revenue {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-revenue-kpi-card {
    padding: 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 5.5rem;
}

.crm-revenue-kpi-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

.crm-revenue-kpi-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: hsl(var(--foreground));
}

.crm-revenue-charts-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-revenue-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-revenue-breakdown-grid,
.crm-revenue-contributors-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-revenue-breakdown-grid,
    .crm-revenue-contributors-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.crm-revenue-breakdown-card {
    padding: 1rem 1.125rem;
}

.crm-revenue-breakdown-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.crm-revenue-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-revenue-breakdown-list__item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid hsl(var(--border) / 0.6);
    padding-bottom: 0.5rem;
}

.crm-revenue-breakdown-list__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.crm-revenue-breakdown-list__label {
    font-weight: 500;
}

.crm-revenue-breakdown-list__meta {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: hsl(var(--foreground));
}

.crm-revenue-breakdown-list__count {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-weight: 400;
}

.crm-revenue-table-wrap {
    padding: 0;
    overflow: hidden;
}

.crm-revenue-table-wrap .crm-table-responsive {
    overflow-x: auto;
}

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

.crm-revenue-table-wrap .crm-pagination-wrap {
    padding: 0.75rem 1rem;
    border-top: 1px solid hsl(var(--border));
}

@media (max-width: 640px) {
    .crm-revenue-dashboard__filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-kpi-grid--revenue {
        grid-template-columns: 1fr;
    }
}

/* Phase 5 Task 7 � Staff analytics */
.crm-staff-analytics__filters {
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
}

.crm-staff-analytics__filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.crm-kpi-grid--staff {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .crm-kpi-grid--staff {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-staff-kpi-card {
    padding: 1rem 1.125rem;
}

.crm-staff-kpi-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.35rem;
}

.crm-staff-kpi-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.crm-staff-charts-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-staff-charts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.crm-staff-leaderboards-grid,
.crm-staff-rankings-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-staff-leaderboards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-staff-rankings-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.crm-staff-leaderboard-card {
    padding: 1rem 1.125rem;
}

.crm-staff-leaderboard-card__title,
.crm-staff-ranking-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.crm-staff-leaderboard-list,
.crm-staff-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-staff-leaderboard-row,
.crm-staff-ranking-list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.crm-staff-leaderboard-row__rank,
.crm-staff-ranking-list__rank {
    width: 1.5rem;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
}

.crm-staff-leaderboard-row__body {
    flex: 1;
    min-width: 0;
}

.crm-staff-leaderboard-row__meta,
.crm-staff-ranking-list__name {
    display: block;
}

.crm-staff-leaderboard-row__meta {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-staff-leaderboard-row__value,
.crm-staff-ranking-list__value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.crm-staff-ranking-card {
    padding: 1rem 1.125rem;
}

.crm-staff-ranking-list__item {
    justify-content: space-between;
    border-bottom: 1px solid hsl(var(--border) / 0.6);
    padding-bottom: 0.5rem;
}

.crm-staff-table-wrap {
    padding: 0;
    overflow: hidden;
}

.crm-staff-performance-table__expand td {
    background: hsl(var(--muted) / 0.35);
}

.crm-staff-performance-table__expand-inner {
    padding: 1rem;
}

.crm-staff-performance-table__expand-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.crm-staff-trend-mini {
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

.crm-staff-metrics-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
    .crm-staff-metrics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-staff-metric-tile {
    padding: 1rem 1.125rem;
}

.crm-staff-metric-tile__label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.25rem;
}

.crm-staff-metric-tile__value {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.crm-staff-metric-tile__meta {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin: 0.35rem 0 0;
}

.crm-text-danger {
    color: rgb(185 28 28);
    font-weight: 600;
}

.crm-page-header--compact {
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .crm-staff-analytics__filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-kpi-grid--staff {
        grid-template-columns: 1fr;
    }

    .crm-staff-metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Phase 5 Task 10 � City expansion */
.crm-onboarding-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.crm-onboarding-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 0.8125rem;
    background: hsl(var(--card));
}

.crm-onboarding-step.is-active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.06);
}

.crm-onboarding-step.is-complete .crm-onboarding-step__number {
    background: hsl(142 76% 36% / 0.15);
    color: hsl(142 76% 30%);
}

.crm-onboarding-step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
    background: hsl(var(--muted));
}

.crm-city-onboarding__layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 1000px) {
    .crm-city-onboarding__layout {
        grid-template-columns: 1.4fr 0.9fr;
        align-items: start;
    }
}

.crm-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.crm-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.crm-textarea {
    width: 100%;
    min-height: 5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
}

.crm-readiness-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.crm-readiness-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.crm-readiness-card__score {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.crm-readiness-card__checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-readiness-check {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.875rem;
}

.crm-readiness-check.is-passed .crm-readiness-check__icon {
    color: hsl(142 76% 36%);
}

.crm-readiness-check__detail {
    width: 100%;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-readiness-card--ready {
    border-left: 3px solid hsl(142 76% 36%);
}

.crm-readiness-card--partial {
    border-left: 3px solid hsl(38 92% 50%);
}

.crm-readiness-card--setup {
    border-left: 3px solid hsl(var(--muted-foreground));
}

.crm-readiness-card--compact {
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.crm-readiness-card--compact .crm-readiness-card__checks {
    gap: 0.35rem;
}

.crm-onboarding-credentials {
    background: hsl(var(--muted) / 0.35);
    padding: 1rem;
}

.crm-comparison-table__best {
    background: hsl(142 76% 36% / 0.12);
    font-weight: 600;
}

.crm-comparison-meta-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.crm-comparison-meta-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.crm-multi-admin-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .crm-multi-admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-multi-admin-card__name {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.crm-multi-admin-card__list {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.875rem;
}

.crm-lead-assignment-panel .crm-form-grid {
    gap: 1rem;
}

.crm-expansion-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-expansion-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-expansion-city-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.crm-expansion-city-card__header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.crm-expansion-city-card__code {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin: 0.25rem 0 0.75rem;
}

.crm-expansion-city-card__score {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.crm-expansion-city-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.crm-tag--success {
    background: hsl(142 76% 36% / 0.15);
    color: hsl(142 76% 30%);
}

.crm-tag--muted {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.crm-mt-6 {
    margin-top: 1.5rem;
}

.crm-mb-4 {
    margin-bottom: 1rem;
}

/* Phase 5 Task 9 � Export actions */
.crm-page-header-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.crm-export-actions {
    flex-shrink: 0;
}

/* Phase 5 Task 8 � Lead analytics */
.crm-lead-analytics__filters {
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
}

.crm-lead-analytics__filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.crm-kpi-grid--lead {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .crm-kpi-grid--lead {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-lead-kpi-card {
    padding: 1rem 1.125rem;
}

.crm-lead-kpi-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.35rem;
}

.crm-lead-kpi-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.crm-lead-funnel-card {
    padding: 1rem 1.125rem;
}

.crm-lead-funnel-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.crm-lead-funnel-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .crm-lead-funnel-layout {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
}

.crm-lead-analytics-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.crm-lead-analytics-grid--wide {
    margin-top: 1rem;
}

@media (min-width: 900px) {
    .crm-lead-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-lead-analytics-charts {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
}

@media (min-width: 900px) {
    .crm-lead-analytics-charts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-lead-source-card {
    padding: 1rem 1.125rem;
}

.crm-lead-source-card__title,
.crm-lead-trend-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.crm-lead-source-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-lead-source-list__item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid hsl(var(--border) / 0.6);
    padding-bottom: 0.5rem;
}

.crm-lead-source-list__meta {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.crm-lead-conversion-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .crm-lead-conversion-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.crm-lead-conversion-tile {
    padding: 1rem 1.125rem;
}

.crm-lead-conversion-tile__label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.25rem;
}

.crm-lead-conversion-tile__value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.crm-lead-conversion-tile__meta {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin: 0.35rem 0 0;
}

.crm-lead-trend-card {
    padding: 1rem 1.125rem;
}

.crm-lead-trend-card--table {
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .crm-lead-analytics__filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-kpi-grid--lead {
        grid-template-columns: 1fr;
    }
}

/* Phase 5 QA � responsive hardening (375�768px) */
@media (max-width: 768px) {
    .crm-onboarding-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-onboarding-step {
        width: 100%;
    }

    .crm-comparison-meta-grid,
    .crm-expansion-grid {
        grid-template-columns: 1fr;
    }

    .crm-expansion-city-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-expansion-city-card__actions .crm-btn {
        width: 100%;
        justify-content: center;
    }

    .crm-page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .crm-page-header-row__actions {
        width: 100%;
    }

    .crm-analytics-chart-card__canvas-wrap {
        min-height: 200px;
        max-height: 280px;
    }

    .crm-revenue-dashboard__filter-row,
    .crm-staff-performance__filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-notification-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-notification-filters .crm-select,
    .crm-notification-filters .crm-btn {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .crm-kpi-grid--lead,
    .crm-revenue-charts-grid,
    .crm-lead-conversion-grid {
        grid-template-columns: 1fr;
    }
}


/* Alpine cloak � hide until Alpine.js initialises */
[x-cloak] { display: none !important; }

/* Lead Creation Type Badges — neutral chips (see shared chip base above) */
.crm-badge--creation-website,
.crm-badge--creation-walking,
.crm-badge--creation-property {
    /* uses shared neutral chip styling */
}

/* Client cards */
.crm-client-card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.25rem;
    background: hsl(var(--card));
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.crm-client-card:hover {
    border-color: hsl(var(--border) / 0.85);
    box-shadow:
        0 4px 16px -4px hsl(var(--foreground) / 0.06),
        0 2px 8px -2px hsl(var(--foreground) / 0.04);
}

.crm-client-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.625rem;
}

.crm-client-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
}

.crm-client-card__name:hover {
    color: hsl(var(--payix-purple));
}

.crm-client-card__phone {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.125rem;
}

.crm-client-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: flex-end;
    align-items: center;
}

.crm-client-card__meta {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.45;
    margin-bottom: 0.375rem;
}

.crm-client-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
    font-size: 0.8125rem;
}

.crm-client-card__assignee {
    color: hsl(var(--muted-foreground));
}

/* Lead score badge (list + detail) */
.crm-lead-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    background: hsl(var(--muted) / 0.7);
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

.crm-lead-score-badge::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--score-dot, hsl(var(--muted-foreground)));
    flex: none;
}

.crm-lead-score-badge--compact {
    padding: 0.1875rem 0.45rem;
    font-size: 0.75rem;
}

.crm-lead-score-badge--hot { --score-dot: hsl(142 60% 42%); }
.crm-lead-score-badge--warm { --score-dot: hsl(25 90% 52%); }
.crm-lead-score-badge--cold { --score-dot: hsl(217 80% 56%); }

.crm-lead-score-badge__band {
    font-weight: 500;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: hsl(var(--muted-foreground));
}

/* Dashboard hero KPI row */
.crm-dashboard-hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .crm-dashboard-hero__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .crm-dashboard-hero__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

.crm-dashboard-hero__card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px -4px hsl(var(--foreground) / 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left-width: 4px;
}

.crm-dashboard-hero__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -6px hsl(var(--foreground) / 0.12);
}

.crm-dashboard-hero__card--purple { border-left-color: hsl(var(--payix-purple)); background: linear-gradient(135deg, hsl(var(--payix-purple-light)) 0%, hsl(var(--card)) 55%); }
.crm-dashboard-hero__card--green { border-left-color: hsl(var(--payix-green)); background: linear-gradient(135deg, hsl(145 60% 96%) 0%, hsl(var(--card)) 55%); }
.crm-dashboard-hero__card--orange { border-left-color: hsl(var(--payix-orange)); background: linear-gradient(135deg, hsl(25 90% 96%) 0%, hsl(var(--card)) 55%); }
.crm-dashboard-hero__card--blue { border-left-color: hsl(217 91% 55%); background: linear-gradient(135deg, hsl(217 91% 96%) 0%, hsl(var(--card)) 55%); }

.crm-dashboard-hero__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.crm-dashboard-hero__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.crm-dashboard-hero__icon--purple { background: hsl(var(--payix-purple) / 0.12); color: hsl(var(--payix-purple)); }
.crm-dashboard-hero__icon--green { background: hsl(var(--payix-green) / 0.12); color: hsl(var(--payix-green)); }
.crm-dashboard-hero__icon--orange { background: hsl(var(--payix-orange) / 0.12); color: hsl(var(--payix-orange)); }
.crm-dashboard-hero__icon--blue { background: hsl(217 91% 92%); color: hsl(217 91% 45%); }

.crm-dashboard-hero__content {
    min-width: 0;
}

.crm-dashboard-hero__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: hsl(var(--foreground));
}

.crm-dashboard-hero__label {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.crm-dashboard-hero__hint {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

/* Quick action buttons */
.crm-dashboard-quick-actions__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .crm-dashboard-quick-actions__grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

.crm-quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 6.5rem;
    padding: 1rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.crm-quick-action-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px -6px hsl(var(--foreground) / 0.12);
    border-color: hsl(var(--payix-purple) / 0.35);
}

.crm-quick-action-btn--primary {
    background: linear-gradient(135deg, hsl(var(--payix-purple-light)) 0%, hsl(var(--card)) 100%);
    border-color: hsl(var(--payix-purple) / 0.25);
}

.crm-quick-action-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.crm-quick-action-btn--primary .crm-quick-action-btn__icon {
    background: hsl(var(--payix-purple) / 0.12);
    color: hsl(var(--payix-purple));
}

.crm-quick-action-btn__icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.crm-quick-action-btn__label {
    font-size: 0.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.crm-quick-action-btn__hint {
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
}

/* Workload counter accent borders */
.crm-counter-card--accent-green {
    border-left: 4px solid hsl(var(--payix-green));
}

.crm-counter-card--accent-orange {
    border-left: 4px solid hsl(var(--payix-orange));
}

.crm-counter-card--accent-red {
    border-left: 4px solid hsl(var(--destructive));
}

.crm-counter-card--accent-green .crm-counter-card__value,
.crm-counter-card--accent-orange .crm-counter-card__value,
.crm-counter-card--accent-red .crm-counter-card__value {
    font-size: 2.125rem;
    font-weight: 800;
}

/* Feature chips (parameters, nearby) */
.crm-feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.crm-feature-chip--nearby {
    background: hsl(var(--payix-purple-light));
    border-color: hsl(var(--payix-purple) / 0.15);
}

.crm-feature-chip__name {
    font-weight: 600;
    color: hsl(var(--muted-foreground));
}

.crm-feature-chip__name::after {
    content: ':';
}

.crm-feature-chip--nearby .crm-feature-chip__name::before {
    content: '•';
    margin-right: 0.25rem;
    color: hsl(var(--payix-purple));
}

.crm-feature-chip--nearby .crm-feature-chip__name::after {
    content: '';
}

.crm-feature-chip__value {
    font-weight: 600;
    color: hsl(var(--foreground));
}

.crm-feature-chip__value a {
    color: inherit;
    text-decoration: none;
}

.crm-feature-chip__value a:hover {
    text-decoration: underline;
}
