/* Youthnet Nexus - Dark Theme Stylesheet */

/* ==========================================================================
   TABLE OF CONTENTS
   ==========================================================================

   1.  THEME SYSTEM .................................................. Line 71
       - Default, Ocean, Old School, Bubblegum, Orange Creamsicle
       - Cascadia, Underworld/Overworld, Yellowjacket, Royalty
       - Soviet McDonalds, Matrix
       - Dark and Light mode variants for each theme (11 themes total)

   2.  MOBILE NAV VARIABLES ......................................... Line 556

   3.  OLD SCHOOL THEME SPECIAL STYLES
       - Light Mode (Notebook Paper Theme) .......................... Line 580
       - Dark Mode (Dark Notebook Theme) ............................ Line 792

   4.  THEME PREFERENCES UI ......................................... Line 986
       - Theme picker modal and preview styles

   5.  CORE UI COMPONENTS ........................................... Line 1129
       - Reset and Base Styles
       - Header and Navigation
       - Notifications Dropdown ..................................... Line 1253
       - Profile Dropdown
       - Navigation Tabs and Dropdowns
       - Filters, Search, Custom Dropdowns
       - Modals, Forms, Buttons, Tables
       - Cards and Layouts

   6.  MODAL MOBILE RESPONSIVE FIXES ................................ Line 3516

   7.  GLOBAL MOBILE RESPONSIVE FIXES ............................... Line 3690

   8.  RESPONSIVE TABLE - CARD LAYOUT ON MOBILE ..................... Line 3850

   9.  LIFESET PROGRAM STYLES ....................................... Line 4093

   10. BRS COMPLIANCE SECTION STYLES ................................ Line 5465

   11. COMPLIANCE MASONRY LAYOUT .................................... Line 5608

   12. MOBILE CLIENT LIST HAMBURGER MENU ............................ Line 5795

   13. COMPREHENSIVE RESPONSIVE DESIGN .............................. Line 5942
       - Breakpoints: 1600px, 1366px, 1200px, 992px, 768px, 576px, 480px

   14. MESSAGING THEME FIXES ........................................ Line 7402
       - Theme-specific overrides for messaging components

   15. MESSAGING SYSTEM STYLES ...................................... Line 10011
       - Layout, Conversations Sidebar, Message Thread
       - Message Bubbles, Attachments, Compose Area

   16. MESSAGE REPLY FUNCTIONALITY .................................. Line 10723

   17. AUDIO MESSAGES ............................................... Line 10893
       - Recording UI, Waveform visualization, Playback controls

   18. ENROLLMENT HISTORY TIMELINE .................................. Line 12083

   19. TASKS SYSTEM STYLES .......................................... Line 12572

   20. SCHEDULE CALENDAR STYLES ..................................... Line 12828

   Last updated: January 10, 2026
   Total lines: ~13,436
   ========================================================================== */

/* ==========================================
   THEME SYSTEM
   ========================================== */

/* DEFAULT THEME - Dark Mode (default) */
:root,
[data-theme="default"][data-mode="dark"] {
    --primary-dark: #111111;
    --secondary-dark: #1a1a1a;
    --card-bg: #262626;
    --accent-purple: #4c506d;
    --accent-purple-hover: #5a5e7d;
    --accent-purple-rgb: 76, 80, 109;
    --accent-orange: #f4a460;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --text-on-accent: #ffffff;
    --link-color: #60a5fa;
    --link-color-hover: #93c5fd;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --border-color: #3a3a3a;
    --gradient-start: #4c506d;
    --gradient-end: #5a5e7d;
    --gradient-active-start: #2d3250;
    --gradient-active-end: #3d4268;
    --scrollbar-track: #000000;
}

/* DEFAULT THEME - Light Mode */
[data-theme="default"][data-mode="light"] {
    --primary-dark: #f5f5f5;
    --secondary-dark: #e8e8e8;
    --card-bg: #ffffff;
    --accent-purple: #5c6089;
    --accent-purple-hover: #6b6f98;
    --accent-purple-rgb: 92, 96, 137;
    --accent-orange: #e8945a;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #7a7a7a;
    --text-on-accent: #ffffff;
    --success: #2e7d32;
    --error: #c62828;
    --warning: #ef6c00;
    --border-color: #d0d0d0;
    --gradient-start: #5c6089;
    --gradient-end: #6b6f98;
    --gradient-active-start: #4a4e70;
    --gradient-active-end: #5a5e80;
    --scrollbar-track: #e0e0e0;
    --link-color: #3b82f6;
    --link-color-hover: #60a5fa;
}

/* OCEAN THEME - Dark Mode */
[data-theme="ocean"][data-mode="dark"] {
    --primary-dark: #0a1628;
    --secondary-dark: #0f1c35;
    --card-bg: #162850;
    --accent-purple: #1e88e5;
    --accent-purple-hover: #42a5f5;
    --accent-purple-rgb: 30, 136, 229;
    --accent-orange: #00bcd4;
    --text-primary: #e6f1ff;
    --text-secondary: #a8c7e5;
    --text-muted: #6b8eb5;
    --text-on-accent: #ffffff;
    --success: #26a69a;
    --error: #ef5350;
    --warning: #ffa726;
    --border-color: #1e3a5f;
    --gradient-start: #1e88e5;
    --gradient-end: #42a5f5;
    --gradient-active-start: #0d47a1;
    --gradient-active-end: #1565c0;
    --scrollbar-track: #0a1628;
    --link-color: #38bdf8;
    --link-color-hover: #7dd3fc;
}

/* OCEAN THEME - Light Mode */
[data-theme="ocean"][data-mode="light"] {
    --primary-dark: #e8f4fc;
    --secondary-dark: #d8ecf8;
    --card-bg: #ffffff;
    --accent-purple: #1565c0;
    --accent-purple-hover: #1976d2;
    --accent-purple-rgb: 21, 101, 192;
    --accent-orange: #0097a7;
    --text-primary: #0a3d62;
    --text-secondary: #2c5282;
    --text-muted: #5a8ab8;
    --text-on-accent: #ffffff;
    --success: #00897b;
    --error: #e53935;
    --warning: #fb8c00;
    --border-color: #b3d4fc;
    --gradient-start: #1565c0;
    --gradient-end: #1976d2;
    --gradient-active-start: #0d47a1;
    --gradient-active-end: #1565c0;
    --scrollbar-track: #cce5ff;
    --link-color: #0369a1;
    --link-color-hover: #0284c7;
}

/* OLD SCHOOL THEME - Dark Mode */
[data-theme="oldschool"][data-mode="dark"] {
    --primary-dark: #1a1714;
    --secondary-dark: #241f1a;
    --card-bg: #352d25;
    --accent-purple: #8b7355;
    --accent-purple-hover: #a08565;
    --accent-purple-rgb: 139, 115, 85;
    --accent-orange: #d4a574;
    --text-primary: #f5e6d3;
    --text-secondary: #c4b5a5;
    --text-muted: #8c7b6b;
    --text-on-accent: #ffffff;
    --success: #6b8e23;
    --error: #cd5c5c;
    --warning: #daa520;
    --border-color: #4a3f35;
    --gradient-start: #8b7355;
    --gradient-end: #a08565;
    --gradient-active-start: #6b5340;
    --gradient-active-end: #7b6350;
    --scrollbar-track: #1a1714;
    --link-color: #e9b872;
    --link-color-hover: #f0c987;
}

/* OLD SCHOOL THEME - Light Mode - Notebook Paper & Sticky Notes */
[data-theme="oldschool"][data-mode="light"] {
    --primary-dark: #f8f6f0;
    --secondary-dark: #fff8dc;
    --card-bg: #fffacd;
    --accent-purple: #8b4513;
    --accent-purple-hover: #a0522d;
    --accent-purple-rgb: 139, 69, 19;
    --accent-orange: #cc5500;
    --text-primary: #2c1810;
    --text-secondary: #4a3728;
    --text-muted: #7a6a5a;
    --text-on-accent: #ffffff;
    --success: #228b22;
    --error: #cc0000;
    --warning: #cc5500;
    --border-color: #c4a77d;
    --gradient-start: #8b4513;
    --gradient-end: #a0522d;
    --gradient-active-start: #6b3410;
    --gradient-active-end: #8b4513;
    --scrollbar-track: #e8dcc8;
    --notebook-line: #a8d4f0;
    --notebook-margin: #e88b8b;
    --sticky-yellow: #fff740;
    --sticky-pink: #ff7eb9;
    --sticky-blue: #7afcff;
    --sticky-green: #98fb98;
    --link-color: #0369a1;
    --link-color-hover: #0284c7;
}

/* BUBBLEGUM THEME - Dark Mode */
[data-theme="bubblegum"][data-mode="dark"] {
    --primary-dark: #1a0a14;
    --secondary-dark: #240f1c;
    --card-bg: #3a1a2d;
    --accent-purple: #e91e63;
    --accent-purple-hover: #f06292;
    --accent-purple-rgb: 233, 30, 99;
    --accent-orange: #ff80ab;
    --text-primary: #fce4ec;
    --text-secondary: #f8bbd9;
    --text-muted: #ad6b8f;
    --text-on-accent: #ffffff;
    --success: #81c784;
    --error: #ff5252;
    --warning: #ffab91;
    --border-color: #4a1f35;
    --gradient-start: #e91e63;
    --gradient-end: #f06292;
    --gradient-active-start: #c2185b;
    --gradient-active-end: #d81b60;
    --scrollbar-track: #1a0a14;
    --link-color: #f472b6;
    --link-color-hover: #f9a8d4;
}

/* BUBBLEGUM THEME - Light Mode */
[data-theme="bubblegum"][data-mode="light"] {
    --primary-dark: #fce8f0;
    --secondary-dark: #f5d0e0;
    --card-bg: #ffffff;
    --accent-purple: #c2185b;
    --accent-purple-hover: #d81b60;
    --accent-purple-rgb: 194, 24, 91;
    --accent-orange: #ec407a;
    --text-primary: #6d0839;
    --text-secondary: #8e1152;
    --text-muted: #c47a9a;
    --text-on-accent: #ffffff;
    --success: #4caf50;
    --error: #d32f2f;
    --warning: #ff7043;
    --border-color: #f0b8d0;
    --gradient-start: #c2185b;
    --gradient-end: #d81b60;
    --gradient-active-start: #ad1457;
    --gradient-active-end: #c2185b;
    --scrollbar-track: #f8d0e0;
    --link-color: #be185d;
    --link-color-hover: #db2777;
}

/* ORANGE CREAMSICLE THEME - Dark Mode */
[data-theme="creamsicle"][data-mode="dark"] {
    --primary-dark: #1c1410;
    --secondary-dark: #2a1a12;
    --card-bg: #3d2618;
    --accent-purple: #ff7a2e;
    --accent-purple-hover: #ff9544;
    --accent-purple-rgb: 255, 122, 46;
    --accent-orange: #ffbe8a;
    --text-primary: #fff8f2;
    --text-secondary: #ffe0c8;
    --text-muted: #cc8860;
    --text-on-accent: #ffffff;
    --success: #81c784;
    --error: #ff5252;
    --warning: #ffd54f;
    --border-color: #5c3d28;
    --gradient-start: #ff7a2e;
    --gradient-end: #ff9544;
    --gradient-active-start: #f06820;
    --gradient-active-end: #ff7a2e;
    --scrollbar-track: #1c1410;
    --link-color: #ff9544;
    --link-color-hover: #ffbe8a;
}

/* ORANGE CREAMSICLE THEME - Light Mode */
[data-theme="creamsicle"][data-mode="light"] {
    --primary-dark: #fff5eb;
    --secondary-dark: #ffe8d6;
    --card-bg: #ffffff;
    --accent-purple: #e55a25;
    --accent-purple-hover: #ff6b35;
    --accent-purple-rgb: 229, 90, 37;
    --accent-orange: #ff8c5a;
    --text-primary: #5c2d0e;
    --text-secondary: #7a3d14;
    --text-muted: #c4856a;
    --text-on-accent: #ffffff;
    --success: #4caf50;
    --error: #d32f2f;
    --warning: #ff9800;
    --border-color: #ffd0b0;
    --gradient-start: #e55a25;
    --gradient-end: #ff6b35;
    --gradient-active-start: #cc4a15;
    --gradient-active-end: #e55a25;
    --scrollbar-track: #ffe8d6;
    --link-color: #e55a25;
    --link-color-hover: #ff6b35;
}

/* CASCADIA THEME - Dark Mode */
[data-theme="cascadia"][data-mode="dark"] {
    --primary-dark: #0a1612;
    --secondary-dark: #101e1a;
    --card-bg: #1a302a;
    --accent-purple: #00a5b8;
    --accent-purple-hover: #00bcd4;
    --accent-purple-rgb: 0, 165, 184;
    --accent-orange: #3cb371;
    --text-primary: #e8f5f0;
    --text-secondary: #a8d5c5;
    --text-muted: #6b9a8a;
    --text-on-accent: #ffffff;
    --success: #4caf50;
    --error: #ef5350;
    --warning: #ffb74d;
    --border-color: #2d4a40;
    --gradient-start: #00a5b8;
    --gradient-end: #00bcd4;
    --gradient-active-start: #008999;
    --gradient-active-end: #00a5b8;
    --scrollbar-track: #0a1612;
    --link-color: #2dd4bf;
    --link-color-hover: #5eead4;
}

/* CASCADIA THEME - Light Mode */
[data-theme="cascadia"][data-mode="light"] {
    --primary-dark: #e8f5f0;
    --secondary-dark: #d5ebe5;
    --card-bg: #ffffff;
    --accent-purple: #0097a7;
    --accent-purple-hover: #00acc1;
    --accent-purple-rgb: 0, 151, 167;
    --accent-orange: #2e8b57;
    --text-primary: #0a2e20;
    --text-secondary: #1e4a35;
    --text-muted: #5a8a75;
    --text-on-accent: #ffffff;
    --success: #2e7d32;
    --error: #c62828;
    --warning: #ef6c00;
    --border-color: #a8d5c5;
    --gradient-start: #0097a7;
    --gradient-end: #00acc1;
    --gradient-active-start: #00838f;
    --gradient-active-end: #0097a7;
    --scrollbar-track: #c5e5d5;
    --link-color: #0d9488;
    --link-color-hover: #14b8a6;
}

/* UNDERWORLD/OVERWORLD THEME - Dark Mode (Underworld) */
[data-theme="underworld"][data-mode="dark"] {
    --primary-dark: #000000;
    --secondary-dark: #1a0808;
    --card-bg: #2d1212;
    --accent-purple: #cc1a1a;
    --accent-purple-hover: #e52222;
    --accent-purple-rgb: 204, 26, 26;
    --accent-orange: #ff6600;
    --text-primary: #fff0f0;
    --text-secondary: #e0a8a0;
    --text-muted: #a07068;
    --text-on-accent: #ffffff;
    --success: #6b8e23;
    --error: #ff4444;
    --warning: #ff8800;
    --border-color: #4a1a1a;
    --gradient-start: #cc1a1a;
    --gradient-end: #e52222;
    --gradient-active-start: #a01515;
    --gradient-active-end: #cc1a1a;
    --scrollbar-track: #000000;
    --link-color: #fb7185;
    --link-color-hover: #fda4af;
}

/* UNDERWORLD/OVERWORLD THEME - Light Mode (Overworld) */
[data-theme="underworld"][data-mode="light"] {
    --primary-dark: #fffef5;
    --secondary-dark: #f5edd8;
    --card-bg: #ffffff;
    --accent-purple: #d4a017;
    --accent-purple-hover: #e6b422;
    --accent-purple-rgb: 212, 160, 23;
    --accent-orange: #b8860b;
    --text-primary: #3d3020;
    --text-secondary: #5c4a35;
    --text-muted: #9c8b70;
    --text-on-accent: #ffffff;
    --success: #4a7023;
    --error: #b33030;
    --warning: #cc8800;
    --border-color: #e8d9b8;
    --gradient-start: #d4a017;
    --gradient-end: #e6b422;
    --gradient-active-start: #b8890f;
    --gradient-active-end: #d4a017;
    --scrollbar-track: #f5edd8;
    --link-color: #b45309;
    --link-color-hover: #d97706;
}

/* YELLOWJACKET THEME - Dark Mode (Black & Yellow Bee) */
[data-theme="yellowjacket"][data-mode="dark"] {
    --primary-dark: #000000;
    --secondary-dark: #111111;
    --accent-purple: #ffd700;
    --accent-purple-hover: #ffea00;
    --accent-purple-rgb: 255, 215, 0;
    --accent-orange: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #888888;
    --text-on-accent: #000000;
    --success: #8bc34a;
    --error: #ff5252;
    --warning: #ffd700;
    --border-color: #333333;
    --gradient-start: #ffd700;
    --gradient-end: #ffea00;
    --gradient-active-start: #e6c200;
    --gradient-active-end: #ffd700;
    --scrollbar-track: #000000;
    --card-bg: #1a1a1a;
    --bg-hover: #222222;
    --link-color: #facc15;
    --link-color-hover: #fde047;
}

/* YELLOWJACKET THEME - Light Mode */
[data-theme="yellowjacket"][data-mode="light"] {
    --primary-dark: #ffffff;
    --secondary-dark: #f5f5f5;
    --accent-purple: #ffc107;
    --accent-purple-hover: #ffca28;
    --accent-purple-rgb: 255, 193, 7;
    --accent-orange: #e6ac00;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --text-on-accent: #000000;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --border-color: #dddddd;
    --gradient-start: #ffc107;
    --gradient-end: #ffca28;
    --gradient-active-start: #ffb300;
    --gradient-active-end: #ffc107;
    --scrollbar-track: #eeeeee;
    --card-bg: #ffffff;
    --bg-hover: #f0f0f0;
    --link-color: #a16207;
    --link-color-hover: #ca8a04;
}

/* ROYALTY THEME - Dark Mode - Purple and Gold like Crown Royal */
[data-theme="royalty"][data-mode="dark"] {
    --primary-dark: #1a0a2e;
    --secondary-dark: #221240;
    --card-bg: #3a2860;
    --accent-purple: #d4af37;
    --accent-purple-hover: #e6c558;
    --accent-purple-rgb: 212, 175, 55;
    --accent-orange: #e6c558;
    --text-primary: #f5f5f5;
    --text-secondary: #d4c4e0;
    --text-muted: #8b7a9e;
    --text-on-accent: #ffffff;
    --success: #27ae60;
    --error: #c0392b;
    --warning: #e6c558;
    --border-color: #4a3a5c;
    --gradient-start: #d4af37;
    --gradient-end: #b8962e;
    --gradient-active-start: #b8962e;
    --gradient-active-end: #9a7d26;
    --scrollbar-track: #1a0a2e;
    --bg-hover: #3d2b5e;
    --link-color: #c084fc;
    --link-color-hover: #d8b4fe;
}

/* ROYALTY THEME - Light Mode */
[data-theme="royalty"][data-mode="light"] {
    --primary-dark: #f8f4fc;
    --secondary-dark: #e5daf0;
    --card-bg: #ffffff;
    --accent-purple: #c9a227;
    --accent-purple-hover: #d4af37;
    --accent-purple-rgb: 201, 162, 39;
    --accent-orange: #d4af37;
    --text-primary: #2c1b3d;
    --text-secondary: #4a3a5c;
    --text-muted: #6b5a7c;
    --text-on-accent: #ffffff;
    --success: #27ae60;
    --error: #c0392b;
    --warning: #d4af37;
    --border-color: #d4c4e0;
    --gradient-start: #c9a227;
    --gradient-end: #d4af37;
    --gradient-active-start: #b8962e;
    --gradient-active-end: #c9a227;
    --scrollbar-track: #ede4f5;
    --bg-hover: #f0e8f5;
    --link-color: #7c3aed;
    --link-color-hover: #8b5cf6;
}

/* SOVIET MCDONALDS THEME - Dark Mode - Red with yellow accents */
[data-theme="sovietmcdonalds"][data-mode="dark"] {
    --primary-dark: #330000;
    --secondary-dark: #4a0000;
    --accent-purple: #ffc72c;
    --accent-purple-hover: #ffda4d;
    --accent-purple-rgb: 255, 199, 44;
    --accent-orange: #ffda4d;
    --text-primary: #ffffff;
    --text-secondary: #ffcccc;
    --text-muted: #cc9999;
    --text-on-accent: #330000;
    --success: #4caf50;
    --error: #ff5252;
    --warning: #ffc72c;
    --border-color: #800000;
    --gradient-start: #ffc72c;
    --gradient-end: #ffda4d;
    --gradient-active-start: #e6b020;
    --gradient-active-end: #ffc72c;
    --scrollbar-track: #330000;
    --card-bg: #5c0000;
    --bg-hover: #700000;
    --link-color: #fcd34d;
    --link-color-hover: #fde68a;
}

/* SOVIET MCDONALDS THEME - Light Mode */
[data-theme="sovietmcdonalds"][data-mode="light"] {
    --primary-dark: #fff5f5;
    --secondary-dark: #ffe8e8;
    --card-bg: #ffffff;
    --accent-purple: #cc0000;
    --accent-purple-hover: #e60000;
    --accent-purple-rgb: 204, 0, 0;
    --accent-orange: #ffc72c;
    --text-primary: #4d0000;
    --text-secondary: #800000;
    --text-muted: #a65050;
    --text-on-accent: #ffffff;
    --success: #2e7d32;
    --error: #c62828;
    --warning: #e6a800;
    --border-color: #ffcccc;
    --gradient-start: #cc0000;
    --gradient-end: #e60000;
    --gradient-active-start: #b30000;
    --gradient-active-end: #cc0000;
    --scrollbar-track: #ffe6e6;
    --bg-hover: #fff0f0;
    --link-color: #991b1b;
    --link-color-hover: #b91c1c;
}

/* MATRIX THEME - Dark Mode - RGB color scheme */
[data-theme="matrix"][data-mode="dark"] {
    --primary-dark: #0a0a0a;
    --secondary-dark: #111111;
    --card-bg: #1a1a1a;
    --accent-purple: #0000FF;
    --accent-purple-hover: #3333FF;
    --accent-purple-rgb: 0, 0, 255;
    --accent-orange: #FF0000;
    --text-primary: #e8e8e8;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --text-on-accent: #ffffff;
    --success: #00FF00;
    --error: #FF0000;
    --warning: #FFFF00;
    --border-color: #333333;
    --gradient-start: #0000FF;
    --gradient-end: #0000FF;
    --gradient-active-start: #00FF00;
    --gradient-active-end: #00FF00;
    --scrollbar-track: #0a0a0a;
    --link-color: #0000FF;
    --link-color-hover: #3333FF;
}

/* MATRIX THEME - Light Mode - RGB on light */
[data-theme="matrix"][data-mode="light"] {
    --primary-dark: #f5f5f5;
    --secondary-dark: #e8e8e8;
    --card-bg: #ffffff;
    --accent-purple: #0000CC;
    --accent-purple-hover: #0000AA;
    --accent-purple-rgb: 0, 0, 204;
    --accent-orange: #CC0000;
    --text-primary: #1a1a1a;
    --text-secondary: #444444;
    --text-muted: #888888;
    --text-on-accent: #ffffff;
    --success: #00CC00;
    --error: #CC0000;
    --warning: #CCCC00;
    --border-color: #cccccc;
    --gradient-start: #0000CC;
    --gradient-end: #0000CC;
    --gradient-active-start: #00CC00;
    --gradient-active-end: #00CC00;
    --scrollbar-track: #e8e8e8;
    --link-color: #0000CC;
    --link-color-hover: #0000AA;
}

/* THE NEXT GENERATION THEME - Dark Mode - LCARS inspired interface */
[data-theme="thenextgeneration"][data-mode="dark"] {
    --primary-dark: #000000;
    --secondary-dark: #0a0a14;
    --card-bg: #101018;
    --accent-purple: #9999ff;
    --accent-purple-hover: #aaaaff;
    --accent-purple-rgb: 153, 153, 255;
    --accent-orange: #ff9900;
    --text-primary: #ff9966;
    --text-secondary: #cc99cc;
    --text-muted: #9999cc;
    --text-on-accent: #000000;
    --success: #99cc66;
    --error: #cc6666;
    --warning: #ffcc66;
    --border-color: #333355;
    --gradient-start: #9999ff;
    --gradient-end: #ff9900;
    --gradient-active-start: #cc99cc;
    --gradient-active-end: #ff9966;
    --scrollbar-track: #0a0a14;
    --link-color: #ff9966;
    --link-color-hover: #ffbb99;
}

/* THE NEXT GENERATION THEME - Light Mode - LCARS inspired, lighter */
[data-theme="thenextgeneration"][data-mode="light"] {
    --primary-dark: #e8e0f0;
    --secondary-dark: #d9cce6;
    --card-bg: #ffffff;
    --accent-purple: #9966cc;
    --accent-purple-hover: #7744aa;
    --accent-purple-rgb: 153, 102, 204;
    --accent-orange: #cc6633;
    --text-primary: #1a1a2e;
    --text-secondary: #6633aa;
    --text-muted: #9999aa;
    --text-on-accent: #ffffff;
    --success: #669944;
    --error: #cc4444;
    --warning: #cc9933;
    --border-color: #ccbbdd;
    --gradient-start: #9966cc;
    --gradient-end: #cc6633;
    --gradient-active-start: #7744aa;
    --gradient-active-end: #aa5522;
    --scrollbar-track: #d9cce6;
    --link-color: #6633aa;
    --link-color-hover: #9966cc;
}

/* THE NEXT GENERATION THEME - LCARS Interface Styling */
/* Authentic Star Trek TNG LCARS design with curved elbow frame */

/* ================================================================
   LCARS FRAME STRUCTURE
   - Horizontal bar at top (below header)
   - Curved elbow at top-left corner
   - Vertical bar down the left side
   - Content sits inside the frame
   ================================================================ */

/* Main content area - create the LCARS frame */
[data-theme="thenextgeneration"] .main-content {
    position: relative;
    padding-top: 0;
    padding-left: 40px; /* Space for vertical bar */
    min-height: calc(100vh - 60px);
}

/* Vertical LCARS bar - always in content area below header */

/* Default: bar starts below header */
[data-theme="thenextgeneration"] .main-content::before {
    content: '';
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 40px;
    background: #9999ff;
    z-index: 110;
    border-radius: 0 0 0 16px;
}

/* Pages WITHOUT sub-nav-tabs: add rounded top-left and offset so rounded corner is visible */
[data-theme="thenextgeneration"] body:not(:has(.sub-nav-tabs)) .main-content::before {
    top: 150px; /* Start below page title area so rounded corner is visible */
    border-radius: 16px 0 0 16px; /* Rounded top-left and bottom-left corners */
}

/* Header has normal padding - bar is now below header, not overlapping */

/* Curved elbow connector - only shows on pages with sub-nav-tabs */
[data-theme="thenextgeneration"] .main-content::after {
    display: none; /* Hidden by default */
}

/* LCARS elbow element is now handled by sub-nav-tabs::before */
[data-theme="thenextgeneration"] body:has(.sub-nav-tabs) .main-content::after {
    display: none;
}

/* Horizontal bar that extends from elbow - sits in sub-nav area */
[data-theme="thenextgeneration"] .sub-nav-tabs {
    position: sticky;
    top: 0;
    background: var(--primary-dark);
    border-bottom: none;
    gap: 0;
    padding-left: 0;
    padding-bottom: 6px;
    padding-top: 6px;
    margin-bottom: 0;
    margin-left: -40px; /* Extend to align with fixed frame */
    padding-right: 40px; /* Compensate */
    z-index: 100;
    min-height: 48px;
    display: flex;
    align-items: center;
}

/* LCARS elbow bar before the tabs */
[data-theme="thenextgeneration"] .sub-nav-tabs::before {
    content: '';
    display: block;
    width: 48px;
    min-width: 48px;
    flex-shrink: 0;
    align-self: stretch;
    position: relative;
    margin-left: 40px; /* Start after the vertical bar */
    background: #9999ff;
    border-radius: 20px 0 0 0;
}

/* Sub-nav-tabs - LCARS segmented bar style (only last tab rounded) */
[data-theme="thenextgeneration"] .sub-nav-tab {
    border: none;
    border-radius: 0; /* Straight edges by default */
    background: #cc99cc;
    color: #000000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1.5rem 0.75rem 1rem;
    margin-left: 4px;
    height: auto;
    min-height: 36px;
    display: flex;
    align-items: center;
}

[data-theme="thenextgeneration"] .sub-nav-tab:first-child {
    margin-left: 8px; /* Gap between elbow bar and first tab */
}

/* Only the last tab gets the rounded end */
[data-theme="thenextgeneration"] .sub-nav-tab:last-child {
    border-radius: 0 20px 20px 0;
}

[data-theme="thenextgeneration"] .sub-nav-tab:hover {
    background: #ddaadd;
    color: #000000;
}

[data-theme="thenextgeneration"] .sub-nav-tab.active {
    background: #ff9900;
    color: #000000;
}

/* Container adjustments to work with LCARS frame */
/* .container stays centered (margin: 0 auto) - main-content padding-left handles bar space */
/* .container-full gets small left padding for gap from bar */
[data-theme="thenextgeneration"] .container-full {
    padding-left: 1rem;
}

[data-theme="thenextgeneration"] .container-full::before,
[data-theme="thenextgeneration"] .container-full::after {
    display: none;
}

/* Content tabs container */
[data-theme="thenextgeneration"] .content-tabs-container {
    position: relative;
    z-index: 2;
}

/* LCARS-style content tabs */
[data-theme="thenextgeneration"] .content-tabs {
    background: transparent;
    border-bottom: none;
    gap: 4px;
    padding-left: 0;
    padding-right: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
    z-index: 2;
    align-items: stretch;
    min-height: 42px;
    border-radius: 0;
}

/* Content tabs - LCARS segmented bar style (only last tab rounded) */
[data-theme="thenextgeneration"] .content-tab {
    border: none;
    border-radius: 0; /* Straight edges by default */
    background: #cc99cc;
    color: #000000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 1.5rem 0.6rem 1rem;
    position: relative;
    margin: 0;
    margin-left: 4px;
}

[data-theme="thenextgeneration"] .content-tab:first-child {
    margin-left: 0;
}

/* Only the last content tab gets the rounded end */
[data-theme="thenextgeneration"] .content-tab:last-child {
    border-radius: 0 20px 20px 0;
}

[data-theme="thenextgeneration"] .content-tab:hover {
    background: #ddaadd;
    color: #000000;
    transform: none;
}

/* Active tab - orange */
[data-theme="thenextgeneration"] .content-tab.active {
    background: #ff9900;
    color: #000000;
    box-shadow: none;
}

/* Client tabs - nested tabs inside client view don't need the LCARS bar */
[data-theme="thenextgeneration"] .client-tabs-container .sub-nav-tabs {
    border-bottom: none;
    background: var(--primary-dark);
    min-height: auto;
    padding: 0.5rem;
}

[data-theme="thenextgeneration"] .client-tabs-container .sub-nav-tabs::before {
    display: none; /* No LCARS bar for nested tabs */
}

[data-theme="thenextgeneration"] .client-tabs-container {
    background: var(--secondary-dark);
    margin-top: 8px;
}

[data-theme="thenextgeneration"] .client-tabs-container .sub-nav-tab {
    background: #cc99cc;
    color: #000000;
    border: none;
    border-radius: 0; /* Straight edges */
    height: auto;
}

