@import url('../assets/css/global.css');

:root {
    --crm-surface: rgba(8, 11, 15, 0.88);
    --crm-surface-strong: rgba(5, 8, 16, 0.96);
    --crm-surface-soft: rgba(18, 23, 35, 0.78);
    --crm-border: rgba(201, 176, 55, 0.16);
    --crm-border-strong: rgba(201, 176, 55, 0.32);
    --crm-text-soft: rgba(255, 255, 255, 0.68);
    --crm-text-muted: rgba(255, 255, 255, 0.4);
    --crm-accent: #d8c49a;
    --crm-accent-strong: #bda46d;
    --crm-success: #4caf7c;
    --crm-warning: #e2b866;
    --crm-danger: #f16f6f;
    --crm-info: #77b7ff;
    --crm-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --crm-page-background:
        radial-gradient(circle at top right, rgba(201, 176, 55, 0.11), transparent 28%),
        radial-gradient(circle at bottom left, rgba(35, 73, 136, 0.16), transparent 26%),
        linear-gradient(180deg, rgba(10, 13, 19, 0.98) 0%, rgba(5, 8, 16, 1) 100%);
}

.calendar-page {
    display: grid;
    gap: 1.4rem;
}

.calendar-hero {
    position: relative;
}

.calendar-hero-split {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    min-height: 420px;
    border-radius: 28px;
    overflow-x: clip;
    border: 1px solid rgba(201, 176, 55, 0.28);
    border-top: 3px solid var(--primary-gold);
    background:
        radial-gradient(circle at top left, rgba(201, 176, 55, 0.1), transparent 34%),
        linear-gradient(140deg, rgba(8, 11, 15, 0.98) 0%, rgba(5, 8, 16, 0.98) 100%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.calendar-hero-photo-panel,
.calendar-hero-content-panel {
    position: relative;
    overflow-x: clip;
}

.calendar-hero-photo-panel {
    background:
        radial-gradient(circle at 24% 18%, rgba(201, 176, 55, 0.17), transparent 24%),
        radial-gradient(circle at 78% 72%, rgba(119, 183, 255, 0.12), transparent 26%),
        linear-gradient(180deg, rgba(8, 11, 15, 0.96) 0%, rgba(5, 8, 16, 0.98) 100%);
}

.calendar-hero-photo-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 0%, transparent 34%),
        linear-gradient(to top, rgba(201, 176, 55, 0.12) 0%, transparent 42%);
    pointer-events: none;
}

.calendar-hero-photo-inner,
.calendar-hero-content-panel > * {
    position: relative;
    z-index: 1;
}

.calendar-hero-photo-inner {
    display: grid;
    gap: 1.1rem;
    height: 100%;
    padding: 2rem;
    align-content: space-between;
}

.calendar-hero-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: fit-content;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.24);
    background: rgba(8, 11, 15, 0.58);
    color: var(--secondary-gold);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-hero-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.calendar-hero-stat {
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.calendar-hero-stat-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--crm-text-soft);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-hero-stat strong {
    font-size: 1.55rem;
    color: var(--light-text);
}

.calendar-hero-mini-list {
    display: grid;
    gap: 0.7rem;
}

.calendar-hero-mini-title {
    color: var(--secondary-gold);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-mini-event {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    text-align: left;
    border-radius: 16px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(255, 255, 255, 0.035);
    color: inherit;
}

.calendar-mini-event span,
.calendar-hero-empty {
    color: var(--crm-text-soft);
    font-size: 0.84rem;
}

.calendar-mini-event strong {
    font-size: 0.98rem;
}

.calendar-hero-content-panel {
    display: grid;
    align-content: center;
    gap: 1rem;
    padding: 2.35rem;
    background: linear-gradient(150deg, rgba(201, 176, 55, 0.1) 0%, rgba(10, 14, 22, 0.86) 58%);
    border-left: 3px solid var(--primary-gold);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.calendar-hero-content-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.calendar-hero-content-panel:hover::after {
    opacity: 1;
    animation: crm-card-shimmer-sweep 0.65s ease forwards;
}

.calendar-hero-title {
    font-size: clamp(2rem, 4vw, 2.85rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--light-text);
}

.calendar-hero-title span {
    color: var(--secondary-gold);
}

.calendar-hero-subtitle {
    max-width: 560px;
    color: var(--crm-text-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.calendar-filter-row,
.calendar-hero-actions,
.calendar-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.calendar-filter-chip {
    border: 1px solid rgba(201, 176, 55, 0.2);
    background: rgba(255, 255, 255, 0.035);
    color: var(--crm-text-soft);
    border-radius: 999px;
    padding: 0.7rem 1rem;
}

.calendar-filter-chip.active {
    color: var(--light-text);
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    border-color: transparent;
}

.calendar-hero-stamp {
    position: absolute;
    right: -6%;
    bottom: -18%;
    width: min(360px, 54%);
    opacity: 0.05;
    filter: brightness(1.4);
    pointer-events: none;
}

.calendar-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
    gap: 1rem;
}

.calendar-agenda-column {
    display: grid;
    gap: 1rem;
    align-self: start;
}

.calendar-month-card,
.calendar-agenda-card,
.lead-detail-calendar-card {
    border: 1px solid rgba(201, 176, 55, 0.18);
}

.calendar-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-panel-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.45rem;
}

.calendar-month-actions {
    display: flex;
    gap: 0.55rem;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.65rem;
}

.calendar-weekday {
    padding: 0 0.25rem 0.45rem;
    color: var(--crm-text-soft);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-day-cell {
    min-height: 150px;
    padding: 0.75rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.024);
    display: grid;
    align-content: start;
    gap: 0.7rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-day-cell:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 176, 55, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.calendar-day-cell.selected {
    border-color: rgba(201, 176, 55, 0.52);
    box-shadow: 0 0 0 1px rgba(201, 176, 55, 0.12) inset;
}

.calendar-day-cell.today {
    background: linear-gradient(180deg, rgba(201, 176, 55, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.calendar-day-cell.outside-month {
    opacity: 0.55;
}

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

.calendar-day-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-text);
}

.calendar-day-count {
    color: var(--crm-text-muted);
    font-size: 0.75rem;
}

.calendar-day-events,
.calendar-event-list {
    display: grid;
    gap: 0.55rem;
}

.calendar-day-event {
    display: grid;
    gap: 0.15rem;
    text-align: left;
    border: 1px solid rgba(201, 176, 55, 0.12);
    border-left: 3px solid var(--primary-gold);
    border-radius: 12px;
    padding: 0.45rem 0.6rem;
    background: rgba(5, 8, 16, 0.7);
    color: inherit;
}

.calendar-day-event span,
.calendar-day-more,
.calendar-event-meta,
.calendar-event-lead,
.calendar-empty-state,
.calendar-readonly-line {
    color: var(--crm-text-soft);
    font-size: 0.82rem;
}

.calendar-day-event strong {
    font-size: 0.84rem;
}

.calendar-event-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(201, 176, 55, 0.14);
    background: rgba(255, 255, 255, 0.028);
}

.calendar-event-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
}

.calendar-event-head h3 {
    margin: 0.35rem 0 0.2rem;
    font-size: 1.03rem;
}

.calendar-event-head p,
.calendar-readonly-copy {
    margin: 0.25rem 0 0;
    color: var(--crm-text-soft);
    line-height: 1.6;
}

.calendar-event-badges,
.calendar-drawer-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.calendar-status-pill,
.calendar-visibility-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.38rem 0.7rem;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.calendar-status-pill.scheduled {
    background: rgba(119, 183, 255, 0.14);
    color: var(--crm-info);
}

.calendar-status-pill.completed {
    background: rgba(76, 175, 124, 0.14);
    color: var(--crm-success);
}

.calendar-status-pill.canceled {
    background: rgba(241, 111, 111, 0.14);
    color: var(--crm-danger);
}

.calendar-status-pill.missed {
    background: rgba(226, 184, 102, 0.14);
    color: var(--crm-warning);
}

.calendar-visibility-pill.private {
    background: rgba(255, 255, 255, 0.06);
    color: var(--crm-text-soft);
}

.calendar-visibility-pill.shared {
    background: rgba(201, 176, 55, 0.14);
    color: var(--secondary-gold);
}

.calendar-event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.calendar-event-form,
.calendar-drawer-readonly {
    display: grid;
    gap: 1rem;
}

.calendar-share-fieldset {
    border: 1px solid rgba(201, 176, 55, 0.12);
    border-radius: 18px;
    padding: 1rem;
    margin: 0;
}

.calendar-share-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.calendar-share-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.028);
}

.calendar-readonly-copy {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-drawer-status-row {
    justify-content: space-between;
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 176, 55, 0.1);
}

@media screen and (max-width: 980px) {
    .calendar-hero-split,
    .calendar-main-grid {
        grid-template-columns: 1fr;
    }

    .calendar-hero-content-panel {
        border-left: none;
        border-top: 1px solid rgba(201, 176, 55, 0.18);
    }

    .calendar-agenda-column {
        order: 1;
    }

    .calendar-month-card {
        order: 2;
    }
}

@media screen and (max-width: 768px) {
    .calendar-hero-photo-inner,
    .calendar-hero-content-panel {
        padding: 1.25rem;
    }

    .calendar-hero-stat-grid,
    .calendar-share-grid {
        grid-template-columns: 1fr;
    }

    .calendar-month-grid {
        gap: 0.45rem;
    }

    .calendar-day-cell {
        min-height: 110px;
        padding: 0.55rem;
    }

    .calendar-day-event strong {
        font-size: 0.78rem;
    }

    .calendar-panel-head,
    .calendar-event-head,
    .calendar-drawer-status-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.calendar-shell {
    display: grid;
    width: 100%;
    max-width: 1180px;
    margin: 0.45rem auto 0;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.calendar-sidebar-rail {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 0.8rem;
}

.calendar-compose-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 50px;
    padding: 0.78rem 0.95rem;
    border: 1px solid rgba(201, 176, 55, 0.24);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(201, 176, 55, 0.16), rgba(255, 255, 255, 0.05));
    color: var(--light-text);
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.calendar-mini-card,
.calendar-stage,
.calendar-week-shell,
.calendar-month-stage {
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: linear-gradient(180deg, rgba(9, 13, 20, 0.98) 0%, rgba(7, 10, 17, 0.96) 100%);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.calendar-mini-card,
.calendar-stage {
    border-radius: 22px;
}

.calendar-mini-card {
    padding: 0.85rem;
    display: grid;
    gap: 0.75rem;
}

.calendar-mini-toolbar,
.calendar-stage-toolbar,
.calendar-stage-toolbar-left,
.calendar-stage-toolbar-right,
.calendar-view-switch,
.calendar-period-nav,
.calendar-inline-filters,
.calendar-sidebar-filters {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.calendar-mini-toolbar {
    justify-content: space-between;
}

.calendar-mini-label,
.calendar-stage-title {
    color: var(--light-text);
    font-weight: 600;
}

.calendar-stage-title {
    font-size: 1rem;
}

.calendar-toolbar-button,
.calendar-icon-button,
.calendar-mini-nav,
.calendar-view-button,
.calendar-filter-chip {
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.calendar-toolbar-button,
.calendar-view-button,
.calendar-filter-chip {
    min-height: 38px;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.calendar-icon-button,
.calendar-mini-nav {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-view-button.active,
.calendar-filter-chip.active,
.calendar-toolbar-button:hover,
.calendar-icon-button:hover,
.calendar-mini-nav:hover,
.calendar-view-button:hover,
.calendar-filter-chip:hover,
.calendar-compose-button:hover,
.calendar-sidebar-event:hover,
.calendar-month-event:hover,
.calendar-empty-chip:hover {
    border-color: rgba(201, 176, 55, 0.34);
    background: rgba(201, 176, 55, 0.14);
    color: var(--light-text);
    transform: translateY(-1px);
}

.calendar-mini-weekdays,
.calendar-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.3rem;
}

.calendar-mini-weekdays {
    color: var(--crm-text-muted);
    font-size: 0.64rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.calendar-mini-day {
    position: relative;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--light-text);
    font-size: 0.8rem;
}

.calendar-mini-day.outside-month {
    color: var(--crm-text-muted);
}

.calendar-mini-day.today,
.calendar-month-cell.today .calendar-month-number,
.calendar-week-day.selected strong {
    color: var(--secondary-gold);
}

.calendar-mini-day.selected {
    border-color: rgba(201, 176, 55, 0.34);
    background: rgba(201, 176, 55, 0.12);
}

.calendar-mini-day-dot {
    position: absolute;
    left: 50%;
    bottom: 0.35rem;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: var(--primary-gold);
    transform: translateX(-50%);
}

.calendar-sidebar-events {
    display: grid;
    gap: 0.55rem;
}

.calendar-sidebar-event,
.calendar-empty-chip {
    display: grid;
    gap: 0.14rem;
    width: 100%;
    padding: 0.64rem 0.72rem;
    border-radius: 12px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.02));
    color: var(--light-text);
    text-align: left;
}

.calendar-sidebar-event strong {
    font-size: 0.82rem;
    line-height: 1.3;
}

.calendar-sidebar-event span,
.calendar-sidebar-event small,
.calendar-empty-chip span {
    color: var(--crm-text-soft);
    font-size: 0.7rem;
}

.calendar-empty-chip {
    align-items: center;
    justify-items: start;
}

.calendar-stage {
    padding: 0.85rem;
    display: grid;
    gap: 0.85rem;
}

.calendar-stage-toolbar {
    justify-content: space-between;
}

.calendar-stage-toolbar-left,
.calendar-stage-toolbar-right {
    min-width: 0;
}

.calendar-week-shell {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.calendar-week-shell::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.calendar-week-shell::-webkit-scrollbar-corner {
    background: transparent;
}

.calendar-month-stage {
    overflow: auto;
}

.calendar-week-head {
    display: grid;
    grid-template-columns: 60px repeat(7, minmax(104px, 1fr));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 790px;
}

.calendar-week-offset {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 0.4rem;
    color: var(--crm-text-soft);
    font-size: 0.7rem;
}

.calendar-week-day {
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    gap: 0.18rem;
    justify-items: center;
    align-content: center;
    min-height: 58px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.015);
    color: var(--crm-text-soft);
    box-shadow: none;
}

.calendar-week-day.selected {
    background: rgba(201, 176, 55, 0.08);
}

.calendar-week-day span {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
}

.calendar-week-day strong {
    font-size: 1.22rem;
    color: var(--light-text);
    line-height: 1;
}

.calendar-week-body {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    max-height: calc(56px * 11);
    overflow-x: clip;
    overflow-y: auto;
    min-width: 790px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.calendar-week-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.calendar-week-body::-webkit-scrollbar-corner {
    background: transparent;
}

.calendar-week-hours {
    display: grid;
    grid-template-rows: repeat(24, 56px);
    background: rgba(255, 255, 255, 0.015);
}

.calendar-hour-label {
    padding: 0.1rem 0.45rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--crm-text-soft);
    text-align: right;
    font-size: 0.68rem;
}

.calendar-week-columns {
    display: grid;
    grid-template-columns: repeat(7, minmax(104px, 1fr));
}

.calendar-week-column {
    position: relative;
    display: grid;
    grid-template-rows: repeat(24, 56px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
}

.calendar-week-column.today {
    background: linear-gradient(180deg, rgba(201, 176, 55, 0.06), rgba(255, 255, 255, 0.01));
}

.calendar-week-slot {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-week-event {
    position: absolute;
    top: var(--calendar-event-top);
    left: var(--calendar-event-left);
    width: calc(var(--calendar-event-width) - 0.32rem);
    height: var(--calendar-event-height);
    min-height: 22px;
    margin-left: 0.16rem;
    padding: 0.28rem 0.34rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 176, 55, 0.28);
    background: linear-gradient(180deg, rgba(201, 176, 55, 0.18), rgba(201, 176, 55, 0.1));
    color: var(--light-text);
    text-align: left;
    overflow-x: clip;
    z-index: 2;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.calendar-week-event span,
.calendar-week-event small {
    display: block;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.58rem;
}

.calendar-week-event strong {
    display: block;
    margin: 0.06rem 0;
    font-size: 0.68rem;
    line-height: 1.2;
}

.calendar-week-event.completed,
.calendar-month-event.completed,
.calendar-sidebar-event.completed {
    border-color: rgba(76, 175, 124, 0.34);
    background: rgba(76, 175, 124, 0.16);
}

.calendar-week-event.canceled,
.calendar-month-event.canceled,
.calendar-sidebar-event.canceled {
    border-color: rgba(241, 111, 111, 0.3);
    background: rgba(241, 111, 111, 0.14);
}

.calendar-week-event.missed,
.calendar-month-event.missed,
.calendar-sidebar-event.missed {
    border-color: rgba(226, 184, 102, 0.3);
    background: rgba(226, 184, 102, 0.14);
}

.calendar-month-stage {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-radius: 24px;
}

.calendar-month-weekday {
    padding: 0.68rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--crm-text-soft);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-month-cell {
    min-height: 118px;
    padding: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.012);
}

.calendar-month-cell.selected {
    background: rgba(201, 176, 55, 0.06);
}

.calendar-month-cell.outside-month {
    background: rgba(255, 255, 255, 0.006);
}

.calendar-month-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.72rem;
    height: 1.72rem;
    border-radius: 999px;
    color: var(--light-text);
    font-weight: 600;
    font-size: 0.86rem;
}

.calendar-month-events {
    display: grid;
    gap: 0.28rem;
    margin-top: 0.45rem;
}

.calendar-month-event {
    display: grid;
    gap: 0.1rem;
    width: 100%;
    padding: 0.28rem 0.42rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(201, 176, 55, 0.12);
    color: var(--light-text);
    text-align: left;
}

.calendar-month-event span,
.calendar-month-more {
    color: var(--crm-text-soft);
    font-size: 0.64rem;
}

.calendar-month-event strong {
    font-size: 0.7rem;
    line-height: 1.2;
}

.calendar-client-search-shell {
    width: 100%;
}

.calendar-client-search-input {
    width: 100%;
    min-height: 46px;
    padding: 0.74rem 0.9rem 0.74rem 2.7rem;
    border-radius: 16px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
    color: var(--light-text);
    font-size: 0.9rem;
    transition: min-height 0.35s ease, padding 0.35s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.35s ease, transform 0.35s ease;
}

.search-shell.is-expanded .calendar-client-search-input {
    min-height: 48px;
    padding-left: 2.8rem;
    padding-right: 0.95rem;
    border-color: rgba(201, 176, 55, 0.32);
    background: linear-gradient(135deg, rgba(201, 176, 55, 0.12), rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.035) 100%);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(201, 176, 55, 0.12) inset;
    transform: translateY(-1px);
}

.calendar-client-suggestion-panel {
    top: calc(100% + 0.5rem);
}

.calendar-client-selection {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.55rem;
    padding: 0.64rem 0.72rem;
    border-radius: 13px;
    border: 1px solid rgba(201, 176, 55, 0.12);
    background: rgba(255, 255, 255, 0.025);
    color: var(--crm-text-soft);
}

.calendar-client-selection strong {
    color: var(--light-text);
    font-size: 0.82rem;
}

.calendar-event-drawer {
    gap: 0.85rem;
}

.calendar-event-drawer .drawer-head > .crm-button-ghost {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-event-drawer .drawer-title {
    font-size: clamp(1.08rem, 2.6vw, 1.35rem);
    letter-spacing: -0.025em;
}

.calendar-event-drawer .calendar-drawer-status-row {
    padding: 0.7rem 0.8rem;
    border-radius: 16px;
    align-items: flex-start;
    gap: 0.7rem;
}

.calendar-event-drawer .form-grid {
    grid-template-columns: 1fr;
    gap: 0.72rem;
}

.calendar-event-drawer .form-label,
.calendar-event-drawer .calendar-share-fieldset > .form-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.calendar-event-drawer .crm-input,
.calendar-event-drawer .crm-select,
.calendar-event-drawer .crm-textarea {
    border-radius: 16px;
    border-color: rgba(201, 176, 55, 0.16);
    background: rgba(7, 10, 17, 0.68);
    min-height: 46px;
    padding: 0.74rem 0.88rem;
    font-size: 0.92rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.calendar-event-drawer .crm-textarea {
    min-height: 108px;
}

.calendar-event-drawer .calendar-share-fieldset {
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
}

.calendar-event-drawer .calendar-share-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.calendar-event-drawer .calendar-share-option {
    padding: 0.56rem 0.68rem;
    border-radius: 12px;
}

.calendar-event-card {
    gap: 0.62rem;
    padding: 0.78rem;
    border-radius: 15px;
}

.calendar-event-head h3 {
    margin: 0.28rem 0 0.16rem;
    font-size: 0.92rem;
}

.calendar-readonly-copy {
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
}

.calendar-event-meta,
.calendar-event-lead {
    font-size: 0.76rem;
}

.calendar-event-card .crm-button-ghost,
.calendar-event-card .crm-button-secondary {
    padding: 0.62rem 0.84rem;
    border-radius: 12px;
    font-size: 0.82rem;
}

.calendar-event-card .calendar-event-actions {
    gap: 0.45rem;
}

.calendar-client-selection.empty {
    color: var(--crm-text-muted);
    border-style: dashed;
}

@media (max-width: 1040px) {
    .calendar-shell {
        grid-template-columns: 1fr;
    }

    .calendar-sidebar-rail {
        position: static;
    }
}

@media (max-width: 860px) {
    .calendar-stage-title {
        font-size: 0.96rem;
    }

    .calendar-week-head,
    .calendar-week-body {
        min-width: 736px;
    }

    .calendar-month-cell {
        min-height: 104px;
    }
}

@media (max-width: 720px) {
    .calendar-stage {
        padding: 0.85rem;
    }

    .calendar-inline-filters {
        display: none;
    }

    .calendar-stage-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-mini-card {
        order: 2;
    }

    .calendar-compose-button {
        width: 100%;
    }
}

html {
    min-height: 100%;
    background-color: #0a0d13;
    background-image: var(--crm-page-background);
    background-attachment: fixed;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body.crm-body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--light-text);
    background-color: transparent;
    background-image: var(--crm-page-background);
    overscroll-behavior-y: auto;
    overflow-x: clip;
}

body.crm-body.crm-nav-open {
    overflow-x: clip;
}

html::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.75), transparent 88%);
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.75), transparent 88%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.crm-app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-gate {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(4rem, 8vh, 5.5rem) 2rem;
    background: radial-gradient(circle at 50% 50%, rgba(201, 176, 55, 0.08), transparent 50%);
    position: relative;
    overflow-x: clip;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(201, 176, 55, 0.09) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    top: -100px;
    left: -15%;
    right: -15%;
    bottom: -80px;
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            transparent 35%,
            rgba(5, 8, 16, 0.4) 65%,
            rgba(5, 8, 16, 0.85) 88%,
            var(--darker-bg) 100%
        ),
        radial-gradient(circle at 35% 55%, rgba(201, 176, 55, 0.10), transparent 50%),
        radial-gradient(circle at 72% 30%, rgba(201, 176, 55, 0.05), transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    background: linear-gradient(150deg, rgba(201, 176, 55, 0.1) 0%, rgba(10, 14, 22, 0.85) 55%);
    border: 1px solid rgba(201, 176, 55, 0.28);
    border-top: 3px solid var(--primary-gold);
    border-radius: 20px;
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    z-index: 1;
    overflow-x: clip;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: login-card-float 5s ease-in-out infinite alternate;
}

