/* style.css */

/* --- Variable & Base Styles --- */
:root {
    --dark-bg: #2f2b26;
    --muted-blue: #7d86a1;
    --off-white: #f9fdfc;
    --muted-green: #87a079;
    --dark-green: #16362b;
    --danger-red: #dc3545;
    /* Default sticky offset for tab bar under the page header */
    --sticky-header-offset: 72px;

    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--off-white);
    color: var(--dark-bg);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Chat tick icon sizing (used in Collaboration Space) */
.msg-meta { display: flex; align-items: center; gap: 8px; }
.msg-ticks .tick-icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }

/* Page-specific variable tuning */
body.dashboard-page { 
    /* Match Tasks header height for sticky tab offset */
    --sticky-header-offset: 72px; 
}

h1, h2, h3 {
    color: var(--dark-green);
    margin-bottom: 1rem;
}

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

/* --- Main Layout --- */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}


/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    display: flex;
    height: 100vh;
    overflow: hidden;
    flex-direction: column;
}

.content-area {
    width: 100%;
    padding: 2rem;
    height: 100%;
    /* Add a background to see the glassmorphism effect on pages like the calendar */
    background: linear-gradient(135deg, #eaf0e8, #f9fdfc);
    background-size: cover;
    background-attachment: fixed;
}

/* Re-using the .view-container from performance.css for consistency */
.view-container {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* This is key: it stops the main area from scrolling */
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0; /* Prevent header from shrinking */
}
/* Make the header and tabs sticky within the .view-container */
.view-container > .page-header,
.view-container > .tab-nav {
    position: sticky;
    top: 0; /* Stick the main header to the very top */
    z-index: 100;
    /* Ensure sticky elements are opaque and do not show scrolled content through */
    background: var(--off-white);
}

/* Dark mode: ensure sticky bars are not transparent */
body.dark-mode .view-container > .page-header,
body.dark-mode .view-container > .tab-nav {
    background: var(--dark-bg);
}

/* Dashboard: make sticky header and tabs use the same background as the page */
body.dashboard-page .view-container > .page-header,
body.dashboard-page .view-container > .tab-nav {
    background: inherit;
}

/* Prevent layout jitter on zoom: keep sticky elements at full width */
body.dashboard-page .view-container > .page-header,
body.dashboard-page .view-container > .tab-nav {
    left: 0;
    right: 0;
    width: 100%;
}

/* Adjust the top position for the tab nav to appear below the header */
.view-container > .tab-nav {
    top: var(--sticky-header-offset); /* Controlled by CSS variable for consistency */
    z-index: 120; /* Above header to ensure clicks are not blocked */
    /* Solid background so content doesn't bleed through while scrolling */
    background: var(--off-white);
    /* Subtle divider when pinned */
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-bell {
    font-size: 1.5rem;
    color: var(--muted-blue);
    cursor: pointer;
    /* Ensure vertical centering alongside the 40px avatar */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* match .user-profile height for perfect alignment */
    position: relative; /* anchor badge */
}

/* Normalize icon box for consistent alignment */
.notification-bell i {
    line-height: 1;
    display: block;
}

/* Badge for notification count (top-right dot) */
.notification-bell .notification-count-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 12px;
    background: var(--danger-red);
    color: #fff;
    border-radius: 999px;
    padding: 0 6px;
    text-align: center;
    pointer-events: none;
}

/* assets/css/style.css */

/* ------------------------------------------------------------------ */
/* Replace your existing .user-profile rule with this */
.user-profile {
    position: relative; 
    overflow: visible;  
    display: block; 
    width: 40px;
    height: 40px;
    cursor: pointer; 
    /* All visual styles have been moved to the ::before pseudo-element */
}

/* Real image overlay for header avatar; sits above the ::before circle */
.user-profile .header-profile-picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 12; /* Above the ::before (z-index: 11) */
    border: 2px solid var(--muted-green);
}

/* Add this new rule to your CSS file */
.user-profile::before {
    content: ''; /* Required for pseudo-elements to appear */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* --- The Stacking Fix --- */
    z-index: 11; /* This is higher than the flyout's z-index of 10, keeping it on top */
    
    /* --- All visual styles moved here --- */
    border-radius: 50%;
    /* Use CSS variable to allow per-user avatar; fallback to default silhouette */
    background-image: var(--profile-avatar, url('../images/no_pp_green.svg')), linear-gradient(transparent, transparent);
    background-color: var(--muted-green); 
    background-size: 100%, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    
    /* Transition for the hover effect */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Replace your existing .user-profile:hover rule with this */
.user-profile:hover::before {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(22, 54, 43, 0.4); 
}

/* --- User Profile Hover Flyout --- */
.user-profile-flyout {
    position: absolute;
    top: 0;
    /* Position the right edge of the flyout to the center of the button, preparing for the slide-out */
    right: 20px; 
    height: 40px; /* Same height as the button */
    
    /* Styling the container */
    background-color: var(--dark-green); /* Using the dark green for good contrast */
    color: var(--off-white);
    border-radius: 20px 15px 15px 20px; /* Semi-circle on the left, sharp corners on the right */
    
    /* Content layout */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px 0 25px; /* Padding for text inside */
    white-space: nowrap; /* Prevents text from wrapping */
    
    /* Initial state for animation: hidden and shifted to the right */
    opacity: 0;
    transform: translateX(15px);
    pointer-events: none; /* Can't interact with it when hidden */
    z-index: -1; /* Place it behind the profile icon initially */
    
    /* Smooth transition for the slide and fade effect */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.3s ease, 
                z-index 0.3s;
}

/* --- State on Hover --- */
/* When you hover over the main .user-profile button, this happens to the flyout */
.user-profile:hover .user-profile-flyout {
    opacity: 1;
    transform: translateX(0); /* Slides it into its final position */
    pointer-events: auto; /* Becomes interactive */
    z-index: 10; /* Brings it in front of other elements */
}

/* --- Styling for text inside the flyout --- */
.flyout-info {
    line-height: 1;
    padding: 0 20px 0 0;
}

.flyout-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.flyout-id {
    font-size: 0.8rem;
    color: var(--muted-blue); /* Use a muted color for less emphasis */
    margin-left: 0.5rem;
}

.flyout-role {
    font-size: 0.75rem;
    opacity: 0.8;
}
/* ------------------------------------------------------------------- */

/* --- Sidebar Navigation Links --- */
.sidebar-nav {
    list-style-type: none;
    padding: 0 1rem;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: var(--muted-green);
    color: var(--dark-bg);
}
.sidebar-nav a i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
    margin-right: 1rem;
}
/* Add this to your assets/css/style.css file */

.sidebar-footer {
    padding: 11px;
    padding-top: 0;
    padding-bottom: 16px;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    color: #f9fdfc; /* Match other sidebar text */
    justify-content: center; /* Center content when collapsed */
    background-color: var(--muted-green);
}

.sidebar-logout:hover {
    background-color: var(--danger-red); /* A red color for logout hover */
}

.sidebar-logout i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
    margin-right: 1rem;
}

/* Hide text when sidebar is collapsed */
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

.sidebar.collapsed .sidebar-logout i {
    margin-right: 0;
}

/* --- NEW: Sidebar Action Button --- */
.sidebar-action-btn {
    padding: 0 1rem 1rem 1rem; /* Padding around the button */
    margin-top: auto; /* Pushes this block up against the calendar */
}

.sidebar-action-btn .btn {
    width: 100%;
    justify-content: center;
    background-color: var(--muted-green);
    color: var(--dark-bg);
    font-weight: bold;
}

.sidebar-action-btn .btn:hover {
    background-color: var(--off-white);
}

