/* Feng Shui CRM V8.7 - Core Styles */
:root {
    --primary: #8B0000;
    --primary-dark: #5C0A0A;
    --secondary: #A0522D;
    --white: #FFFFFF;
    --gray-50: #FDF5E6;
    --gray-100: #FAEBD7;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-800: #4A2C1A;
    --success: #10B981;
    --error: #EF4444;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
}

/* App Shell */
.top-bar {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand i {
    color: var(--primary);
    font-size: 24px;
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    margin-left: 32px;
    flex-grow: 1;
    overflow-x: auto;
}

.nav-links li {
    font-size: 14px;
    color: var(--gray-500);
    cursor: pointer;
    white-space: nowrap;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}

.nav-links li:hover,
.nav-links li.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
}

/* Layout */
.main-layout {
    display: flex;
    height: calc(100vh - 64px);
}

.sidebar {
    width: 64px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.search-trigger {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    transition: 0.2s;
}

.search-trigger:hover {
    background: var(--primary);
    color: var(--white);
}

.content-viewport {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: 0.2s;
}

.btn-icon:hover {
    color: var(--primary);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn.primary {
    background: var(--primary);
    color: var(--white);
}

.btn.primary:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: var(--gray-100);
    color: var(--gray-800);
    border-color: var(--gray-200);
}

.btn.secondary:hover {
    background: var(--gray-200);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none !important;
    background: rgba(0,0,0,0.5) !important;	
    
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-overlay.active {
    display: flex !important;
}
.modal-box {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.modal-content {
    padding: 16px;
}
.modal-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


.modal-box.fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

.modal-content {
    margin-bottom: 16px;
}


.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}


/* Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease;
    font-size: 14px;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--error);
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Phase 1: Calendar Styles */
.calendar-view-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-header-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.calendar-title-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calendar-title-nav h2 {
    font-size: 20px;
    font-weight: 700;
    min-width: 140px;
}

.nav-arrows {
    display: flex;
    gap: 8px;
}

.btn-nav {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
}

.calendar-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.view-toggles {
    display: flex;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 8px;
}

.btn-toggle {
    padding: 6px 16px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 6px;
}

.btn-toggle.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-monthly-wrapper {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.day-header {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
}

.calendar-grid-main {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(120px, auto);
}

.calendar-cell {
    border-right: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    padding: 8px;
}

.calendar-cell:nth-child(7n) {
    border-right: none;
}

.date-num {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.date-num.other-month {
    color: var(--gray-300);
}

.calendar-cell.today {
    background-color: #f0f9ff;
}

.grid-activities {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-act-item {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-act-item.cps {
    background: #dcfce7;
    color: #166534;
}

.grid-act-item.ftf {
    background: #dbeafe;
    color: #1e40af;
}

.grid-act-item.fsa {
    background: #fed7aa;
    color: #9a3412;
}

.grid-act-item.event {
    background: #fee2e2;
    color: #b91c1c;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.green {
    background: #10b981;
}

.dot.blue {
    background: #3b82f6;
}

.dot.orange {
    background: #f97316;
}

.dot.red {
    background: #ef4444;
}

/* Phase 2: Activity Modal Styles */
.activity-modal-form {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.form-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.form-group.half {
    flex: 1;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.required {
    color: var(--error);
    margin-left: 4px;
}

.help-text {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
    font-style: italic;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-switch input {
    width: 40px;
    height: 20px;
}

.co-agent-search {
    display: flex;
    gap: 8px;
}

.co-agent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-height: 40px;
}

.co-agent-tag {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.co-agent-tag select {
    border: none;
    background: transparent;
    font-size: 11px;
    margin-left: 4px;
}

.co-agent-tag .remove {
    color: var(--gray-500);
    cursor: pointer;
}

.co-agent-tag .remove:hover {
    color: var(--error);
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-label {
    margin-right: 16px;
    display: inline-flex;
}

.search-with-results {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-md);
}

.search-result-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-item:last-child {
    border-bottom: none;
}

.selected-entity-info {
    margin: 12px 0;
}

.selected-entity-badge {
    background: var(--gray-100);
    border-left: 3px solid var(--primary);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.selected-entity-badge button {
    margin-left: 12px;
}

/* Quick Add Button */
.quick-add-container {
    display: flex;
    justify-content: center;
    padding: 20px 0 40px;
}

.btn-quick-add {
    background: var(--primary);
    color: var(--white);
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-quick-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

/* Phase 3: Prospect Management Styles */
.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--gray-100);
    padding: 6px;
    border-radius: 10px;
    width: fit-content;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover:not(.active) {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Profile Redesign Styles */
.profile-view,
.customer-profile-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 60px;
}

.profile-section {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-section h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-50);
    padding-bottom: 12px;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.btn-section-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-section-edit:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.scroll-container {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 12px;
}

.prospects-view {
    padding: 20px;
}

.prospects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.prospects-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.prospects-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.search-group {
    flex: 2;
    min-width: 250px;
    position: relative;
}

.search-group i {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--gray-400);
}

.search-group input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    min-width: 140px;
}

.prospects-table-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: auto;
}

.prospects-table {
    width: 100%;
    border-collapse: collapse;
}

.prospects-table th {
    background: var(--gray-50);
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.prospects-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    cursor: pointer;
}

/* Phase 7: Referrals Module Styles */
.referrals-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
}

.referrals-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
}

.leaderboard-card,
.tree-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
}

.leaderboard-controls {
    padding: 12px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: var(--gray-50);
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-right: 12px;
}

.rank-1 .rank-badge {
    background: #FDE68A;
    color: #92400E;
}

.rank-2 .rank-badge {
    background: #E5E7EB;
    color: #4B5563;
}

.rank-3 .rank-badge {
    background: #FFEDD5;
    color: #9A3412;
}

.referrer-info {
    flex-grow: 1;
}

.referrer-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.referrer-name:hover {
    text-decoration: underline;
}

.referrer-stats {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}

.hide-btn {
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--gray-400);
    cursor: pointer;
}

.leaderboard-item:hover .hide-btn {
    opacity: 1;
}

.hide-btn:hover {
    color: var(--error);
}

.tree-container {
    flex-grow: 1;
    position: relative;
    background: #fcfcfc;
    overflow: hidden;
}

.tree-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.control-btn {
    width: 36px;
    height: 36px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: 0.2s;
}

.control-btn:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.tree-search-bar {
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

/* D3 Tree Custom Styles */
.node circle {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 2px;
    cursor: pointer;
}

.node text {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

.link {
    fill: none;
    stroke: #ccc;
    stroke-width: 1.5px;
}

.edge-label {
    font-size: 10px;
    fill: var(--gray-500);
}

.origin-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-cps {
    background: #DCFCE7;
    color: #166534;
}

.badge-event {
    background: #FEF9C3;
    color: #854D0E;
}

.badge-manual {
    background: #E0F2FE;
    color: #075985;
}

.tree-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.tree-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
}

.prospects-table tr:hover {
    background: var(--gray-50);
}

.score-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.score-A-plus {
    background: #0b4f2e;
    color: white;
}

.score-A {
    background: #10b981;
    color: white;
}

.score-B {
    background: #f59e0b;
    color: white;
}

.score-C {
    background: #f97316;
    color: white;
}

.score-D {
    background: #ef4444;
    color: white;
}

.protection-bar {
    width: 100px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.protection-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
}

.protection-fill.warning {
    background: var(--secondary);
}

.protection-fill.critical {
    background: var(--error);
}

/* Profile View - No Tabs */
.profile-view {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.profile-info h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-meta .badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: #d1fae5;
    color: #0b4f2e;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.info {
    background: #dbeafe;
    color: #1e40af;
}

.profile-actions {
    display: flex;
    gap: 12px;
}

.profile-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.profile-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-section h2 .section-actions {
    display: flex;
    gap: 8px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-section {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    font-size: 14px;
    align-items: flex-start;
}

.info-label {
    width: 130px;
    color: var(--gray-500);
    font-weight: 500;
}

.info-value {
    flex: 1;
    font-weight: 400;
}

/* Proposed Solutions Table */
.solutions-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
}

.solutions-table th {
    background: var(--gray-100);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.solutions-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    align-items: center;
}

.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag.blue {
    background: #3b82f6;
}

.tag.purple {
    background: #8b5cf6;
}

.tag.green {
    background: #10b981;
}

.tag.orange {
    background: #f59e0b;
}

.tag.teal {
    background: #14b8a6;
}

.tag.gray {
    background: #6b7280;
}

.tag .remove {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.tag .remove:hover {
    color: var(--white);
}

/* Name List Table */
.name-list-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
}

.name-list-table th {
    background: var(--gray-100);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.name-list-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* History Timeline */
.history-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 12px;
}

.history-date {
    min-width: 100px;
    color: var(--gray-500);
    font-weight: 600;
}

.history-content {
    flex: 1;
}

.history-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Notes */
.notes-item {
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 12px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--gray-500);
}

.add-note-section {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Protection Section */
.protection-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
    border-left: 4px solid var(--success);
}

.protection-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.protection-progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.protection-progress .fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        gap: 16px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .protection-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* Phase 5: Agent Management Styles */
.agents-view {
    padding: 20px;
}

.agents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.agents-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.agents-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

.agent-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.agents-table-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: auto;
}

.agents-table {
    width: 100%;
    border-collapse: collapse;
}

.agents-table th {
    background: var(--gray-50);
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.agents-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    cursor: pointer;
}

.agents-table tr:hover {
    background: var(--gray-50);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #d1fae5;
    color: #0b4f2e;
}

.status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.status-probation {
    background: #fef3c7;
    color: #92400e;
}

.status-expired {
    background: #e5e7eb;
    color: #4b5563;
}

.followup-rate {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.rate-good {
    background: #10b981;
}

.rate-warning {
    background: #f59e0b;
}

.rate-critical {
    background: #ef4444;
}

/* Agent Profile */
.agent-profile-view {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.conversion-banner {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.license-dashboard {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.license-dashboard h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 16px;
}

.license-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.license-stat {
    display: flex;
    flex-direction: column;
}

.license-stat-label {
    font-size: 12px;
    color: #0369a1;
    opacity: 0.7;
}

.license-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #0369a1;
}

.license-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.performance-card {
    background: var(--gray-50);
    padding: 20px;
    border-radius: 8px;
}

.performance-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.performance-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.stat-label {
    color: var(--gray-500);
}

.stat-value {
    font-weight: 600;
}

.target-progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.target-progress .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.inactive-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.inactive-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--white);
    border-radius: 6px;
}

.inactive-item.critical {
    border-left: 3px solid var(--error);
}

.inactive-item.warning {
    border-left: 3px solid var(--secondary);
}

.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assignment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--white);
    border-radius: 6px;
}