@keyframes login-card-float {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-4px);
    }
}

.login-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 0;
}

.login-container:hover::after {
    opacity: 1;
    animation: login-shimmer-sweep 0.65s ease forwards;
}

.login-container:hover {
    border-color: rgba(201, 176, 55, 0.55);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35), 0 0 28px rgba(201, 176, 55, 0.18);
}

@keyframes login-shimmer-sweep {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.login-inner {
    position: relative;
    z-index: 2;
}

@keyframes login-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: login-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.10s both;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.login-brand img {
    width: min(148px, 38vw);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 28px rgba(201, 176, 55, 0.2));
}

.login-header p {
    color: var(--gray-text);
    font-size: 0.95rem;
    line-height: 1.55;
}

.login-header p span {
    display: block;
}

.error-message,
.success-message {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: block;
    animation: login-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.error-message {
    background: rgba(255, 59, 59, 0.1);
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}

.success-message {
    background: rgba(42, 87, 31, 0.1);
    border: 1px solid var(--success-green);
    color: #8fe0a1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:nth-of-type(1) {
    animation: login-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.form-group:nth-of-type(2) {
    animation: login-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--light-text);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--field-bg);
    border: 1px solid rgba(201, 176, 55, 0.2);
    border-radius: 10px;
    color: var(--light-text);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.form-group input::placeholder {
    color: var(--gray-text);
}

.form-group input:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--primary-gold);
}

.password-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remember-me input[type="checkbox"] {
    accent-color: var(--primary-gold);
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.remember-me span {
    color: var(--light-text);
    font-size: 0.95rem;
}

.login-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    animation: login-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

.login-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gray-text);
}

.login-status i {
    color: var(--primary-gold);
}

.auth-login-actions {
    display: grid;
    gap: 0.85rem;
}

.auth-return-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    color: var(--darker-bg);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
    animation: login-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(201, 176, 55, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}


.auth-grid {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
}

.auth-hero,
.auth-panel,
.crm-card,
.crm-table-card,
.crm-summary-card,
.crm-surface {
    background: linear-gradient(160deg, rgba(19, 24, 38, 0.84) 0%, rgba(7, 10, 17, 0.96) 100%);
    border: 1px solid var(--crm-border);
    border-radius: 24px;
    box-shadow: var(--crm-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-hero {
    position: relative;
    overflow-x: clip;
    padding: 2.5rem;
}

.auth-hero::after {
    content: '';
    position: absolute;
    inset: auto -10% -28% auto;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(201, 176, 55, 0.12), transparent 70%);
    pointer-events: none;
}

.auth-panel {
    padding: 2.25rem;
}

.crm-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(201, 176, 55, 0.22);
    background: rgba(201, 176, 55, 0.08);
    color: var(--crm-accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-title,
.section-title,
.drawer-title,
.modal-title {
    margin: 1rem 0 0.75rem;
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: var(--light-text);
}

.section-title,
.drawer-title,
.modal-title {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    margin: 0;
}

.auth-copy,
.crm-copy,
.empty-copy {
    color: var(--crm-text-soft);
    max-width: 52ch;
}

.auth-feature-list {
    margin-top: 2rem;
    display: grid;
    gap: 0.85rem;
}

.auth-feature-item,
.meta-list-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-feature-item i,
.meta-list-item i {
    width: 1.15rem;
    color: var(--crm-accent);
}

.auth-subtitle,
.panel-subtitle {
    color: var(--crm-text-muted);
    margin-top: 0.35rem;
}

.auth-user-grid {
    display: grid;
    gap: 0.9rem;
    margin: 1.4rem 0 1.6rem;
}

.auth-user-card {
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid rgba(201, 176, 55, 0.14);
    background: linear-gradient(145deg, rgba(201, 176, 55, 0.08), rgba(255, 255, 255, 0.03));
}

.auth-user-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.auth-user-role {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--crm-accent);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-user-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.auth-user-meta {
    margin-top: 0.7rem;
    color: var(--crm-text-soft);
    display: grid;
    gap: 0.35rem;
    font-size: 0.92rem;
}

.auth-actions,
.toolbar-actions,
.row-actions,
.drawer-actions,
.modal-actions,
.filter-row,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.crm-button,
.crm-button-secondary,
.crm-button-ghost,
.crm-button-danger {
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.crm-button {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    color: var(--darker-bg);
}

.crm-button-secondary {
    background: rgba(201, 176, 55, 0.12);
    color: var(--crm-accent);
    border-color: rgba(201, 176, 55, 0.25);
}

.crm-button-ghost {
    background: rgba(255, 255, 255, 0.03);
    color: var(--light-text);
    border-color: rgba(255, 255, 255, 0.08);
}

.crm-button-danger {
    background: rgba(241, 111, 111, 0.1);
    color: #ffd7d7;
    border-color: rgba(241, 111, 111, 0.28);
}

.crm-button:hover,
.crm-button-secondary:hover,
.crm-button-ghost:hover,
.crm-button-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
}

.crm-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    overflow-y: visible;
}

.crm-sidebar {
    display: none;
    padding: 1.25rem 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(6, 9, 16, 0.995), rgba(8, 11, 15, 0.985));
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    min-width: 0;
    overflow-x: clip;
    z-index: 1;
}

.crm-brand {
    width: 100%;
    aspect-ratio: 1;
    padding: 0.9rem;
    border-radius: 34px;
    border: 1px solid rgba(201, 176, 55, 0.14);
    background: linear-gradient(160deg, rgba(20, 25, 39, 0.96), rgba(9, 12, 19, 0.98));
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.crm-brand img {
    width: 100%;
    max-width: 68px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 22px rgba(201, 176, 55, 0.22));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.crm-brand:hover img {
    transform: scale(1.04);
    filter: drop-shadow(0 10px 26px rgba(201, 176, 55, 0.28));
}

.crm-sidebar-drawer {
    display: none;
    width: 100%;
    min-width: 0;
}

.crm-sidebar-nav {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

.crm-sidebar-link {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 20, 31, 0.92);
    color: var(--crm-text-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    min-width: 0;
    overflow-x: clip;
}

.crm-sidebar-link.active {
    background: linear-gradient(160deg, rgba(30, 36, 52, 0.98), rgba(16, 20, 31, 0.96));
    border-color: rgba(201, 176, 55, 0.22);
    color: var(--light-text);
}

.crm-sidebar-link-main {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.crm-sidebar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(201, 176, 55, 0.08);
    color: var(--crm-accent);
    font-size: 0.74rem;
    font-weight: 700;
}

.crm-sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 20, 31, 0.94);
    color: var(--crm-text-soft);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    min-width: 0;
    display: none;
}

.crm-stage {
    --crm-stage-pad: 1.35rem;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--crm-stage-pad, 1.35rem);
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    overflow-y: visible;
    z-index: 2;
}

.crm-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(201, 176, 55, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(9, 13, 21, 0.96) 0%, rgba(7, 10, 17, 0.98) 100%);
    pointer-events: none;
    z-index: 0;
}

.crm-topbar {
    position: sticky;
    top: 12px;
    z-index: 60;
    display: grid;
    gap: 0.85rem;
    padding-bottom: 1rem;
    isolation: isolate;
}

.crm-toolbar {
    border-radius: 38px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(5, 8, 16, 0.92);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    display: grid;
    gap: 0;
    padding: 0.85rem 1.35rem;
    overflow: visible;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-radius 0.3s ease;
}

.crm-detail-utility {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0.2rem 0.25rem;
}

.crm-detail-utility-left,
.crm-detail-utility-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.crm-detail-utility-right {
    justify-content: flex-end;
}

.crm-detail-floating-button {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 999px;
    padding: 0.72rem 1rem;
    border-color: rgba(201, 176, 55, 0.18);
    background: rgba(7, 10, 17, 0.88);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.crm-detail-floating-button:hover,
.crm-detail-floating-button:focus-visible {
    border-color: rgba(201, 176, 55, 0.34);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(201, 176, 55, 0.08) inset;
}

.crm-detail-floating-button:disabled {
    opacity: 0.46;
    box-shadow: none;
}

.crm-detail-floating-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    background: rgba(201, 176, 55, 0.12);
    color: var(--primary-gold);
    font-size: 0.82rem;
    flex: 0 0 auto;
}

.crm-toolbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 468px) minmax(0, 1fr);
    align-items: center;
    gap: 1.6rem;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.crm-toolbar-left {
    display: contents;
}

.crm-toolbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    flex: 0 0 auto;
    grid-column: 1;
    justify-self: start;
}

.crm-toolbar-brand img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 6px 18px rgba(201, 176, 55, 0.28));
}

.crm-toolbar-brand:hover img {
    transform: scale(1.05);
}

.crm-search-shell-desktop {
    grid-column: 2;
    width: 100%;
    max-width: 412px;
    justify-self: center;
    transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s ease, filter 0.35s ease;
}

.crm-primary-nav {
    display: flex;
    align-items: center;
    min-width: 0;
    justify-content: flex-end;
    position: relative;
    grid-column: 3;
    justify-self: end;
    padding-left: 0.45rem;
}

.crm-desktop-nav {
    position: relative;
}

.crm-desktop-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 188px;
    min-height: 48px;
    padding: 0.5rem 0.68rem 0.5rem 0.56rem;
    border-radius: 20px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.022));
    color: var(--light-text);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
    transition: border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

.crm-desktop-nav-trigger:hover,
.crm-desktop-nav-trigger:focus-visible,
.crm-desktop-nav.is-open .crm-desktop-nav-trigger {
    border-color: rgba(201, 176, 55, 0.34);
    background: linear-gradient(180deg, rgba(201, 176, 55, 0.14), rgba(255, 255, 255, 0.045));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(201, 176, 55, 0.08) inset;
    transform: translateY(-1px);
}

.crm-desktop-nav-trigger-icon,
.crm-desktop-nav-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 14px;
}

.crm-desktop-nav-trigger-icon {
    width: 2.2rem;
    height: 2.2rem;
    background: rgba(201, 176, 55, 0.12);
    color: var(--primary-gold);
    font-size: 0.88rem;
}