/* Hide text and show only icon when collapsed */
.sidebar.collapsed .sidebar-action-btn span {
    display: none;
}

/* --- Notification Panel --- */
/* --- Notification Panel --- */
.notification-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    transform: translateX(100%); /* Initially hidden */
}

.notification-panel.open {
    transform: translateX(0); /* Slides into view */
}

.notification-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Basic toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.toggle-switch input { display: none; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--muted-green); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- Dashboard --- */
.admin-menu {
    width: 250px;
    background-color: #f0f2f5;
    padding: 2rem;
    border-right: 1px solid #ddd;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* --- Task Page --- */
.tab-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-nav button {
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted-blue);
    border-bottom: 3px solid transparent;
}

.tab-nav button.active, .tab-nav button:hover {
    color: var(--dark-green);
    border-bottom-color: var(--dark-green);
}

.task-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: 8px;
}

.task-filters input, .task-filters select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* --- Task Item Component (Based on Mockup) --- */
.task-item-container {
    background-color: #eaf0e8; /* Lighter version of muted green */
    border-radius: 8px;
    padding: 1rem 1.5rem 1rem 1.5rem;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #d0d8cd;
    height: 40px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 6px;
}

.task-department {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--dark-green);
}

.task-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-header-actions .sort-filter-box {
    width: 120px;
    height: 30px;
    background-color: #b7a69e; /* Muted brown-ish color from mockup */
    border-radius: 15px;
}

.task-header-actions .dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--muted-green);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.task-header-actions .dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.task-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.task-content:hover{
    background-color: var(--dark-green) ;
    color: var(--off-white);
}

.task-details:hover .task-description .task-due-date {
    background-color: #16362b;
    color: #f9fdfc;
}

.task-details:hover .task-tag{
    color: #16362b;
}

/* Task container collapsed state: visibility handled via [hidden] on .task-list-content */
/* No per-item height animation to avoid clipping issues */

/* Ensure task lists render fully when expanded */
.task-list-content {
    display: block;
    overflow: visible;
}
/* Force-show when expanded, even if an inline style tried to hide it */
.task-item-container:not(.collapsed) .task-list-content {
    display: block !important;
}
/* Hide content when the container is collapsed */
.task-item-container.collapsed .task-list-content {
    display: none !important;
}
/* Hide via attribute regardless of container classes */
.task-list-content[hidden] {
    display: none !important;
}
.task-item-container.collapsed .task-header {
    margin-bottom: 0; /* remove gap under header when collapsed */
    border-bottom: none; /* hide divider line when collapsed */
}
/* Redundant safety for collapsed containers */
.task-item-container.collapsed .task-list-content[hidden] { display: none !important; }

/* Task container expanded state (default) */
.task-item-container .task-content {
    /* Allow natural height to prevent truncation when expanding */
    padding: 1rem;
    border-radius: 10px;
}

.task-details {
    flex-grow: 1;
    margin-top: 2px;
}

.task-title-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem;
}

.task-title {
    font-size: 1rem;
    font-weight: 600;
}

.importance-indicator {
    width: 12px;
    height: 12px;
    background-color: #e57373; /* Default (fallback) */
    border-radius: 50%;
}

/* Urgency color mapping for the dot */
.importance-indicator.urgent { background-color: #b71c1c; } /* Dark red */
.importance-indicator.high { background-color: #ff3b30; }   /* Bright red */
.importance-indicator.medium { background-color: #f9a825; } /* Yellow */
.importance-indicator.low { background-color: #2e7d32; }    /* Green */

.task-tag {
    background-color: #fff;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid #ccc;
    color: #333;
    font-weight: 500;
}

/* Tag color variations for different departments */
.task-tag.frontend {
    background-color: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.task-tag.ui-ux {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border-color: #e1bee7;
}

.task-tag.a11y {
    background-color: #e8f5e8;
    color: #388e3c;
    border-color: #c8e6c9;
}

.task-tag.content {
    background-color: #fff3e0;
    color: #f57c00;
    border-color: #ffcc02;
}

.task-tag.design {
    background-color: #fce4ec;
    color: #c2185b;
    border-color: #f8bbd9;
}

.task-tag.backend {
    background-color: #e0f2f1;
    color: #00695c;
    border-color: #b2dfdb;
}

.task-tag.database {
    background-color: #f1f8e9;
    color: #558b2f;
    border-color: #dcedc8;
}

.task-tag.devops {
    background-color: #e8eaf6;
    color: #3f51b5;
    border-color: #c5cae9;
}

.task-tag.bugfix {
    background-color: #ffebee;
    color: #d32f2f;
    border-color: #ffcdd2;
}

.task-tag.urgent {
    background-color: #ffebee;
    color: #d32f2f;
    border-color: #ffcdd2;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.task-tag.under-review {
    background-color: #fff8e1;
    color: #f9a825;
    border-color: #ffecb3;
}

.task-tag.grade-a {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #c8e6c9;
    font-weight: 600;
}

.task-tag.grade-b {
    background-color: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
    font-weight: 600;
}

.task-tag.reporting {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border-color: #e1bee7;
}

.task-tag.all-hands {
    background-color: #e0f2f1;
    color: #00695c;
    border-color: #b2dfdb;
}

.task-tag.recreation {
    background-color: #e8f5e8;
    color: #388e3c;
    border-color: #c8e6c9;
}

.task-tag.social {
    background-color: #fce4ec;
    color: #c2185b;
    border-color: #f8bbd9;
}

/* Pulse animation for urgent tags */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.task-description {
    background-color: #dce5d9;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
    min-height: 40px;
}

.task-actions {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
    margin-top: 1rem;
}

.task-status-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--muted-green);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--muted-green);
    cursor: pointer;
}


/* --- Single Task View --- */
.single-task-card {
    max-width: 900px;
    margin: auto;
}
.single-task-card .task-title { font-size: 2rem; }
.single-task-card .task-description-full {
    line-height: 1.6;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f8f8;
    border-radius: 8px;
}
.single-task-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin: 0 0 25px 0;
    font-family: var(--font-family);
    font-size: 16px;
}
.btn-primary {
    background-color: var(--dark-green);
    color: var(--off-white);
}
.btn-secondary {
    background-color: var(--dark-green);
    color: var(--off-white);
}


/* --- Collaboration Page --- */
.collab-space {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 4rem); /* Full height minus padding */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.chat-list {
    background-color: #f7f9f8;
    border-right: 1px solid #eee;
    overflow-y: auto;
}
.chat-list-item {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.chat-list-item:hover, .chat-list-item.active {
    background-color: #eaf0e8;
}
.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--muted-green);
}
.chat-name { font-weight: bold; }

.chat-window {
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}
.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
}
.chat-input {
    padding: 1.5rem;
    border-top: 1px solid #eee;
}
.chat-input input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 20px;
}


/* --- Performance Page --- */
.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.performance-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: bold;
    color: var(--dark-green);
    background: conic-gradient(var(--muted-green) 87%, #eee 87%);
}

/* --- Settings Page --- */
.settings-form .form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

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

.settings-form .form-group {
    margin-bottom: 1rem;
}


.settings-form .btn-container {
    margin-top: 2rem;
}


.tab-content {
    display: none;
    margin-top: 20px;
}
.tab-content.active {
    display: block;
}

/* This container will hold the tabs and allow them to grow */
.tab-content-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow this container to grow and enable scrolling */
    overflow-y: auto; /* Make this the primary scroll area */
}

/* Make the filter bar within each tab sticky */
.tab-content .task-filters-new {
    position: sticky;
    top: 0; /* Stick to the top of its scrolling parent (.tab-content-container) */
    z-index: 98;
    background: #f9fdfc; /* Give it a solid background to hide content scrolling underneath */
}

