/* Custom styles for Workflow System */

/* Font Awesome Icon Fix */
.fas, .fa, .far, .fab, .fal, .fad {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.far {
    font-weight: 400 !important;
}

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1040; /* Lower than modal backdrop (1050) */
    display: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.mobile-nav-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #084298 100%);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

.mobile-nav-overlay.show .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-body {
    padding: 1rem 0;
}

.mobile-nav-body .list-group-item {
    border: none;
    background: transparent;
    color: white;
    padding: 1rem;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.mobile-nav-body .list-group-item:hover,
.mobile-nav-body .list-group-item:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.mobile-nav-body .list-group-item i {
    width: 20px;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    min-height: 44px; /* Touch-friendly minimum height */
    padding: 0.5rem 1rem;
}

.btn-sm {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    min-height: 32px;
}

.status-select {
    max-width: 150px;
    min-height: 44px; /* Touch-friendly */
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.badge {
    font-weight: 500;
}

/* Dashboard Cards */
.hover-shadow {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2) !important;
}

.bg-primary {
    background: var(--sidebar-primary) !important;
}

.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffca2c 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #3dd5f3 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%) !important;
}

/* Form Styling */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-control,
.form-select {
    min-height: 44px; /* Touch-friendly */
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Login Page */
.min-vh-100 {
    min-height: 100vh;
}

/* Modal z-index fixes - More aggressive approach */
.modal {
    z-index: 1055 !important; /* Higher than backdrop */
}

.modal-backdrop {
    z-index: 1040 !important; /* Much lower than modal */
}

.modal-dialog {
    z-index: 1056 !important; /* Higher than modal */
}

/* Force modal backdrop to be behind modal content */
.modal.show .modal-backdrop {
    z-index: 1040 !important;
}

/* Ensure modal content is always on top */
.modal.show {
    z-index: 1055 !important;
}

.modal.show .modal-dialog {
    z-index: 1056 !important;
}

/* Ensure notifications appear above modals */
.alert.position-fixed {
    z-index: 1060 !important; /* Higher than modals */
}

/* Additional modal backdrop fix - most specific selector */
body .modal-backdrop.fade.show {
    z-index: 1040 !important;
    position: fixed !important;
}

/* Ensure modal is always above backdrop */
body .modal.show {
    z-index: 1055 !important;
    position: fixed !important;
}

body .modal.show .modal-dialog {
    z-index: 1056 !important;
}

/* Nuclear option - target backdrop with maximum specificity */
html body div.modal-backdrop.fade.show {
    z-index: 1040 !important;
    position: fixed !important;
}

html body div.modal.show {
    z-index: 1055 !important;
    position: fixed !important;
}

html body div.modal.show div.modal-dialog {
    z-index: 1056 !important;
}

/* Specific fix for memberModal on team page */
#memberModal {
    z-index: 1055 !important;
}

#memberModal .modal-dialog {
    z-index: 1056 !important;
}

/* Force backdrop behind specific modal */
body.modal-open .modal-backdrop {
    position: fixed !important;
    z-index: 1040 !important;
}

/* Target the specific modal when it's shown */
#memberModal.show {
    z-index: 1055 !important;
}

#memberModal.show .modal-dialog {
    z-index: 1056 !important;
}

/* Ensure all modal elements have correct positioning for stacking context */
.modal {
    position: fixed !important;
    z-index: 1055 !important;
}

.modal-backdrop {
    position: fixed !important;
    z-index: 1040 !important;
}

.modal-dialog {
    position: relative !important;
    z-index: 1056 !important;
}

/* Nuclear option - override Bootstrap's compiled CSS with maximum specificity */
html body div.modal-backdrop.fade.show {
    position: fixed !important;
    z-index: 1040 !important;
}

html body div.modal.show {
    position: fixed !important;
    z-index: 1055 !important;
}

html body div.modal.show div.modal-dialog {
    position: relative !important;
    z-index: 1056 !important;
}

