/* ==================================================
   Agency75 CRM v0.2.1 — loveable-ui.css
   Ported from: docs/loveable_design_extracted/src/styles.css
   Single main stylesheet for Lovable UI parity (PHP + Tailwind CDN).
   Fonts: Inter (body), Space Grotesk (headings/brand).
   Palette: coral primary, warm-charcoal sidebar, off-white workspace.
================================================== */

/* ==================================================
   DESIGN TOKENS
   1:1 port of the Loveable oklch palette.
================================================== */

:root {
    --lv-radius: 0.625rem;
    --lv-radius-sm: 0.375rem;
    --lv-radius-md: 0.5rem;
    --lv-radius-lg: 0.625rem;
    --lv-radius-xl: 0.875rem;

    --lv-bg:                 oklch(0.985 0.004 60);
    --lv-fg:                 oklch(0.22 0.02 30);
    --lv-card:               oklch(1 0 0);
    --lv-card-fg:            oklch(0.22 0.02 30);

    --lv-primary:            oklch(0.66 0.23 28);
    --lv-primary-fg:         oklch(0.99 0.005 60);
    --lv-primary-soft:       oklch(0.955 0.045 30);

    --lv-accent-brand:       oklch(0.74 0.18 50);

    --lv-secondary:          oklch(0.97 0.008 50);
    --lv-secondary-fg:       oklch(0.28 0.04 30);

    --lv-success:            oklch(0.66 0.16 152);
    --lv-success-fg:         oklch(0.99 0 0);
    --lv-success-soft:       oklch(0.95 0.06 152);
    --lv-success-strong:     oklch(0.40 0.13 142);

    --lv-warning:            oklch(0.78 0.16 75);
    --lv-warning-fg:         oklch(0.25 0.05 60);
    --lv-warning-soft:       oklch(0.965 0.05 75);
    --lv-warning-strong:     oklch(0.45 0.15 70);

    --lv-danger:             oklch(0.6 0.22 27);
    --lv-danger-fg:          oklch(0.99 0 0);
    --lv-danger-soft:        oklch(0.96 0.04 25);

    --lv-muted:              oklch(0.965 0.008 50);
    --lv-muted-fg:           oklch(0.52 0.02 35);
    --lv-accent:             oklch(0.965 0.018 40);
    --lv-accent-fg:          oklch(0.28 0.04 30);

    --lv-border:             oklch(0.92 0.01 45);
    --lv-input:              oklch(0.92 0.01 45);
    --lv-ring:               oklch(0.66 0.23 28);

    --lv-sidebar:            oklch(0.205 0.025 30);
    --lv-sidebar-fg:         oklch(0.93 0.01 50);
    --lv-sidebar-primary:    oklch(0.72 0.21 35);
    --lv-sidebar-primary-fg: oklch(0.99 0 0);
    --lv-sidebar-accent:     oklch(0.27 0.04 30);
    --lv-sidebar-accent-fg:  oklch(0.99 0.005 50);
    --lv-sidebar-border:     oklch(0.3 0.03 30);

    --lv-shadow-card:     0 1px 2px 0 rgb(20 14 14 / 0.04), 0 1px 3px 0 rgb(20 14 14 / 0.06);
    --lv-shadow-elevated: 0 8px 24px -6px rgb(255 61 61 / 0.12), 0 2px 6px -1px rgb(20 14 14 / 0.05);
    --lv-shadow-brand:    0 10px 30px -10px rgb(255 61 61 / 0.45);

    --lv-gradient-brand:      linear-gradient(135deg, oklch(0.66 0.23 28) 0%, oklch(0.74 0.18 50) 100%);
    --lv-gradient-brand-soft: linear-gradient(135deg, oklch(0.96 0.04 28) 0%, oklch(0.97 0.035 60) 100%);

    --lv-font-sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --lv-font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* ==================================================
   GLOBAL SHELL
================================================== */

body.a75crm-lovable-shell,
body.a75crm-auth-screen {
    font-family: var(--lv-font-sans);
    -webkit-font-smoothing: antialiased;
    color: var(--lv-fg);
    background-color: var(--lv-bg);
}

body.a75crm-lovable-shell {
    letter-spacing: -0.011em;
}

.a75crm-lovable-shell h1,
.a75crm-lovable-shell h2,
.a75crm-lovable-shell h3,
.a75crm-lovable-shell h4 {
    letter-spacing: -0.015em;
}

.a75crm-lovable-shell .main-content.app-content {
    background: transparent;
}

.a75crm-lovable-shell .main-container {
    max-width: 80rem;
}

/* ==================================================
   PAGE HEADER
================================================== */

.a75crm-lovable-shell .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.a75crm-lovable-shell .page-title {
    font-family: var(--lv-font-sans);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--lv-fg);
}

.a75crm-lovable-shell .breadcrumb {
    margin-bottom: 0;
}

.a75crm-lovable-shell .breadcrumb a {
    color: var(--lv-primary) !important;
}

.a75crm-lovable-shell .text-primary {
    color: var(--lv-primary) !important;
}