.chat-list {
    background-color: #f7f9f8;
    border-right: 1px solid #eee;
    overflow-y: auto;
}
.chat-list-item {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.chat-list-item:hover, .chat-list-item.active {
    background-color: #eaf0e8;
}
.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--muted-green);
}
.chat-name { font-weight: bold; }

.chat-window {
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    flex-shrink: 0;
}

.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9em;
}

.message.received {
    align-self: flex-start;
}
.message.received strong {
     color: var(--dark-green);
}

.message.sent {
    align-self: flex-end;
}

.chat-input {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background-color: #fff;
    flex-shrink: 0;
}

.chat-input-form {
    display: flex;
    gap: 10px;
}
.chat-input-form input {
    flex-grow: 1;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1rem;
}
.chat-input-form button {
    padding: 0.8rem 1.5rem;
    border: none;
    background-color: var(--dark-green);
    color: var(--off-white);
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
.chat-input-form button:hover {
    background-color: #2a5a4a; /* A slightly lighter dark-green */
}

/* --- Performance Page --- */
.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;  
}

/* Move keyframes OUTSIDE the selector */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.performance-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: bold;
    color: var(--dark-green);
    background: conic-gradient(var(--muted-green) 87%, #eee 87%);
}

/* --- Performance Page (Moved from inline) --- */
.performance-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.insight-item h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attendance-card .card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.average-attendance-badge {
    text-align: right;
}

.average-attendance-badge .stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-green);
    display: block;
}

.average-attendance-badge .stat-label {
    font-size: 0.8rem;
    color: var(--muted-blue);
}

.attendance-stats-list {
    list-style-type: none;
}

.attendance-stats-list .stat-count {
    font-weight: bold;
    font-size: 1.1rem;
}

.settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 20px;
}

.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--off-white);
    color: var(--dark-green);
}

.settings-form .btn-container {
    margin-top: 2rem;
}

.single-task-title-line {
    margin-bottom: 1.5rem;
}

.success-title {
    margin-bottom: 1rem !important;
}

/* --- Dark Mode Styles --- */
body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--off-white);
}

.tab-content {
    display: none;
    margin-top: 20px;
}
.tab-content.active {
    display: block;
}
.app-container {
    display: flex;
}
.sidebar {
    width: 250px;
    flex-shrink: 0;
    transition: width 0.3s ease-in-out;
    overflow: hidden;
}
.sidebar.collapsed {
    width: 80px;
}
.sidebar-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.sidebar.collapsed span {
    display: none;
}
/* .sidebar.collapsed .sidebar-nav a {
    justify-content: center;
} */
.sidebar.collapsed .sidebar-header {
    justify-content: center; /* Center the logo container */
    position: relative;      /* Create positioning context for the arrow */
}

.notification-panel.open {
    right: 0; /* Slides into view */
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    background-color: var(--off-white);
}

.notification-panel-header h3 {
    margin: 0;
    color: var(--dark-green);
    font-size: 1.3rem;
}

.notification-panel-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--muted-blue);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-panel-close-btn:hover {
    background-color: #f0f0f0;
}

.notification-panel .notification-content {
    /* Make the notification body a flex column so header stays fixed and list scrolls */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 75px); /* Keep in sync with header height */
}

.notification-panel .notification-actions {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.notification-panel .notification-actions .btn {
    width: 100%;
    margin: 0;
}

.notification-panel .notification-list {
    flex-grow: 1;              /* Fill remaining space */
    overflow-y: auto;          /* Scroll list, not the header/buttons */
    padding: 0;
}

/* Placeholder styling when there are no notifications */
.no-notifications-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #aaa;
    text-align: center;
}
.no-notifications-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.notification-list {
    padding: 0;
}

/* ------------------------- */
/* Empty state (Tasks page)  */
/* ------------------------- */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45vh; /* centers within content area */
    padding: 1rem;
}
.empty-state .empty-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    max-width: 560px;
    width: 100%;
    text-align: center;
}
.empty-state .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--muted-blue);
    background: var(--off-white);
}
.empty-state h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1.2rem;
    color: var(--dark-green);
    font-weight: 700;
}
.empty-state p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Dark mode adjustments */
body.dark-mode .empty-state .empty-card {
    background: #1f1f1f;
    border-color: #2c2c2c;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
body.dark-mode .empty-state .icon {
    background: #183222;
    color: #9fc8a7;
}
body.dark-mode .empty-state h3 { color: #e6f1ea; }
body.dark-mode .empty-state p { color: #b9c3ba; }

.notification-item {
    display: flex;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

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

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.notification-item:nth-child(1) .notification-icon {
    background-color: #e3f2fd;
    color: #1976d2;
}

.notification-item:nth-child(2) .notification-icon {
    background-color: #e8f5e8;
    color: #388e3c;
}

.notification-item:nth-child(3) .notification-icon {
    background-color: #fff3e0;
    color: #f57c00;
}

.notification-item:nth-child(4) .notification-icon {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.notification-details {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--dark-green);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.notification-message {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

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

/* Overlay for when sidebar is open */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

.message {
    padding: 0.5rem 1rem;
    border-radius: 18px;
    margin-bottom: 0.75rem;
    max-width: 100%;
}

.message.sent {
    background-color: var(--dark-green);
    color: var(--off-white);
    margin-left: auto;
    text-align: right;
}

.message.received {
    background-color: #eaf0e8;
    color: var(--dark-bg);
    margin-right: auto;
}

/* Chat message row with optional avatar */
.message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.message-row.sent { justify-content: flex-end; }
.message-row.received { justify-content: flex-start; }

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9f3ea;
    color: #0b6a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 28px;
}
.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Footer meta inside bubbles (time + ticks) */
.msg-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #666;
}
.msg-ticks { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.msg-ticks .tick-icon { width: 16px; height: 16px; vertical-align: middle; }

/* =================================================================== */
/*  DEFINITIVE SIDEBAR & CALENDAR STYLES (Replaces all previous versions) */
/* =================================================================== */

/* --- Layout Fixes --- */
.sidebar {
    width: 265px; /* Using a consistent width */
    background-color: var(--dark-bg);
    color: var(--off-white);
    padding: 0; /* Padding will be handled by inner elements */
    display: flex; /* FIX: This is essential for the calendar positioning */
    flex-direction: column; /* FIX: Stacks nav and calendar vertically */
    transition: width 0.3s ease;
    flex-shrink: 0;
    height: 100vh;
    /* Add these two lines to prevent the initial flash */
    visibility: hidden;
    opacity: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    color: inherit;
    padding: 1.1rem;
    font-size: 1.3rem;
    font-weight: bold;
    white-space: nowrap;
}

@media (min-width: 1920px) {
    .sidebar-header{
        padding: 1.5rem;
    }
}

.sidebar-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar.collapsed .header-title span {
    display: none;
}

/* --- Mini Calendar Fixes --- */
.mini-calendar {
    margin-top: auto; /* FIX: This now works and pushes the calendar to the bottom */
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05); /* Using a subtle dark theme color */
    border-radius: 12px;
    white-space: nowrap;
    box-sizing: border-box;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 20px;
}

.sidebar-nav ul {
    list-style-type: none;
    padding: 0 1rem; /* Add padding to the list itself */
    margin: 0;
    flex-grow: 1; /* Allow the nav to grow and push the calendar down */
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.mini-calendar-header button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6); /* Muted white for arrows */
    cursor: pointer;
    font-size: 14px;
    padding: 5px;

}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 13px;
    text-decoration: none;
}

.day-name, .date-cell {
    text-align: center;
    width: 28px;
    height: 28px;
    line-height: 28px;
    margin: 0 auto;
}

.day-name {
    font-weight: bold;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.date-cell.today {
    background-color: var(--muted-green); /* THEME: Using your palette for the highlight */
    border-radius: 50%;
    font-weight: bold;
    color: var(--dark-bg); /* Dark text on the lighter green background */
}

/* Hide the mini-calendar when the sidebar is collapsed */
.sidebar.collapsed .hide-when-collapsed {
    display: none;
}

/* By default, hide the calendar icon link */
.calendar-icon-link {
    display: none;
}

/* Only show the calendar icon link when the sidebar is collapsed */
.sidebar.collapsed .calendar-icon-link {
    display: block;
}

.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

/* ======================================= */
/*  STYLES FOR ADVANCED DASHBOARD LAYOUT   */
/* ======================================= */

.dashboard-main-content {
    background-color: #f0f2f5;
    padding: 2rem;
    border-right: 1px solid #ddd;
}

.admin-sidebar h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--dark-bg);
}

.admin-sidebar ul {
    list-style-type: none;
    margin-top: 1rem;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    color: var(--muted-blue);
    transition: background-color 0.2s;
}

.admin-sidebar a:hover, .admin-sidebar a.active {
    background-color: #e2e8f0;
    color: var(--dark-green);
}
/* --- Dashboard Page Layout --- */
.dashboard-main-content {
    display: flex;
    gap: 2rem;
    padding: 1rem;
}

.admin-sidebar h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #555;
    padding: 0 1rem 0.5rem 1rem;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    margin: 0.25rem 0;
}