.crm-desktop-nav-trigger-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.crm-desktop-nav-trigger-label {
    color: var(--crm-text-soft);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.crm-desktop-nav-trigger-value {
    color: var(--light-text);
    font-size: 0.94rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-desktop-nav-trigger-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    color: var(--crm-text-soft);
    transition: transform 0.28s ease, color 0.28s ease;
}

.crm-desktop-nav.is-open .crm-desktop-nav-trigger-chevron {
    transform: rotate(180deg);
    color: var(--primary-gold);
}

.crm-desktop-nav-panel {
    position: absolute;
    top: calc(100% + 0.8rem);
    right: 0;
    width: min(320px, calc(100vw - 2rem));
    padding: 0.6rem;
    border-radius: 24px;
    border: 1px solid rgba(201, 176, 55, 0.2);
    background:
        radial-gradient(circle at top right, rgba(201, 176, 55, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(8, 11, 18, 0.98) 0%, rgba(6, 9, 16, 0.98) 100%);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 80;
    overflow-x: clip;
}

.crm-desktop-nav-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%);
    pointer-events: none;
}

.crm-desktop-nav.is-open .crm-desktop-nav-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
    animation: crmDesktopNavPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.crm-desktop-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.78rem;
    width: 100%;
    padding: 0.8rem 0.88rem;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: var(--light-text);
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
    font: inherit;
    cursor: pointer;
    opacity: 0;
    transform: translateY(14px);
    transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease, opacity 0.24s ease;
}

a.crm-desktop-nav-link-external {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0.25rem;
    border-radius: 0 0 18px 18px;
}

.crm-desktop-nav.is-open .crm-desktop-nav-link {
    opacity: 1;
    transform: none;
    animation: crmDesktopNavLinkIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.04s + (var(--crm-nav-index) * 0.05s));
}

.crm-desktop-nav-link:hover,
.crm-desktop-nav-link:focus-visible,
.crm-desktop-nav-link.active {
    background: rgba(201, 176, 55, 0.1);
    color: var(--primary-gold);
}

.crm-desktop-nav-link-icon {
    width: 2rem;
    height: 2rem;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.82rem;
    transition: background 0.24s ease, color 0.24s ease;
}

.crm-desktop-nav-link:hover .crm-desktop-nav-link-icon,
.crm-desktop-nav-link:focus-visible .crm-desktop-nav-link-icon,
.crm-desktop-nav-link.active .crm-desktop-nav-link-icon {
    background: rgba(201, 176, 55, 0.16);
    color: var(--primary-gold);
}

.crm-desktop-nav-link-label {
    flex: 1;
    min-width: 0;
    font-size: 0.94rem;
    font-weight: 600;
    white-space: nowrap;
}

.crm-desktop-nav-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.2);
    background: rgba(201, 176, 55, 0.08);
    color: var(--secondary-gold);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.crm-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    min-width: 0;
    grid-column: 3;
    justify-self: end;
}

.crm-toolbar-compose {
    white-space: nowrap;
    padding: 0.72rem 1rem;
}

.crm-primary-link {
    background: none;
    border: none;
    color: var(--light-text);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.crm-primary-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-gold);
    transition: width 0.35s ease;
}

.crm-primary-link:hover,
.crm-primary-link.active {
    color: var(--primary-gold);
}

.crm-primary-link:hover::after,
.crm-primary-link.active::after {
    width: 100%;
}

.crm-mobile-toggle,
.crm-mobile-search-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(201, 176, 55, 0.2);
    background: rgba(201, 176, 55, 0.05);
    color: var(--primary-gold);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 65;
    flex: 0 0 auto;
    transition: opacity 0.25s ease, transform 0.35s ease, color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.crm-mobile-toggle {
    flex-direction: column;
    gap: 6px;
    padding: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 0;
    box-shadow: none;
    justify-self: start;
}

.crm-mobile-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-gold);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(201, 176, 55, 0.16);
    transition: transform 0.35s ease, opacity 0.35s ease;
    transform-origin: center;
}

.crm-mobile-toggle.is-open .crm-mobile-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    animation: crmHamburgerTopOpen 0.35s ease both;
}

.crm-mobile-toggle.is-open .crm-mobile-toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
    animation: crmHamburgerMiddleOpen 0.35s ease both;
}

.crm-mobile-toggle.is-open .crm-mobile-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    animation: crmHamburgerBottomOpen 0.35s ease both;
}

.crm-mobile-search-toggle.active,
.crm-mobile-search-toggle:hover {
    color: var(--secondary-gold);
    border-color: rgba(201, 176, 55, 0.28);
}

.search-shell {
    min-width: 0;
    position: relative;
    display: block;
    width: 100%;
    transform: translateY(0) scale(1);
    transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s ease, filter 0.35s ease;
}

.crm-search-shell-desktop.is-expanded {
    width: 100%;
    max-width: 452px;
    transform: translateY(-1px) scale(1.015);
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.18));
}

.search-shell i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    transition: color 0.25s ease, transform 0.35s ease;
    z-index: 1;
}

.search-shell.is-expanded i {
    color: var(--primary-gold);
    transform: translateY(-50%) scale(1.05);
}

.crm-mobile-search-row {
    display: none;
    position: relative;
    z-index: 2;
}

.crm-search {
    width: 100%;
    min-height: 56px;
    padding: 1rem 1.1rem 1rem 3rem;
    border-radius: 20px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
    color: var(--light-text);
    font-size: 0.98rem;
    transition: min-height 0.35s ease, padding 0.35s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.35s ease, transform 0.35s ease;
}

.search-shell.is-expanded .crm-search {
    min-height: 60px;
    padding-left: 3.15rem;
    padding-right: 1.25rem;
    border-color: rgba(201, 176, 55, 0.32);
    background: linear-gradient(135deg, rgba(201, 176, 55, 0.12), rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.035) 100%);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(201, 176, 55, 0.12) inset;
    transform: translateY(-1px);
}

.crm-search:focus,
.calendar-client-search-input:focus,
.crm-select:focus,
.crm-input:focus,
.crm-textarea:focus {
    outline: none;
    border-color: rgba(201, 176, 55, 0.42);
    box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.12);
}

.crm-search-suggestion-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 0;
    right: 0;
    border-radius: 22px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(5, 8, 16, 0.97);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-x: clip;
    z-index: 75;
}

.crm-search-suggestion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid rgba(201, 176, 55, 0.08);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.crm-search-suggestion-list {
    display: grid;
    max-height: min(420px, 58vh);
    overflow-y: auto;
}

.crm-search-suggestion-item,
.crm-search-suggestion-empty {
    padding: 0.9rem 1rem;
}

.crm-search-suggestion-item {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: var(--light-text);
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.crm-search-suggestion-item:first-child {
    border-top: none;
}

.crm-search-suggestion-item:hover,
.crm-search-suggestion-item.active {
    background: rgba(201, 176, 55, 0.08);
}

.crm-search-suggestion-copy {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.crm-search-suggestion-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    font-weight: 700;
}

.crm-search-suggestion-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(201, 176, 55, 0.08);
    color: var(--primary-gold);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.crm-search-suggestion-type.member {
    border-color: rgba(96, 165, 250, 0.26);
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
}

.crm-search-suggestion-meta {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.crm-search-suggestion-empty {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: var(--crm-text-soft);
    text-align: center;
}

.crm-mobile-menu-panel {
    display: none;
}

.crm-mobile-menu-links {
    display: contents;
}

@keyframes crmMobileMenuPanelIn {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crmMobileMenuLinkIn {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crmDesktopNavPanelIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes crmDesktopNavLinkIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crmHamburgerTopOpen {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(8px) rotate(45deg);
    }
}

@keyframes crmHamburgerMiddleOpen {
    from {
        opacity: 1;
        transform: scaleX(1);
    }

    to {
        opacity: 0;
        transform: scaleX(0);
    }
}

@keyframes crmHamburgerBottomOpen {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(-8px) rotate(-45deg);
    }
}

.crm-mobile-menu-brand {
    display: none;
}

.crm-mobile-menu-link {
    display: none;
}

.role-badge,
.tag-chip,
.status-pill,
.metric-chip,
.summary-chip,
.inline-code {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.4rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.role-badge {
    background: rgba(201, 176, 55, 0.12);
    color: var(--crm-accent);
    border: 1px solid rgba(201, 176, 55, 0.22);
}

.crm-alert {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid transparent;
    position: relative;
    z-index: 1;
}

.crm-alert-success {
    background: rgba(76, 175, 124, 0.09);
    border-color: rgba(76, 175, 124, 0.22);
    color: #d5ffe8;
}

.crm-alert-error {
    background: rgba(241, 111, 111, 0.09);
    border-color: rgba(241, 111, 111, 0.22);
    color: #ffe3e3;
}

.crm-content {
    display: grid;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.crm-panel {
    position: relative;
    z-index: 1;
}

.panel-grid,
.overview-grid,
.settings-grid,
.imports-grid {
    display: grid;
    gap: 1.2rem;
}

.overview-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.crm-summary-card {
    padding: 1.2rem;
    position: relative;
    z-index: 1;
}

.crm-summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--crm-text-muted);
}

.crm-summary-value {
    margin-top: 0.75rem;
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1;
    font-weight: 800;
}

.crm-summary-meta {
    margin-top: 0.65rem;
    color: var(--crm-text-soft);
    font-size: 0.92rem;
}

.crm-card,
.crm-table-card {
    padding: 1.3rem;
    position: relative;
    z-index: 1;
}

.crm-table-card {
    overflow-x: clip;
}

.panel-head,
.table-head,
.drawer-head,
.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.panel-copy,
.table-copy {
    color: var(--crm-text-soft);
    margin-top: 0.35rem;
}

.metric-chip,
.summary-chip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--crm-text-soft);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-list,
.metric-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.65rem;
}

.mini-list li,
.metric-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-list-main {
    display: grid;
    gap: 0.2rem;
}

.mini-list-title {
    font-weight: 700;
}

.mini-list-meta {
    color: var(--crm-text-muted);
    font-size: 0.86rem;
}

.tag-cloud,
.status-cloud,
.credentials-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.tag-chip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tag-chip strong {
    color: var(--crm-accent);
}

.crm-admin-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.crm-admin-hero {
    position: relative;
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 20px;
    padding: 2rem 2rem 1.75rem;
    overflow-x: clip;
}

.crm-admin-hero-glow {
    position: absolute;
    top: -70px;
    right: -70px;
    width: 400px;
    height: 320px;
    background: radial-gradient(ellipse at center, rgba(201, 176, 55, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.crm-admin-hero-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.crm-admin-label-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-gold);
    background: rgba(201, 176, 55, 0.08);
    border: 1px solid rgba(201, 176, 55, 0.2);
    padding: 0.28rem 0.78rem;
    border-radius: 100px;
    margin-bottom: 0.85rem;
}

.crm-admin-hero-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--secondary-gold) 55%, var(--primary-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}

.crm-admin-hero-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.38);
}

.crm-admin-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.38rem 0.9rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
    align-self: flex-start;
    cursor: pointer;
    font-family: inherit;
}

.crm-admin-back-btn:hover {
    color: var(--primary-gold);
    border-color: rgba(201, 176, 55, 0.25);
    background: rgba(201, 176, 55, 0.05);
}

.crm-admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.crm-admin-stat-card {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.crm-admin-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(201, 176, 55, 0.08);
    border: 1px solid rgba(201, 176, 55, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--primary-gold);
    flex-shrink: 0;
}

.crm-admin-stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--light-text);
    line-height: 1;
    margin-bottom: 0.22rem;
}

.crm-admin-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}

.crm-admin-tabs {
    display: flex;
    gap: 0.4rem;
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.15);
    border-radius: 12px;
    padding: 0.35rem;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.crm-admin-tabs::-webkit-scrollbar {
    display: none;
}

.crm-admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.crm-admin-tab.active {
    background: rgba(201, 176, 55, 0.1);
    border-color: rgba(201, 176, 55, 0.22);
    color: var(--primary-gold);
}

.crm-admin-panel {
    display: none;
}

.crm-admin-panel.active {
    display: block;
}

.crm-admin-card {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 16px;
    padding: 1.75rem;
}

.crm-admin-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.crm-admin-card-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: -0.2rem 0 0;
}

.crm-admin-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    gap: 1rem;
}

.crm-admin-activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.crm-admin-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.crm-admin-search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.crm-admin-search-wrap > i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.78rem;
    pointer-events: none;
}

.crm-admin-search-input {
    width: 100%;
    background: rgba(10, 14, 22, 0.6);
    border: 1px solid rgba(201, 176, 55, 0.15);
    border-radius: 10px;
    padding: 0.65rem 1rem 0.65rem 2.2rem;
    color: var(--light-text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.crm-admin-search-input:focus {
    border-color: rgba(201, 176, 55, 0.35);
}

.crm-admin-search-input::placeholder {
    color: rgba(255, 255, 255, 0.22);
}

.crm-admin-filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.crm-admin-filter-pill {
    padding: 0.38rem 0.85rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.crm-admin-filter-pill.active,
.crm-admin-filter-pill:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: rgba(201, 176, 55, 0.28);
    color: var(--primary-gold);
}

.crm-admin-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(201, 176, 55, 0.1);
}

.crm-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.crm-admin-table thead {
    background: rgba(201, 176, 55, 0.04);
}

.crm-admin-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(201, 176, 55, 0.1);
    white-space: nowrap;
}

.crm-admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.76);
}

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

.crm-admin-table tbody tr:hover {
    background: rgba(201, 176, 55, 0.025);
}

.crm-admin-user-cell {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.crm-admin-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(179, 161, 125, 0.2), rgba(226, 207, 181, 0.06));
    border: 1px solid rgba(201, 176, 55, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-gold);
    flex-shrink: 0;
}

.crm-admin-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--light-text);
    line-height: 1.2;
}

.crm-admin-user-email {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}

.crm-admin-role-badge,
.crm-admin-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-admin-role-badge.sales {
    background: rgba(201, 176, 55, 0.08);
    border: 1px solid rgba(201, 176, 55, 0.22);
    color: var(--primary-gold);
}

.crm-admin-role-badge.senior {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: #bfdbfe;
}

.crm-admin-role-badge.admin {
    background: rgba(76, 175, 124, 0.12);
    border: 1px solid rgba(76, 175, 124, 0.3);
    color: #c4f3d7;
}

.crm-admin-role-badge.support {
    background: rgba(125, 211, 252, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.26);
    color: #d7f0ff;
}

.crm-admin-status-chip.active {
    background: rgba(42, 87, 31, 0.15);
    color: #81c784;
}

.crm-admin-status-chip.inactive {
    background: rgba(211, 47, 47, 0.1);
    color: #e57373;
}

.crm-admin-row-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.crm-admin-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.75rem;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
}

.crm-admin-row-btn.edit {
    background: rgba(201, 176, 55, 0.06);
    border-color: rgba(201, 176, 55, 0.22);
    color: var(--primary-gold);
}

.crm-admin-row-btn.edit:hover {
    background: rgba(201, 176, 55, 0.14);
}

.crm-admin-row-btn.delete {
    background: rgba(211, 47, 47, 0.06);
    border-color: rgba(244, 67, 54, 0.22);
    color: #e57373;
}

.crm-admin-row-btn.delete:hover {
    background: rgba(211, 47, 47, 0.14);
}

.crm-admin-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: rgba(255, 255, 255, 0.28);
}

.crm-admin-empty i {
    font-size: 2rem;
    color: var(--primary-gold);
    margin-bottom: 0.75rem;
    display: block;
}

.crm-admin-empty.compact {
    padding: 1rem 0.25rem;
}

.crm-admin-empty.compact i {
    display: none;
}

.crm-admin-form-stack {
    margin-top: 1.25rem;
}

.crm-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.crm-admin-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.crm-admin-mini-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.crm-admin-mini-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.crm-admin-substats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.crm-admin-substat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.crm-admin-substat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--light-text);
    line-height: 1;
}

.crm-admin-substat-label {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1180px) {
    .crm-admin-section-grid,
    .crm-admin-activity-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .crm-admin-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .crm-admin-tabs {
        width: 100%;
    }

    .crm-admin-card {
        padding: 1.25rem 1rem;
    }

    .crm-admin-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .crm-admin-hero {
        padding: 1.25rem 1.25rem 1rem;
    }

    .crm-admin-hero-body,
    .crm-admin-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-admin-back-btn {
        align-self: flex-start;
    }

    .crm-admin-stats-grid,
    .crm-admin-substats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .crm-admin-stat-card {
        padding: 0.95rem 1rem;
        gap: 0.7rem;
    }

    .crm-admin-stat-value {
        font-size: 1.3rem;
    }

    .crm-admin-tab {
        padding: 0.45rem 0.9rem;
        font-size: 0.75rem;
    }
}

.status-pill {
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: capitalize;
}

.status-pill.new {
    color: #f3e2b8;
    background: rgba(243, 226, 184, 0.1);
}

.status-pill.contacted {
    color: #bdd7ff;
    background: rgba(119, 183, 255, 0.1);
}

.status-pill.qualified {
    color: #c4f3d7;
    background: rgba(76, 175, 124, 0.1);
}

.status-pill.won {
    color: #f6de9a;
    background: rgba(201, 176, 55, 0.14);
}