/* ==================================================
   CARDS
   Matching: rounded-xl border border-border bg-card shadow-card
================================================== */

.a75crm-lovable-shell .card,
.a75crm-auth-card {
    border: 1px solid var(--lv-border);
    border-radius: var(--lv-radius-xl);
    background: var(--lv-card);
    box-shadow: var(--lv-shadow-card);
    overflow: hidden;
}

.a75crm-lovable-shell .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--lv-border);
    background: transparent;
    padding: 0.875rem 1.25rem;
}

.a75crm-lovable-shell .card-title {
    font-family: var(--lv-font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lv-fg);
    letter-spacing: -0.01em;
    margin-bottom: 0;
}

.a75crm-lovable-shell .card-body {
    padding: 1rem 1.25rem;
}

/* ==================================================
   TABLES
   Matching Loveable: divide-y, bg-muted/40 thead, hover:bg-accent/40
================================================== */

.a75crm-lovable-shell .table {
    margin-bottom: 0;
}

.a75crm-lovable-shell .table thead th {
    border-bottom: 1px solid var(--lv-border);
    background: var(--lv-muted);
    color: var(--lv-muted-fg);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.625rem 1.25rem;
}

.a75crm-lovable-shell .table tbody td {
    border-bottom: 1px solid var(--lv-border);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    vertical-align: middle;
}

.a75crm-lovable-shell .table tbody tr {
    transition: background 0.15s ease;
}

.a75crm-lovable-shell .table tbody tr:hover {
    background: var(--lv-accent);
}

/* ==================================================
   FORMS & INPUTS
================================================== */

.a75crm-lovable-shell .form-control,
.a75crm-lovable-shell .form-select,
.a75crm-auth-input {
    height: 2.5rem;
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border);
    background-color: var(--lv-bg);
    color: var(--lv-fg);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.a75crm-lovable-shell .form-control::placeholder,
.a75crm-auth-input::placeholder {
    color: var(--lv-muted-fg);
}

.a75crm-lovable-shell .form-control:focus,
.a75crm-lovable-shell .form-select:focus,
.a75crm-auth-input:focus {
    border-color: var(--lv-primary);
    box-shadow: 0 0 0 3px oklch(0.66 0.23 28 / 0.2);
    background-color: var(--lv-card);
    outline: none;
}

.a75crm-lovable-shell label,
.a75crm-auth-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--lv-fg);
}

/* ==================================================
   BUTTONS
   Matching: rounded-md bg-primary text-primary-foreground shadow-sm
================================================== */

.a75crm-lovable-shell .btn,
.a75crm-auth-submit {
    border-radius: var(--lv-radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.a75crm-lovable-shell .btn-primary,
.a75crm-auth-submit {
    border: 0;
    color: var(--lv-primary-fg) !important;
    background: var(--lv-primary) !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.a75crm-lovable-shell .btn-primary:hover,
.a75crm-auth-submit:hover {
    background: oklch(0.60 0.23 28) !important;
}

.a75crm-lovable-shell .btn-primary:focus-visible,
.a75crm-auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px oklch(0.66 0.23 28 / 0.3);
}

.a75crm-lovable-shell .btn-outline-primary {
    border: 1px solid var(--lv-border);
    color: var(--lv-fg);
    background: transparent;
}

.a75crm-lovable-shell .btn-outline-primary:hover {
    background: var(--lv-accent);
    color: var(--lv-accent-fg);
}

/* ==================================================
   BADGES
   Matching: rounded-full px-2 py-0.5 text-[11px] font-medium
================================================== */

.a75crm-lovable-shell .badge {
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.01em;
    padding: 0.125rem 0.5rem;
}

.a75crm-lovable-shell .bg-primary-transparent,
.a75crm-lovable-shell .a75crm-role-badge {
    background: var(--lv-primary-soft) !important;
    color: var(--lv-primary) !important;
}

.a75crm-lovable-shell .bg-success-transparent {
    background: var(--lv-success-soft) !important;
    color: var(--lv-success-strong) !important;
}

.a75crm-lovable-shell .bg-warning-transparent {
    background: var(--lv-warning-soft) !important;
    color: var(--lv-warning-strong) !important;
}

.a75crm-lovable-shell .bg-danger-transparent {
    background: var(--lv-danger-soft) !important;
    color: var(--lv-danger) !important;
}

/* ==================================================
   MODERN SIDEBAR
   Matching AppShell.tsx: bg-sidebar, w-64, border-r
================================================== */

.a75crm-lovable-shell .app-sidebar.a75crm-sidebar {
    background: var(--lv-sidebar);
    border-right: 1px solid var(--lv-sidebar-border);
    color: var(--lv-sidebar-fg);
    width: 16rem;
}

.a75crm-sidebar .side-header {
    display: flex;
    align-items: center;
    height: 4rem;
    border-bottom: 1px solid var(--lv-sidebar-border);
    background: transparent;
    padding: 0;
}

/* --------------------------------------------------
   Brand lockup
-------------------------------------------------- */

.a75crm-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0 1.25rem;
    color: #fff;
    text-decoration: none;
}

.a75crm-brand-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--lv-primary);
    font-family: var(--lv-font-display);
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.a75crm-brand-title {
    display: block;
    font-family: var(--lv-font-display);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.025em;
}

