/* ==========================================
   Family Medical Advocate Command Center
   Main Stylesheet
   ========================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #f59e0b;
    --accent-dark: #d97706;
    
    /* Medical/Healthcare Theme Colors */
    --medical-blue: #0ea5e9;
    --medical-green: #22c55e;
    --medical-red: #ef4444;
    --medical-purple: #a855f7;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Merriweather', serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: background 0.3s, border-color 0.3s;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 var(--spacing-xl);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-section i {
    font-size: 2rem;
    color: var(--primary-color);
    transition: color 0.3s;
}

.logo-section h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
}

.logo-section .subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.btn-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
}

.btn-icon i {
    font-size: 1.25rem;
    color: var(--gray-600);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
}

.user-profile i {
    font-size: 1.5rem;
    color: var(--gray-600);
}

.user-profile span {
    font-weight: 600;
    color: var(--gray-700);
}

/* Container & Layout */
.container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index: 90;
}

.nav-menu {
    list-style: none;
    padding: var(--spacing-md);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

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

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-2xl);
    max-width: 100%;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Section Headers */
.section-header {
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1.875rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-subtitle {
    color: var(--gray-600);
    margin-top: var(--spacing-sm);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-action {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-action {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    width: 100%;
    justify-content: center;
    padding: var(--spacing-md);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.btn-close:hover {
    background: var(--gray-200);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.stat-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: all 0.2s;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: #dbeafe;
    color: var(--primary-color);
}

.stat-icon.orange {
    background: #fed7aa;
    color: var(--accent-color);
}

.stat-icon.green {
    background: #d1fae5;
    color: var(--secondary-color);
}

.stat-icon.purple {
    background: #e9d5ff;
    color: var(--medical-purple);
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.stat-content p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.dashboard-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.125rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-header i {
    color: var(--primary-color);
}

.card-content {
    padding: var(--spacing-lg);
}

.empty-state {
    text-align: center;
    color: var(--gray-500);
    padding: var(--spacing-xl);
    font-style: italic;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    gap: var(--spacing-md);
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-controls {
    display: flex;
    gap: var(--spacing-md);
}

.filter-controls select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: var(--gray-200);
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
}

/* Clients Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.client-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-lg);
    transition: all 0.2s;
    cursor: pointer;
}

.client-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.client-info h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.client-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.client-status.active {
    background: #d1fae5;
    color: #065f46;
}

.client-status.on-hold {
    background: #fed7aa;
    color: #92400e;
}

.client-status.discharged {
    background: #e5e7eb;
    color: #374151;
}

.client-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    color: var(--gray-600);
    font-size: 0.875rem;
}

.client-detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.client-detail-item i {
    width: 18px;
    color: var(--gray-400);
}

/* Detail View Overlay */
.detail-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.detail-view-container {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.detail-view-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-view-tabs {
    display: flex;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-xl);
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}

.tab-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 2px solid transparent;
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.detail-view-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

/* Tabs Container */
.tabs-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
}

.tab-button {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.2s;
}

.tab-button:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    padding: var(--spacing-xl);
}

.tab-content.active {
    display: block;
}

.tab-toolbar {
    margin-bottom: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
}

/* Client Tab Buttons (8-tab system) */
.client-tab-btn {
    padding: 12px 16px;
    border: none;
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.client-tab-btn:hover {
    background: var(--gray-50);
    color: var(--primary-color);
}

.client-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--primary-light);
}

.client-tab-btn i {
    margin-right: 6px;
}

/* Data Tables */
.data-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

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

/* SOPs Grid */
.sops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.sop-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-lg);
    transition: all 0.2s;
    cursor: pointer;
}

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

.sop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.sop-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
}

.sop-title {
    font-size: 1.125rem;
    color: var(--gray-800);
    margin: var(--spacing-sm) 0;
}

.sop-meta {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* Training Grid */
.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.training-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s;
}

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

.training-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.training-content {
    padding: var(--spacing-lg);
}

.training-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.training-title {
    font-size: 1.125rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.training-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.training-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* GPT Tools Grid */
.gpt-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.gpt-tool-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 2px solid var(--gray-200);
    padding: var(--spacing-xl);
    transition: all 0.3s;
}

.gpt-tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.gpt-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
}

.gpt-tool-card h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
}

.gpt-tool-card p {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.gpt-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.feature-tag {
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.feature-tag i {
    color: var(--secondary-color);
}

.gpt-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
}

.gpt-note i {
    color: var(--accent-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.gpt-note p {
    color: var(--gray-700);
}

/* Goals Grid */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.goal-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-lg);
    transition: all 0.2s;
}

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

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.goal-title {
    font-size: 1.125rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.goal-category {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
}

.goal-progress {
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-top: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: var(--secondary-color);
    border-radius: 6px;
    transition: width 0.3s;
}

.goal-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* Settings Container */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.settings-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.2s;
}

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

.settings-card.warning {
    border-color: var(--danger);
    background: #fef2f2;
}

.settings-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: 2rem;
    color: var(--gray-600);
}