.admin-sidebar ul li a:hover {
    background-color: #e9eef2;
}

.admin-sidebar ul li a.active {
    background-color: var(--dark-green);
    color: white;
}

/* --- Dashboard View Specifics --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    grid-template-areas:
        "deadlines activity"
        "deadlines status";
}

.card-deadlines { grid-area: deadlines; }
.card-activity { grid-area: activity; }
.card-status { grid-area: status; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.card-header h3 { font-size: 1.25rem; }
.card-header .view-all-link { color: #007bff; text-decoration: none; font-size: 0.9rem; }

.deadline-item {
    background-color: #f5f8f6;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.deadline-item p { margin: 0; }
.deadline-item .team-name { font-size: 0.8rem; color: #666; }

.status-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}
.status-tag.on-track { background-color: #2e7d32; }
.status-tag.at-risk { background-color: #ed6c02; }

.activity-list {
    list-style: none;
    padding: 0;
}
.activity-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #555;
}
.activity-list .bullet { width: 8px; height: 8px; border-radius: 50%; }
.activity-list .bullet.blue { background-color: #1976d2; }
.activity-list .bullet.green { background-color: #2e7d32; }
.activity-list .bullet.purple { background-color: #7b1fa2; }

.team-status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.active { background-color: #2e7d32; }
.status-dot.inactive { background-color: #d32f2f; }

/* --- All Tasks View Styling --- */
.task-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.task-filters input, .task-filters .filter-button {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 1rem;
}
.task-filters input { flex-grow: 1; }

.task-item {
    background-color: #f7f9fa;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.task-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}
.task-item-header .task-tag {
    background-color: #e0e0e0;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
}
.task-item .status-ontrack { color: #1976d2; }
.task-item .status-atrisk { color: #f57c00; }
.task-item .status-complete { color: #388e3c; }
.task-item-details {
    margin-left: 2.2rem;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

/* --- Manage Interns View Styling --- */
.intern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.intern-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    border-radius: 12px;
}
.intern-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.intern-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
}
.avatar-jd { background-color: #0288d1; }
.avatar-sm { background-color: #388e3c; }
.avatar-lc { background-color: #8e24aa; }
.intern-card h4 { margin: 0; }
.intern-card .department { color: #666; margin: 0; }
.intern-bio { font-size: 0.9rem; color: #555; margin-bottom: 1.5rem; }
.intern-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}
.stat-number { font-size: 1.5rem; font-weight: bold; }
.stat-label { font-size: 0.8rem; color: #666; }

/* --- Project Overview Styling --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}
.progress-bar {
    background-color: #e9ecef;
    height: 8px;
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 4px; }
.progress-percent { text-align: center; margin-top: 0.5rem; font-weight: bold; }
.project-card .team { color: #555; margin-bottom: 0.75rem;}
.project-card .description { font-size: 0.9rem; color: #666; }
.bg-green { background-color: #2e7d32; }
.bg-yellow { background-color: #f9a825; }
.bg-blue { background-color: #1565c0; }

/* --- Profile Page Specific Styles --- */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.profile-summary-card {
    text-align: center;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--muted-green);
}

.profile-picture-upload {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background-color: var(--dark-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}
.profile-picture-upload:hover {
    background-color: #2a5a4a;
}
.profile-picture-upload input[type="file"] {
    display: none;
}

.user-role {
    color: var(--muted-blue);
    margin-bottom: 1.5rem;
}

.profile-info-list {
    list-style: none;
    text-align: left;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.profile-info-list li {
    margin-bottom: 0.75rem;
}

/* --- Profile Page Tabs --- */
.profile-tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem;
}

.profile-tab-nav button {
    padding: 0.8rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--muted-blue);
    border-bottom: 3px solid transparent;
    font-weight: 600;
}

.profile-tab-nav button.active, .profile-tab-nav button:hover {
    color: var(--dark-green);
    border-bottom-color: var(--dark-green);
}

.profile-tab-content {
    display: none;
}

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

.settings-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--off-white);
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#mc-file-upload {
    display: none;
}

/* --- Popups / Modals --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.popup-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    max-width: 400px;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #0e0e0e;
}

.popup-content .icon {
    font-size: 3rem;
    color: var(--muted-green);
    margin-bottom: 1rem;
}
.hidden {
    display: none !important;
}

/* --- NEW: Sidebar Logo Styling --- */
.sidebar .sidebar-header .header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* MODIFIED: Made main logo bigger */
    height: 40px;
    flex-grow: 1;
    margin-right: 1rem;
    overflow: hidden;
}

.sidebar .header-logo .logo-full {
    display: block;
    height: 100%;
    width: auto;
    transition: opacity 0.2s ease-in-out;
}

.sidebar .header-logo .logo-mark {
    display: none; /* Hidden by default */
    height: 34px; /* Made the collapsed logo a tiny bit smaller */
    width: auto;
}

/* When sidebar is collapsed, swap the logos */
.sidebar.collapsed .header-logo .logo-full { display: none; }
.sidebar.collapsed .header-logo .logo-mark { display: block; }
.sidebar.collapsed .header-logo {
    flex-grow: 0; /* Allow the logo to center properly */
    justify-content: center;
    margin-right: 0;
}

/* Position the arrow independently to prevent it from affecting logo centering */
.sidebar.collapsed #toggle-arrow {
    position: absolute;
    right: 0.6rem;
    visibility: hidden;
}

/* When collapsed, match nav link padding for perfect alignment */
.sidebar.collapsed .sidebar-header {
    padding: 1rem;
}

/* Make the arrow smaller */
#toggle-arrow {
    font-size: 1rem; /* MODIFIED: Reduced arrow size */
    transition: transform 0.3s ease;
}

/* --- Event Modal Specific Styles --- */
.popup-content.event-modal {
    text-align: left;
    max-width: 500px;
}

.event-modal-list {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #eee;
}

.event-modal-list .calendar-event {
    margin-bottom: 0.5rem;
}

.event-modal-list p {
    color: #666;
    text-align: center;
    padding: 1rem 0;
}

.event-modal-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.event-modal-form input {
    flex-grow: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

/* --- Toast Notification --- */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: white;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-notification.success {
    background-color: var(--dark-green);
}
.toast-notification.error {
    background-color: var(--danger-red);
}

/* --- NEW: Task Filter Bar (for /) --- */
.task-filters-new {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.task-filters-new input[type="text"] {
    flex-grow: 1;
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
    background-color: transparent;
    color: var(--dark-green);
}
.task-filters-new input[type="text"]:focus {
    outline: none;
}

.task-item-container.single-task {
    padding: 0;
    margin-bottom: 1rem;
}

.task-item-container.single-task .task-content {
    margin-bottom: 0;
    border-radius: 10px;
}

@media (min-width: 1920px) {
    .page-header {
        margin-bottom: 2rem;
    }
}

.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 14%;
}

@media (min-width: 1920px) {
    .custom-dropdown {
        width: 10.1%;
    }
}

.dropdown-button {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: var(--muted-green);
    color: var(--off-white);
    cursor: pointer;
    position: relative; /* Ensure the arrow is positioned relative to the button */
    text-align: left;
}

.filter {
    position: absolute;
    right: 1rem; /* Align the arrow to the right */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--off-white); /* Arrow color */
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--muted-green);
    border: 1px solid #ccc;
    border-radius: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    z-index: 1000;
}

.dropdown-options li {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--off-white);
    transition: background-color 0.2s ease;
}