[data-theme="thenextgeneration"] .client-tabs-container .sub-nav-tab:last-child {
    border-radius: 0 20px 20px 0; /* Only last tab rounded */
}

[data-theme="thenextgeneration"] .client-tabs-container .sub-nav-tab:hover {
    background: #ddaadd;
    color: #000000;
}

[data-theme="thenextgeneration"] .client-tabs-container .sub-nav-tab.active {
    background: #ff9900;
    color: #000000;
}

/* Cards - simpler styling, no pseudo-element decorations */
[data-theme="thenextgeneration"] .card {
    border: 2px solid var(--accent-purple);
    border-radius: 12px;
    margin-left: 5px;
}

/* Filter chips - black text for readability on purple */
[data-theme="thenextgeneration"] .filter-chip:hover,
[data-theme="thenextgeneration"] .filter-chip.active {
    color: #000000;
}

/* Dashboard - purple icons with black, orange buttons */
[data-theme="thenextgeneration"] .program-icon {
    background-color: #9999ff;
}

[data-theme="thenextgeneration"] .program-icon svg {
    color: #000000;
}

[data-theme="thenextgeneration"] .program-card .btn {
    background: #ff9900;
    color: #000000;
    border-color: #ff9900;
}

[data-theme="thenextgeneration"] .program-card .btn:hover {
    background: #ffaa22;
    border-color: #ffaa22;
}

/* Stat cards */
[data-theme="thenextgeneration"] .stat-card {
    border-color: var(--accent-orange);
}

/* Buttons get LCARS pill shape */
[data-theme="thenextgeneration"] .btn,
[data-theme="thenextgeneration"] .btn-primary,
[data-theme="thenextgeneration"] .btn-secondary,
[data-theme="thenextgeneration"] .btn-success,
[data-theme="thenextgeneration"] .btn-danger,
[data-theme="thenextgeneration"] .btn-outline,
[data-theme="thenextgeneration"] button[type="submit"],
[data-theme="thenextgeneration"] button[type="button"] {
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border: none;
}

[data-theme="thenextgeneration"] .btn-secondary {
    background: #cc99cc;
    color: #000000;
}

[data-theme="thenextgeneration"] .btn-secondary:hover {
    background: #ddaadd;
}

[data-theme="thenextgeneration"] .btn-primary {
    background: #ff9900;
    color: #000000;
}

[data-theme="thenextgeneration"] .btn-primary:hover {
    background: #ffaa22;
}

/* Tables get LCARS styling with rounded corners on all cells */
[data-theme="thenextgeneration"] .data-table {
    border-collapse: separate;
    border-spacing: 4px;
}

[data-theme="thenextgeneration"] .data-table thead th {
    background: #9999ff;
    color: #000000;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 18px;
    box-shadow: none;
    clip-path: none;
}

[data-theme="thenextgeneration"] .data-table th:hover {
    background: #aaaaff;
}

/* Widget tables (workspace page) */
[data-theme="thenextgeneration"] .widget-table {
    border-collapse: separate;
    border-spacing: 4px;
}

[data-theme="thenextgeneration"] .widget-table thead th {
    background: #9999ff;
    color: #000000;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 18px;
    box-shadow: none;
    clip-path: none;
}

[data-theme="thenextgeneration"] .widget-table th:hover {
    background: #aaaaff;
}

[data-theme="thenextgeneration"] .data-table tbody td {
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Form inputs get LCARS styling */
[data-theme="thenextgeneration"] .form-control,
[data-theme="thenextgeneration"] .form-input,
[data-theme="thenextgeneration"] select,
[data-theme="thenextgeneration"] .form-select {
    border-radius: 15px;
    border: 2px solid #9999ff;
    background-color: var(--secondary-dark);
    color: var(--text-primary);
}

[data-theme="thenextgeneration"] .form-control:focus,
[data-theme="thenextgeneration"] .form-input:focus,
[data-theme="thenextgeneration"] select:focus,
[data-theme="thenextgeneration"] .form-select:focus {
    border-color: #ff9900;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

/* Dropdown/Select specific styling */
[data-theme="thenextgeneration"] select,
[data-theme="thenextgeneration"] .form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239999ff' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

[data-theme="thenextgeneration"] select:focus,
[data-theme="thenextgeneration"] .form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff9900' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Date and time input icons - make them orange for visibility */
[data-theme="thenextgeneration"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="thenextgeneration"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="thenextgeneration"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(62%) sepia(93%) saturate(1700%) hue-rotate(360deg) brightness(100%) contrast(105%);
    cursor: pointer;
    opacity: 1;
}

/* Style the dropdown options */
[data-theme="thenextgeneration"] select option {
    background-color: var(--secondary-dark);
    color: var(--text-primary);
    padding: 8px 12px;
}

/* Page title area LCARS bar */
[data-theme="thenextgeneration"] .page-header {
    position: relative;
    padding-left: 20px;
}

[data-theme="thenextgeneration"] .page-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-orange));
    border-radius: 4px;
}

/* Sidebar LCARS treatment (if visible) */
[data-theme="thenextgeneration"] .sidebar {
    border-right: none;
    position: relative;
}

[data-theme="thenextgeneration"] .sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(to bottom,
        var(--accent-purple) 0%,
        var(--accent-purple) 50%,
        var(--accent-orange) 50%,
        var(--accent-orange) 100%
    );
}

/* Modal LCARS styling */
[data-theme="thenextgeneration"] .modal {
    overflow: visible;
}

[data-theme="thenextgeneration"] .modal-content,
[data-theme="thenextgeneration"] .modal-content.modal-large,
[data-theme="thenextgeneration"] .modal-content.modal-medium,
[data-theme="thenextgeneration"] #activityModal .modal-content,
[data-theme="thenextgeneration"] #outreachModal .modal-content,
[data-theme="thenextgeneration"] #complianceModal .modal-content,
[data-theme="thenextgeneration"] #caseAideReportModal .modal-content,
[data-theme="thenextgeneration"] #youthProfileModal .modal-content,
[data-theme="thenextgeneration"] #scheduleEventModal .modal-content,
[data-theme="thenextgeneration"] #mileageModal .modal-content,
[data-theme="thenextgeneration"] #taskModal .modal-content,
[data-theme="thenextgeneration"] #addClientModal .modal-content,
[data-theme="thenextgeneration"] .theme-modal {
    border: none;
    border-radius: 16px;
    overflow: visible !important;
    position: relative;
    margin-left: 24px;
}

/* LCARS left bar for modals - starts below the inner curve */
[data-theme="thenextgeneration"] .modal-content::before,
[data-theme="thenextgeneration"] .theme-modal::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 70px;
    bottom: 0;
    width: 24px;
    background: #9999ff;
    border-radius: 0 0 12px 12px;
}

/* Modal header - extends left to create seamless connection */
[data-theme="thenextgeneration"] .modal-header,
[data-theme="thenextgeneration"] .theme-modal-header {
    background: #9999ff;
    color: #000000;
    border-radius: 12px 12px 0 0;
    margin-left: -24px;
    padding-left: calc(24px + 1rem);
    position: relative;
    border-bottom: none;
}

/* Connector from header down to bar */
[data-theme="thenextgeneration"] .modal-header::after,
[data-theme="thenextgeneration"] .theme-modal-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -20px;
    width: 24px;
    height: 20px;
    background: #9999ff;
}

[data-theme="thenextgeneration"] .modal-header h2,
[data-theme="thenextgeneration"] .modal-header h3,
[data-theme="thenextgeneration"] .modal-header .modal-title,
[data-theme="thenextgeneration"] .theme-modal-header h2 {
    color: #000000;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modal body/form padding - add space from header */
[data-theme="thenextgeneration"] .modal-body,
[data-theme="thenextgeneration"] .theme-modal-body {
    padding: 1.5rem;
    padding-top: 2rem;
    position: relative;
}

/* Forms directly in modal-content (no modal-body wrapper) */
[data-theme="thenextgeneration"] .modal-content > form {
    padding: 1.5rem;
    padding-top: 1.5rem;
    position: relative;
}

/* Inner curve - concave curve using radial gradient at inside corner */
[data-theme="thenextgeneration"] .modal-content > form::before,
[data-theme="thenextgeneration"] .modal-body::before,
[data-theme="thenextgeneration"] .theme-modal-body::before {
    content: '';
    position: absolute;
    left: 0;
    top: -1px;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 100% 100%, transparent 18px, #9999ff 18px);
    z-index: 10;
}

/* Modal footer padding */
[data-theme="thenextgeneration"] .modal-footer {
    padding: 1rem 1.5rem;
}

/* Modal close button */
[data-theme="thenextgeneration"] .modal-close,
[data-theme="thenextgeneration"] .modal-close-btn,
[data-theme="thenextgeneration"] .theme-modal-close,
[data-theme="thenextgeneration"] .modal-header .close,
[data-theme="thenextgeneration"] .btn-close {
    color: #000000;
    background: #ff9966;
    border: 2px solid #000000;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

[data-theme="thenextgeneration"] .modal-close:hover,
[data-theme="thenextgeneration"] .modal-close-btn:hover,
[data-theme="thenextgeneration"] .theme-modal-close:hover,
[data-theme="thenextgeneration"] .modal-header .close:hover,
[data-theme="thenextgeneration"] .btn-close:hover {
    background: #ddaadd; /* Same as Cancel button hover */
    color: #000000;
    border-color: #000000;
}

/* Make SVG X thicker in theme modal for TNG */
[data-theme="thenextgeneration"] .theme-modal-close svg {
    stroke-width: 3;
}

/* Navigation gets LCARS treatment */
[data-theme="thenextgeneration"] .top-nav {
    border-bottom: 4px solid var(--accent-orange);
}

[data-theme="thenextgeneration"] .nav-item.active {
    background: var(--accent-orange);
    color: #000000;
    border-radius: 0 0 15px 15px;
}

/* Profile button - pill shape */
[data-theme="thenextgeneration"] .profile-btn {
    background: #ff9900;
    color: #000000;
    border-radius: 20px;
    font-weight: 600;
}

[data-theme="thenextgeneration"] .profile-btn:hover {
    background: #ffaa22;
}

/* Message Widget - Orange FAB with black icon */
[data-theme="thenextgeneration"] #msgWidgetFab {
    background: #ff9900;
    color: #000000;
}

[data-theme="thenextgeneration"] #msgWidgetFab:hover {
    background: #ffaa22;
}

[data-theme="thenextgeneration"] #msgWidgetPanel {
    border: 2px solid #9999ff;
    border-radius: 16px;
}

[data-theme="thenextgeneration"] .mw-header {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .mw-header h2 {
    color: #000000;
}

[data-theme="thenextgeneration"] .mw-close {
    color: #000000;
    background: #ff9966;
    border: 2px solid #000000;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
}

[data-theme="thenextgeneration"] .mw-close:hover {
    background: #ff7f7f;
    color: #000000;
    border-color: #000000;
}

/* Message Bubbles - Orange outgoing, Purple incoming */
[data-theme="thenextgeneration"] .message-wrapper.outgoing .message-bubble {
    background: #ff9900;
    color: #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .message-bubble {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .message-bubble .message-time {
    color: rgba(0, 0, 0, 0.7);
}

/* Send button */
[data-theme="thenextgeneration"] .mw-input button#msgWidgetSend {
    background: #ff9900;
    color: #000000;
}

[data-theme="thenextgeneration"] .mw-input button#msgWidgetSend:hover {
    background: #ffaa22;
}