.assignment-prospect {
    font-weight: 600;
}

.assignment-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.status-warm {
    background: #fef3c7;
    color: #92400e;
}

.status-cold {
    background: #f3f4f6;
    color: #4b5563;
}

.conversion-banner {
    background: #f3e8ff;
    border: 1px solid #d8b4fe;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: #6b21a8;
    font-weight: 500;
}

.conversion-banner i {
    font-size: 20px;
    color: #9333ea;
}

/* Responsive */
@media (max-width: 768px) {
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .license-stats {
        flex-direction: column;
        gap: 12px;
    }
}

/* Phase 6: Pipeline Styles */
.pipeline-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
}

.pipeline-column {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.column-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.column-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.pipeline-list {
    padding: 16px;
    min-height: 400px;
}

.pipeline-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: move;
    transition: all 0.2s;
    border-left-width: 4px;
    border-left-style: solid;
}

.pipeline-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pipeline-card.dragging {
    opacity: 0.5;
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.boost-icon {
    color: #f59e0b;
}

.demote-icon {
    color: #f97316;
}

.card-value {
    font-weight: 600;
    color: var(--success);
}

.card-value.normal {
    color: var(--gray-800);
}

.card-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.card-justification {
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
    margin-bottom: 8px;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.card-actions button {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 14px;
}

.card-actions button:hover {
    color: var(--primary);
}

/* Border colors */
.border-system {
    border-left-color: var(--primary);
}

.border-boosted {
    border-left-color: #f59e0b;
}

.border-demoted {
    border-left-color: #f97316;
}

.border-normal {
    border-left-color: var(--gray-300);
}

/* History Section */
.history-section {
    margin-top: 24px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.type-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.type-boost {
    background: #fef3c7;
    color: #92400e;
}

.type-demote {
    background: #f3f4f6;
    color: #4b5563;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-active {
    background: #d1fae5;
    color: #0b4f2e;
}

.status-expired {
    background: #f3f4f6;
    color: #4b5563;
}

/* Drag and Drop */
.drag-handle {
    cursor: grab;
    color: var(--gray-400);
    margin-right: 8px;
}

.drag-handle:active {
    cursor: grabbing;
}

.drop-indicator {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin: 4px 0;
}

/* Boost Modal */
.boost-justification {
    min-height: 100px;
    resize: vertical;
}

.reason-group {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.expiry-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pipeline-container {
        grid-template-columns: 1fr;
    }
}

/* Day/Week View Styles */
.day-view-container {
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.day-view-hours {
    margin-top: 15px;
}

.day-view-hour {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
    min-height: 60px;
}

.hour-label {
    width: 60px;
    padding: 10px;
    color: var(--gray-500);
    font-size: 12px;
    border-right: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.hour-content {
    flex: 1;
    padding: 5px;
    position: relative;
}

.day-act-item {
    background: #e0f2fe;
    border-left: 3px solid #0ea5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 2px;
}

/* Phase 8: Event Management Styles */
.events-view {
    padding: 20px;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.events-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.events-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

.event-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 8px;
}

.event-tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 6px;
}

.event-tab.active {
    background: var(--primary);
    color: white;
}

.events-table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: auto;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
}

.events-table th {
    background: var(--gray-50);
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.events-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.event-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.event-badge.public {
    background: #dbeafe;
    color: #1e40af;
}

.event-badge.private {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Scoring Configuration */
.scoring-section {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.scoring-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.bonus-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* Registration Modal */
.attendee-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.engagement-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.metric-card {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 8px;
}

.metric-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.report-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.report-card h3 {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.report-card .stat {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.chart-container {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    height: 300px;
}

.reports-dashboard {
    padding: 10px;
}

.chart-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-row>.chart-container {
    flex: 1;
}

.full-width {
    width: 100%;
}

.export-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }

    .scoring-row {
        flex-direction: column;
    }

    .chart-row {
        flex-direction: column;
    }
}


/* Validation Errors */
.form-control.error {
    border-color: var(--error);
    background-color: #fff5f5;
}

.validation-error {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
}

/* Pipeline View Enhancements */
.pipeline-stages {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    min-height: 500px;
}

.pipeline-stage {
    min-width: 250px;
    background: var(--gray-50);
    border-radius: 8px;
    padding: 12px;
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}

.stage-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.stage-count {
    background: var(--gray-200);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.stage-list {
    min-height: 300px;
}

.pipeline-totals {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.total-card {
    flex: 1;
    text-align: center;
}

.total-label {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* Tag Mapping */
.tag-mapping {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--gray-50);
    padding: 12px;
    border-radius: 6px;
}

.tag-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 8px;
}

/* ==================== LOGIN SCREEN ==================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #8B0000 0%, #5C0A0A 100%);
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--secondary);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h2 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 12px;
    color: var(--gray-800);
}

.login-hint {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

/* ==================== BTN-ICON ==================== */
.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-icon.text-error {
    color: var(--error);
}

.btn-icon.text-error:hover {
    background: #fef2f2;
}

/* ==================== STATUS BADGES ==================== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-prospect {
    background: #dbeafe;
    color: #1e40af;
}

.status-converted {
    background: #f0fdf4;
    color: #15803d;
}

.status-inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* ==================== PIPELINE CARD BORDERS & BADGES ==================== */
.border-system {
    border-left: 3px solid #3b82f6;
}

.border-boosted {
    border-left: 3px solid #f59e0b;
}

.border-demoted {
    border-left: 3px solid #ef4444;
}

.border-normal {
    border-left: 3px solid var(--gray-200);
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-yellow {
    background: #fef9c3;
    color: #854d0e;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.boost-icon {
    color: #f59e0b;
}

.demote-icon {
    color: #ef4444;
}

.type-boost {
    background: #fef9c3;
    color: #854d0e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.type-demote {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.status-expired {
    color: var(--gray-500);
}

/* ==================== FORM ERROR ==================== */
.form-error {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.form-control.error {
    border-color: var(--error);
}

/* ==================== CONVERSION / AGENT BANNERS ==================== */
.conversion-banner,
.customer-since-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #166534;
}

.conversion-banner i {
    margin-right: 8px;
}

/* ==================== EVENT ATTENDEES MODAL ==================== */
.event-attendees {
    min-width: 500px;
}

/* ==================== REPORTS DASHBOARD ==================== */
.reports-dashboard {
    min-width: 640px;
}

.reports-grid {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.report-card {
    flex: 1;
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.report-card h3 {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.report-card .stat {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.chart-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    flex: 1;
    min-height: 200px;
    position: relative;
}

.full-width {
    flex: none;
    width: 100%;
}

.export-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==================== BONUS CHECKBOX ==================== */
.bonus-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
}

/* ==================== SCORING SECTION ==================== */
.scoring-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.scoring-section h4 {
    margin-bottom: 12px;
}

/* ==================== WARNING BANNER ==================== */
.warning-banner {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #854d0e;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

@media (max-width: 768px) {
    .activity-cards-grid table td .btn-sm {
        padding: 2px 4px;
        font-size: 10px;
        margin: 2px;
    }

    .button-group {
        gap: 2px;
    }
}

/* ==================== WEEK VIEW STYLES ==================== */
.week-view-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    grid-column: span 7;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.week-day-header {
    padding: 12px;
    text-align: center;
    border-left: 1px solid var(--gray-200);
}

.week-day-header.today {
    background: #f0f9ff;
}

.day-name {
    font-size: 12px;
    color: var(--gray-500);
}

.day-date {
    font-size: 18px;
    font-weight: 700;
}

.week-body {
    display: flex;
    flex-direction: column;
}

.week-hour-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    min-height: 60px;
    border-bottom: 1px solid var(--gray-100);
}

.hour-label {
    padding: 8px;
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
}

.week-hour-cell {
    border-left: 1px solid var(--gray-100);
    padding: 4px;
}

.week-activity {
    font-size: 11px;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-activity.cps {
    background: #dcfce7;
    color: #166534;
}

.week-activity.ftf {
    background: #dbeafe;
    color: #1e40af;
}

.week-activity.fsa {
    background: #fed7aa;
    color: #9a3412;
}

.week-activity.event {
    background: #fee2e2;
    color: #b91c1c;
}

/* ==================== ENHANCED DAY VIEW STYLES ==================== */
.enhanced-day-view {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    grid-column: span 7;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.day-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.day-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.timeline {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.timeline-hour {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
    min-height: 80px;
}

.timeline-hour:last-child {
    border-bottom: none;
}

.timeline-label {
    width: 80px;
    padding: 12px;
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    border-right: 1px solid var(--gray-200);
}

.timeline-slot {
    flex: 1;
    padding: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-activity {
    background: var(--gray-50);
    border-left: 4px solid;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 200px;
    cursor: pointer;
}

.timeline-activity.cps {
    border-left-color: #10b981;
}

.timeline-activity.ftf {
    border-left-color: #3b82f6;
}

.timeline-activity.fsa {
    border-left-color: #f97316;
}

.timeline-activity.event {
    border-left-color: #ef4444;
}

.activity-time {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.activity-title {
    font-size: 13px;
    font-weight: 500;
}

.activity-agent {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ==================== PIPELINE STAGE STYLES ==================== */
.pipeline-stages {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    min-height: 600px;
}

.pipeline-stage {
    min-width: 280px;
    background: var(--gray-50);
    border-radius: 12px;
    padding: 16px;
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid;
}

.stage-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.stage-probability {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 8px;
}

.stage-stats {
    text-align: right;
}

.stage-count {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.stage-value {
    font-size: 12px;
    color: var(--gray-500);
}

.stage-list {
    min-height: 400px;
}

.empty-stage {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
}

.empty-stage i {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-stage p {
    font-size: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 11px;
    color: var(--gray-500);
}

.close-date i {
    margin-right: 4px;
}

.override-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.pipeline-totals {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #8B0000 0%, #5C0A0A 100%);
    border-radius: 12px;
    color: white;
}

.total-card {
    flex: 1;
    text-align: center;
}

.total-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.total-value {
    font-size: 28px;
    font-weight: 700;
}

/* ==================== EVENT REPORT STYLES ==================== */
.event-report-detail {
    min-width: 600px;
    padding: 20px;
}

.event-report-detail h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.event-report-detail>p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.engagement-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.engagement-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.engagement-item span:first-child {
    width: 120px;
    font-size: 13px;
    color: var(--gray-600);
}

.engagement-item span:last-child {
    width: 80px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.bar-container {
    flex: 1;
    height: 24px;
    background: var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    transition: width 0.3s ease;
}

.reminder-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.tag-mapping {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
}

.tag-mapping div {
    margin: 4px 0;
}

.tag-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-right: 8px;
}

/* Phase 9: KPI Dashboard Styles */
.kpi-dashboard {
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

.time-filter-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.time-toggle-group {
    display: flex;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 8px;
}

.time-toggle-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 6px;
}

.time-toggle-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.date-range-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-range-picker input {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--error);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #1e40af;
}

.stat-icon.green {
    background: #d1fae5;
    color: #0b4f2e;
}

.stat-icon.orange {
    background: #fed7aa;
    color: #9a3412;
}

.stat-icon.purple {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Yearly Target Card */
.targets-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 24px;
}

.targets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.targets-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.targets-table {
    width: 100%;
    border-collapse: collapse;
}

.targets-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.targets-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.target-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-bg {
    width: 100px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.progress-green {
    background: var(--success);
}

.progress-yellow {
    background: var(--secondary);
}

.progress-red {
    background: var(--error);
}

/* Q1 Performance Table */
.performance-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.performance-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.performance-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.status-badge-success {
    background: #d1fae5;
    color: #0b4f2e;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.leaderboard-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.rank-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-700);
    text-align: center;
    line-height: 24px;
    font-weight: 600;
    font-size: 12px;
}

.rank-1 {
    background: #fbbf24;
    color: #78350f;
}

.rank-2 {
    background: #94a3b8;
    color: #1e293b;
}

.rank-3 {
    background: #b45309;
    color: #fffbeb;
}

/* Tooltip */
.kpi-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    color: var(--gray-400);
    cursor: help;
}

.kpi-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background: var(--gray-800);
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
}

/* Target Management Form */
.target-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.target-form-group {
    margin-bottom: 12px;
}

.target-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.target-form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

/* Print Styles */
@media print {

    .sidebar,
    .top-bar,
    .time-filter-bar,
    .dashboard-header button {
        display: none !important;
    }

    .main-layout {
        margin: 0 !important;
        padding: 0 !important;
    }

    .kpi-dashboard {
        padding: 0 !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .chart-container {
        page-break-inside: avoid;
    }
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .time-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .target-form {
        grid-template-columns: 1fr;
    }
}

/* Phase 10: Advanced Search Styles */

/* Search Panel */
.search-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.search-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 800px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    padding: 24px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.search-panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.close-btn:hover {
    color: var(--error);
}

/* Presets */
.search-presets {
    margin-bottom: 24px;
}

.search-presets h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    padding: 6px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Entity Selector */
.search-entity-selector {
    margin-bottom: 24px;
}

.search-entity-selector label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.search-entity-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

/* Date Range */
.date-range-filter {
    margin-bottom: 24px;
}

.date-range-filter h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
}

/* Filter Sections */
.filter-sections {
    margin-bottom: 24px;
}

.filter-sections h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
}

/* Condition Builder */
.condition-builder {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.condition-builder h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.condition-group {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.group-header select {
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
}

.condition-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--gray-50);
    border-radius: 6px;
}

.condition-row select,
.condition-row input {
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
}

.condition-field {
    width: 150px;
}

.condition-operator {
    width: 100px;
}

.condition-value {
    flex: 1;
}

.condition-logic-toggle {
    margin-top: 12px;
    text-align: right;
}

/* Search Actions */
.search-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

/* Saved Searches */
.saved-searches,
.search-history {
    margin-bottom: 24px;
}

.saved-searches h3,
.search-history h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.saved-search-item,
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.saved-search-item:hover,
.history-item:hover {
    background: var(--gray-100);
}

.saved-search-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.saved-search-info i {
    color: var(--primary);
    font-size: 14px;
}

.saved-search-info small {
    color: var(--gray-500);
    font-size: 11px;
    margin-left: 8px;
}

/* Search Results */
.search-results {
    margin-top: 24px;
}

.search-results h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.search-results-table {
    width: 100%;
    border-collapse: collapse;
}

.search-results-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.search-results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.search-results-table tr:hover {
    background: var(--gray-50);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
    font-style: italic;
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-controls button {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls span {
    font-size: 13px;
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 768px) {
    .search-panel {
        width: 100%;
    }

    .filter-row {
        flex-direction: column;
    }

    .condition-row {
        flex-wrap: wrap;
    }

    .condition-field,
    .condition-operator {
        width: calc(50% - 4px);
    }

    .condition-value {
        width: 100%;
    }
}

/* Phase 11: Document Management System Styles */

/* Main Layout */
.dms-view {
    padding: 20px;
}

.dms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dms-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.dms-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

.dms-actions {
    display: flex;
    gap: 12px;
}

.dms-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* Folder Sidebar */
.folder-sidebar {
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 16px;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.folder-tree {
    font-size: 14px;
}

.folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.folder-item:hover {
    background: var(--gray-100);
}

.folder-item.active {
    background: #e0f2fe;
    border-left: 3px solid var(--primary);
}

.folder-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.folder-content i.fa-folder {
    font-size: 16px;
}

.folder-name {
    font-size: 13px;
    font-weight: 500;
}

.toggle-children {
    font-size: 11px;
    color: var(--gray-500);
    margin-left: 4px;
}

.folder-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-item:hover .folder-actions {
    opacity: 1;
}

/* File Explorer */
.file-explorer {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.explorer-header {
    margin-bottom: 20px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.breadcrumb-item:hover {
    background: var(--gray-100);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--gray-800);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-item.active:hover {
    background: none;
    text-decoration: none;
}

.breadcrumb-separator {
    color: var(--gray-400);
}

.explorer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-filter-bar i {
    position: relative;
    left: 30px;
    color: var(--gray-400);
    z-index: 1;
}

.search-filter-bar input[type="text"] {
    padding: 8px 8px 8px 36px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
}

.search-filter-bar select {
    width: 150px;
}

.view-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 6px;
    padding: 2px;
}

.view-toggle .btn-icon {
    padding: 6px 10px;
}

.view-toggle .btn-icon.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Batch Actions */
.batch-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #e0f2fe;
    border-radius: 8px;
    margin-top: 12px;
}

.selected-count {
    font-weight: 600;
    color: var(--primary);
    margin-right: 12px;
}

/* File Container */
.file-container {
    flex: 1;
    overflow-y: auto;
}

.empty-folder {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-folder i {
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-folder h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-folder p {
    margin-bottom: 20px;
}

/* File Table */
.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.file-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.file-item {
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:hover {
    background: var(--gray-50);
}

.file-item.selected {
    background: #e0f2fe;
}

.file-icon {
    margin-right: 8px;
    color: var(--primary);
}

.file-name {
    font-weight: 500;
}

.starred {
    color: #fbbf24;
    margin-left: 8px;
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px;
}

.file-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
    position: relative;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.file-card.selected {
    background: #e0f2fe;
    border-color: var(--primary);
}

.file-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.file-card-icon {
    text-align: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.file-card-icon i {
    color: var(--primary);
}

.file-card-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    word-break: break-all;
}

.file-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.file-card-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-card-actions {
    opacity: 1;
}

/* Upload Modal */
.upload-modal {
    min-width: 500px;
}

.upload-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: var(--gray-50);
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-drop-zone.drag-over {
    border-color: var(--primary);
    background: #e0f2fe;
}

.upload-drop-zone i {
    color: var(--gray-400);
    margin-bottom: 16px;
}

.upload-drop-zone h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.upload-drop-zone p {
    margin-bottom: 16px;
}

.upload-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.upload-list ul {
    list-style: none;
    padding: 0;
}

.upload-list li {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.upload-list li i {
    margin-right: 8px;
}

.upload-progress {
    margin: 20px 0;
}

.upload-options {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

/* Version History */
.version-history {
    min-width: 700px;
}

.version-header {
    margin-bottom: 20px;
}

.version-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.version-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.version-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.current-version {
    background: #f0f9ff;
    font-weight: 600;
}

.version-compare {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.compare-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.compare-controls select {
    flex: 1;
}

/* Share Modal */
.share-modal {
    min-width: 500px;
}

.share-form {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.share-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.share-list {
    margin-bottom: 24px;
}

.share-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 8px;
}

.share-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-info i {
    font-size: 24px;
    color: var(--primary);
}

.share-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--gray-200);
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}

.share-link {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.link-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

/* File Metadata */
.file-metadata {
    min-width: 400px;
}

.metadata-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.metadata-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-600);
}

.metadata-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.metadata-row {
    display: flex;
    align-items: flex-start;
}

.metadata-label {
    width: 100px;
    font-size: 13px;
    color: var(--gray-500);
}

.metadata-value {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.metadata-description {
    padding: 12px;
    background: var(--gray-50);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

/* Version Comparison */
.version-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-width: 900px;
}

.comparison-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
}

.comparison-panel h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

/* Loading */
.loading-files {
    text-align: center;
    padding: 60px;
    color: var(--gray-500);
}

.loading-files i {
    margin-right: 8px;
}

/* Dragging */
.file-item.dragging {
    opacity: 0.5;
    background: var(--gray-100);
}

.folder-item.drag-over {
    background: #e0f2fe;
    border: 2px dashed var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .dms-layout {
        flex-direction: column;
    }

    .folder-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .version-comparison {
        grid-template-columns: 1fr;
        min-width: auto;
    }

    .share-row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-filter-bar input[type="text"] {
        width: 100%;
    }

    .file-table {
        font-size: 12px;
    }

    .file-table td:not(:first-child):not(:last-child) {
        display: none;
    }

    .upload-modal {
        min-width: auto;
    }
}

/* ========== PHASE 13: IMPORT SYSTEM STYLES ========== */
.import-view {
    padding: 24px;
}

.import-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.import-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.import-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.import-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.recent-imports {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recent-imports h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.imports-table-container {
    overflow-x: auto;
}

.imports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.imports-table th {
    padding: 10px 12px;
    background: var(--gray-50);
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
}

.imports-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.imports-table tr:hover {
    background: var(--gray-50);
}

.import-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.import-wizard {
    padding: 4px;
}

.wizard-steps {
    display: flex;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.wizard-step {
    flex: 1;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--gray-100);
    color: var(--gray-500);
    border-right: 1px solid var(--gray-200);
}

.wizard-step:last-child {
    border-right: none;
}

.wizard-step.active {
    background: var(--primary);
    color: white;
}

.wizard-step.completed {
    background: #d1fae5;
    color: #065f46;
}

.step-content {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.step-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.upload-area-large {
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    background: white;
}

.upload-area-large:hover {
    border-color: var(--primary);
}

.upload-area-large i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
    display: block;
}

.upload-area-large h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.upload-area-large p {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 4px;
}

.upload-area-large .file-limit {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.file-info-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

.import-type-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.mapping-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mapping-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mapping-table th {
    padding: 10px 12px;
    background: var(--gray-100);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.mapping-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.validation-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.validation-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    border-radius: 10px;
    flex: 1;
    text-align: center;
}

.validation-badge.valid {
    background: #d1fae5;
    color: #065f46;
}

.validation-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-count {
    font-size: 28px;
    font-weight: 800;
}

.badge-label {
    font-size: 12px;
    font-weight: 500;
}

.error-table,
.warning-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 8px;
}

.error-table th,
.warning-table th {
    padding: 8px;
    background: var(--gray-50);
    text-align: left;
    font-weight: 600;
}

.error-table td,
.warning-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.error-row {
    background: #fff5f5;
}

.warning-row {
    background: #fffbeb;
}

.validation-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.duplicate-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    margin-bottom: 12px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    margin-bottom: 16px;
}

.progress-bar-container {
    height: 28px;
    background: var(--gray-200);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    border-radius: 99px;
}

/* ========== PHASE 13: PROTECTION MONITORING ========== */
.protection-view {
    padding: 24px;
}

.protection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.protection-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.protection-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.protection-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.team-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--primary);
}

.summary-card.team-a {
    border-top-color: #3b82f6;
}

.summary-card.team-b {
    border-top-color: #f59e0b;
}

.summary-card.team-c {
    border-top-color: #8b5cf6;
}

.summary-card.total {
    border-top-color: #10b981;
}

.summary-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-700);
}

.summary-card .summary-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-card .summary-stats div {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.summary-card .stat-label {
    color: var(--gray-500);
}

.summary-card .stat-value {
    font-weight: 700;
}

.summary-card .stat-value.warning {
    color: #d97706;
}

.summary-card .stat-value.danger {
    color: #dc2626;
}

.agent-performance {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.agent-performance h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.agent-table-container {
    overflow-x: auto;
}

.agent-performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.agent-performance-table th {
    padding: 10px 12px;
    background: var(--gray-50);
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.agent-performance-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.agent-performance-table tr:hover {
    background: var(--gray-50);
}

.rate-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
}

.rate-good {
    background: #d1fae5;
    color: #065f46;
}

.rate-warning {
    background: #fef3c7;
    color: #92400e;
}

.rate-bad {
    background: #fee2e2;
    color: #991b1b;
}

.inactive-prospects {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.inactive-prospects h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.inactive-table-container {
    overflow-x: auto;
}

.inactive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.inactive-table th {
    padding: 10px 12px;
    background: var(--gray-50);
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
}

.inactive-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.inactive-table tr:hover {
    background: var(--gray-50);
}

.inactive-table td.critical {
    color: #dc2626;
    font-weight: 700;
}

.inactive-table td.warning {
    color: #d97706;
    font-weight: 600;
}

.status-badge.status-critical {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.current-info {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.current-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.distribution-preview {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    font-size: 13px;
}

.distribution-preview ul {
    margin: 8px 0 0 16px;
}

.prospects-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding: 8px;
    background: var(--gray-50);
    border-radius: 8px;
}

/* ==================== PHASE 14: VOICE RECORDER ==================== */

.hamburger-menu {
    display: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-700);
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger-menu:hover {
    background: var(--gray-100);
}

/* Offline Indicator */
#offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--gray-800);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    box-shadow: var(--shadow-md);
}

#offline-indicator i {
    font-size: 14px;
}

/* Mobile Folder Toggle */
.mobile-folder-toggle {
    display: none;
    text-align: center;
    padding: 10px;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 12px;
}

/* Mobile Card Lists */
.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
}

.mobile-card {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-card:active {
    transform: scale(0.98);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mobile-card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--gray-600);
}

.mobile-card-body i {
    width: 20px;
    color: var(--primary);
}

.mobile-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}

/* Mobile Timeline */
.mobile-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.timeline-time {
    min-width: 60px;
    font-weight: 600;
    color: var(--gray-500);
    font-size: 13px;
}

.timeline-content {
    flex: 1;
}

.timeline-type {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-type.cps {
    color: #10b981;
}

.timeline-type.ftf {
    color: #3b82f6;
}

.timeline-type.fsa {
    color: #f59e0b;
}

.timeline-type.event {
    color: #ef4444;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-customer {
    font-size: 12px;
    color: var(--gray-500);
}

/* Voice Recorder Modal */
.voice-recorder {
    text-align: center;
    padding: 8px;
}

.mic-container {
    margin: 20px 0;
}

.mic-container i {
    font-size: 64px;
    color: var(--primary);
    transition: all 0.3s;
}

.mic-container i.recording {
    color: #ef4444;
    animation: pulse14 1s infinite;
}

.mic-container i.processing {
    color: var(--warning, #f59e0b);
    animation: spin14 2s linear infinite;
}

@keyframes pulse14 {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes spin14 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.recorder-timer {
    font-size: 32px;
    font-weight: 700;
    margin: 12px 0;
    color: var(--gray-700);
    font-variant-numeric: tabular-nums;
}

.waveform-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    height: 48px;
    margin: 16px 0;
    overflow: hidden;
}

.waveform-bar {
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: height 0.1s ease;
    min-height: 4px;
}

.transcription-area {
    margin: 16px 0;
    text-align: left;
}

.transcription-area label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.recorder-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.recorder-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn-large {
    padding: 12px 24px !important;
    font-size: 15px !important;
}

/* Voice Settings */
.voice-settings {
    padding: 8px;
}

.voice-settings h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 16px;
    color: var(--primary);
}

.voice-settings h4:first-child {
    margin-top: 0;
}

.voice-settings .radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-settings .radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.voice-settings .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 8px;
}

/* Voice note icon in notes list */
.voice-note-icon {
    color: var(--primary);
    font-size: 11px;
    margin-left: 4px;
}

/* Pull to Refresh */
.pull-to-refresh {
    height: 0;
    overflow: hidden;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: height 0.3s;
}

.pull-to-refresh.show {
    height: 40px;
}

/* Bottom navigation for mobile */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 8px 4px;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s;
    flex: 1;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary);
}

.mobile-nav-item i {
    font-size: 20px;
}

/* Mobile Menu Grid */
.mobile-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 8px;
}

.mobile-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--gray-50);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.2s;
}

.mobile-menu-item i {
    font-size: 24px;
    color: var(--primary);
}

.mobile-menu-item:hover {
    background: var(--gray-100);
}

/* ==================== PHASE 14: MOBILE RESPONSIVE ==================== */

@media (max-width: 768px) {

    /* Hamburger */
    .hamburger-menu {
        display: block;
        margin-left: auto;
    }

    .brand-name {
        display: none;
    }

    /* Navigation dropdown */
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-md);
        z-index: 1000;
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li {
        padding: 12px 8px;
        border-bottom: 1px solid var(--gray-100);
        border-radius: 0;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    /* Sidebar hidden on mobile */
    .sidebar {
        display: none;
    }

    .main-layout {
        margin-left: 0 !important;
    }

    /* Content */
    .content-viewport {
        padding: 12px !important;
        padding-bottom: 80px !important;
    }

    /* Calendar */
    .calendar-header-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }

    .calendar-title-nav {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
    }

    .calendar-grid-main {
        grid-auto-rows: minmax(56px, auto);
    }

    .grid-act-item {
        font-size: 8px;
        padding: 1px 2px;
    }

    /* Activity cards */
    .activity-cards-grid {
        grid-template-columns: 1fr !important;
    }

    /* Birthday */
    .birthday-columns {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Tables – horizontal scroll */
    .prospects-table-container,
    .customers-table-container,
    .agents-table-container,
    .imports-table-container,
    .events-table-container {
        overflow-x: auto;
    }

    .prospects-table,
    .customers-table,
    .agents-table,
    .imports-table,
    .events-table {
        min-width: 700px;
    }

    /* Profile views */
    .profile-header {
        flex-direction: column;
        gap: 16px;
    }

    .profile-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .profile-grid {
        grid-template-columns: 1fr !important;
    }

    .profile-content-grid {
        grid-template-columns: 1fr !important;
    }

    .profile-sidebar {
        display: none;
    }

    /* DMS */
    .dms-layout {
        grid-template-columns: 1fr !important;
    }

    .folder-sidebar {
        display: none !important;
    }

    .mobile-folder-toggle {
        display: block;
    }

    /* Marketing */
    .templates-layout {
        grid-template-columns: 1fr !important;
    }

    .analytics-stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Import wizard */
    .import-wizard {
        min-width: auto;
    }

    .wizard-steps {
        flex-wrap: wrap;
    }

    .wizard-step {
        flex: auto;
        min-width: 70px;
        margin-bottom: 4px;
    }

    /* Reports */
    .chart-row {
        flex-direction: column;
    }

    .reports-grid {
        grid-template-columns: 1fr !important;
    }

    .performance-grid {
        grid-template-columns: 1fr !important;
    }

    .team-summary-cards {
        grid-template-columns: 1fr !important;
    }

    /* Voice recorder on mobile */
    .recorder-controls {
        flex-direction: column;
        align-items: center;
    }

    .recorder-actions {
        flex-direction: column;
        align-items: stretch;
    }

    /* Touch-friendly tap targets */
    .btn,
    .btn-sm {
        min-height: 44px;
    }

    .btn-icon {
        min-height: 40px;
        min-width: 40px;
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
        /* Prevent iOS auto-zoom */
    }

    /* Bottom nav */
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
    }

    /* Pipeline */
    .pipeline-layout {
        grid-template-columns: 1fr !important;
    }

    /* KPI */
    .kpi-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Agent cards row */
    .agents-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .profile-content-grid {
        grid-template-columns: 1fr 250px !important;
    }

    .analytics-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .team-summary-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .kpi-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Phase 15: Integration Styles */
.integration-hub {
    padding: 20px;
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.integration-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.integration-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.integration-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
    display: flex;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.integration-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.integration-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.integration-icon.calendar {
    background: #dbeafe;
    color: #1e40af;
}

.integration-icon.messaging {
    background: #d1fae5;
    color: #0b4f2e;
}

.integration-icon.accounting {
    background: #fef3c7;
    color: #92400e;
}

.integration-icon.storage {
    background: #f3e8ff;
    color: #6b21a8;
}

.integration-info {
    flex: 1;
}

.integration-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.integration-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.integration-status {
    font-size: 12px;
    font-weight: 600;
}

.integration-status.status-connected {
    color: var(--success);
}

.integration-status.status-disconnected {
    color: var(--gray-500);
}

.integration-status.status-expired {
    color: var(--warning);
}

.integration-action {
    display: flex;
    align-items: center;
}

/* Integration Detail */
.integration-detail {
    padding: 20px;
}

.detail-header {
    margin-bottom: 24px;
}

.detail-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 16px;
}

.connection-status {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.connection-status.connected {
    border-left: 4px solid var(--success);
}

.connection-status.disconnected {
    border-left: 4px solid var(--gray-300);
}

.status-indicator {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.status-indicator.connected {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.disconnected {
    background: var(--gray-300);
}

.status-text {
    flex: 1;
}

.status-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-text p {
    color: var(--gray-500);
    font-size: 14px;
}

/* Sync Settings */
.sync-settings {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.sync-settings h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary);
}

.settings-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ==================== PHASE 17: AI ANALYTICS ==================== */

/* AI Dashboard */
.ai-dashboard,
.lead-scoring-dashboard,
.forecast-dashboard,
.churn-dashboard,
.performance-dashboard {
    padding: 20px;
    background: var(--gray-50);
    min-height: calc(100vh - 120px);
}

.dashboard-header,
.scoring-header,
.forecast-header,
.churn-header,
.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--gray-200);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.stat-icon.green {
    background: #f0fdf4;
    color: #10b981;
}

.stat-icon.red {
    background: #fef2f2;
    color: #ef4444;
}

.stat-icon.yellow {
    background: #fefce8;
    color: #eab308;
}

.stat-content h4 {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
}

.stat-trend.positive {
    color: #10b981;
}

.stat-trend.negative {
    color: #ef4444;
}

/* Chart Containers */
.chart-container {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.chart-container h3,
.recent-predictions h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.ai-timeline-chart {
    height: 300px;
    margin-bottom: 16px;
}

.timeline-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    padding-bottom: 30px;
    position: relative;
}

.timeline-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 6%;
}

.bar-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 250px;
}

.bar {
    width: 30%;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.bar.actual {
    background: var(--gray-300);
}

.bar.predicted {
    background: var(--primary);
}

.bar.target {
    background: #3b82f6;
    width: 4px;
    border-radius: 2px;
}

.bar-label {
    position: absolute;
    bottom: 0;
    font-size: 12px;
    color: var(--gray-500);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.color-dot.actual {
    background: var(--gray-300);
}

.color-dot.predicted {
    background: var(--primary);
}

.color-dot.target {
    background: #3b82f6;
}

.color-dot.confidence {
    background: rgba(13, 148, 136, 0.2);
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.insight-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.insight-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.insight-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.insight-card p {
    color: var(--gray-500);
    margin-bottom: 12px;
    font-size: 14px;
}

.trend {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.trend.up {
    background: #d1fae5;
    color: #065f46;
}

.trend.down {
    background: #fee2e2;
    color: #991b1b;
}

.trend.warning {
    background: #fef3c7;
    color: #92400e;
}

/* Predictions Table */
.recent-predictions {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.predictions-table {
    width: 100%;
    border-collapse: collapse;
}

.predictions-table th,
.predictions-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.predictions-table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 13px;
    text-transform: uppercase;
}

.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.score-badge.high {
    background: #d1fae5;
    color: #065f46;
}

.score-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.score-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

.confidence {
    font-weight: 600;
}

.confidence.high {
    color: #10b981;
}

.confidence.medium {
    color: #f59e0b;
}

.confidence.low {
    color: #ef4444;
}

/* Lead Scoring Dashboard */
.factors-card,
.top-leads-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.factors-table {
    width: 100%;
    border-collapse: collapse;
}

.factors-table th,
.factors-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.total-row td {
    border-top: 2px solid var(--gray-200);
    font-size: 16px;
    padding-top: 16px;
}

.score-large {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.prediction-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.prediction-badge.high {
    background: #10b981;
    color: white;
}

.prediction-badge.warm {
    background: #f59e0b;
    color: white;
}

.prediction-badge.cold {
    background: #6b7280;
    color: white;
}

.model-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-right: 12px;
}

/* Sales Forecast Dashboard */
.forecast-controls {
    display: flex;
    gap: 12px;
}

.forecast-accuracy {
    background: var(--white);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.accuracy-meter {
    display: flex;
    align-items: center;
    gap: 16px;
}

.accuracy-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    white-space: nowrap;
}

.accuracy-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
}

.forecast-chart-large {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    height: 250px;
}

.forecast-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.number-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    text-align: center;
    position: relative;
}

.number-card.best {
    border-top: 4px solid #10b981;
}

.number-card.worst {
    border-top: 4px solid #ef4444;
}

.number-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.number-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-800);
}

.number-trend {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
}

.number-trend.negative {
    color: #ef4444;
}

.forecast-breakdown {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.breakdown-table th,
.breakdown-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    text-align: left;
}

.forecast-actions,
.action-buttons,
.performance-actions {
    display: flex;
    gap: 16px;
    margin-top: auto;
}

/* Churn Risk Dashboard */
.overall-risk {
    display: flex;
    align-items: center;
    gap: 16px;
}

.risk-meter {
    font-size: 32px;
    font-weight: 700;
    color: #ef4444;
}

.risk-trend.negative {
    padding: 4px 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.risk-distribution {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.distribution-bars {
    margin-top: 16px;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.distribution-label {
    width: 180px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.distribution-bar-container {
    flex: 1;
    height: 12px;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: hidden;
}

.distribution-bar {
    height: 100%;
    border-radius: 6px;
}

.distribution-bar.high {
    background: #ef4444;
}

.distribution-bar.medium {
    background: #f59e0b;
}

.distribution-bar.low {
    background: #10b981;
}

.distribution-value {
    width: 40px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

.at-risk-customers {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.risk-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.risk-table th,
.risk-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    text-align: left;
}

.risk-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
}

.risk-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

.risk-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.risk-badge.low {
    background: #d1fae5;
    color: #065f46;
}

.risk-factors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.factor-tag {
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-600);
}

.recommended-actions {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.action-list {
    list-style: none;
    margin: 16px 0 24px 0;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid transparent;
}

.action-item input[type="checkbox"] {
    margin-top: 4px;
}

.action-item label {
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
}

.action-item.high {
    background: #fff5f5;
    border-left-color: #fca5a5;
}

.action-item.medium {
    background: #fffbeb;
    border-left-color: #fcd34d;
}

.action-item.low {
    background: #f0fdf4;
    border-left-color: #6ee7b7;
}

.action-item.critical {
    background: #fee2e2;
    border-left-color: #ef4444;
}

/* Performance Dashboard */
.team-performance {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.performance-table th,
.performance-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    text-align: left;
}

.variance {
    font-weight: 700;
}

.variance.positive {
    color: #10b981;
}

.variance.negative {
    color: #ef4444;
}

.agent-insight {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.insight-strength {
    color: #059669;
}

.insight-improvement {
    color: #d97706;
}

.activity-recommendations {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.recommendation-card {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

.recommendation-card i {
    font-size: 24px;
    color: var(--primary);
    margin-top: 4px;
}

.recommendation-content h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-800);
}

.recommendation-content p {
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.recommendation-content small {
    font-size: 11px;
    color: var(--gray-500);
}

/* Modals */
.retrain-models {
    padding: 16px 0;
}

.retrain-models p {
    margin-bottom: 12px;
    color: var(--gray-700);
}

.model-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-list .checkbox-label {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

/* Phase 18: Mobile App & Offline Sync Styles */

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 8px 4px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 4px 8px;
    color: var(--gray-500);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary);
}

.mobile-bottom-nav .nav-item.active i {
    color: var(--primary);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 1px solid #fde68a;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Swipeable Cards */
.swipeable-card {
    position: relative;
    transition: transform 0.3s ease;
    cursor: grab;
    user-select: none;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid transparent;
}

.swipeable-card:active {
    cursor: grabbing;
}

.swipeable-card.swipe-left {
    transform: translateX(-100%);
}

.swipeable-card.swipe-right {
    transform: translateX(100%);
}

/* Pull to Refresh */
.pull-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--gray-500);
    font-size: 14px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .pull-indicator {
        display: flex;
    }
}

.pull-indicator.pulling {
    color: var(--primary);
}

.pull-indicator i {
    font-size: 18px;
}

/* Mobile List */
.mobile-list-container {
    padding: 16px;
}

.mobile-search {
    position: relative;
    margin-bottom: 16px;
}

.mobile-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.mobile-search input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--gray-200);
    border-radius: 24px;
    font-size: 16px;
    background: var(--gray-50);
}

.mobile-sort {
    margin-bottom: 16px;
}

.mobile-sort select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    font-size: 14px;
}

.list-group-header {
    background: var(--gray-100);
    padding: 8px 12px;
    margin: 16px 0 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-600);
    border-radius: 20px;
    display: inline-block;
}

.empty-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-size: 14px;
}

/* Action Sheet */
.action-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.action-sheet.visible {
    visibility: visible;
    opacity: 1;
}

.action-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.action-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.action-sheet.visible .action-sheet-content {
    transform: translateY(0);
}

.action-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.action-sheet-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 8px;
}

.action-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
}

.action-btn i {
    font-size: 20px;
    width: 24px;
    color: var(--gray-600);
}

.action-btn.destructive {
    color: #ef4444;
}

.action-btn.destructive i {
    color: #ef4444;
}

.action-btn:hover {
    background: var(--gray-100);
}

.action-sheet-cancel {
    width: 100%;
    padding: 16px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.bottom-sheet.visible {
    visibility: visible;
    opacity: 1;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bottom-sheet.visible .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 12px auto;
    cursor: grab;
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

/* Biometric Login */
.biometric-login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    transition: all 0.3s;
}

.biometric-login-btn i {
    font-size: 20px;
}

.biometric-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.biometric-login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Settings */
.mobile-settings {
    padding: 20px;
}

.settings-group {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-group h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-info i {
    font-size: 20px;
    color: var(--primary);
    width: 24px;
}

.setting-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
}

.setting-description {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.setting-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: var(--gray-700);
    min-width: 120px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

.app-info {
    text-align: center;
    padding: 20px;
    color: var(--gray-500);
    font-size: 12px;
    border-top: 1px solid var(--gray-200);
}

.app-info p {
    margin: 4px 0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .main-content {
        padding-bottom: 70px;
        /* Space for bottom nav */
    }

    .modal.fullscreen {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }

    .btn {
        padding: 12px 16px;
        font-size: 16px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevent zoom on iOS */
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }
}

/* Phase 19: Security & Compliance Styles */

/* Security Dashboard */
.security-dashboard {
    padding: 24px;
}

.security-score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Audit Log Viewer */
.audit-log-viewer {
    background: white;
    border-radius: 12px;
    padding: 24px;
}

.audit-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-table th {
    text-align: left;
    padding: 12px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.audit-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.log-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.log-level.info {
    background: #dbeafe;
    color: #1e40af;
}

.log-level.warning {
    background: #fef3c7;
    color: #92400e;
}

.log-level.error {
    background: #fee2e2;
    color: #b91c1c;
}

.log-level.critical {
    background: #fecaca;
    color: #991b1b;
}

/* Two-Factor Setup */
.two-factor-setup {
    max-width: 600px;
    padding: 24px;
}

.setup-steps {
    margin: 24px 0;
}

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-content p {
    color: var(--gray-600);
    font-size: 14px;
}

.qr-code {
    background: white;
    padding: 16px;
    border-radius: 12px;
    display: inline-block;
    margin: 16px 0;
    border: 1px solid var(--gray-200);
}

.qr-code img {
    display: block;
    width: 200px;
    height: 200px;
}

.backup-codes {
    margin-top: 24px;
    padding: 20px;
    background: #fef3c7;
    border-radius: 12px;
    border: 1px solid #fde68a;
}

.backup-codes h4 {
    color: #92400e;
    margin-bottom: 8px;
}

.codes-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.backup-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 600;
    padding: 8px;
    background: white;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #fde68a;
}

/* Two-Factor Login */
.two-factor-login {
    padding: 24px;
    min-width: 350px;
}

.two-factor-login h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.two-factor-login p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.two-factor-login input {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-family: monospace;
}

.backup-option {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

/* Consent Management */
.consent-manager {
    padding: 24px;
}

.consent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.consent-item:last-child {
    border-bottom: none;
}

.consent-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.consent-info p {
    color: var(--gray-600);
    font-size: 13px;
}

.consent-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.consent-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.consent-badge.granted {
    background: #dcfce7;
    color: #166534;
}

.consent-badge.revoked {
    background: #fee2e2;
    color: #991b1b;
}

/* Data Retention */
.retention-policies {
    padding: 24px;
}

.policy-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
}

.policy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.policy-name {
    font-size: 16px;
    font-weight: 600;
}

.policy-action {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    background: var(--gray-100);
}

.policy-details {
    display: flex;
    gap: 16px;
    color: var(--gray-600);
    font-size: 13px;
}

/* Security Incidents */
.incident-list {
    padding: 24px;
}

.incident-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.incident-item.critical {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.incident-item.high {
    border-left-color: #f97316;
    background: #fff7ed;
}

.incident-item.medium {
    border-left-color: #eab308;
    background: #fef9c3;
}

.incident-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.incident-content {
    flex: 1;
}

.incident-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.incident-meta {
    display: flex;
    gap: 16px;
    color: var(--gray-600);
    font-size: 12px;
}

.incident-actions {
    display: flex;
    gap: 8px;
}

/* IP Whitelist */
.ip-whitelist {
    padding: 24px;
}

.ip-list {
    margin: 16px 0;
}

.ip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 8px;
}

.ip-address {
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
}

.ip-description {
    color: var(--gray-600);
    font-size: 12px;
}

@media (max-width: 768px) {
    .audit-filters {
        flex-direction: column;
    }

    .codes-list {
        grid-template-columns: 1fr;
    }

    .incident-item {
        flex-wrap: wrap;
    }

    .incident-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Module 2: Calendar Appointment CSS additions */
.calendar-appointment {
    background: white;
    border-left: 3px solid;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.calendar-appointment.cps {
    border-left-color: #10b981;
}

.calendar-appointment.ftf {
    border-left-color: #3b82f6;
}

.calendar-appointment.fsa {
    border-left-color: #f59e0b;
}

.calendar-appointment.event {
    border-left-color: #ef4444;
}

.appointment-time {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-800);
}

.appointment-agent,
.appointment-customer,
.appointment-type {
    margin-left: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-600);
}

.appointment-closed {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #ccc;
    background: #f0fdf4;
    border-radius: 2px;
    padding-left: 4px;
}

.closed-badge {
    color: #059669;
    font-weight: 600;
    margin-bottom: 2px;
}

.closed-product {
    color: var(--gray-800);
    font-size: 11px;
    margin-bottom: 2px;
}

.closed-amount {
    color: #059669;
    font-weight: 600;
}

/* ========== PHASE 20: SYSTEM ADMINISTRATION & DEPLOYMENT ========== */
.admin-dashboard,
.tenant-management,
.system-health,
.backup-manager,
.performance-monitor,
.deployment-center {
    background: #f8fafc;
    min-height: calc(100vh - 64px);
}

.kpi-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.admin-module-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-module-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.admin-module-card:hover h3 {
    color: var(--primary-color);
}

/* Phase 18: Cases Module */
.cases-view {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.case-title {
    display: flex;
    align-items: center;
}

.case-detail-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.case-meta-header {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    color: var(--gray-500);
    font-size: 14px;
}

.case-meta-header span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-section {
    margin-bottom: 24px;
    padding: 24px;
}

.case-section h3 {
    margin-bottom: 16px;
    color: var(--primary);
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 8px;
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.strategy-item h4 {
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
}

.highlight-box {
    background: #f0fdfa;
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 4px;
}

.case-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-400);
    font-size: 12px;
}

/* Modal Specifics */
.case-study-form .modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.case-study-form .tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--gray-500);
    font-weight: 500;
}

.case-study-form .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

.search-category {
    padding: 8px 12px;
    background: var(--gray-50);
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--gray-400);
}
/* ========== ACTIVITY NOTES TABLE (Post-Meetup Notes Inline Editor) ========== */
.activity-notes-table-wrapper {
    overflow-x: auto;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.activity-notes-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.activity-notes-table thead tr {
    background: var(--gray-100, #f5f5f5);
}

.activity-notes-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gray-600, #555);
    border-bottom: 2px solid var(--gray-200, #e0e0e0);
    white-space: nowrap;
}

.activity-notes-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-200, #e0e0e0);
    vertical-align: middle;
}

.activity-notes-table tbody tr:hover {
    background: rgba(139,0,0,0.03);
}

.notes-cell-readonly {
    white-space: nowrap;
    font-weight: 500;
    color: var(--gray-700, #333);
    min-width: 90px;
}

.activity-notes-table .note-input {
    min-width: 140px;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-300, #ccc);
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.activity-notes-table .note-input:focus {
    outline: none;
    border-color: var(--primary, #8B0000);
    box-shadow: 0 0 0 2px rgba(139,0,0,0.1);
}

/* ===== Notes Table: text wrapping & photo thumbnails ===== */
.activity-notes-table td {
    white-space: normal;
    word-wrap: break-word;
    max-width: 200px;
    vertical-align: top;
    padding: 8px;
}

.activity-notes-table input[type="text"].note-input {
    width: 100%;
    box-sizing: border-box;
}

/* Photo upload input in table */
.photo-upload-input {
    display: block;
    font-size: 11px;
    margin-top: 5px;
    max-width: 140px;
}

/* Photo thumbnails grid */
.photo-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.thumbnail {
    max-width: 50px;
    max-height: 50px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--gray-200, #e5e7eb);
    transition: transform 0.15s ease;
}

.thumbnail:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Phase: Case Studies Repository */
.cases-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.case-stories-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.story-table-section {
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.story-table-section .section-title {
    padding: 16px;
    margin: 0;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    font-size: 16px;
    color: var(--gray-800);
}

.story-table-section .section-title.closing {
    color: var(--success);
}

.cases-table {
    width: 100%;
    border-collapse: collapse;
}

.cases-table th {
    padding: 12px;
    text-align: left;
    font-size: 12px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.cases-table td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-50);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
}

/* ===== Activity History Table   Improved Layout ===== */

/* Make all input fields wider and consistent */
.activity-notes-table .note-input {
    min-width: 140px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    transition: border-color 0.2s;
    background: #fff;
}

.activity-notes-table .note-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139,0,0,0.1);
}

/* Table cells: allow text wrapping, add padding */
.activity-notes-table td {
    white-space: normal;
    word-wrap: break-word;
    max-width: 200px;
    vertical-align: top;
    padding: 10px 8px;
    border-bottom: 1px solid var(--gray-100);
}

/* Table headers: keep them readable */
.activity-notes-table th {
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    padding: 12px 8px;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

/* Ensure the table wrapper scrolls horizontally on small screens */
.activity-notes-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    margin-top: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Photo thumbnails   keep them tidy */
.photo-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.thumbnail {
    max-width: 50px;
    max-height: 50px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    transition: transform 0.15s ease;
}

.thumbnail:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}


/* Activity History Table   Multi-line Textareas */
.activity-notes-table textarea.note-input {
    min-height: 60px;          /* give enough height for 2 3 lines */
    resize: vertical;           /* allow user to expand */
    line-height: 1.4;
    font-family: inherit;      /* match body font */
}

.data-table {
    min-width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.data-table td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Co-Agent Status Styles */
.status-pending { color: #f59e0b; font-weight: 600; }
.status-accepted { color: #10b981; font-weight: 600; }
.status-rejected { color: #ef4444; font-weight: 600; }
.btn-sm.success { background: #10b981; color: white !important; border: none; }
.btn-sm.danger { background: #ef4444; color: white !important; border: none; }

/* Co-Agent Search Dropdown */
.co-agent-search-wrapper { position: relative; width: 100%; }
#agent-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--gray-300);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none;
    margin-top: 2px;
}

.btn-icon.text-danger {
    color: #ef4444;
}
.btn-icon.text-danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}