.dropdown-options li:hover {
    background-color: var(--dark-green);
    color: var(--off-white);
}

/* --- FAQ Accordion Styles --- */
.faq-accordion {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-green);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--muted-green);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--muted-blue);
}

.faq-question[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 0 1rem 0;
    color: var(--muted-blue);
    line-height: 1.6;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    margin: 0;
}

/* Dark mode adjustments for FAQ */
body.dark-mode .faq-item {
    border-bottom-color: var(--border-grey);
}

body.dark-mode .faq-question {
    color: var(--dark-green);
}

body.dark-mode .faq-question:hover {
    color: var(--muted-green);
}

body.dark-mode .faq-answer {
    color: var(--text-color-muted);
}

/* ============================================================= */
/*  DARK MODE: DEFINITIVE SIDEBAR & CALENDAR STYLES (V2)         */
/* ============================================================= */

/* --- Layout Fixes --- */
.sidebar {
    width: 265px; /* Using a consistent width */
    background-color: var(--dark-bg);
    color: var(--off-white);
    padding: 0; /* Padding will be handled by inner elements */
    display: flex; /* FIX: This is essential for the calendar positioning */
    flex-direction: column; /* FIX: Stacks nav and calendar vertically */
    transition: width 0.3s ease;
    flex-shrink: 0;
    height: 100vh;
    /* Add these two lines to prevent the initial flash */
    visibility: hidden;
    opacity: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    color: inherit;
    padding: 1.1rem;
    font-size: 1.3rem;
    font-weight: bold;
    white-space: nowrap;
}

@media (min-width: 1920px) {
    .sidebar-header{
        padding: 1.5rem;
    }
}

.sidebar-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar.collapsed .header-title span {
    display: none;
}

/* --- Mini Calendar Fixes --- */
.mini-calendar {
    margin-top: auto; /* FIX: This now works and pushes the calendar to the bottom */
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05); /* Using a subtle dark theme color */
    border-radius: 12px;
    white-space: nowrap;
    box-sizing: border-box;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 20px;
}

.sidebar-nav ul {
    list-style-type: none;
    padding: 0 1rem; /* Add padding to the list itself */
    margin: 0;
    flex-grow: 1; /* Allow the nav to grow and push the calendar down */
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.mini-calendar-header button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6); /* Muted white for arrows */
    cursor: pointer;
    font-size: 14px;
    padding: 5px;

}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 13px;
    text-decoration: none;
}

.day-name, .date-cell {
    text-align: center;
    width: 28px;
    height: 28px;
    line-height: 28px;
    margin: 0 auto;
}

.day-name {
    font-weight: bold;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.date-cell.today {
    background-color: var(--muted-green); /* THEME: Using your palette for the highlight */
    border-radius: 50%;
    font-weight: bold;
    color: var(--dark-bg); /* Dark text on the lighter green background */
}

/* Hide the mini-calendar when the sidebar is collapsed */
.sidebar.collapsed .hide-when-collapsed {
    display: none;
}

/* By default, hide the calendar icon link */
.calendar-icon-link {
    display: none;
}

/* Only show the calendar icon link when the sidebar is collapsed */
.sidebar.collapsed .calendar-icon-link {
    display: block;
}

.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

/* ======================================= */
/*  STYLES FOR ADVANCED DASHBOARD LAYOUT   */
/* ======================================= */

.dashboard-main-content {
    background-color: #f0f2f5;
    padding: 2rem;
    border-right: 1px solid #ddd;
}

.admin-sidebar h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--dark-bg);
}

.admin-sidebar ul {
    list-style-type: none;
    margin-top: 1rem;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    color: var(--muted-blue);
    transition: background-color 0.2s;
}

.admin-sidebar a:hover, .admin-sidebar a.active {
    background-color: #e2e8f0;
    color: var(--dark-green);
}
/* --- Dashboard Page Layout --- */
.dashboard-main-content {
    display: flex;
    gap: 2rem;
    padding: 1rem;
}

.admin-sidebar h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #555;
    padding: 0 1rem 0.5rem 1rem;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    margin: 0.25rem 0;
}

.admin-sidebar ul li a:hover {
    background-color: #e9eef2;
}

.admin-sidebar ul li a.active {
    background-color: var(--dark-green);
    color: white;
}

/* --- Dashboard View Specifics --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    grid-template-areas:
        "deadlines activity"
        "deadlines status";
}

.card-deadlines { grid-area: deadlines; }
.card-activity { grid-area: activity; }
.card-status { grid-area: status; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.card-header h3 { font-size: 1.25rem; }
.card-header .view-all-link { color: #007bff; text-decoration: none; font-size: 0.9rem; }

.deadline-item {
    background-color: #f5f8f6;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.deadline-item p { margin: 0; }
.deadline-item .team-name { font-size: 0.8rem; color: #666; }

.status-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}
.status-tag.on-track { background-color: #2e7d32; }
.status-tag.at-risk { background-color: #ed6c02; }

.activity-list {
    list-style: none;
    padding: 0;
}
.activity-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #555;
}
.activity-list .bullet { width: 8px; height: 8px; border-radius: 50%; }
.activity-list .bullet.blue { background-color: #1976d2; }
.activity-list .bullet.green { background-color: #2e7d32; }
.activity-list .bullet.purple { background-color: #7b1fa2; }

.team-status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.active { background-color: #2e7d32; }
.status-dot.inactive { background-color: #d32f2f; }

/* --- All Tasks View Styling --- */
.task-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.task-filters input, .task-filters .filter-button {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 1rem;
}
.task-filters input { flex-grow: 1; }

