/* Skallix CRM - Modern Design System */

:root {
    /* Primary Colors */
    --primary-blue: #0066FF;
    --primary-black: #0A0A0A;
    --primary-white: #FFFFFF;
    
    /* Accent Colors */
    --accent-gold: #FFB800;
    --accent-green: #00D084;
    --accent-red: #FF3B30;
    
    /* Neutral Colors */
    --gray-50: #F9FAFB;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --crm-surface: #F5F7FA;
    --crm-card-border: #E0E6ED;
    --crm-shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--gray-100);
    color: var(--primary-black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Navigation Bar */
.navbar {
    background: var(--primary-white) !important;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-black) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: var(--primary-blue);
}

.navbar-nav .nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background-color: var(--gray-100);
    color: var(--primary-black) !important;
}

.navbar-nav .nav-link.active {
    background-color: var(--primary-blue);
    color: var(--primary-white) !important;
}

/* Modern Cards */
.card {
    background: var(--primary-white);
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--primary-white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Buttons */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    transition: background 0.2s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--primary-white);
}

.btn-primary:hover {
    background: #0052CC;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-white);
}

.btn-success {
    background: var(--accent-green);
    color: var(--primary-white);
}

.btn-success:hover {
    background: #00B571;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-white);
}

.btn-danger {
    background: var(--accent-red);
    color: var(--primary-white);
}

.btn-danger:hover {
    background: #D70015;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-white);
}

.btn-warning {
    background: var(--accent-gold);
    color: var(--primary-black);
}

.btn-warning:hover {
    background: #E6A500;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-black);
}

.btn-dark {
    background: var(--primary-black);
    color: var(--primary-white);
}

.btn-dark:hover {
    background: var(--gray-900);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: var(--primary-white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Modern Forms */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control,
.form-select {
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--primary-white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    outline: none;
}

/* Modern Badges */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.bg-primary {
    background-color: var(--primary-blue) !important;
}

.bg-success {
    background-color: var(--accent-green) !important;
}

.bg-danger {
    background-color: var(--accent-red) !important;
}

.bg-warning {
    background-color: var(--accent-gold) !important;
    color: var(--primary-black) !important;
}

.bg-dark {
    background-color: var(--primary-black) !important;
}

.bg-secondary {
    background-color: var(--gray-600) !important;
}

/* Modern Tables */
.table {
    background: var(--primary-white);
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-300);
    font-weight: 600;
    color: var(--gray-700);
    padding: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--gray-800);
}

/* Modern Stat Cards */
.stat-card {
    background: var(--primary-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-black);
    margin: 0.5rem 0;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Modern Sidebar */
.sidebar {
    background: var(--primary-white);
    border-right: 1px solid var(--gray-200);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    padding-top: 70px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu-item {
    margin: 0.25rem 1rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.sidebar-menu-link:hover {
    background: var(--gray-100);
    color: var(--primary-blue);
}

.sidebar-menu-link.active {
    background: var(--primary-blue);
    color: var(--primary-white);
}

.sidebar-menu-link i {
    width: 20px;
    margin-right: 0.75rem;
}

/* Modern Page Headers */
.page-header {
    background: var(--primary-white);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-blue);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--gray-600);
    margin: 0;
}

/* Modern Modals */
.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--primary-black);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    background: var(--gray-50);
}

/* Modern Dropdowns */
.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary-blue);
}