/* Target Bootstrap's specific classes with maximum specificity */
.fade.show.modal-backdrop {
    position: fixed !important;
    z-index: 1040 !important;
}

.fade.show.modal {
    position: fixed !important;
    z-index: 1055 !important;
}

/* Hide modal backdrop completely */
.modal-backdrop {
    display: none !important;
}

/* Alternative approach - make backdrop transparent */
.modal-backdrop.fade.show {
    display: none !important;
}

/* Ensure modal is still clickable without backdrop */
.modal.show {
    pointer-events: auto !important;
}

/* Container-fluid styling handled by layout; removed empty ruleset */

/* Header container styling */
.header-bar .container-fluid {
    height: 100%; /* Take full height of header */
    display: flex;
    align-items: center; /* Center content vertically */
    flex-wrap: nowrap; /* Prevent wrapping to new line */
    overflow: hidden; /* Hide any overflow */
}

/* The notification menu must be able to extend below the compact header. */
.header-bar .container-fluid,
.header-bar .col-6.col-md-3:last-child {
    overflow: visible;
}

#notificationMenu + .dropdown-menu {
    z-index: 1080;
    color: #212529;
    background-color: #fff;
}

/* Do not inherit the white header text colour inside the notification panel. */
#notificationMenu + .dropdown-menu .dropdown-item,
#notificationMenu + .dropdown-menu .dropdown-item .small,
#notificationMenu + .dropdown-menu .dropdown-item .text-muted {
    color: #212529 !important;
}

#notificationMenu + .dropdown-menu .dropdown-item.bg-light {
    background-color: #eef4ff !important;
}

#notificationMenu + .dropdown-menu .dropdown-item:hover,
#notificationMenu + .dropdown-menu .dropdown-item:focus {
    background-color: #dfeaff;
}

#notificationMenu + .dropdown-menu .text-muted {
    color: #6c757d !important;
}

/* Header row styling */
.header-bar .row {
    width: 100%;
    margin: 0; /* Remove default margin */
    flex-wrap: nowrap; /* Keep all columns on same line */
}

/* Header columns styling */
.header-bar .col-6,
.header-bar .col-md-3,
.header-bar .col-md-6 {
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* Prevent content wrapping */
    overflow: hidden; /* Hide overflow */
}

/* Header button groups styling */
.header-bar .d-flex {
    flex-wrap: nowrap; /* Keep buttons in horizontal line */
    gap: 0.5rem; /* Add small gap between buttons */
}

