/*
 * IT Database Design System - Core CSS
 * Based on STYLES.md standards
 * Modern CSS with Bootstrap 5 compatibility
 */

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */
:root {
    /* Primary Brand Colors */
    --primary-blue: #007bff;
    --primary-green: #28a745;
    --primary-teal: #20c997;
    
    /* Semantic Colors */
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    
    /* Neutral Grays */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #6c757d;
    --gray-500: #495057;
    --gray-600: #343a40;
    --gray-700: #212529;

    /* Semantic Tokens for Better Accessibility */
    --on-surface-primary: var(--text-primary);
    --on-surface-secondary: var(--text-secondary);
    --on-surface-muted: var(--text-muted);

    /* Link colors - theme-aware */
    --link-color: #0d6efd;
    --link-hover: #0a58ca;

    /* Accent text tokens for content on surfaces */
    --accent-on-surface-primary: var(--primary-blue);
    --accent-on-surface-success: var(--success);
    --accent-on-surface-danger: var(--danger);
    --accent-on-surface-info: var(--info);

    /* Typography */
    --font-family-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-monospace: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */

    /* App-Specific Color Accents */
    --crm-primary: #475569;  /* Professional slate-blue instead of bright green */
    --crm-gradient: linear-gradient(135deg, #475569 0%, #64748b 100%);
    --timer-primary: #007bff;
    --timer-gradient: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
    --assets-primary: #fd7e14;
    --assets-gradient: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
    --projects-primary: #6f42c1;
    --projects-gradient: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
}

/* ===== LIGHT THEME COLORS ===== */
:root,
:root[data-bs-theme="light"] {
    color-scheme: light;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    --text-primary: #212529;
    /* #5c636a (was #6c757d): darkened so .text-muted meets WCAG AA 4.5:1 on the
       gray card gradient (#e9ecef) and the #f8f9fa body, not just pure white. */
    --text-secondary: #5c636a;
    --text-muted: #495057;
    
    --border-color: #dee2e6;
    --border-light: #eceff1;
    --border-focus: rgba(0, 123, 255, 0.25);
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.2);
    
    /* Link colors for light theme */
    --link-color: #0d6efd;
    --link-hover: #0a58ca;
}