.status-pill.inactive {
    color: #c9c9d6;
    background: rgba(201, 201, 214, 0.08);
}

.status-pill.member {
    color: #d8c49a;
    background: rgba(201, 176, 55, 0.12);
}

/* ============================================================
   Leads workspace — full-width Zoho-style shell (BCS dark luxury)
   ============================================================ */
.lead-workspace {
    width: 100%;
    /* Break out of the .crm-stage left/right gutter so the workspace reads edge-to-edge */
    margin: 0 calc(-1 * var(--crm-stage-pad, 1.35rem));
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

/* Leads/Members only: turn the surrounding shell into a fixed-height app frame so the
   filter rail and the table scroll INDEPENDENTLY instead of scrolling the whole page.
   Scoped with :has() so every other CRM view keeps its normal page scroll. */
.crm-stage:has(.lead-workspace) {
    height: 100dvh;
    overflow-y: clip;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

.crm-content:has(.lead-workspace) {
    flex: 1;
    min-height: 0;
    display: flex;
}

.crm-panel:has(.lead-workspace) {
    flex: 1;
    min-height: 0;
    display: flex;
}

.lead-workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    padding: 0.8rem 1.35rem;
    background: #0a0e16;
    border-top: 1px solid rgba(201, 176, 55, 0.16);
    border-bottom: 1px solid rgba(201, 176, 55, 0.16);
}

.lead-toolbar-left,
.lead-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    min-width: 0;
}

.lead-toolbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.lead-toolbar-icon-btn:hover:not(:disabled) {
    color: var(--primary-gold);
    border-color: rgba(201, 176, 55, 0.4);
    background: rgba(201, 176, 55, 0.08);
}

.lead-toolbar-icon-btn.active {
    color: var(--primary-gold);
    border-color: rgba(201, 176, 55, 0.45);
    background: rgba(201, 176, 55, 0.12);
}

.lead-toolbar-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Saved-views dropdown */
.lead-views-menu-shell {
    position: relative;
}

.lead-views-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 260px;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 176, 55, 0.3);
    background: rgba(201, 176, 55, 0.06);
    color: var(--light-text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.lead-views-trigger:hover,
.lead-views-menu-shell.open .lead-views-trigger {
    border-color: rgba(201, 176, 55, 0.55);
    background: rgba(201, 176, 55, 0.12);
}

.lead-views-trigger-icon {
    color: var(--primary-gold);
    font-size: 0.72rem;
}

.lead-views-trigger-label {
    overflow-x: clip;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-views-trigger-caret {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.15rem;
}

.lead-views-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 70;
    width: 320px;
    max-width: min(90vw, 360px);
    border-radius: 14px;
    border: 1px solid rgba(201, 176, 55, 0.22);
    background: #0b0f18;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    overflow: clip;
}

.lead-views-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-views-menu-title {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.lead-views-new {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(201, 176, 55, 0.35);
    background: transparent;
    color: var(--primary-gold);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.lead-views-new:hover {
    background: rgba(201, 176, 55, 0.12);
}

.lead-views-menu-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.lead-views-empty {
    margin: 0;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.76rem;
    line-height: 1.5;
}

.lead-views-group {
    margin-top: 0.5rem;
}

.lead-views-group-label {
    padding: 0.4rem 0.6rem 0.25rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.lead-views-item-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9px;
}

.lead-views-item-row.active,
.lead-views-item-row:hover {
    background: rgba(201, 176, 55, 0.08);
}

.lead-views-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.65rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--light-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.lead-views-item-all {
    width: 100%;
    margin-bottom: 0.25rem;
}

.lead-views-item-all:hover,
.lead-views-item-all.active {
    background: rgba(201, 176, 55, 0.08);
}

.lead-views-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    overflow-x: clip;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-views-item-meta {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
}

.lead-views-item-action {
    flex: none;
    width: 30px;
    height: 30px;
    margin-right: 0.2rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    cursor: pointer;
}

.lead-views-item-action:hover {
    color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.05);
}

.lead-views-item-action.danger:hover {
    color: var(--danger-red);
}

/* Scope switch (Leads / Members) */
.lead-scope-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(255, 255, 255, 0.03);
}

.lead-scope-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-family: inherit;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.lead-scope-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.lead-scope-btn.active {
    color: #0c0c0c;
    background: linear-gradient(135deg, var(--secondary-gold), var(--primary-gold));
    border-color: rgba(201, 176, 55, 0.5);
}

/* Toolbar meta (total + sort + filter count) */
.lead-toolbar-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
}

.lead-toolbar-total strong {
    color: var(--light-text);
    font-weight: 800;
}

.lead-toolbar-dot {
    color: rgba(255, 255, 255, 0.25);
}

.lead-toolbar-sort,
.lead-toolbar-filtercount {
    white-space: nowrap;
}

.lead-toolbar-filtercount {
    color: var(--primary-gold);
    font-weight: 700;
}

/* Page size + pager */
.lead-toolbar-pagesize select {
    min-width: 100px;
}

.lead-toolbar-pager {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.lead-toolbar-pager-copy {
    padding: 0 0.35rem;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* Actions dropdown */
.lead-actions-menu-shell {
    position: relative;
}

.lead-actions-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.lead-actions-trigger:hover,
.lead-actions-menu-shell.open .lead-actions-trigger {
    border-color: rgba(201, 176, 55, 0.4);
    background: rgba(201, 176, 55, 0.08);
}

.lead-actions-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--primary-gold);
    color: #0c0c0c;
    font-size: 0.66rem;
    font-weight: 800;
}

.lead-actions-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 70;
    width: 280px;
    max-width: 90vw;
    padding: 0.5rem;
    border-radius: 14px;
    border: 1px solid rgba(201, 176, 55, 0.22);
    background: #0b0f18;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.lead-actions-group {
    padding: 0.35rem 0;
}

.lead-actions-group + .lead-actions-group {
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-actions-group-label {
    padding: 0.25rem 0.5rem 0.4rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.lead-actions-hint {
    margin: 0 0 0.4rem;
    padding: 0 0.5rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.45;
}

.lead-actions-assign-row {
    display: flex;
    gap: 0.4rem;
    padding: 0 0.5rem 0.4rem;
}

.lead-actions-assign-row select {
    flex: 1;
    min-width: 0;
}

.lead-actions-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--light-text);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.lead-actions-item i {
    width: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.lead-actions-item:hover:not(:disabled) {
    background: rgba(201, 176, 55, 0.1);
}

.lead-actions-item:hover:not(:disabled) i {
    color: var(--primary-gold);
}

.lead-actions-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Body: rail + main */
.lead-workspace-body {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(258px, 300px) minmax(0, 1fr);
    align-items: stretch;
    min-height: 0;
}

.lead-workspace.rail-collapsed .lead-workspace-body {
    grid-template-columns: minmax(0, 1fr);
}

/* Filter rail */
.lead-filter-rail {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(201, 176, 55, 0.12);
    background: rgba(7, 10, 17, 0.55);
}

.lead-filter-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1rem 0.7rem;
}

.lead-filter-rail-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--light-text);
}

.lead-filter-rail-title i {
    color: var(--primary-gold);
}

.lead-filter-rail-clear {
    font-size: 0.66rem !important;
}

.lead-filter-rail-search {
    position: relative;
    margin: 0 1rem 0.5rem;
}

.lead-filter-rail-search > i {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
    pointer-events: none;
}

.lead-filter-rail-search-input {
    width: 100%;
    padding: 0.55rem 0.7rem 0.55rem 2rem;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    font-family: inherit;
    font-size: 0.8rem;
}

.lead-filter-rail-search-input:focus {
    outline: none;
    border-color: rgba(201, 176, 55, 0.45);
    background: rgba(201, 176, 55, 0.05);
}

.lead-filter-rail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 1rem 1.5rem;
}

.lead-filter-section {
    padding-top: 0.85rem;
}

.lead-filter-section + .lead-filter-section {
    margin-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-filter-section-title {
    margin-bottom: 0.6rem;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.lead-filter-field {
    display: block;
    margin-bottom: 0.7rem;
}

.lead-filter-field-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.lead-filter-field-select {
    width: 100%;
}

/* Filter By Fields — collapsible section with checkbox rows (Zoho-style) */
.lead-filter-rail-clear {
    border: none;
    background: transparent;
    color: var(--primary-gold);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
}

.lead-filter-rail-clear:hover {
    text-decoration: underline;
}

.lead-filter-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.1rem 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    cursor: pointer;
}

.lead-filter-section-toggle:hover {
    color: rgba(255, 255, 255, 0.82);
}

.lead-filter-section-caret {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.18s ease;
}

.lead-filter-section-caret.open {
    transform: rotate(180deg);
}

.lead-field-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.lead-field-row.active {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding-bottom: 0.45rem;
}

.lead-field-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
}

.lead-field-check:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lead-field-check input {
    flex: none;
}

.lead-field-name {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
}

.lead-field-count {
    flex: none;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: rgba(201, 176, 55, 0.18);
    color: var(--primary-gold);
    font-size: 0.62rem;
    font-weight: 800;
}

.lead-field-control {
    padding: 0.1rem 0.4rem 0.15rem 1.95rem;
}

.lead-field-control-select {
    width: 100%;
}

.lead-field-control-tokens {
    margin-top: 0.1rem;
}

.lead-field-empty {
    margin: 0.5rem 0.4rem;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Column chooser dropdown */
.lead-columns-menu-shell {
    position: relative;
}

.lead-columns-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 70;
    width: 220px;
    padding: 0.5rem;
    border-radius: 14px;
    border: 1px solid rgba(201, 176, 55, 0.22);
    background: #0b0f18;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.lead-columns-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.5rem 0.5rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-columns-menu-title {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.lead-columns-reset {
    border: none;
    background: transparent;
    color: var(--primary-gold);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.lead-columns-reset:hover {
    text-decoration: underline;
}

.lead-columns-menu-list {
    display: flex;
    flex-direction: column;
}

.lead-columns-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

.lead-columns-item:hover {
    background: rgba(201, 176, 55, 0.08);
}

/* Main column */
.lead-workspace-main {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    background: rgba(8, 11, 18, 0.35);
}

.lead-workspace-subbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.35rem 0;
}

.lead-workspace-desc {
    margin: 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
}

.lead-history-bulk-hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

.lead-workspace-main .lead-history-pagination {
    padding: 1rem 1.35rem 1.6rem;
}

@media (max-width: 960px) {
    /* Stack rail above the table and restore normal page scrolling on small screens */
    .crm-stage:has(.lead-workspace) {
        height: auto;
        overflow-y: visible;
        padding-bottom: var(--crm-stage-pad, 1.35rem);
        display: block;
    }

    .crm-content:has(.lead-workspace),
    .crm-panel:has(.lead-workspace) {
        display: block;
    }

    .lead-workspace {
        min-height: calc(100dvh - 7rem);
    }

    .lead-workspace-body,
    .lead-workspace.rail-collapsed .lead-workspace-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .lead-filter-rail {
        border-right: none;
        border-bottom: 1px solid rgba(201, 176, 55, 0.12);
    }

    .lead-workspace-main {
        overflow-y: visible;
    }

    .lead-filter-rail-scroll {
        overflow-y: visible;
    }
}

@media (max-width: 640px) {
    .lead-workspace-toolbar {
        gap: 0.6rem;
    }

    .lead-toolbar-left,
    .lead-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

.lead-history-page {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.lead-history-hero {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.lead-history-hero-left {
    display: grid;
    gap: 0;
}

.lead-history-scope-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0;
}

.lead-history-scope-btn {
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.42);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    font-family: inherit;
}

.lead-history-scope-btn:hover {
    color: rgba(255, 255, 255, 0.82);
    border-color: rgba(201, 176, 55, 0.24);
}

.lead-history-scope-btn.active {
    background: rgba(201, 176, 55, 0.14);
    border-color: rgba(201, 176, 55, 0.38);
    color: var(--primary-gold);
}

.lead-history-hero-left h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-gold);
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.lead-history-hero-left p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.lead-history-hero-badge,
.lead-history-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    background: rgba(201, 176, 55, 0.1);
    border: 1px solid rgba(201, 176, 55, 0.3);
    color: var(--primary-gold);
    white-space: nowrap;
}

.lead-history-meta-chip {
    letter-spacing: 0.02em;
}

.lead-history-filters {
    position: relative;
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.12);
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.lead-history-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.lead-history-filter-group-saved {
    flex: 1 1 240px;
}

.lead-history-filter-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    margin-right: 0.2rem;
    white-space: nowrap;
}

.lead-history-filter-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 0.12rem;
}

.lead-history-pill {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.lead-history-pill:hover {
    border-color: rgba(201, 176, 55, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

.lead-history-pill.active {
    background: rgba(201, 176, 55, 0.14);
    border-color: rgba(201, 176, 55, 0.5);
    color: var(--primary-gold);
}

.lead-history-pill.status-new.active {
    background: rgba(243, 226, 184, 0.12);
    border-color: rgba(243, 226, 184, 0.35);
    color: #f3e2b8;
}

.lead-history-pill.status-contacted.active {
    background: rgba(119, 183, 255, 0.12);
    border-color: rgba(119, 183, 255, 0.32);
    color: #bdd7ff;
}

.lead-history-pill.status-qualified.active {
    background: rgba(76, 175, 124, 0.12);
    border-color: rgba(76, 175, 124, 0.32);
    color: #c4f3d7;
}

.lead-history-pill.status-won.active {
    background: rgba(201, 176, 55, 0.14);
    border-color: rgba(201, 176, 55, 0.45);
    color: #f6de9a;
}

.lead-history-pill.status-inactive.active {
    background: rgba(201, 201, 214, 0.1);
    border-color: rgba(201, 201, 214, 0.25);
    color: #d7d7e3;
}

.lead-history-filter-empty {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

.lead-history-select {
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
    outline: none;
    transition: border-color 0.18s;
    min-width: 130px;
}

.lead-history-toolbar-select {
    min-width: 138px;
}

.lead-history-select:focus {
    border-color: rgba(201, 176, 55, 0.45);
}

.lead-history-clear-btn,
.lead-history-mini-btn {
    font-size: 0.67rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.lead-history-clear-btn:hover,
.lead-history-mini-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(201, 176, 55, 0.25);
}

.lead-history-mini-btn.primary {
    background: rgba(201, 176, 55, 0.08);
    color: var(--primary-gold);
    border-color: rgba(201, 176, 55, 0.25);
}

.lead-history-clear-btn:disabled,
.lead-history-mini-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lead-history-table-card {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.12);
    border-radius: 14px;
    overflow-x: clip;
}

.lead-history-advanced-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lead-history-advanced-shell.open {
    z-index: 46;
}

.lead-history-advanced-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(440px, calc(100vw - 3rem));
    max-height: min(84vh, 720px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 18px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(5, 8, 16, 0.96);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-x: clip;
    z-index: 45;
}

.lead-history-advanced-menu-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.7rem 0.78rem 0.62rem;
    border-bottom: 1px solid rgba(201, 176, 55, 0.08);
    flex-wrap: wrap;
}

.lead-history-advanced-menu-scroll {
    min-height: 0;
    overflow-y: auto;
    padding: 0.62rem 0.78rem 0.78rem;
}

.lead-history-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.lead-history-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.82);
}

.lead-history-section-copy {
    margin: 0.18rem 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.42);
}

.lead-history-filter-panel {
    gap: 0.65rem;
}

.lead-history-save-form {
    margin-top: 0.35rem;
}

.lead-history-save-form.compact {
    margin-top: 0;
}

.lead-history-saved-form-actions {
    margin-top: 1rem;
}

.lead-history-saved-list {
    margin-top: 1rem;
}

.lead-history-saved-card {
    padding: 0.8rem 0.85rem;
}

.lead-history-saved-card-actions {
    margin-top: 0.75rem;
}

.lead-history-empty-state {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.025);
}

.lead-history-table-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.85rem 1.25rem 0.7rem;
    border-bottom: 1px solid rgba(201, 176, 55, 0.08);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lead-history-table-meta-left,
.lead-history-table-meta-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lead-history-table-meta-left {
    align-items: flex-start;
}

.lead-history-table-meta-right {
    margin-left: auto;
}

.lead-history-table-title-stack {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.lead-history-table-title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lead-history-table-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
}

.lead-history-table-copy {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.42);
}

.lead-history-count-badge {
    font-size: 0.63rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    background: rgba(201, 176, 55, 0.1);
    border: 1px solid rgba(201, 176, 55, 0.2);
    color: var(--primary-gold);
    align-self: center;
}

