/* Prevent raw unrendered Vue templates from displaying before mount */
[v-cloak] {
    display: none !important;
}

/* Font Awesome icon alignment utilities */
.fa-solid,
.fa-brands,
.fa-regular {
    vertical-align: middle;
    line-height: 1;
}

/* Sidebar icon alignment */
.sidebar-item a .fa-solid,
.sidebar-item a .fa-fw {
    margin-right: 2px;
    font-size: 14px;
    opacity: 0.85;
}

/* Settings sidebar icon */
.settings-nav-item .fa-solid,
.settings-nav-item .fa-brands {
    margin-right: 3px;
    font-size: 13px;
    opacity: 0.85;
}

/* Button icon spacing */
.btn .fa-solid,
.btn .fa-brands,
.btn .fa-regular {
    margin-right: 5px;
    font-size: 13px;
}
.btn-logout .fa-solid {
    margin-right: 5px;
}



/* Core Styling Reset & Font Setup */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Modern Color Tokens */
    --bg-warm: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --header-dark: #0b1329;
    --header-surface: #111d3d;
    --primary-orange: #ea580c;
    --primary-hover: #c2410c;
    --primary-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    
    --border-light: #e2e8f0;
    --border-focus: #cbd5e1;
    
    --success-text: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    
    --error-text: #dc2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    
    --warning-text: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    
    /* Modern Layout & Elevation Tokens */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --card-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --card-hover-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    --modal-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45);
    
    --font-family: 'Plus Jakarta Sans', 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 13px;
    --font-size-large: 16px;
    --font-size-small: 11px;
}

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

body {
    background-color: var(--bg-warm);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Page Layout Structures */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar CSS styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--header-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    height: 35px;
    object-fit: contain;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-item a:hover,
.sidebar-item.active > a {
    color: #fff;
    background-color: var(--primary-orange);
}

/* Sidebar Dropdown Group */
.sidebar-dropdown-group > a.sidebar-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-dropdown-group > a.sidebar-dropdown-trigger > span {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-dropdown-group > a.sidebar-dropdown-trigger:hover {
    color: #fff;
    background-color: rgba(232, 99, 28, 0.25);
}

.sidebar-caret {
    font-size: 11px;
    transition: transform 0.25s ease;
    opacity: 0.6;
}

.sidebar-caret.open {
    transform: rotate(180deg);
    opacity: 1;
}

.sidebar-submenu {
    list-style: none;
    padding: 4px 0 4px 12px;
    margin: 2px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 2px solid rgba(232, 99, 28, 0.4);
    margin-left: 20px;
}

.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-submenu li a:hover,
.sidebar-submenu li.active a {
    color: #fff;
    background-color: var(--primary-orange);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-size-small);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flexbox items from pushing past screen boundaries */
}

.top-bar {
    height: 60px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.top-bar-title {
    font-size: var(--font-size-large);
    font-weight: 800;
    color: var(--header-dark);
}

.top-bar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background-color: var(--bg-warm);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: var(--font-size-small);
    border: 1px solid var(--border-light);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--error-text);
    font-weight: 600;
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.8;
}

.content-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-warm);
}

/* Dynamic Module View Loader & Transitions */
.view-viewport {
    animation: fadeInModule 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModule {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    gap: 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.loading-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(234, 88, 12, 0.15);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spinView 0.8s linear infinite;
}

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

/* Skeleton Loading State for Login */
.login-loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}
.skeleton-logo {
    width: 140px;
    height: 50px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    animation: skeletonPulse 1.5s infinite ease-in-out;
}
.skeleton-line {
    width: 220px;
    height: 20px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    animation: skeletonPulse 1.5s infinite ease-in-out;
}
.skeleton-box {
    width: 100%;
    height: 120px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    animation: skeletonPulse 1.5s infinite ease-in-out;
}
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Brand badge in sidebar header */
.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-badge {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.4));
    border: 1px solid rgba(249, 115, 22, 0.5);
    color: var(--primary-orange);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 6px;
}

/* Login Screen Layout */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    background-color: var(--header-dark);
}

.login-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 14px;
    color: #fff;
    box-shadow: var(--modal-shadow);
}

.login-logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    height: 60px;
    object-fit: contain;
}

.login-title {
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* Forms and Inputs */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-weight: 600;
    font-size: 12px;
    color: inherit;
}