/* Header buttons styling */
.header-bar .btn {
    white-space: nowrap; /* Prevent button text wrapping */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Header search input styling */
.header-bar .form-control {
    min-width: 200px; /* Ensure search input has minimum width */
    flex-shrink: 1; /* Allow search input to shrink if needed */
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .header-bar {
        height: 76px; /* Maintain consistent height on mobile */
        min-height: 76px;
        max-height: 76px;
    }
    
    /* Mobile header adjustments */
    .header-bar .col-6 {
        flex: 0 0 auto; /* Don't grow or shrink */
    }
    
    .header-bar .d-flex {
        gap: 0.25rem; /* Smaller gap on mobile */
    }
    
    .header-bar .btn {
        font-size: 0.875rem; /* Smaller font on mobile */
        padding: 0.375rem 0.75rem; /* Smaller padding */
    }
    
    .header-bar .form-control {
        min-width: 150px; /* Smaller search input on mobile */
        font-size: 0.875rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
        border-radius: 0.5rem;
        overflow: hidden;
    }
    
    .btn-group-sm > .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    /* Mobile table improvements */
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    .table th {
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    /* Mobile card improvements */
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    /* Mobile button improvements */
    .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .btn + .btn {
        margin-left: 0;
    }
    
    /* Mobile form improvements */
    .form-row > .col,
    .form-row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    /* Mobile navigation improvements */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile dashboard improvements */
    .col-6.col-md-3 {
        margin-bottom: 1rem;
    }
    
    .col-6.col-md-3 .card {
        min-height: 120px;
    }
    
    /* Mobile search improvements */
    .input-group {
        flex-direction: column;
    }
    
    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .btn {
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .input-group > .btn {
        margin-left: 0;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .header-bar {
        height: 76px; /* Maintain consistent height on small screens */
        min-height: 76px;
        max-height: 76px;
    }
    
    /* Small screen header adjustments */
    .header-bar .btn {
        font-size: 0.8rem; /* Even smaller font on small screens */
        padding: 0.25rem 0.5rem; /* Even smaller padding */
    }
    
    .header-bar .form-control {
        min-width: 120px; /* Even smaller search input */
        font-size: 0.8rem;
    }
    
    .header-bar .d-flex {
        gap: 0.125rem; /* Minimal gap on small screens */
    }
    
    .card-body {
        padding: 0.75rem 0.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.375rem 0.125rem;
        font-size: 0.75rem;
    }
    
    .h1, .h2, .h3, .h4, .h5, .h6 {
        font-size: 1.1rem;
    }
    
    .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
        font-size: 1.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .card:hover {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .hover-shadow:hover {
        transform: none;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }
    
    .form-control,
    .form-select {
        min-height: 48px;
    }
    
    /* Better touch feedback */
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0.375rem;
    }
    
    /* Fix for iOS button styling */
    input[type="submit"],
    input[type="button"],
    button {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0.375rem;
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .form-control:focus,
    .form-select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    }
}

/* Animation for status changes */
.status-select {
    transition: all 0.3s ease;
}

.status-select:focus {
    transform: scale(1.02);
}

/* Button Color Scheme */
.btn-success, .btn-positive {
    background-color: var(--sidebar-success) !important;
    border-color: var(--sidebar-success) !important;
    color: white !important;
}

.btn-success:hover, .btn-positive:hover {
    background-color: #15803d !important;
    border-color: #15803d !important;
    color: white !important;
}

.btn-danger, .btn-delete {
    background-color: var(--sidebar-danger) !important;
    border-color: var(--sidebar-danger) !important;
    color: white !important;
}

.btn-danger:hover, .btn-delete:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: white !important;
}

/* Reduce space between header and sidebar - User Requested Changes */
/* Note: These rules are already applied above in the main sidebar and main-content definitions */

/* Loading spinner */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Logout button styling */
.dropdown-item.border-0.bg-transparent {
    padding: 0.25rem 1rem;
    width: 100%;
    text-align: left;
    color: var(--bs-dropdown-link-color, #212529);
    text-decoration: none;
    background-color: transparent;
    border: 0;
    cursor: pointer;
}

.dropdown-item.border-0.bg-transparent:hover {
    color: var(--bs-dropdown-link-hover-color, #1e2125);
    background-color: var(--bs-dropdown-link-hover-bg, #e9ecef);
}

/* Mobile-specific utility classes */
.d-mobile-block {
    display: none;
}

@media (max-width: 768px) {
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-none {
        display: none !important;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
    
    .text-mobile-left {
        text-align: left !important;
    }
    
    .text-mobile-right {
        text-align: right !important;
    }
}

/* Mobile-friendly spacing */
.mobile-mt-2 {
    margin-top: 0.5rem;
}

.mobile-mb-2 {
    margin-bottom: 0.5rem;
}

.mobile-p-2 {
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-mt-2 {
        margin-top: 0.5rem !important;
    }
    
    .mobile-mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .mobile-p-2 {
        padding: 0.5rem !important;
    }
}

/* Global Sidebar Styles */
:root {
    --sidebar-primary: #1e3a8a; /* Dark navy blue */
    --sidebar-secondary: #6c757d;
    --sidebar-success: #16a34a; /* Green for positive actions */
    --sidebar-danger: #dc2626; /* Red for delete actions */
    --sidebar-warning: #ffc107;
    --sidebar-info: #0dcaf0;
    --sidebar-dark: #212529;
    --sidebar-purple: #6f42c1;
    --sidebar-pink: #d63384;
    --sidebar-teal: #20c997;
    --sidebar-text-color: white; /* White text for dark navy background */
    --header-bg: #f9fafb; /* Off-white / light gray */
    --header-primary: #1e3a8a; /* Default header color matching sidebar */
}

body {
    margin: 0;
    padding: 0;
}

.header-bar {
    position: fixed;
    width: 100%;
    z-index: 1030; /* Lower than modal backdrop (1050) but higher than main content */
    background: var(--header-primary);
    color: white;
    top: 0;
    left: 0;
    height: 76px; /* Fixed height to prevent dynamic changes */
    min-height: 76px; /* Ensure minimum height */
    max-height: 76px; /* Prevent height from growing */
    display: flex;
    align-items: center; /* Center content vertically */
    overflow: hidden; /* Prevent content from overflowing */
}

.header-bar.theme-warning,
.header-bar.theme-info,
.header-bar.theme-light,
.header-bar.theme-light-blue,
.header-bar.theme-light-green,
.header-bar.theme-light-red,
.header-bar.theme-light-yellow,
.header-bar.theme-light-purple,
.header-bar.theme-light-pink,
.header-bar.theme-light-teal {
    color: #212529;
}

.header-bar.theme-warning { background: #ffc107 !important; }
.header-bar.theme-info { background: #0dcaf0 !important; }
.header-bar.theme-light { background: #f8f9fa !important; }
.header-bar.theme-light-blue { background: #e3f2fd !important; }
.header-bar.theme-light-green { background: #e8f5e8 !important; }
.header-bar.theme-light-red { background: #ffebee !important; }
.header-bar.theme-light-yellow { background: #fffde7 !important; }
.header-bar.theme-light-purple { background: #f3e5f5 !important; }
.header-bar.theme-light-pink { background: #fce4ec !important; }
.header-bar.theme-light-teal { background: #e0f2f1 !important; }

.header-bar[class*="theme-light"] .text-white,
.header-bar.theme-warning .text-white,
.header-bar.theme-info .text-white {
    color: inherit !important;
}

.header-bar[class*="theme-light"] .btn-outline-light,
.header-bar.theme-warning .btn-outline-light,
.header-bar.theme-info .btn-outline-light {
    color: inherit;
    border-color: currentColor;
}

.sidebar {
    width: 192px;
    background: var(--sidebar-primary);
    color: var(--sidebar-text-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: calc(100vh - 76px);
    left: 0;
    top: 76px;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    margin-top: 0 !important;
    padding: 10px 0 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Theme Classes */
.sidebar.theme-primary { --sidebar-primary: #1e3a8a; --sidebar-text-color: white; --header-primary: #1e3a8a; }
.sidebar.theme-secondary { --sidebar-primary: #6c757d; --sidebar-text-color: white; --header-primary: #6c757d; }
.sidebar.theme-success { --sidebar-primary: #16a34a; --sidebar-text-color: white; --header-primary: #16a34a; }
.sidebar.theme-danger { --sidebar-primary: #dc2626; --sidebar-text-color: white; --header-primary: #dc2626; }
.sidebar.theme-warning { --sidebar-primary: #ffc107; --sidebar-text-color: #212529; --header-primary: #ffc107; }
.sidebar.theme-info { --sidebar-primary: #0dcaf0; --sidebar-text-color: #212529; --header-primary: #0dcaf0; }
.sidebar.theme-dark { --sidebar-primary: #212529; --sidebar-text-color: white; --header-primary: #212529; }
.sidebar.theme-purple { --sidebar-primary: #6f42c1; --sidebar-text-color: white; --header-primary: #6f42c1; }
.sidebar.theme-pink { --sidebar-primary: #d63384; --sidebar-text-color: white; --header-primary: #d63384; }
.sidebar.theme-teal { --sidebar-primary: #20c997; --sidebar-text-color: white; --header-primary: #20c997; }

/* Light Themes */
.sidebar.theme-light { --sidebar-primary: #f8f9fa; --sidebar-text-color: #212529; --header-primary: #f8f9fa; }
.sidebar.theme-light-blue { --sidebar-primary: #e3f2fd; --sidebar-text-color: #1565c0; --header-primary: #e3f2fd; }
.sidebar.theme-light-green { --sidebar-primary: #e8f5e8; --sidebar-text-color: #2e7d32; --header-primary: #e8f5e8; }
.sidebar.theme-light-red { --sidebar-primary: #ffebee; --sidebar-text-color: #c62828; --header-primary: #ffebee; }
.sidebar.theme-light-yellow { --sidebar-primary: #fffde7; --sidebar-text-color: #f57f17; --header-primary: #fffde7; }
.sidebar.theme-light-purple { --sidebar-primary: #f3e5f5; --sidebar-text-color: #7b1fa2; --header-primary: #f3e5f5; }
.sidebar.theme-light-pink { --sidebar-primary: #fce4ec; --sidebar-text-color: #ad1457; --header-primary: #fce4ec; }
.sidebar.theme-light-teal { --sidebar-primary: #e0f2f1; --sidebar-text-color: #00695c; --header-primary: #e0f2f1; }

.sidebar-header {
    padding: 15px 10px;
    color: var(--sidebar-text-color);
}

.workspace-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.workspace-details {
    flex: 1;
    min-width: 0;
}

.workspace-name {
    font-weight: 600;
    font-size: 11px;
    color: var(--sidebar-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-dropdown {
    font-size: 12px;
    color: rgba(33, 37, 41, 0.7);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 2px 12px;
    color: var(--sidebar-text-color);
    opacity: 0.8;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--sidebar-text-color);
    opacity: 1;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--sidebar-text-color);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.nav-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.nav-item.active i {
    opacity: 1;
    transform: scale(1.05);
}

.sidebar-footer {
    padding: 15px 10px;
}

.invite-btn {
    background: linear-gradient(135deg, var(--sidebar-success) 0%, #22c55e 100%);
    color: white !important;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: none;
}

.invite-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, var(--sidebar-success) 100%);
    color: white !important;
}

.upgrade-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white !important;
    border-radius: 6px;
    border-left: none;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    color: white !important;
}

/* Theme Selector Styles */
.theme-selector {
    margin-top: 15px;
    padding-top: 15px;
}

.theme-checkbox-container {
    margin-bottom: 10px;
}

.theme-checkbox {
    display: none;
}

.theme-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--sidebar-text-color);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.theme-checkbox-label:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.theme-checkbox:checked + .theme-checkbox-label {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.theme-colors {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.theme-colors.show {
    display: grid;
}

.theme-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.theme-color:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-color.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.theme-color::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theme-color.active::after {
    opacity: 1;
}

/* Search button theming */
.btn-search-theme {
    background-color: var(--sidebar-primary) !important;
    color: white !important;
    border: none !important;
}

.btn-search-theme:hover {
    background-color: var(--sidebar-primary) !important;
    opacity: 0.9;
    color: white !important;
}

.main-content {
    margin-left: 192px; /* Account for sidebar width */
    margin-top: 76px; /* Account for fixed header height */
    padding: 0;
    padding-top: 0; /* Remove extra padding that might push content down */
    background-color: #f8f9fa;
    min-height: calc(100vh - 76px);
    position: relative;
    z-index: 1; /* Lower than header z-index */
}

.content-header {
    background: var(--header-bg); /* Off-white / light gray */
    padding: 16px 24px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 2;
    width: 100%;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.welcome-text {
    color: #7f8c8d;
    font-size: 14px;
}

.content-body {
    padding: 20px;
}

/* Quick Actions Styling */
.quick-actions-header {
    background: #f8f9fa;
    padding: 16px 32px;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-actions-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.quick-actions-buttons {
    background: white;
    padding: 20px 32px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e1e5e9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-action-btn {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        left: 0;
        top: 76px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 76px; /* Account for fixed header on mobile */
        width: 100%;
    }
    
    .content-header {
        padding: 16px 20px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .content-body {
        padding: 20px;
    }
    
    .quick-actions-header {
        padding: 12px 20px;
    }
    
    .quick-actions-buttons {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .quick-action-btn {
        min-width: auto;
        width: 100%;
    }
    
    .workspace-name {
        font-size: 13px;
    }
    
    .nav-item {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .theme-colors {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .theme-color {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 576px) {
    .content-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .content-body {
        padding: 16px;
    }
    
    .quick-actions-header {
        padding: 10px 16px;
    }
    
    .quick-actions-title {
        font-size: 16px;
    }
    
    .quick-actions-buttons {
        padding: 12px 16px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 192px;
    }
}

/* Organizational Tree Integration with Sidebar */
.organizational-tree-section {
    margin: 15px 0;
    padding: 0 10px;
}

.tree-section-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.tree-section-header h6 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-section-header i {
    font-size: 16px;
}

/* Override organizational tree styles for sidebar integration */
.sidebar .organizational-tree {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    margin: 0;
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar .tree-controls {
    margin-bottom: 10px;
}

.sidebar .tree-controls .btn {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.sidebar .tree-controls .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.sidebar .tree-container {
    max-height: 300px;
    background: transparent;
}

.sidebar .tree-node-content {
    background: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    color: white;
    padding: 6px 8px;
    margin: 1px 0;
    border-radius: 4px;
}

.sidebar .tree-node-content:hover {
    background: rgba(255, 193, 7, 0.2) !important;
    color: white;
    transform: translateX(2px);
}

.sidebar .tree-label {
    color: white;
    font-size: 12px;
}

.sidebar .tree-node-content:hover .tree-label {
    color: white;
}

.sidebar .tree-icon.text-warning {
    color: #ffc107 !important;
}

.sidebar .tree-icon.text-success {
    color: #28a745 !important;
}

.sidebar .tree-arrow {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar .tree-arrow.clickable:hover {
    color: #ffc107;
}

.sidebar .tree-children {
    border-left-color: rgba(255, 255, 255, 0.3);
}

.sidebar .tree-children::before {
    background: linear-gradient(to bottom, rgba(255, 193, 7, 0.3), rgba(40, 167, 69, 0.3));
}

/* Level-specific styling for sidebar */
.sidebar .tree-node[data-level="0"] .tree-node-content {
    background: rgba(255, 193, 7, 0.2) !important;
    border: 1px solid rgba(255, 193, 7, 0.4) !important;
    font-weight: bold;
    font-size: 13px;
}

.sidebar .tree-node[data-level="1"] .tree-node-content {
    background: rgba(40, 167, 69, 0.2) !important;
    border-left: 3px solid #28a745 !important;
    margin-left: 5px;
}

.sidebar .tree-node[data-level="2"] .tree-node-content {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left: 2px solid #ffc107 !important;
    margin-left: 10px;
}

.sidebar .tree-node[data-level="3"] .tree-node-content {
    background: rgba(40, 167, 69, 0.15) !important;
    border-left: 2px solid #28a745 !important;
    margin-left: 15px;
}

.sidebar .tree-node[data-level="4"] .tree-node-content {
    background: rgba(255, 193, 7, 0.1) !important;
    border-left: 1px solid #ffc107 !important;
    margin-left: 20px;
}

.sidebar .tree-node[data-level="5"] .tree-node-content {
    background: rgba(40, 167, 69, 0.1) !important;
    border-left: 1px solid #28a745 !important;
    margin-left: 25px;
}

.sidebar .tree-node[data-level="6"] .tree-node-content {
    background: rgba(255, 193, 7, 0.05) !important;
    border-left: 1px solid #ffc107 !important;
    margin-left: 30px;
}

.sidebar .tree-node[data-level="7"] .tree-node-content {
    background: rgba(40, 167, 69, 0.05) !important;
    border-left: 1px solid #28a745 !important;
    margin-left: 35px;
}

.sidebar .tree-node[data-level="8"] .tree-node-content {
    background: rgba(255, 193, 7, 0.05) !important;
    border-left: 1px solid #ffc107 !important;
    margin-left: 40px;
}

/* Mobile responsiveness for organizational tree in sidebar */
@media (max-width: 768px) {
    .organizational-tree-section {
        margin: 10px 0;
        padding: 0 5px;
    }
    
    .sidebar .tree-container {
        max-height: 250px;
    }
    
    .sidebar .tree-node-content {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .sidebar .tree-label {
        font-size: 11px;
    }
    
    .sidebar .tree-icon {
        font-size: 10px;
    }
    
    .sidebar .tree-arrow {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }
    
    .sidebar .tree-children {
        margin-left: 10px;
    }
    
}

/* Careers page - tabs and forms polish */
#careersTabs .nav-link {
  font-weight: 500;
}

#careersTabs .nav-link.active {
  color: var(--sidebar-primary);
  border-bottom: 3px solid var(--sidebar-primary);
}

/* Keep tab content nicely rounded when used with border utilities */
.tab-content.rounded-bottom {
  border-top-left-radius: 0 !important;
}

/* Align badges in volunteer history rows */
.list-group-item .badge {
  vertical-align: middle;
}

/* iOS fixes for .btn */
.btn {
    -webkit-appearance: none;
    appearance: none;
}

/* Gradient primary button used on Careers forms */
.btn-gradient-primary {
  background: linear-gradient(135deg, var(--sidebar-primary) 0%, #6f42c1 100%);
  color: #fff !important;
  border: none !important;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.btn-gradient-primary:hover {
  filter: brightness(0.95);
  color: #fff !important;
}
.btn-gradient-primary:active {
  transform: translateY(1px);
}

/* Make default Bootstrap primary buttons look like gradient primary for consistency */
.btn-primary {
  background-color: #0d6efd !important; /* Office blue */
  border-color: #0d6efd !important;
  color: #fff !important;
  border-radius: 10px;
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #0b5ed7 !important;
  border-color: #0a58ca !important;
  color: #fff !important;
}
.btn-primary:active {
  background-color: #0a58ca !important;
  border-color: #0a53be !important;
}

/* Outline primary to match brand color and hover fill to gradient */
.btn-outline-primary {
  color: #0d6efd !important;
  border-color: #0d6efd !important;
  background: transparent;
  border-radius: 10px;
  font-weight: 600;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #fff !important;
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

/* Volunteer history cards */
.history-card {
  border: 1px solid #eef2f7 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06) !important;
  margin-bottom: 14px;
}
.history-card .fw-bold {
  font-size: 1rem;
}
.history-card .small {
  color: #6b7280 !important;
}

/* Make form controls a bit more pill-like to match mockups */
.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  border-radius: 10px;
}

/* Tidy crispy labels */
.form-label {
  font-weight: 600;
}

/* Attention pulse for important CTA */
@keyframes pulse-shadow {
  0% { box-shadow: 0 0 0 0 rgba(111, 66, 193, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(111, 66, 193, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 66, 193, 0); }
}
.btn-attention {
  animation: pulse-shadow 1.6s ease-out 0s 2;
}

/* Notification dropdown: it lives inside the fixed header, so it must not
   inherit the header's white text or be clipped by the compact layout. */
.header-bar,
.header-bar .container-fluid,
.header-bar .row,
.header-bar .col-6.col-md-3:last-child,
.header-bar .notification-dropdown {
  overflow: visible !important;
}

.header-bar .notification-dropdown-menu {
  z-index: 1100 !important;
  width: min(92vw, 26rem) !important;
  max-width: calc(100vw - 1rem) !important;
  color: #212529 !important;
  background: #ffffff !important;
  border: 1px solid #d7e0ee !important;
  white-space: normal !important;
}

.header-bar .notification-dropdown-menu .dropdown-item,
.header-bar .notification-dropdown-menu .dropdown-item *,
.header-bar .notification-dropdown-menu strong {
  color: #212529 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.header-bar .notification-dropdown-menu .text-muted {
  color: #6c757d !important;
}

.header-bar .notification-dropdown-menu .dropdown-item.bg-light {
  background-color: #eef4ff !important;
}