.lead-history-page-size {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.lead-history-page-size-select,
.lead-history-bulk-select {
    min-width: 110px;
}

.lead-history-bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(201, 176, 55, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.lead-history-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
}

.crm-table.lead-history-table {
    min-width: 980px;
    font-size: 0.78rem;
}

.crm-table.lead-history-table thead th {
    position: static;
    background: transparent;
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(201, 176, 55, 0.08);
    white-space: nowrap;
}

.crm-table.lead-history-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.crm-table.lead-history-table tbody tr:hover {
    background: rgba(201, 176, 55, 0.04);
}

.crm-table.lead-history-table td {
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    border-bottom: none;
}

.crm-table.lead-history-table .sort-button {
    gap: 0.3rem;
    font-size: 0.63rem;
    letter-spacing: 0.07em;
    color: inherit;
}

.crm-table.lead-history-table .sort-button i {
    opacity: 0.4;
    font-size: 0.55rem;
    color: var(--crm-text-muted);
}

.crm-table.lead-history-table .sort-button.active i {
    opacity: 1;
    color: var(--primary-gold);
}

.lead-history-name-cell,
.lead-history-notes-cell,
.lead-history-tags-cell {
    white-space: normal;
}

.lead-history-submeta {
    display: block;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.72rem;
}

.lead-history-tag {
    --tag-h: 43;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.12rem 0.3rem 0.12rem 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: hsla(var(--tag-h), 60%, 55%, 0.16);
    border: 1px solid hsla(var(--tag-h), 55%, 60%, 0.45);
    color: hsl(var(--tag-h), 78%, 80%);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.lead-history-tag strong {
    color: inherit;
}

.lead-history-tag-more {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.55);
}

.lead-history-notes-preview {
    max-width: 260px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

.lead-history-muted {
    color: rgba(255, 255, 255, 0.35);
}

.lead-history-pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.95rem 1.25rem 1rem;
    border-top: 1px solid rgba(201, 176, 55, 0.08);
    color: rgba(255, 255, 255, 0.45);
}

.lead-history-pagination-copy {
    font-size: 0.78rem;
}

.lead-history-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
}

.lead-history-state i {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.65rem;
}

.ov-page {
    position: relative;
    z-index: 1;
}

.ov-hero {
    padding: 4.75rem 2rem 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    text-align: center;
}

.ov-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 520px;
    background: radial-gradient(ellipse at center, rgba(201, 176, 55, 0.09) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ov-hero-inner {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(18px);
    animation: ov-fade-up 0.65s ease 0.1s forwards;
}

@keyframes ov-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ov-hero-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-gold);
    border: 1px solid rgba(201, 176, 55, 0.3);
    border-radius: 20px;
    padding: 0.3rem 0.95rem;
    margin-bottom: 1.25rem;
}

.ov-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--light-text);
    margin: 0 0 1rem;
}

.ov-hero h1 em {
    font-style: italic;
    display: inline-block;
    padding-bottom: 0.12em;
    padding-right: 0.12em;
    margin-right: -0.12em;
    background: linear-gradient(135deg, var(--primary-gold) 20%, var(--secondary-gold) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ov-hero-desc {
    font-size: 1rem;
    color: var(--gray-text);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.ov-feature {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.ov-feature-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.ov-feature-number {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--primary-gold);
}

.crm-countup-number {
    font-variant-numeric: tabular-nums;
}

.ov-divider {
    border: none;
    border-top: 1px solid rgba(201, 176, 55, 0.12);
    margin: 0;
}

.ov-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.ov-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.75rem 0;
}

.ov-stat-tile {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    position: relative;
    overflow-x: clip;
}

.ov-stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 14px 14px 0 0;
}

#ov-stat-leads::before {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

#ov-stat-members::before {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

#ov-stat-status::before {
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold));
}

#ov-stat-tag::before {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.ov-stat-tile-label {
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 0.35rem;
}

.ov-stat-tile-value {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--light-text);
}

.ov-stat-tile-sub {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.22);
    margin-top: 0.3rem;
}

.ov-insight-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.ov-insight-mini {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.15);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.ov-insight-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-text);
    margin-bottom: 0.35rem;
}

.ov-insight-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-text);
}

.ov-progress-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 0.5rem;
    overflow-x: clip;
}

.ov-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #34d399, #0ea5e9);
}

.ov-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.ov-card {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.18);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow-x: clip;
}

.ov-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold));
}

.ov-card-wide {
    grid-column: 1 / -1;
}

.ov-card-title {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.ov-status-list,
.ov-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.ov-status-list li,
.ov-activity-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ov-activity-main {
    display: grid;
    gap: 0.2rem;
}

.ov-activity-title {
    font-weight: 700;
}

.ov-activity-meta {
    color: var(--crm-text-muted);
    font-size: 0.86rem;
}

.ov-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.4rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    color: var(--crm-text-soft);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ov-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ov-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.45rem 0.82rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ov-tag-chip strong {
    color: var(--crm-accent);
}

.ov-card-empty {
    color: var(--gray-text);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0.25rem 0.5rem;
}

.filter-row {
    justify-content: space-between;
    margin: 1.2rem 0 1rem;
}

.saved-filter-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.page-size-shell {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.page-size-shell .crm-select {
    min-width: 92px;
}

.saved-filter-strip {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.saved-filter-chip,
.lead-link-button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--light-text);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.saved-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    font-weight: 700;
}

.saved-filter-chip.active {
    background: rgba(201, 176, 55, 0.12);
    color: var(--crm-accent);
    border-color: rgba(201, 176, 55, 0.24);
}

.lead-link-button {
    border-radius: 12px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--light-text);
    font-weight: 700;
    text-align: left;
}

.lead-link-button:hover {
    color: var(--crm-accent);
}

.lead-link-button:focus-visible,
.saved-filter-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.14);
}

.crm-filter-panel {
    display: grid;
    gap: 1rem;
}

.single-column-grid {
    grid-template-columns: 1fr;
}

.multi-filter-group {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    overflow-x: clip;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.multi-filter-group.open {
    border-color: rgba(201, 176, 55, 0.2);
    background: rgba(201, 176, 55, 0.05);
    box-shadow: 0 0 0 1px rgba(201, 176, 55, 0.08) inset;
}

.multi-filter-toggle {
    width: 100%;
    padding: 0.62rem 0.72rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
}

.multi-filter-toggle-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.multi-filter-toggle-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.multi-filter-toggle-icon {
    color: rgba(255, 255, 255, 0.42);
    transition: transform 0.18s ease, color 0.18s ease;
}

.multi-filter-toggle:hover .mapping-label,
.multi-filter-toggle:hover .multi-filter-toggle-icon {
    color: rgba(255, 255, 255, 0.92);
}

.multi-filter-toggle:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(201, 176, 55, 0.2);
}

.multi-filter-group.open .multi-filter-toggle-icon {
    color: var(--crm-accent);
    transform: rotate(180deg);
}

.multi-filter-panel {
    display: none;
    gap: 0.65rem;
    padding: 0 0.72rem 0.72rem;
}

.multi-filter-group.open .multi-filter-panel {
    display: grid;
}

.multi-filter-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.multi-filter-shell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    align-items: center;
    min-height: 40px;
    padding: 0.45rem 0.58rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.multi-filter-select-shell {
    display: block;
}

.multi-filter-select {
    min-width: 0;
    padding: 0.58rem 0.72rem;
    border-radius: 10px;
}

.filter-token {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.62rem;
    border-radius: 999px;
    background: rgba(201, 176, 55, 0.12);
    border: 1px solid rgba(201, 176, 55, 0.2);
    color: var(--crm-accent);
    font-size: 0.77rem;
    font-weight: 700;
}

.filter-token-remove,
.filter-clear-button {
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
}

.filter-token-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.filter-token-input {
    flex: 1 1 130px;
    min-width: 120px;
    border: none;
    background: transparent;
    color: var(--light-text);
    padding: 0.2rem 0;
}

.filter-token-input:focus {
    outline: none;
}

.filter-token-input::placeholder {
    color: var(--crm-text-muted);
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.crm-select,
.crm-input,
.crm-textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: var(--light-text);
    padding: 0.85rem 0.95rem;
}

.crm-select:disabled,
.crm-input[readonly],
.crm-textarea[readonly] {
    opacity: 0.74;
    cursor: not-allowed;
}

.crm-phone-link,
.crm-email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    color: var(--crm-accent);
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 0.18em;
}

.crm-phone-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.crm-phone-action-group.is-field {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 0.55rem;
}

.crm-phone-action-group.is-field .crm-contact-field {
    flex: 1 1 auto;
    min-width: 0;
}

.crm-phone-primary-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-width: 0;
}

.crm-phone-link-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.42rem;
    border-radius: 999px;
    background: rgba(102, 185, 255, 0.18);
    color: #a8dbff;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.crm-phone-utility-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.crm-phone-utility-actions.is-field {
    align-self: stretch;
}

.crm-phone-utility-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.95rem;
    min-width: 1.95rem;
    height: 1.95rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 176, 55, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 244, 214, 0.86);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.crm-phone-utility-button:hover,
.crm-phone-utility-button:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(201, 176, 55, 0.42);
    background: rgba(201, 176, 55, 0.12);
    color: var(--primary-gold);
}

.crm-email-trigger,
.crm-contact-field-button {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    text-align: left;
}

.crm-email-trigger {
    border: none;
    background: none;
    padding: 0;
}

.crm-phone-link span,
.crm-email-link span,
.crm-contact-field span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.crm-contact-field .crm-phone-primary-copy {
    flex: 1 1 auto;
}

.crm-phone-link.has-icon i,
.crm-email-link.has-icon i,
.crm-contact-field i {
    flex: 0 0 auto;
    font-size: 0.82rem;
}

.crm-phone-link:hover,
.crm-phone-link:focus-visible,
.crm-email-link:hover,
.crm-email-link:focus-visible {
    color: var(--primary-gold);
    text-decoration: underline;
    outline: none;
}

.crm-phone-link.is-google-voice,
.crm-contact-field.is-google-voice {
    color: #8fd0ff;
}

.crm-contact-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-decoration: none;
}

.crm-contact-field-button {
    width: 100%;
}

.crm-contact-field.is-callable {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.crm-contact-field.is-callable:hover,
.crm-contact-field.is-callable:focus-visible {
    outline: none;
    border-color: rgba(201, 176, 55, 0.34);
    background: rgba(201, 176, 55, 0.08);
    box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.12);
}

.crm-contact-field.is-callable i {
    color: var(--crm-accent);
}

.crm-phone-link.is-google-voice,
.crm-contact-field.is-google-voice {
    color: #8fd0ff;
}

.crm-contact-field .crm-phone-primary-copy {
    flex: 1 1 auto;
}

.crm-contact-field.is-static {
    cursor: default;
}

.crm-select {
    min-width: 160px;
}

.crm-textarea {
    resize: vertical;
    min-height: 130px;
}

.lead-detail-shell {
    gap: 1.1rem;
}

.lead-summary-card {
    overflow-x: clip;
}

.lead-detail-layout {
    display: grid;
    gap: 1.2rem;
}

.lead-detail-layout.history-visible {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    align-items: start;
}

.lead-history-panel {
    position: sticky;
    top: 96px;
}

.table-shell {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.crm-table thead th {
    position: sticky;
    top: 0;
    background: rgba(10, 14, 22, 0.96);
    z-index: 1;
    text-align: left;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--crm-text-soft);
    font-size: 0.84rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.crm-table tbody tr {
    cursor: default;
    transition: background 0.2s ease;
}

.crm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.crm-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}

.selection-cell {
    width: 48px;
    text-align: center;
}

.crm-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--crm-accent-strong);
}

.bulk-toolbar {
    justify-content: flex-end;
}

.sort-button {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    padding: 0;
}

.sort-button i {
    color: var(--crm-text-muted);
}

.notes-preview {
    max-width: 280px;
    color: var(--crm-text-soft);
}

.pagination-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: var(--crm-text-soft);
}

.tag-picker {
    display: grid;
    gap: 0.5rem;
}

.tag-picker-shell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    min-height: 58px;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.tag-picker-shell.readonly {
    opacity: 0.82;
}

.tag-picker-chips {
    display: contents;
}

.tag-picker-input {
    flex: 1 1 140px;
    min-width: 140px;
    border: none;
    background: transparent;
    color: var(--light-text);
    padding: 0.35rem 0;
}

.tag-picker-input:focus {
    outline: none;
}

.tag-picker-input::placeholder {
    color: var(--crm-text-muted);
}

.tag-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-suggestion {
    border: 1px solid rgba(201, 176, 55, 0.2);
    background: rgba(201, 176, 55, 0.08);
    color: var(--crm-accent);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-weight: 700;
}

.compact-history {
    margin-top: 0;
}

.drawer-overlay,
.crm-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 45;
}

.crm-modal-layer {
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background: rgba(4, 6, 12, 0.72);
}

.crm-modal {
    width: min(980px, 100%);
    max-height: min(88vh, 940px);
    overflow: auto;
    padding: 1.3rem;
    border-radius: 24px;
    border: 1px solid var(--crm-border-strong);
    background: linear-gradient(160deg, rgba(19, 24, 38, 0.94) 0%, rgba(7, 10, 17, 0.98) 100%);
    box-shadow: var(--crm-shadow);
}

.drawer-open .crm-drawer {
    transform: translateX(0);
}

.crm-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(520px, 100vw);
    height: 100vh;
    padding: 1.2rem;
    background: rgba(6, 9, 16, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
    overflow: auto;
    z-index: 55;
    transform: translateX(102%);
    transition: transform 0.28s ease;
}

.crm-drawer.crm-drawer-preview {
    width: min(640px, 100vw);
}

.crm-drawer.crm-drawer-email-compose {
    width: min(560px, 100vw);
}

.drawer-surface {
    display: grid;
    gap: 1rem;
}

.crm-search-preview-drawer {
    gap: 1rem;
}