.login-card .form-label {
    color: rgba(255, 255, 255, 0.7);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background-color: #fff;
    color: var(--text-main);
    transition: all 0.2s;
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.login-card .form-control:focus {
    border-color: var(--primary-orange);
    outline: none;
    background: rgba(255, 255, 255, 0.15);
}

.form-control:focus {
    border-color: var(--primary-orange);
    outline: none;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-orange);
    color: #fff;
}

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

.btn-secondary {
    background-color: var(--bg-warm);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: var(--border-light);
}

.btn-danger {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-text);
}

.btn-danger:hover {
    background-color: var(--error-text);
    color: #fff;
}

.btn-block {
    width: 100%;
}

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

/* Premium Layout Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-label {
    font-size: var(--font-size-small);
    text-transform: uppercase;
    font-weight: 700;
    color: #777;
    letter-spacing: 0.5px;
}

.stats-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--header-dark);
}

.panel-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--border-light);
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.panel-title {
    font-size: var(--font-size-large);
    font-weight: 800;
    color: var(--header-dark);
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 14px 16px;
    background-color: var(--bg-warm);
    font-weight: 700;
    color: #555;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-size-small);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,0.01);
}

/* Overdue highlight */
.tr-overdue {
    background-color: var(--error-bg) !important;
    border-left: 4px solid var(--error-text);
}

.tr-overdue td {
    color: var(--error-text);
}

/* Modals & Dialogs */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--modal-shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background-color: var(--header-dark);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-size-large);
    font-weight: 800;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: 70vh;
}

.modal-footer {
    padding: 15px 25px;
    background-color: var(--bg-warm);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Alerts and Toast notifications */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-text);
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-text);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-text);
}

/* Custom Mini Calendar Component */
.mini-calendar {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 15px;
    max-width: 320px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    margin-bottom: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day-header {
    font-weight: 700;
    font-size: var(--font-size-small);
    color: #777;
    padding: 5px 0;
}

.calendar-cell {
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    transition: all 0.2s;
}

.calendar-cell:hover {
    background-color: var(--bg-warm);
}

.calendar-cell.selected {
    background-color: var(--primary-orange) !important;
    color: #fff;
}

.calendar-cell.has-followup::after {
    content: "⏰";
    position: absolute;
    top: 1px;
    right: 1px;
    font-size: 8px;
}

/* Sequential Pipeline Checklist Layout */
.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.pipeline-step {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fff;
    transition: all 0.2s ease;
}

.pipeline-step.completed {
    border-color: var(--success-text);
    background-color: var(--success-bg);
}

.pipeline-step.active {
    border-left: 4px solid var(--primary-orange);
    box-shadow: var(--card-shadow);
}

.pipeline-step.locked {
    opacity: 0.5;
    background-color: #faf9f6;
    cursor: not-allowed;
}

.step-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--bg-warm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.pipeline-step.completed .step-number {
    background-color: var(--success-text);
    color: #fff;
    border: none;
}

.pipeline-step.active .step-number {
    background-color: var(--primary-orange);
    color: #fff;
    border: none;
}

.step-label {
    font-weight: 700;
    color: var(--header-dark);
}

/* Audio Visualizer 8 Bar Graph */
.visualizer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #000;
    border-radius: 10px;
    margin: 15px 0;
}

.visualizer-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
    width: 120px;
}

.visualizer-bar {
    width: 8px;
    background-color: var(--primary-orange);
    border-radius: 4px;
    transition: height 0.1s ease;
    height: 5px;
}

.visualizer-text {
    color: #fff;
    font-size: var(--font-size-small);
    font-family: monospace;
}

/* Location pill filter for Admin stats */
.location-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.location-pill {
    padding: 8px 18px;
    border-radius: 20px;
    background-color: #fff;
    border: 1px solid var(--border-light);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.location-pill:hover,
.location-pill.active {
    background-color: var(--header-dark);
    color: #fff;
    border-color: var(--header-dark);
}

/* Cursive font for signature inputs */
.cursive-signature {
    font-family: 'Great Vibes', 'Brush Script MT', 'Dancing Script', cursive;
    font-size: 26px;
    padding: 10px;
    border: 1px dashed #bbb;
    border-radius: 8px;
    background-color: #fafaf9;
    text-align: center;
    min-height: 48px;
}

/* Dashboard Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
    .sidebar-item a {
        padding: 8px 12px;
        white-space: nowrap;
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Inline Audio Player for Admin meetings log */
/* ── Compact Table Audio Play Button ───────────────────────────── */
.audio-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding: 7px 14px 7px 10px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    outline: none;
    white-space: nowrap;
    overflow: hidden;
}