.settings-card.warning .settings-icon {
    background: #fee2e2;
    color: var(--danger);
}

.settings-card h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.settings-card p {
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

/* Business Setup */
.business-setup-container {
    display: grid;
    gap: var(--spacing-xl);
}

.setup-checklist,
.business-info-display,
.compliance-resources {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-xl);
}

.setup-checklist h3,
.compliance-resources h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s;
}

.checklist-item:hover {
    background: var(--gray-100);
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.resource-links {
    display: grid;
    gap: var(--spacing-md);
}

.resource-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    color: var(--gray-700);
}

.resource-link:hover {
    border-color: var(--primary-color);
    background: var(--gray-50);
    color: var(--primary-color);
}

/* Financial Summary */
.financial-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.summary-card i {
    font-size: 2.5rem;
}

.summary-card.income i {
    color: var(--secondary-color);
}

.summary-card.expense i {
    color: var(--danger);
}

.summary-card.profit i {
    color: var(--primary-color);
}

.summary-content h3 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.chart-container {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-xl);
    height: 400px;
}

/* Packages Grid */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.package-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
    padding: var(--spacing-xl);
    transition: all 0.3s;
}

.package-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.package-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background: #fed7aa;
    color: #92400e;
}

.status-badge.danger {
    background: #fecaca;
    color: #991b1b;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.loading-spinner p {
    color: var(--gray-600);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    :root {
        --sidebar-width: 0px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--spacing-lg);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .clients-grid,
    .sops-grid,
    .training-grid,
    .goals-grid,
    .settings-container {
        grid-template-columns: 1fr;
    }
}

/* Auth Screen */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-xl);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.auth-logo p {
    color: var(--gray-600);
    font-size: 1rem;
}

.auth-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--gray-200);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-600);
    transition: all 0.2s;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: var(--primary-color);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    animation: fadeIn 0.3s;
}

.auth-note {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: var(--spacing-md);
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
}

/* Profile Dropdown */
.user-profile {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-sm);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    min-width: 200px;
    z-index: 1000;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--gray-700);
    transition: background 0.2s;
    border-bottom: 1px solid var(--gray-100);
}

.profile-dropdown a:last-child {
    border-bottom: none;
}

.profile-dropdown a:hover {
    background: var(--gray-50);
    color: var(--primary-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s;
}

.modal-content.large {
    max-width: 900px;
}

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

.modal-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.modal-body {
    margin-top: var(--spacing-lg);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: bottom 0.3s;
}

.toast.show {
    bottom: var(--spacing-2xl);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--info);
}

/* Task Item Styles */
.task-item {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.task-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.task-content {
    flex: 1;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.task-header h4 {
    margin: 0;
    color: var(--gray-800);
}

.task-badges {
    display: flex;
    gap: var(--spacing-sm);
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-badge.high {
    background: #fecaca;
    color: #991b1b;
}

.priority-badge.medium {
    background: #fed7aa;
    color: #92400e;
}

.priority-badge.low {
    background: var(--gray-200);
    color: var(--gray-700);
}

.date-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
}

.task-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: var(--spacing-sm) 0;
}

.task-client {
    color: var(--gray-500);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.task-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Client Detail View */
.client-detail-view {
    padding: var(--spacing-lg) 0;
}

.detail-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--gray-200);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--gray-800);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.detail-item label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.detail-item p {
    color: var(--gray-800);
}

/* Transaction Item */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-md);
}

.transaction-amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-amount.expense {
    color: var(--danger);
}

.transaction-item .description {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: var(--spacing-xs);
}

/* SOP View */
.sop-view {
    max-width: 900px;
}

.sop-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.sop-content {
    line-height: 1.8;
    color: var(--gray-700);
}

.sop-content h3 {
    color: var(--primary-600);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: var(--spacing-sm);
}

.sop-content h3:first-child {
    margin-top: 0;
}

.sop-content h4 {
    color: var(--gray-800);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    font-size: 1.1rem;
}

.sop-content p {
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.sop-content ul,
.sop-content ol {
    margin-left: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-md);
}

.sop-content ul {
    list-style-type: disc;
}

.sop-content ol {
    list-style-type: decimal;
}

.sop-content li {
    margin-bottom: var(--spacing-sm);
    color: var(--gray-700);
    line-height: 1.7;
}

.sop-content li strong {
    color: var(--gray-900);
    font-weight: 600;
}

.sop-content strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: var(--gray-900);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-container {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

/* Help Center */
.help-center {
    max-width: 900px;
}

.help-sections {
    display: grid;
    gap: var(--spacing-xl);
}

.help-section h3 {
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.help-section ul {
    list-style: none;
    padding: 0;
}

.help-section li {
    padding: var(--spacing-sm) 0;
    color: var(--gray-700);
    line-height: 1.6;
}

.help-section li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

.settings-card.warning {
    border-color: var(--danger);
    background: #fef2f2;
}

/* Business Setup Grid */
.business-setup-grid {
    display: grid;
    gap: var(--spacing-xl);
}

.business-info-card,
.setup-checklist,
.compliance-resources {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-xl);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.info-item label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.info-item p {
    color: var(--gray-800);
}

/* Button Group */
.button-group {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* Card */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s;
}

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

.card h4 {
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: var(--spacing-xs) 0;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--spacing-md);
}

.mb-1 {
    margin-bottom: var(--spacing-md);
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        margin: var(--spacing-lg);
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }
}