.crm-search-preview-shell {
    position: relative;
    display: grid;
    gap: 1rem;
    overflow-x: clip;
    border-radius: 22px;
    border: 1px solid rgba(201, 176, 55, 0.28);
    border-top: 3px solid var(--primary-gold);
    padding: 1.35rem;
    background: linear-gradient(150deg, rgba(201, 176, 55, 0.1) 0%, rgba(10, 14, 22, 0.85) 55%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.crm-search-preview-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.crm-search-preview-shell:hover::after {
    opacity: 1;
    animation: crm-card-shimmer-sweep 0.65s ease forwards;
}

.crm-search-preview-shell > * {
    position: relative;
    z-index: 1;
}

.crm-search-preview-shell-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.crm-search-preview-header {
    min-width: 0;
}

.crm-search-preview-shell .drawer-title {
    margin: 0.7rem 0 0.35rem;
    font-size: clamp(2rem, 6vw, 3rem);
}

.crm-search-preview-subtitle {
    margin: 0;
    color: var(--crm-text-soft);
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.crm-search-preview-close {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(201, 176, 55, 0.2);
    background: rgba(10, 13, 22, 0.72);
    color: var(--light-text);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.crm-search-preview-close:hover,
.crm-search-preview-close:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(201, 176, 55, 0.34);
    background: rgba(201, 176, 55, 0.12);
    color: var(--primary-gold);
}

.crm-search-preview-meta {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(10, 13, 22, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.crm-search-preview-pills {
    gap: 0.65rem;
}

.crm-search-preview-pills .summary-chip {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.crm-search-preview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.crm-search-preview-section {
    position: relative;
    overflow-x: clip;
    display: grid;
    gap: 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(9, 13, 22, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    padding: 1.05rem;
}

.crm-search-preview-section-full {
    grid-column: 1 / -1;
}

.crm-search-preview-section-head {
    display: grid;
    gap: 0.35rem;
}

.crm-search-preview-section-title {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.crm-search-preview-section-copy {
    margin: 0;
    color: var(--crm-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.crm-search-preview-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.crm-search-preview-field {
    display: grid;
    gap: 0.45rem;
}

.crm-search-preview-field.is-full {
    grid-column: 1 / -1;
}

.crm-search-preview-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.crm-search-preview-field-value {
    min-height: 58px;
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(10, 13, 22, 0.7);
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 12px;
    color: var(--light-text);
    font-size: 0.95rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.crm-search-preview-field-value .crm-phone-link {
    width: fit-content;
    max-width: 100%;
}

.crm-search-preview-field-value .crm-phone-action-group {
    width: fit-content;
    max-width: 100%;
}

.crm-search-preview-field-value .crm-email-link {
    width: fit-content;
    max-width: 100%;
}

.crm-search-preview-chip-wrap {
    min-height: 64px;
    align-items: flex-start;
}

.crm-search-preview-chip-wrap .tag-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(201, 176, 55, 0.18);
}

.crm-search-preview-text-panel {
    display: grid;
    gap: 0.75rem;
    min-height: 118px;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(10, 13, 22, 0.7);
}

.crm-search-preview-copy {
    color: var(--light-text);
    line-height: 1.7;
    white-space: pre-wrap;
}

.crm-search-preview-panel-meta {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-search-preview-actions {
    margin-top: 0.25rem;
    justify-content: flex-start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

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

.form-label {
    font-size: 0.86rem;
    color: var(--crm-text-soft);
    font-weight: 700;
}

.meta-grid {
    display: grid;
    gap: 0.75rem;
}

.meta-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state,
.loading-state {
    min-height: 280px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    border: 1px dashed rgba(201, 176, 55, 0.22);
    background: rgba(255, 255, 255, 0.02);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--crm-accent);
    animation: crm-spin 0.9s linear infinite;
    margin: 0 auto 1rem;
}

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

.import-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    margin-top: 1rem;
}

.mapping-grid {
    display: grid;
    gap: 0.75rem;
}

.mapping-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
}

.mapping-label {
    color: var(--crm-text-soft);
    font-weight: 700;
}

.mapping-hint {
    margin: 0;
    color: var(--crm-text-muted);
    font-size: 0.84rem;
}

.lead-history-advanced-menu .mapping-label {
    font-size: 0.79rem;
    line-height: 1.12;
}

.lead-history-advanced-menu .mapping-hint {
    font-size: 0.73rem;
    line-height: 1.3;
}

.lead-history-advanced-menu .summary-chip {
    gap: 0.35rem;
    padding: 0.3rem 0.62rem;
    font-size: 0.71rem;
}

.lead-history-advanced-menu .lead-history-clear-btn {
    padding: 0.32rem 0.62rem;
    font-size: 0.65rem;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.stat-tile {
    padding: 0.95rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-tile-label {
    color: var(--crm-text-muted);
    font-size: 0.8rem;
}

.stat-tile-value {
    margin-top: 0.45rem;
    font-size: 1.55rem;
    font-weight: 800;
}

.sample-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.sample-table th,
.sample-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    font-size: 0.9rem;
}

.sample-table th {
    color: var(--crm-text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.history-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.history-sublist {
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 0.75rem;
}

.history-version {
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-version-meta {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.history-card {
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.note-history-copy {
    margin-top: 0.85rem;
    color: var(--crm-text-soft);
    white-space: pre-wrap;
}

.history-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.history-title {
    font-size: 1rem;
    font-weight: 700;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.history-audit-grid {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.merge-resolution-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 0.9rem;
}

.merge-choice-card {
    display: grid;
    gap: 0.45rem;
    padding: 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.merge-choice-card input {
    accent-color: var(--crm-accent-strong);
}

.inline-code {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--light-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.danger-box {
    border-radius: 20px;
    padding: 1.1rem;
    border: 1px solid rgba(241, 111, 111, 0.22);
    background: rgba(241, 111, 111, 0.06);
}

@keyframes crm-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crm-card-shimmer-sweep {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.lead-detail-page {
    display: grid;
    gap: 0.8rem;
}

.crm-settings-page {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.lead-detail-hero,
.crm-settings-hero {
    position: relative;
    overflow-x: clip;
}

.lead-detail-hero {
    padding: 0.55rem 1.5rem 1.3rem;
    margin-bottom: -0.3rem;
    text-align: center;
}

.lead-detail-hero .crm-detail-utility {
    position: relative;
    z-index: 2;
    max-width: 1040px;
    margin: 0 auto 1.25rem;
}

.lead-detail-hero::before {
    content: '';
    position: absolute;
    top: -110px;
    left: 50%;
    transform: translateX(-50%);
    width: 760px;
    height: 440px;
    background: radial-gradient(ellipse at center, rgba(201, 176, 55, 0.11) 0%, transparent 70%);
    pointer-events: none;
}

.lead-detail-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 10, 17, 0) 0%, rgba(7, 10, 17, 0.08) 64%, rgba(7, 10, 17, 0.52) 100%),
        radial-gradient(circle at 28% 20%, rgba(201, 176, 55, 0.08), transparent 28%),
        radial-gradient(circle at 72% 34%, rgba(119, 183, 255, 0.08), transparent 30%);
    pointer-events: none;
}

.lead-detail-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(18px);
    animation: crm-fade-up 0.6s ease 0.05s forwards;
}

.lead-detail-hero-label,
.crm-settings-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-gold);
    background: rgba(201, 176, 55, 0.08);
    border: 1px solid rgba(201, 176, 55, 0.22);
    border-radius: 999px;
    padding: 0.34rem 0.95rem;
}

.lead-detail-hero h1 {
    margin: 1.1rem 0 0.8rem;
    font-size: clamp(2.3rem, 4.4vw, 3.55rem);
    font-weight: 900;
    line-height: 1.07;
    letter-spacing: -0.03em;
}

.lead-detail-hero-summary {
    max-width: 680px;
    margin: 0 auto;
    color: var(--crm-text-soft);
    font-size: 1rem;
    line-height: 1.68;
}

.lead-detail-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.35rem;
}

.lead-detail-hero-meta .summary-chip {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(201, 176, 55, 0.14);
    color: var(--light-text);
}

.lead-detail-content {
    display: grid;
    width: 100%;
    max-width: 1120px;
    margin: -0.1rem auto 0;
    grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.76fr);
    gap: 1.25rem;
    align-items: start;
    position: relative;
    z-index: 2;
}

.lead-detail-contact-card {
    overflow-x: clip;
    background: linear-gradient(150deg, rgba(201, 176, 55, 0.1) 0%, rgba(10, 14, 22, 0.88) 55%);
    border: 1px solid rgba(201, 176, 55, 0.28);
    border-top: 3px solid var(--primary-gold);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lead-detail-contact-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.lead-detail-contact-card:hover::after {
    opacity: 1;
    animation: crm-card-shimmer-sweep 0.65s ease forwards;
}

.lead-detail-card-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    margin-bottom: 1.25rem;
}

.lead-detail-card-head-copy {
    max-width: 620px;
}

.lead-detail-card-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-gold);
    background: rgba(201, 176, 55, 0.08);
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 999px;
    padding: 0.32rem 0.86rem;
    margin-bottom: 0.85rem;
}

.lead-detail-card-head-copy > .lead-detail-card-label:last-child,
.lead-detail-side-card .panel-head > div > .lead-detail-card-label:last-child {
    margin-bottom: 0;
}

.lead-detail-card-head h2 {
    margin: 0;
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    line-height: 1.1;
}

.lead-detail-card-head p {
    margin: 0.7rem 0 0;
    max-width: 620px;
    color: var(--crm-text-soft);
    line-height: 1.62;
}

.lead-detail-card-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lead-detail-action-button {
    padding: 0.58rem 0.85rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.1;
}

.lead-detail-action-button i {
    font-size: 0.82rem;
}

.lead-detail-form-grid {
    position: relative;
    z-index: 1;
    gap: 1rem;
    justify-content: start;
}

.lead-detail-form-grid > .form-field {
    width: min(100%, 440px);
    justify-self: start;
}

.lead-detail-form-grid > .form-field.form-field-full {
    width: min(100%, 896px);
    max-width: 100%;
    justify-self: start;
}

.lead-detail-contact-card .form-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.lead-detail-contact-card .crm-input,
.lead-detail-contact-card .crm-select,
.lead-detail-contact-card .crm-textarea,
.lead-detail-note-form .crm-textarea {
    border-radius: 16px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: rgba(7, 10, 17, 0.68);
    padding: 0.95rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.lead-detail-contact-card .crm-input:hover,
.lead-detail-contact-card .crm-select:hover,
.lead-detail-contact-card .crm-textarea:hover,
.lead-detail-note-form .crm-textarea:hover {
    border-color: rgba(201, 176, 55, 0.28);
}

.lead-detail-contact-card .crm-select:disabled,
.lead-detail-contact-card .crm-input[readonly],
.lead-detail-contact-card .crm-textarea[readonly] {
    opacity: 1;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.66);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: none;
}

.lead-detail-contact-card .crm-contact-field.is-static {
    opacity: 1;
    color: rgba(255, 255, 255, 0.66);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: none;
}

.lead-detail-contact-card .crm-contact-field.is-callable {
    color: var(--light-text);
}

.lead-detail-email-card .panel-head {
    align-items: flex-start;
}

.crm-email-history-list {
    gap: 0.85rem;
}

.crm-email-history-list-single {
    margin-top: 0.35rem;
}

.crm-email-history-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.35rem 0 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.35rem;
}

.crm-email-history-pager-label {
    font-size: 0.78rem;
    color: var(--crm-text-muted);
    letter-spacing: 0.04em;
}

.crm-email-history-pager-btn {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
}

.crm-email-history-pager-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.crm-email-history-body-scroll {
    max-height: 14rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 0.5rem;
}

.crm-email-history-card {
    border-left: 3px solid rgba(201, 176, 55, 0.22);
}

.crm-email-history-card.sent {
    border-left-color: rgba(76, 175, 124, 0.55);
}

.crm-email-history-card.failed {
    border-left-color: rgba(241, 111, 111, 0.58);
}

.crm-email-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    margin-top: 0.9rem;
    color: var(--crm-text-soft);
    font-size: 0.78rem;
}

.crm-email-history-error {
    color: #ffb4b4;
}

.summary-chip.sent {
    background: rgba(76, 175, 124, 0.14);
    color: #bdecca;
}

.summary-chip.failed {
    background: rgba(241, 111, 111, 0.14);
    color: #ffc2c2;
}

.lead-detail-contact-card .tag-picker-shell {
    min-height: 60px;
    border-radius: 16px;
    border-color: rgba(201, 176, 55, 0.18);
    background: rgba(7, 10, 17, 0.62);
}

.lead-detail-contact-card .tag-picker-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.lead-detail-form-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.lead-detail-sidebar {
    display: grid;
    gap: 1rem;
    align-self: start;
}

.lead-detail-side-card {
    border: 1px solid rgba(201, 176, 55, 0.18);
}

.lead-detail-side-card .section-title {
    margin: 0.1rem 0 0;
    font-size: 1.28rem;
}

.lead-detail-side-card .panel-copy {
    color: var(--crm-text-soft);
}

.lead-detail-note-form {
    margin-top: 1rem;
}

.lead-detail-note-form .crm-textarea {
    min-height: 150px;
}

.lead-detail-notes-card .history-card {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.05);
}

.lead-detail-empty-copy {
    margin-top: 1rem;
}

.crm-modal-layer.crm-modal-layer-history {
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: crm-history-backdrop-in 0.24s ease both;
}

.crm-history-modal {
    width: min(980px, 100%);
    max-height: min(84vh, 920px);
    padding: 0;
    overflow-x: clip;
    border-radius: 28px;
    border: 1px solid rgba(201, 176, 55, 0.22);
    border-top: 3px solid var(--primary-gold);
    background: linear-gradient(160deg, rgba(14, 18, 29, 0.96) 0%, rgba(5, 8, 16, 0.99) 100%);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
    position: relative;
    opacity: 0;
    transform: translateY(26px) scale(0.97);
    animation: crm-history-modal-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.crm-history-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(201, 176, 55, 0.14), transparent 34%),
        radial-gradient(circle at 82% 16%, rgba(119, 183, 255, 0.08), transparent 28%);
    pointer-events: none;
}

.crm-history-modal-head,
.crm-history-modal-body {
    position: relative;
    z-index: 1;
}

.crm-history-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.4rem 1rem;
}

.crm-history-modal-copy {
    --crm-history-copy-offset: 0.9rem;
    max-width: 720px;
}

.crm-history-modal-copy .modal-title {
    padding-left: var(--crm-history-copy-offset);
    margin-top: 0.3rem;
}

.crm-history-modal-copy .crm-history-modal-meta {
    padding-left: var(--crm-history-copy-offset);
}

.crm-history-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.crm-history-modal-body {
    padding: 0 1.4rem 1.35rem;
}

.crm-history-modal-scroll {
    max-height: calc(min(84vh, 920px) - 184px);
    overflow: auto;
    padding-right: 0.15rem;
}

.crm-history-entry-list {
    margin-top: 0;
}

.crm-history-modal .history-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(201, 176, 55, 0.14);
}

.crm-history-modal-empty {
    padding: 1.2rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--crm-text-soft);
    line-height: 1.6;
}

@keyframes crm-history-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes crm-history-modal-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.crm-settings-hero {
    padding: 1.25rem 0.25rem 0.45rem;
}

.crm-settings-hero::before {
    content: '';
    position: absolute;
    top: -140px;
    left: -40px;
    width: 680px;
    height: 460px;
    background: radial-gradient(ellipse at center, rgba(201, 176, 55, 0.1) 0%, transparent 72%);
    pointer-events: none;
}

.crm-settings-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 860px;
    opacity: 0;
    transform: translateY(16px);
    animation: crm-fade-up 0.6s ease 0.08s forwards;
}

.crm-settings-hero h1 {
    margin: 1.05rem 0 0.95rem;
    font-size: clamp(2.2rem, 4.6vw, 3.7rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.crm-settings-hero h1 em {
    font-style: italic;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.crm-settings-hero-desc {
    max-width: 620px;
    color: var(--crm-text-soft);
    line-height: 1.65;
}

.crm-settings-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.45rem;
}

.crm-settings-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.36rem 0.92rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.crm-settings-chip i {
    font-size: 0.72rem;
    color: var(--primary-gold);
}

.crm-settings-chip.is-active {
    background: rgba(201, 176, 55, 0.12);
    border-color: rgba(201, 176, 55, 0.35);
    color: var(--primary-gold);
}

.crm-settings-shell {
    display: grid;
    width: 100%;
    max-width: 1240px;
    margin: 0.2rem auto 0;
    grid-template-columns: minmax(180px, 210px) minmax(0, 1fr);
    gap: clamp(0.95rem, 1.8vw, 1.2rem);
    align-items: start;
}

.crm-settings-rail {
    position: static;
    display: grid;
    gap: 0.55rem;
    align-self: start;
    z-index: 3;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.crm-settings-nav-card,
.crm-settings-stage-header,
.crm-settings-card {
    border: 1px solid rgba(201, 176, 55, 0.18);
    background: linear-gradient(180deg, rgba(14, 18, 27, 0.995) 0%, rgba(10, 14, 22, 0.99) 100%);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
    position: relative;
    isolation: isolate;
    overflow-x: clip;
}

.crm-settings-nav-card,
.crm-settings-stage-header,
.crm-settings-card {
    border-radius: 20px;
}

.crm-settings-context-card {
    display: none !important;
}

.crm-settings-context-kicker,
.crm-settings-stage-kicker {
    display: none !important;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary-gold);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-settings-context-card h1,
.crm-settings-stage-header h2 {
    margin: 0;
    color: var(--light-text);
    letter-spacing: -0.02em;
}

.crm-settings-context-card p,
.crm-settings-stage-header p {
    display: none !important;
}

.crm-settings-context-chips {
    display: none !important;
}

.crm-settings-nav-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: transparent;
    box-shadow: none;
    border: 0;
    overflow: visible;
}

.crm-settings-nav-button {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 20, 30, 0.72);
    color: var(--light-text);
    display: flex;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.crm-settings-nav-button:hover,
.crm-settings-nav-button:focus-visible,
.crm-settings-nav-button.is-active {
    border-color: rgba(201, 176, 55, 0.28);
    background: linear-gradient(180deg, rgba(34, 30, 18, 0.88) 0%, rgba(22, 20, 15, 0.92) 100%);
    transform: translateY(-1px);
    outline: none;
}

.crm-settings-nav-button-copy {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
}

.crm-settings-nav-button-copy small {
    display: none !important;
}

.crm-settings-nav-button-copy strong {
    font-size: 0.98rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.crm-settings-main {
    display: grid;
    gap: 0.9rem;
    width: 100%;
    max-width: 980px;
    min-width: 0;
    position: relative;
    z-index: 1;
    padding: 0.15rem 0;
}

.crm-settings-mobile-nav {
    display: none;
    gap: 0.42rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(201, 176, 55, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 20, 30, 0.985) 0%, rgba(10, 14, 22, 0.975) 100%);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.crm-settings-mobile-nav-label {
    color: var(--crm-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-settings-section-select {
    min-width: 0;
}

.crm-settings-stage-header {
    padding: 0.95rem 1.05rem;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(15, 20, 30, 0.995) 0%, rgba(10, 14, 22, 0.995) 100%);
}

.crm-settings-stage-header h2 {
    font-size: 1.35rem;
}

.crm-settings-card-title p,
.crm-settings-stage-header p,
.crm-settings-context-card p {
    display: none;
}

.crm-settings-subcard-head span {
    display: none;
}

.crm-settings-stage-body,
.crm-settings-stage-stack {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
}

.crm-settings-stage-grid {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
}

.crm-settings-stage-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-settings-card {
    padding: 1rem;
    background: linear-gradient(180deg, rgba(15, 20, 30, 0.985) 0%, rgba(10, 14, 22, 0.975) 100%);
    border-radius: 18px;
    min-width: 0;
}

.crm-settings-card-full {
    grid-column: 1 / -1;
}

.crm-settings-card-wide {
    grid-column: 1 / -1;
}

.crm-settings-card-danger {
    background: rgba(18, 7, 7, 0.82);
    border-color: rgba(241, 111, 111, 0.28);
}

.crm-settings-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    align-items: flex-start;
    flex-wrap: wrap;
    min-width: 0;
}

.crm-settings-card-title {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    min-width: 0;
}

.crm-settings-card-title > div,
.crm-settings-subcard-head > div {
    min-width: 0;
}

.crm-settings-card-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(201, 176, 55, 0.12);
    border: 1px solid rgba(201, 176, 55, 0.22);
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-settings-card-danger .crm-settings-card-icon {
    background: rgba(241, 111, 111, 0.12);
    border-color: rgba(241, 111, 111, 0.25);
    color: #ff8d8d;
}

.crm-settings-card-title h2 {
    margin: 0;
    font-size: 1.05rem;
}

.crm-settings-card-title p {
    margin: 0.24rem 0 0;
    color: var(--crm-text-soft);
    line-height: 1.55;
    max-width: 44rem;
    font-size: 0.92rem;
}

.crm-settings-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: 100%;
    white-space: nowrap;
}

.crm-settings-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    margin-top: 0.8rem;
}

.crm-mailbox-form,
.crm-email-drawer-form {
    margin-top: 1.1rem;
}

.crm-settings-mailbox-form,
.crm-settings-inline-form {
    margin-top: 0;
}

.crm-email-drawer-note {
    margin-top: -0.15rem;
    margin-bottom: 0.1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background: rgba(201, 176, 55, 0.08);
    color: var(--crm-text-soft);
    line-height: 1.55;
}

.crm-email-drawer-note strong {
    color: var(--light-text);
    font-weight: 700;
}

.crm-settings-field {
    display: grid;
    gap: 0.38rem;
}

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

.crm-settings-subcard {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.crm-settings-subcard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
}

.crm-settings-subcard-head strong {
    display: block;
    color: var(--light-text);
    font-size: 0.96rem;
}

.crm-settings-subcard-head span {
    display: block;
    margin-top: 0.18rem;
    color: var(--crm-text-soft);
    font-size: 0.84rem;
    line-height: 1.5;
}

.crm-mailbox-editor-layout {
    display: grid;
    gap: 0.85rem;
}

.crm-signature-editor {
    display: grid;
    gap: 0.85rem;
    margin-top: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.crm-signature-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.crm-signature-mode-pill {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    padding: 0.36rem 0.68rem;
    border-radius: 999px;
    background: rgba(201, 176, 55, 0.12);
    color: var(--primary-gold);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.crm-signature-tabs,
.crm-signature-group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.crm-signature-tab,
.crm-signature-group-tab {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    border-radius: 999px;
    padding: 0.55rem 0.82rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.crm-signature-tab.is-active,
.crm-signature-tab:hover,
.crm-signature-tab:focus-visible,
.crm-signature-group-tab.is-active,
.crm-signature-group-tab:hover,
.crm-signature-group-tab:focus-visible {
    border-color: rgba(201, 176, 55, 0.32);
    background: rgba(201, 176, 55, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.crm-signature-panel {
    display: none;
    gap: 0.85rem;
}

.crm-signature-panel.is-active {
    display: grid;
}

.crm-signature-template-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.crm-signature-preview-toggle {
    display: none;
}

.crm-signature-template-shell,
.crm-signature-html-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.crm-signature-template-fields {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.crm-signature-section-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    min-width: 0;
}

.crm-signature-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.crm-signature-section-head strong {
    display: block;
    color: var(--light-text);
    font-size: 0.95rem;
}

.crm-signature-section-head span {
    display: block;
    margin-top: 0.16rem;
    color: var(--crm-text-soft);
    font-size: 0.83rem;
    line-height: 1.5;
}

.crm-signature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
}

.crm-signature-social-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0.65rem;
    grid-column: 1 / -1;
}

.crm-signature-asset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    align-items: start;
}

.crm-signature-asset-card {
    display: grid;
    gap: 0.65rem;
    padding: 0.8rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 13, 22, 0.58);
    min-width: 0;
    align-content: start;
}

.crm-signature-asset-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.crm-signature-asset-head span {
    color: var(--crm-text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-signature-asset-preview {
    width: 100%;
    max-width: min(100%, 184px);
    aspect-ratio: 1 / 1;
    min-height: 0;
    border-radius: 16px;
    border: 1px dashed rgba(201, 176, 55, 0.2);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    place-items: center;
    overflow-x: clip;
    color: var(--crm-text-soft);
    text-align: center;
    padding: 0.6rem;
    margin-inline: auto;
}

.crm-signature-asset-card-banner .crm-signature-asset-preview {
    max-width: 100%;
    aspect-ratio: 16 / 7;
}

.crm-signature-asset-preview.has-image {
    padding: 0;
}

.crm-signature-asset-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

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

.crm-signature-upload-button,
.crm-signature-clear-button {
    justify-content: center;
    width: auto;
    min-height: 38px;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
}

.crm-signature-upload-button {
    position: relative;
    overflow-x: clip;
}

.crm-signature-upload-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.crm-signature-preview-shell {
    display: grid;
    gap: 0.7rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top right, rgba(201, 176, 55, 0.12), transparent 46%),
        rgba(10, 14, 22, 0.76);
    position: static;
    align-self: start;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-self: stretch;
}

.crm-signature-preview-shell > [data-signature-preview] {
    display: grid;
}

.crm-signature-preview-shell > [data-signature-preview] > .crm-signature-preview-card,
.crm-signature-preview-shell > [data-signature-preview] > .crm-signature-preview-empty {
    width: min(100%, 760px);
    justify-self: start;
}

.crm-signature-preview-head {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.crm-signature-preview-head span {
    color: var(--crm-text-soft);
    line-height: 1.5;
    font-size: 0.86rem;
}

.crm-signature-preview-card {
    display: grid;
    gap: 0.72rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.85rem 0.9rem 0.92rem;
    border-radius: 24px;
    border: 1px solid rgba(201, 176, 55, 0.18);
    background:
        radial-gradient(circle at top right, rgba(201, 176, 55, 0.16), transparent 38%),
        linear-gradient(180deg, rgba(11, 16, 26, 0.98) 0%, rgba(17, 24, 38, 0.96) 100%);
    color: #f6f7fb;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
    overflow-x: clip;
}

.crm-signature-preview-card a {
    color: inherit;
}

.crm-signature-preview-card-plain {
    background: rgba(7, 10, 17, 0.8);
    color: var(--light-text);
}

.crm-signature-preview-card-plain pre {
    margin: 0;
    white-space: pre-wrap;
    font: inherit;
    line-height: 1.65;
}

.crm-signature-preview-card-html {
    background: rgba(255, 255, 255, 0.96);
    color: #18202c;
    overflow: auto;
}

.crm-signature-preview-empty {
    padding: 1rem;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--crm-text-soft);
    background: rgba(255, 255, 255, 0.03);
}

.crm-signature-preview-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    grid-template-areas: "primary avatar contact";
    gap: 0.9rem 1rem;
    align-items: center;
    min-width: 0;
}

.crm-signature-preview-primary {
    display: grid;
    gap: 0.2rem;
    align-content: center;
    grid-area: primary;
    justify-self: center;
    justify-items: center;
    width: fit-content;
    max-width: min(100%, 15rem);
    min-width: 0;
    text-align: center;
}

.crm-signature-preview-avatar {
    width: 72px;
    height: 72px;
    grid-area: avatar;
    justify-self: center;
    align-self: center;
    border-radius: 999px;
    overflow-x: clip;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #1e2b42 0%, #111927 100%);
    border: 1px solid rgba(201, 176, 55, 0.28);
    color: #f8f3eb;
    font-size: 1.35rem;
    font-weight: 800;
}

.crm-signature-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.crm-signature-preview-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.crm-signature-preview-copy-contact {
    grid-area: contact;
    justify-items: stretch;
    align-content: center;
    justify-self: stretch;
    min-width: 0;
    min-height: 100%;
    padding-left: 1rem;
    border-left: 1px solid rgba(201, 176, 55, 0.16);
}

.crm-signature-preview-primary > strong {
    font-size: 1.08rem;
    line-height: 1.08;
    text-align: center;
}

.crm-signature-preview-primary > span {
    color: rgba(220, 227, 241, 0.78);
    font-size: 0.82rem;
    text-align: center;
}

.crm-signature-preview-contact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.36rem;
    font-size: 0.84rem;
    line-height: 1.36;
    color: rgba(237, 241, 248, 0.92);
    min-width: 0;
}

.crm-signature-preview-contact-row {
    display: grid;
    grid-template-columns: 1.2rem minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start;
    min-width: 0;
}

.crm-signature-preview-contact-label {
    color: var(--primary-gold);
    font-weight: 700;
    text-align: left;
}

.crm-signature-preview-contact-value {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: left;
}

.crm-signature-preview-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    justify-content: center;
    align-items: center;
    justify-self: center;
    margin-top: 0.58rem;
    min-width: 0;
}

.crm-signature-preview-social a {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #f5efe1;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-signature-preview-social a svg {
    width: 22px;
    height: 22px;
    display: block;
}

.crm-signature-preview-banner {
    position: relative;
    min-height: 118px;
    display: flex;
    align-items: flex-end;
    padding: 0.82rem;
    border-radius: 18px;
    overflow-x: clip;
    border: 1px solid rgba(201, 176, 55, 0.16);
    background:
        linear-gradient(135deg, rgba(18, 28, 45, 0.98) 0%, rgba(25, 38, 58, 0.94) 100%);
}

.crm-signature-preview-banner.has-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 15, 24, 0.86) 0%, rgba(10, 15, 24, 0.55) 45%, rgba(10, 15, 24, 0.28) 100%);
    pointer-events: none;
}