.task-item {
    background-color: #f7f9fa;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.task-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}
.task-item-header .task-tag {
    background-color: #e0e0e0;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
}
.task-item .status-ontrack { color: #1976d2; }
.task-item .status-atrisk { color: #f57c00; }
.task-item .status-complete { color: #388e3c; }
.task-item-details {
    margin-left: 2.2rem;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

/* --- Manage Interns View Styling --- */
.intern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.intern-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    border-radius: 12px;
}
.intern-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.intern-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
}
.avatar-jd { background-color: #0288d1; }
.avatar-sm { background-color: #388e3c; }
.avatar-lc { background-color: #8e24aa; }
.intern-card h4 { margin: 0; }
.intern-card .department { color: #666; margin: 0; }
.intern-bio { font-size: 0.9rem; color: #555; margin-bottom: 1.5rem; }
.intern-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}
.stat-number { font-size: 1.5rem; font-weight: bold; }
.stat-label { font-size: 0.8rem; color: #666; }

/* --- Project Overview Styling --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}
.progress-bar {
    background-color: #e9ecef;
    height: 8px;
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 4px; }
.progress-percent { text-align: center; margin-top: 0.5rem; font-weight: bold; }
.project-card .team { color: #555; margin-bottom: 0.75rem;}
.project-card .description { font-size: 0.9rem; color: #666; }
.bg-green { background-color: #2e7d32; }
.bg-yellow { background-color: #f9a825; }
.bg-blue { background-color: #1565c0; }

/* --- Profile Page Specific Styles --- */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.profile-summary-card {
    text-align: center;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--muted-green);
}

.profile-picture-upload {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background-color: var(--dark-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}
.profile-picture-upload:hover {
    background-color: #2a5a4a;
}
.profile-picture-upload input[type="file"] {
    display: none;
}

.user-role {
    color: var(--muted-blue);
    margin-bottom: 1.5rem;
}

.profile-info-list {
    list-style: none;
    text-align: left;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.profile-info-list li {
    margin-bottom: 0.75rem;
}

/* --- Profile Page Tabs --- */
.profile-tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem;
}

.profile-tab-nav button {
    padding: 0.8rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--muted-blue);
    border-bottom: 3px solid transparent;
    font-weight: 600;
}

.profile-tab-nav button.active, .profile-tab-nav button:hover {
    color: var(--dark-green);
    border-bottom-color: var(--dark-green);
}

.profile-tab-content {
    display: none;
}

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

.settings-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#mc-file-upload {
    display: none;
}

/* --- Popups / Modals --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.popup-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    max-width: 400px;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #acbac1;
}

.popup-content .icon {
    font-size: 3rem;
    color: var(--muted-green);
    margin-bottom: 1rem;
}
.hidden {
    display: none !important;
}

/* --- NEW: Sidebar Logo Styling --- */
.sidebar .sidebar-header .header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* MODIFIED: Made main logo bigger */
    height: 40px;
    flex-grow: 1;
    margin-right: 1rem;
    overflow: hidden;
}

.sidebar .header-logo .logo-full {
    display: block;
    height: 100%;
    width: auto;
    transition: opacity 0.2s ease-in-out;
}

.sidebar .header-logo .logo-mark {
    display: none; /* Hidden by default */
    height: 34px; /* Made the collapsed logo a tiny bit smaller */
    width: auto;
}

/* When sidebar is collapsed, swap the logos */
.sidebar.collapsed .header-logo .logo-full { display: none; }
.sidebar.collapsed .header-logo .logo-mark { display: block; }
.sidebar.collapsed .header-logo {
    flex-grow: 0; /* Allow the logo to center properly */
    justify-content: center;
    margin-right: 0;
}

/* Position the arrow independently to prevent it from affecting logo centering */
.sidebar.collapsed #toggle-arrow {
    position: absolute;
    right: 0.6rem;
}

/* When collapsed, match nav link padding for perfect alignment */
.sidebar.collapsed .sidebar-header {
    padding: 1rem;
}

/* Make the arrow smaller */
#toggle-arrow {
    font-size: 1rem; /* MODIFIED: Reduced arrow size */
    transition: transform 0.3s ease;
}

/* --- Event Modal Specific Styles --- */
.popup-content.event-modal {
    text-align: left;
    max-width: 500px;
}

.event-modal-list {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #eee;
}

.event-modal-list .calendar-event {
    margin-bottom: 0.5rem;
}

.event-modal-list p {
    color: #666;
    text-align: center;
    padding: 1rem 0;
}

.event-modal-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.event-modal-form input {
    flex-grow: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

/* --- Toast Notification --- */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: white;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-notification.success {
    background-color: var(--dark-green);
}
.toast-notification.error {
    background-color: var(--danger-red);
}

/* --- NEW: Task Filter Bar (for /) --- */
.task-filters-new {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.task-filters-new input[type="text"] {
    flex-grow: 1;
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
    background-color: #dce5d9;
}
.task-filters-new input[type="text"]:focus {
    outline: none;
}

.task-filters-new select {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: var(--dark-green);
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c757d'%3E%3Cpath fill-rule='evenodd' d='M4.22 6.22a.75.75 0 011.06 0L8 8.94l2.72-2.72a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0L4.22 7.28a.75.75 0 010-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2em;
    padding-right: 2rem;
}
.task-filters-new select:focus {
    outline: none;
    border-color: var(--muted-green);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2387a079'%3E%3Cpath fill-rule='evenodd' d='M4.22 6.22a.75.75 0 011.06 0L8 8.94l2.72-2.72a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0L4.22 7.28a.75.75 0 010-1.06z'/%3E%3C/svg%3E");
}

.task-item-container.single-task {
    padding: 0;
    margin-bottom: 1rem;
}

.task-item-container.single-task .task-content {
    margin-bottom: 0;
    border-radius: 10px;
}

@media (min-width: 1920px) {
    .page-header {
        margin-bottom: 2rem;
    }
}

.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 14%;
}

@media (min-width: 1920px) {
    .custom-dropdown {
        width: 10.1%;
    }
}

.dropdown-button {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: var(--muted-green);
    color: var(--off-white);
    cursor: pointer;
    position: relative; /* Ensure the arrow is positioned relative to the button */
    text-align: left;
}

.filter {
    position: absolute;
    right: 1rem; /* Align the arrow to the right */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--off-white); /* Arrow color */
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--muted-green);
    border: 1px solid #ccc;
    border-radius: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    z-index: 1000;
}

.dropdown-options li {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--off-white);
    transition: background-color 0.2s ease;
}

.dropdown-options li:hover {
    background-color: var(--dark-green);
    color: var(--off-white);
}

/* --- FAQ Accordion Styles --- */
.faq-accordion {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-green);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--muted-green);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--muted-blue);
}

.faq-question[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 0 1rem 0;
    color: var(--muted-blue);
    line-height: 1.6;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    margin: 0;
}

/* .settings-container {
    max-width: 600px;
    margin: 0 auto;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
} */

/* Dark mode adjustments for FAQ */
body.dark-mode .faq-item {
    border-bottom-color: var(--border-grey);
}

body.dark-mode .faq-question {
    color: var(--dark-green);
}

body.dark-mode .faq-question:hover {
    color: var(--muted-green);
}

body.dark-mode .faq-answer {
    color: var(--text-color-muted);
}

/* ============================================================= */
/*  DARK MODE: DEFINITIVE SIDEBAR & CALENDAR STYLES (V2 - ENHANCED VISIBILITY)
/* ============================================================= */

body.dark-mode {
    /* --- Core Color Palette Remapping (Brighter & Higher Contrast) --- */
    --dark-bg: #1e2124;                     /* Slightly lighter, cooler dark background */
    --off-white: #282c31;                   /* Card background, more distinct from main bg */
    --light-green: #333840;                 /* Background for smaller elements, inputs */
    --border-grey: #444950;                 /* Brighter, more visible borders */
    --text-color: #e6e6e6;                  /* Main text color, slightly softer than pure white */
    --text-color-muted: #b0bec5;            /* NEW: Much brighter muted text for readability */
    --dark-green: #9fba91;                  /* Primary Accent (Brighter Sage Green) */
    --muted-green: #87a079;                 /* Hover Accent (Now uses the old primary color) */
    --muted-blue: var(--text-color-muted);  /* Reroute the old muted blue to the new readable color */
    --placeholder-color: #8a9199;           /* NEW: Specific, readable placeholder color */
    
    /* --- Apply Core Colors --- */
    background-color: var(--dark-bg);
    color: var(--text-color);
}

/* === Component Overrides === */