/* Modern Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 208, 132, 0.1);
    color: var(--accent-green);
    border-left: 4px solid var(--accent-green);
}

.alert-danger {
    background: rgba(255, 59, 48, 0.1);
    color: var(--accent-red);
    border-left: 4px solid var(--accent-red);
}

.alert-warning {
    background: rgba(255, 184, 0, 0.1);
    color: #CC9400;
    border-left: 4px solid var(--accent-gold);
}

/* Modern Progress Bars */
.progress {
    height: 0.75rem;
    background: var(--gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Utilities */
.text-primary { color: var(--primary-blue) !important; }
.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-warning { color: var(--accent-gold) !important; }
.text-dark { color: var(--primary-black) !important; }
.text-muted { color: var(--gray-600) !important; }

.border-primary { border-color: var(--primary-blue) !important; }
.border-success { border-color: var(--accent-green) !important; }
.border-danger { border-color: var(--accent-red) !important; }
.border-warning { border-color: var(--accent-gold) !important; }

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
}

/* CRM Professional Shell */
body.crm-shell {
    --primary-blue: #1F3A63;
    --accent-gold: #D99A1B;
    --accent-green: #2E7D5F;
    --accent-red: #C23B22;
    --primary-black: #1F2837;
    --gray-100: #F4F6F9;
    --gray-200: #E4E7EC;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475467;
    --gray-700: #344054;
    --gray-800: #1D2939;
    --gray-900: #101828;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #F5F7FA;
    color: var(--primary-black);
    margin: 0;
    padding: 0;
    /* Sticky footer: grow the column to the viewport so `.main-footer { margin-top: auto }`
       actually pins the bar to the bottom on short pages (My Requests with one row, etc.). */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.crm-shell .main-content {
    background: #F5F7FA;
    padding: 0;
    /* Grow to fill leftover space after header + footer. min-height: 0 overrides
       the old calc(100vh - 120px) so short pages do not overflow the viewport. */
    flex: 1 1 auto;
    min-height: 0;
}

body.crm-shell .main-footer {
    background: #FFFFFF;
    border-top: 1px solid #E0E6ED;
    padding: 1rem 0;
    margin-top: auto;
    flex-shrink: 0;
}

body.crm-shell .btn {
    border-radius: 0.375rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

body.crm-shell .btn-outline-primary {
    border-width: 1px;
}

body.crm-shell .badge {
    border-radius: 999px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
}

/* CRM Dashboard Components */
.crm-dashboard {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.5rem 2rem;
}

@media (max-width: 768px) {
    .crm-dashboard {
        padding: 1rem 1rem 1.5rem;
    }
}

.crm-page-heading {
    background: #FFFFFF;
    border-bottom: 1px solid #E0E6ED;
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: none;
    margin: 0 -1.5rem 1.25rem;
    width: calc(100% + 3rem);
}

@media (max-width: 768px) {
    .crm-page-heading {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        margin: 0 -1rem 1rem;
        width: calc(100% + 2rem);
    }
}

.crm-page-heading h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-black);
}

.crm-page-heading p {
    margin: 0.25rem 0 0;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.crm-eyebrow {
    display: none;
}

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

.crm-panel {
    background: #FFFFFF;
    border: 1px solid #E0E6ED;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: none;
}

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

.crm-section-title h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-black);
}

.crm-section-title p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.crm-section-title small {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.crm-pill {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.crm-quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.crm-quick-link {
    border: 1px solid #E0E6ED;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #FFFFFF;
    text-decoration: none;
    color: var(--primary-black);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.crm-quick-link:hover {
    border-color: var(--primary-blue);
    background: #F8FAFC;
}

.crm-quick-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    background: #F1F5F9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.crm-quick-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.crm-quick-subtext {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.crm-metric-grid {
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1100px) {
    .crm-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .crm-metric-grid {
        grid-template-columns: 1fr;
    }
}

.crm-metric-card {
    background: #FFFFFF;
    border: 1px solid #E0E6ED;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: none;
}

.crm-metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
}

.crm-metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-black);
    line-height: 1.2;
    margin: 0.25rem 0;
}

.crm-metric-trend {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
}

.crm-metric-trend.is-positive {
    background: rgba(46, 125, 95, 0.15);
    color: #1F6B4D;
}

.crm-metric-trend.is-neutral {
    background: rgba(217, 154, 27, 0.15);
    color: #8A5A0A;
}

.crm-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.crm-activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid #E0E6ED;
}

.crm-activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.crm-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F1F5F9;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.crm-activity-icon.is-job {
    color: var(--accent-green);
}

.crm-activity-icon.is-appointment {
    color: var(--accent-gold);
}

.crm-activity-content {
    flex: 1;
}

.crm-activity-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.1rem;
    color: var(--primary-black);
}

.crm-activity-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.crm-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--gray-500);
    border: 1px dashed var(--crm-card-border);
    border-radius: 0.75rem;
    background: var(--gray-50);
}

/* Setup Progress widget (OB-DASH-002) — first-time-admin onboarding checklist. */
.crm-onboarding-card {
    border: 1px solid #C7D2FE;
    background: linear-gradient(180deg, #F5F7FF 0%, #FFFFFF 70%);
    padding: 1.25rem 1.5rem;
}

.crm-onboarding-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.crm-onboarding-title {
    margin: 0.15rem 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-black);
}

.crm-onboarding-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.crm-onboarding-subtitle strong {
    color: var(--primary-black);
}