.a75crm-brand-version {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-top: 0.25rem;
    padding: 0.0625rem 0.375rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --------------------------------------------------
   Sidebar nav groups & items
   Matching the collapsible group headers + leaf items
-------------------------------------------------- */

.a75crm-sidebar .sub-category h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.375rem 0.75rem;
    margin: 0.5rem 0 0.125rem;
}

.a75crm-sidebar .side-menu__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2rem;
    margin: 0.0625rem 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--lv-radius-md);
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.a75crm-sidebar .side-menu__item:hover {
    color: var(--lv-sidebar-accent-fg) !important;
    background: var(--lv-sidebar-accent);
}

.a75crm-sidebar .side-menu__item.active {
    color: var(--lv-sidebar-accent-fg) !important;
    background: var(--lv-sidebar-accent);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.a75crm-sidebar .side-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    margin-right: 0;
    background: transparent;
    font-size: 1rem;
    transition: transform 0.15s ease;
}

.a75crm-sidebar .side-menu__item:hover .side-menu__icon {
    transform: scale(1.1);
}

.a75crm-sidebar .side-menu__item.active::after {
    content: "";
    display: block;
    width: 0.375rem;
    height: 0.375rem;
    margin-left: auto;
    border-radius: 9999px;
    background: var(--lv-primary);
}

.a75crm-nav-badge {
    margin-left: auto;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    border: 1px solid var(--lv-sidebar-border);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Sidebar footer user block */
.a75crm-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin: 0 0.5rem 0.5rem;
    border-top: 1px solid var(--lv-sidebar-border);
    border-radius: var(--lv-radius-md);
    color: var(--lv-sidebar-fg);
    text-decoration: none;
}

.a75crm-sidebar-user:hover {
    background: var(--lv-sidebar-accent);
}

.a75crm-sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lv-sidebar-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.a75crm-sidebar-user-role {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================================================
   MODERN TOPBAR
   Matching AppShell header: sticky top-0 z-20 h-16 border-b bg-card/80 backdrop-blur
================================================== */

.a75crm-lovable-shell .app-header.a75crm-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 4rem;
    border-bottom: 1px solid var(--lv-border);
    background: oklch(1 0 0 / 0.8);
    backdrop-filter: blur(12px);
    box-shadow: none;
}

.a75crm-topbar .main-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .a75crm-topbar .main-container {
        padding: 0 1.5rem;
    }
}

/* --------------------------------------------------
   Topbar search
   Matching: h-9 w-full max-w-xl rounded-md border
-------------------------------------------------- */

.a75crm-topbar-search {
    position: relative;
    width: 100%;
    max-width: 36rem;
}

.a75crm-topbar-search .form-control {
    height: 2.25rem;
    padding-left: 2.25rem;
    padding-right: 6rem;
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border);
    background: var(--lv-bg);
    font-size: 0.875rem;
}

.a75crm-topbar-search .form-control:focus {
    border-color: var(--lv-primary);
    box-shadow: 0 0 0 3px oklch(0.66 0.23 28 / 0.2);
}

.a75crm-topbar-search i {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    z-index: 2;
    transform: translateY(-50%);
    color: var(--lv-muted-fg);
    font-size: 0.875rem;
}

.a75crm-topbar-search-hint {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--lv-muted-fg);
    font-size: 0.625rem;
    pointer-events: none;
}

.a75crm-topbar-search-hint kbd {
    padding: 0.0625rem 0.25rem;
    border-radius: var(--lv-radius-sm);
    border: 1px solid var(--lv-border);
    background: var(--lv-muted);
    font-family: var(--lv-font-sans);
    font-size: 0.625rem;
}

/* --------------------------------------------------
   Topbar actions
-------------------------------------------------- */

.a75crm-topbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.25rem;
    padding: 0 0.625rem;
    border: 0;
    border-radius: var(--lv-radius-md);
    background: transparent;
    color: var(--lv-muted-fg);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.a75crm-topbar-action:hover {
    background: var(--lv-accent);
    color: var(--lv-fg);
}

.a75crm-topbar-action.is-primary {
    border: 0;
    color: var(--lv-primary-fg) !important;
    background: var(--lv-primary) !important;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.a75crm-topbar-action.is-primary:hover {
    background: oklch(0.60 0.23 28) !important;
}

/* --------------------------------------------------
   Profile button (topbar)
   Matching ProfileMenu.tsx: flex items-center gap-2 rounded-md px-1.5 py-1
-------------------------------------------------- */

.a75crm-profile-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.375rem;
    border: 0;
    border-radius: var(--lv-radius-md);
    background: transparent;
    color: var(--lv-fg);
    text-decoration: none;
    transition: background 0.15s ease;
}

.a75crm-profile-button:hover {
    background: var(--lv-accent);
}

.a75crm-profile-button .avatar {
    width: 2rem;
    height: 2rem;
}