/* --- Main Layout & Cards --- */
body.dark-mode .sidebar {
    background-color: #16181a; 
    color: #e0e0e0;
}
body.dark-mode .sidebar-nav a:hover, 
body.dark-mode .sidebar-nav a.active {
    background-color: var(--muted-green);
    color: #16181a;
}
body.dark-mode .mini-calendar {
    background-color: rgba(249, 253, 252, 0.05);
}
body.dark-mode .date-cell.today {
    background-color: var(--dark-green);
    color: #16181a;
}

body.dark-mode .content-area {
    background: var(--dark-bg);
}
body.dark-mode .card,
body.dark-mode .profile-summary-panel,
body.dark-mode .profile-main-panel,
body.dark-mode .popup-content,
body.dark-mode .project-group,
body.dark-mode .request-category-card,
body.dark-mode .project-card,
body.dark-mode .intern-card,
body.dark-mode .card.glass-card,
body.dark-mode .notification-panel {
    background-color: var(--off-white);
    border: 1px solid var(--border-grey);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}
body.dark-mode .task-item-container {
    background-color: var(--light-green);
    border-color: transparent;
}
body.dark-mode .task-item-container:hover {
    background-color: var(--border-grey) !important;
}

/* --- Headings & Text --- */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode .flyout-name,
body.dark-mode .stat-number,
body.dark-mode .department-box-title {
    color: var(--dark-green);
}
body.dark-mode a {
    color: var(--dark-green);
}
body.dark-mode .sidebar a {
    color: #f0f0f0;
}

/* FIX: Muted text now uses the high-visibility muted color */
body.dark-mode p,
body.dark-mode .project-team,
body.dark-mode .department,
body.dark-mode .notification-time,
body.dark-mode .notification-message,
body.dark-mode .stat-label,
body.dark-mode .detail-label,
body.dark-mode .user-role {
    color: var(--text-color-muted);
}

body.dark-mode .flyout-name {
    font-weight: 700; /* Make it bolder to stand out */
}

body.dark-mode .flyout-id,
body.dark-mode .flyout-role, body.dark-mode .flyout-name {
    /* Use a slightly less intense dark color for secondary info */
    color: rgba(30, 33, 36, 0.85);
}

body.dark-mode strong, body.dark-mode .detail-value, body.dark-mode .intern-popup-name {
    color: var(--text-color); /* Ensure bold/strong text is bright */
}

body.dark-mode .task-description,
body.dark-mode .intern-bio,
body.dark-mode .detail-item {
    background-color: var(--light-green);
    color: var(--text-color);
    border-color: var(--border-grey);
}

/* --- Buttons & Interactive Elements --- */
body.dark-mode .btn-primary {
    background-color: var(--dark-green);
    color: #1e2124;
    font-weight: bold;
    font-family: var(--font-family);
    font-size: 16px;
}
body.dark-mode .btn-secondary,
body.dark-mode .btn-cancel {
    background-color: var(--dark-green);
    color: #1e2124;
    border: 1px solid var(--light-grey);
    font-weight: bold;
    font-family: var(--font-family);
    font-size: 16px;
}
body.dark-mode .btn-confirm {
    background-color: var(--muted-green);
    color: #1e2124;
}

/* --- Tabs --- */
body.dark-mode .tab-nav,
body.dark-mode .admin-tab-nav,
body.dark-mode .details-tab-nav,
body.dark-mode .profile-tab-nav {
    border-bottom-color: var(--border-grey);
}
/* FIX: Inactive tabs now use the high-visibility muted color */
body.dark-mode .tab-nav button,
body.dark-mode .admin-tab-link,
body.dark-mode .details-tab-nav button,
body.dark-mode .profile-tab-nav button {
    color: var(--text-color-muted);
}
body.dark-mode .tab-nav button.active,
body.dark-mode .tab-nav button:hover,
body.dark-mode .admin-tab-link.active,
body.dark-mode .admin-tab-link:hover,
body.dark-mode .details-tab-nav button.active,
body.dark-mode .details-tab-nav button:hover,
body.dark-mode .profile-tab-nav button.active,
body.dark-mode .profile-tab-nav button:hover {
    color: var(--dark-green);
    border-bottom-color: var(--dark-green);
}

/* --- Forms & Inputs --- */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: var(--light-green) !important;
    border: 1px solid var(--border-grey) !important;
    color: var(--text-color) !important;
}
body.dark-mode select {
    /* 👇 Custom Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f9fdfc'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important;
    background-size: 1.2em !important;
    padding-right: 2rem !important;
    /* 👇 Crucial: Hide default system arrow */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}
/* FIX: Placeholder text now uses the high-visibility placeholder color */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--placeholder-color);
}
body.dark-mode .user-profile::before {
    background-color: var(--dark-green);
}