/* Conversation avatars - solid purple with black initials */
[data-theme="thenextgeneration"] .conversation-avatar-small,
[data-theme="thenextgeneration"] .conversation-avatar {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .user-avatar-sm.user-initials,
[data-theme="thenextgeneration"] .assignment-avatar,
[data-theme="thenextgeneration"] .staff-avatar.initials-only span {
    background: #9999ff;
    color: #000000;
}

/* Message attachments/shared content - match bubble colors */
[data-theme="thenextgeneration"] .message-wrapper.outgoing .message-attachments,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .message-attachment {
    background: #cc7700;
    color: #000000;
    border: none;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .message-attachments,
[data-theme="thenextgeneration"] .message-wrapper.incoming .message-attachment {
    background: #7777cc;
    color: #000000;
    border: none;
}

/* Group badge */
[data-theme="thenextgeneration"] .group-badge {
    background: #ff9900;
    color: #000000;
}

/* Conversation list - active/selected state */
[data-theme="thenextgeneration"] .conversation-item.active {
    background: #ff9900;
    border-radius: 12px;
}

[data-theme="thenextgeneration"] .conversation-item.active .conversation-name,
[data-theme="thenextgeneration"] .conversation-item.active .conversation-last-message,
[data-theme="thenextgeneration"] .conversation-item.active .conversation-time {
    color: #000000;
}

/* Group conversations - purple avatar so it doesn't clash with orange highlight */
[data-theme="thenextgeneration"] .conversation-item.active .conversation-avatar-small.group-avatar,
[data-theme="thenextgeneration"] .conversation-item.active .group-badge {
    background: #9999ff;
    color: #000000;
}

/* Message avatars - purple with black initials */
[data-theme="thenextgeneration"] .message-avatar {
    background: #9999ff;
    color: #000000;
}

/* Share link button - inverted colors for contrast */
[data-theme="thenextgeneration"] .share-link-button {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .share-link-button:hover {
    color: #000000;
}

/* Outgoing messages: purple button on orange bubble */
[data-theme="thenextgeneration"] .message-wrapper.outgoing .share-link-button {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .share-link-button:hover {
    color: #000000;
}

/* Incoming messages: orange button on purple bubble */
[data-theme="thenextgeneration"] .message-wrapper.incoming .share-link-button {
    background: #ff9900;
    color: #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .share-link-button:hover {
    color: #000000;
}

/* Sender name highlight */
[data-theme="thenextgeneration"] .message-sender-name {
    color: #ff9900;
}

/* Reply quote bar - orange for incoming (on purple bubble), keep light for outgoing */
[data-theme="thenextgeneration"] .message-wrapper.incoming .reply-quote-bar {
    background: #ff9900;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .reply-quote-bar {
    background: #9999ff;
}

/* Reaction badges - black background */
[data-theme="thenextgeneration"] .reaction-item {
    background: #000000;
    border: 1px solid #333;
    color: #ffffff;
}

[data-theme="thenextgeneration"] .reaction-item.user-reacted {
    background: #000000;
    border-color: #ff9900;
}

/* Share link button - add black border */
[data-theme="thenextgeneration"] .share-link-button {
    background: #9999ff;
    color: #000000;
    border: 2px solid #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .share-link-button {
    background: #9999ff;
    color: #000000;
    border: 2px solid #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .share-link-button {
    background: #ff9900;
    color: #000000;
    border: 2px solid #000000;
}

/* Reply quotes - styled like cards with black border */
[data-theme="thenextgeneration"] .message-reply-quote {
    background: #9999ff;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

[data-theme="thenextgeneration"] .message-reply-quote .reply-quote-bar {
    display: none;
}

[data-theme="thenextgeneration"] .message-reply-quote .reply-quote-sender {
    color: #000000;
    font-weight: 600;
}

[data-theme="thenextgeneration"] .message-reply-quote .reply-quote-text {
    color: #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .message-reply-quote {
    background: #9999ff;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .message-reply-quote {
    background: #ff9900;
}

/* Audio player styling - card style with black border */
[data-theme="thenextgeneration"] .audio-message-player,
[data-theme="thenextgeneration"] .audio-message-player.audio-file,
[data-theme="thenextgeneration"] .audio-message-player.voice-message {
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 0.5rem;
    background: #9999ff;
}

/* Outgoing: purple card on orange bubble */
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-message-player,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-message-player.audio-file,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-message-player.voice-message {
    background: #9999ff;
}

/* Incoming: orange card on purple bubble */
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-message-player,
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-message-player.audio-file,
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-message-player.voice-message {
    background: #ff9900;
}

[data-theme="thenextgeneration"] .audio-play-btn,
[data-theme="thenextgeneration"] .message-wrapper .audio-play-btn,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-play-btn,
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-play-btn {
    background: #000000;
    border: 1px solid #333;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-play-btn {
    color: #9999ff;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-play-btn {
    color: #ff9900;
}

[data-theme="thenextgeneration"] .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper.incoming .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-waveform .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-waveform .waveform-bar {
    background: #000000;
    opacity: 1;
}

[data-theme="thenextgeneration"] .audio-progress .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-progress .waveform-bar,
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-progress .waveform-bar {
    background: #000000;
}

[data-theme="thenextgeneration"] .audio-time {
    color: #000000;
    font-weight: 600;
}

[data-theme="thenextgeneration"] .audio-download-btn,
[data-theme="thenextgeneration"] .message-wrapper .audio-download-btn,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-download-btn,
[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-download-btn {
    background: #000000;
    border: 2px solid #000000;
    border-radius: 50%;
    padding: 4px;
    color: #9999ff;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .audio-download-btn {
    color: #9999ff;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .audio-download-btn {
    color: #ff9900;
}

/* Remove background from message-attachments container */
[data-theme="thenextgeneration"] .message-attachments,
[data-theme="thenextgeneration"] .message-wrapper .message-attachments,
[data-theme="thenextgeneration"] .message-wrapper.outgoing .message-attachments,
[data-theme="thenextgeneration"] .message-wrapper.incoming .message-attachments {
    background: transparent;
}

[data-theme="thenextgeneration"] .audio-file-name {
    color: #000000;
}

[data-theme="thenextgeneration"] .audio-playhead {
    background: #000000;
}

/* Remove background corners on audio elements */
[data-theme="thenextgeneration"] .audio-waveform,
[data-theme="thenextgeneration"] .audio-progress,
[data-theme="thenextgeneration"] .audio-player-controls {
    background: transparent;
}

/* File attachments (Excel, etc.) - purple/orange card with black border */
[data-theme="thenextgeneration"] .attachment-file {
    border: 2px solid #000000;
    border-radius: 8px;
    color: #000000;
}

[data-theme="thenextgeneration"] .message-wrapper.outgoing .attachment-file {
    background: #9999ff;
}

[data-theme="thenextgeneration"] .message-wrapper.incoming .attachment-file {
    background: #ff9900;
}

[data-theme="thenextgeneration"] .attachment-file:hover {
    opacity: 0.9;
    background: inherit;
}

/* TNG Custom Dropdown Styling */
[data-theme="thenextgeneration"] .custom-dropdown-wrapper .custom-dropdown-display {
    background: #000000;
    border: 2px solid #9999ff;
    border-radius: 20px;
    color: #ff9900;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper .custom-dropdown-display:hover {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper.open .custom-dropdown-display {
    background: #9999ff;
    color: #000000;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper .dropdown-arrow {
    color: #ff9900;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper:hover .dropdown-arrow,
[data-theme="thenextgeneration"] .custom-dropdown-wrapper.open .dropdown-arrow {
    color: #000000;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper .custom-dropdown-options {
    background: #000000;
    border: 2px solid #9999ff;
    border-radius: 12px;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper .custom-dropdown-option {
    color: #ff9900;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper .custom-dropdown-option:hover {
    background: #1a1a1a;
}

[data-theme="thenextgeneration"] .custom-dropdown-wrapper .custom-dropdown-option.selected {
    background: #ff9900;
    color: #000000;
}


/* Schedule Grid - LCARS styling */
[data-theme="thenextgeneration"] .schedule-grid thead th {
    background: #9999ff;
    color: #000000;
    font-weight: 600;
}

[data-theme="thenextgeneration"] .schedule-grid th.day-column.today {
    background: #ff9900;
    color: #000000;
}

[data-theme="thenextgeneration"] .schedule-grid th.day-column.today .day-name,
[data-theme="thenextgeneration"] .schedule-grid th.day-column.today .day-date {
    color: #000000;
    text-shadow: none;
}

/* TNG LCARS styling for data tables */
[data-theme="thenextgeneration"] .table-card {
    border: none;
    border-radius: 12px;
    overflow: visible;
    position: relative;
    margin-left: 32px;
    padding: 0;
}

[data-theme="thenextgeneration"] .table-card::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 4px;
    bottom: 0;
    width: 24px;
    background: #9999ff;
    border-radius: 16px 0 0 16px;
}

[data-theme="thenextgeneration"] .data-table thead th {
    background: #9999ff;
    color: #000000;
    font-weight: 600;
}

/* TNG - reduce padding in cards containing tables */
[data-theme="thenextgeneration"] .card > .table-card,
[data-theme="thenextgeneration"] .report-section > .table-card {
    margin-left: 28px;
}

[data-theme="thenextgeneration"] .card:has(.table-card) {
    padding: 1rem;
}

[data-theme="thenextgeneration"] .report-section {
    padding: 0;
}

[data-theme="thenextgeneration"] .container-full > .card {
    padding: 1rem;
}

/* TNG - Reports page specific adjustments */
[data-theme="thenextgeneration"] .card:has(.report-section) {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
}

/* TNG - Darker cards for reports tabs */
[data-theme="thenextgeneration"] .container-full > .card {
    background: rgba(0, 0, 0, 0.25);
}

[data-theme="thenextgeneration"] .report-section .report-controls {
    padding: 0 0.25rem;
    margin-bottom: 1rem;
}

[data-theme="thenextgeneration"] .report-section > .table-card {
    margin-left: 24px;
}

[data-theme="thenextgeneration"] .report-section > .table-card::before {
    left: -20px;
    top: 4px;
    width: 16px;
}

/* Hide LCARS frame on mobile to avoid clutter */
@media (max-width: 768px) {
    /* Remove main LCARS frame elements */
    [data-theme="thenextgeneration"] .main-content {
        padding-left: 0;
    }

    [data-theme="thenextgeneration"] .main-content::before,
    [data-theme="thenextgeneration"] .main-content::after,
    [data-theme="thenextgeneration"] .container-full::before,
    [data-theme="thenextgeneration"] .container-full::after,
    [data-theme="thenextgeneration"] .content-tabs-container::before,
    [data-theme="thenextgeneration"] .table-card::before,
    [data-theme="thenextgeneration"] .sub-nav-tabs::before,
    [data-theme="thenextgeneration"] .two-column-layout::before {
        display: none;
    }

    /* Reset header padding on mobile */
    [data-theme="thenextgeneration"] .main-header,
    [data-theme="thenextgeneration"] .sticky-header-wrapper {
        padding-left: 0;
    }

    [data-theme="thenextgeneration"] .container-full {
        padding-left: 0;
        margin-left: 0;
    }

    [data-theme="thenextgeneration"] .main-content > .container {
        margin-left: 0;
    }

    [data-theme="thenextgeneration"] .table-card {
        margin-left: 0;
    }

    [data-theme="thenextgeneration"] .two-column-layout {
        margin-left: 0;
    }

    [data-theme="thenextgeneration"] .sub-nav-tabs {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-left: 0;
        min-height: auto;
        gap: 4px;
    }

    /* Tabs become pills on mobile */
    [data-theme="thenextgeneration"] .sub-nav-tab,
    [data-theme="thenextgeneration"] .sub-nav-tab:last-child {
        border-radius: 20px;
        margin-left: 0;
    }

    [data-theme="thenextgeneration"] .sub-nav-tab:first-child {
        margin-left: 0;
    }

    [data-theme="thenextgeneration"] .content-tabs {
        padding-left: 0.5rem;
    }

    [data-theme="thenextgeneration"] .content-tab,
    [data-theme="thenextgeneration"] .content-tab:last-child {
        border-radius: 20px;
    }

    /* Simplify table spacing on mobile */
    [data-theme="thenextgeneration"] .data-table {
        border-spacing: 2px;
    }
}

/* ==========================================
   MOBILE NAV VARIABLES - Theme Aware
   ========================================== */

/* Dark mode - all themes */
[data-mode="dark"] {
    --mobile-nav-header-bg: #0d0d0d;
    --mobile-nav-header-text: #ffffff;
    --mobile-nav-section-text: rgba(255, 255, 255, 0.85);
    --mobile-nav-content-bg: var(--secondary-dark);
    --mobile-nav-item-bg: var(--card-bg);
    --mobile-nav-item-hover: var(--primary-dark);
}

/* Light mode - all themes */
[data-mode="light"] {
    --mobile-nav-header-bg: #2a2a2a;
    --mobile-nav-header-text: #ffffff;
    --mobile-nav-section-text: rgba(255, 255, 255, 0.9);
    --mobile-nav-content-bg: var(--secondary-dark);
    --mobile-nav-item-bg: var(--card-bg);
    --mobile-nav-item-hover: var(--primary-dark);
}

/* ==========================================
   OLD SCHOOL LIGHT MODE - Notebook Paper Theme
   ========================================== */

/* Notebook paper background with blue lines */
[data-theme="oldschool"][data-mode="light"] body {
    background-color: #f5f5f0;
    background-image:
        linear-gradient(90deg, transparent 60px, #e8a0a0 60px, #e8a0a0 62px, transparent 62px),
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 23px,
            #9dc5e8 23px,
            #9dc5e8 24px
        );
    background-size: 100% 100%, 100% 24px;
    background-attachment: fixed;
}

/* Main content area - keep the lined paper look */
[data-theme="oldschool"][data-mode="light"] .main-content {
    background-color: rgba(255, 255, 255, 0.85);
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 23px,
            #b8d4e8 23px,
            #b8d4e8 24px
        );
    background-size: 100% 24px;
    border-left: 3px solid #e88b8b;
    margin-left: 40px;
    padding-left: 20px;
}

/* Cards look like sticky notes */
[data-theme="oldschool"][data-mode="light"] .card {
    background: linear-gradient(135deg, #fff740 0%, #fffacd 100%);
    border: none;
    border-radius: 2px;
    box-shadow:
        3px 3px 7px rgba(0,0,0,0.2),
        inset 0 -2px 5px rgba(0,0,0,0.05);
    transform: rotate(-0.5deg);
    position: relative;
}

[data-theme="oldschool"][data-mode="light"] .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, transparent 100%);
    border-radius: 2px 2px 0 0;
}

/* Youth detail card - larger sticky note, straight */
[data-theme="oldschool"][data-mode="light"] .youth-detail-card {
    background: linear-gradient(135deg, #fff740 0%, #fffacd 100%) !important;
    transform: rotate(0deg);
}

/* Client sidebar - clean notebook look */
[data-theme="oldschool"][data-mode="light"] .client-sidebar,
[data-theme="oldschool"][data-mode="light"] .left-column .card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.15);
    transform: none;
}

/* Client list items - alternating sticky note colors */
[data-theme="oldschool"][data-mode="light"] .client-list-item,
[data-theme="oldschool"][data-mode="light"] .youth-list-item {
    background: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 100%);
    border-left: none;
    border-bottom: none;
    border-radius: 2px;
    margin-bottom: 4px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

[data-theme="oldschool"][data-mode="light"] .client-list-item:nth-child(even),
[data-theme="oldschool"][data-mode="light"] .youth-list-item:nth-child(even) {
    background: linear-gradient(135deg, #87ceeb 0%, #b0e0e6 100%);
}

[data-theme="oldschool"][data-mode="light"] .client-list-item:hover,
[data-theme="oldschool"][data-mode="light"] .youth-list-item:hover {
    transform: translateX(3px);
    box-shadow: 3px 3px 6px rgba(0,0,0,0.15);
}

[data-theme="oldschool"][data-mode="light"] .client-list-item.active,
[data-theme="oldschool"][data-mode="light"] .youth-list-item.active {
    background: linear-gradient(135deg, #fff740 0%, #fffacd 100%);
    border-left: 4px solid #cc5500;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
    transform: translateX(2px);
}

/* Case aide hours - pink sticky note */
[data-theme="oldschool"][data-mode="light"] .case-aide-hours {
    background: linear-gradient(135deg, #ff7eb9 0%, #ffb6c1 100%) !important;
    border: none;
    border-radius: 2px;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.15);
    transform: rotate(1deg);
    position: relative;
}

[data-theme="oldschool"][data-mode="light"] .case-aide-hours::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.06) 0%, transparent 100%);
    border-radius: 2px 2px 0 0;
}

/* Header - light neutral style */
[data-theme="oldschool"][data-mode="light"] .main-header {
    background: linear-gradient(180deg, #f5f0e6 0%, #e8e0d0 100%);
    border-bottom: 2px solid #c4a77d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

[data-theme="oldschool"][data-mode="light"] .main-header .page-title,
[data-theme="oldschool"][data-mode="light"] .main-header .header-nav a {
    color: #3d2b1f;
    text-shadow: none;
}

/* Navigation tabs - blue sticky note background */
[data-theme="oldschool"][data-mode="light"] .sub-nav-tabs {
    background: linear-gradient(135deg, #7afcff 0%, #87ceeb 100%) !important;
    border-bottom: none !important;
    padding: 1rem 2rem 0.5rem 2rem;
    border-radius: 2px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.15);
    transform: rotate(0.5deg);
    margin: 0 1rem 2rem 1rem;
}

[data-theme="oldschool"][data-mode="light"] .sub-nav-tab {
    background: rgba(255,255,255,0.7);
    border: none;
    border-radius: 4px;
    color: #1a4a6e;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

[data-theme="oldschool"][data-mode="light"] .sub-nav-tab:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
    color: #1a4a6e;
}

[data-theme="oldschool"][data-mode="light"] .sub-nav-tab.active {
    background: linear-gradient(135deg, #fff740 0%, #fffacd 100%);
    color: #3d2b1f;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    border: none;
}

/* Buttons - pencil/eraser style */
[data-theme="oldschool"][data-mode="light"] .btn-primary {
    background: linear-gradient(180deg, #ffd700 0%, #daa520 100%);
    color: #1a1a2e;
    border: 2px solid #b8860b;
    box-shadow: 2px 2px 0 #8b6914;
}

[data-theme="oldschool"][data-mode="light"] .btn-primary:hover {
    background: linear-gradient(180deg, #ffe44d 0%, #ffd700 100%);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #8b6914;
}

[data-theme="oldschool"][data-mode="light"] .btn-secondary {
    background: linear-gradient(180deg, #ffb6c1 0%, #ff69b4 100%);
    color: #4a1a2a;
    border: 2px solid #db7093;
}

/* Stat cards - index cards */
[data-theme="oldschool"][data-mode="light"] .stat-card {
    background: #ffffff;
    border: 1px solid #c4a77d;
    border-top: 8px solid #8b4513;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.15);
    transform: none;
    border-radius: 0;
}

[data-theme="oldschool"][data-mode="light"] .stat-card::before {
    display: none;
}

/* Welcome title - handwritten look */
[data-theme="oldschool"][data-mode="light"] .welcome-title {
    font-style: italic;
    color: #1a3009;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

/* ==========================================
   OLD SCHOOL DARK MODE - Dark Notebook Theme
   ========================================== */

/* Dark notebook paper background with light lines */
[data-theme="oldschool"][data-mode="dark"] body {
    background-color: #1a1714;
    background-image:
        linear-gradient(90deg, transparent 60px, #8b4513 60px, #8b4513 62px, transparent 62px),
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 23px,
            #3a5a7c 23px,
            #3a5a7c 24px
        );
    background-size: 100% 100%, 100% 24px;
    background-attachment: fixed;
}

/* Main content - dark paper with lines */
[data-theme="oldschool"][data-mode="dark"] .main-content {
    background-color: rgba(30, 28, 24, 0.9);
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 23px,
            #3a5a7c 23px,
            #3a5a7c 24px
        );
    background-size: 100% 24px;
    border-left: 3px solid #8b4513;
    margin-left: 40px;
    padding-left: 20px;
}

/* Cards - dark sticky notes */
[data-theme="oldschool"][data-mode="dark"] .card {
    background: linear-gradient(135deg, #8b7500 0%, #6b5a00 100%);
    border: none;
    border-radius: 2px;
    box-shadow:
        3px 3px 7px rgba(0,0,0,0.4),
        inset 0 -2px 5px rgba(0,0,0,0.2);
    transform: rotate(-0.5deg);
    position: relative;
}

[data-theme="oldschool"][data-mode="dark"] .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    border-radius: 2px 2px 0 0;
}

/* Youth detail card */
[data-theme="oldschool"][data-mode="dark"] .youth-detail-card {
    background: linear-gradient(135deg, #8b7500 0%, #6b5a00 100%) !important;
    transform: rotate(0deg);
}

/* Client sidebar - dark notebook */
[data-theme="oldschool"][data-mode="dark"] .client-sidebar,
[data-theme="oldschool"][data-mode="dark"] .left-column .card {
    background: #241f1a;
    border-radius: 8px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.3);
    transform: none;
}

/* Client list items - dark alternating sticky notes */
[data-theme="oldschool"][data-mode="dark"] .client-list-item,
[data-theme="oldschool"][data-mode="dark"] .youth-list-item {
    background: linear-gradient(135deg, #8b3a62 0%, #6b2a4a 100%);
    border-left: none;
    border-bottom: none;
    border-radius: 2px;
    margin-bottom: 4px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

[data-theme="oldschool"][data-mode="dark"] .client-list-item:nth-child(even),
[data-theme="oldschool"][data-mode="dark"] .youth-list-item:nth-child(even) {
    background: linear-gradient(135deg, #2a5a6b 0%, #1a4a5a 100%);
}

[data-theme="oldschool"][data-mode="dark"] .client-list-item:hover,
[data-theme="oldschool"][data-mode="dark"] .youth-list-item:hover {
    transform: translateX(3px);
    box-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

[data-theme="oldschool"][data-mode="dark"] .client-list-item.active,
[data-theme="oldschool"][data-mode="dark"] .youth-list-item.active {
    background: linear-gradient(135deg, #8b7500 0%, #6b5a00 100%);
    border-left: 4px solid #d4a574;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.4);
    transform: translateX(2px);
}

/* Case aide hours - dark pink sticky note */
[data-theme="oldschool"][data-mode="dark"] .case-aide-hours {
    background: linear-gradient(135deg, #8b3a62 0%, #6b2a4a 100%) !important;
    border: none;
    border-radius: 2px;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    transform: rotate(1deg);
}

/* Navigation tabs - dark pink sticky note */
[data-theme="oldschool"][data-mode="dark"] .sub-nav-tabs {
    background: linear-gradient(135deg, #8b3a62 0%, #6b2a4a 100%) !important;
    border-bottom: none !important;
    padding: 1rem 2rem 0.5rem 2rem;
    border-radius: 2px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
    transform: rotate(0.5deg);
    margin: 0 1rem 2rem 1rem;
}

[data-theme="oldschool"][data-mode="dark"] .sub-nav-tab {
    background: linear-gradient(135deg, #2a5a6b 0%, #1a4a5a 100%);
    border: none;
    border-radius: 4px;
    color: #c4b5a5;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

[data-theme="oldschool"][data-mode="dark"] .sub-nav-tab:hover {
    background: linear-gradient(135deg, #3a6a7b 0%, #2a5a6a 100%);
    transform: translateY(-2px);
    color: #f5e6d3;
}

[data-theme="oldschool"][data-mode="dark"] .sub-nav-tab.active {
    background: linear-gradient(135deg, #8b7500 0%, #6b5a00 100%);
    color: #f5e6d3;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    border: none;
}

/* Program icons - dark pencil style */
[data-theme="oldschool"][data-mode="dark"] .program-icon {
    background-color: #8b7500;
}
[data-theme="oldschool"][data-mode="dark"] .program-icon svg {
    color: #1a1714;
}

/* Stat cards - dark index cards */
[data-theme="oldschool"][data-mode="dark"] .stat-card {
    background: #241f1a;
    border: 1px solid #4a3f35;
    border-top: 8px solid #8b7355;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    transform: none;
    border-radius: 0;
}

[data-theme="oldschool"][data-mode="dark"] .stat-card::before {
    display: none;
}

/* Theme transition for smooth switching */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

/* Logo switching for light/dark modes */
.header-logo {
    content: url('images/youthnet-logo-dark-mode.png');
}

[data-mode="light"] .header-logo {
    content: url('images/youthnet-logo-light-mode.png');
}

/* Also handle login page logo */
.logo {
    content: url('images/youthnet-logo-dark-mode.png');
}

[data-mode="light"] .logo {
    content: url('images/youthnet-logo-light-mode.png');
}

/* ==========================================
   THEME PREFERENCES UI
   ========================================== */

.theme-mode-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--primary-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mode-switch {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mode-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.theme-preview-card {
    position: relative;
    background-color: var(--primary-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-preview-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-preview-card.active {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(244, 164, 96, 0.2);
}

.theme-preview-colors {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: #222222; /* Fixed neutral color so swatches are always visible */
}

.preview-swatch {
    flex: 1;
    height: 40px;
    border-radius: 4px;
}

/* Theme-specific preview colors (showing dark mode colors) */
.theme-preview-colors.default .preview-swatch:nth-child(1) { background-color: #111111; }
.theme-preview-colors.default .preview-swatch:nth-child(2) { background-color: #1a1a2e; }
.theme-preview-colors.default .preview-swatch:nth-child(3) { background-color: #4c506d; }
.theme-preview-colors.default .preview-swatch:nth-child(4) { background-color: #f4a460; }

.theme-preview-colors.ocean .preview-swatch:nth-child(1) { background-color: #0a1628; }
.theme-preview-colors.ocean .preview-swatch:nth-child(2) { background-color: #112240; }
.theme-preview-colors.ocean .preview-swatch:nth-child(3) { background-color: #1e88e5; }
.theme-preview-colors.ocean .preview-swatch:nth-child(4) { background-color: #00bcd4; }

.theme-preview-colors.oldschool .preview-swatch:nth-child(1) { background-color: #f5f0e1; }
.theme-preview-colors.oldschool .preview-swatch:nth-child(2) { background-color: #fffef7; }
.theme-preview-colors.oldschool .preview-swatch:nth-child(3) { background-color: #6b5344; }
.theme-preview-colors.oldschool .preview-swatch:nth-child(4) { background-color: #a67c52; }

.theme-preview-colors.bubblegum .preview-swatch:nth-child(1) { background-color: #1a0a14; }
.theme-preview-colors.bubblegum .preview-swatch:nth-child(2) { background-color: #2d1423; }
.theme-preview-colors.bubblegum .preview-swatch:nth-child(3) { background-color: #e91e63; }
.theme-preview-colors.bubblegum .preview-swatch:nth-child(4) { background-color: #ff80ab; }

.theme-preview-colors.creamsicle .preview-swatch:nth-child(1) { background-color: #1c1410; }
.theme-preview-colors.creamsicle .preview-swatch:nth-child(2) { background-color: #3d2618; }
.theme-preview-colors.creamsicle .preview-swatch:nth-child(3) { background-color: #ff7a2e; }
.theme-preview-colors.creamsicle .preview-swatch:nth-child(4) { background-color: #ffbe8a; }

.theme-preview-colors.cascadia .preview-swatch:nth-child(1) { background-color: #0a1612; }
.theme-preview-colors.cascadia .preview-swatch:nth-child(2) { background-color: #142420; }
.theme-preview-colors.cascadia .preview-swatch:nth-child(3) { background-color: #00a5b8; }
.theme-preview-colors.cascadia .preview-swatch:nth-child(4) { background-color: #3cb371; }

.theme-preview-colors.underworld .preview-swatch:nth-child(1) { background-color: #000000; }
.theme-preview-colors.underworld .preview-swatch:nth-child(2) { background-color: #1a0a0a; }
.theme-preview-colors.underworld .preview-swatch:nth-child(3) { background-color: #cc1a1a; }
.theme-preview-colors.underworld .preview-swatch:nth-child(4) { background-color: #ff6600; }

.theme-preview-colors.yellowjacket .preview-swatch:nth-child(1) { background-color: #000000; }
.theme-preview-colors.yellowjacket .preview-swatch:nth-child(2) { background-color: #111111; }
.theme-preview-colors.yellowjacket .preview-swatch:nth-child(3) { background-color: #ffd700; }
.theme-preview-colors.yellowjacket .preview-swatch:nth-child(4) { background-color: #ffffff; }

.theme-preview-colors.royalty .preview-swatch:nth-child(1) { background-color: #1a0a2e; }
.theme-preview-colors.royalty .preview-swatch:nth-child(2) { background-color: #2d1b4e; }
.theme-preview-colors.royalty .preview-swatch:nth-child(3) { background-color: #9b59b6; }
.theme-preview-colors.royalty .preview-swatch:nth-child(4) { background-color: #d4af37; }

.theme-preview-colors.sovietmcdonalds .preview-swatch:nth-child(1) { background-color: #330000; }
.theme-preview-colors.sovietmcdonalds .preview-swatch:nth-child(2) { background-color: #5c0000; }
.theme-preview-colors.sovietmcdonalds .preview-swatch:nth-child(3) { background-color: #ffc72c; }
.theme-preview-colors.sovietmcdonalds .preview-swatch:nth-child(4) { background-color: #ffda4d; }

.theme-preview-colors.matrix .preview-swatch:nth-child(1) { background-color: #FF0000; }
.theme-preview-colors.matrix .preview-swatch:nth-child(2) { background-color: #00FF00; }
.theme-preview-colors.matrix .preview-swatch:nth-child(3) { background-color: #0000FF; }
.theme-preview-colors.matrix .preview-swatch:nth-child(4) { background-color: #1a1a1a; }

.theme-preview-colors.thenextgeneration .preview-swatch:nth-child(1) { background-color: #000000; }
.theme-preview-colors.thenextgeneration .preview-swatch:nth-child(2) { background-color: #9999ff; }
.theme-preview-colors.thenextgeneration .preview-swatch:nth-child(3) { background-color: #cc99cc; }
.theme-preview-colors.thenextgeneration .preview-swatch:nth-child(4) { background-color: #ff9900; }

.theme-preview-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.theme-preview-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.theme-check {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    background-color: var(--accent-orange);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent, #fff);
}

.theme-preview-card.active .theme-check {
    display: flex;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
/* Sticky Header Wrapper - keeps header + nav fixed at top */
.sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header {
    background-color: var(--secondary-dark);
    border-bottom: 2px solid var(--accent-purple);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
}

.header-left {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
}

.header-left a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-logo {
    height: 50px;
    width: auto;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.header-logo:hover {
    opacity: 0.8;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1;
    padding-bottom: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile menu - hidden on desktop */
.mobile-menu-btn,
.mobile-nav-overlay {
    display: none;
}

/* Header Icon Buttons (Messages, etc.) */
.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary-dark);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.header-icon-btn:hover,
.header-icon-btn.active {
    background: var(--accent-purple);
    color: var(--text-on-accent, #fff);
}

.header-icon-btn svg {
    width: 20px;
    height: 20px;
}

.header-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent-orange);
    color: var(--text-on-accent, #fff);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =====================================================
   NOTIFICATIONS DROPDOWN
   ===================================================== */
.notifications-wrapper {
    position: relative;
}

.notifications-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.notifications-dropdown.open {
    display: flex;
    flex-direction: column;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.4);
}

.notifications-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notifications-mark-all {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.notifications-mark-all:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}

.notifications-loading,
.notifications-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.notification-item:hover {
    background: rgba(var(--accent-purple-rgb), 0.08);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(var(--accent-purple-rgb), 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-purple);
}

.notification-item.read {
    opacity: 0.7;
}

.notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(var(--accent-purple-rgb), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
}

.notification-icon svg {
    width: 16px;
    height: 16px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.notification-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.notification-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.notification-item:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.notifications-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
}

.notifications-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.notifications-footer a:hover {
    color: var(--text-primary);
}

/* Light mode notifications - use light backgrounds instead of dark overlay */
[data-mode="light"] .notifications-header,
[data-mode="light"] .notifications-footer {
    background: rgba(0, 0, 0, 0.06);
}

[data-mode="light"] .notifications-mark-all,
[data-mode="light"] .notifications-footer a {
    color: var(--text-muted);
}

[data-mode="light"] .notifications-mark-all:hover,
[data-mode="light"] .notifications-footer a:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.08);
}

/* Theme-specific notification styling for better contrast */
[data-theme="yellowjacket"][data-mode="dark"] .notifications-header,
[data-theme="yellowjacket"][data-mode="dark"] .notifications-footer {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .notifications-header,
[data-theme="sovietmcdonalds"][data-mode="dark"] .notifications-footer {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="royalty"][data-mode="dark"] .notifications-header,
[data-theme="royalty"][data-mode="dark"] .notifications-footer {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="underworld"][data-mode="dark"] .notifications-header,
[data-theme="underworld"][data-mode="dark"] .notifications-footer {
    background: rgba(0, 0, 0, 0.5);
}

/* Notification icon colors for themes with low-contrast accent colors */
[data-theme="yellowjacket"][data-mode="dark"] .notification-icon {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .notification-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-btn {
    background-color: var(--accent-purple);
    border: none;
    color: var(--text-on-accent);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.profile-btn:hover {
    background-color: var(--accent-purple-hover);
    transform: translateY(-2px);
}

.profile-btn svg {
    width: 20px;
    height: 20px;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--secondary-dark);
    border: 1px solid var(--accent-purple);
    border-radius: 8px;
    min-width: 250px;
    padding: 0.5rem 0;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 2500;
}

.profile-menu.show {
    display: block;
}

.profile-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-info strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.profile-info small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-menu hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0;
}

.profile-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
}

.profile-menu-item:hover {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

/* Navigation Tabs */
.nav-tabs {
    background-color: var(--secondary-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-tab:hover {
    color: var(--text-primary);
    background-color: rgba(var(--accent-purple-rgb), 0.2);
}

.nav-tab.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

/* Navigation Dropdown Menus */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-dropdown-btn:hover {
    color: var(--text-primary);
    background-color: rgba(var(--accent-purple-rgb), 0.2);
}

.nav-dropdown-btn.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

.nav-dropdown-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-btn svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 330px;
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-dropdown-item:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.3);
    border-left-color: var(--accent-purple);
}

.nav-dropdown-item.active {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    border-left-color: var(--accent-orange);
    color: var(--accent-orange);
}

.nav-dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0;
}

.nav-dropdown-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Secondary Navigation Tabs */
.sub-nav-tabs {
    background-color: var(--primary-dark);
    border-bottom: 2px solid var(--accent-purple);
    padding: 0.5rem 2rem 0 2rem;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sub-nav-tab {
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--secondary-dark);
    border: 2px solid var(--accent-purple);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-nav-tab:hover {
    background: var(--primary-dark);
    color: var(--accent-purple);
    transform: translateY(-2px);
}

.sub-nav-tab.active {
    background: var(--accent-purple);
    color: var(--text-on-accent);
    border-color: var(--accent-purple);
    box-shadow: 0 -2px 10px rgba(var(--accent-purple-rgb), 0.4);
}

.sub-nav-tab.active:hover {
    transform: none;
    color: var(--text-on-accent);
}

/* Mobile Sub-Nav - hidden by default, shown on mobile */
.mobile-sub-nav {
    display: none;
    margin-bottom: 1rem;
}

.mobile-sub-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--accent-purple);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.mobile-sub-nav-btn:hover {
    filter: brightness(1.1);
}

.mobile-sub-nav-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Overlay menu (like main hamburger menu) */
.mobile-sub-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.mobile-sub-nav.open .mobile-sub-nav-overlay {
    display: flex;
}

.mobile-sub-nav-menu {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: mobileSubNavFadeIn 0.2s ease-out;
}

@keyframes mobileSubNavFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mobile-sub-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-dark);
}

.mobile-sub-nav-header span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.mobile-sub-nav-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-sub-nav-close:hover {
    background: var(--secondary-dark);
    color: var(--text-primary);
}

.mobile-sub-nav-content {
    overflow-y: auto;
    max-height: calc(70vh - 50px);
}

.mobile-sub-nav-item {
    display: block;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.mobile-sub-nav-item:last-child {
    border-bottom: none;
}

.mobile-sub-nav-item:hover {
    background: var(--primary-dark);
}

.mobile-sub-nav-item.active {
    background: var(--accent-purple);
    color: var(--text-on-accent);
    font-weight: 600;
}

/* Client Detail Tabs - tighter styling for within cards */
.client-tabs-container {
    margin: 0;
    position: sticky;
    top: 60px;
    z-index: 100;
    background: var(--secondary-dark);
}

.client-tabs-container .sub-nav-tabs {
    margin-bottom: 0;
    padding: 0.5rem 1rem 0 1rem;
    background: var(--primary-dark);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--accent-purple);
}

/* Spacing for content after client tabs */
.client-tabs-container + .tab-actions,
.client-tabs-container + .card,
.client-tabs-container + .tab-content,
.client-tabs-container + div:not(.client-tabs-container),
.client-tabs-container + .case-info-section,
.client-tabs-container ~ .card:first-of-type {
    margin-top: 0.25rem;
}

/* Tab actions bar (buttons like Add Activity, Add Report) */
.tab-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--secondary-dark);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.client-tabs-container .sub-nav-tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    border: 2px solid var(--accent-purple);
    border-bottom: none;
    background: var(--secondary-dark);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-tabs-container .sub-nav-tab:hover {
    background: var(--primary-dark);
    color: var(--accent-purple);
    transform: none;
}

.client-tabs-container .sub-nav-tab.active {
    background: var(--accent-purple);
    color: var(--text-on-accent);
    border-color: var(--accent-purple);
    box-shadow: 0 -2px 8px rgba(var(--accent-purple-rgb), 0.3);
}

.client-tab-panel {
    margin-top: 1rem;
}

/* Dashboard Content Tabs - stylized tabs for switching content within a page */
.content-tabs-container {
    margin-bottom: 0;
}

.content-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem 1rem 0 1rem;
    background: var(--primary-dark);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--accent-purple);
    flex-wrap: wrap;
}

.content-tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    border: 2px solid var(--accent-purple);
    border-bottom: none;
    background: var(--secondary-dark);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.content-tab:hover {
    background: var(--primary-dark);
    color: var(--accent-purple);
    transform: translateY(-2px);
}

.content-tab.active {
    background: var(--accent-purple);
    color: var(--text-on-accent);
    border-color: var(--accent-purple);
    box-shadow: 0 -2px 8px rgba(var(--accent-purple-rgb), 0.3);
}

.content-tab.active:hover {
    transform: none;
    color: var(--text-on-accent);
}

/* Tab Content */
.tab-content {
    margin-top: 1rem;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--secondary-dark);
    padding: 1rem;
    border-radius: 8px;
}

.filters-left {
    flex: 0 0 auto;
}

.filters-right {
    display: flex;
    gap: 0.75rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    align-items: center;
}

/* Constrain custom dropdowns in filter bar */
.filters-right .custom-dropdown-wrapper {
    width: auto;
    min-width: 180px;
}

/* Search Box */
.search-box {
    position: relative;
    display: inline-block;
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 300px;
    transition: all 0.3s ease;
    text-indent: 1.35rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(var(--accent-purple-rgb), 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Filter Dropdowns - Native (hidden) */
.filter-dropdown {
    display: none;
}

/* Custom Dropdown Wrapper */
.custom-dropdown-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Custom Dropdown Display Button */
.custom-dropdown-display {
    width: 100%;
    padding: 0.75rem 0.875rem;
    padding-right: 2rem;
    background-color: var(--primary-dark);
    border: 1px solid var(--accent-purple);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.custom-dropdown-display:hover {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
    color: var(--text-on-accent);
}

.custom-dropdown-wrapper.open .custom-dropdown-display {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
    color: var(--text-on-accent);
}

/* Dropdown Arrow */
.dropdown-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.custom-dropdown-wrapper.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Custom Dropdown Options List */
.custom-dropdown-options {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    min-width: 100%;
    background-color: var(--primary-dark);
    border: 1px solid var(--accent-purple);
    border-radius: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 200px;
    display: none;
    z-index: 2100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.custom-dropdown-wrapper.open .custom-dropdown-options {
    display: block;
}

/* Custom Dropdown Option */
.custom-dropdown-option {
    padding: 0.5rem 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.custom-dropdown-option:hover {
    background-color: var(--secondary-dark);
}

.custom-dropdown-option.selected {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

/* Custom dropdowns - fixed positioning handled by JS for modal escape */
/* When open, JS sets fixed positioning - must override problematic CSS */
.custom-dropdown-wrapper.open .custom-dropdown-options {
    z-index: 99999;
    min-width: 0 !important; /* Override - 100% would mean viewport width with fixed positioning */
    max-width: none; /* Let JS control width */
    box-sizing: border-box;
    /* Width is set by JS based on button width */
}

/* Table Card */
.table-card {
    padding: 0;
    overflow-x: auto;
}

.table-card .data-table {
    margin: 0;
}

.no-data {
    text-align: center;
    padding: 3rem 1rem !important;
    color: var(--text-muted);
    font-style: italic;
}

.eligibility-row {
    cursor: pointer;
    background-color: var(--primary-dark);
}

.eligibility-row:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.15);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--secondary-dark);
    margin: 5% auto;
    border: 1px solid var(--accent-purple);
    border-radius: 12px;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-content.modal-sm {
    max-width: 400px;
}

.modal-content.modal-md {
    max-width: 550px;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 1rem 1.5rem;
    background-color: var(--primary-dark);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-left: 0.75rem;
    font-weight: normal;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.modal-title-group h2 {
    margin: 0;
}

.modal-title-divider {
    color: var(--border-color);
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0 0.75rem;
}

.modal-youth-name {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 500;
}

.modal-close,
.modal-close-btn {
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover,
.modal-close-btn:hover {
    color: var(--text-primary);
    background: var(--secondary-dark);
    border-color: var(--accent-purple);
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

/* Forms directly in modal-content need padding like modal-body */
.modal-content > form {
    padding: 1.25rem 1.5rem;
}

.modal-content > form .modal-footer {
    margin: 0 -1.5rem -1.25rem -1.5rem;
    padding: 1rem 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: var(--primary-dark);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-shrink: 0;
}

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

.details-table tr {
    border-bottom: 1px solid var(--border-color);
}

.details-table tr:last-child {
    border-bottom: none;
}

.detail-label {
    padding: 1rem 0;
    width: 40%;
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-value {
    padding: 1rem 0;
    color: var(--text-primary);
}

.detail-value.has-change {
    padding: 1rem;
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-value.changed {
    background-color: rgba(244, 164, 96, 0.2);
    padding: 1rem;
    border-radius: 4px;
}

/* Changes Section */
.changes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.change-item {
    padding: 1rem;
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--accent-orange);
}

.change-field {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.change-values {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.old-value {
    padding: 0.4rem 0.75rem;
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border-radius: 4px;
    text-decoration: line-through;
    font-size: 0.9rem;
}

.new-value {
    padding: 0.4rem 0.75rem;
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.arrow {
    color: var(--accent-orange);
    font-size: 1.1rem;
    font-weight: bold;
}

/* Upload Area */
.upload-description {
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.upload-area {
    border: 2px dashed var(--accent-purple);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background-color: rgba(var(--accent-purple-rgb), 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-color: var(--accent-purple-hover);
}

.upload-area.dragover {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    border-color: var(--accent-orange);
}

.upload-area svg {
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

.upload-area h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.upload-status {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 8px;
    background-color: rgba(var(--accent-purple-rgb), 0.1);
}

.upload-status .success {
    color: var(--success);
}

.upload-status .error {
    color: var(--error);
}

.upload-results {
    margin-top: 2rem;
    padding: 2rem;
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-radius: 12px;
}

.upload-results h3 {
    margin-top: 0;
    color: var(--accent-orange);
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.result-stat {
    padding: 1rem;
    background-color: var(--secondary-dark);
    border: 1px solid var(--accent-purple);
    border-radius: 8px;
    text-align: center;
}

.result-stat strong {
    display: block;
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.changes-list {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.changes-list li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--secondary-dark);
    border-left: 3px solid var(--accent-orange);
    border-radius: 4px;
}

/* Main Content */
.main-content {
    padding: 2rem;
    min-height: calc(100vh - 150px);
    overflow: visible;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container.container-wide {
    max-width: 1500px;
}

.container-full {
    max-width: 100%;
    padding: 0 2rem;
}

.container-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Cards */
.card {
    background-color: var(--card-bg, var(--secondary-dark));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Stats Grid - for resource categories and dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--card-bg, var(--secondary-dark));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-purple);
}

.stat-card .stat-icon {
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* Resource List Items */
.resource-list {
    margin-top: 0.5rem;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.resource-item:last-child {
    border-bottom: none;
}

.login-card {
    max-width: 450px;
    width: 100%;
}

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo {
    max-width: 200px;
    height: auto;
}

/* Typography */
h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--accent-orange);
}

ul {
    margin-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

ul li {
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.welcome-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.page-greeting {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: left;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(var(--accent-purple-rgb), 0.2);
}

input::placeholder {
    color: var(--text-muted);
}

small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Links - theme aware */
.link-primary {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-primary:hover {
    color: var(--accent-purple-hover);
    text-decoration: underline;
}

/* Data table links */
.data-table a {
    color: var(--link-color);
    text-decoration: none;
}

.data-table a:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

.btn:hover {
    background-color: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-purple-rgb), 0.3);
}

.btn-primary {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background-color: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-purple-rgb), 0.3);
}

.btn-accent {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

.btn-accent:hover {
    background-color: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-purple-rgb), 0.3);
}

.btn-secondary {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

.btn-secondary:hover {
    background-color: var(--accent-purple-hover);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-link {
    color: var(--accent-orange);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-link:hover {
    color: #ff9f4d;
    text-decoration: underline;
}

.btn-link.text-danger {
    color: #ef4444;
}

.btn-link.text-danger:hover {
    color: #f87171;
}

.btn-link.text-success {
    color: #10b981;
}

.btn-link.text-success:hover {
    color: #34d399;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn-link {
    margin-right: 0.5rem;
}

.actions-cell .btn-link:last-child {
    margin-right: 0;
}

.nowrap {
    white-space: nowrap;
}

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

.text-right {
    text-align: right;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-card {
    padding: 1.5rem;
}

.table-card .table-responsive {
    padding: 0;
}

.table-card .data-table {
    margin: 0;
    width: 100%;
}

/* Programs column - allow wrapping */
.programs-cell {
    max-width: 200px;
}

.program-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.program-badge-sm {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Actions cell - consistent width and alignment */
.actions-cell {
    white-space: nowrap;
    text-align: right;
    min-width: 140px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Messages */
.message {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.message.success {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: var(--success);
    color: #81c784;
}

.message.error {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: var(--error);
    color: #e57373;
}

/* Program Grid */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.program-card {
    background-color: var(--card-bg, var(--secondary-dark));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.program-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.program-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 80px;
    height: 80px;
    background-color: var(--accent-purple);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.program-icon svg {
    color: var(--accent-orange);
}

/* Oldschool light theme: pencil yellow background with dark icons */
[data-theme="oldschool"][data-mode="light"] .program-icon {
    background-color: #ffd700;
}
[data-theme="oldschool"][data-mode="light"] .program-icon svg {
    color: #3d2b1f;
}

/* Yellowjacket theme: black icons on yellow background */
[data-theme="yellowjacket"] .program-icon svg {
    color: #000000;
}

/* Yellowjacket theme: black text on yellow active filter chips */
[data-theme="yellowjacket"][data-mode="dark"] .filter-chip.active,
[data-theme="yellowjacket"][data-mode="dark"] .filter-chip:hover {
    color: #000000;
}

/* Yellowjacket theme: black checkmark on yellow checkbox */
[data-theme="yellowjacket"] .program-checkbox input[type="checkbox"]:checked::after,
[data-theme="yellowjacket"] .custom-checkbox input[type="checkbox"]:checked::after {
    border-color: #000000;
}

/* Yellowjacket light mode: same treatment */
[data-theme="yellowjacket"][data-mode="light"] .program-checkbox input[type="checkbox"]:checked::after,
[data-theme="yellowjacket"][data-mode="light"] .custom-checkbox input[type="checkbox"]:checked::after {
    border-color: #000000;
}

/* Yellowjacket theme: black initials on yellow avatar for readability */
[data-theme="yellowjacket"] .user-avatar-sm.user-initials,
[data-theme="yellowjacket"] .assignment-avatar,
[data-theme="yellowjacket"] .staff-avatar.initials-only span {
    color: #000000;
}

/* Underworld light (Overworld) theme: black initials on gold avatar for readability */
[data-theme="underworld"][data-mode="light"] .user-avatar-sm.user-initials,
[data-theme="underworld"][data-mode="light"] .assignment-avatar,
[data-theme="underworld"][data-mode="light"] .staff-avatar.initials-only span {
    color: #000000;
}

/* Royalty theme: black initials on gold avatar for readability */
[data-theme="royalty"] .user-avatar-sm.user-initials,
[data-theme="royalty"] .assignment-avatar,
[data-theme="royalty"] .staff-avatar.initials-only span {
    color: #000000;
}

/* Yellowjacket theme: black text on yellow active menu items for readability */
[data-theme="yellowjacket"] .ypm-mobile-item.active,
[data-theme="yellowjacket"] .mobile-sub-nav-item.active,
[data-theme="yellowjacket"] .mobile-nav-item.active,
[data-theme="yellowjacket"] .sub-nav-tab.active {
    color: #000000;
}

/* Underworld light theme: black text on gold active menu items */
[data-theme="underworld"][data-mode="light"] .ypm-mobile-item.active,
[data-theme="underworld"][data-mode="light"] .mobile-sub-nav-item.active,
[data-theme="underworld"][data-mode="light"] .mobile-nav-item.active,
[data-theme="underworld"][data-mode="light"] .sub-nav-tab.active {
    color: #000000;
}

/* Royalty theme: black text on gold active menu items */
[data-theme="royalty"] .ypm-mobile-item.active,
[data-theme="royalty"] .mobile-sub-nav-item.active,
[data-theme="royalty"] .mobile-nav-item.active,
[data-theme="royalty"] .sub-nav-tab.active {
    color: #000000;
}

/* Yellowjacket dark theme: input and dropdown contrast fixes */
[data-theme="yellowjacket"][data-mode="dark"] .user-filter-input:hover,
[data-theme="yellowjacket"][data-mode="dark"] .user-filter-input:focus {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .user-filter-input:hover::placeholder,
[data-theme="yellowjacket"][data-mode="dark"] .user-filter-input:focus::placeholder {
    color: #333333;
}

[data-theme="yellowjacket"][data-mode="dark"] .custom-dropdown-display:hover,
[data-theme="yellowjacket"][data-mode="dark"] .custom-dropdown-display:focus {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .search-input:hover,
[data-theme="yellowjacket"][data-mode="dark"] .search-input:focus {
    border-color: #ffd700;
}

[data-theme="yellowjacket"][data-mode="dark"] .search-input::placeholder {
    color: #666666;
}

/* Yellowjacket dark: form inputs in modals */
[data-theme="yellowjacket"][data-mode="dark"] .modal .form-input:focus,
[data-theme="yellowjacket"][data-mode="dark"] .modal select:focus {
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* Yellowjacket dark: select dropdowns - ensure dark background */
[data-theme="yellowjacket"][data-mode="dark"] select,
[data-theme="yellowjacket"][data-mode="dark"] .form-input[type="select"],
[data-theme="yellowjacket"][data-mode="dark"] select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Yellowjacket light theme: input and dropdown contrast fixes */
[data-theme="yellowjacket"][data-mode="light"] .user-filter-input:hover,
[data-theme="yellowjacket"][data-mode="light"] .user-filter-input:focus {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .user-filter-input:hover::placeholder,
[data-theme="yellowjacket"][data-mode="light"] .user-filter-input:focus::placeholder {
    color: #333333;
}

[data-theme="yellowjacket"][data-mode="light"] .custom-dropdown-display:hover,
[data-theme="yellowjacket"][data-mode="light"] .custom-dropdown-display:focus {
    color: #000000;
}

/* Yellowjacket light: select dropdowns */
[data-theme="yellowjacket"][data-mode="light"] select option {
    background-color: #ffffff;
    color: #000000;
}

/* Royalty dark theme: input contrast fixes (gold accent) */
[data-theme="royalty"][data-mode="dark"] .user-filter-input:hover,
[data-theme="royalty"][data-mode="dark"] .user-filter-input:focus {
    color: #000000;
}

[data-theme="royalty"][data-mode="dark"] .user-filter-input:hover::placeholder,
[data-theme="royalty"][data-mode="dark"] .user-filter-input:focus::placeholder {
    color: #333333;
}

[data-theme="royalty"][data-mode="dark"] .custom-dropdown-display:hover,
[data-theme="royalty"][data-mode="dark"] .custom-dropdown-display:focus {
    color: #000000;
}

/* Yellowjacket dark theme: messaging overrides */
[data-theme="yellowjacket"][data-mode="dark"] .conversation-item.active {
    background: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .conversation-item.active .conversation-name,
[data-theme="yellowjacket"][data-mode="dark"] .conversation-item.active .conversation-last-message,
[data-theme="yellowjacket"][data-mode="dark"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="yellowjacket"][data-mode="dark"] .conversation-avatar-small {
    background: linear-gradient(135deg, #ffd700, #ffea00);
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .message-wrapper.outgoing .message-bubble {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="yellowjacket"][data-mode="dark"] .message-wrapper.outgoing .message-seen {
    color: #1a5c1a;
}

[data-theme="yellowjacket"][data-mode="dark"] .conversation-item .unread-badge {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .header-badge {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .header-icon-btn:hover,
[data-theme="yellowjacket"][data-mode="dark"] .header-icon-btn.active {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #ffd700, #ffea00);
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .group-badge {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="dark"] .message-avatar {
    background: linear-gradient(135deg, #ffd700, #ffea00);
    color: #000000;
}

/* Yellowjacket light theme: messaging overrides */
[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active {
    background: linear-gradient(135deg, #ffc107, #ffca28);
}

[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .conversation-avatar-small {
    background: linear-gradient(135deg, #ffc107, #ffca28);
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .message-wrapper.outgoing .message-bubble {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="yellowjacket"][data-mode="light"] .message-wrapper.outgoing .message-seen {
    color: #1a5c1a;
}

[data-theme="yellowjacket"][data-mode="light"] .conversation-item .unread-badge {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .header-badge {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .header-icon-btn:hover,
[data-theme="yellowjacket"][data-mode="light"] .header-icon-btn.active {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #ffc107, #ffca28);
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .group-badge {
    color: #000000;
}

[data-theme="yellowjacket"][data-mode="light"] .message-avatar {
    background: linear-gradient(135deg, #ffc107, #ffca28);
    color: #000000;
}

/* Royalty dark theme: messaging overrides for gold accents */
[data-theme="royalty"][data-mode="dark"] .conversation-item.active {
    background: linear-gradient(135deg, #d4af37, #e6c558);
}

[data-theme="royalty"][data-mode="dark"] .conversation-item.active .conversation-name,
[data-theme="royalty"][data-mode="dark"] .conversation-item.active .conversation-last-message,
[data-theme="royalty"][data-mode="dark"] .conversation-item.active .conversation-time {
    color: #1a0a2e;
}

[data-theme="royalty"][data-mode="dark"] .conversation-avatar-small {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
}

[data-theme="royalty"][data-mode="dark"] .message-wrapper.outgoing .message-bubble {
    color: #1a0a2e;
}

[data-theme="royalty"][data-mode="dark"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(26, 10, 46, 0.7);
}

[data-theme="royalty"][data-mode="dark"] .message-wrapper.outgoing .message-seen {
    color: #0d3d0d;
}

[data-theme="royalty"][data-mode="dark"] .conversation-item .unread-badge {
    color: #1a0a2e;
}

[data-theme="royalty"][data-mode="dark"] .header-badge {
    color: #1a0a2e;
}

[data-theme="royalty"][data-mode="dark"] .header-icon-btn:hover,
[data-theme="royalty"][data-mode="dark"] .header-icon-btn.active {
    color: #1a0a2e;
}

[data-theme="royalty"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
}

/* Royalty light theme: messaging overrides for gold accents */
[data-theme="royalty"][data-mode="light"] .conversation-item.active {
    background: linear-gradient(135deg, #c9a227, #d4af37);
}

[data-theme="royalty"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="royalty"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="royalty"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #2c1b3d;
}

[data-theme="royalty"][data-mode="light"] .conversation-avatar-small {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
}

[data-theme="royalty"][data-mode="light"] .message-wrapper.outgoing .message-bubble {
    color: #2c1b3d;
}

[data-theme="royalty"][data-mode="light"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(44, 27, 61, 0.7);
}

[data-theme="royalty"][data-mode="light"] .message-wrapper.outgoing .message-seen {
    color: #0d3d0d;
}

[data-theme="royalty"][data-mode="light"] .conversation-item .unread-badge {
    color: #2c1b3d;
}

[data-theme="royalty"][data-mode="light"] .header-badge {
    color: #2c1b3d;
}

[data-theme="royalty"][data-mode="light"] .header-icon-btn:hover,
[data-theme="royalty"][data-mode="light"] .header-icon-btn.active {
    color: #2c1b3d;
}

[data-theme="royalty"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
}

[data-theme="royalty"][data-mode="dark"] .group-badge,
[data-theme="royalty"][data-mode="light"] .group-badge {
    color: #1a0a2e;
}

[data-theme="royalty"][data-mode="dark"] .message-avatar,
[data-theme="royalty"][data-mode="light"] .message-avatar {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
}

/* Underworld light (Overworld) theme: messaging overrides for gold accents */
[data-theme="underworld"][data-mode="light"] .conversation-item.active {
    background: linear-gradient(135deg, #d4a017, #e6b422);
}

[data-theme="underworld"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="underworld"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="underworld"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .conversation-avatar-small {
    background: linear-gradient(135deg, #d4a017, #e6b422);
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .message-bubble {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(61, 48, 32, 0.7);
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .message-seen {
    color: #1a4a1a;
}

[data-theme="underworld"][data-mode="light"] .conversation-item .unread-badge {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .header-badge {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .header-icon-btn:hover,
[data-theme="underworld"][data-mode="light"] .header-icon-btn.active {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #d4a017, #e6b422);
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .group-badge {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .message-avatar {
    background: linear-gradient(135deg, #d4a017, #e6b422);
    color: #3d3020;
}

/* Soviet McDonalds dark theme: messaging overrides for yellow accents */
[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-item.active .conversation-name,
[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-item.active .conversation-last-message,
[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-item.active .conversation-time {
    color: #330000;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-avatar-small {
    background: linear-gradient(135deg, #cc0000, #990000);
    color: #ffc72c;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .message-wrapper.outgoing .message-bubble {
    color: #330000;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(51, 0, 0, 0.7);
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .message-wrapper.outgoing .message-seen {
    color: #1a4a1a;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-item .unread-badge {
    color: #330000;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .header-badge {
    color: #330000;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .header-icon-btn:hover,
[data-theme="sovietmcdonalds"][data-mode="dark"] .header-icon-btn.active {
    color: #330000;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #cc0000, #990000);
    color: #ffc72c;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .group-badge {
    color: #330000;
}

[data-theme="sovietmcdonalds"][data-mode="dark"] .message-avatar {
    background: linear-gradient(135deg, #cc0000, #990000);
    color: #ffc72c;
}

/* Matrix theme: black text on green outgoing bubbles */
[data-theme="matrix"][data-mode="dark"] .message-wrapper.outgoing .message-bubble {
    color: #ffffff;
}

[data-theme="matrix"][data-mode="dark"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="matrix"][data-mode="dark"] .message-wrapper.outgoing .message-seen {
    color: #aaaaaa;
}

[data-theme="matrix"][data-mode="dark"] .conversation-item .unread-badge {
    color: #000000;
}

[data-theme="matrix"][data-mode="dark"] .header-badge {
    color: #000000;
}

[data-theme="matrix"][data-mode="dark"] .header-icon-btn:hover,
[data-theme="matrix"][data-mode="dark"] .header-icon-btn.active {
    color: #000000;
}

[data-theme="matrix"][data-mode="dark"] .message-avatar {
    background: #0000FF;
    color: #ffffff;
}

[data-theme="matrix"][data-mode="dark"] .group-badge {
    color: #000000;
}

/* Matrix light mode: dark text on light green bubbles */
[data-theme="matrix"][data-mode="light"] .message-wrapper.outgoing .message-bubble {
    color: #ffffff;
}

[data-theme="matrix"][data-mode="light"] .message-wrapper.outgoing .message-bubble .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Royalty theme: white icons on gold background */
[data-theme="royalty"] .program-icon svg {
    color: #ffffff;
}

/* Cascadia theme: white icons on aqua background */
[data-theme="cascadia"] .program-icon svg {
    color: #ffffff;
}

/* Soviet McDonalds theme: red icons on yellow background */
[data-theme="sovietmcdonalds"] .program-icon svg {
    color: #cc0000;
}

/* Soviet McDonalds theme: black text on yellow active filter chips */
[data-theme="sovietmcdonalds"][data-mode="dark"] .filter-chip.active,
[data-theme="sovietmcdonalds"][data-mode="dark"] .filter-chip:hover {
    color: #000000;
}

/* Soviet McDonalds dark mode: dark checkmark on yellow checkbox */
[data-theme="sovietmcdonalds"][data-mode="dark"] .program-checkbox input[type="checkbox"]:checked::after,
[data-theme="sovietmcdonalds"][data-mode="dark"] .custom-checkbox input[type="checkbox"]:checked::after {
    border-color: #330000;
}

/* Soviet McDonalds dark: add missing active background */
[data-theme="sovietmcdonalds"][data-mode="dark"] .conversation-item.active {
    background: #1a0000;
}

/* ==========================================
   MODAL MOBILE RESPONSIVE FIXES
   Override inline grid styles for all modals
   ========================================== */
@media (max-width: 768px) {
    /* General modal fullscreen on mobile */
    .modal-content.modal-large,
    .modal-content.modal-medium,
    #editHousingModal .modal-content,
    #actionPlanModal .modal-content,
    #addCLSAModal .modal-content,
    #supportFundModal .modal-content,
    #addILNoteModal .modal-content,
    #addNoteModal .modal-content,
    #activityModal .modal-content,
    #addClientModal .modal-content {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal .modal-body {
        overflow-x: hidden;
    }

    /* IYHP Housing Modal - override inline grids */
    #editHousingModal div[style*="grid-template-columns"],
    #editHousingModal div[style*="display: grid"],
    #editHousingModal div[style*="display:grid"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* IYHP Action Plan Modal */
    #actionPlanModal div[style*="grid-template-columns"],
    #actionPlanModal div[style*="display: grid"],
    #actionPlanModal div[style*="display:grid"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* IL Support Fund View Modal (JS-generated) */
    #viewSupportFundContent > div[style*="grid-template-columns"],
    #viewSupportFundContent > div[style*="display: grid"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    /* IL CLSA Modal - 3 column form rows */
    #addCLSAModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* IL Note Modal */
    #addILNoteModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* IL Support Fund Modal */
    #supportFundModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* IYHP Note Modal */
    #addNoteModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Case Info Grid (CSP/Lifeset client pages) */
    .case-info-grid,
    .case-info-grid[style*="grid-template-columns"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    /* Activity Modal */
    #activityModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Add Client Modal */
    #addClientModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Task Modal */
    #taskModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Outreach Modal */
    #outreachModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Compliance Modal */
    #complianceModal .form-row,
    #complianceItemModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Red Flag Modal */
    #addRedFlagModal .form-row,
    #resolveRedFlagModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Lifeset Report Modal */
    #addReportModal .form-row,
    #editClientModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Form actions - wrap buttons */
    .modal .form-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal .form-actions .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* Extra small screens - stack everything */
@media (max-width: 480px) {
    /* Case info grid single column on very small screens */
    .case-info-grid,
    .case-info-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* View support fund - single column */
    #viewSupportFundContent > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Full width buttons */
    .modal .form-actions .btn {
        width: 100%;
        min-width: 100%;
    }
}

/* ==========================================
   GLOBAL MOBILE RESPONSIVE FIXES
   Dashboard controls, info grids, widgets
   ========================================== */
@media (max-width: 768px) {
    /* Dashboard Controls - stack and wrap properly */
    .dashboard-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .dashboard-controls > div,
    .dashboard-controls-left,
    .dashboard-controls-right {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    /* Nested flex containers inside dashboard controls */
    .dashboard-controls div[style*="display: flex"],
    .dashboard-controls div[style*="display:flex"] {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .dashboard-controls .search-box {
        width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .dashboard-controls .search-input {
        width: 100% !important;
    }

    .dashboard-controls .btn {
        flex: 1 1 auto !important;
        min-width: 120px;
        justify-content: center;
        text-align: center;
    }

    .dashboard-controls select.form-input {
        flex: 1 1 auto !important;
        min-width: 100px;
        max-width: 100%;
    }

    /* Ensure form inputs don't overflow */
    .dashboard-controls .form-input {
        max-width: 100%;
    }

    /* Support Funds Widgets - 2 columns on tablet */
    .support-funds-widgets,
    .support-funds-widgets[style*="grid-template-columns"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    /* Case Info Grids - 2 columns on tablet */
    .case-info-grid,
    .case-info-grid[style*="grid-template-columns"],
    .brs-info-grid,
    .brs-info-grid[style*="grid-template-columns"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    /* Summary card grids with inline 4-column styles */
    div[style*="repeat(4, 1fr)"],
    div[style*="repeat(3, 1fr)"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    /* Result summary grids */
    .result-summary[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Stat cards and widgets - ensure they don't overflow */
    .stat-card,
    .case-aide-hours,
    .card {
        min-width: 0;
        overflow: hidden;
    }

    /* Compact text in widgets on mobile */
    .case-aide-hours h3 {
        font-size: 0.9rem !important;
    }

    .case-aide-hours .hours-info {
        font-size: 0.85rem;
    }

    /* Tab actions row - wrap buttons */
    .tab-actions {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .tab-actions .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* Extra small screens - single column everything */
@media (max-width: 480px) {
    /* Support Funds Widgets - single column */
    .support-funds-widgets,
    .support-funds-widgets[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Case Info Grids - single column */
    .case-info-grid,
    .case-info-grid[style*="grid-template-columns"],
    .brs-info-grid,
    .brs-info-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* All inline grids - single column */
    div[style*="repeat(4, 1fr)"],
    div[style*="repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    .result-summary[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Dashboard controls - full width buttons */
    .dashboard-controls .btn {
        width: 100%;
        min-width: 100%;
    }

    .dashboard-controls select.form-input {
        width: 100%;
    }

    /* Lifetime limits inner grid - single column */
    .case-aide-hours div[style*="repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   RESPONSIVE TABLE - CARD LAYOUT ON MOBILE
   Transform data tables to card layout
   ========================================== */
@media (max-width: 768px) {
    /* Users table and similar admin tables - card layout */
    .table-card .table-responsive {
        overflow-x: visible;
    }

    .table-card .data-table thead {
        display: none;
    }

    .table-card .data-table,
    .table-card .data-table tbody {
        display: block;
        width: 100%;
    }

    .table-card .data-table tr {
        display: block;
        background: var(--primary-dark);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 1rem;
        position: relative;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

    .table-card .data-table tr:hover {
        border-color: var(--accent-primary);
    }

    .table-card .data-table tr.inactive-row {
        opacity: 0.6;
    }

    .table-card .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
        min-height: 2rem;
    }

    .table-card .data-table td:last-child {
        border-bottom: none;
    }

    /* Add labels before each cell using data attributes */
    .table-card .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        flex-shrink: 0;
        margin-right: 1rem;
        font-size: 0.85rem;
    }

    /* Hide label for cells without data-label or empty data-label */
    .table-card .data-table td[data-label=""]::before {
        display: none;
    }

    /* Name cell - make it prominent at top */
    .table-card .data-table td:first-child {
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 0.75rem;
        margin-bottom: 0.25rem;
        font-weight: 600;
        font-size: 1.15rem !important;
    }

    .table-card .data-table td:first-child a,
    .table-card .data-table td:first-child span,
    .table-card .data-table td[data-label=""] a {
        font-size: 1.15rem !important;
        font-weight: 600 !important;
        color: var(--accent-orange);
    }

    .table-card .data-table td:first-child::before {
        display: none;
    }

    .table-card .data-table .user-name-cell {
        width: 100%;
        justify-content: flex-start;
    }

    .table-card .data-table .user-name-cell .user-avatar-sm {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Actions cell - special styling */
    .table-card .data-table .actions-cell {
        justify-content: flex-end;
        gap: 1rem;
        padding-top: 0.75rem;
        margin-top: 0.25rem;
        border-top: 1px solid var(--border-color);
        border-bottom: none !important;
    }

    .table-card .data-table .actions-cell::before {
        display: none;
    }

    .table-card .data-table .actions-cell .btn-link,
    .table-card .data-table .actions-cell a.btn-link,
    .table-card .data-table .actions-cell button.btn-link,
    .table-card .data-table .actions-cell a {
        padding: 0.5rem 1rem;
        background: var(--bg-secondary);
        border-radius: 6px;
        font-weight: 500;
        font-size: 0.9rem;
        text-decoration: none;
        display: inline-block;
    }

    /* Role and status badges */
    .table-card .data-table .role-badge,
    .table-card .data-table .status-badge {
        margin-left: auto;
    }

    /* Ensure nowrap cells can wrap on mobile */
    .table-card .data-table td.nowrap {
        white-space: normal;
        word-break: break-word;
    }

    /* Programs cell on mobile */
    .table-card .data-table .programs-cell {
        max-width: none;
    }

    .table-card .data-table .programs-cell .program-badges-inline {
        justify-content: flex-end;
    }

    /* Text alignment fixes */
    .table-card .data-table td.text-center {
        text-align: right;
    }

    /* Hide columns marked as mobile-hidden */
    .table-card .data-table td.mobile-hidden {
        display: none !important;
    }

    /* Email Alerts action buttons */
    .table-card .data-table .action-btns {
        display: flex;
        gap: 0.75rem;
        justify-content: flex-end;
    }

    .table-card .data-table .action-btn {
        padding: 0.5rem 1rem;
        border-radius: 6px;
        font-weight: 500;
        font-size: 0.9rem;
    }

    /* Delivery badges layout */
    .table-card .data-table .delivery-badges {
        justify-content: flex-end;
    }

    /* Tables without data-labels - show column headers inline */
    .table-card .data-table td:not([data-label])::before,
    .table-card .data-table td[data-label=""]::before {
        content: none;
    }

    /* Progress bars and complex content in cards */
    .table-card .data-table .hours-progress-mini,
    .table-card .data-table .progress-bar-mini {
        width: 100%;
    }

    /* Outreach timeline in cards - hide overflow, no scrollbar needed */
    .table-card .data-table .outreach-timeline-card {
        max-width: 100%;
        overflow: hidden;
    }

    .table-card .data-table .outreach-timeline {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    /* Action buttons in cards */
    .table-card .data-table .action-buttons {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }

    .table-card .data-table .btn-icon {
        padding: 0.5rem;
        background: var(--bg-secondary);
        border-radius: 6px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 6px;
    border: 2px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple-hover);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-purple) var(--scrollbar-track);
}

/* ==========================================
   LIFESET PROGRAM STYLES
   ========================================== */

/* Cycle color orbs */
.cycle-orb {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.cycle-orb.purple { background-color: #9c27b0; }
.cycle-orb.yellow { background-color: #fdd835; }
.cycle-orb.green { background-color: #4caf50; }
.cycle-orb.blue { background-color: #2196f3; }

/* Red flag icon */
.red-flag {
    color: #f44336;
    font-weight: bold;
    margin-left: 8px;
}

/* Dashboard specific styles */
.dashboard-table-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.dashboard-tab {
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
}

.dashboard-tab:hover {
    color: var(--text-primary);
    background-color: rgba(var(--accent-purple-rgb), 0.1);
}

.dashboard-tab.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.dashboard-controls-left {
    flex: 0 0 auto;
}

.dashboard-controls-right {
    flex: 0 0 auto;
}

.cycle-dropdown {
    min-width: 200px;
    width: auto;
}

/* Clients page styles */
.clients-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - 220px);
    transition: grid-template-columns 0.3s ease;
    align-items: start;
}

.clients-layout.sidebar-hidden {
    grid-template-columns: 0px 1fr;
}

.client-sidebar {
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: calc(100vh - 110px);
}

#clientList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.client-sidebar.hidden {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

.toggle-sidebar-btn {
    position: fixed;
    bottom: 2rem;
    left: calc(350px + 2rem + 1.5rem + 20px);
    z-index: 1000;
    padding: 0.75rem 1rem;
    background-color: var(--accent-purple);
    border: none;
    border-radius: 8px;
    color: var(--text-on-accent);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(var(--accent-purple-rgb), 0.3);
}

.toggle-sidebar-btn.sidebar-hidden {
    left: calc(2rem + 20px);
}

.toggle-sidebar-btn:hover {
    background-color: var(--accent-purple-hover);
    box-shadow: 0 6px 16px rgba(var(--accent-purple-rgb), 0.4);
}

.sidebar-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar-search {
    flex: 1;
}

.btn-toggle-sidebar {
    padding: 0.75rem;
    background-color: var(--accent-purple);
    border: none;
    border-radius: 8px;
    color: var(--text-on-accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-toggle-sidebar:hover {
    background-color: var(--accent-purple-hover);
}

.filter-toggle-btn {
    padding: 0.75rem 1rem;
    background-color: var(--accent-purple);
    border: none;
    border-radius: 8px;
    color: var(--text-on-accent);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-toggle-btn:hover {
    background-color: var(--accent-purple-hover);
}

.filter-panel {
    background-color: var(--primary-dark);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.filter-panel.show {
    display: block;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.client-list-item {
    padding: 0.75rem 1rem;
    background-color: var(--primary-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    margin-bottom: 0.5rem;
}

.client-list-item:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-left-color: var(--accent-purple);
}

.client-list-item.active {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    border-left-color: var(--accent-orange);
}

.client-name-display {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.client-status-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.add-client-btn-bottom {
    width: 100%;
    flex-shrink: 0;
}

/* Client detail view */
.client-detail-container {
    overflow-y: visible;
    padding-top: 4px;
}

/* Clickable table rows */
#clientsTableBody tr {
    cursor: pointer;
}

#clientsTableBody tr:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.2) !important;
}

.client-detail-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-detail-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.client-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Accordion Table Styles */
.accordion-table .accordion-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.accordion-table .accordion-row:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.05);
}

.accordion-table .accordion-row.expanded {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-bottom: none;
}

.accordion-toggle {
    background: rgba(var(--accent-purple-rgb), 0.1);
    border: 1px solid rgba(var(--accent-purple-rgb), 0.3);
    color: var(--accent-purple);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.accordion-toggle:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    border-color: var(--accent-purple);
    transform: scale(1.05);
}

.accordion-toggle svg {
    transition: transform 0.2s ease;
    width: 20px;
    height: 20px;
}

.accordion-row.expanded .accordion-toggle {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

/* Themes with light accent colors need black text on expanded accordion */
[data-theme="yellowjacket"] .accordion-row.expanded .accordion-toggle,
[data-theme="royalty"] .accordion-row.expanded .accordion-toggle,
[data-theme="sovietmcdonalds"][data-mode="dark"] .accordion-row.expanded .accordion-toggle {
    color: #000000;
}

.accordion-row.expanded .accordion-toggle svg {
    transform: rotate(180deg);
}

.accordion-details {
    display: none;
    background-color: var(--primary-dark);
    border-bottom: 1px solid var(--border-color);
}

.accordion-details.show {
    display: table-row;
}

.accordion-details-content {
    padding: 1.25rem 1.5rem;
}

.accordion-section {
    margin-bottom: 1.25rem;
}

.accordion-section:last-of-type {
    margin-bottom: 1rem;
}

.accordion-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.accordion-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.accordion-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.accordion-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accordion-field-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.accordion-field-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

.accordion-field-value.full-width {
    grid-column: 1 / -1;
}

.accordion-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.accordion-actions-left {
    display: flex;
    gap: 0.5rem;
}

.accordion-actions-right {
    display: flex;
    gap: 0.5rem;
}

/* Action buttons container for table cells */
.action-buttons {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

/* Accordion button (expand/collapse in tables) */
.accordion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(var(--accent-purple-rgb), 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.accordion-btn:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.15);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.accordion-btn svg {
    transition: transform 0.2s ease;
}

.accordion-row.expanded .accordion-btn svg,
tr.expanded .accordion-btn svg {
    transform: rotate(180deg);
}

/* Accordion content rows (hidden by default) */
.accordion-content {
    display: none;
    background-color: var(--primary-dark);
}

.accordion-content.show {
    display: table-row;
}

.accordion-content td {
    padding: 1rem 1.5rem;
    border-top: none;
}

/* CLSA details grid */
.clsa-details h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.clsa-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.clsa-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--secondary-dark);
    border-radius: 6px;
}

.clsa-score-item .score-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.clsa-score-item .score-value {
    font-weight: 600;
    color: var(--accent-primary);
}

.clsa-score-item .score-value.score-low {
    color: var(--warning);
}

/* Note full content in accordion */
.note-full-content {
    padding: 0.5rem 0;
}

.note-full-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.famlink-format {
    background: var(--secondary-dark);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Smaller btn-icon variant for tables with multiple actions */
.action-buttons .btn-icon {
    width: 32px;
    height: 32px;
}

.action-buttons .btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(var(--accent-purple-rgb), 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.15);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    transform: scale(1.02);
}

.btn-icon.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-icon.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: scale(1.02);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Accordion action buttons - larger styling */
.accordion-actions .btn-icon {
    width: 44px;
    height: 44px;
}

.accordion-actions .btn-icon svg {
    width: 22px;
    height: 22px;
}

.accordion-actions .btn.btn-secondary {
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
}

.accordion-actions .btn.btn-secondary svg {
    width: 18px;
    height: 18px;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-with-icon svg {
    width: 18px;
    height: 18px;
}

/* Document upload */
.upload-btn-area {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Button colors */
.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #38bdf8;
    color: white;
}

.btn-info:hover {
    background-color: #0ea5e9;
}

/* Collateral contact spacing */
.collateral-contact-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(var(--accent-purple-rgb), 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.add-contact-btn-wrapper {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Biological Parents Section */
.bio-parent-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: rgba(var(--accent-purple-rgb), 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

.bio-parent-item .bio-parent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.bio-parent-item .bio-parent-relationship {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bio-parent-item .bio-parent-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.bio-parent-item .bio-parent-remove:hover {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
}

.bio-parent-item .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.bio-parent-item .form-group {
    margin-bottom: 0.5rem;
}

.bio-parent-item .form-group label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.bio-parent-item .form-input {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .bio-parent-item .form-row {
        grid-template-columns: 1fr;
    }
}

/* Make modal scrollable */
.modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto !important;
}

/* Hide page-level mobile nav when modal is open */
.modal[style*="display: block"] ~ .mobile-sub-nav,
body:has(.modal[style*="display: block"]) .mobile-sub-nav {
    display: none !important;
}

.modal-content {
    max-height: 85vh !important;
    margin: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
}

.modal-header {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
}

.modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1;
    padding: 1rem 1.5rem;
    min-height: 0;
}

/* For large modals */
.modal-large .modal-content {
    max-width: 900px !important;
}

/* More compact form spacing */
.modal-body .form-group {
    margin-bottom: 0.5rem;
}

.modal-body .form-row {
    gap: 0.5rem;
}

.modal-body h3.section-title {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
}

/* Extra compact for schedule event modal */
#scheduleEventModal .form-group {
    margin-bottom: 0.4rem;
}

#scheduleEventModal .form-group label {
    margin-bottom: 0.2rem;
}

#scheduleEventModal .form-input,
#scheduleEventModal .form-select {
    padding: 0.45rem 0.6rem;
}

.modal-body .collateral-contact-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.modal-body textarea.form-input {
    min-height: 60px;
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem !important;
}

.sortable:hover {
    background: linear-gradient(135deg, var(--gradient-active-start) 0%, var(--gradient-active-end) 100%);
}

.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.75rem;
    opacity: 0.5;
    font-size: 0.9rem;
}

.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

/* Reports Page Styles */
.report-section {
    margin-top: 1.5rem;
    overflow-x: auto;
}

.report-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.report-controls .search-box {
    flex: 1;
    min-width: 250px;
}

.date-range-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background-color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.date-range-filter label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.date-range-filter .form-input {
    width: 150px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Mobile: Stack report controls and date range filter */
@media (max-width: 768px) {
    .report-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .report-controls .search-box {
        min-width: unset;
        width: 100%;
    }

    .date-range-filter {
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .date-range-filter label {
        font-size: 0.85rem;
    }

    .date-range-filter .form-input {
        width: calc(50% - 2rem);
        min-width: 100px;
        flex: 1;
    }

    .date-range-filter .btn {
        width: 100%;
        margin-top: 0.25rem;
    }

    .report-controls > .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .date-range-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-filter label {
        margin-bottom: -0.25rem;
    }

    .date-range-filter .form-input {
        width: 100%;
    }
}

.sort-indicator {
    margin-left: 0.5rem;
    opacity: 0.5;
    font-size: 0.9rem;
    user-select: none;
}

.data-table th {
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    background: linear-gradient(135deg, var(--gradient-end) 0%, var(--accent-purple-hover) 100%);
}

/* Youth name links in tables */
.youth-name-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.youth-name-link:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

/* Youth Actions */
.youth-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.youth-actions .btn {
    display: flex;
    align-items: center;
}

/* Youth Profile Modal */
.modal-xlarge {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-xlarge .modal-body {
    padding: 1rem 1.5rem 2rem 1.5rem;
}

/* Add extra padding at the bottom of profile tab content for dropdowns */
.profile-tab-content {
    padding-bottom: 1.5rem;
}

/* Staff Assignment section needs extra space at bottom */
.profile-tab-content .form-row:last-child {
    margin-bottom: 1rem;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

/* Mobile: hide scrollbar but keep functionality */
@media (max-width: 768px) {
    .profile-tabs {
        gap: 0.25rem;
        padding-bottom: 0.5rem;
        margin-bottom: 0.75rem;
        /* Fade effect to indicate more tabs */
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }

    .profile-tabs::-webkit-scrollbar {
        height: 3px;
    }

    .profile-tabs::-webkit-scrollbar-track {
        background: var(--border-color);
        border-radius: 2px;
    }

    .profile-tabs::-webkit-scrollbar-thumb {
        background: var(--accent-purple);
        border-radius: 2px;
    }
}

.profile-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

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

.profile-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

/* Mobile profile tabs styling */
@media (max-width: 768px) {
    .profile-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .profile-tab {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

.profile-tab-content {
    display: none;
}

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

/* Youth Profile Modal - Styled Tabs */
.youth-profile-tabs {
    background-color: var(--primary-dark);
    border-bottom: 2px solid var(--accent-purple);
    padding: 0.35rem 0.5rem 0 0.5rem;
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.youth-profile-tabs .sub-nav-tab {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Youth Profile Mobile Navigation - unique classes to avoid conflicts */
.ypm-mobile-nav {
    display: none;
    margin-bottom: 1rem;
}

.ypm-mobile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--secondary-dark);
    border: 2px solid var(--accent-purple);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ypm-mobile-btn:hover {
    background: var(--primary-dark);
}

.ypm-mobile-btn svg {
    color: var(--accent-purple);
}

.ypm-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.ypm-mobile-nav.open .ypm-mobile-overlay {
    display: flex;
}

.ypm-mobile-menu {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ypm-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-dark);
}

.ypm-mobile-header span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.ypm-mobile-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ypm-mobile-close:hover {
    background: var(--secondary-dark);
    color: var(--text-primary);
}

.ypm-mobile-content {
    overflow-y: auto;
    max-height: calc(70vh - 50px);
}

.ypm-mobile-item {
    display: block;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.ypm-mobile-item:last-child {
    border-bottom: none;
}

.ypm-mobile-item:hover {
    background: var(--primary-dark);
}

.ypm-mobile-item.active {
    background: var(--accent-purple);
    color: var(--text-on-accent);
    font-weight: 600;
}

/* Youth Profile Searchable Dropdowns */
.youth-profile-dropdown {
    position: fixed !important;
    z-index: 99999 !important;
    background: var(--secondary-dark) !important;
    border: 1px solid var(--accent-purple) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 6px;
}

.youth-profile-dropdown .search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.youth-profile-dropdown .search-result-item:last-child {
    border-bottom: none;
}

.youth-profile-dropdown .search-result-item:hover {
    background: var(--accent-purple);
    color: var(--text-on-accent);
}

.youth-profile-dropdown .search-result-item:hover .search-result-role {
    color: var(--text-on-accent);
    opacity: 0.8;
}

.youth-profile-dropdown .search-result-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.youth-profile-dropdown .search-result-item.hidden {
    display: none;
}

/* Mobile: show hamburger, hide desktop tabs */
@media (max-width: 768px) {
    .ypm-mobile-nav {
        display: block;
    }

    .youth-profile-tabs {
        display: none !important;
    }
}

/* Compact form styling for profile modal */
.modal-xlarge .form-group {
    margin-bottom: 0.75rem;
}

.modal-xlarge .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.modal-xlarge .form-input,
.modal-xlarge .form-select,
.modal-xlarge .form-textarea {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    height: auto;
}

.modal-xlarge .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.modal-xlarge h3 {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* Contact Cards */
.contact-card {
    background-color: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.contact-card-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.btn-icon:hover {
    color: var(--error);
}

/* Reports table specific styling */
.report-section .data-table {
    font-size: 0.85rem;
    width: 100%;
    table-layout: auto;
}

.report-section .data-table th,
.report-section .data-table td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
}

.report-section .data-table th {
    font-size: 0.75rem;
    padding: 0.75rem 0.5rem;
}

/* Specific column widths for better fit */
#billablesTable th:nth-child(1),
#billablesTable td:nth-child(1) { min-width: 100px; } /* Date Submitted */
#billablesTable th:nth-child(2),
#billablesTable td:nth-child(2) { min-width: 90px; } /* Shift Date */
#billablesTable th:nth-child(3),
#billablesTable td:nth-child(3) { min-width: 120px; } /* Youth Name */
#billablesTable th:nth-child(4),
#billablesTable td:nth-child(4) { min-width: 110px; } /* Case Aide */
#billablesTable th:nth-child(5),
#billablesTable td:nth-child(5) { min-width: 110px; } /* Case Manager */
#billablesTable th:nth-child(6),
#billablesTable td:nth-child(6) { min-width: 100px; } /* Shift Type */
#billablesTable th:nth-child(7),
#billablesTable td:nth-child(7) { min-width: 80px; } /* Start Time */
#billablesTable th:nth-child(8),
#billablesTable td:nth-child(8) { min-width: 80px; } /* End Time */
#billablesTable th:nth-child(9),
#billablesTable td:nth-child(9) { min-width: 90px; } /* Youth Time */
#billablesTable th:nth-child(10),
#billablesTable td:nth-child(10) { min-width: 90px; } /* Commute */
#billablesTable th:nth-child(11),
#billablesTable td:nth-child(11) { min-width: 70px; } /* Mileage */
#billablesTable th:nth-child(12),
#billablesTable td:nth-child(12) { min-width: 90px; } /* Doc Time */
#billablesTable th:nth-child(13),
#billablesTable td:nth-child(13) { min-width: 80px; } /* Total */

/* =====================================================
   BRS Compliance Section Styles
   ===================================================== */

/* Compliance Modal Content - proper padding and spacing */
#complianceModal .modal-body {
    padding: 1.5rem 2rem;
}

#complianceModal .compliance-doc-content {
    padding: 0.5rem 0;
}

#complianceModal .compliance-doc-content .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

#complianceModal .compliance-doc-content .form-group {
    margin-bottom: 1rem;
}

.compliance-section {
    margin-top: 1rem;
    /* Removed column-count - using CSS Grid in .compliance-masonry instead */
}

.compliance-category {
    margin-bottom: 1rem;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    break-inside: avoid;
}

.compliance-category-title {
    background: var(--primary-dark);
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.compliance-items {
    padding: 0;
}

.compliance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.compliance-item:last-child {
    border-bottom: none;
}

.compliance-item:hover {
    background: var(--primary-dark);
}

.compliance-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.compliance-orb {
    font-size: 0.875rem;
    line-height: 1;
}

/* Styled compliance orbs (replacing emojis for consistent brightness) */
.compliance-orb-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 4px currentColor;
}

.compliance-orb-dot.completed {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.compliance-orb-dot.pending {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.compliance-orb-dot.overdue {
    background: #f87171;
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.6);
}

.compliance-orb-dot.awaiting-signature {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.compliance-orb-dot.partial-signature {
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.compliance-item-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.optional-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.5rem;
    font-style: italic;
}

.compliance-item-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compliance-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 120px;
    text-align: right;
}

.compliance-date.completed {
    color: var(--success);
}

.compliance-date.pending {
    color: var(--warning);
}

.compliance-date.overdue {
    color: var(--error);
}

.compliance-action {
    min-width: 80px;
}

/* Loading state */
.compliance-loading {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

/* ==========================================
   COMPLIANCE MASONRY LAYOUT
   ========================================== */

.compliance-section {
    padding: 0;
}

.compliance-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.compliance-category-card {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.compliance-category-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.compliance-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-dark);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.compliance-category-icon {
    font-size: 0.7rem;
    font-weight: 700;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-purple);
    color: var(--text-on-accent);
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.compliance-category-info {
    flex: 1;
}

.compliance-category-info .compliance-category-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    padding: 0;
    border: none;
}

.compliance-progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.compliance-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.compliance-category-stats {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--secondary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.compliance-category-stats.has-overdue {
    background: var(--error);
    color: white;
}

.compliance-items-list {
    padding: 0.5rem;
}

.compliance-items-list .compliance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    border: none;
    transition: background 0.15s ease;
}

.compliance-items-list .compliance-item:last-child {
    margin-bottom: 0;
}

.compliance-items-list .compliance-item:hover {
    background: var(--hover-bg);
}

.compliance-items-list .compliance-item.completed {
    opacity: 0.7;
}

.compliance-items-list .compliance-item.completed .compliance-item-actions .btn {
    opacity: 1.43; /* Counter the 0.7 opacity on parent: 1/0.7 ≈ 1.43 */
}

.compliance-items-list .compliance-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.compliance-items-list .compliance-orb {
    font-size: 1rem;
    flex-shrink: 0;
}

.compliance-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.compliance-item-info .compliance-item-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compliance-item-info .compliance-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.compliance-item.overdue .compliance-item-date {
    color: var(--error);
}

.compliance-item.completed .compliance-item-date {
    color: var(--success);
}

.compliance-item-actions {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.compliance-item-actions .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.has-file-icon {
    margin-left: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compliance-masonry {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   MOBILE CLIENT LIST HAMBURGER MENU
   ========================================== */

/* Mobile hamburger button - only visible on mobile when two-column layout exists */
/* Positioned on left side as vertical tab since sidebar slides from left */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1600;
    width: 24px;
    height: 72px;
    border-radius: 0 8px 8px 0;
    background-color: var(--accent-purple);
    border: none;
    color: var(--text-on-accent);
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Hide close button on desktop */
.mobile-sidebar-close {
    display: none;
}

.mobile-sidebar-toggle:hover {
    background-color: var(--accent-purple-hover);
    width: 28px;
}

.mobile-sidebar-toggle:active {
    width: 24px;
}

.mobile-sidebar-toggle svg {
    width: 16px;
    height: 16px;
}

/* Mobile overlay for sidebar */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.visible {
    opacity: 1;
}

/* Mobile-specific two-column layout behavior */
@media (max-width: 992px) {
    /* Show hamburger button on pages with two-column layout (body class added by JS) */
    body.has-two-column-layout .mobile-sidebar-toggle {
        display: flex;
    }

    body.has-two-column-layout .mobile-sidebar-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-sidebar-overlay.visible {
        pointer-events: auto;
    }

    /* Hide left column by default on mobile */
    .two-column-layout {
        display: block;
    }

    .two-column-layout .left-column {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1550;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        background-color: var(--primary-dark);
        padding: 1rem;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .two-column-layout .left-column.mobile-visible {
        transform: translateX(0);
    }

    /* Move toggle to edge of open sidebar */
    .mobile-sidebar-toggle.sidebar-open {
        left: min(85vw, 320px);
    }

    .two-column-layout .left-column .card {
        height: auto;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .two-column-layout .right-column {
        width: 100%;
        max-width: 100vw;
        margin-left: 0;
        padding: 0 0.5rem;
        box-sizing: border-box;
    }

    /* Close button for mobile sidebar */
    .mobile-sidebar-close {
        display: flex;
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-color: var(--secondary-dark);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

    .mobile-sidebar-close:hover {
        background-color: var(--accent-purple);
        color: var(--text-on-accent);
    }
}

/* ==========================================
   COMPREHENSIVE RESPONSIVE DESIGN
   ========================================== */

/* Base responsive variables - scale everything down on smaller screens */
:root {
    --base-font-size: 16px;
    --scale-factor: 1;
}

/* Large Desktop (1600px and below) - slight reduction */
@media (max-width: 1600px) {
    :root {
        --base-font-size: 15px;
        --scale-factor: 0.95;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .welcome-title {
        font-size: 2.25rem;
    }

    .stat-card .stat-value,
    .stat-number {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .container {
        max-width: 1100px;
    }

    .container.container-wide {
        max-width: 1400px;
    }
}

/* Standard HD (1366px and below) - common 1080p laptops */
@media (max-width: 1366px) {
    :root {
        --base-font-size: 14px;
        --scale-factor: 0.9;
    }

    body {
        font-size: 14px;
    }

    .main-header {
        padding: 0.75rem 1.5rem;
    }

    .header-logo {
        height: 40px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .header-left {
        gap: 1rem;
    }

    .profile-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .nav-tabs {
        padding: 0 1.5rem;
    }

    .nav-tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .sub-nav-tabs {
        padding: 0.5rem 1.5rem 0 1.5rem;
        margin-bottom: 1.5rem;
    }

    .sub-nav-tab {
        padding: 0.7rem 1.25rem;
        font-size: 0.85rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-card .stat-value,
    .stat-number {
        font-size: 1.75rem;
    }

    .stat-card .stat-label,
    .stat-label {
        font-size: 0.85rem;
    }

    .stats-grid {
        gap: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .welcome-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .page-greeting {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    /* Two column layout adjustments */
    .two-column-layout {
        grid-template-columns: 380px 1fr;
        gap: 1rem;
    }

    /* Clients layout */
    .clients-layout {
        grid-template-columns: 300px 1fr;
        gap: 1rem;
    }

    .toggle-sidebar-btn {
        left: calc(300px + 1.5rem + 1rem + 20px);
    }

    .toggle-sidebar-btn.sidebar-hidden {
        left: calc(1.5rem + 20px);
    }

    /* Program cards */
    .program-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .program-card {
        padding: 1.5rem;
    }

    .program-card h2 {
        font-size: 1.2rem;
    }

    /* Form elements */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Tables */
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.6rem;
        font-size: 0.9rem;
    }

    /* Modals */
    .modal-content {
        max-width: 600px;
        margin: 3% auto;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1rem 1.25rem;
    }
}

/* Small Desktop / Large Tablets (1200px and below) */
@media (max-width: 1200px) {
    :root {
        --base-font-size: 14px;
    }

    .main-header {
        padding: 0.75rem 1rem;
    }

    .header-logo {
        height: 36px;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .nav-tabs {
        padding: 0 1rem;
        gap: 0.25rem;
    }

    .nav-tab {
        padding: 0.7rem 1rem;
    }

    .sub-nav-tabs {
        padding: 0.5rem 1rem 0 1rem;
        gap: 0.35rem;
    }

    .sub-nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 1rem;
    }

    /* Stats grid - 3 columns max */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Two column layout - reduce sidebar */
    .two-column-layout {
        grid-template-columns: 320px 1fr;
    }

    /* Clients layout */
    .clients-layout {
        grid-template-columns: 260px 1fr;
    }

    .toggle-sidebar-btn {
        left: calc(260px + 1rem + 1rem + 20px);
    }

    /* Program grid */
    .program-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }

    /* Container */
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }

    .container.container-wide {
        max-width: 100%;
    }

    .container-full {
        padding: 0 1rem;
    }

    /* Welcome title */
    .welcome-title {
        font-size: 1.75rem;
    }

    .page-greeting {
        font-size: 1.5rem;
    }
}

/* Tablets (992px and below) */
@media (max-width: 992px) {
    .main-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .header-left {
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .header-logo {
        height: 32px;
    }

    /* Navigation - horizontal scroll */
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .nav-tab {
        white-space: nowrap;
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }

    .sub-nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .sub-nav-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Two column layout - stack on mobile */
    .two-column-layout {
        display: block !important;
        width: 100%;
        max-width: 100vw;
    }

    .two-column-layout .right-column {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 0.5rem;
    }

    .left-column,
    .right-column {
        overflow-y: visible;
    }

    /* Clients layout - hide sidebar by default */
    .clients-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .client-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 300px;
        height: 100vh;
        z-index: 1500;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .client-sidebar.mobile-visible {
        transform: translateX(0);
    }

    .client-sidebar.hidden {
        transform: translateX(-100%);
    }

    .toggle-sidebar-btn {
        position: fixed;
        left: auto;
        right: 1rem;
        top: auto;
        bottom: 1.5rem;
        z-index: 100;
    }

    .toggle-sidebar-btn.sidebar-hidden {
        right: 1rem;
        left: auto;
    }

    /* Mobile sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1400;
    }

    .sidebar-overlay.visible {
        display: block;
    }

    /* Stats grid - 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value,
    .stat-number {
        font-size: 1.5rem;
    }

    /* Program grid */
    .program-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Form row - stack */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Filters */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-left {
        width: 100%;
    }

    .filters-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .search-input {
        min-width: 200px;
        width: 100%;
    }

    /* Modal - larger */
    .modal-content {
        margin: 2% auto;
        max-width: 90%;
    }

    .modal-xlarge {
        max-width: 95%;
    }

    .modal-xlarge .form-row {
        grid-template-columns: 1fr 1fr;
    }

    /* Tables - horizontal scroll */
    .table-card {
        overflow-x: auto;
    }
}

/* Small Tablets / Large Mobile (768px and below) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    html {
        overflow-x: hidden;
    }

    .main-header {
        padding: 0.75rem 1rem;
    }

    .header-left {
        flex: 1;
    }

    .header-logo {
        height: 28px;
    }

    /* Rearrange header: title below logo on mobile */
    .main-header {
        flex-wrap: wrap;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .page-title {
        font-size: 0.75rem;
        width: 100%;
        max-width: none;
        overflow: visible;
        white-space: normal;
        line-height: 1.2;
        opacity: 0.85;
    }

    .header-right {
        gap: 0.5rem;
    }

    .profile-btn {
        padding: 0.5rem 0.75rem;
    }

    .profile-btn span {
        display: none;
    }

    /* Hide nav-tabs on mobile, use hamburger menu instead */
    .nav-tabs {
        display: none;
    }

    /* Hide sub-nav-tabs on mobile, use dropdown instead */
    .sub-nav-tabs {
        display: none !important;
    }

    /* Client widgets - stack on mobile */
    .support-funds-widgets {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .support-funds-widgets .case-aide-hours {
        padding: 0.75rem;
    }

    /* Case info grid - stack on mobile */
    .case-info-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Show mobile sub-nav dropdown on mobile */
    .mobile-sub-nav {
        display: block;
        margin-top: 1rem;
        padding: 0 1rem;
    }

    /* Mobile sub-nav inside client tabs container */
    .client-tabs-container .mobile-sub-nav {
        display: block !important;
        margin: 0 0 1rem 0;
        padding: 0;
    }

    /* Ensure client-tabs-container is visible on mobile */
    .client-tabs-container {
        display: block !important;
    }

    /* Make dashboard content tabs smaller on mobile */
    .content-tabs {
        gap: 0.15rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .content-tab {
        padding: 0.35rem 0.4rem;
        font-size: 0.6rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Tables on mobile - smaller text, horizontal scroll if needed */
    .data-table {
        font-size: 0.7rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.35rem;
    }

    .table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-primary);
        padding: 0.5rem;
        cursor: pointer;
        border-radius: 8px;
        margin-left: auto;
    }

    .mobile-menu-btn:hover {
        background: var(--primary-dark);
    }

    /* Mobile Navigation Overlay */
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 2000;
        backdrop-filter: blur(4px);
    }

    .mobile-nav-overlay.show {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding-top: 10vh;
    }

    .mobile-nav-menu {
        background: var(--card-bg);
        border-radius: 16px;
        width: calc(100% - 2rem);
        max-width: 360px;
        max-height: 80vh;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        animation: mobileNavFadeIn 0.2s ease-out;
    }

    @keyframes mobileNavFadeIn {
        from {
            opacity: 0;
            transform: scale(0.95);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--mobile-nav-header-bg, #1a1a1a);
    }

    .mobile-nav-header span {
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--mobile-nav-header-text, #ffffff);
    }

    .mobile-nav-close {
        background: none;
        border: none;
        color: var(--mobile-nav-header-text, rgba(255, 255, 255, 0.7));
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    .mobile-nav-content {
        padding: 0;
        overflow-y: auto;
        max-height: calc(80vh - 60px);
        -webkit-overflow-scrolling: touch;
        background: var(--mobile-nav-content-bg, var(--primary-dark));
    }

    .mobile-nav-item {
        display: block;
        padding: 1rem 1.25rem;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
        transition: background 0.15s ease;
        background: var(--mobile-nav-item-bg, var(--card-bg));
    }

    .mobile-nav-item:last-child {
        border-bottom: none;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item:active {
        background: var(--mobile-nav-item-hover, var(--primary-dark));
    }

    .mobile-nav-item.active {
        background: var(--accent-purple);
        color: #ffffff;
        font-weight: 600;
    }

    .mobile-nav-item.disabled {
        opacity: 0.5;
        pointer-events: none;
    }

    .mobile-nav-section {
        padding: 0.75rem 1.25rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--mobile-nav-section-text, rgba(255, 255, 255, 0.8));
        background: var(--mobile-nav-header-bg, #1a1a1a);
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-nav-section:first-child {
        margin-top: 0;
    }

    .nav-dropdown-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .nav-dropdown-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
    }

    .nav-dropdown-overlay.visible {
        display: block;
    }

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

    @keyframes fadeInScale {
        from {
            transform: translate(-50%, -50%) scale(0.9);
            opacity: 0;
        }
        to {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
        }
    }

    .sub-nav-tabs {
        padding: 0.4rem 0.75rem 0 0.75rem;
        margin-bottom: 1rem;
    }

    .sub-nav-tab {
        padding: 0.5rem 0.85rem;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 0.75rem;
        min-height: calc(100vh - 120px);
    }

    /* Cards */
    .card {
        padding: 1rem;
        border-radius: 8px;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-card .stat-value,
    .stat-number {
        font-size: 1.35rem;
    }

    .stat-card .stat-label,
    .stat-label {
        font-size: 0.75rem;
    }

    /* Program grid - single column */
    .program-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .program-card {
        padding: 1.25rem;
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    /* Welcome and greetings */
    .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .page-greeting {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1rem;
    }

    /* Modals - near full screen */
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
    }

    /* Youth profile modal responsive */
    .modal-xlarge {
        max-width: calc(100% - 1rem);
        margin: 0.5rem;
    }

    .modal-xlarge .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .modal-xlarge .modal-body {
        padding: 0.75rem 1rem 1.5rem 1rem;
    }

    .modal-xlarge h3 {
        font-size: 0.95rem;
    }

    /* Detail tables */
    .detail-label {
        width: 35%;
        padding: 0.75rem 0;
        font-size: 0.85rem;
    }

    .detail-value {
        padding: 0.75rem 0;
        font-size: 0.9rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    /* Profile menu */
    .profile-menu {
        min-width: 220px;
        right: -0.5rem;
    }

    /* Dropdowns */
    .custom-dropdown-display {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Tables - compact for mobile */
    .data-table {
        font-size: 0.65rem;
    }

    .data-table th {
        padding: 0.35rem 0.2rem;
        font-size: 0.55rem;
        letter-spacing: 0;
    }

    .data-table td {
        padding: 0.35rem 0.2rem;
    }

    .data-table .status-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.3rem;
    }

    .hours-progress-mini {
        min-width: 40px;
    }

    .hours-text {
        font-size: 0.55rem;
    }

    .outreach-timeline-card {
        min-width: 60px;
    }

    .outreach-dot {
        width: 16px;
        height: 16px;
    }

    /* Compliance items - keep on same row but compact */
    .compliance-item {
        padding: 0.5rem 0.75rem;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .compliance-item-left {
        flex: 1;
        min-width: 0;
        gap: 0.5rem;
    }

    .compliance-item-info .compliance-item-name {
        font-size: 0.8rem;
    }

    .compliance-item-info .compliance-item-date {
        font-size: 0.7rem;
    }

    .compliance-item-right {
        flex-shrink: 0;
    }

    .compliance-item-actions .btn-sm,
    .compliance-item-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .compliance-date {
        min-width: auto;
        text-align: left;
        font-size: 0.7rem;
    }

    .compliance-orb {
        font-size: 0.85rem;
    }

    /* Client sidebar for mobile */
    .client-sidebar {
        width: 280px;
    }

    .client-sidebar {
        padding: 1rem;
    }
}

/* Mobile (576px and below) */
@media (max-width: 576px) {
    body {
        font-size: 13px;
    }

    .main-header {
        padding: 0.5rem 0.75rem;
    }

    .header-logo {
        height: 24px;
    }

    .header-left {
        gap: 0.5rem;
    }

    .profile-btn {
        padding: 0.4rem 0.6rem;
    }

    .profile-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Navigation */
    .nav-tabs {
        padding: 0 0.5rem;
    }

    .nav-tab {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }

    .sub-nav-tabs {
        padding: 0.35rem 0.5rem 0 0.5rem;
    }

    .sub-nav-tab {
        padding: 0.45rem 0.7rem;
        font-size: 0.7rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    /* Cards */
    .card {
        padding: 0.75rem;
    }

    /* Stats - can go single column if needed */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .stat-card {
        padding: 0.6rem;
    }

    .stat-card .stat-value,
    .stat-number {
        font-size: 1.2rem;
    }

    .stat-card .stat-label,
    .stat-label {
        font-size: 0.7rem;
    }

    /* Titles */
    .welcome-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .page-greeting {
        font-size: 1.15rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    h3 {
        font-size: 0.95rem;
    }

    /* Modal - full screen */
    .modal-content {
        margin: 0;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        border-radius: 0;
    }

    .modal-footer {
        border-radius: 0;
    }

    /* Buttons */
    .btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.8rem;
    }

    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Upload area */
    .upload-area {
        padding: 1.5rem 1rem;
    }

    .upload-area h3 {
        font-size: 1rem;
    }

    /* Profile dropdown */
    .profile-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Details table - stack */
    .details-table tr {
        display: flex;
        flex-direction: column;
    }

    .detail-label {
        width: 100%;
        padding: 0.5rem 0 0.25rem 0;
        font-weight: 600;
    }

    .detail-value {
        width: 100%;
        padding: 0.25rem 0 0.5rem 0;
    }

    /* Client sidebar */
    .client-sidebar {
        width: 100%;
    }

    /* Filter bar */
    .filter-chips {
        width: 100%;
    }

    .filter-chip {
        flex: 1;
        text-align: center;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Search box */
    .search-box {
        width: 100%;
    }

    .search-input {
        min-width: 100%;
    }

    /* Toggle sidebar button */
    .toggle-sidebar-btn {
        bottom: 0.75rem;
        left: 0.75rem;
        padding: 0.6rem 0.85rem;
        font-size: 0.8rem;
    }

    /* Activity items */
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    /* Red flag items */
    .red-flag-item {
        padding: 0.75rem 1rem;
    }
}

/* Extra Small Mobile (480px and below) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.35rem;
    }

    .card {
        padding: 0.6rem;
        border-radius: 6px;
    }

    /* Stats - force 2 columns but smaller */
    .stats-grid {
        gap: 0.35rem;
    }

    .stat-card {
        padding: 0.5rem;
    }

    .stat-card .stat-value,
    .stat-number {
        font-size: 1.1rem;
    }

    /* Program cards */
    .program-card {
        padding: 1rem;
    }

    .program-card h2 {
        font-size: 1rem;
    }

    /* Form elements */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        padding: 0.55rem;
        font-size: 0.85rem;
    }

    /* Buttons full width */
    .modal-footer .btn {
        flex: 1;
    }

    .modal-footer {
        flex-wrap: wrap;
    }
}

/* Touch-friendly enhancements for mobile */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }

    .nav-tab {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .sub-nav-tab {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .filter-chip {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .profile-btn {
        min-height: 44px;
    }

    .client-list-item,
    .youth-list-item {
        min-height: 48px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .stat-card:hover,
    .program-card:hover,
    .client-card:hover {
        transform: none;
    }

    /* Active states instead */
    .stat-card:active,
    .program-card:active,
    .client-card:active {
        transform: scale(0.98);
    }
}

/* Print styles */
@media print {
    .main-header,
    .nav-tabs,
    .sub-nav-tabs,
    .btn,
    .toggle-sidebar-btn,
    .client-sidebar {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .modal-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Landscape orientation adjustments for tablets/mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .main-header {
        padding: 0.35rem 1rem;
    }

    .header-logo {
        height: 24px;
    }

    .nav-tabs {
        padding: 0 0.5rem;
    }

    .nav-tab {
        padding: 0.4rem 0.75rem;
    }

    .sub-nav-tabs {
        margin-bottom: 0.5rem;
    }

    .main-content {
        padding: 0.5rem;
        min-height: calc(100vh - 80px);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
}

/* ==========================================
   MESSAGING THEME FIXES - Dark solid bg on active, bright avatar
   Following Yellowjacket dark pattern for good contrast
   ========================================== */

/* DEFAULT THEME - Dark Mode */
[data-theme="default"][data-mode="dark"] .conversation-item.active {
    background: #1a1a2e;
}

[data-theme="default"][data-mode="dark"] .conversation-avatar-small,
[data-theme="default"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: #ffffff;
}

/* DEFAULT THEME - Light Mode */
[data-theme="default"][data-mode="light"] .conversation-item.active {
    background: #3a3a5a;
}

[data-theme="default"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="default"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="default"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="default"][data-mode="light"] .conversation-avatar-small,
[data-theme="default"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: #ffffff;
}

/* OCEAN THEME - Dark Mode */
[data-theme="ocean"][data-mode="dark"] .conversation-item.active {
    background: #0a1830;
}

[data-theme="ocean"][data-mode="dark"] .conversation-avatar-small,
[data-theme="ocean"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #1e88e5, #00bcd4);
    color: #ffffff;
}

/* OCEAN THEME - Light Mode */
[data-theme="ocean"][data-mode="light"] .conversation-item.active {
    background: #0d47a1;
}

[data-theme="ocean"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="ocean"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="ocean"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="ocean"][data-mode="light"] .conversation-avatar-small,
[data-theme="ocean"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #1565c0, #0097a7);
    color: #ffffff;
}

/* OLDSCHOOL THEME - Dark Mode */
[data-theme="oldschool"][data-mode="dark"] .conversation-item.active {
    background: #1a1510;
}

[data-theme="oldschool"][data-mode="dark"] .conversation-avatar-small,
[data-theme="oldschool"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #8b7355, #d4a574);
    color: #ffffff;
}

/* OLDSCHOOL THEME - Light Mode */
[data-theme="oldschool"][data-mode="light"] .conversation-item.active {
    background: #5c4030;
}

[data-theme="oldschool"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="oldschool"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="oldschool"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="oldschool"][data-mode="light"] .conversation-avatar-small,
[data-theme="oldschool"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #8b4513, #cc5500);
    color: #ffffff;
}

/* BUBBLEGUM THEME - Dark Mode */
[data-theme="bubblegum"][data-mode="dark"] .conversation-item.active {
    background: #1a0a14;
}

[data-theme="bubblegum"][data-mode="dark"] .conversation-avatar-small,
[data-theme="bubblegum"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #e91e63, #ff80ab);
    color: #ffffff;
}

/* BUBBLEGUM THEME - Light Mode */
[data-theme="bubblegum"][data-mode="light"] .conversation-item.active {
    background: #8e1152;
}

[data-theme="bubblegum"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="bubblegum"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="bubblegum"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="bubblegum"][data-mode="light"] .conversation-avatar-small,
[data-theme="bubblegum"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #c2185b, #ec407a);
    color: #ffffff;
}

/* ORANGE CREAMSICLE THEME - Dark Mode */
[data-theme="creamsicle"][data-mode="dark"] .conversation-item.active {
    background: #1c1410;
}

[data-theme="creamsicle"][data-mode="dark"] .conversation-avatar-small,
[data-theme="creamsicle"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #ff7a2e, #ffbe8a);
    color: #ffffff;
}

/* ORANGE CREAMSICLE THEME - Light Mode */
[data-theme="creamsicle"][data-mode="light"] .conversation-item.active {
    background: #d35400;
}

[data-theme="creamsicle"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="creamsicle"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="creamsicle"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="creamsicle"][data-mode="light"] .conversation-avatar-small,
[data-theme="creamsicle"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #f06820, #ff9544);
    color: #ffffff;
}

/* Nested card contrast fix for themes with similar card-bg and secondary-dark */
[data-theme="bubblegum"] .card .card,
[data-theme="bubblegum"] .card .summary-stat,
[data-theme="bubblegum"] .card .program-report-card,
[data-theme="creamsicle"] .card .card,
[data-theme="creamsicle"] .card .summary-stat,
[data-theme="creamsicle"] .card .program-report-card,
[data-theme="ocean"] .card .card,
[data-theme="ocean"] .card .summary-stat,
[data-theme="ocean"] .card .program-report-card,
[data-theme="cascadia"] .card .card,
[data-theme="cascadia"] .card .summary-stat,
[data-theme="cascadia"] .card .program-report-card,
[data-theme="royalty"] .card .card,
[data-theme="royalty"] .card .summary-stat,
[data-theme="royalty"] .card .program-report-card,
[data-theme="matrix"] .card .card,
[data-theme="matrix"] .card .summary-stat,
[data-theme="matrix"] .card .program-report-card,
[data-theme="thenextgeneration"] .card .card,
[data-theme="thenextgeneration"] .card .summary-stat,
[data-theme="thenextgeneration"] .card .program-report-card {
    background: var(--secondary-dark) !important;
}

/* CASCADIA THEME - Dark Mode */
[data-theme="cascadia"][data-mode="dark"] .conversation-item.active {
    background: #051510;
}

[data-theme="cascadia"][data-mode="dark"] .conversation-avatar-small,
[data-theme="cascadia"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #00a5b8, #3cb371);
    color: #ffffff;
}

/* CASCADIA THEME - Light Mode */
[data-theme="cascadia"][data-mode="light"] .conversation-item.active {
    background: #00695c;
}

[data-theme="cascadia"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="cascadia"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="cascadia"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="cascadia"][data-mode="light"] .conversation-avatar-small,
[data-theme="cascadia"][data-mode="light"] .conversation-avatar {
    background: linear-gradient(135deg, #0097a7, #2e8b57);
    color: #ffffff;
}

/* UNDERWORLD THEME - Dark Mode */
[data-theme="underworld"][data-mode="dark"] .conversation-item.active {
    background: #000000;
}

[data-theme="underworld"][data-mode="dark"] .conversation-avatar-small,
[data-theme="underworld"][data-mode="dark"] .conversation-avatar {
    background: linear-gradient(135deg, #cc1a1a, #ff6600);
    color: #ffffff;
}

/* Fix UNDERWORLD LIGHT (Overworld) - was gold on gold, now dark bg with gold avatar */
[data-theme="underworld"][data-mode="light"] .conversation-item.active {
    background: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="underworld"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="underworld"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

/* Fix YELLOWJACKET LIGHT - was yellow on yellow, now dark bg with yellow avatar */
[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active {
    background: #333333;
}

[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="yellowjacket"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

/* MATRIX THEME - Dark Mode */
[data-theme="matrix"][data-mode="dark"] .conversation-item.active {
    background: #1a1a2a;
}

[data-theme="matrix"][data-mode="dark"] .conversation-avatar-small,
[data-theme="matrix"][data-mode="dark"] .conversation-avatar {
    background: #00FF00;
    color: #000000;
}

/* MATRIX THEME - Light Mode */
[data-theme="matrix"][data-mode="light"] .conversation-item.active {
    background: #0000CC;
}

[data-theme="matrix"][data-mode="light"] .conversation-item.active .conversation-name,
[data-theme="matrix"][data-mode="light"] .conversation-item.active .conversation-last-message,
[data-theme="matrix"][data-mode="light"] .conversation-item.active .conversation-time {
    color: #ffffff;
}

[data-theme="matrix"][data-mode="light"] .conversation-avatar-small,
[data-theme="matrix"][data-mode="light"] .conversation-avatar {
    background: #CC0000;
    color: #ffffff;
}

.program-card h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.program-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.program-card .btn {
    margin-top: auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    text-align: left;
    margin-bottom: 0;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px 0;
    margin-top: 1rem;
}

.data-table thead {
    background-color: transparent;
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-on-accent);
    border-bottom: 2px solid var(--border-color);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    box-shadow: 0 2px 8px rgba(var(--accent-purple-rgb), 0.3);
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%, 0 8px);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
    text-align: center;
}

.data-table tbody tr {
    transition: background-color 0.2s;
    background-color: var(--primary-dark);
}

.data-table tbody tr:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
}

.data-table tbody tr.inactive-row {
    opacity: 0.6;
}

/* Compact Data Table - for tables with many columns */
.data-table-compact th {
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.data-table-compact td {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
}

.data-table-compact .sort-indicator {
    font-size: 0.7rem;
}

/* Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-super_admin {
    background-color: rgba(244, 164, 96, 0.2);
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
}

.role-admin {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

.role-user {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.role-director {
    background-color: rgba(220, 120, 96, 0.2);
    color: #dc7860;
    border: 1px solid #dc7860;
}

.role-program_manager {
    background-color: rgba(100, 149, 237, 0.2);
    color: #6495ed;
    border: 1px solid #6495ed;
}

.role-program_supervisor {
    background-color: rgba(138, 43, 226, 0.2);
    color: #9370db;
    border: 1px solid #9370db;
}

.role-case_manager_supervisor {
    background-color: rgba(72, 209, 204, 0.2);
    color: #48d1cc;
    border: 1px solid #48d1cc;
}

.role-case_manager {
    background-color: rgba(144, 238, 144, 0.2);
    color: #90ee90;
    border: 1px solid #90ee90;
}

.role-case_aide_supervisor {
    background-color: rgba(221, 160, 221, 0.2);
    color: #dda0dd;
    border: 1px solid #dda0dd;
}

.role-support_specialist {
    background-color: rgba(255, 182, 108, 0.2);
    color: #ffb66c;
    border: 1px solid #ffb66c;
}

.role-case_aide {
    background-color: rgba(176, 196, 222, 0.2);
    color: #b0c4de;
    border: 1px solid #b0c4de;
}

/* Assignment Role Badges */
.role-primary {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.role-secondary {
    background-color: rgba(100, 149, 237, 0.2);
    color: #6495ed;
    border: 1px solid #6495ed;
}

.role-supervisor {
    background-color: rgba(138, 43, 226, 0.2);
    color: #9370db;
    border: 1px solid #9370db;
}

.role-backup {
    background-color: rgba(255, 182, 108, 0.2);
    color: #ffb66c;
    border: 1px solid #ffb66c;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background-color: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.status-inactive {
    background-color: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.status-discharged {
    background-color: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.status-new {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-updated {
    background-color: rgba(244, 164, 96, 0.2);
    color: var(--accent-orange);
}

.status-removed {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.status-unchanged {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

/* Enrollment Status Badges */
.status-referred {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-outreach {
    background-color: rgba(156, 39, 176, 0.2);
    color: #AB47BC;
}

.status-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.status-enrolled {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

/* IYHP Housing Status Badges */
.status-seeking {
    background-color: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.status-placed {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-stable {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-exited {
    background-color: rgba(120, 144, 156, 0.2);
    color: #78909C;
}

.status-rejected {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* CSP-specific Enrollment Status Badges */
.status-initial_engagement {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.status-ongoing_engagement {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-active_engagement {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-lost_eligibility {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.status-declined {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

.status-withdrew {
    background-color: rgba(121, 85, 72, 0.2);
    color: #8D6E63;
}

.status-unknown {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

/* Case Status Badges (fallback) */
.status-open {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-closed {
    background-color: rgba(120, 144, 156, 0.2);
    color: #78909C;
}

/* Activity Type Badges */
.status-face-to-face {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-on-call {
    background-color: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.status-case-note {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

.status-ftdm {
    background-color: rgba(156, 39, 176, 0.2);
    color: #AB47BC;
}

.status-spm {
    background-color: rgba(0, 150, 136, 0.2);
    color: #009688;
}

.status-referral {
    background-color: rgba(233, 30, 99, 0.2);
    color: #E91E63;
}

.status-general_case_note {
    background-color: rgba(121, 85, 72, 0.2);
    color: #8D6E63;
}

.text-muted {
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        padding: 1rem;
    }

    .header-logo {
        height: 40px;
    }

    .nav-tabs {
        padding: 0 1rem;
        overflow-x: auto;
    }

    .sub-nav-tabs {
        padding: 0.5rem 1rem 0 1rem;
        overflow-x: auto;
    }

    .main-content {
        padding: 1rem;
    }

    .program-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .profile-btn span {
        display: none;
    }

    .welcome-title {
        font-size: 1.75rem;
    }

    /* Filters bar mobile - stack vertically */
    .filters-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .filters-left,
    .filters-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filters-right {
        flex-direction: column;
    }

    .filter-dropdown,
    .user-filter-wrapper,
    .custom-dropdown {
        width: 100% !important;
        min-width: unset !important;
    }

    .search-box {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    /* Container overflow control */
    .container-full,
    .tab-content {
        overflow-x: hidden;
        max-width: 100%;
    }

    .card {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* All Clients Page - Simple grid, no height constraints on right column */
.two-column-layout {
    display: grid !important;
    grid-template-columns: 480px 1fr !important;
    grid-template-rows: auto !important;
    gap: 1.5rem;
    align-items: start !important;
}

/* Clients pages - use flexbox to fit left column within viewport */
.clients-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.clients-page .sticky-header-wrapper {
    flex-shrink: 0;
}

.clients-page .main-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: 0;
    padding-bottom: 1rem;
}

.clients-page .two-column-layout {
    padding-top: 1rem;
}

.clients-page .client-tabs-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--secondary-dark);
    margin-bottom: 1rem;
}

/* Schedule page - fit calendar within viewport */
.schedule-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.schedule-page .sticky-header-wrapper {
    flex-shrink: 0;
}

.schedule-page .main-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    padding-bottom: 0;
}

.schedule-page .container-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 90%;
}

.schedule-page .container-full > .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.schedule-page .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.schedule-page .schedule-calendar {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.schedule-page .schedule-grid-wrapper {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.left-column {
    position: sticky;
    top: 0;
    align-self: start;
    transition: opacity 0.15s ease-in-out;
}

.clients-page .left-column > .card {
    max-height: calc(100vh - 260px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.right-column {
    /* Intentionally empty - content determines height */
}

.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-filter-bar .btn {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
}

.filter-panel {
    background-color: var(--primary-dark);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.filter-panel h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.youth-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.5rem;
}

.youth-list-item {
    padding: 0.75rem 1rem;
    background-color: var(--primary-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.youth-list-item:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-left-color: var(--accent-purple);
}

.youth-list-item.active {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    border-left-color: var(--accent-orange);
}

.youth-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

/* Ensure youth names in light mode use proper text color */
[data-mode="light"] .youth-name {
    color: var(--text-primary) !important;
}

.youth-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.youth-status-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.youth-status-row .youth-status {
    margin-bottom: 0;
}

.youth-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9E9E9E; /* Default grey for unset states */
}

.youth-status-indicator.outreach {
    background-color: #FFD700;
}

.youth-status-indicator.accepted {
    background-color: #2196F3;
}

.youth-status-indicator.enrolled {
    background-color: #4CAF50;
}

.youth-status-indicator.rejected {
    background-color: #F44336;
}

.youth-status-indicator.archived {
    background-color: #9E9E9E;
}

.youth-status-indicator.referred {
    background-color: #9C27B0;
}

.youth-status-indicator.outreach_done {
    background-color: #FFD700;
}

.youth-status-indicator.pea_complete {
    background-color: #2196F3;
}

.youth-status-indicator.exited {
    background-color: #9E9E9E;
}

.youth-status-indicator.pending {
    background-color: #FF9800;
}

/* Case status indicators for BRS */
.youth-status-indicator.open {
    background-color: #10b981;
}

.youth-status-indicator.discharged {
    background-color: #ff9800;
}

.youth-status-indicator.closed {
    background-color: #6b7280;
}

/* Cycle indicator colors for Lifeset */
.youth-status-indicator.cycle-purple {
    background-color: #9C27B0;
}

.youth-status-indicator.cycle-yellow {
    background-color: #FFD700;
}

.youth-status-indicator.cycle-green {
    background-color: #4CAF50;
}

.youth-status-indicator.cycle-blue {
    background-color: #2196F3;
}

.youth-status-indicator.cycle-none {
    background-color: #9E9E9E;
}

/* CSP Enrollment Status Colors */
span.youth-status-indicator.initial_engagement {
    background-color: #FFD700 !important; /* Gold - initial engagement */
}

span.youth-status-indicator.ongoing_engagement {
    background-color: #2196F3 !important; /* Blue - ongoing engagement */
}

span.youth-status-indicator.active_engagement {
    background-color: #4CAF50 !important; /* Green - active engagement */
}

span.youth-status-indicator.lost_eligibility {
    background-color: #F44336 !important; /* Red - lost eligibility */
}

span.youth-status-indicator.declined {
    background-color: #9E9E9E !important; /* Grey */
}

span.youth-status-indicator.withdrew {
    background-color: #795548 !important; /* Brown */
}

span.youth-status-indicator.discharged {
    background-color: #ff9800 !important; /* Orange - discharged */
}

.youth-id {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.youth-header {
    margin-bottom: 2rem;
}

.youth-header h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.caregiver-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.caregiver-info a:hover {
    color: var(--accent-purple) !important;
    text-decoration: underline !important;
}

.case-aide-hours {
    background-color: var(--primary-dark);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    max-width: 320px;
}

.case-aide-hours h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.case-aide-hours .status-badge {
    margin-bottom: 1rem;
}

/* Add spacing between custom dropdown wrapper and status badge */
.case-aide-hours .custom-dropdown-wrapper {
    margin-bottom: 0.75rem;
}

.status-not-started {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-in-progress {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-complete {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-draft {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-ready-for-case-aide {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-needs-revision {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-compliance {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(156, 39, 176, 0.2);
    color: #BA68C8;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-uploaded {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(0, 188, 212, 0.2);
    color: #00BCD4;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-ready-for-review {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(156, 39, 176, 0.2);
    color: #9C27B0;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hours-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.hours-used {
    font-weight: 600;
    color: var(--text-primary);
}

.hours-percentage {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-bar {
    height: 10px;
    background-color: rgba(var(--accent-purple-rgb), 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-orange));
    transition: width 0.3s ease;
}

/* Mini progress bar for table cells */
.hours-progress-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}

.hours-progress-mini .hours-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.progress-bar-mini {
    height: 6px;
    background-color: rgba(var(--accent-purple-rgb), 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-mini .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-orange));
    transition: width 0.3s ease;
}

/* Anchor scroll offset for fixed header */
#theme {
    scroll-margin-top: 100px;
}

/* User avatar in tables */
.user-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-sm.user-initials {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.activity-tabs-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding: 0;
}

.activity-tabs {
    display: flex;
    gap: 0;
}

.activity-tab {
    padding: 1rem 1.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    margin-bottom: -2px;
}

.activity-tab:hover {
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(var(--accent-purple-rgb), 0.1) 0%, transparent 100%);
}

.activity-tab.active {
    color: var(--accent-orange);
    border-bottom: 3px solid var(--accent-orange);
    background: linear-gradient(180deg, rgba(var(--accent-orange-rgb), 0.1) 0%, transparent 100%);
}

.activities-section {
    margin-top: 1.5rem;
}

.activity-search-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--accent-purple);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.2);
    color: var(--accent-orange);
}

/* Modal Large */
.modal-large {
    max-width: 900px;
    max-height: 90vh;
    overflow: visible;
}

.modal-large .modal-body {
    overflow: visible;
}

/* Modal Medium */
.modal-medium {
    max-width: 600px;
    max-height: 80vh;
    overflow: visible;
}

.modal-medium .modal-body {
    overflow-y: auto;
    max-height: 60vh;
}

/* Assignments List */
.assignments-list {
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 60px;
    max-height: 300px;
    overflow-y: auto;
}

.assignment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

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

.assignment-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.assignment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.assignment-details {
    display: flex;
    flex-direction: column;
}

.assignment-name {
    font-weight: 500;
    color: var(--text-primary);
}

.assignment-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.assignment-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.assignment-remove:hover {
    background: var(--error-color);
    color: white;
}

/* Activity Modal - allow dropdown overflow */
#activityModal {
    overflow: visible;
}

#activityModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#activityModal .modal-body {
    overflow-y: auto;
    overflow-x: visible;
    flex: 1;
    min-height: 0;
}

#activityModal .modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

#activityModal .form-row {
    overflow: visible;
}

#activityModal .form-group {
    position: relative;
    overflow: visible;
}

/* Ensure dropdowns in activity modal can overflow */
#activityModal .custom-dropdown-wrapper {
    position: relative;
    z-index: 100;
}

#activityModal .custom-dropdown-wrapper.open {
    z-index: 2001;
}

#activityModal .custom-dropdown-options {
    z-index: 2002;
    max-height: 300px;
    overflow-y: auto;
}

/* Schedule Event Modal - wider program dropdowns */
#eventProgramSelectorGroup .custom-dropdown-wrapper,
#shiftProgramSelectorGroup .custom-dropdown-wrapper {
    min-width: 300px;
    width: 300px;
}

/* Outreach Modal - make it taller */
#outreachModal .modal-content {
    max-height: 90vh;
}

#outreachModal .modal-body {
    max-height: 75vh;
    overflow-y: auto;
}

/* Outreach History List */
.outreach-history-list {
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.outreach-item {
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 0.4rem;
    border-left: 3px solid var(--accent-purple);
}

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

.outreach-item-highlight {
    animation: outreach-highlight 2s ease-out;
}

@keyframes outreach-highlight {
    0%, 30% {
        background: rgba(156, 39, 176, 0.3);
        box-shadow: 0 0 0 2px var(--accent-purple);
    }
    100% {
        background: var(--bg-secondary);
        box-shadow: none;
    }
}

.outreach-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.outreach-type {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.outreach-type svg {
    width: 14px;
    height: 14px;
}

.outreach-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.outreach-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.outreach-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.outreach-item:hover .outreach-actions {
    opacity: 1;
}

.btn-icon-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: var(--primary-dark);
    color: var(--text-primary);
}

.btn-icon-sm.btn-danger-subtle:hover {
    background: rgba(220, 53, 69, 0.15);
    color: var(--error);
}

.outreach-response {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--accent-purple);
    color: var(--text-on-accent, #fff);
}

.outreach-response.accepted_services { background: var(--success); }
.outreach-response.rejected_services { background: var(--error); }
.outreach-response.no_response { background: var(--text-muted); }
.outreach-response.wants_further_communication { background: #f0ad4e; color: #000; }
.outreach-response.contacting_dcyf { background: var(--accent-blue); }

/* Outreach Timeline Mini Display (CSP Dashboard) */
.outreach-cell {
    transition: background-color 0.2s;
    cursor: pointer;
    min-width: 100px;
    max-width: 365px;
    overflow-x: clip;
    overflow-y: visible;
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
    z-index: 1;
}

.outreach-cell:has(.outreach-dot:hover) {
    z-index: 100;
}

.outreach-cell:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.05);
}

/* Card container for timeline */
.outreach-timeline-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px 23px 10px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.outreach-timeline {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible;
    padding: 4px 0;
}

.outreach-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    flex-shrink: 0;
    background: var(--text-muted);
    color: white;
    cursor: pointer;
}

.outreach-dot svg {
    stroke: currentColor;
    stroke-width: 2.5;
}

.outreach-dot:hover {
    transform: scale(1.25);
    z-index: 10;
}

/* Response-based colors for timeline dots - solid backgrounds */
.outreach-dot.accepted_services {
    background: var(--success);
    color: white;
}
.outreach-dot.rejected_services {
    background: var(--error);
    color: white;
}
.outreach-dot.no_response {
    background: var(--text-muted);
    color: white;
}
.outreach-dot.wants_further_communication {
    background: #f0ad4e;
    color: #1a1a2e;
}
.outreach-dot.contacting_dcyf {
    background: var(--accent-orange);
    color: white;
}

/* Backwards compatibility for hyphenated response values */
.outreach-dot.accepted-services {
    background: var(--success);
    color: white;
}
.outreach-dot.rejected-services {
    background: var(--error);
    color: white;
}
.outreach-dot.no-response {
    background: var(--text-muted);
    color: white;
}
.outreach-dot.wants-further-communication {
    background: #f0ad4e;
    color: #1a1a2e;
}
.outreach-dot.contacting-dcyf {
    background: var(--accent-orange);
    color: white;
}

/* Flow arrows between timeline dots - chevron style */
.outreach-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.outreach-arrow svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent-purple);
    stroke-width: 3;
    fill: none;
}

/* Hide the static last date - we use per-dot dates on hover instead */
.outreach-last-date {
    display: none;
}

/* Show date below each dot on hover */
.outreach-dot::after {
    content: attr(data-date);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-top: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.outreach-dot:hover::after {
    opacity: 1;
}

/* Keep date within card bounds for edge dots */
.outreach-dot:first-child::after {
    left: 0;
    transform: none;
}

.outreach-dot:last-child::after {
    left: auto;
    right: 0;
    transform: none;
}

.no-outreach-indicator {
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.outreach-cell:hover .no-outreach-indicator {
    opacity: 1;
}

/* CSP Dashboard Cases Table - Optimized column widths */
#casesTable {
    table-layout: auto;
    overflow: visible;
}

#casesTable tr {
    position: relative;
}

#casesTable tr:has(.outreach-dot:hover) {
    z-index: 100;
}

#casesTable th,
#casesTable td {
    padding: 0.75rem 0.5rem;
}

#casesTable th:nth-child(1), /* Name */
#casesTable td:nth-child(1) {
    min-width: 120px;
}

#casesTable th:nth-child(2), /* Enrollment Status */
#casesTable td:nth-child(2) {
    white-space: nowrap;
}

#casesTable th:nth-child(3), /* Case Aide Hours */
#casesTable td:nth-child(3) {
    min-width: 100px;
}

#casesTable th:nth-child(4), /* Support Level */
#casesTable td:nth-child(4) {
    white-space: nowrap;
    text-align: center;
}

#casesTable th:nth-child(5), /* Weight */
#casesTable td:nth-child(5) {
    white-space: nowrap;
    text-align: center;
}

#casesTable th:nth-child(6), /* Outreach */
#casesTable td:nth-child(6) {
    min-width: 150px;
}

#casesTable th:nth-child(7), /* Last Contact */
#casesTable td:nth-child(7) {
    white-space: nowrap;
}

.outreach-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.outreach-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.outreach-documents {
    margin-top: 0.3rem;
}

.outreach-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--accent-purple);
    text-decoration: none;
    padding: 0.15rem 0.4rem;
    background: var(--primary-dark);
    border-radius: 4px;
    margin-right: 0.25rem;
}

.outreach-doc-link:hover {
    background: var(--accent-purple);
    color: white;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-top: 0.25rem;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--secondary-dark);
}

/* Document Type Dropdown in Activity Modal */
.doc-type-dropdown {
    position: absolute;
    max-height: 280px;
    z-index: 1100;
}

.doc-type-dropdown .search-result-item {
    padding: 0.6rem 1rem;
}

/* Allow dropdown to overflow modal - need !important to override base modal styles */
#activityModal .modal-body {
    overflow: visible !important;
}

#activityModal .modal-content {
    overflow: visible !important;
}

#activityModal .form-group {
    overflow: visible;
}

/* User Filter Input (CSP Dashboard) */
.user-filter-wrapper {
    position: relative;
    display: block;
    width: auto;
    min-width: 240px;
}

.user-filter-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    padding-right: 2rem;
    background-color: var(--primary-dark);
    border: 1px solid var(--accent-purple);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-filter-input:hover,
.user-filter-input:focus {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
    color: var(--text-on-accent);
    outline: none;
}

.user-filter-input::placeholder {
    color: var(--text-secondary);
}

/* Dropdown arrow for user filter */
.user-filter-wrapper::after {
    content: '▼';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.user-filter-wrapper:hover::after,
.user-filter-wrapper:focus-within::after {
    color: var(--text-on-accent);
}

/* User filter dropdown results */
.user-filter-wrapper .search-results-dropdown {
    min-width: 100%;
    left: 0;
    right: auto;
}

/* Additional Youth List (for outreach multi-select) */
.additional-youth-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.additional-youth-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--accent-purple);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
}

.additional-youth-tag button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.8;
}

.additional-youth-tag button:hover {
    opacity: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem;
    background-color: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background-color: rgba(var(--accent-purple-rgb), 0.1);
}

select.form-input option {
    background-color: var(--secondary-dark);
    color: var(--text-primary);
}

/* Modal select/dropdown styling - ensure consistent theme colors */
.modal select.form-input {
    background-color: var(--primary-dark);
    color: var(--text-primary);
    cursor: pointer;
}

.modal select.form-input:focus {
    background-color: var(--primary-dark);
}

.modal select.form-input option {
    background-color: var(--secondary-dark);
    color: var(--text-primary);
    padding: 0.5rem;
}

.modal select.form-input option:hover,
.modal select.form-input option:checked {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
}

/* Dark mode explicit fallbacks for select options (browsers often ignore CSS vars in options) */
[data-mode="dark"] .modal select.form-input,
[data-mode="dark"] select.form-input {
    background-color: #1a1d23;
    color: #e2e8f0;
}

[data-mode="dark"] .modal select.form-input option,
[data-mode="dark"] select.form-input option {
    background-color: #12151a;
    color: #e2e8f0;
}

/* Light mode explicit fallbacks for select options */
[data-mode="light"] .modal select.form-input,
[data-mode="light"] select.form-input {
    background-color: #f8f9fa;
    color: #1a1a1a;
}

[data-mode="light"] .modal select.form-input option,
[data-mode="light"] select.form-input option {
    background-color: #ffffff;
    color: #1a1a1a;
}

/* Theme-specific select overrides */
[data-theme="yellowjacket"][data-mode="dark"] .modal select.form-input,
[data-theme="yellowjacket"][data-mode="dark"] .modal select.form-input option {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="yellowjacket"][data-mode="light"] .modal select.form-input,
[data-theme="yellowjacket"][data-mode="light"] .modal select.form-input option {
    background-color: #ffffff;
    color: #000000;
}

[data-theme="royalty"][data-mode="dark"] .modal select.form-input,
[data-theme="royalty"][data-mode="dark"] .modal select.form-input option {
    background-color: #1a1520;
    color: #e2e8f0;
}

[data-theme="underworld"][data-mode="dark"] .modal select.form-input,
[data-theme="underworld"][data-mode="dark"] .modal select.form-input option {
    background-color: #0d0d0d;
    color: #e2e8f0;
}

[data-theme="underworld"][data-mode="light"] .modal select.form-input,
[data-theme="underworld"][data-mode="light"] .modal select.form-input option {
    background-color: #f5f5f5;
    color: #1a1a1a;
}

.form-input[readonly] {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Custom Checkbox Styling - Theme Aware */
.program-checkbox,
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.program-checkbox input[type="checkbox"],
.custom-checkbox input[type="checkbox"] {
    /* Hide native checkbox */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--secondary-dark);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.program-checkbox input[type="checkbox"]:hover,
.custom-checkbox input[type="checkbox"]:hover {
    border-color: var(--accent-purple);
    background-color: rgba(var(--accent-purple-rgb), 0.1);
}

.program-checkbox input[type="checkbox"]:checked,
.custom-checkbox input[type="checkbox"]:checked {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.program-checkbox input[type="checkbox"]:checked::after,
.custom-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.program-checkbox input[type="checkbox"]:focus,
.custom-checkbox input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--accent-purple-rgb), 0.3);
}

.program-checkbox input[type="checkbox"]:disabled,
.custom-checkbox input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.program-checkbox span,
.custom-checkbox span {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Program checkbox container */
.program-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border: 2px solid var(--text-secondary);
    border-radius: 24px;
    position: relative;
    transition: all 0.3s;
    display: inline-block;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 2px;
    left: 2px;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-purple);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background-color: var(--text-on-accent, #ffffff);
    box-shadow: 0 0 8px rgba(var(--accent-purple-rgb), 0.6);
}

/* Red Flag Badges */
.red-flag-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.red-flag-badge.no-flag {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.red-flag-badge.has-flag {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Tab badge for red flag count */
.tab-badge {
    background-color: #dc3545;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.35rem;
}

/* Red Flag Cards */
.red-flag-card {
    background-color: var(--secondary-dark);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    border-left: 4px solid #dc3545;
}

.red-flag-card.resolved {
    border-left-color: #4CAF50;
    opacity: 0.8;
}

.red-flag-card.severity-critical {
    border-left-color: #7b1fa2;
}

.red-flag-card.severity-high {
    border-left-color: #dc3545;
}

.red-flag-card.severity-medium {
    border-left-color: #ff9800;
}

.red-flag-card.severity-low {
    border-left-color: #ffc107;
}

.red-flag-header {
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.red-flag-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.red-flag-icon {
    font-size: 1rem;
}

.red-flag-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.red-flag-type {
    background-color: rgba(var(--accent-purple-rgb), 0.3);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.red-flag-severity {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.red-flag-severity.severity-critical {
    background-color: rgba(123, 31, 162, 0.3);
    color: #ce93d8;
}

.red-flag-severity.severity-high {
    background-color: rgba(220, 53, 69, 0.3);
    color: #f48fb1;
}

.red-flag-severity.severity-medium {
    background-color: rgba(255, 152, 0, 0.3);
    color: #ffcc80;
}

.red-flag-severity.severity-low {
    background-color: rgba(255, 193, 7, 0.3);
    color: #fff59d;
}

.red-flag-body {
    padding: 1rem;
}

.red-flag-body p {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.red-flag-body p:last-child {
    margin-bottom: 0;
}

.red-flag-footer {
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.red-flag-footer .resolved-info {
    color: #4CAF50;
}

.red-flag-resolution {
    padding: 0.75rem 1rem;
    background-color: rgba(76, 175, 80, 0.1);
    border-top: 1px solid rgba(76, 175, 80, 0.2);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =====================================================
   MEDICAL TAB STYLES
   ===================================================== */

/* Provider Type Tabs */
.provider-type-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.provider-type-tab {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--secondary-dark);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-type-tab:hover {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
    border-color: var(--accent-purple);
}

.provider-type-tab.active {
    background-color: var(--accent-purple);
    color: var(--text-on-accent);
    border-color: var(--accent-purple);
}

/* Medical List Cards */
.medical-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.medical-card {
    background-color: var(--secondary-dark);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent-purple);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.medical-card.inactive {
    opacity: 0.6;
    border-left-color: var(--text-muted);
}

.medical-card-info {
    flex: 1;
    min-width: 0;
}

.medical-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.medical-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.medical-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.medical-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.medical-card-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Medication card specific */
.medication-card {
    border-left-color: #2196F3;
}

/* Allergy card specific */
.allergy-card {
    border-left-color: #ff9800;
}

.allergy-card.severity-mild {
    border-left-color: #4CAF50;
}

.allergy-card.severity-moderate {
    border-left-color: #ff9800;
}

.allergy-card.severity-severe {
    border-left-color: #f44336;
}

.allergy-card.severity-life_threatening {
    border-left-color: #9c27b0;
}

/* Provider card specific */
.provider-card {
    border-left-color: #4CAF50;
}

.provider-card[data-type="dental"] {
    border-left-color: #00bcd4;
}

.provider-card[data-type="vision"] {
    border-left-color: #9c27b0;
}

.provider-card[data-type="mental_health"] {
    border-left-color: #e91e63;
}

.provider-card[data-type="pharmacy"] {
    border-left-color: #ff5722;
}

.provider-card .primary-badge {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Allergy severity badges */
.allergy-severity-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.allergy-severity-badge.mild {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.allergy-severity-badge.moderate {
    background-color: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.allergy-severity-badge.severe {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.allergy-severity-badge.life_threatening {
    background-color: rgba(156, 39, 176, 0.2);
    color: #ce93d8;
}

/* Small buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title-compact {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0.75rem 0 0.5rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.duration-display {
    color: var(--text-muted);
    font-weight: normal;
}

.input-with-suffix {
    position: relative;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.upload-area-small {
    border: 2px dashed var(--accent-purple);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    background-color: rgba(var(--accent-purple-rgb), 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.upload-area-small:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-color: var(--accent-purple-hover);
}

.upload-area-small svg {
    color: var(--accent-purple);
    margin-bottom: 0.35rem;
}

.upload-area-small p {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.9rem;
}

.upload-area-small small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.uploaded-files {
    margin-bottom: 0.75rem;
}

.uploaded-files h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.uploaded-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.remove-file-btn:hover {
    color: #F44336;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Caregiver Contact Card */
.caregiver-contact-card {
    background-color: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-purple);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.caregiver-contact-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.caregiver-contact-card .contact-info p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.caregiver-contact-card .contact-info strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

/* Time Selector */
.time-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-input {
    width: 80px;
    text-align: center;
}

/* Compact Modal Styling for Case Aide Reports */
#caseAideReportModal .modal-content {
    margin: 2% auto;
    max-height: 96vh;
    overflow-y: auto;
}

#caseAideReportModal .modal-header {
    padding: 0.75rem 1rem;
}

#caseAideReportModal .modal-header h2 {
    font-size: 1.1rem;
}

#caseAideReportModal .modal-body {
    padding: 0.75rem 1rem;
}

#caseAideReportModal .form-group {
    margin-bottom: 0.5rem;
}

#caseAideReportModal .form-row {
    margin-bottom: 0.5rem;
}

#caseAideReportModal .form-group label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

#caseAideReportModal .caregiver-contact-card-compact {
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

#caseAideReportModal .upload-area-small {
    padding: 0.75rem;
    margin-top: 0.5rem;
}

#caseAideReportModal .form-actions {
    margin-top: 0.75rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -0.75rem;
    padding: 1rem;
    background-color: var(--primary-dark);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

#caseAideReportModal .form-input,
#caseAideReportModal textarea.form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

#caseAideReportModal textarea.form-input {
    min-height: 50px;
}

/* Case Aide Report Modal - Mobile Responsive */
@media (max-width: 768px) {
    #caseAideReportModal .modal-content {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    #caseAideReportModal .modal-body {
        padding: 0.75rem;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: calc(100vh - 120px);
    }

    /* Ensure form doesn't overflow modal */
    #caseAideReportModal form {
        max-width: 100%;
        overflow: hidden;
    }

    #caseAideReportModal .form-group {
        max-width: 100%;
        overflow: visible;
    }

    /* Override inline grid-template-columns styles */
    #caseAideReportModal .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Two-column layout for compact fields on mobile */
    #caseAideReportModal .form-row-3 {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Youth header section - stack on mobile */
    #caseAideReportModal .case-aide-youth-header > div {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    #caseAideReportModal .case-aide-youth-header > div > div {
        flex: none !important;
        min-width: 100% !important;
        width: 100% !important;
    }

    /* Time selector - ensure it stays inline */
    #caseAideReportModal .time-selector {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    #caseAideReportModal .time-input {
        width: 60px !important;
        flex-shrink: 0;
    }

    /* Billable time section - 2 columns on mobile */
    #caseAideReportModal [style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Case aide search dropdown - contain within modal */
    #caseAideReportModal .search-results-dropdown {
        position: absolute;
        left: 0;
        right: 0;
        max-width: 100%;
        z-index: 1000;
    }

    /* Form actions - stack buttons on very small screens */
    #caseAideReportModal .form-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #caseAideReportModal .form-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }

    /* Caregiver card - more compact */
    #caseAideReportModal .caregiver-contact-card {
        padding: 0.75rem;
    }

    #caseAideReportModal .caregiver-contact-card > div {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    #caseAideReportModal #carCaregiverContact {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    #caseAideReportModal #carCaregiverContact span {
        margin-right: 0 !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #caseAideReportModal .form-row-3 {
        grid-template-columns: 1fr !important;
    }

    #caseAideReportModal [style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    #caseAideReportModal .form-actions .btn {
        width: 100%;
        min-width: 100%;
    }
}

/* ==============================================
   MESSAGING SYSTEM STYLES
   ============================================== */

/* Messaging Layout */
.messaging-layout {
    display: flex;
    height: calc(100vh - 220px);
    background: var(--primary-dark);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

/* Conversations Sidebar */
.conversations-sidebar {
    width: 360px;
    min-width: 300px;
    max-width: 400px;
    background: var(--secondary-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.conversation-search {
    margin: 1rem;
    margin-bottom: 0.5rem;
}

.conversation-search .search-input {
    background: var(--primary-dark);
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: var(--primary-dark);
}

.conversation-item.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
}

.conversation-item.active .conversation-name,
.conversation-item.active .conversation-last-message,
.conversation-item.active .conversation-time {
    color: white;
}

.conversation-item.unread .conversation-name {
    font-weight: 600;
}

.conversation-avatar-small {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
}

/* Avatar images in messaging */
.conversation-avatar-small img.conversation-avatar-img,
.conversation-avatar img.conversation-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-avatar img.suggestion-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    overflow: hidden;
}

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

.message-content-wrapper {
    flex: 1;
    min-width: 0;
}

.message-wrapper.incoming {
    display: flex;
    align-items: flex-start;
}

.conversation-preview {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: var(--accent-purple);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.conversation-last-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.conversation-item .unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-conversations {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Message Thread Area */
.message-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
}

/* Table row empty states */
tr.empty-state {
    display: table-row;
}

tr.empty-state td {
    background: var(--primary-dark) !important;
    border: none !important;
    padding: 0 !important;
    display: table-cell;
}

tr.empty-state td[colspan] {
    width: 100%;
    text-align: center;
}

tr.empty-state:hover td {
    background: var(--primary-dark) !important;
}

.table-empty-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Ensure table headers display correctly with empty state */
.data-table {
    table-layout: auto;
}

.data-table thead th {
    white-space: nowrap;
}

/* Card-based empty state (preferred for tables) */
.table-card .empty-state {
    padding: 3rem 2rem;
    text-align: center;
}

.table-card .empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.table-card .empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.table-card .empty-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Active Conversation View */
.active-conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--secondary-dark);
}

.mobile-back-btn {
    display: none;
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
}

.conversation-info {
    flex: 1;
}

.conversation-info h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.conversation-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.conversation-actions {
    position: relative;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.conversation-actions .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    display: none;
}

.conversation-actions .dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--primary-dark);
}

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

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.no-messages {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.date-separator {
    text-align: center;
    margin: 1rem 0;
}

.date-separator span {
    background: var(--secondary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.system-message {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.5rem;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message-wrapper.outgoing {
    align-self: flex-end;
}

.message-wrapper.incoming {
    align-self: flex-start;
}

/* Message layout with avatar */
.message-wrapper.has-avatar {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.message-wrapper.has-avatar.outgoing {
    flex-direction: row-reverse;
}

.message-wrapper.has-avatar.outgoing .message-sender-name {
    text-align: right;
    margin-left: 0;
    margin-right: 12px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.message-bubble-container {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.message-sender-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
    margin-left: 12px;
    font-weight: 500;
}

.message-sender {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
    margin-left: 12px;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    position: relative;
    max-width: 100%;
}

.message-wrapper.outgoing .message-bubble {
    background: var(--accent-purple);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-wrapper.incoming .message-bubble {
    background: var(--secondary-dark);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content {
    word-wrap: break-word;
    line-height: 1.4;
}

/* Clickable links in messages */
.message-link {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-color: rgba(var(--accent-color-rgb), 0.4);
    word-break: break-all;
    transition: text-decoration-color 0.15s;
}
.message-link:hover {
    text-decoration-color: var(--accent-color);
}
/* Ensure links in outgoing messages are visible */
.message-wrapper.outgoing .message-link {
    color: inherit;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}
.message-wrapper.outgoing .message-link:hover {
    text-decoration-color: rgba(255, 255, 255, 0.9);
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Message Seen Indicator */
.message-seen {
    font-size: 0.65rem;
    color: var(--success);
    font-weight: 500;
}

/* Message Reactions - Facebook-style corner placement */
.message-reactions {
    position: absolute;
    bottom: -10px;
    right: -6px;
    display: flex;
    gap: 0.15rem;
    z-index: 1;
}

.reaction-item {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.1rem 0.35rem;
    background: var(--card-bg);
    border-radius: 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.reaction-item:hover {
    transform: scale(1.1);
}

.reaction-item.user-reacted {
    background: rgba(var(--accent-purple-rgb), 0.2);
    border-color: var(--accent-purple);
}

/* Add padding to message bubble when it has reactions */
.message-bubble:has(.message-reactions) {
    margin-bottom: 12px;
}

/* Reaction Trigger Button (on hover) */
.reaction-trigger {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message-wrapper.incoming:hover .reaction-trigger {
    opacity: 1;
}

.reaction-trigger:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

/* Share Link Button in messages */
.share-link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.15s;
    margin: 0.25rem 0;
}
.share-link-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
}
.share-link-button svg {
    flex-shrink: 0;
}
/* Theme-specific share button text colors for contrast */
[data-theme="yellowjacket"] .share-link-button { color: #000; }
[data-theme="sovietmcdonalds"] .share-link-button { color: #000; }
[data-theme="royalty"] .share-link-button { color: #1a0a2e; }
[data-theme="matrix"] .share-link-button { background: #000000; color: #ffffff; }
[data-theme="yellowjacket"] .share-link-button:hover { color: #000; }
[data-theme="sovietmcdonalds"] .share-link-button:hover { color: #000; }
[data-theme="royalty"] .share-link-button:hover { color: #1a0a2e; }
[data-theme="matrix"] .share-link-button:hover { color: #cccccc; }
/* Inverted colors for outgoing messages - prevents button blending with bubble */
[data-theme="yellowjacket"] .message-wrapper.outgoing .share-link-button {
    background: #1a1a1a;
    color: #fff;
}
[data-theme="yellowjacket"] .message-wrapper.outgoing .share-link-button:hover { color: #e5e5e5; }
[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .share-link-button {
    background: #1a1a1a;
    color: #ef4444;
}
[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .share-link-button:hover { color: #f87171; }
[data-theme="matrix"] .message-wrapper.outgoing .share-link-button {
    background: #000000;
    color: #ffffff;
}
[data-theme="matrix"] .message-wrapper.outgoing .share-link-button:hover { color: #cccccc; }
[data-theme="royalty"] .message-wrapper.outgoing .share-link-button {
    background: #1a1a1a;
    color: #a855f7;
}
[data-theme="royalty"] .message-wrapper.outgoing .share-link-button:hover { color: #c084fc; }
[data-theme="default"] .message-wrapper.outgoing .share-link-button {
    background: #1a1a2e;
    color: #a78bfa;
}
[data-theme="default"] .message-wrapper.outgoing .share-link-button:hover { color: #c4b5fd; }
[data-theme="bubblegum"] .message-wrapper.outgoing .share-link-button {
    background: #1a1a1a;
    color: #f472b6;
}
[data-theme="bubblegum"] .message-wrapper.outgoing .share-link-button:hover { color: #f9a8d4; }
[data-theme="creamsicle"] .message-wrapper.outgoing .share-link-button {
    background: #1c1410;
    color: #ff9544;
}
[data-theme="creamsicle"] .message-wrapper.outgoing .share-link-button:hover { color: #ffbe8a; }
[data-theme="ocean"] .message-wrapper.outgoing .share-link-button {
    background: #0a1520;
    color: #38bdf8;
}
[data-theme="ocean"] .message-wrapper.outgoing .share-link-button:hover { color: #7dd3fc; }
[data-theme="cascadia"] .message-wrapper.outgoing .share-link-button {
    background: #0a1a14;
    color: #4ade80;
}
[data-theme="cascadia"] .message-wrapper.outgoing .share-link-button:hover { color: #86efac; }
[data-theme="oldschool"] .message-wrapper.outgoing .share-link-button {
    background: #1a1510;
    color: #fbbf24;
}
[data-theme="oldschool"] .message-wrapper.outgoing .share-link-button:hover { color: #fcd34d; }
[data-theme="underworld"] .message-wrapper.outgoing .share-link-button {
    background: #1a1a1a;
    color: #a1a1aa;
}
[data-theme="underworld"] .message-wrapper.outgoing .share-link-button:hover { color: #d4d4d8; }

/* =====================================================
   MESSAGE REPLY FUNCTIONALITY
   ===================================================== */

/* Reply Trigger Button (on hover) */
.reply-trigger {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
}

.message-wrapper.incoming .reply-trigger {
    right: -70px;
}

.message-wrapper.outgoing .reply-trigger {
    left: -36px;
}

.message-wrapper:hover .reply-trigger {
    opacity: 1;
}

.reply-trigger:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

/* Reply Preview in Compose Area */
.reply-preview {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--primary-dark);
    border-radius: 8px;
    border-left: 3px solid var(--accent-purple);
}

.reply-preview-bar {
    display: none; /* Using border-left instead */
}

.reply-preview-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reply-preview-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
}

.reply-preview-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
}

.reply-preview-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Reply Quote in Message Bubble */
.message-reply-quote {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.message-reply-quote:hover {
    background: rgba(0, 0, 0, 0.25);
}

.reply-quote-bar {
    width: 3px;
    background: var(--accent-purple);
    border-radius: 2px;
    flex-shrink: 0;
}

.message-wrapper.outgoing .reply-quote-bar {
    background: rgba(255, 255, 255, 0.6);
}

.reply-quote-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reply-quote-sender {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.9;
}

.reply-quote-text {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight animation for scrolled-to messages */
.message-wrapper.highlight-message .message-bubble {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: none; }
    25%, 75% { box-shadow: 0 0 0 3px var(--accent-purple), 0 0 15px rgba(139, 92, 246, 0.4); }
}

/* Mobile adjustments for reply */
@media (max-width: 768px) {
    .reply-trigger {
        opacity: 0.7; /* Always slightly visible on mobile */
    }

    .message-wrapper.incoming .reply-trigger {
        right: -64px;
    }

    .message-wrapper.outgoing .reply-trigger {
        left: -32px;
    }
}

/* =====================================================
   AUDIO MESSAGES
   ===================================================== */

/* Record Button in Compose Area */
.audio-record-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 8px;
    background: var(--primary-dark);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
    box-sizing: border-box;
}

.audio-record-btn:hover {
    background: var(--accent-purple);
    color: white;
}

/* Recording UI */
.recording-ui {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-dark);
    border-radius: 20px;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: recordingPulse 1s infinite;
}

@keyframes recordingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

.recording-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
}

.recording-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 32px;
    min-width: 100px;
}

.recording-cancel,
.recording-stop {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording-cancel {
    color: var(--text-secondary);
}

.recording-cancel:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.recording-stop {
    width: 44px;
    height: 44px;
    background: #ef4444;
    color: white;
}

.recording-stop:hover {
    background: #dc2626;
}

/* Pending Audio Preview */
.pending-audio-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.audio-waveform-preview {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 32px;
    flex: 1;
}

.audio-duration {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.audio-preview-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    line-height: 1;
}

.audio-preview-remove:hover {
    color: #ef4444;
}

/* Waveform Bars (shared between recording and playback) */
.waveform-bar {
    width: 3px;
    background: var(--accent-purple);
    border-radius: 2px;
    transition: height 0.1s ease;
}

/* Audio Player in Messages */
.audio-message-player {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 180px;
    max-width: 240px;
    width: 100%;
    box-sizing: border-box;
}

.audio-message-player.voice-message {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.audio-message-player.voice-message .audio-player-controls {
    display: contents;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.audio-file-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.25rem;
}

.audio-file-name svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.audio-file-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-wrapper.outgoing .audio-file-name {
    color: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.audio-play-btn:hover {
    transform: scale(1.05);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-waveform {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1px;
    height: 32px;
    position: relative;
    cursor: pointer;
    user-select: none;
    touch-action: none;
    overflow: hidden;
}

.audio-waveform .waveform-bar {
    flex: 1 1 0;
    min-width: 1px;
    max-width: 4px;
    opacity: 0.4;
}

.audio-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1px;
    pointer-events: none;
    clip-path: inset(0 100% 0 0);
    overflow: hidden;
}

/* Playhead - vertical line at current position */
.audio-playhead {
    position: absolute;
    left: 0;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--accent-purple);
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(139, 92, 246, 0.5);
    pointer-events: none;
    transform: translateX(-50%);
}

/* Played portion of waveform - highlight bars */
.audio-progress .waveform-bar {
    flex: 1 1 0;
    min-width: 1px;
    max-width: 4px;
    opacity: 1;
    background: var(--accent-purple);
}

/* Outgoing message playhead */
.message-wrapper.outgoing .audio-playhead {
    background: white;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.message-wrapper.outgoing .audio-progress .waveform-bar {
    background: white;
    opacity: 1;
}

/* Yellowjacket theme playhead */
[data-theme="yellowjacket"] .message-wrapper.outgoing .audio-playhead {
    background: #000000;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

[data-theme="yellowjacket"] .message-wrapper.outgoing .audio-progress .waveform-bar {
    background: #000000;
}

/* Royalty theme playhead */
[data-theme="royalty"] .message-wrapper.outgoing .audio-playhead {
    background: #1a0a2e;
    box-shadow: 0 0 4px rgba(26, 10, 46, 0.3);
}

[data-theme="royalty"] .message-wrapper.outgoing .audio-progress .waveform-bar {
    background: #1a0a2e;
}

/* Soviet McDonalds theme playhead */
[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .audio-playhead {
    background: #330000;
    box-shadow: 0 0 4px rgba(51, 0, 0, 0.3);
}

[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .audio-progress .waveform-bar {
    background: #330000;
}

/* Underworld light theme playhead */
[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .audio-playhead {
    background: #3d3020;
    box-shadow: 0 0 4px rgba(61, 48, 32, 0.3);
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .audio-progress .waveform-bar {
    background: #3d3020;
}

.audio-time {
    font-size: 0.75rem;
    opacity: 0.7;
    min-width: 35px;
    text-align: right;
}

.audio-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    opacity: 0.6;
    transition: all 0.15s ease;
    margin-left: 0.25rem;
}

.audio-download-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.message-wrapper.outgoing .audio-download-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.message-wrapper.outgoing .audio-download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Theme-specific adjustments for audio in outgoing messages */
.message-wrapper.outgoing .audio-message-player {
    background: rgba(255, 255, 255, 0.15);
}

.message-wrapper.outgoing .audio-play-btn {
    background: white;
    color: var(--accent-purple);
}

.message-wrapper.outgoing .waveform-bar {
    background: white;
}

.message-wrapper.outgoing .audio-waveform .waveform-bar {
    opacity: 0.5;
}

/* Yellowjacket theme: dark audio player elements on yellow outgoing messages */
[data-theme="yellowjacket"] .message-wrapper.outgoing .audio-play-btn {
    background: #000000;
    color: #ffd700;
}

[data-theme="yellowjacket"] .message-wrapper.outgoing .waveform-bar {
    background: #000000;
}

[data-theme="yellowjacket"] .message-wrapper.outgoing .audio-time {
    color: #000000;
}

[data-theme="yellowjacket"] .message-wrapper.outgoing .audio-file-name {
    color: #000000;
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

[data-theme="yellowjacket"] .message-wrapper.outgoing .audio-file-name svg {
    stroke: #000000;
}

/* Royalty theme: dark audio player elements on gold outgoing messages */
[data-theme="royalty"] .message-wrapper.outgoing .audio-play-btn {
    background: #1a0a2e;
    color: #d4af37;
}

[data-theme="royalty"] .message-wrapper.outgoing .waveform-bar {
    background: #1a0a2e;
}

[data-theme="royalty"] .message-wrapper.outgoing .audio-time {
    color: #1a0a2e;
}

[data-theme="royalty"] .message-wrapper.outgoing .audio-file-name {
    color: #1a0a2e;
    border-bottom-color: rgba(26, 10, 46, 0.2);
}

[data-theme="royalty"] .message-wrapper.outgoing .audio-file-name svg {
    stroke: #1a0a2e;
}

/* Underworld light (Overworld) theme: dark audio elements */
[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .audio-play-btn {
    background: #3d3020;
    color: #d4af37;
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .waveform-bar {
    background: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .audio-time {
    color: #3d3020;
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .audio-file-name {
    color: #3d3020;
    border-bottom-color: rgba(61, 48, 32, 0.2);
}

[data-theme="underworld"][data-mode="light"] .message-wrapper.outgoing .audio-file-name svg {
    stroke: #3d3020;
}

/* Soviet McDonalds theme: dark audio elements on red/gold */
[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .audio-play-btn {
    background: #330000;
    color: #ffd700;
}

[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .waveform-bar {
    background: #330000;
}

[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .audio-time {
    color: #330000;
}

[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .audio-file-name {
    color: #330000;
    border-bottom-color: rgba(51, 0, 0, 0.2);
}

[data-theme="sovietmcdonalds"] .message-wrapper.outgoing .audio-file-name svg {
    stroke: #330000;
}

/* Mobile adjustments for audio */
@media (max-width: 768px) {
    .audio-message-player {
        min-width: 180px;
        max-width: 240px;
    }

    .recording-waveform {
        max-width: 120px;
    }

    .recording-ui {
        padding: 0.5rem;
    }
}

/* Reaction Picker */
.reaction-picker {
    position: fixed;
    transform: translateY(-100%) translateY(-8px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0.4rem 0.5rem;
    display: flex;
    gap: 0.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: fadeIn 0.15s ease;
}

.reaction-option {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    line-height: 1;
}

.reaction-option:hover {
    background: rgba(var(--accent-purple-rgb), 0.3);
    transform: scale(1.2);
}

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

/* "More" button in reaction picker */
.reaction-more {
    font-size: 1rem !important;
    font-weight: 600;
    color: var(--text-muted);
}

/* Full Emoji Picker */
.full-emoji-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    max-width: 90vw;
    max-height: 70vh;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
}

.full-emoji-picker.show {
    opacity: 1;
    visibility: visible;
    animation: emojiPickerFadeIn 0.15s ease-out;
}

@keyframes emojiPickerFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.emoji-picker-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.emoji-search {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.emoji-search:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.emoji-picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 4px;
}

.emoji-picker-close:hover {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
}

.emoji-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.emoji-category {
    margin-bottom: 1rem;
}

.emoji-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.emoji-option {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    line-height: 1;
}

.emoji-option:hover {
    background: rgba(var(--accent-purple-rgb), 0.3);
    transform: scale(1.15);
}

/* Message Attachments */
.message-attachments {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-image {
    display: block;
    max-width: 250px;
    border-radius: 8px;
    overflow: hidden;
}

.attachment-image img {
    width: 100%;
    height: auto;
    display: block;
}

.attachment-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
}

.attachment-file:hover {
    background: rgba(0,0,0,0.3);
}

.attachment-file small {
    opacity: 0.7;
    margin-left: auto;
}

/* Compose Area */
.compose-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-dark);
}

.compose-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.compose-attachments:empty {
    display: none;
}

.pending-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary-dark);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.pending-attachment button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.pending-attachment button:hover {
    color: #ef4444;
}

/* Pending audio attachment with waveform preview */
.pending-audio-attachment {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--primary-dark);
    border-radius: 8px;
    position: relative;
}

.pending-audio-attachment > button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.pending-audio-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-audio-info svg {
    color: var(--accent-purple);
    flex-shrink: 0;
}

.pending-audio-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.pending-audio-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
    padding-right: 1.5rem;
}

.pending-audio-waveform-mini {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
    padding: 0 0.25rem;
}

.waveform-bar-mini {
    width: 2px;
    min-height: 3px;
    background: var(--accent-purple);
    border-radius: 1px;
    opacity: 0.7;
}

.compose-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 8px;
    background: var(--primary-dark);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
    box-sizing: border-box;
}

.attach-btn:hover {
    background: var(--accent-purple);
    color: white;
}

.compose-input-row textarea {
    flex: 1;
    resize: none;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--primary-dark);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
    max-height: 150px;
}

.compose-input-row textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.compose-input-row textarea::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* New Message Modal */
.message-type-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.type-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--primary-dark);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.type-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

/* Recipient Input */
.recipient-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 44px;
    align-items: center;
}

.recipient-input-container .form-input {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    padding: 0.25rem;
}

.recipient-input-container .form-input:focus {
    outline: none;
    box-shadow: none;
    background: transparent;
}

.selected-recipients {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--accent-purple);
    color: white;
    border-radius: 16px;
    font-size: 0.85rem;
}

.recipient-chip button {
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.recipient-chip button:hover {
    opacity: 1;
}

/* Recipient Suggestions */
.recipient-suggestions {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: var(--primary-dark);
}

.suggestion-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    overflow: hidden;
}

.suggestion-info {
    flex: 1;
}

.suggestion-name {
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.no-suggestions {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Loading Spinner for Messages */
.messages-container .loading-spinner,
.conversations-list .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.75rem;
    color: var(--text-secondary);
}

/* Loading more messages indicator (infinite scroll) */
.loading-more-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Messaging Mobile Responsive */
@media (max-width: 768px) {
    .messaging-layout {
        height: calc(100vh - 180px - env(safe-area-inset-bottom, 0px));
        position: relative;
        overflow: hidden;
    }

    .conversations-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        z-index: 10;
        transition: transform 0.3s ease;
        transform: translateX(0);
        overflow: hidden;
    }

    .messaging-layout.show-thread .conversations-sidebar {
        transform: translateX(-100%);
        visibility: hidden;
    }

    .message-thread {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: var(--primary-dark);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow: hidden;
    }

    .messaging-layout.show-thread .message-thread {
        transform: translateX(0);
        display: flex;
    }

    .mobile-back-btn {
        display: flex;
    }

    .message-wrapper {
        max-width: 85%;
    }

    .conversation-header {
        padding: 0.75rem 1rem;
    }

    .sidebar-header {
        padding: 0.75rem 1rem;
    }

    .compose-area {
        padding: 0.75rem;
    }

    .conversation-search {
        margin: 0.75rem;
        width: calc(100% - 1.5rem);
        box-sizing: border-box;
    }

    .conversation-search .search-input {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .conversation-avatar-small {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 0.8rem;
    }

    .conversation-item {
        padding: 0.75rem;
    }

    .message-bubble {
        padding: 0.625rem 0.875rem;
    }
}

/* =====================================================
   ENROLLMENT HISTORY TIMELINE
   Visual timeline showing enrollment history and re-enrollments
   ===================================================== */

/* Main container for enrollment history section */
.enrollment-history-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.enrollment-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.enrollment-history-header:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.05);
}

.enrollment-history-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enrollment-history-header .toggle-icon {
    transition: transform 0.2s;
}

.enrollment-history-header.expanded .toggle-icon {
    transform: rotate(180deg);
}

.enrollment-history-badge {
    background: var(--accent-purple);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

/* Enrollment periods list */
.enrollment-periods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual enrollment period card */
.enrollment-period {
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.enrollment-period:hover {
    border-color: var(--accent-purple);
}

.enrollment-period.current {
    border-color: var(--success);
    box-shadow: 0 0 0 1px var(--success);
}

/* Enrollment period header (always visible) */
.enrollment-period-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.enrollment-period-header:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.05);
}

.enrollment-period.expanded .enrollment-period-header {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
    border-bottom: 1px solid var(--border-color);
}

.enrollment-number {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 100px;
}

.enrollment-number .current-badge {
    background: var(--success);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
}

.enrollment-status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Status colors for enrollment badges */
.enrollment-status-badge.referred {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.enrollment-status-badge.outreach {
    background: rgba(var(--accent-purple-rgb), 0.15);
    color: var(--accent-purple);
}

.enrollment-status-badge.pending {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
}

.enrollment-status-badge.enrolled {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.enrollment-status-badge.discharged {
    background: rgba(244, 164, 96, 0.15);
    color: var(--accent-orange);
}

.enrollment-status-badge.exited {
    background: rgba(108, 117, 125, 0.15);
    color: var(--text-muted);
}

.enrollment-status-badge.rejected {
    background: rgba(220, 53, 69, 0.15);
    color: var(--error);
}

.enrollment-dates {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.enrollment-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.enrollment-toggle {
    background: rgba(var(--accent-purple-rgb), 0.1);
    border: 1px solid rgba(var(--accent-purple-rgb), 0.3);
    color: var(--accent-purple);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.enrollment-toggle:hover {
    background: rgba(var(--accent-purple-rgb), 0.2);
    border-color: var(--accent-purple);
}

.enrollment-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.enrollment-period.expanded .enrollment-toggle {
    background: var(--accent-purple);
    color: white;
}

.enrollment-period.expanded .enrollment-toggle svg {
    transform: rotate(180deg);
}

/* Enrollment period details (expandable) */
.enrollment-period-details {
    display: none;
    padding: 1rem;
    background: var(--card-bg);
}

.enrollment-period.expanded .enrollment-period-details {
    display: block;
}

/* Status timeline visualization within enrollment */
.enrollment-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--primary-dark);
    border-radius: 6px;
    flex-wrap: wrap;
}

.enrollment-timeline-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.enrollment-timeline-dot .dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    transition: transform 0.15s;
}

.enrollment-timeline-dot .dot:hover {
    transform: scale(1.15);
}

.enrollment-timeline-dot .date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Timeline dot colors by status */
.enrollment-timeline-dot .dot.referred {
    background: #2196F3;
}

.enrollment-timeline-dot .dot.outreach {
    background: var(--accent-purple);
}

.enrollment-timeline-dot .dot.pending {
    background: #FFC107;
    color: #1a1a2e;
}

.enrollment-timeline-dot .dot.enrolled {
    background: var(--success);
}

.enrollment-timeline-dot .dot.discharged {
    background: var(--accent-orange);
}

.enrollment-timeline-dot .dot.exited {
    background: var(--text-muted);
}

/* Arrow between timeline dots */
.enrollment-timeline-arrow {
    color: var(--accent-purple);
    flex-shrink: 0;
}

.enrollment-timeline-arrow svg {
    width: 20px;
    height: 20px;
}

/* Details grid within expanded enrollment */
.enrollment-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.enrollment-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.enrollment-detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enrollment-detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.enrollment-detail-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Exit reason special styling */
.enrollment-exit-reason {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.enrollment-exit-reason .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.enrollment-exit-reason .value {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Empty state */
.enrollment-history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Loading state */
.enrollment-history-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .enrollment-period-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .enrollment-number {
        min-width: auto;
        width: 100%;
    }

    .enrollment-dates {
        width: 100%;
        order: 3;
    }

    .enrollment-toggle {
        position: absolute;
        right: 0.75rem;
        top: 0.75rem;
    }

    .enrollment-period-header {
        position: relative;
        padding-right: 3rem;
    }

    .enrollment-timeline {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .enrollment-details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .enrollment-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Ultra-compact tables for small mobile screens */
@media (max-width: 500px) {
    .data-table {
        font-size: 0.5rem !important;
        border-spacing: 1px 0 !important;
    }

    .data-table th {
        padding: 0.25rem 0.15rem !important;
        font-size: 0.45rem !important;
        letter-spacing: -0.3px !important;
    }

    /* Fix sort icons */
    .data-table th::after {
        font-size: 0.4rem !important;
        margin-left: 2px !important;
        position: relative !important;
        top: 0 !important;
    }

    .data-table td {
        padding: 0.25rem 0.15rem !important;
    }

    /* Names/links in table */
    .data-table td a {
        font-size: 0.5rem !important;
    }

    .data-table .status-badge {
        font-size: 0.4rem !important;
        padding: 0.1rem 0.2rem !important;
    }

    .hours-progress-mini {
        min-width: 30px !important;
    }

    .hours-text {
        font-size: 0.4rem !important;
    }

    .progress-bar-mini {
        height: 3px !important;
    }

    .outreach-timeline-card {
        min-width: 40px !important;
        padding: 0.2rem !important;
    }

    .outreach-timeline {
        gap: 2px !important;
    }

    .outreach-dot {
        width: 12px !important;
        height: 12px !important;
    }

    .outreach-dot svg {
        width: 8px !important;
        height: 8px !important;
    }

    .outreach-arrow {
        display: none !important;
    }

    .outreach-last-date {
        font-size: 0.4rem !important;
    }

    .no-outreach-indicator {
        font-size: 0.45rem !important;
        padding: 0.15rem 0.25rem !important;
    }
}

/* ==========================================
   TASKS SYSTEM STYLES
   ========================================== */

/* Priority Indicators - small colored dots */
.priority-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.priority-indicator.priority-low {
    background-color: #4caf50;
}

.priority-indicator.priority-medium {
    background-color: #2196f3;
}

.priority-indicator.priority-high {
    background-color: #ff9800;
}

.priority-indicator.priority-urgent {
    background-color: #f44336;
    animation: pulse-urgent 1.5s infinite;
}

@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.priority-badge.priority-low {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.priority-badge.priority-medium {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.priority-badge.priority-high {
    background-color: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.priority-badge.priority-urgent {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* Task Status Badges (extend existing status badge styles) */
.status-badge.status-in_progress {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-badge.status-completed {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-badge.status-cancelled {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

/* Task Table Styles */
.task-title-cell {
    display: flex;
    align-items: center;
}

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

.task-title-link:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

/* Overdue Row Highlighting */
.data-table tr.overdue-row {
    background-color: rgba(244, 67, 54, 0.08);
}

.data-table tr.overdue-row:hover {
    background-color: rgba(244, 67, 54, 0.12);
}

/* Overdue row for workspace widget tables */
.widget-table tr.task-row-overdue td {
    background: rgba(244, 67, 54, 0.08);
}
.widget-table tr.task-row-overdue:hover td {
    background: rgba(244, 67, 54, 0.15);
}

/* Text helpers for tasks */
.text-danger {
    color: #f44336 !important;
}

.text-muted {
    color: var(--text-muted);
}

/* Badge info style for auto-generated indicator */
.badge.badge-info {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    margin-left: 0.5rem;
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

/* Tasks Filter Controls */
.tasks-filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--secondary-dark);
    border-radius: 8px;
}

.tasks-filter-bar .search-box {
    flex: 1;
    min-width: 200px;
}

.tasks-filter-bar select {
    min-width: 140px;
}

/* Workspace Tasks Widget Styles */
.workspace-task-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.workspace-task-item:last-child {
    border-bottom: none;
}

.workspace-task-item:hover {
    background-color: rgba(var(--accent-purple-rgb), 0.1);
}

.workspace-task-item.overdue {
    background-color: rgba(244, 67, 54, 0.08);
}

.workspace-task-item.overdue:hover {
    background-color: rgba(244, 67, 54, 0.12);
}

.task-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-item-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.task-item-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-youth,
.task-program {
    color: var(--text-secondary);
}

.task-due.text-danger {
    color: #f44336;
    font-weight: 500;
}

.empty-widget-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Action buttons in task table */
.actions-cell {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-sm svg {
    display: block;
}

/* Modal medium size for task modal */
.modal-content.modal-medium {
    max-width: 550px;
}

/* Form row for side-by-side fields */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Required field indicator */
.form-label.required::after {
    content: ' *';
    color: var(--error);
}

/* ==========================================
   SCHEDULE CALENDAR STYLES
   ========================================== */

.schedule-calendar {
    width: 100%;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    overflow: visible;
    padding-top: 4px; /* Space for button hover animation */
}

.schedule-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.schedule-nav .btn {
    padding: 0.5rem 0.75rem;
}

.schedule-nav .btn svg {
    display: block;
}

.schedule-title h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

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

/* Calendar Grid */
.schedule-grid-wrapper {
    overflow-x: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.schedule-grid {
    width: 100%;
    min-width: 800px;
    table-layout: fixed;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.schedule-grid th,
.schedule-grid td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    vertical-align: top;
}

.schedule-grid thead th {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-on-accent);
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.schedule-grid th.staff-column {
    width: 150px;
    min-width: 150px;
    text-align: left;
}

.schedule-grid th.day-column {
    width: calc((100% - 150px) / 7);
}

.schedule-grid th.day-column.today {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e8945a 100%);
}

.schedule-grid th.day-column.today .day-name,
.schedule-grid th.day-column.today .day-date {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.day-name {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day-date {
    font-size: 1rem;
    font-weight: 700;
}

/* Staff Cell */
.staff-cell {
    background: var(--primary-dark);
    min-height: 80px;
}

.staff-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.staff-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Staff Info with Avatar */
.staff-info-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.staff-avatar.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-avatar.initials-only {
    background: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-avatar.initials-only span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.staff-details {
    flex: 1;
    min-width: 0;
}

/* Day Cell */
.day-cell {
    min-height: 80px;
    background: var(--secondary-dark);
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.day-cell:hover {
    background: var(--primary-dark);
}

.day-cell.today {
    background: rgba(244, 164, 96, 0.1);
    border-left: 2px solid var(--accent-orange);
    border-right: 2px solid var(--accent-orange);
}

.day-cell.today:hover {
    background: rgba(244, 164, 96, 0.25);
}

/* Schedule Events */
.schedule-event {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    /* Ensure CM color stripe is visible with dark outline */
    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.3);
}

/* CM color stripe outline for visibility on any theme */
.schedule-event[style*="border-left"] {
    position: relative;
}

.schedule-event[style*="border-left"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), 1px 0 0 rgba(255, 255, 255, 0.1);
}

.schedule-event:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1;
    position: relative;
}

.schedule-event:last-child {
    margin-bottom: 0;
}

/* Event time and title on separate lines */
.schedule-event .event-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.9;
    margin-bottom: 0.15rem;
}

.schedule-event .event-title {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
    word-break: break-word;
}

/* Event type colors */
.schedule-event.source-report {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-hover) 100%);
    color: var(--text-on-accent);
}

.schedule-event.type-meeting {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.schedule-event.type-training {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.schedule-event.type-appointment {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: white;
}

.schedule-event.type-shift {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #1a1a1a;
}

.schedule-event.type-other {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: white;
}

/* Status modifiers */
.schedule-event.status-complete {
    opacity: 0.7;
    border-left: 3px solid var(--success);
}

.schedule-event.status-draft {
    opacity: 0.8;
    border-left: 3px solid var(--warning);
    border-style: dashed;
}

/* Yellowjacket theme: ensure black text on yellow for readability */
[data-theme="yellowjacket"] .staff-avatar.initials-only span {
    color: #000000;
}

[data-theme="yellowjacket"] .schedule-event.source-report {
    color: #000000;
}

.event-text {
    display: block;
    word-break: break-word;
    line-height: 1.3;
}

/* Schedule Legend */
.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.legend-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-cm-section {
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color-stripe {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.legend-color.source-report {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-hover) 100%);
}

.legend-color.type-meeting {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.legend-color.type-training {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* Program badges on calendar events (multi-program mode) */
.event-program-badge {
    display: block;
    width: fit-content;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background: #6b7280;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

/* Program-specific badge colors - solid backgrounds with white text */
.event-program-badge.program-csp {
    background: #7c3aed;
}

.event-program-badge.program-brs {
    background: #d97706;
}

.event-program-badge.program-trad {
    background: #059669;
}

.event-program-badge.program-lifeset {
    background: #2563eb;
}

.event-program-badge.program-iyhp {
    background: #db2777;
}

/* Staff column header centered */
.schedule-grid th.staff-column {
    text-align: center;
}

.legend-color.status-complete {
    background: var(--card-bg);
    border: 2px solid var(--success);
    opacity: 0.7;
}

.legend-color.status-draft {
    background: var(--card-bg);
    border: 2px dashed var(--warning);
}

/* Event Popup */
.event-popup {
    position: fixed;
    z-index: 10000;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    max-width: 350px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.event-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-radius: 8px 8px 0 0;
}

.event-popup-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-on-accent);
}

.popup-close {
    background: none;
    border: none;
    color: var(--text-on-accent);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

.popup-close:hover {
    opacity: 1;
}

.event-popup-body {
    padding: 1rem;
}

.popup-row {
    display: flex;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.popup-row:last-child {
    margin-bottom: 0;
}

.popup-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.popup-value {
    color: var(--text-primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cm-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.popup-description {
    flex-direction: column;
}

.popup-description .popup-value {
    margin-top: 0.25rem;
    padding: 0.5rem;
    background: var(--primary-dark);
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.event-popup-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .schedule-header {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-nav {
        justify-content: center;
    }

    .schedule-title {
        text-align: center;
    }

    .schedule-title h2 {
        font-size: 1.1rem;
    }

    .schedule-actions {
        justify-content: center;
    }

    .schedule-grid {
        min-width: 600px;
    }

    .schedule-grid th.staff-column {
        width: 100px;
        min-width: 100px;
    }

    .schedule-grid th.day-column {
        min-width: 70px;
    }

    .staff-name {
        font-size: 0.8rem;
    }

    .staff-role {
        display: none;
    }

    .day-name {
        font-size: 0.7rem;
    }

    .day-date {
        font-size: 0.85rem;
    }

    .schedule-event {
        font-size: 0.65rem;
        padding: 0.25rem 0.35rem;
    }

    .schedule-legend {
        justify-content: center;
    }

    .event-popup {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    .schedule-grid {
        min-width: 500px;
    }

    .schedule-grid th.staff-column {
        width: 80px;
        min-width: 80px;
    }

    .schedule-grid th.day-column {
        min-width: 55px;
    }

    .day-cell {
        min-height: 60px;
    }
}

/* ==========================================
   ALL STAFF ROW & SCOPE BADGES
   ========================================== */

/* All Staff row styling */
.all-staff-row {
    background: linear-gradient(180deg, rgba(var(--accent-purple-rgb), 0.08) 0%, transparent 100%);
}

.all-staff-cell {
    background: linear-gradient(135deg, rgba(var(--accent-purple-rgb), 0.15) 0%, rgba(var(--accent-purple-rgb), 0.05) 100%) !important;
    border-bottom: 2px solid var(--accent-purple) !important;
}

.all-staff-day-cell {
    background: rgba(var(--accent-purple-rgb), 0.05) !important;
    border-bottom: 2px solid var(--accent-purple) !important;
}

.all-staff-day-cell:hover {
    background: rgba(var(--accent-purple-rgb), 0.12) !important;
}

.all-staff-day-cell.today {
    background: rgba(244, 164, 96, 0.15) !important;
}

.all-staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
}

/* Scoped event styling */
.schedule-event.scoped-event {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-hover) 100%);
    color: var(--text-on-accent);
    border-left: none;
}

.schedule-event.scope-organization {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

.schedule-event.scope-program {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

/* Event scope badges (on calendar) */
.event-scope-badge {
    display: block;
    width: fit-content;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.event-scope-badge.scope-org {
    background: #111111;
    color: #ffffff;
}

.event-scope-badge.scope-program {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Program-specific scope badge colors */
.event-scope-badge.program-csp {
    background: #7c3aed;
}

.event-scope-badge.program-brs {
    background: #d97706;
}

.event-scope-badge.program-trad {
    background: #059669;
}

.event-scope-badge.program-lifeset {
    background: #2563eb;
}

.event-scope-badge.program-iyhp {
    background: #db2777;
}

.event-scope-badge.program-il {
    background: #0891b2;
}

/* External calendar synced events */
.schedule-event.source-external {
    border-left: 3px solid var(--event-feed-color, #4285f4);
    position: relative;
}

.schedule-event.source-external::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--event-feed-color, #4285f4);
    opacity: 0.8;
}

/* External source badge */
.event-source-badge {
    display: block;
    width: fit-content;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

.event-source-badge.external {
    background: #111111;
    color: #ffffff;
}

/* External feeds legend section */
.legend-feeds-section {
    flex-wrap: wrap;
}

/* Popup scope badge styling */
.popup-scope-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.popup-scope-badge.scope-org {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.popup-scope-badge.scope-program {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Mobile adjustments for All Staff row */
@media (max-width: 768px) {
    .all-staff-row .staff-role {
        display: block;
        font-size: 0.65rem;
    }

    .event-scope-badge {
        font-size: 0.45rem;
        padding: 0.1rem 0.25rem;
    }
}

/* ==========================================
   CASE DOCUMENTS TAB STYLES
   ========================================== */

/* Filter Pills Container */
.case-doc-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Document Type Filter Dropdown */
.case-doc-type-filter {
    position: relative;
    min-width: 220px;
}

.case-doc-type-select {
    position: relative;
}

.case-doc-type-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.3));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.case-doc-type-display:hover {
    border-color: var(--accent-purple);
    background: var(--primary-dark, rgba(0, 0, 0, 0.4));
}

.case-doc-type-display .selected-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-doc-type-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 250px;
    max-height: 350px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1050;
    overflow: hidden;
}

.case-doc-type-dropdown.show {
    display: block;
}

.case-doc-type-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.case-doc-type-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.case-doc-type-search input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.case-doc-type-options {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.case-doc-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.1s ease;
}

.case-doc-type-option:hover {
    background: var(--bg-tertiary);
}

.case-doc-type-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

.case-doc-type-option.hidden {
    display: none;
}

.case-doc-type-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Legacy filter pills - keep for backwards compatibility */
.case-doc-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.case-doc-filter-pill {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.3));
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.case-doc-filter-pill:hover {
    background: var(--primary-dark, rgba(0, 0, 0, 0.5));
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.case-doc-filter-pill.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: var(--text-on-accent);
}

.case-doc-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.case-doc-controls .search-box {
    min-width: 180px;
}

/* Date Range Filter */
.case-doc-date-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.case-doc-date-filter label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.case-doc-date-filter .date-input {
    width: 140px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.case-doc-date-filter .btn-sm {
    padding: 0.35rem 0.5rem;
    min-width: auto;
}

/* Add New Dropdown */
.case-doc-add-dropdown {
    position: relative;
}

.case-doc-add-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 100;
    display: none;
}

.case-doc-add-dropdown .dropdown-menu.show {
    display: block;
}

.case-doc-add-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.case-doc-add-dropdown .dropdown-item:hover {
    background: var(--secondary-dark);
}

.case-doc-add-dropdown .dropdown-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Case Documents Table */
.case-doc-table {
    width: 100%;
}

/* Sortable column headers */
.case-doc-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

.case-doc-table th.sortable:hover {
    background: var(--accent-purple);
    color: var(--text-on-accent);
}

.case-doc-table th.sortable::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-muted);
    margin-top: 3px;
    opacity: 0.4;
}

.case-doc-table th.sortable::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-bottom-color: var(--text-muted);
    margin-top: -9px;
    opacity: 0.4;
}

.case-doc-table th.sortable.sort-asc::before {
    border-bottom-color: var(--text-primary);
    opacity: 1;
}

.case-doc-table th.sortable.sort-asc::after {
    opacity: 0.3;
}

.case-doc-table th.sortable.sort-desc::after {
    border-top-color: var(--text-primary);
    opacity: 1;
}

.case-doc-table th.sortable.sort-desc::before {
    opacity: 0.3;
}

.case-doc-table th.date-col,
.case-doc-table td.date-col {
    width: 100px;
}

.case-doc-table th.type-col,
.case-doc-table td.type-col {
    width: 100px;
}

.case-doc-table th.status-col,
.case-doc-table td.status-col {
    width: 130px;
}

.case-doc-table th.created-by-col,
.case-doc-table td.created-by-col {
    width: 130px;
}

.case-doc-table th.actions-col,
.case-doc-table td.actions-col {
    width: 50px;
    text-align: center;
}

/* Type Badges */
.case-doc-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.case-doc-type-badge.type-activity {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.case-doc-type-badge.type-ca-report {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.case-doc-type-badge.type-case-note {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.case-doc-type-badge.type-document {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.case-doc-type-badge.type-referral {
    background: rgba(244, 114, 182, 0.2);
    color: #f472b6;
}

/* Specific Document Type Badges */
.case-doc-type-badge.type-face-to-face {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.case-doc-type-badge.type-on-call {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.case-doc-type-badge.type-referral-activity {
    background: rgba(244, 114, 182, 0.2);
    color: #f472b6;
}

.case-doc-type-badge.type-general-case-note {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.case-doc-type-badge.type-ftdm {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.case-doc-type-badge.type-spm {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.case-doc-type-badge.type-outreach {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

/* Document Row Expand/Collapse */
.case-doc-row {
    cursor: pointer;
}

.case-doc-row:hover {
    background: var(--secondary-dark);
}

.case-doc-row.expanded {
    background: var(--secondary-dark);
}

.case-doc-expand-btn {
    padding: 0.35rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.case-doc-expand-btn .expand-icon {
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.case-doc-row.expanded .case-doc-expand-btn .expand-icon {
    transform: rotate(180deg);
}

/* Case Documents Accordion Content Row */
.case-doc-accordion-content-row {
    background: var(--bg-secondary);
}

.case-doc-accordion-content-row > td {
    padding: 0 !important;
    border-top: none !important;
}

.case-doc-accordion-content {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: block !important;
    width: 100%;
    box-sizing: border-box;
}

.case-doc-accordion-content .accordion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
    .case-doc-accordion-content .accordion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .case-doc-accordion-content .accordion-grid {
        grid-template-columns: 1fr;
    }
}

.accordion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.accordion-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.accordion-detail label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0;
}

.accordion-detail span {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.accordion-notes {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--secondary-dark);
    border-radius: 6px;
}

.accordion-notes label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.5rem;
}

.accordion-notes p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.accordion-notes.accordion-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.accordion-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.accordion-actions .btn {
    min-width: auto;
}

.accordion-actions .action-buttons-left {
    display: flex;
    gap: 0.5rem;
}

.accordion-actions .action-buttons-right {
    display: flex;
    gap: 0.5rem;
}

.accordion-actions .btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.priority-low {
    background: var(--secondary-dark);
    color: var(--text-muted);
}

.priority-badge.priority-medium {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.priority-badge.priority-high {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.priority-badge.priority-urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Source Badges */
.source-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.source-badge.source-compliance {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.source-badge.source-upload {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

/* Empty State */
.case-doc-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.case-doc-empty svg {
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

/* Status badge extensions for case documents */
.status-badge.status-draft {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.status-badge.status-pending,
.status-badge.status-in-review {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-badge.status-needs-revision {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-badge.status-ready-for-case-aide {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.status-badge.status-new {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.status-badge.status-declined {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-badge.status-waitlisted {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 992px) {
    .case-doc-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .case-doc-filter-pills {
        order: 1;
    }

    .case-doc-controls {
        order: 2;
        flex-wrap: wrap;
    }

    .case-doc-controls .search-box {
        flex: 1;
        min-width: 150px;
    }

    .case-doc-date-filter {
        width: 100%;
        order: -1;
    }

    .case-doc-date-filter .date-input {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .case-doc-table th.created-by-col,
    .case-doc-table td.created-by-col {
        display: none;
    }

    .accordion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .case-doc-filter-pill {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }

    .case-doc-table th.status-col,
    .case-doc-table td.status-col {
        display: none;
    }

    .accordion-grid {
        grid-template-columns: 1fr;
    }

    .accordion-actions {
        flex-wrap: wrap;
    }
}

/* Catchment Area Searchable Dropdown */
#catchmentAreaResults {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    width: max-content;
    z-index: 9999;
}

.filter-panel,
.client-sidebar {
    overflow: visible;
}

/* Ensure filter group with dropdown can overflow */
.filter-group[style*="position: relative"] {
    overflow: visible;
}

/* Override: Make catchment dropdown use fixed positioning to escape all containers */
#catchmentAreaResults {
    position: fixed !important;
    min-width: 220px;
    max-height: 250px;
    z-index: 99999 !important;
}

/* ==========================================
   STAFF AVAILABILITY STYLES
   ========================================== */

/* Availability Modal Sections */
.availability-section {
    margin-bottom: 2rem;
}

.availability-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.availability-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* Weekly Schedule Grid */
.availability-week-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.availability-day {
    display: grid;
    grid-template-columns: 100px auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-height: 48px;
}

.availability-day-header {
    display: contents;
}

.availability-day-header .day-name {
    font-weight: 600;
    color: var(--text-primary);
}

.availability-day-header .add-block-btn {
    justify-self: start;
}

.availability-day-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.no-blocks-message {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Time Block Pills */
.time-block {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(var(--accent-purple-rgb), 0.15);
    border: 1px solid var(--accent-purple);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.time-block .btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
}

.time-block .btn-delete:hover {
    color: #ef4444;
}

/* Add Block Button */
.add-block-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Override Form Section */
.override-form {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.override-form .form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.override-form .form-group {
    flex: 1;
    min-width: 150px;
}

.override-form .form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Overrides List Table */
.overrides-list {
    margin-top: 1rem;
}

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

.overrides-table th,
.overrides-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.overrides-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.override-type-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.override-type-badge.override-unavailable {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.override-type-badge.override-modified {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.override-type-badge.override-available {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

/* Time Block Presets */
.time-block-presets {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-xs {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Calendar Availability Indicators */
.availability-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.8;
}

.availability-indicator.status-available {
    background-color: #22c55e;
}

.availability-indicator.status-unavailable {
    background-color: #ef4444;
}

.availability-indicator.status-modified {
    background-color: #f59e0b;
}

.availability-indicator.status-no-pattern {
    background-color: #64748b;
    opacity: 0.5;
}

/* Ensure day cells have relative positioning for indicators */
.schedule-grid .day-cell {
    position: relative;
}

/* Conflict Warning */
.conflict-warning {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.conflict-warning-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}

.conflict-warning-content {
    flex: 1;
}

.conflict-warning-title {
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 0.25rem;
}

.conflict-warning-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.conflict-available-hours {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Find Available Staff Modal */
.find-staff-search {
    margin-bottom: 1.5rem;
}

.find-staff-results {
    min-height: 200px;
}

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

.available-staff-table th,
.available-staff-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.available-staff-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.available-staff-table .staff-row {
    cursor: pointer;
    transition: background 0.15s;
}

.available-staff-table .staff-row:hover {
    background: var(--bg-tertiary);
}

.available-staff-table .staff-row.selected {
    background: rgba(var(--accent-purple-rgb), 0.1);
}

.no-search-message,
.no-results-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Loading Message */
.loading-message {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Icon Button Base */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

.btn-icon.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Mobile responsiveness for availability */
@media (max-width: 768px) {
    .availability-day {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5rem;
    }

    .availability-day-header .day-name {
        grid-column: 1;
        grid-row: 1;
    }

    .availability-day-header .add-block-btn {
        grid-column: 2;
        grid-row: 1;
    }

    .availability-day-blocks {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .availability-section-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .override-form .form-row {
        flex-direction: column;
    }

    .override-form .form-group {
        min-width: 100%;
    }

    .time-block-presets {
        justify-content: center;
    }
}

/* ==========================================
   AVAILABILITY CALENDAR VIEW
   ========================================== */

/* Modal Overrides for Full-Width */
.availability-calendar-modal .modal-content.modal-fullwidth {
    max-width: 95vw;
    width: 1400px;
    max-height: 90vh;
}

.availability-calendar-modal .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    padding: 1rem 1.5rem;
}

/* Calendar Controls */
.availability-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.availability-week-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.availability-week-nav .week-display {
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.availability-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.availability-filters select {
    min-width: 150px;
}

/* Legend */
.availability-legend {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.availability-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.availability-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.availability-legend .legend-color.available {
    background: #22c55e;
}

.availability-legend .legend-color.unavailable {
    background: #ef4444;
}

.availability-legend .legend-color.modified {
    background: #f59e0b;
}

.availability-legend .legend-color.no-pattern {
    background: #64748b;
    opacity: 0.5;
}

.availability-legend .legend-color.scheduled {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

.availability-legend .legend-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

/* Calendar Grid Wrapper */
.availability-calendar-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Calendar Grid Table */
.availability-calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.availability-calendar-grid th,
.availability-calendar-grid td {
    border: 1px solid var(--border-color);
    padding: 0;
    vertical-align: top;
}

.availability-calendar-grid th {
    background: var(--bg-tertiary);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
}

.availability-calendar-grid th.staff-column {
    width: 200px;
    min-width: 200px;
    text-align: left;
    padding-left: 1rem;
}

.availability-calendar-grid th.day-column {
    min-width: 120px;
}

.availability-calendar-grid th.day-column.today {
    background: rgba(var(--accent-purple-rgb), 0.15);
}

.availability-calendar-grid th .day-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.availability-calendar-grid th .day-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Staff Cell */
.availability-calendar-grid .staff-cell {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid var(--border-color);
}

.availability-calendar-grid .staff-info-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.availability-calendar-grid .staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.availability-calendar-grid .staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.availability-calendar-grid .staff-details {
    overflow: hidden;
}

.availability-calendar-grid .staff-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.availability-calendar-grid .staff-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Availability Day Cells */
.availability-day-cell {
    background: var(--bg-primary);
    min-height: 70px;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0.5rem;
}

.availability-day-cell:hover {
    background: var(--bg-tertiary);
}

.availability-day-cell.today {
    background: rgba(var(--accent-purple-rgb), 0.05);
}

.availability-day-cell.today:hover {
    background: rgba(var(--accent-purple-rgb), 0.1);
}

.availability-day-cell.past {
    opacity: 0.6;
}

.availability-day-cell.selected {
    background: rgba(var(--accent-purple-rgb), 0.15);
    box-shadow: inset 0 0 0 2px var(--accent-purple);
}

/* Status-based backgrounds */
.availability-day-cell.status-unavailable {
    background: rgba(239, 68, 68, 0.08);
}

.availability-day-cell.status-unavailable:hover {
    background: rgba(239, 68, 68, 0.12);
}

.availability-day-cell.status-no_pattern {
    background: rgba(100, 116, 139, 0.05);
}

/* Availability Blocks within cells */
.availability-block {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.availability-block:last-child {
    margin-bottom: 0;
}

.availability-block.available {
    background: rgba(34, 197, 94, 0.15);
    border-left: 3px solid #22c55e;
    color: var(--text-primary);
}

.availability-block.available.modified {
    background: rgba(245, 158, 11, 0.15);
    border-left: 3px solid #f59e0b;
}

.availability-block.unavailable {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    color: #ef4444;
}

.availability-block.no-pattern {
    background: transparent;
    border-left: 3px solid var(--border-color);
    color: var(--text-muted);
}

.availability-block .block-time {
    font-weight: 500;
}

.availability-block .block-label {
    font-weight: 500;
}

.availability-block .block-reason {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

/* Selection Info Panel */
.availability-selection-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(var(--accent-purple-rgb), 0.1);
    border: 1px solid var(--accent-purple);
    border-radius: 8px;
    margin-top: 1rem;
}

.availability-selection-info .selection-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.availability-selection-info .selection-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.availability-selection-info #selectedStaffName {
    font-weight: 600;
}

.availability-selection-info #selectedDateTime {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.availability-selection-info #selectedDateTime::before {
    content: "·";
    margin-right: 0.5rem;
}

/* Loading and Empty States */
.availability-calendar-grid .loading-cell,
.availability-calendar-grid .empty-cell,
.availability-calendar-grid .error-cell {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .availability-calendar-modal .modal-content.modal-fullwidth {
        max-width: 98vw;
        margin: 1vh auto;
    }

    .availability-calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .availability-week-nav {
        justify-content: center;
    }

    .availability-filters {
        justify-content: center;
    }

    .availability-calendar-grid th.staff-column {
        width: 150px;
        min-width: 150px;
    }

    .availability-calendar-grid th.day-column {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .availability-legend {
        justify-content: center;
    }

    .availability-calendar-grid .staff-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .availability-calendar-grid .staff-name {
        font-size: 0.8rem;
    }

    .availability-calendar-grid .staff-role {
        display: none;
    }

    .availability-selection-info {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .availability-selection-info .selection-content {
        flex-direction: column;
    }

    .availability-selection-info #selectedDateTime::before {
        display: none;
    }
}

/* Scheduled Events in Availability Calendar */
.availability-day-cell .cell-events {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.calendar-event-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
    background: rgba(var(--accent-purple-rgb), 0.15);
    border-left: 2px solid var(--accent-purple);
    color: var(--text-primary);
    overflow: hidden;
}

.calendar-event-pill:last-child {
    margin-bottom: 0;
}

.calendar-event-pill .event-time {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.calendar-event-pill .event-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    flex-shrink: 0;
}

.calendar-event-pill .event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* Event Type Colors */
.calendar-event-pill.event-type-visit {
    background: rgba(34, 197, 94, 0.15);
    border-left-color: #22c55e;
}

.calendar-event-pill.event-type-visit .event-initials {
    background: #22c55e;
}

.calendar-event-pill.event-type-meeting {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: #3b82f6;
}

.calendar-event-pill.event-type-meeting .event-initials {
    background: #3b82f6;
}

.calendar-event-pill.event-type-training {
    background: rgba(168, 85, 247, 0.15);
    border-left-color: #a855f7;
}

.calendar-event-pill.event-type-training .event-initials {
    background: #a855f7;
}

.calendar-event-pill.event-type-court {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: #ef4444;
}

.calendar-event-pill.event-type-court .event-initials {
    background: #ef4444;
}

.calendar-event-pill.event-type-appointment {
    background: rgba(6, 182, 212, 0.15);
    border-left-color: #06b6d4;
}

.calendar-event-pill.event-type-appointment .event-initials {
    background: #06b6d4;
}

.calendar-event-pill.event-type-transport {
    background: rgba(245, 158, 11, 0.15);
    border-left-color: #f59e0b;
}

.calendar-event-pill.event-type-transport .event-initials {
    background: #f59e0b;
}

.calendar-event-pill.event-type-shift {
    background: rgba(16, 185, 129, 0.15);
    border-left-color: #10b981;
}

.calendar-event-pill.event-type-shift .event-initials {
    background: #10b981;
}

.calendar-event-pill.event-type-respite {
    background: rgba(236, 72, 153, 0.15);
    border-left-color: #ec4899;
}

.calendar-event-pill.event-type-respite .event-initials {
    background: #ec4899;
}

.calendar-event-pill.event-type-other {
    background: rgba(100, 116, 139, 0.15);
    border-left-color: #64748b;
}

.calendar-event-pill.event-type-other .event-initials {
    background: #64748b;
}

/* Has events indicator */
.availability-day-cell.has-events {
    min-height: 90px;
}

/* Mobile adjustments for events */
@media (max-width: 768px) {
    .calendar-event-pill {
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
    }

    .calendar-event-pill .event-initials {
        width: 14px;
        height: 14px;
        font-size: 0.55rem;
    }

    .calendar-event-pill .event-title {
        display: none;
    }
}