.a75crm-profile-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.a75crm-profile-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--lv-fg);
}

.a75crm-profile-role {
    font-size: 0.6875rem;
    color: var(--lv-muted-fg);
}

/* --------------------------------------------------
   Profile dropdown
   Matching ProfileMenu: rounded-xl border bg-card shadow-xl
-------------------------------------------------- */

.a75crm-lovable-shell .dropdown-menu {
    border-radius: var(--lv-radius-xl);
    border: 1px solid var(--lv-border);
    background: var(--lv-card);
    box-shadow: var(--lv-shadow-elevated);
    padding: 0;
    overflow: hidden;
}

.a75crm-lovable-shell .drop-heading {
    padding: 1.25rem 1.25rem 1rem;
}

.a75crm-lovable-shell .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lv-fg);
    border-top: 1px solid var(--lv-border);
    transition: background 0.15s ease;
}

.a75crm-lovable-shell .dropdown-item:hover {
    background: var(--lv-accent);
}

.a75crm-lovable-shell .dropdown-item .dropdown-icon {
    color: var(--lv-primary);
    transition: transform 0.15s ease;
}

.a75crm-lovable-shell .dropdown-item:hover .dropdown-icon {
    transform: scale(1.1);
}

/* ==================================================
   DASHBOARD WIDGETS
   Matching Loveable widgets.tsx: KpiCard, Section, WorkQueueCard, etc.
================================================== */

/* Enhanced dashboard card interactions */
.rounded-xl.border.bg-card.shadow-card {
    transition: all 0.2s ease;
}

.rounded-xl.border.bg-card.shadow-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Loading skeleton animations */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.animate-pulse {
    animation: skeleton-pulse 2s ease-in-out infinite;
}

/* Theme toggle enhancements */
#a75crm-theme-toggle {
    position: relative;
}

#a75crm-theme-toggle .a75crm-icon-light,
#a75crm-theme-toggle .a75crm-icon-dark {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#a75crm-theme-toggle:hover .a75crm-icon-light:not(.hidden),
#a75crm-theme-toggle:hover .a75crm-icon-dark:not(.hidden) {
    transform: rotate(15deg);
}

/* Sidebar enhancements */
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced sidebar item animations */
.sidebar-item {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-item:hover {
    background-color: color-mix(in oklab, var(--lv-sidebar-accent) 72%, transparent);
}

.sidebar-item i {
    transition: transform 0.18s ease;
}

.sidebar-item:hover i {
    transform: scale(1.06);
}

/* Mobile drawer enhancements */
#drawer-overlay {
    backdrop-filter: blur(4px);
}

#drawer-sidebar {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* --------------------------------------------------
   KPI Cards
   Matching: rounded-xl border bg-card p-4 shadow-card
-------------------------------------------------- */

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

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

.a75crm-kpi-card {
    border: 1px solid var(--lv-border);
    border-radius: var(--lv-radius-xl);
    background: var(--lv-card);
    box-shadow: var(--lv-shadow-card);
    padding: 1rem;
}

.a75crm-kpi-card-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.a75crm-kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lv-muted-fg);
}

.a75crm-kpi-value {
    margin-top: 0.375rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--lv-fg);
}

.a75crm-kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.a75crm-kpi-delta.is-up    { color: var(--lv-success-strong); }
.a75crm-kpi-delta.is-down  { color: var(--lv-danger); }
.a75crm-kpi-delta.is-flat  { color: var(--lv-muted-fg); }

.a75crm-kpi-delta-hint {
    color: var(--lv-muted-fg);
    font-weight: 400;
}

.a75crm-kpi-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: var(--lv-radius-lg);
    font-size: 1.25rem;
}

.a75crm-kpi-icon.tone-primary  { background: var(--lv-primary-soft); color: var(--lv-primary); }
.a75crm-kpi-icon.tone-success  { background: var(--lv-success-soft); color: var(--lv-success-strong); }
.a75crm-kpi-icon.tone-warning  { background: var(--lv-warning-soft); color: var(--lv-warning-strong); }
.a75crm-kpi-icon.tone-danger   { background: var(--lv-danger-soft);  color: var(--lv-danger); }

/* --------------------------------------------------
   Section widget (card with header)
   Matching Section in widgets.tsx
-------------------------------------------------- */

.a75crm-section {
    border: 1px solid var(--lv-border);
    border-radius: var(--lv-radius-xl);
    background: var(--lv-card);
    box-shadow: var(--lv-shadow-card);
    overflow: hidden;
}

.a75crm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--lv-border);
    padding: 0.875rem 1.25rem;
}

.a75crm-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lv-fg);
    margin: 0;
}

.a75crm-section-action {
    font-size: 0.75rem;
    color: var(--lv-muted-fg);
}

/* --------------------------------------------------
   List rows (work queue, alerts, data quality)
-------------------------------------------------- */

.a75crm-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--lv-border);
    transition: background 0.15s ease;
}

.a75crm-list-item:last-child {
    border-bottom: 0;
}