/* ===== DARK THEME COLORS ===== */
:root[data-bs-theme="dark"] {
    color-scheme: dark;
    
    --bg-primary: #2d3748;
    --bg-secondary: #1a202c;
    --bg-tertiary: #121212;
    
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #93a4b8;
    
    --border-color: #4a5568;
    --border-light: rgba(255,255,255,0.16);
    --border-focus: rgba(66, 153, 225, 0.5);
    
    /* Higher-contrast accents for text on dark surfaces */
    --primary-blue: #0d6efd;
    --success: #39c65d;
    --danger: #ff5c6c;
    --info: #39c0e0;
    
    /* Map accent text tokens to high-contrast values */
    --accent-on-surface-primary: var(--primary-blue);
    --accent-on-surface-success: var(--success);
    --accent-on-surface-danger: var(--danger);
    --accent-on-surface-info: var(--info);
    
    /* Links in dark should be brighter to read as links */
    --link-color: #66b2ff;
    --link-hover: #9cc9ff;
    
    /* Stronger shadows for better card separation */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.40);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.40);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.60);

    /* Dark mode gradients */
    --crm-gradient: linear-gradient(135deg, #198754 0%, #0d6efd 100%);
    --timer-gradient: linear-gradient(135deg, #0056b3 0%, #5a2d91 100%);
    --assets-gradient: linear-gradient(135deg, #e55a4e 0%, #b02a37 100%);
    --projects-gradient: linear-gradient(135deg, #59359a 0%, #c2185b 100%);
}

/* ===== BASE STYLES ===== */
body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    font-weight: 400;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== HEADER & BRANDING ===== */
.brand-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.brand-logo:hover {
    opacity: 0.8;
    text-decoration: none;
}

.brand-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.brand-name {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .brand-header {
    background: var(--bg-primary);
    border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .brand-name {
    color: var(--text-primary);
}

/* Responsive header */
@media (max-width: 768px) {
    .brand-logo img {
        height: 40px;
    }
    
    .brand-name {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        gap: 0.75rem;
    }
    
    .brand-logo img {
        height: 35px;
    }
    
    .brand-name {
        font-size: 1.25rem;
    }
}

/* ===== TYPOGRAPHY ===== */
.h1, h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; }
.h2, h2 { font-size: 2rem;   font-weight: 600; line-height: 1.3; }
.h3, h3 { font-size: 1.75rem; font-weight: 600; line-height: 1.3; }
.h4, h4 { font-size: 1.5rem;  font-weight: 600; line-height: 1.4; }
.h5, h5 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.h6, h6 { font-size: 1rem;    font-weight: 600; line-height: 1.5; }

.text-lg    { font-size: 1.125rem; line-height: 1.6; }
.text-base  { font-size: 1rem;     line-height: 1.6; }
.text-sm    { font-size: 0.875rem; line-height: 1.5; }
.text-xs    { font-size: 0.75rem;  line-height: 1.4; }

.text-display { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.text-lead    { font-size: 1.25rem; font-weight: 400; line-height: 1.6; opacity: 0.9; }

.text-muted { color: var(--text-secondary) !important; }
.text-subtle { color: var(--text-muted) !important; }
.text-emphasis { font-weight: 600; }
.text-mono { font-family: var(--font-family-monospace); }

/* ===== LINKS ===== */
a { 
    color: var(--link-color); 
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover, a:focus { 
    color: var(--link-hover); 
    text-decoration: underline;
}

/* ===== FORM HEADERS (CRM GOLD STANDARD) ===== */
.form-header {
    /* Modern 4-color gradient (match contact-header) */
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 35%, #007bff 70%, #0056b3 100%) !important;
    color: white;
    padding: 16px 0;
    margin-bottom: 16px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

[data-bs-theme="dark"] .form-header {
    background: linear-gradient(135deg, #0d6efd 0%, #198754 100%);
}

/* CONTACT HEADER GRADIENT - BEAUTIFUL 4-COLOR FLOW
   Density pass 2026-08-06 (Keith: "everything looks enormous"): page headers
   slimmed platform-wide — 30px padding/margins were eating a third of the
   viewport before content started. Titles/subtitles scale down with it below. */
.contact-header {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 35%, #5f672770 70%, #8cff0003 100%) !important;
    color: white !important;
    padding: 16px 20px !important;
    margin-bottom: 16px !important;
    border-radius: 0 0 15px 15px !important;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3) !important;
}

/* Slim the header text with the header: templates mostly use h1.h2 (2rem) +
   a subtitle p — scale both down without touching every template. The class
   selectors out-rank Bootstrap's .h2/.mb-2 utility classes. */
.contact-header h1,
.form-header h1 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.contact-header p,
.form-header p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

[data-bs-theme="dark"] .contact-header {
    background: linear-gradient(135deg, #0d6efd 0%, #198754 100%) !important;
}

/* CRITICAL: Header button styling - maintains our gradient system with readability */
.form-header .btn-primary,
.contact-header .btn-primary,
.gradient-header .btn-primary {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(78, 205, 196, 0.3), rgba(69, 183, 209, 0.3), rgba(150, 206, 180, 0.3)) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-header .btn-secondary,
.contact-header .btn-secondary,
.gradient-header .btn-secondary {
    background: linear-gradient(135deg, rgba(155, 164, 181, 0.3), rgba(206, 212, 218, 0.3), rgba(173, 181, 189, 0.3)) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-header .btn-success,
.contact-header .btn-success,
.gradient-header .btn-success {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(40, 167, 69, 0.3)) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    /*text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;*/
    border-radius: 8px !important;
}

.form-header .btn-danger,
.contact-header .btn-danger,
.gradient-header .btn-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.3), rgba(255, 107, 107, 0.3), rgba(231, 76, 60, 0.3), rgba(255, 99, 132, 0.3)) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Contact header delete button: explicit theme readability to match org */
[data-bs-theme="light"] .contact-header .btn-danger { color: #000000 !important; }
[data-bs-theme="dark"] .contact-header .btn-danger { color: #ffffff !important; }

/* Light mode white halo for black text on header buttons (contact + organization) */
/* Removed light-mode text shadows for crisper black text */

.form-header .btn-info,
.contact-header .btn-info,
.gradient-header .btn-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(23, 162, 184, 0.3)) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
}

/* Contact header specific readability fixes (light mode) */
[data-bs-theme="light"] .contact-header .btn-outline-success {
    color: #111827 !important;
    text-shadow: none !important;
}
[data-bs-theme="light"] .contact-header.gradient-header .btn-outline-success {
    color: #111827 !important;
    text-shadow: none !important;
}
[data-bs-theme="light"] .contact-header .timetracking-inject-btn {
    color: #111827 !important;
    text-shadow: none !important;
}

/* Ensure light-mode hover/active flips to white on contact Start Timer */
[data-bs-theme="light"] .contact-header .btn-outline-success:hover,
[data-bs-theme="light"] .contact-header .btn-outline-success:focus,
[data-bs-theme="light"] .contact-header .btn-outline-success:active,
[data-bs-theme="light"] .contact-header .timetracking-inject-btn:hover,
[data-bs-theme="light"] .contact-header .timetracking-inject-btn:focus,
[data-bs-theme="light"] .contact-header .timetracking-inject-btn:active {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
}
[data-bs-theme="light"] .contact-header .btn-danger {
    color: #111827 !important;
    text-shadow: none !important;
}

/* Header button hover states - enhanced gradients with readability */
.form-header .btn-primary:hover,
.contact-header .btn-primary:hover,
.gradient-header .btn-primary:hover,
.form-header .btn-primary:focus,
.contact-header .btn-primary:focus,
.gradient-header .btn-primary:focus,
.form-header .btn-primary:active,
.contact-header .btn-primary:active,
.gradient-header .btn-primary:active {
    background: linear-gradient(135deg, #007bff, #0056b3, #17a2b8, #20c997, #4ecdc4) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.form-header .btn-secondary:hover,
.contact-header .btn-secondary:hover,
.gradient-header .btn-secondary:hover,
.form-header .btn-secondary:focus,
.contact-header .btn-secondary:focus,
.gradient-header .btn-secondary:focus,
.form-header .btn-secondary:active,
.contact-header .btn-secondary:active,
.gradient-header .btn-secondary:active {
    background: linear-gradient(135deg, #6c757d, #9ba4b5, #ced4da, #adb5bd, #e9ecef) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.form-header .btn-success:hover,
.contact-header .btn-success:hover,
.gradient-header .btn-success:hover,
.form-header .btn-success:focus,
.contact-header .btn-success:focus,
.gradient-header .btn-success:focus {
    background: linear-gradient(135deg, #ffffff, #28a745) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
    transform: translateY(-1px);
}

.form-header .btn-danger:hover,
.contact-header .btn-danger:hover,
.gradient-header .btn-danger:hover,
.form-header .btn-danger:focus,
.contact-header .btn-danger:focus,
.gradient-header .btn-danger:focus,
.form-header .btn-danger:active,
.contact-header .btn-danger:active,
.gradient-header .btn-danger:active {
    background: linear-gradient(135deg, #dc3545, #ff6b6b, #e74c3c, #ff6384, #ff5722) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.form-header .btn-info:hover,
.contact-header .btn-info:hover,
.gradient-header .btn-info:hover,
.form-header .btn-info:focus,
.contact-header .btn-info:focus,
.gradient-header .btn-info:focus {
    background: linear-gradient(135deg, #ffffff, #17a2b8) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
    transform: translateY(-1px);
}

/* Header button active states - solid colors with readability */
.form-header .btn:active,
.contact-header .btn:active,
.gradient-header .btn:active {
    border-radius: 8px !important;
    transform: translateY(0) scale(0.98) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
    animation: none !important;
}

/* Old CSS breathing animation removed - using JavaScript wind-blown fire effects instead */

/* FLOATING PARTICLES EFFECT FOR BUTTONS - DISABLED (CAUSING WEIRD DOTS) */
/* @keyframes float-particles {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) rotate(360deg);
        opacity: 0;
    }
} */

/* GRADIENT FLOW ANIMATION */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.form-container {
    background: #f1f3f4;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

[data-bs-theme="dark"] body {
    background: #000000 !important; /* Black background like production */
}

[data-bs-theme="dark"] .form-container {
    background: #2d3748;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    color: #e2e8f0;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 8px;
    border-left: 6px solid #20c997;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

[data-bs-theme="dark"] .form-section {
    background: #4a5568;
    border: 1px solid #6b7280;
    border-left: 6px solid #20c997;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.form-section h5 {
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-bs-theme="dark"] .form-section h5 {
    color: #f7fafc;
}

.form-actions {
    background: #e9ecef;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #ced4da;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .form-actions {
    background: #4a5568;
}

.form-help {
    background: linear-gradient(135deg, #d1ecf1 0%, #e2e3ff 35%, #fde2e4 70%, #fff2cc 100%);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 6px solid #20c997;
    border: 1px solid #b3d7ff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .form-help {
    background: linear-gradient(135deg, #263238 0%, #37474f 100%);
    border-left-color: #20c997;
}

/* Mobile responsive adjustments for forms */
@media (max-width: 768px) {
    .form-header {
        padding: 20px 0;
    }
    
    .form-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-section {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .form-actions {
        padding: 15px;
        margin-top: 15px;
    }
    
    .form-help {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .form-actions .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .form-actions .btn {
        margin-bottom: 5px;
    }
    
    /* Fix dropdown width on mobile */
    .form-select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure form controls don't overflow */
    .form-control, .form-select {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ===== CARDS (PRIMARY COMPONENT) ===== */
.app-card,
.organization-item,
.contact-card,
.activity-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

/* COOL CARD HOVER ANIMATIONS - Like Contact Page ✨ */
.app-card:hover,
.organization-item:hover,
.contact-card:hover,
.activity-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 123, 255, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
}

[data-bs-theme="dark"] .app-card:hover,
[data-bs-theme="dark"] .organization-item:hover,
[data-bs-theme="dark"] .contact-card:hover,
[data-bs-theme="dark"] .activity-card:hover {
    box-shadow: 
        0 8px 25px rgba(100, 200, 255, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: rgba(100, 200, 255, 0.4);
}

/* Card Variants */
.app-card.primary   { border-left: 4px solid var(--primary-blue); }
.app-card.success   { border-left: 4px solid var(--success); }
.app-card.info      { border-left: 4px solid var(--info); }
.app-card.warning   { border-left: 4px solid var(--warning); }
.app-card.danger    { border-left: 4px solid var(--danger); }

/* App-specific card colors */
.app-card.crm         { border-left-color: var(--crm-primary); }
.app-card.timetracking { border-left-color: var(--timer-primary); }
.app-card.assets      { border-left-color: var(--assets-primary); }
.app-card.projects    { border-left-color: var(--projects-primary); }

/* Glass Morphism Card */
.app-card.glass {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .app-card.glass {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* ===== CARDS & CONTENT (Enhanced Contrast + Modern Effects) ===== */
.card,
.info-card {
    background: linear-gradient(135deg, #e9ecef 0%, #f1f3f4 50%, #e9ecef 100%);
    border: 1px solid #ced4da;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* COOL HOVER ANIMATIONS - Consistent with other cards ✨ */
.card:hover,
.info-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 123, 255, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
    cursor: default; /* Fix confusing pointer cursor - these aren't clickable */
}

/* Apply same hover animation to form sections/containers for edit pages */
.form-section:hover,
.form-container:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 6px 18px rgba(0, 123, 255, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 123, 255, 0.25);
}

[data-bs-theme="dark"] .card:hover,
[data-bs-theme="dark"] .info-card:hover {
    box-shadow: 
        0 8px 25px rgba(100, 200, 255, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: rgba(100, 200, 255, 0.4);
    cursor: default; /* Fix confusing pointer cursor - these aren't clickable */
}


/* Modern glassmorphism effect for cards */
.card,
.info-card {
    position: relative;  /* CRITICAL: Required for ::before positioning */
    overflow: hidden;    /* Clips the shimmer animation */
}

.card::before,
.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
    z-index: 0;
}

.card:hover::before,
.info-card:hover::before {
    left: 100%;
}

/* Disable shimmer effect ONLY on form-container (parent), not form-section (children) */
.form-container.info-card::before,
.form-container.info-card:hover::before {
    display: none;
}

/* Utility: disable shimmer on cards that contain dropdowns or other overflow content.
   Also lifts the card-header above sibling card-body so dropdown menus are not hidden
   behind later DOM siblings (all card children get z-index:1 from the rule below).

   Extended 2026-05-11 to cover .form-section — same pattern (overflow:hidden was set
   defensively against a hypothetical ::before shimmer), same fix. Apply `no-shimmer`
   to any form-section that contains an absolutely-positioned dropdown (e.g. the
   attendees autocomplete in crm/activities/activity_form.html). */
.card.no-shimmer,
.info-card.no-shimmer,
.form-section.no-shimmer {
    overflow: visible !important;
}
.card.no-shimmer::before,
.card.no-shimmer:hover::before,
.info-card.no-shimmer::before,
.info-card.no-shimmer:hover::before,
.form-section.no-shimmer::before,
.form-section.no-shimmer:hover::before {
    display: none !important;
}
.card.no-shimmer > .card-header,
.info-card.no-shimmer > .section-header {
    z-index: 2;
}
.card.no-shimmer > .card-footer {
    z-index: 2;
}
/* Lift the WHOLE no-shimmer card/section above later sibling cards.
   The header/footer rules above only help dropdowns that live in the card
   HEADER. A dropdown in the card BODY (org search, PM/team-member autocomplete,
   attendee pickers, etc.) sits inside this card's own stacking context, which
   — like every card child — is z-index:1 from the `.card > *` rule below. The
   next card down is ALSO z-index:1, and being later in the DOM it paints on top,
   so a body dropdown renders BEHIND the following card. Raising the no-shimmer
   card itself to z-index:3 lifts its overflowing dropdown above those siblings.
   (2026-07-01 — fixes /projects/new/ org search + Team Assignment pickers.) */
.card.no-shimmer,
.info-card.no-shimmer,
.form-section.no-shimmer {
    position: relative;
    z-index: 3;
}
/* Mechanism #5's flat z-index:3 only lifts a body dropdown above a PLAIN (z-index:1)
   following card. On pages where every card is no-shimmer, siblings tie at 3 and the
   later card paints over the open menu. When a no-shimmer card actually has an OPEN
   dropdown, lift just that card to 4 so its menu wins over its no-shimmer siblings.
   Scoped to `.dropdown-menu.show` so closed cards keep the flat z-index:3 and only one
   card (the open one) is ever raised. Central rule — do NOT copy per-page inline styles.
   (2026-07-31 — casework school profile: hero Add Contact menu hid behind the sections below.) */
.card.no-shimmer:has(.dropdown-menu.show),
.info-card.no-shimmer:has(.dropdown-menu.show),
.form-section.no-shimmer:has(.dropdown-menu.show) {
    z-index: 4;
}
/* Flash-free companion to the :has() rule above. core.js adds `dropdown-open` to
   the closest no-shimmer card on Bootstrap's `show.bs.dropdown` — which fires
   BEFORE the menu is shown/painted — so the card is already z-index:4 on the menu's
   FIRST paint. A plain class match isn't subject to the :has() ancestor-recalc lag
   that leaves the menu behind the next card for a frame. Removed on `hide.bs.dropdown`,
   so (like the :has() rule) only the currently-open card is ever raised — siblings
   stay at 3, no all-tie. This makes EVERY no-shimmer dropdown flash-free with no
   per-page code; `dropdown-host` below remains for permanent/always-elevated hosts.
   (2026-08-04 — resource_wall editor card menus flashed behind the next card.) */
.card.no-shimmer.dropdown-open,
.info-card.no-shimmer.dropdown-open,
.form-section.no-shimmer.dropdown-open {
    z-index: 4;
}
/* Same lift for the AjaxSelect combobox (core/js/autocomplete.js). Its suggestion
   panel is NOT a Bootstrap dropdown, so neither the `.dropdown-menu.show` :has()
   rule nor core.js's `.dropdown-open` class ever fires — the enclosing no-shimmer
   card stays at z-index:3, ties with the later no-shimmer sibling cards, and they
   paint over the open panel. autocomplete.js toggles `.ac-open` on the `.ac-wrap`
   while the panel is shown; lift the card to 4 then so the panel wins. Open-state–
   scoped for the same reason as the dropdown rules: closed comboboxes stay at 3, so
   several on one page never all-tie at 4.
   (2026-08-05 — casework referral form: Referral Source Level-2 panel hid behind
   the "Person Being Referred" section below it.) */
.card.no-shimmer:has(.ac-wrap.ac-open),
.info-card.no-shimmer:has(.ac-wrap.ac-open),
.form-section.no-shimmer:has(.ac-wrap.ac-open) {
    z-index: 4;
}
/* NOTE — four rules lift a no-shimmer card to z-index:4 and they are NOT
   redundant: `:has(.dropdown-menu.show)` above is the fallback for menus that
   never fire Bootstrap's show.bs.dropdown; `.dropdown-open` is the flash-free path
   core.js drives for Bootstrap dropdowns; `:has(.ac-wrap.ac-open)` (this rule) is
   the parallel path for the AjaxSelect combobox; `.dropdown-host` below is the
   static always-on lift for permanent hero dropdowns. Don't collapse them. */
/* Flash-free variant: the :has() rule above only raises the card AFTER the menu
   opens, and browsers can defer that ancestor style recalc by a frame — so the menu
   paints behind the next card for one frame, then pops on top. When a no-shimmer card
   has a PERMANENT dropdown that must always win (e.g. a hero action bar), add the
   `dropdown-host` class to elevate it statically up front, before the menu ever opens.
   (2026-07-31 — casework school profile hero "Add Contact".) */
.card.no-shimmer.dropdown-host,
.info-card.no-shimmer.dropdown-host,
.form-section.no-shimmer.dropdown-host {
    z-index: 4;
}
/* Disable hover transform on no-shimmer cards (creates stacking context issues with dropdowns) */
.card.no-shimmer:hover,
.info-card.no-shimmer:hover {
    transform: none !important;
}

/* Ensure content inside cards has proper spacing */
.card > *,
.info-card > * {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.card > .card-body,
.info-card > .card-body {
    padding: 25px;
}

/* Fix for tables and specific content that shouldn't have extra padding */
.card table,
.info-card table,
.card .table,
.info-card .table,
.card .btn,
.info-card .btn {
    margin: 0;
    position: relative;
    z-index: 1;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .info-card {
    background: #2d3748;
    border: 1px solid #4a5568;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
/* ===== UNIFIED SEARCH RESULT CARDS - Reusable across all list views ===== */
.search-result-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    height: 100%; /* Ensures equal height in flex containers */
    display: flex;
    flex-direction: column;
}

[data-bs-theme="dark"] .search-result-card {
    background: linear-gradient(135deg, #2d3748 0%, #374151 100%);
    border-color: #4a5568;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    color: var(--text-primary); /* Ensure light text on dark background */
}

/* Hover effects with modern animations */
.search-result-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-bs-theme="dark"] .search-result-card:hover {
    box-shadow: 
        0 8px 25px rgba(96, 165, 250, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.3);
    border-color: rgba(96, 165, 250, 0.4);
}

/* Card header section */
.search-result-card .card-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .search-result-card .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.search-result-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.search-result-card .card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-card .card-title a:hover {
    color: var(--primary-blue);
}

[data-bs-theme="dark"] .search-result-card .card-title a {
    color: var(--text-primary);
}

/* Card body with auto-expanding content */
.search-result-card .card-body {
    flex: 1;
    padding: 0;
    /* The global .card-body panel look (grey bg + border + radius, meant for
       form/content cards) leaks into search-result cards as an ugly empty grey
       "well" — most visible on cards with little body text (e.g. Activities).
       Search cards opted out of the panel padding above but not the surface;
       complete the opt-out here. */
    background: transparent;
    border: none;
    border-radius: 0;
}

.search-result-card .card-details {
    margin-bottom: 15px;
}

.search-result-card .card-details > div {
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.search-result-card .card-details i {
    width: 16px;
    margin-right: 8px;
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .search-result-card .card-details {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .search-result-card .card-details a {
    color: var(--link-color);
}

[data-bs-theme="dark"] .search-result-card .card-details a:hover {
    color: var(--link-hover);
}

/* Card footer/meta section */
.search-result-card .card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

[data-bs-theme="dark"] .search-result-card .card-footer {
    border-top-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .search-result-card .text-muted,
[data-bs-theme="dark"] .search-result-card small {
    color: var(--text-muted) !important;
}

/* Status indicators with left accent border */
.search-result-card.status-active {
    border-left: 4px solid var(--success);
}

.search-result-card.status-inactive {
    border-left: 4px solid var(--secondary);
    opacity: 0.8;
}

.search-result-card.type-email {
    border-left: 4px solid var(--success);
}

.search-result-card.type-phone {
    border-left: 4px solid var(--info);
}

.search-result-card.type-meeting {
    border-left: 4px solid var(--warning);
}

.search-result-card.type-other {
    border-left: 4px solid var(--secondary);
}

/* Direction indicators with right accent */
.search-result-card.direction-inbound {
    border-right: 3px solid var(--info);
}

.search-result-card.direction-outbound {
    border-right: 3px solid var(--danger);
}

/* Responsive grid for search result cards */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (min-width: 1200px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Ensure IT Details injection boxes use dark surfaces */
[data-bs-theme="dark"] .app-card,
[data-bs-theme="dark"] .organization-item,
[data-bs-theme="dark"] .contact-card,
[data-bs-theme="dark"] .activity-card {
    background: #2d3748;
    border: 1px solid #4a5568;
}

.card-body {
    background: #dee2e6;
    border: 1px solid #adb5bd;
    border-radius: 8px;
    padding: 25px;
    margin: 0;
    position: relative;
    z-index: 1;
}

[data-bs-theme="dark"] .card-body {
    background: #4a5568;
    border: 1px solid #6b7280;
}

/* Same opt-out for search-result cards in dark mode (higher specificity than
   the [data-bs-theme] .card-body rule above, so it wins regardless of order). */
[data-bs-theme="dark"] .search-result-card .card-body {
    background: transparent;
    border: none;
}

/* The card-body surface above (#4a5568) is LIGHTER than the card/token
   surface (#2d3748) the muted grays were tuned for — on it, .form-text
   (#9ca3af), .text-muted (#a0aec0) and .text-subtle (#93a4b8) all land at
   ~3:1, below WCAG AA 4.5:1. Lift the whole muted-text family on this
   surface only (#d3dae3 ≈ 5.3:1). !important required where the global
   .text-muted/.text-subtle utilities already use it. */
[data-bs-theme="dark"] .card-body .form-text {
    color: #d3dae3;
}

[data-bs-theme="dark"] .card-body .text-muted,
[data-bs-theme="dark"] .card-body .text-secondary,
[data-bs-theme="dark"] .card-body .text-subtle {
    color: #d3dae3 !important;
}

/* Card Content Structure */
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: var(--primary-blue);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* ===== BUTTONS ===== */
/* Base sizing lives HERE, before the size variants. For years the base
   .btn padding/font-size was declared AFTER .btn-xs/.btn-sm — equal
   specificity, so the base overrode every "small" button and the whole
   site rendered comically large buttons (fixed 2026-07-14). Keep the
   base rule first and the variants after it. */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

/* Button Sizes */
.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.125rem;
    line-height: 1.6;
}

/* ===== MODERN 4-COLOR GRADIENT BUTTON SYSTEM (SITE-WIDE) ===== */

/* PRIMARY BUTTONS - ENHANCED 4-COLOR GRADIENT */
.btn-primary {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.4), rgba(32, 201, 151, 0.4), rgba(69, 183, 209, 0.4), rgba(150, 206, 180, 0.4)) !important;
    border: 2px solid rgba(0, 123, 255, 0.6) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Dark mode - enhanced gradient with better visibility */
[data-bs-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.3), rgba(32, 201, 151, 0.3), rgba(69, 183, 209, 0.3), rgba(150, 206, 180, 0.3)) !important;
    border: 2px solid rgba(13, 110, 253, 0.6) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #007bff, #20c997) !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* SECONDARY BUTTONS - CLEAN AND READABLE */
.btn-secondary,
.btn-outline-secondary {
    background: rgba(108, 117, 125, 0.1);
    border: 2px solid rgba(108, 117, 125, 0.4);
    border-radius: 8px !important;
    color: #495057 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Dark mode - readable secondary buttons */
[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-outline-secondary {
    background: rgba(173, 181, 189, 0.15);
    border: 2px solid rgba(173, 181, 189, 0.4);
    color: #f8f9fa !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-secondary:focus,
.btn-outline-secondary:focus {
    background: #6c757d !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
    transform: translateY(-1px);
}

.btn-secondary:active,
.btn-outline-secondary:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

/* SUCCESS & WARNING BUTTONS - CLEAN APPROACH */
.btn-success {
    background: rgba(40, 167, 69, 0.15);
    border: 2px solid rgba(40, 167, 69, 0.4);
    border-radius: 8px !important;
    color: #155724 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .btn-success {
    background: rgba(40, 167, 69, 0.2);
    border: 2px solid rgba(40, 167, 69, 0.5);
    color: #d4edda !important;
}

.btn-success:hover,
.btn-success:focus {
    background: #28a745 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 8px !important;
    color: #856404 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .btn-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.5);
    color: #fff3cd !important;
}

.btn-warning:hover,
.btn-warning:focus {
    background: #ffc107 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #000000 !important;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    transform: translateY(-1px);
}

.btn-success:active,
.btn-warning:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* DANGER BUTTONS - CLEAN APPROACH */
.btn-danger {
    background: rgba(220, 53, 69, 0.15);
    border: 2px solid rgba(220, 53, 69, 0.4);
    border-radius: 8px !important;
    color: #721c24 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .btn-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid rgba(220, 53, 69, 0.5);
    color: #f8d7da !important;
}

.btn-danger:hover,
.btn-danger:focus {
    background: #dc3545 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    transform: translateY(-1px);
}

.btn-danger:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

/* INFO BUTTONS - CLEAN APPROACH */
.btn-info {
    background: rgba(23, 162, 184, 0.15);
    border: 2px solid rgba(23, 162, 184, 0.4);
    border-radius: 8px !important;
    color: #0c5460 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .btn-info {
    background: rgba(23, 162, 184, 0.2);
    border: 2px solid rgba(23, 162, 184, 0.5);
    color: #d1ecf1 !important;
}

.btn-info:hover,
.btn-info:focus {
    background: #17a2b8 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
    transform: translateY(-1px);
}

.btn-info:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

/* OUTLINE PRIMARY BUTTONS - BUTTON STANDARD BACKGROUND */
.btn-outline-primary {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.25), rgba(0, 86, 179, 0.25), rgba(23, 162, 184, 0.25), rgba(32, 201, 151, 0.25)) !important;
    border: 2px solid rgba(0, 123, 255, 0.6);
    border-radius: 8px !important;
    color: #000000 !important;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    background: rgba(13, 110, 253, 0.1);
    border: 2px solid rgba(13, 110, 253, 0.6);
    color: #ffffff !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: linear-gradient(135deg, #007bff, #20c997) !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* GHOST BUTTONS - CLEAN APPROACH */
.btn-ghost {
    background: rgba(108, 117, 125, 0.05);
    border: 2px solid transparent;
    border-radius: 8px !important;
    color: #6c757d !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .btn-ghost {
    background: rgba(173, 181, 189, 0.1);
    color: #adb5bd !important;
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: #6c757d !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
    transform: translateY(-1px);
}

.btn-ghost:active {
    border-radius: 8px !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.1);
}

/* ===== ALL OUTLINE BUTTON TYPES - BUTTON STANDARD BACKGROUNDS ===== */

/* OUTLINE DANGER BUTTONS */
.btn-outline-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.25), rgba(255, 107, 107, 0.25), rgba(231, 76, 60, 0.25), rgba(255, 99, 132, 0.25)) !important;
    border: 2px solid rgba(220, 53, 69, 0.6) !important;
    color: #dc3545 !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: #ffffff !important;
}

/* OUTLINE SECONDARY BUTTONS */
.btn-outline-secondary,
a.btn-outline-secondary,
button.btn-outline-secondary {
    /* Orange-based default gradient (site-wide) */
    background: linear-gradient(135deg,
        rgba(253, 126, 20, 0.35),   /* #fd7e14 */
        rgba(255, 145, 77, 0.35),   /* soft orange */
        rgba(255, 107, 107, 0.35),  /* coral */
        rgba(220, 53, 69, 0.30)     /* red accent */
    ) !important;
    border: 2px solid rgba(253, 126, 20, 0.6) !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
    color: #1a1f2b !important; /* dark text in light mode */
}
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] a.btn-outline-secondary,
[data-bs-theme="dark"] button.btn-outline-secondary {
    color: #ffffff !important; /* white text in dark mode */
}

[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] a.btn-outline-secondary,
[data-bs-theme="dark"] button.btn-outline-secondary {
    color: #ffffff !important;
}

/* OUTLINE SECONDARY BUTTONS - HOVER STATES */
.btn-outline-secondary:hover,
a.btn-outline-secondary:hover,
button.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
a.btn-outline-secondary:focus,
button.btn-outline-secondary:focus {
    /* Vivid orange fill on hover */
    background: linear-gradient(135deg, #fd7e14, #ff914d, #ff6b6b, #dc3545) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* OUTLINE DANGER BUTTONS - HOVER STATES */
.btn-outline-danger:hover,
a.btn-outline-danger:hover,
button.btn-outline-danger:hover,
.btn-outline-danger:focus,
a.btn-outline-danger:focus,
button.btn-outline-danger:focus {
    background: linear-gradient(135deg, #dc3545, #ff6b6b, #e74c3c, #ff6384, #ff5722) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* OUTLINE INFO BUTTONS */
.btn-outline-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.25), rgba(78, 205, 196, 0.25), rgba(32, 201, 151, 0.25), rgba(70, 187, 184, 0.25)) !important;
    border: 2px solid rgba(23, 162, 184, 0.6) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-bs-theme="dark"] .btn-outline-info {
    color: #ffffff !important;
}

/* OUTLINE WARNING BUTTONS */
.btn-outline-warning,
a.btn-outline-warning,
button.btn-outline-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 205, 86, 0.25), rgba(255, 179, 0, 0.25), rgba(255, 152, 0, 0.25)) !important;
    border: 2px solid rgba(255, 193, 7, 0.6) !important;
    color: #856404 !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
}

[data-bs-theme="dark"] .btn-outline-warning,
[data-bs-theme="dark"] a.btn-outline-warning,
[data-bs-theme="dark"] button.btn-outline-warning {
    color: #ffffff !important;
    border: 2px solid rgba(255, 193, 7, 0.7) !important;
}

/* OUTLINE WARNING BUTTONS - HOVER STATES */
.btn-outline-warning:hover,
a.btn-outline-warning:hover,
button.btn-outline-warning:hover,
.btn-outline-warning:focus,
a.btn-outline-warning:focus,
button.btn-outline-warning:focus {
    background: linear-gradient(135deg, #ffc107, #ffcd56, #ffb300, #ff9800) !important;
    border: 2px solid transparent !important;
    color: #000000 !important;
    text-shadow: none !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4) !important;
}

[data-bs-theme="dark"] .btn-outline-warning:hover,
[data-bs-theme="dark"] a.btn-outline-warning:hover,
[data-bs-theme="dark"] button.btn-outline-warning:hover {
    color: #000000 !important;
}

/* OUTLINE LIGHT BUTTONS - Navigation & Neutral Actions */
.btn-outline-light,
a.btn-outline-light,
button.btn-outline-light {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.25), rgba(233, 236, 239, 0.25), rgba(206, 212, 218, 0.25), rgba(173, 181, 189, 0.25)) !important;
    border: 2px solid rgba(248, 249, 250, 0.6) !important;
    color: #000000 !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

[data-bs-theme="dark"] .btn-outline-light,
[data-bs-theme="dark"] a.btn-outline-light,
[data-bs-theme="dark"] button.btn-outline-light {
    color: #ffffff !important;
    border: 2px solid rgba(248, 249, 250, 0.4) !important;
}

/* OUTLINE LIGHT BUTTONS - HOVER STATES */
.btn-outline-light:hover,
a.btn-outline-light:hover,
button.btn-outline-light:hover,
.btn-outline-light:focus,
a.btn-outline-light:focus,
button.btn-outline-light:focus {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef, #ced4da, #adb5bd, #6c757d) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* CRM Organization IT Summary - Dark Mode fixes (scoped) */
[data-bs-theme="dark"] .organization-it-summary .bg-light {
    background: #1f2937 !important; /* slate-800 */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #e5e7eb; /* text slightly lighter in dark */
}
[data-bs-theme="dark"] .organization-it-summary .bg-light .text-muted {
    color: #9ca3af !important; /* gray-400 */
}

/* Optional: stat-box subtle elevation in dark */
[data-bs-theme="dark"] .organization-it-summary .stat-box.bg-light {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* UNIVERSAL STAT BOX STYLING - Base container for all stat boxes site-wide */
.stat-box {
    text-align: center;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);
    color: #212529;
    position: relative;
    transition: all 0.25s ease;
}

[data-bs-theme="dark"] .stat-box {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Enhanced styling for organization IT summary context (keeps existing mouse glow) */
.organization-it-summary .stat-box {
    background-image: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(78, 205, 196, 0.20) 0%,
        transparent 50%
    );
    background-repeat: no-repeat;
}

/* Ensure glow is visible in dark mode despite background overrides */
[data-bs-theme="dark"] .organization-it-summary .stat-box {
    background-image: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(78, 205, 196, 0.28) 0%,
        transparent 55%
    ) !important;
}

/* Stronger hover visibility (light mode) */
.organization-it-summary .stat-box:hover {
    background-image: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(78, 205, 196, 0.35) 0%,
        transparent 55%
    );
}

/* Stronger hover visibility (dark mode) */
[data-bs-theme="dark"] .organization-it-summary .stat-box:hover {
    background-image: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(78, 205, 196, 0.42) 0%,
        transparent 55%
    ) !important;
}

/* Light-mode readability: black text for key outline-primary buttons */
.organization-it-summary .btn-outline-primary {
    color: #111827 !important;
    text-shadow: none !important;
}
[data-bs-theme="dark"] .organization-it-summary .btn-outline-primary {
    color: #ffffff !important;
}

/* Light-mode readability for "Edit Dept" in Active Contacts header */
.organization-detail .section-header .btn-outline-primary {
    color: #111827 !important;
    text-shadow: none !important;
}
[data-bs-theme="dark"] .organization-detail .section-header .btn-outline-primary {
    color: #ffffff !important;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-blue);
}

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

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

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-label.required::after {
    content: " *";
    color: var(--danger);
}

.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #9fb0c4;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--border-focus);
    outline: none;
}

.form-control:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-color: var(--border-light);
}

/* ===== TABLES ===== */
.table {
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 8px 10px;
    color: var(--text-primary);
}

.table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background: #233044;
}

[data-bs-theme="dark"] .table-warning {
    --bs-table-color: #332701;
    --bs-table-bg: #fff3cd;
    --bs-table-hover-bg: #f0e4b8;
    color: #332701 !important;
}

[data-bs-theme="dark"] .table-warning td,
[data-bs-theme="dark"] .table-warning th {
    color: #332701 !important;
}

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

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: auto;
    transition: all 0.3s ease;
}

.footer-nav {
    display: flex;
    gap: 20px;
    justify-content: end;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* Organization Footer */
.org-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0 1rem 0;
    margin-top: 3rem;
    transition: all 0.3s ease;
}

/* Footer Navigation (App-Injected) */
.footer-navigation {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-navigation h6 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list li {
    display: inline-flex;
    align-items: center;
}

.footer-nav-list li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
}

.footer-nav-list li a:hover {
    color: var(--primary);
    text-decoration: none;
}

.footer-nav-list .nav-separator {
    color: var(--border-color);
    margin: 0 0.25rem;
    user-select: none;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .org-footer,
[data-bs-theme="dark"] .footer {
    background: var(--bg-secondary);
    border-top-color: var(--border-color);
}

[data-bs-theme="dark"] .footer-navigation {
    border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .footer-nav-list li a {
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .footer-nav-list li a:hover {
    color: var(--primary);
}

/* Responsive footer navigation */
@media (max-width: 768px) {
    .footer-navigation h6 {
        font-size: 0.8rem;
    }
    
    .footer-nav-list {
        font-size: 0.85rem;
        gap: 0.35rem;
    }
    
    .footer-nav-list li a {
        padding: 0.2rem 0.35rem;
        font-size: 0.85rem;
    }
}

/* ===== UTILITY CLASSES ===== */
/* Bootstrap's `.min-w-0` utility is NOT present in this build. Several templates
   use it on a `.flex-fill`/`.flex-grow-1` wrapper so its `.text-truncate` children
   clip — but with the class undefined the flex item keeps `min-width: auto` and
   expands to its content's min-content width (a `nowrap` string's min-content is
   its full length), overflowing the container instead of truncating. Define it
   once here, matching Bootstrap's own semantics, so every current and future use
   works. (Found via the resource_wall card-overflow bug, 2026-08-04.) */
.min-w-0 { min-width: 0 !important; }

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

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--border-focus);
}

/* ===== ANIMATIONS & TRANSITIONS ===== */
/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * { 
        transition: none !important; 
        animation: none !important; 
    }
}

/* Loading animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 2s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .loading {
        animation: none;
        opacity: 0.7;
    }
}

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

.spinner {
    animation: spin 1s linear infinite;
}

/* ========================================================================================
   COMPREHENSIVE BUTTON COVERAGE - ALL MISSING TYPES (PROJECT HAT APPROACH)
   ======================================================================================== */

/* ===== SUCCESS BUTTONS (Start Timer, etc.) - UPDATED WITH ENHANCED BREATHING ===== */
.btn-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(32, 201, 151, 0.2), rgba(72, 187, 120, 0.2), rgba(104, 211, 145, 0.2)) !important;
    border: 2px solid rgba(40, 167, 69, 0.4) !important;
    color: #155724 !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background: linear-gradient(135deg, #28a745, #20c997, #48bb78, #68d391, #38a169) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* ===== OUTLINE SUCCESS BUTTONS (Find Organization, etc.) - BUTTON STANDARD BACKGROUND ===== */
.btn-outline-success,
.btn-outline-success:not(:hover):not(:focus):not(:active),
button.btn-outline-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.25), rgba(32, 201, 151, 0.25), rgba(72, 187, 120, 0.25), rgba(104, 211, 145, 0.25)) !important;
    border: 2px solid rgba(40, 167, 69, 0.6) !important;
    color: #000000 !important;
    border-radius: 8px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-bs-theme="dark"] .btn-outline-success,
[data-bs-theme="dark"] .btn-outline-success:not(:hover):not(:focus):not(:active),
[data-bs-theme="dark"] button.btn-outline-success {
    color: #ffffff !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
    background: linear-gradient(135deg, #28a745, #20c997, #48bb78, #68d391, #38a169) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* ===== UPDATE ALL EXISTING BUTTONS WITH ENHANCED BREATHING ===== */

/* Update existing buttons with clean breathing animation */
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    transform: translateY(-2px) scale(1.02) !important;
}

/* Old CSS fire glow effects removed - using JavaScript wind-blown fire effects instead */

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .app-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .navbar {
        padding: 8px 0;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --border-light: #000000;
    }
    
    [data-bs-theme="dark"] {
        --border-color: #ffffff;
        --border-light: #ffffff;
    }
}

/* ===== FINAL COMPREHENSIVE BUTTON SYSTEM (OVERRIDES ALL PREVIOUS) ===== */
/* This section provides site-wide button consistency with enhanced gradients and fire effects */

/* PRIMARY BUTTONS - Enhanced 4-Color Gradient (Site-wide) */
.btn-primary, 
.form-header .btn-primary, 
.contact-header .btn-primary, 
.gradient-header .btn-primary {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.45), rgba(32, 201, 151, 0.45), rgba(69, 183, 209, 0.45), rgba(150, 206, 180, 0.45)) !important;
    border: 2px solid rgba(0, 123, 255, 0.7) !important;
    border-radius: 8px !important;
    color: #000000 !important;
    font-weight: 600 !important;
    /*text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;*/
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .form-header .btn-primary,
[data-bs-theme="dark"] .contact-header .btn-primary,
[data-bs-theme="dark"] .gradient-header .btn-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.35), rgba(32, 201, 151, 0.35), rgba(69, 183, 209, 0.35), rgba(150, 206, 180, 0.35)) !important;
    border: 2px solid rgba(13, 110, 253, 0.6) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.form-header .btn-primary:hover, .form-header .btn-primary:focus, .form-header .btn-primary:active,
.contact-header .btn-primary:hover, .contact-header .btn-primary:focus, .contact-header .btn-primary:active,
.gradient-header .btn-primary:hover, .gradient-header .btn-primary:focus, .gradient-header .btn-primary:active {
    background: linear-gradient(135deg, #007bff, #0056b3, #17a2b8, #20c997, #4ecdc4) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* SECONDARY BUTTONS - Enhanced 4-Color Gradient */
.btn-secondary,
.form-header .btn-secondary,
.contact-header .btn-secondary,
.gradient-header .btn-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.45), rgba(155, 164, 181, 0.45), rgba(206, 212, 218, 0.45), rgba(173, 181, 189, 0.45)) !important;
    border: 2px solid rgba(108, 117, 125, 0.7) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active,
.form-header .btn-secondary:hover, .form-header .btn-secondary:focus, .form-header .btn-secondary:active,
.contact-header .btn-secondary:hover, .contact-header .btn-secondary:focus, .contact-header .btn-secondary:active,
.gradient-header .btn-secondary:hover, .gradient-header .btn-secondary:focus, .gradient-header .btn-secondary:active {
    background: linear-gradient(135deg, #6c757d, #9ba4b5, #ced4da, #adb5bd, #e9ecef) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* SUCCESS BUTTONS - Enhanced 4-Color Gradient */
.btn-success,
.form-header .btn-success,
.contact-header .btn-success,
.gradient-header .btn-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.45), rgba(32, 201, 151, 0.45), rgba(72, 187, 120, 0.45), rgba(104, 211, 145, 0.45)) !important;
    border: 2px solid rgba(40, 167, 69, 0.7) !important;
    border-radius: 8px !important;
    color: #000000 !important;
    font-weight: 600 !important;
    /*text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;*/
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-success:hover, .btn-success:focus, .btn-success:active,
.form-header .btn-success:hover, .form-header .btn-success:focus, .form-header .btn-success:active,
.contact-header .btn-success:hover, .contact-header .btn-success:focus, .contact-header .btn-success:active,
.gradient-header .btn-success:hover, .gradient-header .btn-success:focus, .gradient-header .btn-success:active {
    background: linear-gradient(135deg, #28a745, #20c997, #48bb78, #68d391, #38a169) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* DANGER BUTTONS - Enhanced 4-Color Gradient */
.btn-danger,
.form-header .btn-danger,
.contact-header .btn-danger,
.gradient-header .btn-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.45), rgba(255, 107, 107, 0.45), rgba(231, 76, 60, 0.45), rgba(255, 99, 132, 0.45)) !important;
    border: 2px solid rgba(220, 53, 69, 0.7) !important;
    border-radius: 8px !important;
    color: #000000 !important;
    font-weight: 600 !important;
    /*text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;*/
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-danger:hover, .btn-danger:focus, .btn-danger:active,
.form-header .btn-danger:hover, .form-header .btn-danger:focus, .form-header .btn-danger:active,
.contact-header .btn-danger:hover, .contact-header .btn-danger:focus, .contact-header .btn-danger:active,
.gradient-header .btn-danger:hover, .gradient-header .btn-danger:focus, .gradient-header .btn-danger:active {
    background: linear-gradient(135deg, #dc3545, #ff6b6b, #e74c3c, #ff6384, #ff5722) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* INFO BUTTONS - Enhanced 4-Color Gradient */
.btn-info,
.form-header .btn-info,
.contact-header .btn-info,
.gradient-header .btn-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.45), rgba(78, 205, 196, 0.45), rgba(32, 201, 151, 0.45), rgba(70, 187, 184, 0.45)) !important;
    border: 2px solid rgba(23, 162, 184, 0.7) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-info:hover, .btn-info:focus, .btn-info:active,
.form-header .btn-info:hover, .form-header .btn-info:focus, .form-header .btn-info:active,
.contact-header .btn-info:hover, .contact-header .btn-info:focus, .contact-header .btn-info:active,
.gradient-header .btn-info:hover, .gradient-header .btn-info:focus, .gradient-header .btn-info:active {
    background: linear-gradient(135deg, #17a2b8, #20c997, #4ecdc4, #45b7d1, #78c7da) !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* ============================================================================
   Accounting: table-register — QB Desktop-style ledger tables
   ============================================================================
   High info density, monospace numeric columns, grid-like borders to mirror
   QB Desktop's register and list views. Use with <table class="table-register">.
   See 2026-04-24-Accounting-Plan.md §4.5. */

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

.table-register thead th {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 2px solid var(--bs-border-color);
    border-top: 1px solid var(--bs-border-color);
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-register tbody td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--bs-border-color);
    vertical-align: top;
}

.table-register tbody tr:hover {
    background-color: var(--bs-secondary-bg);
}

.table-register tbody tr.table-register-active {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
    background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.08));
}

.table-register td.num,
.table-register th.num,
.table-register .table-register-num {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.table-register td.num-negative {
    color: var(--bs-danger);
}

.table-register .table-register-cleared {
    text-align: center;
    width: 2rem;
    color: var(--bs-success);
}

.table-register .table-register-reconciled {
    color: var(--bs-primary);
    font-weight: 700;
}

.table-register .table-register-balance {
    font-weight: 600;
    background-color: var(--bs-tertiary-bg);
}

/* Compact variant: register inside a modal or side panel */
.table-register.table-register-compact thead th,
.table-register.table-register-compact tbody td {
    padding: 0.2rem 0.4rem;
    font-size: 0.8125rem;
}

/* Dark mode — the Bootstrap 5.3 variables already handle most surfaces; this
   just ensures the sticky header blends in. */
[data-bs-theme="dark"] .table-register thead th {
    background-color: var(--bs-tertiary-bg);
}

/* ------------------------------------------------------------------
   Scrollable list within a card. Used by:
   - core_records {activity,note,comment}_timeline.html (class baked in)
   - projects notes / milestones / checklist sections
   - project_detail Project Discussion
   Keeps the section header + add button always visible while the
   list scrolls within a bounded height. Override per-instance with
   the --scroll-max-h custom property (style="--scroll-max-h: 600px").
   ------------------------------------------------------------------ */
.scrollable-section {
    max-height: var(--scroll-max-h, 400px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    padding-right: 4px;
}