.crm-signature-preview-banner-media {
    position: absolute;
    inset: 0;
}

.crm-signature-preview-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.crm-signature-preview-banner-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.22rem;
    max-width: min(100%, 17rem);
    min-width: 0;
}

.crm-signature-preview-banner-copy strong {
    font-size: 0.98rem;
    line-height: 1.08;
    color: #ffffff;
}

.crm-signature-preview-banner-copy span,
.crm-signature-preview-banner-copy em {
    color: rgba(237, 241, 248, 0.84);
    font-style: normal;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.crm-signature-preview-disclaimer {
    margin-top: 0.16rem;
    font-size: 0.67rem;
    line-height: 1.45;
    color: rgba(220, 227, 241, 0.54);
    white-space: normal;
}

.crm-signature-plain-actions {
    display: flex;
    justify-content: flex-start;
}

.crm-signature-mini-textarea {
    min-height: 88px;
}

.crm-signature-html-textarea {
    min-height: 220px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.crm-signature-plain-textarea {
    min-height: 170px;
}

.crm-settings-field-value {
    min-height: 46px;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--light-text);
    display: flex;
    align-items: center;
}

.crm-settings-action-row,
.crm-settings-inline-actions,
.crm-settings-editor-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.crm-settings-action-row {
    margin-top: 0.9rem;
}

.crm-inline-feedback {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.48rem 0.72rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    max-width: min(100%, 28rem);
}

.crm-inline-feedback::before {
    content: '';
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    flex: 0 0 auto;
    background: currentColor;
    opacity: 0.92;
}

.crm-inline-feedback-success {
    color: #cfe8bf;
    border-color: rgba(114, 175, 102, 0.26);
    background: rgba(77, 133, 65, 0.12);
}

.crm-inline-feedback-error {
    color: #ffd0d0;
    border-color: rgba(241, 111, 111, 0.28);
    background: rgba(115, 34, 34, 0.18);
}

.crm-signature-asset-actions .crm-inline-feedback {
    flex: 1 1 100%;
    order: 3;
}

.crm-settings-quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
    grid-auto-rows: 1fr;
    gap: 0.65rem;
    margin-top: 0.85rem;
    align-items: stretch;
}

.crm-settings-quick-stats-compact {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
}

.crm-settings-quick-stat {
    display: grid;
    gap: 0.24rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    min-width: 0;
    align-content: start;
}

.crm-settings-quick-stat span {
    color: var(--crm-text-muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-settings-quick-stat strong {
    font-size: 1.02rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.crm-settings-support-note {
    margin-top: 0.78rem;
    color: var(--crm-text-soft);
    line-height: 1.55;
    font-size: 0.9rem;
}

.crm-email-drawer-form .crm-textarea {
    min-height: 220px;
    resize: vertical;
}

.crm-email-page {
    display: grid;
    gap: 0.75rem;
}

.crm-email-shell {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(280px, 0.95fr) minmax(360px, 1.2fr);
    gap: 0.75rem;
    align-items: start;
}

.crm-email-rail,
.crm-email-list-pane,
.crm-email-preview-pane {
    min-width: 0;
}

.crm-email-rail-card,
.crm-email-list-pane,
.crm-email-preview-card,
.crm-email-compose-pane,
.crm-email-empty-preview {
    background: rgba(10, 14, 22, 0.78);
    border: 1px solid rgba(201, 176, 55, 0.16);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.crm-email-rail-card,
.crm-email-list-pane,
.crm-email-preview-card,
.crm-email-compose-pane {
    padding: 0.9rem 1rem;
}

.crm-email-rail-card {
    display: grid;
    gap: 0.75rem;
    position: sticky;
    top: 94px;
}

.crm-email-rail-header h1,
.crm-email-list-toolbar h2,
.crm-email-preview-head h2 {
    margin: 0.25rem 0 0.35rem;
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    font-weight: 700;
}

.crm-email-rail-header p,
.crm-email-list-toolbar p,
.crm-email-preview-head p,
.crm-email-sync-copy {
    margin: 0;
    color: var(--crm-text-soft);
    line-height: 1.5;
    font-size: 0.84rem;
}

.crm-email-compose-button {
    justify-content: center;
}

.crm-email-template-toolbar {
    display: grid;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 176, 55, 0.14);
    background: rgba(0, 0, 0, 0.2);
}

.crm-email-template-toolbar .panel-subtitle {
    margin: 0;
}

.crm-email-template-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crm-email-template-apply {
    flex: 1;
    min-width: 0;
}

.crm-email-template-delete {
    flex-shrink: 0;
    margin-bottom: 0.1rem;
}

.crm-email-template-save-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crm-email-template-save-row .crm-input {
    flex: 1;
    min-width: 140px;
}

.crm-hidden {
    display: none !important;
}

.crm-email-format-toggle .crm-email-format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.crm-email-format-buttons .crm-button-secondary.is-active {
    border-color: rgba(201, 176, 55, 0.55);
    background: rgba(201, 176, 55, 0.12);
    color: var(--primary-gold);
}

.crm-textarea-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    min-height: 180px;
}

.crm-email-preview-panel {
    margin-top: 0.25rem;
}

.crm-email-preview-shell {
    border: 1px solid rgba(201, 176, 55, 0.2);
    border-radius: 10px;
    overflow-x: clip;
    background: #fff;
    min-height: 200px;
}

.crm-email-preview-iframe {
    width: 100%;
    min-height: 220px;
    height: 280px;
    border: 0;
    display: block;
    background: #fff;
}

.crm-email-folder-list {
    display: grid;
    gap: 0.35rem;
}

.crm-email-folder-button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--light-text);
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.crm-email-folder-button span {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.crm-email-folder-button strong,
.crm-email-unread-pill {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(201, 176, 55, 0.14);
    color: var(--primary-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.crm-email-folder-button.active,
.crm-email-folder-button:hover,
.crm-email-folder-button:focus-visible {
    border-color: rgba(201, 176, 55, 0.34);
    background: rgba(201, 176, 55, 0.09);
    transform: translateY(-1px);
    outline: none;
}

.crm-email-sync-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
}

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

.crm-email-sync-actions .crm-button-secondary {
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.crm-email-sync-actions .crm-email-full-resync {
    flex: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
}

.crm-email-sync-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crm-text-muted);
    margin-bottom: 0.25rem;
}

.crm-email-list-pane,
.crm-email-preview-pane {
    min-height: min(68vh, 560px);
}

.crm-email-list-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
}

.crm-email-list-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.crm-email-search {
    width: min(100%, 280px);
    position: relative;
}

.crm-email-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    pointer-events: none;
    font-size: 0.85rem;
}

.crm-email-search .crm-input {
    padding-left: 2.4rem;
    font-size: 0.9rem;
}

.crm-email-thread-list {
    display: grid;
    gap: 0.4rem;
    align-content: start;
    max-height: calc(min(68vh, 560px) - 110px);
    overflow: auto;
    padding-right: 0.1rem;
}

.crm-email-thread-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.35rem 0.4rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.crm-email-thread-row:hover,
.crm-email-thread-row.active {
    border-color: rgba(201, 176, 55, 0.26);
    background: rgba(201, 176, 55, 0.08);
    transform: translateY(-1px);
}

.crm-email-thread-row.is-unread {
    background: rgba(255, 255, 255, 0.045);
}

.crm-email-thread-actions {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.crm-email-thread-star,
.crm-email-thread-delete,
.crm-email-thread-button {
    border: none;
    background: none;
    color: inherit;
}

.crm-email-thread-star,
.crm-email-thread-delete {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.34);
    transition: color 0.2s ease, background 0.2s ease;
}

.crm-email-thread-star.active,
.crm-email-thread-star:hover,
.crm-email-thread-star:focus-visible {
    color: var(--primary-gold);
    background: rgba(201, 176, 55, 0.1);
    outline: none;
}