.a75crm-list-item:hover {
    background: var(--lv-accent);
}

.a75crm-list-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lv-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.a75crm-list-item-context {
    font-size: 0.75rem;
    color: var(--lv-muted-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.a75crm-list-item-due {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--lv-muted-fg);
    font-variant-numeric: tabular-nums;
}

.a75crm-list-item-due.is-overdue {
    color: var(--lv-danger);
    font-weight: 500;
}

/* Priority pills */
.a75crm-priority {
    display: inline-flex;
    align-items: center;
    height: 1.25rem;
    padding: 0 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.a75crm-priority.is-high   { background: var(--lv-danger-soft);  color: var(--lv-danger); }
.a75crm-priority.is-medium { background: var(--lv-warning-soft); color: var(--lv-warning-strong); }
.a75crm-priority.is-low    { background: var(--lv-muted);        color: var(--lv-muted-fg); }

/* --------------------------------------------------
   Quick actions grid
   Matching: grid-cols-2 divide, icon + label + arrow
-------------------------------------------------- */

.a75crm-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .a75crm-quick-actions {
        grid-template-columns: 1fr 1fr;
    }
}

.a75crm-quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--lv-fg);
    text-decoration: none;
    border-bottom: 1px solid var(--lv-border);
    transition: background 0.15s ease;
}

.a75crm-quick-action:hover {
    background: var(--lv-accent);
}

.a75crm-quick-action-icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border-radius: var(--lv-radius-md);
    background: var(--lv-primary-soft);
    color: var(--lv-primary);
}

.a75crm-quick-action-label {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.a75crm-quick-action-hint {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--lv-muted-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------
   Progress bars
   Matching: h-2 rounded-full bg-muted + inner bar
-------------------------------------------------- */

.a75crm-progress-track {
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--lv-muted);
    overflow: hidden;
}

.a75crm-progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.a75crm-progress-fill.tone-primary { background: var(--lv-primary); }
.a75crm-progress-fill.tone-success { background: var(--lv-success); }
.a75crm-progress-fill.tone-warning { background: var(--lv-warning); }
.a75crm-progress-fill.tone-danger  { background: var(--lv-danger); }

/* --------------------------------------------------
   Dashboard greeting header
   Matching DashboardHeader from widgets.tsx
-------------------------------------------------- */

.a75crm-dash-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.a75crm-dash-greeting {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--lv-fg);
}

.a75crm-dash-subtitle {
    font-size: 0.875rem;
    color: var(--lv-muted-fg);
}

.a75crm-dash-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.5rem;
    padding: 0 0.875rem;
    border-radius: var(--lv-radius-md);
    border: 0;
    background: var(--lv-primary);
    color: var(--lv-primary-fg);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    transition: background 0.15s ease;
}

.a75crm-dash-primary-action:hover {
    background: oklch(0.60 0.23 28);
    color: var(--lv-primary-fg);
}

/* --------------------------------------------------
   Dashboard grid layouts
   Matching the lg:grid-cols-3 patterns
-------------------------------------------------- */

.a75crm-dash-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .a75crm-dash-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .a75crm-dash-grid .span-2 {
        grid-column: span 2;
    }
}

/* ==================================================
   AUTH PAGES
   Matching AuthLayout.tsx: min-h-screen lg:grid lg:grid-cols-[1fr_1fr]
================================================== */

body.a75crm-auth-screen {
    min-height: 100vh;
    background-color: var(--lv-bg);
}

.a75crm-auth-grid {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .a75crm-auth-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* --------------------------------------------------
   Brand panel (left side)
   Matching: bg-sidebar, gradient overlays, dot pattern
-------------------------------------------------- */

.a75crm-auth-brand-panel {
    position: relative;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 2.5rem;
    background: var(--lv-sidebar);
    color: var(--lv-sidebar-fg);
}

@media (min-width: 1024px) {
    .a75crm-auth-brand-panel {
        display: flex;
    }
}

.a75crm-auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, oklch(0.22 0.04 30), var(--lv-sidebar), oklch(0.18 0.03 25));
}

.a75crm-auth-brand-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image:
        radial-gradient(circle at 25% 25%, #fff 1px, transparent 1px),
        radial-gradient(circle at 75% 60%, #fff 1px, transparent 1px);
    background-size: 28px 28px, 40px 40px;
}

.a75crm-auth-brand-glow-1 {
    position: absolute;
    top: -6rem;
    left: -4rem;
    width: 20rem;
    height: 20rem;
    border-radius: 9999px;
    background: oklch(0.66 0.23 28 / 0.25);
    filter: blur(48px);
}

.a75crm-auth-brand-glow-2 {
    position: absolute;
    bottom: -6rem;
    right: -4rem;
    width: 24rem;
    height: 24rem;
    border-radius: 9999px;
    background: oklch(0.74 0.18 50 / 0.25);
    filter: blur(48px);
}

.a75crm-auth-brand-panel > * {
    position: relative;
    z-index: 1;
}

.a75crm-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    width: max-content;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.a75crm-auth-heading {
    max-width: 28rem;
    margin-top: 1.25rem;
    font-family: var(--lv-font-display);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #fff;
}

.a75crm-gradient-text {
    background: var(--lv-gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Profile hero — Lovable /profile cover (gradient + dot grid + glow) */
.a75crm-profile-hero {
    background: linear-gradient(
        to bottom right,
        oklch(0.66 0.23 28),
        oklch(0.45 0.18 280),
        oklch(0.55 0.18 220)
    );
}

.a75crm-profile-hero-dots {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 1) 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 1) 1px, transparent 1px);
    background-size: 24px 24px, 32px 32px;
}