.audio-play-btn i {
    font-size: 11px;
    color: var(--primary-orange);
    width: 22px;
    height: 22px;
    background: rgba(232, 99, 28, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.audio-play-btn:hover {
    background: linear-gradient(135deg, #232340 0%, #1a2a50 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(0,0,0,0.3);
}

.audio-play-btn:hover i {
    background: rgba(232, 99, 28, 0.3);
}

.audio-play-btn.playing {
    background: linear-gradient(135deg, var(--primary-orange) 0%, #c0451a 100%);
    box-shadow: 0 4px 18px rgba(232, 99, 28, 0.45);
}

.audio-play-btn.playing i {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

/* Pulsing ring animation on playing */
.audio-btn-ring {
    position: absolute;
    inset: 0;
    border-radius: 50px;
    border: 2px solid var(--primary-orange);
    opacity: 0;
    pointer-events: none;
}

.audio-play-btn.playing .audio-btn-ring {
    animation: audio-ring-pulse 1.4s ease-out infinite;
}

@keyframes audio-ring-pulse {
    0%   { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.12); }
}

.audio-btn-label {
    font-size: 11px;
    letter-spacing: 0.3px;
    min-width: 28px;
}

.audio-none-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #c0c0c0;
    background: #f4f4f4;
    padding: 5px 10px;
    border-radius: 50px;
    font-weight: 600;
}

/* ── Floating Audio Player Bar ──────────────────────────────────── */
.floating-audio-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 28px;
    background: rgba(18, 18, 30, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(232, 99, 28, 0.3);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.55);
}

/* Slide-up transition */
.audio-bar-slide-enter-active,
.audio-bar-slide-leave-active {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.audio-bar-slide-enter-from,
.audio-bar-slide-leave-to {
    transform: translateY(100%);
    opacity: 0;
}

/* Left — track info */
.fab-info {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 190px;
}

.fab-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-orange), #c0451a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(232,99,28,0.45);
}

.fab-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.fab-title {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.fab-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Center — controls + progress */
.fab-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.fab-ctrl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
    padding: 4px;
    line-height: 1;
}

.fab-ctrl-btn span {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.fab-ctrl-btn:hover {
    color: var(--primary-orange);
}

.fab-play-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-orange), #c0451a);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 18px rgba(232,99,28,0.5);
}

.fab-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(232,99,28,0.65);
}

/* Progress bar */
.fab-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fab-time {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    min-width: 38px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fab-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}

.fab-progress-track:hover {
    height: 6px;
}

.fab-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-orange), #ffaa55);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.fab-progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.15s;
}

.fab-progress-track:hover .fab-progress-thumb {
    opacity: 1;
}

/* Right — volume + close */
.fab-right {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 160px;
    justify-content: flex-end;
}

.fab-volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fab-vol-icon {
    color: rgba(255,255,255,0.45);
    font-size: 13px;
}

.fab-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.fab-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-orange);
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(232,99,28,0.5);
}

.fab-close-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.fab-close-btn:hover {
    background: rgba(220, 50, 50, 0.25);
    border-color: rgba(220,50,50,0.4);
    color: #ff6b6b;
}


/* Toast Message Overlay */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background-color: var(--header-dark);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--modal-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Phase 2 Settings Layout --- */
.settings-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
}

.settings-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
    padding: 10px 0;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.settings-nav-item:hover {
    background-color: var(--bg-warm);
    color: var(--primary-orange);
}

.settings-nav-item.active {
    background-color: #fff9f6;
    color: var(--primary-orange);
    border-left-color: var(--primary-orange);
    font-weight: 600;
}

.settings-nav-item svg, .settings-nav-item i {
    width: 16px;
    text-align: center;
    color: #888;
    transition: color 0.2s ease;
}

.settings-nav-item:hover svg, .settings-nav-item.active svg,
.settings-nav-item:hover i, .settings-nav-item.active i {
    color: var(--primary-orange);
}

.settings-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    padding: 30px;
    min-height: 500px;
}

.settings-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.settings-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--header-dark);
}

/* Switch Toggle Component */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-orange);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ============================================================
   Quill Rich Text Editor Overrides
   ============================================================ */