.crm-onboarding-percent {
    flex: 0 0 auto;
    background: #FFFFFF;
    border: 1px solid #C7D2FE;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    color: #4338CA;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
}

.crm-onboarding-progress {
    height: 6px;
    background: #E0E7FF;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0 1rem;
}

.crm-onboarding-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366F1 0%, #4338CA 100%);
    transition: width 240ms ease;
}

.crm-onboarding-step-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.crm-onboarding-step {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.crm-onboarding-step-marker {
    flex: 0 0 1.75rem;
    height: 1.75rem;
    width: 1.75rem;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #C7D2FE;
    color: #4338CA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.4rem;
}

.crm-onboarding-step.is-done .crm-onboarding-step-marker {
    background: #16A34A;
    border-color: #16A34A;
    color: #FFFFFF;
}

.crm-onboarding-step-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid #E0E6ED;
    border-radius: 0.5rem;
    background: #FFFFFF;
    color: var(--primary-black);
    text-decoration: none;
    font-size: 0.92rem;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.crm-onboarding-step-link:hover {
    border-color: #6366F1;
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
    text-decoration: none;
}

.crm-onboarding-step.is-done .crm-onboarding-step-link {
    background: #F8FAFC;
    color: var(--gray-600);
}

.crm-onboarding-step.is-done .crm-onboarding-step-label {
    text-decoration: line-through;
    text-decoration-color: var(--gray-400);
}

.crm-onboarding-step-label {
    font-weight: 600;
}

.crm-onboarding-step-status {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #16A34A;
}

.crm-onboarding-step-status.is-pending {
    color: #6366F1;
}

.crm-onboarding-step-status i {
    margin-left: 0.35rem;
    font-size: 0.7rem;
}

.crm-onboarding-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.crm-onboarding-actions .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.crm-onboarding-dismiss {
    background: transparent;
    border: none;
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
}

.crm-onboarding-dismiss:hover {
    color: var(--gray-700);
}

@media (max-width: 640px) {
    .crm-onboarding-header {
        flex-direction: column;
    }
    .crm-onboarding-percent {
        align-self: flex-start;
    }
}

/* Setup Progress FAB — collapsed state of the onboarding widget. Anchored
   bottom-LEFT so it never collides with the AI assistant FAB / panel that
   live in the bottom-right corner on the Job view (and other AI surfaces).
   Clicking it re-opens the full card above. The admin can minimize/restore
   freely (localStorage), but the FAB itself is only rendered while the
   widget is eligible (admin + not 100% complete). */
.crm-onboarding-fab {
    position: fixed;
    left: 24px;
    right: auto;
    bottom: 24px;
    z-index: 1080;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem 0.6rem 0.65rem;
    background: linear-gradient(135deg, #6366F1 0%, #4338CA 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(67, 56, 202, 0.35), 0 2px 6px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
    animation: crm-onboarding-fab-bob 4s ease-in-out infinite;
}

.crm-onboarding-fab[hidden] {
    display: none !important;
}

.crm-onboarding-fab:hover,
.crm-onboarding-fab:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(67, 56, 202, 0.45), 0 2px 8px rgba(15, 23, 42, 0.22);
    outline: none;
}

.crm-onboarding-fab-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.crm-onboarding-fab-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1;
}

.crm-onboarding-fab-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.crm-onboarding-fab-count {
    font-size: 0.95rem;
    font-weight: 700;
}

@keyframes crm-onboarding-fab-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .crm-onboarding-fab { animation: none; }
}

@media (max-width: 640px) {
    .crm-onboarding-fab {
        left: 16px;
        right: auto;
        bottom: 16px;
        padding: 0.55rem 0.85rem 0.55rem 0.55rem;
    }
    .crm-onboarding-fab-icon {
        width: 28px;
        height: 28px;
    }
}

/* OB-TOUR-* (plans/onboardingplan.md) — Skallix theme override for driver.js
   popovers. Default driver.js popover is a plain white box with a white-on-
   white arrow that vanishes against the CRM background; below we re-skin the
   popover, footer buttons and arrow to match the indigo/Skallix palette. */
.driver-popover.crm-onboarding-popover {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FF 100%);
    border: 1px solid #C7D2FE;
    border-radius: 10px;
    padding: 18px 20px 16px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.20), 0 2px 6px rgba(15, 23, 42, 0.08);
    color: #1E293B;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.driver-popover.crm-onboarding-popover .driver-popover-title {
    font: 700 16px/1.4 'Inter', -apple-system, sans-serif;
    color: #0F172A;
    margin: 0 28px 6px 0;
}