.a75crm-auth-copy {
    max-width: 28rem;
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    line-height: 1.6;
}

.a75crm-auth-feature-list {
    display: grid;
    gap: 0.75rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.a75crm-auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
}

.a75crm-auth-feature-icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border-radius: var(--lv-radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: var(--lv-sidebar-primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.a75crm-auth-brand-footer {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.6875rem;
}

/* --------------------------------------------------
   Form panel (right side)
   Matching: flex min-h-screen flex-col, flex-1 items-center justify-center
-------------------------------------------------- */

.a75crm-auth-form-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .a75crm-auth-form-panel {
        min-height: auto;
    }
}

.a75crm-auth-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem 0;
}

@media (min-width: 1024px) {
    .a75crm-auth-mobile-brand {
        display: none;
    }
}

.a75crm-auth-form-center {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.25rem 2.5rem;
}

@media (min-width: 640px) {
    .a75crm-auth-form-center {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .a75crm-auth-form-center {
        padding: 4rem;
    }
}

.a75crm-auth-card {
    width: 100%;
    max-width: 24rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.a75crm-auth-title {
    font-family: var(--lv-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--lv-fg);
}

@media (min-width: 640px) {
    .a75crm-auth-title {
        font-size: 1.75rem;
    }
}

.a75crm-auth-subtitle {
    margin-top: 0.5rem;
    color: var(--lv-muted-fg);
    font-size: 0.875rem;
    line-height: 1.5;
}

.a75crm-auth-field {
    margin-top: 1.5rem;
}

.a75crm-auth-field:first-of-type {
    margin-top: 2rem;
}

.a75crm-auth-field label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--lv-fg);
}

.a75crm-auth-input-wrap {
    position: relative;
}

.a75crm-auth-input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border);
    background: var(--lv-bg);
    font-size: 0.875rem;
    color: var(--lv-fg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.a75crm-auth-input:focus {
    border-color: var(--lv-primary);
    box-shadow: 0 0 0 3px oklch(0.66 0.23 28 / 0.2);
    outline: none;
}

.a75crm-auth-input::placeholder {
    color: var(--lv-muted-fg);
}

.a75crm-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    z-index: 3;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: var(--lv-radius-sm);
    background: transparent;
    color: var(--lv-muted-fg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.a75crm-password-toggle:hover {
    background: var(--lv-accent);
    color: var(--lv-fg);
}

.a75crm-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px oklch(0.66 0.23 28 / 0.45);
}

.a75crm-auth-or {
    position: relative;
    margin: 1.25rem 0 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--lv-muted-fg);
}

.a75crm-auth-or::before,
.a75crm-auth-or::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 1.75rem);
    height: 1px;
    background: var(--lv-border);
}

.a75crm-auth-or::before {
    left: 0;
}

.a75crm-auth-or::after {
    right: 0;
}

.a75crm-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 2.5rem;
    margin-top: 2rem;
    border: 0;
    border-radius: var(--lv-radius-md);
    background: var(--lv-primary);
    color: var(--lv-primary-fg);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    cursor: pointer;
    transition: background 0.15s;
}

.a75crm-auth-submit:hover {
    background: oklch(0.60 0.23 28);
}

.a75crm-auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px oklch(0.66 0.23 28 / 0.3);
}

.a75crm-auth-demo {
    margin-top: 2rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--lv-border);
    border-radius: var(--lv-radius-md);
    background: var(--lv-secondary);
    color: var(--lv-muted-fg);
    font-size: 0.8125rem;
    text-align: center;
}

/* ==================================================
   EMPTY STATES
================================================== */

.a75crm-empty-state {
    padding: 2.5rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--lv-muted-fg);
}

/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 991.98px) {
    .a75crm-topbar-search {
        display: none;
    }

    .a75crm-profile-meta {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .a75crm-topbar-action span {
        display: none;
    }

    .a75crm-topbar-action {
        width: 2.25rem;
        padding: 0;
    }
}

/* ==================================================
   Agency75 CRM LOVABLE UI — TAILWIND APP SHELL (index.php)
   Warm workspace, glass topbar, auth heading font
================================================== */

body.a75crm-lovable-shell {
    background-color: var(--lv-bg);
}

body.a75crm-lovable-shell #content {
    background: transparent;
}

body.a75crm-lovable-shell #topbar {
    background: color-mix(in srgb, var(--lv-card) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--lv-border);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--lv-border) 60%, transparent);
}

.a75crm-auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--lv-muted-fg);
}