/* --- Calendar Specific Fixes --- */
body.dark-mode .calendar-day, body.dark-mode .custom-picker-content{
    background-color: var(--off-white);
    border-color: var(--border-grey);
}
body.dark-mode .calendar-day:hover {
    background-color: var(--light-green);
}
body.dark-mode .calendar-day.other-month {
    background-color: #222529;
    color: #555;
}
body.dark-mode .calendar-header {
    background-color: var(--light-green);
    color: var(--text-color-muted);
}
/* START: Fix for calendar day numbers */
body.dark-mode .calendar-day:not(.other-month) .date-number {
    color: var(--text-color);
}
/* END: Fix for calendar day numbers */
body.dark-mode .calendar-event {
    color: #f0f0f0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
body.dark-mode .calendar-event.status-pending-review { background-color: rgba(255, 193, 7, 0.7); color: #fff; }
body.dark-mode .calendar-event.status-approved { background-color: rgba(76, 175, 80, 0.7); color: #fff; }
body.dark-mode .calendar-event.status-rejected { background-color: rgba(244, 67, 54, 0.7); color: #fff; }
body.dark-mode .calendar-event.user-added-meeting { background-color: rgba(33, 150, 243, 0.7); color: #fff; }
body.dark-mode .calendar-event.user-added-deadline { background-color: rgba(255, 87, 34, 0.7); color: #fff; }
body.dark-mode .calendar-event.event-joined { background-color: rgba(156, 39, 176, 0.7); color: #fff; }

/* FIX: Notification Panel readability */
body.dark-mode .notification-panel-header,
body.dark-mode .notification-item,
body.dark-mode .notification-actions {
    background-color: var(--off-white);
    border-color: var(--border-grey);
}
body.dark-mode .notification-list::-webkit-scrollbar-thumb {
    background: var(--border-grey);
}
body.dark-mode .notification-list::-webkit-scrollbar-track {
    background: var(--off-white);
}

/* ============================================================= */
/*  DARK MODE: Tasks & Single Task Page Style Fixes              */
/* ============================================================= */

/* --- Task List Page (/) --- */

/* Style the main project accordion header */
body.dark-mode .task-item-container .task-header {
    background-color: var(--light-green);
    border-color: var(--border-grey);
    color: var(--text-color);
}
body.dark-mode .task-department {
    color: var(--dark-green);
}

/* Style the individual task items within the accordion */
body.dark-mode .task-item-container:hover {
    background-color: var(--border-grey) !important;
}

/* Style the filter bar */
body.dark-mode .task-filters-new {
    background-color: var(--off-white);
    border-color: var(--border-grey);
}
body.dark-mode .task-filters-new input,
body.dark-mode .task-filters-new select {
    background-color: var(--light-green) !important;
    border-color: var(--border-grey) !important;
}
body.dark-mode .custom-dropdown .dropdown-button {
    background-color: var(--dark-green);
    border-color: var(--border-grey);
}
body.dark-mode .custom-dropdown .dropdown-options {
    background-color: var(--muted-green);
    border-color: var(--border-grey);
    width: 100%;
}
body.dark-mode .custom-dropdown .dropdown-options li:hover {
    background-color: var(--border-grey);
}

/* --- Single Task Page (/task) --- */

/* Style the main content sections */
body.dark-mode .task-content-section {
    background-color: var(--off-white);
    border-color: var(--border-grey);
}
body.dark-mode .task-content-section h2 {
    background-color: transparent;
    border-bottom: 1px solid var(--border-grey);
}

/* Style the navigation and milestone sidebars */
body.dark-mode .page-section-nav ul,
body.dark-mode .milestones-panel,
body.dark-mode .chat-request-panel {
    background-color: var(--off-white);
    border-color: var(--border-grey);
}
body.dark-mode .page-section-nav li a:hover,
body.dark-mode .page-section-nav li a.active {
    background-color: var(--light-green);
}
body.dark-mode .milestones-header,
body.dark-mode .chat-request-header {
    background-color: var(--light-green);
    border-color: var(--border-grey);
}
body.dark-mode .milestones-header h3,
body.dark-mode .chat-request-header h3 {
    color: var(--dark-green);
}
body.dark-mode .milestone-item {
    border-color: var(--border-grey);
    color : var(--text-color);
}

/* Style sub-task items */
body.dark-mode .sub-task-item {
    background-color: var(--light-green);
    border-color: var(--border-grey);
    color : var(--text-color);
}
body.dark-mode .sub-task-item:hover {
    background-color: var(--border-grey);
}


/* --- Toggle Arrow Styles --- */
#toggle-arrow {
    font-size: 1rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.sidebar.collapsed #toggle-arrow {
    opacity: 0;
    pointer-events: none;
}
/* --- ROLE-SPECIFIC TASK TAG STYLES (Comprehensive List from DB Roles) --- */

/* 1. Admin & CEO Roles */
.task-tag.admin,
.task-tag.super-admin {
    background-color: #f0f0f5; /* Light Grey */
    color: var(--dark-bg);
    border-color: #dcdcdc;
    font-weight: 600;
}
.task-tag.ceo {
    background-color: #fff8e1; /* Pale Gold */
    color: #a07200; /* Gold Text */
    border-color: #ffeb99;
    font-weight: 700;
}

/* 2. Management & Architecture Roles */
.task-tag.project-manager {
    background-color: #eaf8e9; /* Very Light Sage Green */
    color: #4b6b44; /* Darker Sage Green */
    border-color: #d8e5d6;
}
.task-tag.application-architect {
    background-color: #f8eaf8; /* Light Rose */
    color: #883988; /* Dark Magenta */
    border-color: #ecc0ec;
}

/* 3. Development Roles */
.task-tag.frontend,
.task-tag.frontend-developer {
    background-color: #e3f2fd; /* Light Cyan */
    color: #1976d2; /* Strong Blue */
    border-color: #bbdefb;
}
.task-tag.backend {
    background-color: #e0f7fa; /* Very Light Teal */
    color: #00897b; /* Dark Teal */
    border-color: #b2ebf2;
}
.task-tag.fullstack-developer {
    background-color: #e6ffe6; /* Pale Green */
    color: #1b5e20; /* Deep Green */
    border-color: #c8e6c9;
    font-weight: 600;
}
.task-tag.database,
.task-tag.database-developer {
    background-color: #ede7f6; /* Very Light Purple */
    color: #512da8; /* Deep Indigo */
    border-color: #d1c4e9;
}

/* 4. Engineering & Infrastructure Roles */
.task-tag.system-engineer {
    background-color: #fff0e6; /* Light Orange-Brown */
    color: #d64500; /* Dark Orange */
    border-color: #ffd8b2;
}
.task-tag.software-engineering,
.task-tag.software-system-engineering {
    background-color: #f0f8ff; /* Very Light Blue */
    color: #1e88e5; /* Medium Blue */
    border-color: #bbdefb;
}
.task-tag.devops,
.task-tag.devops-engineer {
    background-color: #e8eaf6; /* Light Blue-Gray */
    color: #3f51b5; /* Royal Blue */
    border-color: #c5cae9;
}
.task-tag.cyber-security {
    background-color: #e6e6e6; /* Medium Grey */
    color: #333333; /* Black Text */
    border-color: #b3b3b3;
    font-weight: 600;
}

/* 5. Support/Specialty Roles (from task_table values) */
.task-tag.ui-ux {
    background-color: #f3e5f5; /* Light Lavender */
    color: #7b1fa2; /* Deep Purple */
    border-color: #e1bee7;
}
.task-tag.accessibility, 
.task-tag.a11y {
    background-color: #e8f5e8; /* Light Mint */
    color: #388e3c; /* Forest Green */
    border-color: #c8e6c9;
}
.task-tag.content {
    background-color: #fff3e0; /* Pale Yellow */
    color: #f57c00; /* Dark Orange */
    border-color: #ffcc02;
}
.task-tag.design {
    background-color: #fce4ec; /* Light Pink */
    color: #c2185b; /* Raspberry */
    border-color: #f8bbd9;
}

/* 6. Finance/Miscellaneous */
.task-tag.accountant {
    background-color: #e9f5f5; /* Light Aqua */
    color: #006064; /* Dark Cyan */
    border-color: #b2dfdb;
}

/* 7. High Priority/Task Types */
.task-tag.bugfix {
    background-color: #ffebee; /* Pale Red */
    color: var(--danger-red); /* Alert Red */
    border-color: #ffcdd2;
    font-weight: 600;
}

/* Keep the default as a fallback */
.task-tag {
    /* Retained default styles */
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #fff;
    border: 1px solid #ccc;
    color: #333;
}


/* ===== VIEW TOGGLE & BLOCKS VIEW STYLES ===== */

/* View Toggle Button Styles */
.view-toggle-buttons {
    display: flex;
    gap: 0.5rem;
}

.view-toggle-btn {
    background-color: transparent;
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--dark-green);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.view-toggle-btn:hover {
    border-color: var(--dark-green);
    background-color: rgba(22, 54, 43, 0.05);
}

.view-toggle-btn.active {
    background-color: var(--dark-green);
    color: var(--off-white);
    border-color: var(--dark-green);
}

/* Blocks View Layout */
.task-list.blocks-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.blocks-view .task-item-container {
    background-color: #eaf0e8;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.blocks-view .task-item-container:hover {
    border-color: var(--dark-green);
    box-shadow: 0 4px 12px rgba(22, 54, 43, 0.15);
    transform: translateY(-4px);
}

.blocks-view .task-header {
    display: none;
}

.blocks-view .task-list-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blocks-view .task-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
}



.blocks-view .task-details {
    margin-top: 0 !important;
}

.blocks-view .task-title-line {
    margin: 0 !important;
    flex-wrap: wrap;
}

.blocks-view .task-title {
    font-size: 1.1rem;
    line-height: 1.3;
    flex: 1;
    min-width: 100%;
}

.blocks-view .task-description {
    line-height: 1.5;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blocks-view .task-actions {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #d0d8cd;
    width: 100%;
}

.blocks-view .task-due-date {
    font-size: 0.85rem;
    padding: 0 !important;
    background-color: transparent !important;
    color: inherit !important;
}

.blocks-view .task-tag {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
}

/* Responsive grid for smaller screens */
@media (max-width: 1200px) {
    .task-list.blocks-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .task-list.blocks-view {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .view-toggle-buttons {
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    .task-list.blocks-view {
        grid-template-columns: 1fr;
    }
    
    .task-filters-new {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .task-filters-new input {
        width: 100%;
    }
    
    .view-toggle-buttons {
        width: 100%;
        justify-content: center;
    }
}