.crm-email-thread-delete:hover,
.crm-email-thread-delete:focus-visible {
    color: var(--crm-danger);
    background: rgba(241, 111, 111, 0.12);
    outline: none;
}

.crm-email-thread-button {
    width: 100%;
    text-align: left;
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.crm-email-thread-topline,
.crm-email-thread-subject-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.crm-email-thread-topline strong,
.crm-email-thread-subject {
    overflow-x: clip;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-email-thread-topline span,
.crm-email-thread-snippet {
    color: var(--crm-text-soft);
    font-size: 0.78rem;
}

.crm-email-thread-snippet {
    overflow-x: clip;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-email-preview-pane {
    display: grid;
    align-content: start;
}

.crm-email-preview-card,
.crm-email-compose-pane,
.crm-email-empty-preview {
    min-height: min(68vh, 560px);
}

.crm-email-preview-card,
.crm-email-compose-pane {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.crm-email-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.crm-email-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.crm-email-preview-actions .crm-email-delete:hover,
.crm-email-preview-actions .crm-email-delete:focus-visible {
    color: var(--crm-danger);
}

.crm-email-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.crm-email-message-stack {
    display: grid;
    gap: 0.65rem;
    max-height: calc(min(68vh, 560px) - 180px);
    overflow: auto;
    padding-right: 0.15rem;
    min-height: 0;
}

.crm-email-message-row {
    display: flex;
}

.crm-email-message-row.incoming {
    justify-content: flex-start;
}

.crm-email-message-row.outgoing {
    justify-content: flex-end;
}

.crm-email-message-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 0.9rem;
    display: grid;
    gap: 0.6rem;
    width: min(100%, 580px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.crm-email-message-card.incoming {
    border-color: rgba(132, 149, 176, 0.2);
    background:
        linear-gradient(180deg, rgba(18, 25, 38, 0.98) 0%, rgba(13, 19, 30, 0.94) 100%);
}

.crm-email-message-card.outgoing {
    border-color: rgba(201, 176, 55, 0.18);
    background: rgba(201, 176, 55, 0.06);
}

.crm-email-message-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.crm-email-message-person {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.crm-email-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--light-text);
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.crm-email-message-card.outgoing .crm-email-message-avatar {
    background: rgba(201, 176, 55, 0.12);
    border-color: rgba(201, 176, 55, 0.2);
    color: var(--primary-gold);
}

.crm-email-message-head span {
    color: var(--crm-text-soft);
    font-size: 0.78rem;
}

.crm-email-message-bubble {
    display: grid;
    gap: 0.6rem;
    padding: 0.1rem 0;
}

.crm-email-message-body {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--light-text);
    font-size: 0.9rem;
}

.crm-email-message-body--html {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.crm-email-message-body--html img {
    max-width: 100%;
    height: auto;
}

.crm-email-message-body--html a {
    color: var(--primary-gold);
    text-decoration: underline;
}

.crm-email-message-quote {
    display: grid;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.crm-email-message-card.outgoing .crm-email-message-quote {
    border-color: rgba(201, 176, 55, 0.14);
    background: rgba(7, 10, 17, 0.2);
}

.crm-email-message-quote-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crm-text-soft);
}

.crm-email-message-quote-copy {
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 0.85rem;
    color: var(--crm-text-soft);
}

.crm-email-empty-preview {
    padding: 1.5rem;
    text-align: center;
    display: grid;
    place-items: center;
    gap: 0.6rem;
}

.crm-email-empty-preview i {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 176, 55, 0.1);
    color: var(--primary-gold);
    font-size: 1.25rem;
}

.crm-email-empty-preview h2 {
    margin: 0;
}

.crm-email-empty-preview p {
    max-width: 420px;
    margin: 0;
    color: var(--crm-text-soft);
    line-height: 1.65;
}

.crm-email-workspace-form {
    display: grid;
    gap: 1rem;
}

@media (max-width: 1180px) {
    .ov-card-grid {
        grid-template-columns: 1fr;
    }

    .lead-history-advanced-menu {
        width: min(420px, calc(100vw - 2.5rem));
    }

    .auth-grid,
    .overview-grid,
    .import-grid,
    .lead-detail-layout.history-visible,
    .lead-detail-content,
    .crm-email-shell {
        grid-template-columns: 1fr;
    }

    .crm-signature-template-shell,
    .crm-signature-html-shell {
        grid-template-columns: 1fr;
    }

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

    .crm-signature-grid,
    .crm-signature-asset-grid,
    .crm-signature-social-row {
        grid-template-columns: 1fr;
    }

    .crm-signature-preview-shell {
        position: static;
        max-width: none;
        justify-self: stretch;
    }

    .crm-toolbar-row {
        gap: 1.1rem;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 392px) minmax(0, 1fr);
    }

    .crm-search-shell-desktop {
        max-width: 344px;
    }

    .crm-search-shell-desktop.is-expanded {
        max-width: 376px;
    }

    .crm-toolbar-right {
        gap: 0.85rem;
    }

    .crm-primary-nav {
        padding-left: 0.35rem;
    }

    .crm-desktop-nav-trigger {
        min-width: 172px;
        padding-right: 0.62rem;
    }

    .crm-desktop-nav-panel {
        width: min(296px, calc(100vw - 2rem));
    }

}

@media (max-width: 960px) {
    .crm-settings-shell,
    .crm-settings-stage-grid-two {
        grid-template-columns: 1fr;
    }

    .crm-settings-rail {
        display: none;
    }

    .crm-settings-main {
        max-width: none;
        padding-top: 0;
    }

    .crm-settings-quick-stats-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-settings-mobile-nav {
        display: grid;
    }

    .crm-settings-stage-header {
        display: none;
    }

    .crm-settings-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-settings-card-toggle {
        width: 100%;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 980px) {
    .ov-hero {
        padding: 4.25rem 1.5rem 2.25rem;
    }

    .ov-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lead-history-filters {
        padding: 0.9rem 1rem;
    }

    .lead-history-filter-divider {
        display: none;
    }

    .lead-history-filter-group-saved {
        flex-basis: 100%;
    }

    .lead-history-advanced-shell {
        position: static;
    }

    .lead-history-advanced-menu {
        left: 0;
        right: 0;
        top: calc(100% + 0.75rem);
        width: auto;
        margin-top: 0;
    }

    .lead-history-hero {
        padding: 1.35rem 1.5rem;
    }

    .lead-history-scope-switch {
        margin-bottom: 0.6rem;
    }

    .lead-detail-hero {
        padding-top: 2.4rem;
    }

    .crm-settings-hero {
        padding-top: 0.85rem;
    }

    .crm-stage {
        --crm-stage-pad: 1rem;
    }

    .crm-email-rail-card {
        position: static;
    }

    .crm-email-list-pane,
    .crm-email-preview-card,
    .crm-email-compose-pane,
    .crm-email-empty-preview {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .lead-history-advanced-menu-head,
    .lead-history-advanced-menu-scroll {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    body.crm-body.crm-nav-open {
        height: 100vh;
        height: 100dvh;
        overflow-x: clip;
    }

    .crm-sidebar {
        display: none;
    }

    .crm-shell.sidebar-open,
    .crm-shell.sidebar-open .crm-stage {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        overflow-x: clip;
    }

    .crm-shell.sidebar-open .crm-stage::before {
        background: #050810;
    }

    .crm-shell.sidebar-open .crm-toolbar {
        border-color: transparent;
        box-shadow: none;
        background: #050810;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
    }

    .crm-shell.sidebar-open .crm-mobile-search-toggle {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.82);
    }

    .crm-toolbar {
        border-radius: 50px;
        padding: 0.4rem 1rem;
        gap: 0;
        overflow: visible;
    }

    .crm-toolbar-row {
        position: relative;
        display: flex;
        gap: 1rem;
        min-height: 62px;
    }

    .crm-toolbar-left {
        display: flex;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        pointer-events: none;
        gap: 0;
        flex: 0 0 auto;
    }

    .crm-toolbar-brand {
        pointer-events: auto;
    }

    .crm-toolbar-brand img {
        width: 62px;
        height: 62px;
    }

    .crm-search-shell-desktop,
    .crm-toolbar-right {
        display: none;
    }

    .crm-mobile-toggle,
    .crm-mobile-search-toggle {
        display: inline-flex;
    }

    .crm-mobile-search-toggle {
        margin-left: auto;
    }

    .crm-mobile-search-row {
        display: block;
        max-height: 0;
        opacity: 0;
        overflow-x: clip;
        transform: translateY(-10px) scale(0.94);
        transform-origin: top center;
        transition: max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), padding-top 0.42s cubic-bezier(0.22, 1, 0.36, 1);
        padding-top: 0;
    }

    .crm-mobile-search-row.active {
        max-height: 78px;
        opacity: 1;
        overflow: visible;
        transform: translateY(0) scale(1);
        padding-top: 0.4rem;
    }

    .crm-search-shell-mobile {
        width: min(100%, 332px);
        margin: 0 auto;
        transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s ease, filter 0.35s ease;
    }

    .crm-search-shell-mobile.is-expanded {
        width: min(100%, 360px);
        transform: scale(1.015);
        filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.2));
    }

    .crm-search-shell-mobile .crm-search {
        min-height: 52px;
        padding: 0.8rem 1rem 0.8rem 2.7rem;
        border-radius: 18px;
        font-size: 0.95rem;
    }

    .crm-search-shell-mobile.is-expanded .crm-search {
        min-height: 56px;
        padding-left: 2.8rem;
    }

    .crm-search-shell-mobile i {
        left: 1rem;
    }

    .crm-search-suggestion-panel {
        top: calc(100% + 0.5rem);
        border-radius: 18px;
        max-height: min(52vh, 360px);
    }

    .crm-mobile-menu-panel {
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        position: fixed;
        top: calc(88px + env(safe-area-inset-top, 0px));
        left: 0;
        right: 0;
        bottom: 0;
        padding: 3.2rem 2rem calc(2rem + env(safe-area-inset-bottom, 0px));
        background: #050810;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-18px);
        transition: visibility 0s linear 0.4s;
        z-index: 1;
        overflow-y: auto;
    }

    .crm-mobile-menu-panel.active {
        display: flex;
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        transform: translateY(0);
        transition: visibility 0s linear 0s;
        animation: crmMobileMenuPanelIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
        -webkit-overflow-scrolling: touch;
    }

    .crm-mobile-menu-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        padding-top: 0.5rem;
    }

    .crm-mobile-menu-brand {
        display: none;
    }

    .crm-mobile-menu-link {
        display: block;
        width: 100%;
        opacity: 0;
        transform: translateY(28px);
        transition: opacity 0.45s ease, transform 0.45s ease, color 0.25s ease;
        transition-delay: calc(0.04s + (var(--crm-menu-index) * 0.05s));
        background: none;
        border: none;
        color: var(--light-text);
        text-align: left;
        text-decoration: none;
        padding: 0.45rem 0;
        font: inherit;
        font-size: clamp(1.05rem, 4.5vw, 1.3rem);
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        line-height: 1.2;
        cursor: pointer;
    }

    a.crm-mobile-menu-link-external {
        margin-top: 0.55rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        color: var(--secondary-gold);
    }

    .crm-mobile-menu-panel.active .crm-mobile-menu-link {
        opacity: 1;
        transform: none;
        animation: crmMobileMenuLinkIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
        animation-delay: calc(0.06s + (var(--crm-menu-index) * 0.05s));
    }

    .crm-mobile-menu-link:hover,
    .crm-mobile-menu-link.active {
        color: var(--primary-gold);
    }

    .crm-email-list-toolbar,
    .crm-email-preview-head,
    .crm-email-preview-actions,
    .crm-email-message-head {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-email-search {
        width: 100%;
    }

    .crm-email-thread-list,
    .crm-email-message-stack {
        max-height: none;
    }
}

@media (max-width: 720px) {
    .lead-detail-hero,
    .crm-settings-hero {
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    .crm-detail-utility {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-detail-utility-left,
    .crm-detail-utility-right {
        justify-content: space-between;
    }

    .lead-detail-card-head {
        align-items: stretch;
    }

    .lead-detail-card-head-actions {
        justify-content: flex-start;
    }

    .lead-detail-calendar-card .panel-head {
        align-items: flex-start;
    }

    .lead-detail-calendar-card .lead-detail-action-button {
        align-self: flex-start;
        padding: 0.48rem 0.7rem;
        border-radius: 11px;
        font-size: 0.82rem;
    }

    .lead-detail-calendar-card .lead-detail-action-button i {
        font-size: 0.76rem;
    }

    .crm-settings-field-grid,
    .crm-settings-quick-stats,
    .crm-settings-quick-stats-compact,
    .crm-signature-grid,
    .crm-signature-asset-grid,
    .crm-signature-social-row,
    .crm-signature-preview-top {
        grid-template-columns: 1fr;
    }

    .crm-signature-preview-top {
        grid-template-areas:
            "avatar"
            "primary"
            "contact";
    }

    .crm-settings-context-card,
    .crm-settings-stage-header,
    .crm-settings-card {
        padding: 0.9rem;
        border-radius: 18px;
    }

    .crm-settings-stage-header {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-signature-section-card {
        display: none;
    }

    .crm-signature-section-card.is-active-mobile,
    .crm-signature-section-card-plain {
        display: grid;
    }

    .crm-signature-preview-avatar {
        justify-self: start;
    }

    .crm-signature-preview-primary,
    .crm-signature-preview-copy,
    .crm-signature-preview-copy-contact {
        justify-self: start;
        justify-items: start;
        width: 100%;
    }

    .crm-signature-preview-copy-contact {
        border-left: 0;
        padding-left: 0;
        padding-top: 0.8rem;
        border-top: 1px solid rgba(201, 176, 55, 0.16);
    }

    .crm-signature-preview-primary > strong,
    .crm-signature-preview-primary > span,
    .crm-signature-preview-contact-label,
    .crm-signature-preview-contact-value {
        text-align: left;
    }

    .crm-signature-preview-social {
        justify-content: flex-start;
        justify-self: start;
    }

    .crm-signature-preview-banner-copy {
        max-width: 100%;
    }

    .crm-signature-asset-preview {
        max-width: 132px;
    }

    .crm-signature-asset-card-banner .crm-signature-asset-preview {
        max-width: 100%;
    }

    .crm-email-rail-card,
    .crm-email-list-pane,
    .crm-email-preview-card,
    .crm-email-compose-pane,
    .crm-email-empty-preview {
        padding: 1rem;
        border-radius: 20px;
    }

    .ov-hero {
        padding: 3.75rem 1.25rem 2rem;
    }

    .ov-container {
        padding: 0 1rem 2rem;
    }

    .ov-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .ov-insight-row {
        grid-template-columns: 1fr;
    }

    .ov-card {
        padding: 1.15rem;
    }

    .lead-history-hero {
        padding: 1.25rem;
    }

    .lead-history-filters {
        padding: 0.85rem 1rem;
    }

    .lead-history-table thead th,
    .lead-history-table tbody td {
        padding: 0.6rem 0.75rem;
    }

    .lead-history-table-meta,
    .lead-history-bulk-bar,
    .lead-history-pagination {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .crm-stage {
        --crm-stage-pad: 0.9rem;
    }

    .crm-modal-layer {
        padding: 0.9rem;
    }

    .crm-history-modal {
        border-radius: 22px;
    }

    .crm-history-modal-head,
    .crm-history-modal-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .crm-history-modal-head {
        padding-top: 1rem;
        padding-bottom: 0.85rem;
    }

    .crm-history-modal-scroll {
        max-height: calc(84vh - 168px);
    }

    .auth-gate {
        padding: 0;
    }

    .login-wrapper {
        padding: 4rem 1rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
        animation-duration: 4s;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .login-status-row {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .login-status {
        width: 100%;
    }

    .auth-panel,
    .auth-hero,
    .crm-card,
    .crm-table-card,
    .crm-summary-card,
    .crm-modal {
        padding: 1rem;
        border-radius: 20px;
    }

    .summary-grid,
    .form-grid,
    .stats-strip,
    .meta-grid.two-up,
    .history-audit-grid {
        grid-template-columns: 1fr;
    }

    .lead-detail-form-grid > .form-field,
    .lead-detail-form-grid > .form-field.form-field-full {
        width: 100%;
    }

    .crm-search-preview-shell {
        padding: 1.15rem;
        border-radius: 20px;
    }

    .crm-search-preview-shell-head {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-search-preview-close {
        align-self: flex-end;
    }

    .crm-search-preview-grid,
    .crm-search-preview-field-grid {
        grid-template-columns: 1fr;
    }

    .crm-search-preview-field.is-full {
        grid-column: auto;
    }

    .mapping-row {
        grid-template-columns: 1fr;
    }

    .pagination-row,
    .panel-head,
    .table-head,
    .history-head {
        align-items: stretch;
    }

    .saved-filter-row {
        align-items: stretch;
    }
}