/* ==========================================
   COLLAPSIBLE SIDEBAR
   ========================================== */
.sidebar {
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 68px !important;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-label {
    display: none !important;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item i {
    font-size: 1.35rem;
    width: auto;
}

.sidebar.collapsed #sidebarToggle {
    justify-content: center;
    padding: 10px;
}

.main-content.sidebar-collapsed {
    margin-left: 68px !important;
}

/* ---- Sidebar Toggle Button ---- */
#sidebarToggle {
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    width: 100%;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 8px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#sidebarToggle:hover {
    background: var(--primary-dark, #1a56db) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#sidebarToggle .fa-bars {
    font-size: 1.1rem;
}

.sidebar.collapsed #sidebarToggle {
    padding: 10px;
    justify-content: center;
    width: 100%;
}

/* Sidebar background for visibility */
.sidebar {
    background: linear-gradient(180deg, #1e3a5f 0%, #1a3052 100%) !important;
}

.nav-item {
    color: #c8d8ec !important;
}

.nav-item:hover {
    background: rgba(255,255,255,0.12) !important;
    color: white !important;
}

.nav-item.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */
#notificationBell.has-notifications {
    animation: bellRing 1s ease-in-out;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.notif-item:hover {
    background: #e8f0fe !important;
}

/* ==========================================
   REPORTS UI - REDESIGNED SECTION SELECTOR
   ========================================== */
.report-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
}

.report-section-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

.report-section-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-color)11;
    color: var(--primary-color);
}

.report-section-item.selected {
    border-color: var(--primary-color);
    background: var(--primary-color)15;
    color: var(--primary-color);
}

.report-section-item input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.report-section-group {
    margin-bottom: 16px;
}

.report-section-group-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    padding: 0 4px 8px 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 8px;
}

/* ==========================================
   DARK MODE - COMPREHENSIVE CONTRAST FIX
   ========================================== */
body.dark-mode {
    --gray-50: #1a1a2e;
    --gray-100: #1e2a3a;
    --gray-200: #253447;
    --gray-300: #2d3f55;
    --gray-500: #94a3b8;
    --gray-600: #aabbcc;
    --gray-700: #ccd6e8;
    --gray-800: #dde8f4;
    --gray-900: #eef4ff;
    background: #0f172a;
    color: #dde8f4;
}