.driver-popover.crm-onboarding-popover .driver-popover-description {
    font: 400 13.5px/1.55 'Inter', -apple-system, sans-serif;
    color: #475569;
    margin: 0;
}

.driver-popover.crm-onboarding-popover .driver-popover-description b,
.driver-popover.crm-onboarding-popover .driver-popover-description strong {
    color: #1E293B;
    font-weight: 700;
}

.driver-popover.crm-onboarding-popover .driver-popover-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #E0E7FF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.driver-popover.crm-onboarding-popover .driver-popover-progress-text {
    font: 700 12px/1 'Inter', -apple-system, sans-serif;
    color: #6366F1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-popover.crm-onboarding-popover .driver-popover-footer button {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 7px 14px;
    font: 600 13px/1 'Inter', -apple-system, sans-serif;
    color: #1E293B;
    cursor: pointer;
    transition: filter 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    /* Driver.js base CSS sets text-shadow: 1px 1px 0 #fff on every footer
       button, which produces a 1px white ghost of the label — visible as a
       second "Next" stacked behind the white text on our indigo gradient
       button. Strip it everywhere so labels render cleanly. */
    text-shadow: none;
}

.driver-popover.crm-onboarding-popover .driver-popover-footer button:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
}

.driver-popover.crm-onboarding-popover .driver-popover-next-btn {
    background: linear-gradient(180deg, #6366F1 0%, #4338CA 100%) !important;
    border-color: #4338CA !important;
    color: #FFFFFF !important;
    box-shadow: 0 1px 4px rgba(67, 56, 202, 0.30);
}

.driver-popover.crm-onboarding-popover .driver-popover-next-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.40);
}

.driver-popover.crm-onboarding-popover .driver-popover-close-btn {
    color: #94A3B8;
    font-size: 22px;
    width: 28px;
    height: 26px;
    top: 4px;
    right: 4px;
}

.driver-popover.crm-onboarding-popover .driver-popover-close-btn:hover,
.driver-popover.crm-onboarding-popover .driver-popover-close-btn:focus {
    color: #1E293B;
}

/* Arrow tint: side determines which border edge shows. driver.js uses a CSS
   border-triangle, so we recolor only the visible edge per side. The popover
   gradient starts white so the "top-edge" arrows stay light; the bottom edge
   tint matches the gradient bottom (#F5F7FF). */
.driver-popover.crm-onboarding-popover .driver-popover-arrow-side-top {
    border-top-color: #F5F7FF !important;
}
.driver-popover.crm-onboarding-popover .driver-popover-arrow-side-bottom {
    border-bottom-color: #FFFFFF !important;
}
.driver-popover.crm-onboarding-popover .driver-popover-arrow-side-left {
    border-left-color: #FFFFFF !important;
}
.driver-popover.crm-onboarding-popover .driver-popover-arrow-side-right {
    border-right-color: #F5F7FF !important;
}

/* OB-SIDE-002..003 (plans/onboardingplan.md) — settings-sidebar pulse dot for
   any onboarding step that's still open. Lives in main.css so it applies on
   every settings page regardless of whether the page sources its base styles
   from settings-styles.ejs (inline) or /css/settings.css (external). */
.settings-nav-item.is-pulse {
    position: relative;
}

.settings-nav-pulse {
    margin-left: auto;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #6366F1;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    animation: crm-onboarding-pulse 2s ease-out infinite;
}

@keyframes crm-onboarding-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(99, 102, 241, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0    rgba(99, 102, 241, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .settings-nav-pulse {
        animation: none;
        box-shadow: none;
    }
}

.crm-activity-more {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.crm-activity-more a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.crm-activity-more a:hover {
    text-decoration: underline;
}

.crm-score-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--primary-black);
    margin-bottom: 0.25rem;
}

.crm-score-row span:last-child {
    color: var(--primary-black);
    font-weight: 600;
}

/* CRM Filters */
.crm-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.crm-filter-group {
    min-width: 150px;
    flex: 1;
    max-width: 220px;
}

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

/* CRM Table */
.crm-table-wrapper {
    overflow-x: auto;
}

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

.crm-table thead th {
    background: #F8FAFC;
    border-bottom: 1px solid #E0E6ED;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-600);
    white-space: nowrap;
}