.a75crm-auth-remember-row label[for] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--lv-fg);
}

.a75crm-auth-remember-row input[type="checkbox"] {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: var(--lv-radius-sm);
    border: 1px solid var(--lv-border);
    accent-color: var(--lv-primary);
}

.a75crm-auth-remember-row input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px oklch(0.66 0.23 28 / 0.25);
}

.a75crm-auth-sso {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem;
    min-height: 2.5rem;
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border);
    background: var(--lv-card);
    color: var(--lv-muted-fg);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.85;
}

.a75crm-auth-footer-links {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--lv-muted-fg);
}

.a75crm-auth-footer-links a {
    color: var(--lv-primary);
    font-weight: 500;
    text-decoration: none;
}

.a75crm-auth-footer-links a:hover {
    text-decoration: underline;
}

/* ==================================================
   SIDEBAR COLLAPSE & EXPANDABLE GROUPS
================================================== */

/* Collapsed sidebar state */
#sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: width;
}

#sidebar.sidebar-collapsed {
    width: 72px !important;
}

#sidebar.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

#sidebar.sidebar-collapsed .sidebar-collapse-btn {
    position: absolute;
    right: 0.2rem;
    top: 1rem;
    margin-right: 0;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 9999px;
    background: transparent;
    color: color-mix(in oklab, var(--lv-sidebar-fg) 88%, white);
}

#sidebar.sidebar-collapsed .a75crm-sidebar-brand {
    justify-content: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

#sidebar.sidebar-collapsed .brand-text,
#sidebar.sidebar-collapsed .sidebar-item-text,
#sidebar.sidebar-collapsed .user-info-text,
#sidebar.sidebar-collapsed .sidebar-item-badge,
#sidebar.sidebar-collapsed .a75crm-as-user {
    opacity: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    transform: translateX(-4px);
    pointer-events: none !important;
}

#sidebar.sidebar-collapsed .sidebar-item-text,
#sidebar.sidebar-collapsed .sidebar-item-badge {
    display: none !important;
}

#sidebar .brand-text,
#sidebar .sidebar-item-text,
#sidebar .user-info-text,
#sidebar .sidebar-item-badge,
#sidebar .a75crm-as-user {
    transition: opacity 0.16s ease, transform 0.22s ease, max-width 0.22s ease;
}

#sidebar.sidebar-collapsed .sidebar-group {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

#sidebar.sidebar-collapsed .sidebar-group-toggle {
    display: flex !important;
    justify-content: center;
    padding: 0 0 0.35rem 0;
    min-height: 1.15rem;
}

#sidebar.sidebar-collapsed .sidebar-group-toggle > span:last-child,
#sidebar.sidebar-collapsed .sidebar-group-toggle .sidebar-group-chevron {
    display: none !important;
}

#sidebar.sidebar-collapsed .sidebar-group-toggle > span:first-child {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#sidebar.sidebar-collapsed .sidebar-group-toggle > span:first-child > span {
    display: none !important;
}

#sidebar.sidebar-collapsed .sidebar-group-toggle .truncate {
    display: none !important;
}

#sidebar.sidebar-collapsed .sidebar-group-toggle > span:first-child > i {
    opacity: 0.9;
}

#sidebar.sidebar-collapsed .sidebar-item {
    justify-content: center;
    gap: 0;
    width: 2.5rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    min-height: 2.2rem;
    border-radius: 0.9rem;
}

#sidebar.sidebar-collapsed .sidebar-item.nav-active {
    background: color-mix(in oklab, var(--lv-sidebar-accent) 92%, transparent);
}

#sidebar.sidebar-collapsed .sidebar-item.nav-active::before {
    left: 0.38rem;
    top: 0.42rem;
    bottom: 0.42rem;
    width: 2px;
    border-radius: 2px;
}

#sidebar.sidebar-collapsed .sidebar-group .sidebar-group-list {
    border-left: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

#sidebar.sidebar-collapsed .sidebar-scroll {
    position: relative;
}

#sidebar.sidebar-collapsed .sidebar-scroll::before {
    content: "";
    position: absolute;
    left: 0.98rem;
    top: 0.9rem;
    bottom: 0.9rem;
    width: 1px;
    background: color-mix(in oklab, var(--lv-sidebar-border) 70%, transparent);
    pointer-events: none;
}

/* Hide collapsed rail scrollbars (keep scrolling enabled). */
#sidebar.sidebar-collapsed .sidebar-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#sidebar.sidebar-collapsed .sidebar-scroll::-webkit-scrollbar {
    display: none;
}

/* Keep open section menu icons visible in collapsed rail mode. */
#sidebar.sidebar-collapsed .sidebar-group[data-collapsed="false"] > ul.sidebar-group-list {
    display: block !important;
}

/* Keep closed sections icon-only. */
#sidebar.sidebar-collapsed .sidebar-group[data-collapsed="true"] > ul.sidebar-group-list {
    display: none !important;
}

#sidebar.sidebar-collapsed .avatar-grad {
    margin: 0 auto;
}