.ql-toolbar.ql-snow {
    background: var(--bg-warm, #f8f7f5);
    border: 1px solid var(--border-light, #ddd);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 8px 10px;
    font-family: inherit;
}

.ql-toolbar.ql-snow .ql-formats {
    margin-right: 10px;
}

.ql-toolbar.ql-snow button,
.ql-toolbar.ql-snow .ql-picker-label {
    color: var(--text-primary, #1a1a1a);
}

.ql-toolbar.ql-snow button:hover,
.ql-toolbar.ql-snow button.ql-active,
.ql-toolbar.ql-snow .ql-picker-label:hover {
    color: var(--primary-orange, #e07b39);
}

.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: var(--primary-orange, #e07b39);
}

.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: var(--primary-orange, #e07b39);
}

.ql-container.ql-snow {
    border: 1px solid var(--border-light, #ddd);
    border-radius: 0 0 6px 6px;
    font-family: 'Public Sans', sans-serif;
    font-size: 14px;
}

.ql-editor {
    min-height: 280px;
    padding: 16px 18px;
    color: #1a1a1a;
    line-height: 1.7;
}

.ql-editor.ql-blank::before {
    font-style: italic;
    color: #bbb;
    font-size: 13px;
}

/* Ensure the editor area has minimum height */
#quill-editor-wrapper .ql-container {
    min-height: 280px;
}

/* Make sure Quill picker dropdowns appear above modals */
.ql-picker-options {
    z-index: 99999 !important;
}

/* ==========================================================================
   Modern Stat KPI Cards Grid & Filter Bars
   ========================================================================== */
.stat-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-kpi-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-orange);
}

.stat-kpi-card.kpi-blue::before { background: #2563eb; }
.stat-kpi-card.kpi-green::before { background: #059669; }
.stat-kpi-card.kpi-amber::before { background: #d97706; }
.stat-kpi-card.kpi-purple::before { background: #7c3aed; }
.stat-kpi-card.kpi-red::before { background: #dc2626; }

.stat-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.stat-kpi-info {
    display: flex;
    flex-direction: column;
}

.stat-kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.stat-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-orange);
}

.stat-kpi-card.kpi-blue .stat-kpi-icon { background: #eff6ff; color: #2563eb; }
.stat-kpi-card.kpi-green .stat-kpi-icon { background: #ecfdf5; color: #059669; }
.stat-kpi-card.kpi-amber .stat-kpi-icon { background: #fffbeb; color: #d97706; }
.stat-kpi-card.kpi-purple .stat-kpi-icon { background: #f5f3ff; color: #7c3aed; }

/* Filter Bar Component */
.filter-bar {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-input-wrapper {
    position: relative;
    min-width: 200px;
}

.filter-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}

.filter-input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    font-size: 12px;
    font-family: var(--font-family);
    background: #f8fafc;
    transition: all 0.2s ease;
}

.filter-input:focus {
    background: #fff;
    border-color: var(--primary-orange);
    outline: none;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.filter-select {
    padding: 6px 24px 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    font-size: 12px;
    font-family: var(--font-family);
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.filter-select:focus {
    background: #fff;
    border-color: var(--primary-orange);
}

.btn-filter-reset {
    background: transparent;
    border: 1px solid var(--border-light);
    color: #64748b;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-filter-reset:hover {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: #cbd5e1;
}

/* Pulse animation badge for active visits */
.badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-pulse::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: badgePulseAnim 1.8s infinite;
}

@keyframes badgePulseAnim {
    0% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.4; }
    100% { transform: scale(0.95); opacity: 1; }
}

/* User Avatar & Profile Bar Components */
.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 5px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-main);
}

.user-profile-trigger:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.user-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-orange), #ea580c);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.user-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(232, 99, 28, 0.5);
}

/* Active Meeting Concurrency Banner */
.active-meeting-banner {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1.5px solid #fdba74;
    border-left: 5px solid var(--primary-orange);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(232, 99, 28, 0.08);
}

.active-meeting-banner-text {
    font-size: 13px;
    font-weight: 700;
    color: #9a3412;
}

/* Lead & Timeline Components (Perfex CRM style) */
.timeline-container {
    position: relative;
    padding-left: 30px;
    margin-top: 15px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 11px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon-dot {
    position: absolute;
    left: -30px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--primary-orange);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    z-index: 1;
}

.timeline-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.timeline-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-date {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.timeline-actor {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.timeline-body {
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
    margin-top: 6px;
}

/* Referral Chain pill badge */
.referral-chain-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
    border-radius: 20px;
}

/* ========================================================================== 
   Product UI refresh
   A more deliberate application shell, with a quiet canvas and layered panels.
   ========================================================================== */
:root {
    --bg-warm: #f5f7fb;
    --text-main: #172033;
    --text-muted: #69758a;
    --header-dark: #111a33;
    --header-surface: #172342;
    --primary-orange: #ff6b35;
    --primary-hover: #e95723;
    --primary-gradient: linear-gradient(135deg, #ff8a4c 0%, #ff5d2e 100%);
    --border-light: #e6eaf1;
    --border-focus: #cbd4e1;
    --card-shadow: 0 1px 2px rgba(18, 30, 52, .02), 0 8px 26px rgba(18, 30, 52, .045);
    --card-hover-shadow: 0 16px 35px rgba(18, 30, 52, .10);
    --sidebar-width: 272px;
}

body {
    background: radial-gradient(circle at 100% 0, rgba(255, 107, 53, .055), transparent 26rem), var(--bg-warm);
    letter-spacing: -.01em;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 12px;
    background: linear-gradient(165deg, #111a33 0%, #172342 100%);
    box-shadow: 8px 0 32px rgba(16, 24, 48, .08);
}
.sidebar-header { padding: 10px; border-bottom-color: rgba(255, 255, 255, .08); }
.sidebar-logo { height: 31px; }
.brand-badge { padding: 3px 7px; color: #ffc2a8; background: rgba(255, 107, 53, .14); border-color: rgba(255, 138, 76, .25); border-radius: 999px; font-size: 9px; }
.sidebar-menu { padding: 18px 0; gap: 4px; }
.sidebar-item a, .sidebar-dropdown-group > a.sidebar-dropdown-trigger { min-height: 45px; padding: 11px 13px; border-radius: 10px; color: rgba(241, 245, 249, .67); font-size: 13px; }
.sidebar-item a:hover, .sidebar-item.active > a { color: #fff; background: linear-gradient(105deg, rgba(255, 107, 53, .98), rgba(255, 135, 74, .88)); box-shadow: 0 7px 16px rgba(255, 92, 45, .18); }
.sidebar-dropdown-group > a.sidebar-dropdown-trigger:hover { background: rgba(255, 255, 255, .075); }
.sidebar-submenu { margin-left: 22px; border-left-color: rgba(255, 142, 93, .36); }
.sidebar-submenu li a { font-size: 12px; }
.sidebar-footer { padding: 12px 0 0; border-top-color: rgba(255, 255, 255, .08); }
.sidebar-user-card { border-radius: 12px; background: rgba(255, 255, 255, .055); }

.top-bar { position: sticky; top: 0; z-index: 20; height: 74px; padding: 0 34px; background: rgba(255, 255, 255, .88); border-bottom-color: rgba(226, 232, 240, .86); backdrop-filter: blur(16px); }
.top-bar-title { font-size: 19px; letter-spacing: -.04em; }
.top-bar-title::after { content: 'Workspace'; display: block; margin-top: 1px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.top-bar-user { gap: 10px; }
.user-badge { background: #f8f9fc; border-radius: 999px; padding: 7px 11px; color: #4f5d73; }
.btn-logout { padding: 8px 10px; border-radius: 8px; color: #bd3c37; }
.btn-logout:hover { background: #fff1f1; opacity: 1; }
.content-body { padding: 30px 34px 42px; }

.btn { min-height: 38px; padding: 9px 15px; border-radius: 9px; font-size: 12px; font-weight: 700; box-shadow: none; }
.btn-primary { background: var(--primary-gradient); box-shadow: 0 6px 15px rgba(255, 100, 47, .18); }
.btn-primary:hover { background: linear-gradient(135deg, #ff753b, #f95227); transform: translateY(-1px); box-shadow: 0 9px 19px rgba(255, 100, 47, .24); }
.btn-secondary { background: #fff; border-color: #dfe5ee; }
.btn-secondary:hover { background: #f7f9fc; border-color: #cbd4e1; }

.card-grid, .stat-kpi-grid { gap: 16px; margin-bottom: 20px; }
.stats-card, .stat-kpi-card { min-height: 118px; border-radius: 14px; border-color: rgba(226, 232, 240, .9); box-shadow: var(--card-shadow); }
.stats-card { padding: 20px; gap: 8px; position: relative; overflow: hidden; }
.stats-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary-gradient); }
.stats-label, .stat-kpi-label { color: #778398; font-size: 10px; letter-spacing: .08em; }
.stats-value, .stat-kpi-val { font-size: 28px; letter-spacing: -.05em; }
.stat-kpi-card { padding: 18px 20px; }
.stat-kpi-card::before { width: 3px; }
.stat-kpi-icon { width: 42px; height: 42px; border-radius: 12px; }

.panel-card, .settings-content { border-radius: 14px; border-color: rgba(226, 232, 240, .9); box-shadow: var(--card-shadow); }
.panel-card { padding: 22px; margin-bottom: 20px; }
.panel-header { padding-bottom: 15px; margin-bottom: 16px; }
.panel-title { font-size: 15px; letter-spacing: -.025em; }
.grid-2, .grid-3 { gap: 20px; margin-bottom: 20px; }

.filter-bar { padding: 10px; border-radius: 11px; border-color: #e8ecf2; background: #fafbfc; box-shadow: none; }
.filter-input, .filter-select { min-height: 34px; background: #fff; border-color: #e1e7ef; border-radius: 8px; }
.filter-input:focus { box-shadow: 0 0 0 3px rgba(255, 107, 53, .12); border-color: var(--primary-orange); }
.table th { padding: 12px 14px; background: #f8fafc; color: #738096; font-size: 10px; }
.table td { padding: 14px; border-bottom-color: #edf0f4; }
.table tbody tr { transition: background-color .16s ease; }
.table tbody tr:hover { background: #fafcff; }
.form-control { min-height: 40px; border-radius: 9px; border-color: #dfe5ee; }
.form-control:focus { border-color: var(--primary-orange); box-shadow: 0 0 0 3px rgba(255, 107, 53, .12); }
.modal-content { border-radius: 16px; }
.modal-header { padding: 18px 23px; background: linear-gradient(115deg, #111a33, #1d2a4b); }

.login-container { position: relative; overflow: hidden; background: linear-gradient(130deg, #101a34 0%, #17294d 62%, #1f3157 100%); }
.login-container::before, .login-container::after { content: ''; position: absolute; border-radius: 50%; filter: blur(2px); }
.login-container::before { width: 36rem; height: 36rem; right: -12rem; top: -13rem; background: rgba(255, 107, 53, .22); }
.login-container::after { width: 24rem; height: 24rem; left: -11rem; bottom: -12rem; background: rgba(84, 126, 255, .18); }
.login-card { position: relative; z-index: 1; padding: 38px; border-radius: 20px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); box-shadow: 0 30px 70px rgba(3, 9, 24, .35); }
.login-title { font-size: 21px; letter-spacing: -.035em; }
.login-card .form-control { min-height: 44px; border-radius: 10px; }

@media (max-width: 900px) {
    .sidebar { width: 228px; }
    .content-body { padding: 24px; }
    .top-bar { padding: 0 24px; }
    .user-badge { display: none; }
}
@media (max-width: 768px) {
    .app-container { display: block; }
    .sidebar { position: relative; width: 100%; height: auto; min-height: 0; padding: 8px 12px 0; }
    .sidebar-header { padding: 9px 4px 12px; border: none; }
    .sidebar-menu { padding: 0 0 10px; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .sidebar-menu::-webkit-scrollbar { display: none; }
    .sidebar-item { flex: 0 0 auto; }
    .sidebar-item a, .sidebar-dropdown-group > a.sidebar-dropdown-trigger { min-height: 36px; padding: 8px 11px; font-size: 11px; }
    .sidebar-submenu, .sidebar-footer { display: none !important; }
    .top-bar { position: relative; height: 64px; padding: 0 18px; }
    .top-bar-title { font-size: 16px; }
    .top-bar-title::after { display: none; }
    .user-profile-trigger span, .user-profile-trigger .fa-angle-down, .btn-logout { display: none; }
    .user-profile-trigger { padding: 3px; border: 0; background: transparent; }
    .content-body { padding: 18px 14px 30px; }
    .panel-card { padding: 16px; }
    .grid-2, .grid-3 { gap: 16px; }
    .login-card { width: calc(100% - 32px); padding: 28px 22px; }
}

/* Referral relationship map */
.referral-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 2px 0 22px;
}
.referral-eyebrow { color: var(--primary-orange); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.referral-eyebrow i { margin-right: 5px; }
.referral-hero h2 { margin: 5px 0 4px; font-size: 22px; letter-spacing: -.045em; color: var(--header-dark); }
.referral-hero p, .referral-table-caption { color: var(--text-muted); font-size: 12px; }
.referral-search { display: flex; align-items: center; gap: 9px; width: min(100%, 320px); padding: 0 12px; background: #fff; border: 1px solid var(--border-light); border-radius: 10px; color: #94a3b8; }
.referral-search:focus-within { border-color: var(--primary-orange); box-shadow: 0 0 0 3px rgba(255, 107, 53, .12); }
.referral-search input { width: 100%; height: 40px; border: 0; outline: 0; color: var(--text-main); font: inherit; font-size: 12px; background: transparent; }
.referral-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.referral-stat { position: relative; overflow: hidden; padding: 16px 17px; background: #fff; border: 1px solid var(--border-light); border-radius: 13px; box-shadow: var(--card-shadow); }
.referral-stat::after { content: ''; position: absolute; right: -14px; bottom: -22px; width: 62px; height: 62px; border-radius: 50%; background: rgba(255, 107, 53, .07); }
.referral-stat span { display: block; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.referral-stat strong { display: block; margin-top: 4px; color: var(--header-dark); font-size: 24px; line-height: 1.1; letter-spacing: -.05em; }
.referral-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 16px; }
.referral-chain-card { overflow: hidden; background: #fff; border: 1px solid var(--border-light); border-radius: 15px; box-shadow: var(--card-shadow); }
.referral-chain-header { display: flex; align-items: center; gap: 10px; padding: 15px 17px; border-bottom: 1px solid #edf0f4; }
.referral-customer-avatar { display: grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #fff; background: var(--primary-gradient); font-size: 13px; font-weight: 800; }
.referral-chain-label { display: block; color: var(--text-muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.referral-chain-header h3 { margin-top: 1px; color: var(--header-dark); font-size: 14px; letter-spacing: -.025em; }
.referral-handoff-count { margin-left: auto; padding: 4px 8px; border-radius: 99px; color: #8d431f; background: #fff2ec; font-size: 10px; font-weight: 800; white-space: nowrap; }
.referral-flow { padding: 6px 17px 12px; }
.referral-flow-step { position: relative; display: grid; grid-template-columns: minmax(75px, 1fr) 86px minmax(75px, 1fr); align-items: center; gap: 7px; padding: 13px 0; }
.referral-flow-step + .referral-flow-step { border-top: 1px solid #edf0f4; }
.referral-person { min-width: 0; display: flex; align-items: center; gap: 6px; color: #3b485d; font-size: 11px; font-weight: 700; }
.referral-person i { display: grid; width: 23px; height: 23px; place-items: center; flex: 0 0 auto; border-radius: 7px; color: #557097; background: #eff4fb; font-size: 10px; }
.referral-person-to { justify-content: flex-end; text-align: right; }
.referral-person-to i { color: #148164; background: #eafaf4; order: 2; }
.referral-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.referral-connector { display: grid; justify-items: center; gap: 2px; }
.referral-date { color: #8a95a7; font-size: 9px; font-weight: 700; white-space: nowrap; }
.referral-line { display: flex; align-items: center; justify-content: center; width: 100%; color: var(--primary-orange); font-size: 10px; }
.referral-line::before { content: ''; width: 27px; height: 1px; margin-right: 4px; background: #f7b49d; }
.referral-mode { display: inline-flex; align-items: center; width: max-content; max-width: 100%; padding: 3px 6px; border-radius: 5px; color: #87543f; background: #fff4ef; font-size: 9px; font-weight: 800; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.referral-mode.mode-same-day { color: #27715f; background: #eaf9f3; }
.referral-mode.mode-scheduled { color: #6250a6; background: #f1efff; }
.referral-reason { grid-column: 1 / -1; margin-top: 0; color: #738096; font-size: 10px; line-height: 1.4; }
.referral-reason i { margin-right: 4px; color: #a4aebc; }
.referral-empty-state { grid-column: 1 / -1; display: flex; min-height: 220px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #d6dde8; border-radius: 15px; color: var(--text-muted); text-align: center; }
.referral-empty-state > i { color: var(--primary-orange); font-size: 24px; }
.referral-empty-state strong { color: var(--header-dark); font-size: 13px; }
.referral-empty-state span { font-size: 11px; }
.referral-audit-table { margin-top: 20px; }
.referral-audit-table .panel-header { align-items: flex-start; }
.referral-table-caption { margin-top: 3px; }

@media (max-width: 900px) { .referral-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .referral-hero { align-items: stretch; flex-direction: column; }
    .referral-search { width: 100%; }
    .referral-map { grid-template-columns: 1fr; }
    .referral-flow-step { grid-template-columns: minmax(74px, 1fr) 75px minmax(74px, 1fr); }
}

/* Push & In-App Notification Bell & Menu Styles */
.btn-notification-bell {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--header-dark);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-notification-bell:hover {
    background: #f8fafc;
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: scale(1.05);
}
.notification-badge-pulse {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    text-align: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(239, 68, 68, 0.4);
    animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.notification-dropdown-menu {
    position: absolute;
    top: 48px;
    right: 0;
    width: 340px;
    max-height: 440px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDownFade 0.2s ease-out;
}
@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.notification-dropdown-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--header-dark);
}
.btn-mark-all-read {
    background: none;
    border: none;
    color: var(--primary-orange);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.btn-mark-all-read:hover {
    text-decoration: underline;
}
.notification-dropdown-list {
    overflow-y: auto;
    max-height: 380px;
    display: flex;
    flex-direction: column;
}
.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
    align-items: flex-start;
}
.notification-item:hover {
    background: #f8fafc;
}
.notification-item.unread {
    background: #fff8f5;
    border-left: 3px solid var(--primary-orange);
}
.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.notification-item.unread .notification-icon {
    background: #ffedd5;
    color: var(--primary-orange);
}
.notification-content {
    flex: 1;
    min-width: 0;
}
.notification-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--header-dark);
    margin-bottom: 2px;
}
.notification-body {
    font-size: 11px;
    color: #475569;
    line-height: 1.4;
    word-break: break-word;
}
.notification-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
}
.notification-empty {
    padding: 35px 20px;
    text-align: center;
    color: #94a3b8;
}
.notification-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}
.notification-empty p {
    margin: 0;
    font-size: 12px;
}

/* ==========================================================================
   Perfex CRM Style Action Bar & Dropdowns (Invoice & Contract)
   ========================================================================== */
.perfex-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.perfex-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1;
}

.perfex-status-badge.status-unpaid {
    color: #dc2626;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.perfex-status-badge.status-partially-paid {
    color: #d97706;
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.perfex-status-badge.status-paid {
    color: #16a34a;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.perfex-status-badge.status-draft {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.perfex-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.perfex-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.perfex-icon-btn:hover:not(:disabled) {
    background: #f8fafc;
    color: var(--dark);
    border-color: #cbd5e1;
}

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

.perfex-dropdown-container {
    position: relative;
    display: inline-block;
}

.perfex-btn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.perfex-btn-more:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.perfex-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    min-width: 230px;
    z-index: 200;
    padding: 6px 0;
}

.perfex-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    font-size: 12.5px;
    color: #334155;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
}

.perfex-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.perfex-dropdown-item:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
}

.perfex-dropdown-item:hover:not(:disabled) i {
    color: var(--primary-orange);
}

.perfex-dropdown-item.danger {
    color: #ef4444;
}

.perfex-dropdown-item.danger i {
    color: #ef4444;
}

.perfex-dropdown-item.danger:hover:not(:disabled) {
    background: #fef2f2;
    color: #dc2626;
}

.perfex-dropdown-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.perfex-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 5px 0;
}

.perfex-btn-payment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(22, 163, 74, 0.25);
    transition: all 0.2s;
    letter-spacing: 0.4px;
}

.perfex-btn-payment:hover:not(:disabled) {
    background: #15803d;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
}

.perfex-btn-payment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pipeline-contract-quill-wrapper .ql-container {
    min-height: 380px;
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13.5px;
    line-height: 1.7;
    background: #ffffff;
}

#pipeline-contract-quill-wrapper .ql-toolbar {
    background: #f8fafc;
    border-color: #cbd5e1;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#pipeline-contract-quill-wrapper .ql-editor {
    min-height: 350px;
    max-height: 650px;
    overflow-y: auto;
}