.crm-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #E0E6ED;
    vertical-align: middle;
}

.crm-table tbody tr:hover {
    background: #F8FAFC;
}

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

.crm-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

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

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

.crm-actions .btn {
    padding: 0.25rem 0.5rem;
}

/* CRM Tabs */
.crm-tabs {
    border-bottom: 1px solid #E0E6ED;
    gap: 0.25rem;
}

.crm-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: transparent;
    border-radius: 0;
}

.crm-tabs .nav-link:hover {
    color: var(--primary-blue);
    border-bottom-color: #E0E6ED;
}

.crm-tabs .nav-link.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background: transparent;
}

/* Two-column layout for activity + performance */
.crm-two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 992px) {
    .crm-two-col {
        grid-template-columns: 1fr;
    }
}

.crm-activity-panel {
    min-height: 0;
}

.crm-performance-panel {
    min-height: 0;
}

.crm-chart-wrap {
    max-width: 180px;
    margin: 0 auto 0.5rem;
}

/* Autocomplete dropdown */
.crm-autocomplete-wrapper {
    position: relative;
}

.crm-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    max-height: 280px;
    overflow-y: auto;
}

.crm-autocomplete-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #1e293b;
    text-align: left;
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.crm-autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.crm-autocomplete-item:hover {
    background: #f8fafc;
}

.crm-autocomplete-item:focus {
    background: #eff6ff;
    outline: none;
}

.crm-autocomplete-item .fa-map-marker-alt {
    color: #3b82f6;
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.crm-autocomplete-item .address-text {
    flex: 1;
}

.crm-autocomplete-item .address-main {
    font-weight: 500;
    color: #1e293b;
}

.crm-autocomplete-item .address-secondary {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.crm-autocomplete-powered {
    padding: 8px 16px;
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
}

.crm-autocomplete-powered img {
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
}

/* ============================================= */
/* ========== MOBILE RESPONSIVE STYLES ========= */
/* ============================================= */

@media (max-width: 992px) {
    /* Dashboard Page Heading */
    .crm-page-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .crm-heading-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    
    .crm-heading-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    /* Quick Links Grid */
    .crm-quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Metrics Grid */
    .crm-metric-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Two Column Layout */
    .crm-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Main Content */
    .main-content {
        padding: 0;
    }
    
    .main-content > .container-fluid {
        padding: 0.75rem;
    }
    
    /* Dashboard */
    .crm-dashboard {
        padding: 1rem;
    }
    
    .crm-page-heading h1 {
        font-size: 1.5rem;
    }
    
    .crm-page-heading p {
        font-size: 0.875rem;
    }
    
    .crm-eyebrow {
        font-size: 0.7rem;
    }
    
    /* Panel */
    .crm-panel {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .crm-section-title h2 {
        font-size: 1rem;
    }
    
    .crm-section-title p {
        font-size: 0.8rem;
    }
    
    /* Quick Links */
    .crm-quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .crm-quick-link {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .crm-quick-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin: 0 auto;
    }
    
    .crm-quick-label {
        font-size: 0.75rem;
    }
    
    .crm-quick-subtext {
        display: none;
    }
    
    /* Metrics */
    .crm-metric-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .crm-metric-card {
        padding: 0.875rem;
    }
    
    .crm-metric-value {
        font-size: 1.25rem;
    }
    
    .crm-metric-label {
        font-size: 0.7rem;
    }
    
    .crm-metric-trend {
        font-size: 0.65rem;
    }
    
    /* Activity */
    .crm-activity-item {
        padding: 0.75rem;
    }
    
    .crm-activity-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .crm-activity-title {
        font-size: 0.8rem;
    }
    
    .crm-activity-time {
        font-size: 0.7rem;
    }
    
    /* Pill */
    .crm-pill {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Buttons */
    .crm-heading-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .crm-dashboard {
        padding: 0.75rem;
    }
    
    .crm-page-heading h1 {
        font-size: 1.25rem;
    }
    
    .crm-heading-actions {
        flex-direction: column;
    }
    
    .crm-heading-actions .btn {
        width: 100%;
    }
    
    .crm-quick-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .crm-quick-link {
        padding: 0.5rem;
    }
    
    .crm-quick-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .crm-quick-label {
        font-size: 0.65rem;
    }
    
    .crm-metric-card {
        padding: 0.75rem;
    }
    
    .crm-metric-value {
        font-size: 1.1rem;
    }
}