body.dark-mode .main-header {
    background: linear-gradient(135deg, #1a2a3e, #0f1e30) !important;
    border-color: #253447;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Header icon / logo color in dark mode */
body.dark-mode .logo-section i {
    color: #60a5fa !important;
}

body.dark-mode .logo-section h1,
body.dark-mode .logo-section .subtitle {
    color: #dde8f4 !important;
}

body.dark-mode .btn-icon {
    color: #dde8f4 !important;
}

/* All white/light cards must become dark */
body.dark-mode .card,
body.dark-mode .detail-section,
body.dark-mode .section-card,
body.dark-mode .client-card,
body.dark-mode .task-card,
body.dark-mode .tab-section,
body.dark-mode .delivery-card,
body.dark-mode .appointment-list-item,
body.dark-mode .stat-card,
body.dark-mode .sop-card,
body.dark-mode .training-card,
body.dark-mode .gpt-tool-card,
body.dark-mode .goal-card,
body.dark-mode .lead-card,
body.dark-mode .settings-card,
body.dark-mode .process-card,
body.dark-mode .plan-card,
body.dark-mode .interaction-card,
body.dark-mode .report-card {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #253447 !important;
}

/* Force all text in dark cards to be readable */
body.dark-mode .card *,
body.dark-mode .stat-card *,
body.dark-mode .detail-section *,
body.dark-mode .section-card *,
body.dark-mode .tab-section *,
body.dark-mode .task-card *,
body.dark-mode .delivery-card *,
body.dark-mode .appointment-list-item * {
    color: inherit;
}

/* Financial management specific */
body.dark-mode .budget-summary,
body.dark-mode .financial-card,
body.dark-mode .finance-summary,
body.dark-mode .income-card,
body.dark-mode .expense-card,
body.dark-mode .transaction-row {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #253447 !important;
}

/* Tasks section specific */
body.dark-mode .task-item,
body.dark-mode .activity-item,
body.dark-mode .log-item {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

/* Common inline styles that create white boxes */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"] {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
}

/* gray-50 backgrounds */
body.dark-mode [style*="background: var(--gray-50)"],
body.dark-mode [style*="background:var(--gray-50)"] {
    background: #151f2e !important;
}

body.dark-mode .modal-overlay .modal-content,
body.dark-mode .settings-card {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #253447 !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #253447 !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

body.dark-mode label {
    color: #aabbcc !important;
}

body.dark-mode table {
    color: #dde8f4;
}

body.dark-mode th {
    background: #253447 !important;
    color: #ccd6e8 !important;
}

body.dark-mode td {
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

body.dark-mode tr:hover {
    background: #253447 !important;
}

body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5 {
    color: #eef4ff !important;
}

body.dark-mode p, body.dark-mode span:not(.badge):not(.status-badge) {
    color: #ccd6e8;
}

/* Dashboard stat cards */
body.dark-mode .stat-number {
    color: #60a5fa !important;
}

/* Blurbs / description text */
body.dark-mode .blurb,
body.dark-mode .description,
body.dark-mode .detail-text,
body.dark-mode .info-text {
    color: #aabbcc !important;
}

/* Report section items in dark */
body.dark-mode .report-section-item {
    background: #253447 !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

body.dark-mode .report-section-item:hover,
body.dark-mode .report-section-item.selected {
    border-color: var(--primary-color) !important;
    background: #1a3052 !important;
}

/* ==========================================
   DARK MODE - TARGETED ELEMENT FIXES
   ========================================== */

/* Dashboard stat cards - icon areas and text */
body.dark-mode .stat-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .stat-icon.blue { background: #1e3a5f !important; color: #60a5fa !important; }
body.dark-mode .stat-icon.orange { background: #3d2a10 !important; color: #fbbf24 !important; }
body.dark-mode .stat-icon.green { background: #0d2f1e !important; color: #34d399 !important; }
body.dark-mode .stat-icon.purple { background: #2e1a4a !important; color: #c084fc !important; }
body.dark-mode .stat-content h3 { color: #eef4ff !important; }
body.dark-mode .stat-content p { color: #94a3b8 !important; }

/* Dashboard cards (Activities, Quick Actions) */
body.dark-mode .dashboard-card,
body.dark-mode .dashboard-card .card-header {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .dashboard-card .card-header h3 { color: #eef4ff !important; }

/* Quick Action buttons - dark background so text must be light */
body.dark-mode .btn-action {
    background: #253447 !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .btn-action:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Activity view switcher buttons */
body.dark-mode .view-btn {
    background: #253447 !important;
    color: #aabbcc !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .view-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Client cards in search/list view */
body.dark-mode .client-card,
body.dark-mode .client-card * {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .client-card .status-active { color: #34d399 !important; }
body.dark-mode .client-card .status-inactive { color: #94a3b8 !important; }
body.dark-mode .client-card .status-pending { color: #fbbf24 !important; }

/* Status badges with light backgrounds - force dark text visibility */
body.dark-mode .badge[style*="background: #"],
body.dark-mode .status-badge {
    color: white !important;
}

/* Priority labels / task badges */
body.dark-mode .priority-high { background: #dc2626 !important; color: white !important; }
body.dark-mode .priority-medium { background: #d97706 !important; color: white !important; }
body.dark-mode .priority-low { background: #16a34a !important; color: white !important; }

/* Task priority inline badges */
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background: #fed7aa"],
body.dark-mode [style*="background:#fed7aa"] {
    background: #92400e !important;
    color: #fef3c7 !important;
}
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"] {
    background: #7f1d1d !important;
    color: #fecaca !important;
}
body.dark-mode [style*="background: #dbeafe"],
body.dark-mode [style*="background:#dbeafe"] {
    background: #1e3a5f !important;
    color: #bfdbfe !important;
}
body.dark-mode [style*="background: #d1fae5"],
body.dark-mode [style*="background:#d1fae5"] {
    background: #064e3b !important;
    color: #a7f3d0 !important;
}

/* Preferences module */
body.dark-mode .preference-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .preference-card h4 { color: #60a5fa !important; }
body.dark-mode .preference-grid strong { color: #aabbcc !important; }
body.dark-mode .preference-grid div,
body.dark-mode .preference-grid span { color: #dde8f4 !important; }

/* Client needs kanban */
body.dark-mode .needs-column { background: #151f2e !important; }
body.dark-mode .need-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .need-card h5 { color: #eef4ff !important; }
body.dark-mode .need-card .date-info { color: #94a3b8 !important; }

/* Financial management blurbs */
body.dark-mode .budget-summary-card,
body.dark-mode .finance-stat,
body.dark-mode .finance-total,
body.dark-mode [style*="background: linear-gradient(135deg, #10b981"],
body.dark-mode [style*="background: linear-gradient(135deg, #3b82f6"],
body.dark-mode [style*="background: linear-gradient(135deg, #8b5cf6"] {
    color: white !important;
}
/* Force white text on gradient cards */
body.dark-mode .gradient-card,
body.dark-mode [style*="linear-gradient"] h3,
body.dark-mode [style*="linear-gradient"] p,
body.dark-mode [style*="linear-gradient"] .amount {
    color: white !important;
}

/* Financial totals inline box */
body.dark-mode .income-total,
body.dark-mode .expense-total,
body.dark-mode .net-total {
    background: #1e2a3a !important;
    color: #eef4ff !important;
    border-color: #2d3f55 !important;
}

/* Transaction items */
body.dark-mode .transaction-item,
body.dark-mode .transaction-row,
body.dark-mode .transaction-list > div {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .transaction-item .transaction-name,
body.dark-mode .transaction-item .transaction-note,
body.dark-mode .transaction-item .transaction-date,
body.dark-mode .transaction-row td {
    color: #dde8f4 !important;
}

/* Business setup checklist */
body.dark-mode .setup-checklist,
body.dark-mode .checklist-container,
body.dark-mode .setup-section {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .setup-checklist h3,
body.dark-mode .checklist-title,
body.dark-mode .setup-section-title {
    color: #eef4ff !important;
}

/* Compliance resources hover fix */
body.dark-mode .compliance-item,
body.dark-mode .resource-item {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .compliance-item:hover,
body.dark-mode .resource-item:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Override any inline white backgrounds that create contrast issues */
body.dark-mode .main-content > div,
body.dark-mode #mainContent > div {
    color: #dde8f4;
}

/* Client full-screen tab content area */
body.dark-mode #clientTabContent {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
}

/* Search inputs in dark */
body.dark-mode .search-input,
body.dark-mode #clientSearch {
    background: #253447 !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

/* Form groups labels in dark */
body.dark-mode .form-control,
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #253447 !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

/* Interaction cards */
body.dark-mode .interaction-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}

/* SOP cards */
body.dark-mode .sop-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .sop-card h3,
body.dark-mode .sop-card h4 { color: #eef4ff !important; }
body.dark-mode .sop-card p,
body.dark-mode .sop-card span { color: #aabbcc !important; }

/* Goal cards */
body.dark-mode .goal-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}

/* Advocacy plan cards */
body.dark-mode .plan-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .plan-content { color: #dde8f4 !important; }
body.dark-mode .plan-meta {
    background: #151f2e !important;
    color: #aabbcc !important;
}

/* Process cards */
body.dark-mode .process-card {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

/* Care team cards */
body.dark-mode .care-team-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .care-team-card h5 { color: #eef4ff !important; }
body.dark-mode .care-team-card .contact-info { color: #94a3b8 !important; }

/* Files tab */
body.dark-mode .file-card,
body.dark-mode .file-item {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}

/* Client tab navigation buttons */
body.dark-mode .client-tabs-grid > div {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}

/* Notifications dropdown in dark mode */
body.dark-mode #notificationDropdown {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .notif-item {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .notif-item:hover {
    background: #253447 !important;
}

/* ==========================================
   THEME VARIABLES (for color scheme)
   ========================================== */
body.theme-dark {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
}

body.theme-dark .sidebar {
    background: #16213e;
    border-color: #2d3f55;
}

body.theme-dark .main-header {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
}

body.theme-dark .main-content {
    background: #1a1a2e;
    color: #ccddee;
}

body.theme-dark .card,
body.theme-dark .detail-section,
body.theme-dark .section-card {
    background: #16213e;
    border-color: #2d3f55;
    color: #ccddee;
}

body.theme-dark .nav-item {
    color: #aabbcc;
}

body.theme-dark .nav-item:hover {
    background: #253447;
    color: white;
}

/* ==========================================
   GLOBAL UI POLISH - DEMO READY
   ========================================== */

/* Smooth transitions on interactive elements */
.btn-primary, .btn-secondary, .btn-danger, .btn-sm, .btn-icon {
    transition: all 0.2s ease !important;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

.btn-secondary:hover {
    transform: translateY(-1px);
}

/* Card hover lift effect */
.card:hover, .client-card:hover, .task-card:hover, .sop-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Better focus ring */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
}

/* Calendar day hover */
.calendar-day:hover {
    background: #f0f4ff !important;
    cursor: pointer;
}

body.dark-mode .calendar-day {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
}

body.dark-mode .calendar-day.other-month {
    background: #151f2e !important;
    color: #5a6a7e !important;
}

body.dark-mode .calendar-day.today {
    background: #1a3052 !important;
    border: 2px solid var(--primary-color) !important;
}

body.dark-mode .calendar-grid {
    background: #2d3f55 !important;
}

body.dark-mode .calendar-header {
    background: #1a3052 !important;
}

/* Appointment date badge in dark mode */
body.dark-mode .appointment-date-badge {
    background: var(--primary-color) !important;
}

body.dark-mode .appointment-list-item {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}

/* Delivery cards in dark mode */
body.dark-mode .delivery-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
}

body.dark-mode .delivery-card:hover {
    border-color: var(--primary-color) !important;
}

/* Toast notification polish */
.toast-notification {
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
    font-weight: 500 !important;
}

/* Modal polish */
.modal-content {
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
}

/* Status badges consistent */
.badge {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    letter-spacing: 0.02em;
}

/* Table polish */
th {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section tab headers */
.tab-section > .section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Form group spacing */
.form-group {
    margin-bottom: 16px;
}

/* Delivery log count badge */
.delivery-log-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--success, #10b981);
    color: white;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Sidebar nav section label */
.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    padding: 8px 12px 4px;
    margin-top: 8px;
}

/* Recurrence panel animation */
#recurrencePanel {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Goal progress bar */
.goal-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--gray-200);
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.5s ease;
}

/* Better scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* Print styles */
@media print {
    .sidebar, .main-header, .btn-primary, .btn-secondary, .header-actions { display: none !important; }
    .main-content { margin-left: 0 !important; }
}

/* ==========================================
   CALENDAR MODULE - extracted from JS
   ========================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-300);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
}
.calendar-header {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
}
.calendar-day {
    background: white;
    min-height: 80px;
    padding: 8px;
    position: relative;
}
.calendar-day.other-month {
    background: var(--gray-50);
    color: var(--gray-400);
}
.calendar-day.today {
    background: #e0f2fe;
    border: 2px solid var(--primary-color);
}
.calendar-day-number {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}
.calendar-appointment {
    font-size: 0.75rem;
    padding: 2px 5px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-appointment:hover { opacity: 0.8; }

.appointment-list-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.appointment-list-item:hover { box-shadow: var(--shadow-md); }

.appointment-date-badge {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    min-width: 70px;
}
.appointment-date-badge .day { font-size: 1.5rem; font-weight: 700; }
.appointment-date-badge .month { font-size: 0.85rem; }
.appointment-info { flex: 1; }
.appointment-info h5 { margin: 0 0 5px 0; }
.appointment-reminder {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
    font-size: 0.9rem;
}

/* ==========================================
   DELIVERIES MODULE - extracted from JS
   ========================================== */
.delivery-list { display: grid; gap: 15px; }
.delivery-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}
.delivery-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}
.delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}
.delivery-header h4 { margin: 0; color: var(--gray-800); }
.delivery-type-badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}
.delivery-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.delivery-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

/* ==========================================
   CARE TEAM MODULE - extracted from JS
   ========================================== */
.care-team-category { margin-bottom: 30px; }
.care-team-category h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.care-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.care-team-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}
.care-team-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}
.care-team-card h5 { margin: 0 0 5px 0; color: var(--gray-800); }
.care-team-card .role { color: var(--primary-color); font-weight: 600; margin-bottom: 10px; }
.care-team-card .contact-info { margin: 10px 0; font-size: 0.9rem; color: var(--gray-600); }
.care-team-card .contact-info i { width: 20px; color: var(--primary-color); }
.care-team-actions { display: flex; gap: 10px; margin-top: 15px; }
.care-team-actions button { flex: 1; padding: 8px; font-size: 0.85rem; }

/* ==========================================
   PREFERENCES MODULE - extracted from JS
   ========================================== */
.preference-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.preference-card h4 { color: var(--primary-color); margin-bottom: 15px; }
.preference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}
.preference-grid strong { color: var(--gray-700); display: block; margin-bottom: 5px; }

/* ==========================================
   CLIENT NEEDS MODULE - extracted from JS
   ========================================== */
.needs-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}
.needs-column {
    background: var(--gray-50);
    border-radius: 12px;
    overflow: hidden;
}
.needs-column-header { padding: 15px; color: white; }
.needs-column-header h4 { margin: 0; font-size: 1rem; }
.needs-cards { padding: 15px; min-height: 200px; }
.need-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}
.need-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-color); }
.need-card h5 { margin: 0 0 5px 0; color: var(--gray-800); }
.need-card .category-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; margin-bottom: 8px;
}
.need-card .priority-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; margin-left: 5px;
}
.need-card .date-info { font-size: 0.85rem; color: var(--gray-600); margin-top: 10px; }
.need-actions { display: flex; gap: 5px; margin-top: 10px; }
.need-actions button { flex: 1; padding: 5px; font-size: 0.8rem; }
@media (max-width: 1200px) {
    .needs-kanban { grid-template-columns: 1fr; }
}

/* ==========================================
   ADVOCACY PLANS MODULE - extracted from JS
   ========================================== */
.plan-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.plan-header { color: white; padding: 20px; text-align: center; }
.plan-header i { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.plan-header h4 { margin: 0; font-size: 1.1rem; }
.plan-content { padding: 20px; }
.plan-meta {
    background: var(--gray-50); padding: 15px; border-radius: 8px;
    margin-bottom: 15px; font-size: 0.9rem;
}
.plan-meta div { margin-bottom: 8px; }
.plan-meta div:last-child { margin-bottom: 0; }
.plan-actions { display: flex; flex-direction: column; gap: 10px; }

/* Plan section inside modals */
.plan-section { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.plan-section:last-of-type { border-bottom: none; }
.plan-section h4 { color: var(--primary-color); margin-bottom: 10px; }
.plan-section p { white-space: pre-wrap; line-height: 1.6; }

/* ==========================================
   PROCESS MANAGEMENT MODULE - extracted from JS
   ========================================== */
.process-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}
.process-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.process-card.priority-high { border-left-color: var(--danger, #dc3545); }
.process-card.priority-medium { border-left-color: var(--warning, #fd7e14); }
.process-card.priority-low { border-left-color: var(--success, #198754); }

.status-badge {
    display: inline-block; padding: 4px 12px; border-radius: 12px;
    font-size: 0.85rem; font-weight: 600;
}
.status-not-started { background: var(--gray-200); color: var(--gray-700); }
.status-in-progress { background: #dbeafe; color: #1e40af; }
.status-submitted { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-denied { background: #fee2e2; color: #991b1b; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-on-hold { background: #f3e8ff; color: #6b21a8; }

/* Reports type card hover */
.report-type-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ==========================================
   APPOINTMENT OPTION CARDS (modal)
   ========================================== */
.apt-options-row { display: flex; gap: 12px; margin-bottom: 14px; }
.apt-option-card {
    flex: 1; border: 2px solid var(--gray-200); border-radius: 10px;
    padding: 12px; cursor: pointer; transition: all 0.2s;
}
.apt-option-card:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(66,133,244,0.06);
}
.apt-option-card input[type=checkbox] { display: none; }
.apt-option-inner { display: flex; align-items: center; gap: 10px; }
.apt-option-inner i { font-size: 1.4rem; flex-shrink: 0; }
.apt-option-inner strong { display: block; font-size: 0.9rem; }
.apt-option-inner p { margin: 0; font-size: 0.78rem; color: var(--gray-500); }

/* Day pill checkboxes */
.day-pill {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border: 2px solid var(--gray-200);
    border-radius: 20px; cursor: pointer; font-size: 0.85rem; font-weight: 600;
}
.day-pill:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(66,133,244,0.1);
    color: var(--primary-color);
}
.day-pill input[type=checkbox] { display: none; }

/* Status pill (log delivery) */
.status-pill-label {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: 2px solid var(--gray-200);
    border-radius: 20px; cursor: pointer; font-size: 0.88rem; font-weight: 600;
}
.status-pill-label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(66,133,244,0.1);
    color: var(--primary-color);
}
.status-pill-label input[type=radio] { display: none; }

/* ==========================================
   DARK MODE - FINAL COMPREHENSIVE PASS
   Covers all remaining light-on-light areas
   ========================================== */

/* ---- Main content area & all child divs ---- */
body.dark-mode .main-content,
body.dark-mode #mainContent {
    background: #0f172a !important;
    color: #dde8f4 !important;
}

/* Every white / #fff / #f- background inside dark mode */
body.dark-mode .summary-card,
body.dark-mode .package-card,
body.dark-mode .transaction-item,
body.dark-mode .dashboard-card,
body.dark-mode .dashboard-section,
body.dark-mode .client-full-screen {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .summary-card h3,
body.dark-mode .summary-card p {
    color: #dde8f4 !important;
}

/* ---- Financial Management (renderProfitLossStatement) ---- */
/* The P&L uses background:white inline — override by targeting its container */
body.dark-mode .financial-summary .summary-card { background: #1e2a3a !important; color: #dde8f4 !important; }
/* P&L outer white box */
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: white"] {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
}
/* P&L inner table rows */
body.dark-mode [style*="border-bottom:1px solid var(--gray-100)"],
body.dark-mode [style*="border-bottom: 1px solid var(--gray-100)"] {
    border-color: #2d3f55 !important;
}
/* Gray-100 inline backgrounds (e.g., table alternating rows) */
body.dark-mode [style*="background:var(--gray-100)"],
body.dark-mode [style*="background: var(--gray-100)"] {
    background: #253447 !important;
}

/* ---- Transaction items ---- */
body.dark-mode .transaction-item {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .transaction-item h4,
body.dark-mode .transaction-item p { color: #dde8f4 !important; }

/* ---- Package cards ---- */
body.dark-mode .package-card,
body.dark-mode [style*="border:1px solid var(--gray-200)"][style*="background:white"],
body.dark-mode [style*="border: 1px solid var(--gray-200)"] {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

/* ---- Activities / Tasks section ---- */
body.dark-mode .task-item,
body.dark-mode .task-card,
body.dark-mode #tasksActivityView,
body.dark-mode #tasksActivityView > * {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}

/* ---- Dashboard Activities box and Quick Actions ---- */
body.dark-mode .card-content { background: transparent !important; color: #dde8f4 !important; }
body.dark-mode .card-header { background: #1e2a3a !important; color: #dde8f4 !important; border-color: #2d3f55 !important; }
body.dark-mode .card-header h3 { color: #eef4ff !important; }

/* View switcher buttons not active */
body.dark-mode .view-btn:not(.active) {
    background: #253447 !important;
    color: #aabbcc !important;
    border-color: #2d3f55 !important;
}

/* ---- Client status badge "Active" in client cards ---- */
body.dark-mode .client-status {
    color: white !important;
}
body.dark-mode .client-status.active { background: #059669 !important; }
body.dark-mode .client-status.inactive { background: #6b7280 !important; }
body.dark-mode .client-status.pending { background: #d97706 !important; }

/* ---- Overview detail items ---- */
body.dark-mode .detail-item label { color: #94a3b8 !important; }
body.dark-mode .detail-item span,
body.dark-mode .detail-item p { color: #dde8f4 !important; }

/* ---- Section headers / titles ---- */
body.dark-mode .section-header h2,
body.dark-mode .section-header h3 { color: #eef4ff !important; }
body.dark-mode .section-subtitle { color: #94a3b8 !important; }

/* ---- Priority badge inline styles ---- */
/* High - red light bg */
body.dark-mode [style*="background: var(--danger)"],
body.dark-mode [style*="background:var(--danger)"] {
    background: #7f1d1d !important; color: #fecaca !important;
}
/* Medium - warning yellow bg */
body.dark-mode [style*="background: var(--warning)"],
body.dark-mode [style*="background:var(--warning)"] {
    background: #78350f !important; color: #fde68a !important;
}

/* ---- Business Setup checklist headings ---- */
body.dark-mode .business-setup-section,
body.dark-mode .setup-step,
body.dark-mode .checklist-item {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .checklist-item strong,
body.dark-mode .checklist-item label { color: #dde8f4 !important; }

/* ---- Compliance & Resource items ---- */
body.dark-mode .compliance-section,
body.dark-mode .resource-section { color: #dde8f4 !important; }
body.dark-mode .compliance-link,
body.dark-mode .resource-link { color: #60a5fa !important; }

/* ---- Client tab buttons (inactive) in dark ---- */
body.dark-mode .client-tab-card:not(.active) {
    background: #1e2a3a !important;
    color: #dde8f4 !important;
    border-color: #2d3f55 !important;
}
body.dark-mode .client-tab-card:not(.active) h4 { color: #eef4ff !important; }
body.dark-mode .client-tab-card:not(.active) p { color: #94a3b8 !important; }

/* ---- Client budget tab ---- */
body.dark-mode .budget-section,
body.dark-mode .budget-card,
body.dark-mode .budget-overview {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}

/* ---- Interactions / Activity log ---- */
body.dark-mode .interaction-type,
body.dark-mode .log-timestamp,
body.dark-mode .activity-date { color: #94a3b8 !important; }

/* ---- Reports section (generated items) ---- */
body.dark-mode .report-type-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .report-type-card h3, 
body.dark-mode .report-type-card p { color: #dde8f4 !important; }

/* ---- All inline text in gray areas ---- */
body.dark-mode [style*="color: var(--gray-700)"],
body.dark-mode [style*="color:var(--gray-700)"],
body.dark-mode [style*="color: var(--gray-800)"],
body.dark-mode [style*="color:var(--gray-800)"] {
    color: #dde8f4 !important;
}
body.dark-mode [style*="color: var(--gray-600)"],
body.dark-mode [style*="color:var(--gray-600)"],
body.dark-mode [style*="color: var(--gray-500)"],
body.dark-mode [style*="color:var(--gray-500)"] {
    color: #94a3b8 !important;
}

/* ---- Process status badges in dark ---- */
body.dark-mode .status-not-started { background: #2d3f55 !important; color: #ccd6e8 !important; }
body.dark-mode .status-in-progress { background: #1e3a5f !important; color: #93c5fd !important; }
body.dark-mode .status-submitted   { background: #78350f !important; color: #fde68a !important; }
body.dark-mode .status-approved,
body.dark-mode .status-completed   { background: #064e3b !important; color: #6ee7b7 !important; }
body.dark-mode .status-denied      { background: #7f1d1d !important; color: #fca5a5 !important; }
body.dark-mode .status-on-hold     { background: #4c1d95 !important; color: #c4b5fd !important; }

/* ---- Sidebar toggle button ---- */
body.dark-mode #sidebarToggle {
    background: rgba(255,255,255,0.15) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.25) !important;
}

/* ---- Sidebar collapse arrow ---- */
body.dark-mode .sidebar-toggle-arrow,
body.dark-mode #sidebarToggle i { color: white !important; opacity: 1 !important; }

/* ---- Form row / modal in dark ---- */
body.dark-mode .form-row { color: #dde8f4 !important; }
body.dark-mode .modal-actions { border-color: #2d3f55 !important; }

/* ---- Empty-state messages ---- */
body.dark-mode .empty-state,
body.dark-mode p.empty-state { color: #94a3b8 !important; }

/* ---- Tab section general ---- */
body.dark-mode .tab-section,
body.dark-mode .tab-section > * { color: #dde8f4 !important; }

/* ---- APT option cards in dark ---- */
body.dark-mode .apt-option-card {
    background: #1e2a3a !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .apt-option-card:has(input:checked) {
    border-color: var(--primary-color) !important;
    background: rgba(124,58,237,0.15) !important;
}

/* ---- Day / status pills in dark ---- */
body.dark-mode .day-pill {
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
body.dark-mode .status-pill-label {
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}

/* Recurrence panel in dark */
body.dark-mode #recurrencePanel {
    background: #151f2e !important;
    border-color: #2d3f55 !important;
    color: #dde8f4 !important;
}