#sidebar.sidebar-collapsed .a75crm-sidebar-user-footer {
    padding: 0.5rem 0.35rem 0.7rem;
}

#sidebar.sidebar-collapsed .a75crm-sidebar-user-link {
    justify-content: center;
    gap: 0;
    padding: 0.4rem;
    border-radius: 9999px;
    background: transparent;
}

#sidebar.sidebar-collapsed .a75crm-sidebar-user-link:hover {
    background: color-mix(in oklab, var(--lv-sidebar-accent) 82%, transparent);
}

#sidebar.sidebar-collapsed .a75crm-sidebar-user-link .avatar-grad {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.73rem;
}

/* Expandable sidebar groups */
.sidebar-group-toggle {
    cursor: pointer;
    user-select: none;
    outline: none;
}

.sidebar-group-toggle:hover {
    color: var(--lv-sidebar-fg);
}

.sidebar-group-toggle .sidebar-group-chevron {
    transition: transform 0.2s ease;
}

.sidebar-group[data-collapsed="true"] .sidebar-group-chevron {
    transform: rotate(-90deg);
}

.sidebar-group[data-collapsed="true"] > ul.sidebar-group-list {
    display: none !important;
}

/* Subtle hierarchy line under each section heading */
.sidebar-group .sidebar-group-list {
    border-left: 1px solid color-mix(in oklab, var(--lv-sidebar-border) 72%, transparent);
    margin-left: 0.5rem;
    padding-left: 0.75rem;
}

/* Mobile drawer improvements */
#drawer-sidebar {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

#drawer-overlay {
    backdrop-filter: blur(2px);
}

/* Mobile topbar product link (Lovable: Agency 75 v1.0.0) */
.a75crm-mobile-brand {
    text-decoration: none;
}
.a75crm-mobile-brand:focus-visible {
    outline: 2px solid var(--lv-ring, oklch(0.66 0.23 28));
    outline-offset: 2px;
}

/* Top-right profile chip alignment polish (tab/mobile) */
.a75crm-profile-chip {
    min-height: 2.25rem;
    align-items: center;
}
.a75crm-profile-chip .avatar-grad {
    line-height: 1;
}

/* Profile dropdown */
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    background: var(--lv-card);
    border: 1px solid var(--lv-border);
    border-radius: var(--lv-radius-lg);
    box-shadow: var(--lv-shadow-elevated);
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--lv-fg);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.profile-dropdown-item:hover {
    background-color: var(--lv-accent);
}

.profile-dropdown-item i {
    width: 1rem;
    height: 1rem;
    color: var(--lv-muted-fg);
}

.profile-dropdown-divider {
    height: 1px;
    background-color: var(--lv-border);
    margin: 0.25rem 0;
}

/* ==================================================
   SEARCH (/search) — Lovable-aligned focus + AI card chrome
================================================== */

.a75crm-ai-spark-icon {
    background: var(--lv-gradient-brand);
}

.a75crm-search-form:focus-within {
    outline: 2px solid transparent;
}

.a75crm-search-form input[type="search"]:focus-visible {
    outline: 2px solid var(--lv-ring);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.a75crm-search-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.a75crm-search-tab:focus-visible {
    outline: 2px solid var(--lv-ring);
    outline-offset: 2px;
}

.a75crm-search-ai-details summary {
    list-style: none;
}

.a75crm-search-ai-details summary::-webkit-details-marker {
    display: none;
}

.a75crm-search-result-row:focus-visible {
    outline: 2px solid var(--lv-ring);
    outline-offset: -2px;
}

#a75crm-topbar-search-form-mobile {
    position: relative;
    z-index: 25;
}

@media (max-width: 767.98px) {
    .a75crm-preview-dashboards {
        max-width: 100%;
        overflow: hidden;
    }

    #topbar .ml-auto {
        min-width: 0;
        max-width: 100%;
    }
}

/* Agency75 UI toolkit primitives */
.agency75-tabs {
    display: inline-flex;
    gap: 0.25rem;
    border: 1px solid var(--lv-border);
    background: var(--lv-muted);
    border-radius: var(--lv-radius-md);
    padding: 0.25rem;
}
.agency75-tabs [data-tab-target] {
    border: 0;
    border-radius: var(--lv-radius-sm);
    background: transparent;
    color: var(--lv-muted-fg);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
}
.agency75-tabs [data-tab-target][aria-selected="true"] {
    background: var(--lv-card);
    color: var(--lv-fg);
    box-shadow: var(--lv-shadow-card);
}
.agency75-skeleton {
    border-radius: var(--lv-radius-sm);
    background: linear-gradient(90deg, var(--lv-muted) 25%, color-mix(in srgb, var(--lv-muted) 50%, #fff) 50%, var(--lv-muted) 75%);
    background-size: 200% 100%;
    animation: agency75-skeleton 1.3s linear infinite;
}
@keyframes agency75-skeleton {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}
.agency75-panel {
    border: 1px solid var(--lv-border);
    border-radius: var(--lv-radius-xl);
    background: var(--lv-card);
    box-shadow: var(--lv-shadow-elevated);
}
