:root {
    /* Modern Color Palette */
    --primary: #6366F1;      /* Indigo */
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --secondary: #3F3F46;    /* Zinc */
    --success: #10B981;      /* Emerald */
    --error: #EF4444;        /* Red */
    --warning: #F59E0B;      /* Amber */
    --info: #3B82F6;         /* Blue */
    
    /* Neutral Colors */
    --background: #F8FAFC;   /* Slate 50 */
    --surface: #FFFFFF;
    --text: #1E293B;         /* Slate 800 */
    --text-light: #64748B;   /* Slate 500 */
    --border: #E2E8F0;       /* Slate 200 */
    
    /* Derived / Hover */
    --surface-hover: #F1F5F9;
    --input-bg: #FFFFFF;
    
    /* Status Colors */
    --idle-bg: #F1F5F9;      /* Slate 100 */
    --idle-text: #475569;    /* Slate 600 */
    --vacation-bg: #FEF3C7;  /* Amber 100 */
    --vacation-text: #B45309; /* Amber 700 */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;

    /* Mobile spacing (overridden in media queries for smaller screens) */
    --mobile-gutter: 0.75rem;
    --mobile-section: 1rem;
    --mobile-card: 1rem;
    --mobile-modal: 1rem;
}

/* Dark theme variables */
[data-theme="dark"] {
    --background: #0F172A;   /* Slate 900 */
    --surface: #1E293B;      /* Slate 800 */
    --text: #F1F5F9;         /* Slate 100 */
    --text-light: #94A3B8;   /* Slate 400 */
    --border: #334155;       /* Slate 700 */
    --surface-hover: #334155;
    --input-bg: #1E293B;
    --idle-bg: #1E293B;
    --idle-text: #94A3B8;
    --vacation-bg: #422006;
    --vacation-text: #FCD34D;
    --secondary: #94A3B8;    /* Lighter for dark bg */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* Dark mode: Bulma and custom overrides */
[data-theme="dark"] .navbar.is-primary {
    background-color: var(--primary-dark);
    color: #fff;
}

[data-theme="dark"] .sidebar {
    background-color: var(--surface);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .app-nav,
[data-theme="dark"] .nav-item.active {
    background-color: var(--surface);
    border-bottom-color: var(--border);
}

[data-theme="dark"] .nav-item:hover {
    background-color: var(--surface-hover);
}

[data-theme="dark"] .nav-item.active {
    background-color: rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
}

[data-theme="dark"] .table-container,
[data-theme="dark"] .card,
[data-theme="dark"] .box {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .modal-card,
[data-theme="dark"] .modal-card-head,
[data-theme="dark"] .modal-card-body,
[data-theme="dark"] .modal-card-foot {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .modal-background {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .input,
[data-theme="dark"] .textarea,
[data-theme="dark"] .select select {
    background-color: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .input::placeholder,
[data-theme="dark"] .textarea::placeholder {
    color: var(--text-light);
}

[data-theme="dark"] .card-header {
    background-color: var(--surface);
    border-bottom-color: var(--border);
}

[data-theme="dark"] .card-footer {
    background-color: var(--background);
    border-top-color: var(--border);
}

[data-theme="dark"] .card:hover .card-header {
    background-color: var(--surface-hover);
}

[data-theme="dark"] .table {
    background-color: var(--surface);
    color: var(--text);
}

[data-theme="dark"] .table thead th {
    background-color: var(--background);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    border-color: var(--border);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--surface-hover);
}

[data-theme="dark"] .button.is-light {
    background-color: var(--surface-hover);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .button.is-light:hover {
    background-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .menu-list a:hover {
    background-color: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .sidebar-user-name {
    color: var(--text);
}

[data-theme="dark"] .sidebar-user-email {
    color: var(--text-light);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background-color: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .loading-overlay {
    background-color: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .loading-content p {
    color: var(--text);
}

[data-theme="dark"] .dropdown-content {
    background-color: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--surface-hover);
}

[data-theme="dark"] .notification {
    background-color: var(--surface);
    color: var(--text);
}

[data-theme="dark"] .tasks-filter-panel-drawer,
[data-theme="dark"] .tasks-filter-panel-header {
    background-color: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .tasks-filter-panel-header {
    background-color: var(--background);
}

[data-theme="dark"] .tasks-filter-input,
[data-theme="dark"] .tasks-filter-select {
    background-color: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .tasks-filter-section {
    border-color: var(--border);
    background: var(--surface);
}
[data-theme="dark"] .tasks-filter-section-title {
    color: var(--text);
}
[data-theme="dark"] .tasks-filter-section-title .material-icons {
    color: var(--primary-light);
}
[data-theme="dark"] .tasks-filter-date-range-label {
    color: var(--text);
}
[data-theme="dark"] .tasks-filter-date-range-sep {
    color: var(--text-light);
}
[data-theme="dark"] .tasks-filter-date-range-reset {
    color: var(--text-light);
    background: var(--surface-hover);
    border-color: var(--border);
}
[data-theme="dark"] .tasks-filter-date-range-reset:hover {
    color: var(--text);
    background: var(--border);
}

[data-theme="dark"] .pagination-link,
[data-theme="dark"] .pagination-ellipsis {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .pagination-link.is-current {
    background-color: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .breadcrumb a {
    color: var(--primary-light);
}

[data-theme="dark"] .breadcrumb li.is-active a {
    color: var(--text-light);
}

[data-theme="dark"] .tag:not(.is-primary):not(.is-success):not(.is-warning):not(.is-danger):not(.is-info) {
    background-color: var(--surface-hover);
    color: var(--text);
}

[data-theme="dark"] .panel-block {
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .panel-heading {
    background-color: var(--background);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .fc {
    --fc-border-color: var(--border);
    --fc-button-bg-color: var(--primary);
    --fc-button-border-color: var(--primary);
    --fc-button-hover-bg-color: var(--primary-light);
    --fc-button-hover-border-color: var(--primary-light);
    --fc-today-bg-color: rgba(99, 102, 241, 0.15);
    --fc-page-bg-color: var(--surface);
    --fc-neutral-bg-color: var(--background);
    --fc-list-event-hover-bg-color: var(--surface-hover);
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th {
    border-color: var(--border);
}

[data-theme="dark"] .fc-col-header-cell-cushion,
[data-theme="dark"] .fc-daygrid-day-number,
[data-theme="dark"] .fc-list-event-time,
[data-theme="dark"] .fc-list-event-title {
    color: var(--text);
}

[data-theme="dark"] .fc-list-event:hover td {
    background-color: var(--surface-hover);
}

[data-theme="dark"] .add-to-homescreen {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .project-card .box[data-type="idle"] {
    border-left-color: var(--border);
}

[data-theme="dark"] .project-card .box[data-type="vacation"] {
    border-left-color: var(--warning);
}

[data-theme="dark"] .fc-scrollgrid,
[data-theme="dark"] .fc-theme-standard .fc-scrollgrid {
    border-color: var(--border);
}

[data-theme="dark"] .fc-timegrid-slot-label,
[data-theme="dark"] .fc-timegrid-axis {
    color: var(--text-light);
}

[data-theme="dark"] .fc-multimonth-month,
[data-theme="dark"] .fc-multimonth-title {
    background-color: var(--surface);
    color: var(--text);
}

[data-theme="dark"] .fc-multimonth-header th {
    color: var(--text-light);
}

[data-theme="dark"] .search-highlight {
    background-color: rgba(245, 158, 11, 0.35);
}

/* ========== Dark mode: Views main titles ========== */
[data-theme="dark"] .title,
[data-theme="dark"] .subtitle,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text);
}

[data-theme="dark"] .card-header-title,
[data-theme="dark"] .modal-card-title {
    color: var(--text);
}

[data-theme="dark"] .tasks-view-title,
[data-theme="dark"] .whos-online-title,
[data-theme="dark"] .game-hero-title,
[data-theme="dark"] .todo-column-title,
[data-theme="dark"] .tasks-filter-panel-title,
[data-theme="dark"] .whos-online-section-title {
    color: var(--text);
}

[data-theme="dark"] .tasks-view-title .material-icons,
[data-theme="dark"] .whos-online-title-icon,
[data-theme="dark"] .todo-column-header .material-icons,
[data-theme="dark"] .tasks-filter-panel-title .material-icons {
    color: var(--primary-light);
}

/* ========== Dark mode: Sidebar links and icons ========== */
[data-theme="dark"] .menu-list a {
    color: var(--text);
}

[data-theme="dark"] .menu-list a .material-icons {
    color: var(--text-light);
}

[data-theme="dark"] .menu-list a:hover {
    background-color: rgba(99, 102, 241, 0.2);
    color: var(--text);
}

[data-theme="dark"] .menu-list a:hover .material-icons {
    color: var(--primary-light);
}

[data-theme="dark"] .menu-list a.is-active {
    background-color: var(--primary);
    color: white;
}

[data-theme="dark"] .menu-list a.is-active .material-icons {
    color: white;
}

[data-theme="dark"] .menu-group-label {
    color: var(--text-light);
}

[data-theme="dark"] .theme-preference-label {
    color: var(--text-light);
}

[data-theme="dark"] .theme-btn:not(.is-active) {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border);
}

[data-theme="dark"] .theme-btn:not(.is-active):hover {
    color: var(--text);
    background: var(--border);
}

/* ========== Dark mode: Calendar events ========== */
[data-theme="dark"] .fc-event {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .fc-event .fc-event-main {
    color: var(--text);
}

[data-theme="dark"] .delete-event-icon {
    color: var(--text-light);
    background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .delete-event-icon:hover {
    color: #FCA5A5;
    background: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .idle-event {
    background-color: var(--surface-hover) !important;
    color: var(--text) !important;
    border-left-color: var(--text-light) !important;
}

[data-theme="dark"] .vacation-event {
    background-color: var(--vacation-bg) !important;
    color: var(--vacation-text) !important;
    border-left-color: var(--vacation-text) !important;
}

/* ========== Dark mode: Todo view ========== */
[data-theme="dark"] .todo-card .card-header,
[data-theme="dark"] .todo-card .card-footer {
    background-color: var(--background);
    border-color: var(--border);
}

[data-theme="dark"] .todo-card .card-header-title {
    color: var(--text);
}

[data-theme="dark"] .todo-card .card-footer-item {
    color: var(--text-light);
}

[data-theme="dark"] .todo-card-actions .button.is-success.is-light {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .todo-card-actions .button.is-success.is-light:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

[data-theme="dark"] .todo-card-actions .button.is-danger.is-light {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .todo-card-actions .button.is-danger.is-light:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

[data-theme="dark"] .todo-column-header {
    background: var(--background);
    border-color: var(--border);
}

[data-theme="dark"] .todo-column-count {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .todo-card-drag-handle {
    color: var(--text-light);
}

[data-theme="dark"] .todo-card-drag-handle:hover {
    color: var(--primary-light);
}

/* ========== Dark mode: Reports view ========== */
[data-theme="dark"] .reports-header .title {
    color: var(--text);
}

[data-theme="dark"] .reports-table {
    color: var(--text);
}

[data-theme="dark"] .reports-table thead th {
    color: var(--text);
    background: var(--background);
}

[data-theme="dark"] .chart-container {
    background: var(--surface);
    color: var(--text);
}

[data-theme="dark"] .reports-filters .select select,
[data-theme="dark"] .reports-filters .input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

/* ========== Dark mode: Team management view ========== */
[data-theme="dark"] .team-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .team-card .member-info h3,
[data-theme="dark"] .team-card-body p {
    color: var(--text);
}

[data-theme="dark"] .team-card-body p .material-icons {
    color: var(--text-light);
}

[data-theme="dark"] .btn-icon {
    color: var(--text-light);
}

[data-theme="dark"] .btn-icon:hover {
    color: var(--primary-light);
    background: var(--surface-hover);
}

/* ========== Dark mode: User access view ========== */
[data-theme="dark"] .panel {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .panel-block {
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .panel-block:hover {
    background: var(--surface-hover);
}

[data-theme="dark"] .content p,
[data-theme="dark"] .content li {
    color: var(--text);
}

[data-theme="dark"] .content strong {
    color: var(--text);
}

[data-theme="dark"] .field-label {
    color: var(--text);
}

[data-theme="dark"] .help {
    color: var(--text-light);
}

/* Bulma overrides for dark mode */
[data-theme="dark"] .notification.is-primary {
    background-color: rgba(99, 102, 241, 0.25);
    color: var(--text);
}

[data-theme="dark"] .notification.is-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--text);
}

[data-theme="dark"] .has-text-primary { color: var(--primary-light) !important; }
[data-theme="dark"] .has-text-danger { color: #FCA5A5 !important; }
[data-theme="dark"] .has-text-success { color: #6EE7B7 !important; }
[data-theme="dark"] .has-text-warning { color: #FCD34D !important; }
[data-theme="dark"] .has-text-grey { color: var(--text-light) !important; }
[data-theme="dark"] .has-text-grey-light { color: var(--text-light) !important; }

[data-theme="dark"] .card-content {
    color: var(--text);
}

[data-theme="dark"] .table.is-striped tbody tr:nth-child(even) {
    background-color: var(--background);
}

[data-theme="dark"] .table.is-striped tbody tr:nth-child(odd) {
    background-color: var(--surface);
}

[data-theme="dark"] .tag.is-light {
    background-color: var(--surface-hover);
    color: var(--text);
}

[data-theme="dark"] .button.is-danger.is-light {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .button.is-danger.is-light:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

[data-theme="dark"] .button.is-primary.is-light {
    background: rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .button.is-primary.is-light:hover {
    background: rgba(99, 102, 241, 0.35);
    color: var(--primary-light);
}

[data-theme="dark"] .button.is-success.is-light {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .button.is-success.is-light:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

[data-theme="dark"] .button:not(.is-primary):not(.is-success):not(.is-danger):not(.is-warning) {
    background-color: var(--surface-hover);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .button:not(.is-primary):not(.is-success):not(.is-danger):not(.is-warning):hover {
    background-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .icon .material-icons,
[data-theme="dark"] .icon span {
    color: inherit;
}

[data-theme="dark"] .select:not(.is-multiple):not(.is-loading)::after {
    border-color: var(--text-light);
}

[data-theme="dark"] .todo-ai-empty-text,
[data-theme="dark"] .todo-ai-empty-hint {
    color: var(--text-light);
}

[data-theme="dark"] .todo-ai-card .card-header-title {
    color: var(--text);
}

[data-theme="dark"] .whos-online-card-name,
[data-theme="dark"] .whos-online-card-email {
    color: var(--text);
}

[data-theme="dark"] .whos-online-card-status {
    color: var(--text-light);
}

[data-theme="dark"] .whos-online-count {
    background: var(--surface);
    color: var(--text-light);
}

[data-theme="dark"] .task-form-section-title {
    color: var(--primary-light);
}

[data-theme="dark"] .p-4,
[data-theme="dark"] .p-6 {
    color: var(--text);
}

[data-theme="dark"] .loading-content {
    color: var(--primary-light);
}

[data-theme="dark"] .skeleton-title,
[data-theme="dark"] .skeleton-event {
    background: linear-gradient(90deg, var(--border) 0%, var(--surface-hover) 50%, var(--border) 100%);
}

[data-theme="dark"] .task-card-title,
[data-theme="dark"] .task-card-member-name,
[data-theme="dark"] .task-title {
    color: var(--text);
}

[data-theme="dark"] .tasks-summary-stat-value {
    color: var(--text);
}

[data-theme="dark"] .tasks-summary-stat-label {
    color: var(--text-light);
}

/* Dark mode: Bulk actions bar */
[data-theme="dark"] .tasks-bulk-bar {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .tasks-bulk-count {
    color: var(--text);
}
[data-theme="dark"] .tasks-bulk-actions .button {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border);
}
[data-theme="dark"] .tasks-bulk-actions .button:hover {
    background: var(--border);
    color: var(--text);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-danger.is-light {
    color: #fca5a5;
    background: rgba(185, 28, 28, 0.25);
    border-color: rgba(185, 28, 28, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-danger.is-light:hover {
    background: rgba(185, 28, 28, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-warning.is-light {
    color: #fcd34d;
    background: rgba(180, 83, 9, 0.25);
    border-color: rgba(180, 83, 9, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-warning.is-light:hover {
    background: rgba(180, 83, 9, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-info.is-light {
    color: #93c5fd;
    background: rgba(29, 78, 216, 0.25);
    border-color: rgba(29, 78, 216, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-info.is-light:hover {
    background: rgba(29, 78, 216, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-success.is-light {
    color: #6ee7b7;
    background: rgba(4, 120, 87, 0.25);
    border-color: rgba(4, 120, 87, 0.4);
}
[data-theme="dark"] .tasks-bulk-actions .button.is-success.is-light:hover {
    background: rgba(4, 120, 87, 0.4);
}

[data-theme="dark"] .tasks-day-group-header {
    background: var(--background);
    color: var(--text);
}

[data-theme="dark"] .tasks-day-group-header .material-icons {
    color: var(--primary-light);
}

[data-theme="dark"] .timeline-task {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .timeline-task .task-title {
    color: var(--text);
}

[data-theme="dark"] .timeline-task .task-project {
    color: var(--text-light);
}

[data-theme="dark"] .timeline-container {
    background: var(--surface);
}

[data-theme="dark"] .label {
    color: var(--text);
}

[data-theme="dark"] .delete:hover {
    background-color: var(--error);
}

[data-theme="dark"] .modal-card-foot .button:not(.is-primary) {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .modal-card-foot .button:not(.is-primary):hover {
    background: var(--border);
    color: var(--text);
}

[data-theme="dark"] .sidebar-logout-btn {
    background: var(--surface-hover) !important;
    color: var(--text) !important;
    border-color: var(--border);
}

[data-theme="dark"] .sidebar-logout-btn:hover {
    background: var(--border) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .game-hero-icon {
    color: var(--primary-light);
}

[data-theme="dark"] .game-hero-subtitle {
    color: var(--text-light);
}

[data-theme="dark"] .game-podium-1 {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.2) 0%, var(--surface) 40%);
    border-color: rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .reports-header .title,
[data-theme="dark"] .level .title {
    color: var(--text);
}

[data-theme="dark"] .stats-card .card-header-title,
[data-theme="dark"] .stats-card .card-content {
    color: var(--text);
}

[data-theme="dark"] .stats-card .title.is-1,
[data-theme="dark"] .stats-card .title.is-2,
[data-theme="dark"] .stats-card .title.is-3 {
    color: var(--text);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-nav {
    background-color: var(--surface);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.5rem;
    color: var(--secondary);
}

.nav-item:hover {
    background-color: var(--surface-hover);
}

.nav-item.active {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.15);
}

#mainContent {
    flex: 1;
    padding: 2rem;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
}

/* Desktop: main content width follows sidebar (expanded 260px / collapsed 72px) */
@media screen and (min-width: 1024px) {
    #mainContent {
        max-width: calc(100vw - 260px);
    }
    body.sidebar-collapsed #mainContent {
        max-width: calc(100vw - 72px);
    }
}

/* Responsive Design – mobile: less margins/padding for better space use */
@media (max-width: 768px) {
    :root {
        --mobile-gutter: 0.75rem;
        --mobile-section: 1rem;
        --mobile-card: 0.875rem;
        --mobile-modal: 1rem;
    }
    .app-header {
        padding: 0.75rem 0.75rem;
    }
    .header-content {
        padding: 0 0.25rem;
    }
    .app-nav {
        overflow-x: auto;
        padding: 0.5rem 0.75rem;
        -webkit-overflow-scrolling: touch;
    }
    #mainContent {
        padding: 0.75rem;
    }
    .section {
        padding: 1rem;
    }
    .card,
    .box {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    .card .card-content,
    .box {
        padding: 1rem;
    }
    .card-header-title,
    .card-header-icon {
        padding: 0.75rem 1rem;
    }
    .table-container {
        padding: 1rem;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        border-radius: 0.5rem;
    }
    .navbar .navbar-brand .navbar-item,
    .navbar .navbar-menu .navbar-item {
        padding: 0.5rem 0.75rem;
    }
    .modal-card {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: 0.75rem;
    }
    .modal-card-head,
    .modal-card-foot {
        padding: 0.75rem 1rem;
    }
    .modal-card-body {
        padding: 1rem;
    }
    /* Tasks view */
    .tasks-view-header {
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }
    .tasks-filters-bar {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    .tasks-filter-row {
        gap: 0.75rem 1rem;
    }
    .tasks-filter-panel-drawer,
    .tasks-filter-panel-header {
        padding: 0.75rem 1rem;
    }
    .tasks-filter-panel-body {
        padding: 0.75rem 1rem;
    }
    .tasks-summary-inner {
        padding: 0.75rem 1rem;
    }
    .tasks-summary-stat {
        padding: 0 0.5rem;
    }
    .tasks-day-group-header {
        padding: 0.6rem 1rem;
        margin-bottom: 0.5rem;
    }
    .task-card-body,
    .task-card-enhanced .card-content {
        padding: 1rem;
        padding-right: 5rem;
    }
    .task-card-header {
        margin-bottom: 0.75rem;
        gap: 0.75rem;
    }
    .pwa-update-banner-inner {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    /* Calendar */
    .calendar-header {
        margin-bottom: 1rem;
    }
    .fc-toolbar {
        padding: 0.5rem 0;
    }
    .fc-multimonth {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .fc-multimonth-title {
        padding: 0.75rem 1rem !important;
    }
    /* Who's online / reports / todo */
    .whos-online-section-title {
        padding: 0.75rem 1rem;
    }
    .whos-online-cards {
        padding: 0.25rem;
    }
    .whos-online-card {
        padding: 0.75rem 1rem;
        margin: 0.2rem;
    }
    .todo-card .card-header-title {
        padding: 1rem;
    }
    .task-item {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --mobile-gutter: 0.5rem;
        --mobile-section: 0.75rem;
        --mobile-card: 0.75rem;
        --mobile-modal: 0.75rem;
    }
    .app-header {
        padding: 0.5rem 0.5rem;
    }
    .app-nav {
        padding: 0.4rem 0.5rem;
    }
    #mainContent {
        padding: 0.5rem;
    }
    .section {
        padding: 0.75rem;
    }
    .card .card-content,
    .box {
        padding: 0.75rem;
    }
    .card-header-title,
    .card-header-icon {
        padding: 0.6rem 0.75rem;
    }
    .table-container {
        padding: 0.75rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    .modal-card {
        margin: 0.25rem;
        max-height: calc(100vh - 0.5rem);
    }
    .modal-card-head,
    .modal-card-foot {
        padding: 0.6rem 0.75rem;
    }
    .modal-card-body {
        padding: 0.75rem;
    }
    .tasks-filters-bar {
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    .tasks-filter-panel-drawer,
    .tasks-filter-panel-header {
        padding: 0.6rem 0.75rem;
    }
    .tasks-filter-panel-body {
        padding: 0.6rem 0.75rem;
    }
    .tasks-summary-inner {
        padding: 0.6rem 0.75rem;
    }
    .tasks-day-group-header {
        padding: 0.5rem 0.75rem;
    }
    .task-card-body,
    .task-card-enhanced .card-content {
        padding: 0.75rem;
        padding-right: 5rem;
    }
    .pwa-update-banner-inner {
        padding: 0.6rem 0.75rem;
    }
    .fc-multimonth {
        padding: 0.5rem;
    }
    .whos-online-section-title {
        padding: 0.6rem 0.75rem;
    }
    .whos-online-card {
        padding: 0.6rem 0.75rem;
    }
    .task-item {
        padding: 0.6rem 0.75rem;
    }
    .sidebar-menu {
        padding: 0.5rem;
    }
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.modal {
    display: none;
    transition: all 0.3s ease-in-out;
}

.modal.is-active {
    display: flex;
    animation: modalFadeIn 0.3s ease-in-out;
}

.modal-background {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.is-active .modal-background {
    opacity: 1;
}

.modal-card {
    transform: scale(0.9) translateY(-40px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal.is-active .modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modal Close Animation */
.modal.is-closing {
    animation: modalFadeOut 0.3s ease-in-out;
}

.modal.is-closing .modal-card {
    transform: scale(0.9) translateY(40px);
    opacity: 0;
}

.modal.is-closing .modal-background {
    opacity: 0;
}

/* Keyframe Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Modal Content Animations */
.modal-card-head {
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease-out 0.1s;
}

.modal-card-body {
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease-out 0.2s;
}

.modal-card-foot {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease-out 0.3s;
}

.modal.is-active .modal-card-head,
.modal.is-active .modal-card-body,
.modal.is-active .modal-card-foot {
    transform: translateY(0);
    opacity: 1;
}

/* Modal Delete Button Animation */
.modal .delete {
    transition: all 0.2s ease;
}

.modal .delete:hover {
    transform: rotate(90deg);
    background-color: var(--error);
}

/* Team member pick (Add Allocation) – simple in-flow list */
.team-member-pick {
    width: 100%;
}

.team-member-selected {
    min-height: 2.5em;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.team-member-placeholder {
    color: var(--text-light);
}

.team-member-chosen {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.team-member-name {
    font-weight: 500;
}

.team-member-search {
    margin-bottom: 0.5rem;
}

.team-member-list {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    max-height: 107px;
    overflow-y: auto;
    background: var(--surface);
}

.team-member-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
}

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

.team-member-item:hover {
    background-color: var(--idle-bg);
}

.team-member-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.team-member-item-name {
    flex: 1;
}

.team-member-empty {
    cursor: default;
    color: var(--text-light);
    font-size: 0.875rem;
    padding: 0.75rem;
}

.team-member-empty:hover {
    background: transparent;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--input-bg);
    color: var(--text);
}

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

#calendar {
    background-color: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Team Management Styles */
.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.team-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.avatar {
    font-size: 3rem;
    color: var(--primary);
}

.member-info {
    flex: 1;
}

.member-info h3 {
    margin: 0;
    color: var(--text);
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.team-card-body {
    margin-bottom: 1rem;
}

.team-card-body p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
}

.team-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    color: var(--secondary);
}

.btn-icon:hover {
    background-color: var(--surface-hover);
    color: var(--primary);
}

/* Reports Styles */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.reports-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#customDateRange {
    display: flex;
    gap: 1rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card h3 {
    color: var(--secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.allocation-table-container {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.allocation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.allocation-table th,
.allocation-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.allocation-table th {
    background-color: var(--surface-hover);
    font-weight: 500;
}

.allocation-table tr:hover {
    background-color: var(--surface-hover);
}

/* Calendar Styles */
.fc { /* FullCalendar root */
    height: 100%;
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fc-header-toolbar {
    margin-bottom: 1.5em !important;
}

.fc-button-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.fc-button-primary:disabled {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
}

.fc-event {
    cursor: pointer;
    padding: 2px 4px;
}

.fc-event:hover {
    opacity: 0.9;
}

/* Layout */
html, body {
    height: 100%;
    background-color: var(--surface-hover);
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    background-color: var(--surface);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    min-height: calc(100vh - 3.25rem);
    display: flex;
    flex-direction: column;
}
#sidebarMenu {
    position: relative;
}

@media screen and (max-width: 1023px) {
    #sidebarMenu {
        position: absolute;
    }
}
.sidebar-menu {
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.25rem);
    padding: 1rem;
}

.sidebar-menu .menu-list {
    flex: 1 1 auto;
}

.menu-sub-item {
    padding-left: 2.25rem;
}
.menu-sub-item a {
    font-size: 0.9rem;
}

.sidebar-overlay {
    display: none;
}

/* Responsive sidebar drawer (mobile/tablet) */
@media screen and (max-width: 1023px) {
    /* show burger only on small screens */
    #sidebarBurger {
        display: flex;
        margin-left: auto;
    }

    /* off-canvas sidebar */
    .sidebar {
        position: fixed;
        top: 3.25rem; /* navbar height */
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: calc(100vh - 3.25rem);
        z-index: 50;
        transform: translateX(-110%);
        transition: transform 0.2s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-menu {
        padding: 0.75rem;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 40;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    /* main content takes full width */
    .columns.is-gapless > .column.is-2.sidebar {
        width: auto;
    }
}

/* Desktop: hide burger; collapsible sidebar */
@media screen and (min-width: 1024px) {
    #sidebarBurger {
        display: none;
    }

    #sidebarMenu {
        width: 260px;
        min-width: 260px;
        max-width: 260px;
        flex-shrink: 0;
        transition: width 0.2s ease, min-width 0.2s ease;
    }

    /* Collapsed state: narrow strip, icons only */
    body.sidebar-collapsed #sidebarMenu {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }

    body.sidebar-collapsed .sidebar-menu {
        padding: 0.75rem 0.5rem;
        align-items: center;
    }

    body.sidebar-collapsed .menu-group-label {
        display: none;
    }

    body.sidebar-collapsed .menu-list a {
        justify-content: center;
        padding: 0.6rem;
    }

    body.sidebar-collapsed .menu-list a .menu-item-label {
        display: none;
    }

    body.sidebar-collapsed .menu-list a .material-icons {
        margin-right: 0;
    }

    body.sidebar-collapsed .sidebar-collapse-btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem;
    }

    body.sidebar-collapsed .sidebar-collapse-label {
        display: none;
    }

    body.sidebar-collapsed .sidebar-footer {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        align-items: center;
    }

    body.sidebar-collapsed .theme-preference {
        flex-direction: column;
        align-items: center;
    }

    body.sidebar-collapsed .theme-preference-label {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    body.sidebar-collapsed .theme-preference-text {
        display: none;
    }

    body.sidebar-collapsed .theme-preference-btns {
        flex-direction: column;
    }

    body.sidebar-collapsed .sidebar-user-info-inner {
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-user-details {
        display: none;
    }

    body.sidebar-collapsed .sidebar-user-info {
        margin-bottom: 0.5rem;
    }

    body.sidebar-collapsed .sidebar-logout-btn .menu-item-label,
    body.sidebar-collapsed .sidebar-logout-text {
        display: none;
    }

    body.sidebar-collapsed .sidebar-logout-btn {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

.sidebar-collapse-btn {
    display: none;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0 0.5rem 0;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-collapse-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

@media screen and (min-width: 1024px) {
    .sidebar-collapse-btn {
        display: flex;
    }
}

.menu-list a {
    display: flex;
    align-items: center;
    padding: 0.5em 0.75em;
    margin: 0.1em 0;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.menu-list a:hover {
    background-color: var(--surface-hover);
}

.menu-list a.is-active {
    background-color: var(--primary);
    color: white;
}

.menu-list a .material-icons {
    margin-right: 0.5em;
}

.menu-group-label {
    padding: 0.6rem 0.75rem 0.2rem;
    margin-top: 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}
.menu-group-label:first-child {
    margin-top: 0;
}

/* Content Area */
.section {
    padding: 1.5rem;
}

/* Cards and Tables */
.card {
    background: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.table-container {
    background: var(--surface);
    border-radius: 6px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

/* Forms */
.modal-card {
    max-width: 500px;
    border-radius: 1rem;
    overflow: hidden;
    /* Keep header/footer visible; body scrolls */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-card-head {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.modal-card-body {
    /* Default: allow body to scroll when constrained */
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0; /* required for flex overflow scrolling */
}

.modal-card-foot {
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex: 0 0 auto;
}

/* Tasks modal: constrain height and scroll body on small screens */
#taskModal .modal-card {
    max-width: 720px;
    width: 95%;
    max-height: 90vh;
}

#taskModal #taskForm {
    /* Header is a sibling of the form; the form must fill remaining space */
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* allow inner scrolling */
}

#taskModal .modal-card-body {
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#taskModal .modal-card-foot {
    flex: 0 0 auto;
}

/* Task form: sections and layout */
.task-form-body {
    padding: 1.25rem 1.5rem;
}

.task-form-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .task-form-details-grid {
        grid-template-columns: 1fr;
    }
}

.task-form-section-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    padding-bottom: 1.25rem;
}

.task-form-section-card .task-form-section-title {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.task-form-section-card .task-form-section-body .field {
    margin-bottom: 0.85rem;
}

.task-form-section-card .task-form-section-body .field:last-child,
.task-form-section-card .task-form-section-body .fields-row .field .help:last-child {
    margin-bottom: 0;
}

.task-form-section-collapsible {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.task-form-section-collapsible:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.task-form-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0;
    padding: 0.6rem 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
    border-radius: 8px;
}

.task-form-section-toggle:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.task-form-section-chevron {
    margin-left: auto;
    font-size: 1.25rem !important;
    color: var(--text-light);
}

.task-form-section-collapsible .task-form-section-body {
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
}

.task-form-section-collapsible.is-collapsed .task-form-section-body,
.task-form-section-collapsible .task-form-section-body[hidden] {
    display: none !important;
}

/* Task details collapsible: show summary when collapsed, title when expanded */
.task-form-section-task-details .task-form-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.task-form-section-task-details .task-form-section-toggle-label-summary {
    display: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-light);
    font-size: 0.9rem;
}
.task-form-section-task-details.is-collapsed .task-form-section-toggle-label-expanded {
    display: none;
}
.task-form-section-task-details.is-collapsed .task-form-section-toggle-label-summary {
    display: block;
}

/* Progress hours first section: main focus when editing */
.task-form-section-progress-first {
    margin-bottom: 1rem;
    flex: 0 0 auto;
    visibility: visible;
    display: block;
}
#taskModal .task-form-section-progress-first {
    visibility: visible !important;
    display: block !important;
}

/* Task modal tabs */
.task-modal-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.task-modal-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.task-modal-tab:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.task-modal-tab.is-active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 500;
}

.task-modal-tab .material-icons {
    font-size: 1.1rem;
}

.task-modal-tab-badge {
    display: none;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    color: white;
    background: var(--error);
    border-radius: 10px;
    align-items: center;
    justify-content: center;
}

.task-modal-tab-badge:not([aria-hidden="true"]) {
    display: inline-flex;
}

.task-modal-tab-panel {
    padding-top: 0.25rem;
}

/* Hide inactive tab panels — ensure only active panel content is shown */
.task-modal-tab-panel[hidden] {
    display: none !important;
}

/* Chat tab: only chat content, no form-section styling */
.task-modal-tab-panel-chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.task-modal-tab-panel-chat .task-chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Reorder sections: Edit = Progress first, Task details below. Add = Task details first, Progress below */
#taskTabPanelDetails {
    display: flex;
    flex-direction: column;
}
#taskTabPanelDetails.task-modal-edit-mode .task-form-section-progress-first { order: 1; }
#taskTabPanelDetails.task-modal-edit-mode .task-form-section-task-details { order: 2; }
#taskTabPanelDetails.task-modal-edit-mode .task-form-section-note { order: 3; }
#taskTabPanelDetails.task-modal-add-mode .task-form-section-progress-first { order: 2; }
#taskTabPanelDetails.task-modal-add-mode .task-form-section-task-details { order: 1; }
#taskTabPanelDetails.task-modal-add-mode .task-form-section-note { order: 3; }

.task-form-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.task-form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.task-form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.task-form-section-title .material-icons {
    font-size: 1.1rem;
    opacity: 0.9;
}

.task-form-body .field {
    margin-bottom: 0.75rem;
}

.task-form-body .field:last-child {
    margin-bottom: 0;
}

.task-form-body .field .help {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

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

.task-form-body .fields-row.three-cols {
    grid-template-columns: 1fr 1fr;
}

/* Task chat (conversation) — Chat tab only, no form styling */
.task-chat-section {
    background: var(--background);
    border-radius: 12px;
    padding: 1rem;
}

.task-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.task-chat-header .task-form-section-title {
    margin-bottom: 0;
}

.task-chat-badge {
    display: none;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    color: white;
    background: var(--primary);
    border-radius: 9999px;
}

.task-chat-badge:not([aria-hidden="true"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-chat-messages {
    flex: 1;
    min-height: 160px;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    -webkit-overflow-scrolling: touch;
}

.task-chat-empty {
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 1rem;
}

.task-chat-msg {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 90%;
    animation: task-chat-msg-in 0.25s ease;
}

.task-chat-msg.is-admin {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.task-chat-msg.is-member {
    align-self: flex-start;
}

.task-chat-msg-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #0c00ff;
    border: 2px solid var(--border);
}

.task-chat-msg-content {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

@keyframes task-chat-msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-chat-msg-bubble {
    padding: 0.5rem 0.85rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
}

.task-chat-msg.is-admin .task-chat-msg-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.task-chat-msg.is-member .task-chat-msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.task-chat-msg-meta {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.2rem;
    padding: 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.task-chat-msg.is-admin .task-chat-msg-meta {
    text-align: right;
}

.task-chat-msg.is-member .task-chat-msg-meta {
    text-align: left;
}

.task-chat-msg-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    margin: -0.2rem 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.task-chat-msg-delete:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.task-chat-msg-delete .material-icons {
    font-size: 1rem;
}

.task-chat-msg-actions {
    margin-top: 0.5rem;
}

.task-chat-msg-completed .task-chat-msg-bubble {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.task-chat-msg-adhoc-created .task-chat-msg-bubble {
    border-left-width: 3px;
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(245, 158, 11, 0.02) 100%);
    padding: 0.65rem 0.85rem;
}

.task-chat-msg-adhoc-created .task-chat-msg-adhoc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
    vertical-align: middle;
}

.task-chat-msg-adhoc-created .task-chat-msg-adhoc-icon .material-icons {
    font-size: 1rem;
}

.task-chat-msg-adhoc-created .task-chat-msg-adhoc-text {
    vertical-align: middle;
}

/* Ad-hoc email draft modal: HTML email template preview */
.adhoc-email-preview-wrap {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
}

.adhoc-email-template {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.adhoc-email-header {
    text-align: left;
}

.adhoc-email-logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.adhoc-email-header-title {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
}

.adhoc-email-header-sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.adhoc-email-body {
    padding: 1.25rem 1.5rem;
    background: var(--surface);
}

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

.adhoc-email-table .adhoc-email-label,
.adhoc-email-table .adhoc-email-value {
    padding: 0.4rem 0;
    vertical-align: top;
}

.adhoc-email-label {
    width: 38%;
    color: var(--text-light);
    font-weight: 500;
}

.adhoc-email-value {
    color: var(--text);
}

.adhoc-email-section-title {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.adhoc-email-timelog .adhoc-email-th,
.adhoc-email-timelog .adhoc-email-td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.adhoc-email-th {
    color: var(--text-light);
    font-weight: 600;
}

.adhoc-email-td-right,
.adhoc-email-th-right {
    text-align: right;
}

.adhoc-email-footer-text {
    font-weight: 600;
    color: var(--text);
}

.adhoc-email-footer-dot {
    margin: 0 0.25rem;
}

.adhoc-email-footer-sub {
    font-size: 0.8rem;
    color: var(--text-light);
}

[data-theme="dark"] .adhoc-email-body {
    background: var(--surface);
}

[data-theme="dark"] .adhoc-email-preview-wrap {
    background: var(--background);
    border-color: var(--border);
}

.task-chat-unlock-expected-btn {
    font-size: 0.8rem;
}

.task-expected-hours-control.has-icons-right .input {
    padding-right: 2.25rem;
}
.task-expected-hours-lock-wrap {
    pointer-events: none;
}
.task-expected-hours-lock-wrap .task-expected-hours-lock-btn {
    pointer-events: auto;
    padding: 0.15rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.task-expected-hours-lock-btn:hover {
    color: var(--primary);
    background: var(--surface-hover);
}
.task-expected-hours-unlock-admin {
    margin-top: 0.35rem;
}

.task-chat-input-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.task-chat-input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.9rem;
    resize: none;
    min-height: 44px;
    max-height: 100px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s ease;
}

.task-chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.task-chat-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.task-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.task-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.task-chat-send .material-icons {
    font-size: 1.35rem;
}

/* Tasks notifications (bell + dropdown) */
.tasks-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tasks-notifications-wrap {
    position: relative;
}

.tasks-notifications-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tasks-notifications-btn:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--primary-light);
}

.tasks-notifications-btn .material-icons {
    font-size: 1.5rem;
}

.tasks-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    color: white;
    background: var(--error);
    border-radius: 9999px;
    border: 2px solid var(--surface);
}

.tasks-notifications-badge[aria-hidden="true"] {
    display: none !important;
}

.tasks-notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    max-width: 360px;
    max-height: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tasks-notifications-dropdown[aria-hidden="true"] {
    display: none !important;
}

.tasks-notifications-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.tasks-notifications-header .material-icons {
    font-size: 1.25rem;
    color: var(--primary);
}

.tasks-notifications-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.5rem;
}

.tasks-notifications-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tasks-notifications-item-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    display: none;
}

.tasks-notifications-item-dot[aria-hidden="false"] {
    display: block;
}

.tasks-notifications-item.is-unread .tasks-notifications-item-text {
    font-weight: 600;
}

.tasks-notifications-item:hover {
    background: var(--surface-hover);
}

.tasks-notifications-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.tasks-notifications-item-icon .material-icons {
    font-size: 1.2rem;
}

.tasks-notifications-item-completed .tasks-notifications-item-icon {
    color: var(--success);
}

.tasks-notifications-item-adhoc .tasks-notifications-item-icon {
    color: var(--warning, #f59e0b);
}

.tasks-notifications-item-adhoc {
    --adhoc-accent: #f59e0b;
}

.tasks-notifications-item-adhoc.is-unread .tasks-notifications-item-dot {
    background: var(--adhoc-accent);
}

.tasks-notifications-item-adhoc .tasks-notifications-item-text {
    font-weight: 500;
}

.tasks-notifications-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tasks-notifications-item-arrow {
    font-size: 1.1rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.tasks-notifications-empty {
    padding: 1.5rem 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: center;
}

.tasks-notifications-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.tasks-notifications-show-all {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.tasks-notifications-show-all:hover {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.1);
}

/* Notifications dedicated view (full page) */
.notifications-view {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
}

.notifications-view-header {
    margin-bottom: 1.5rem;
}

.notifications-view-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.notifications-mark-all-read {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.notifications-mark-all-read.is-hidden {
    display: none !important;
}

.notifications-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.notifications-back-btn .material-icons {
    font-size: 1.25rem;
}

.notifications-view-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.notifications-view-title .material-icons {
    font-size: 1.75rem;
    color: var(--primary);
}

.notifications-view-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.notifications-view-list-wrap {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.notifications-view-list {
    padding: 0.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.notifications-view-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notifications-view-item:hover {
    background: var(--surface-hover);
}

.notifications-view-item-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    display: none;
}

.notifications-view-item-dot[aria-hidden="false"] {
    display: block;
}

.notifications-view-item.is-unread .notifications-view-item-text {
    font-weight: 600;
}

.notifications-view-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.notifications-view-item-icon .material-icons {
    font-size: 1.25rem;
}

.notifications-view-item-completed .notifications-view-item-icon {
    color: var(--success);
}

.notifications-view-item-adhoc .notifications-view-item-icon {
    color: #f59e0b;
}

.notifications-view-item-adhoc.is-unread .notifications-view-item-dot {
    background: #f59e0b;
}

.notifications-view-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notifications-view-item-arrow {
    font-size: 1.1rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.notifications-view-item-wrap {
    border-bottom: 1px solid var(--border);
}

.notifications-view-item-wrap:last-child {
    border-bottom: none;
}

.notifications-view-item.is-expanded {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.06);
}

.notifications-view-messages-panel {
    padding: 0.75rem 1rem 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    background: var(--background);
    border-top: 1px solid var(--border);
}

.notifications-view-messages-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.notifications-view-messages-actions {
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.notifications-open-task-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.notifications-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.notifications-msg:last-child {
    margin-bottom: 0;
}

.notifications-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.notifications-msg-bubble {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    word-break: break-word;
}

.notifications-msg-admin .notifications-msg-bubble {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.12);
    border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.25);
}

.notifications-msg-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    padding-left: 0.75rem;
}

.notifications-msg-empty,
.notifications-msg-completed .notifications-msg-bubble {
    font-style: italic;
    color: var(--text-light);
}

.notifications-msg-adhoc .notifications-msg-bubble {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.06);
    color: var(--text);
}

.notifications-view-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.notifications-view-empty .material-icons {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.notifications-view-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.notifications-view-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--text-light);
}

.notifications-view-loading.is-hidden {
    display: none !important;
}

.tasks-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 0.35rem;
}

.tasks-notification-item:last-child {
    margin-bottom: 0;
}

.tasks-notification-item:hover {
    background: var(--surface-hover);
}

.tasks-notification-item-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    color: var(--primary);
}

.tasks-notification-item-icon .material-icons {
    font-size: 1.2rem;
}

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

.tasks-notification-item-task {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.tasks-notification-item-preview {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tasks-notification-item-badge {
    flex-shrink: 0;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    color: white;
    background: var(--primary);
    border-radius: 9999px;
}

/* Time log entries: date + progress (h) + add button per row */
.task-time-log-entries {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.task-time-log-row {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(120px, 2fr) auto;
    gap: 0.75rem 1rem;
    align-items: end;
}
.task-time-log-field-date .control,
.task-time-log-field-hours .control,
.task-time-log-field-note .control {
    margin-bottom: 0;
}
.task-time-log-field-hours .input {
    min-width: 5rem;
}
.task-time-log-actions-btns {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.task-time-log-field-actions .button {
    padding: 0.5rem;    margin-bottom: 0.75rem;
    min-width: 2.5rem;
}
.task-time-log-field-actions .button .material-icons {
    font-size: 1.25rem;
}
.task-time-log-remove {
    color: var(--text-light);
}
.task-time-log-remove:hover {
    color: var(--error);
    border-color: var(--error);
}

/* Task timer controls (play/pause, Add to log) in edit modal */
.task-timer-controls {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--idle-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    visibility: visible !important;
    opacity: 1;
    min-height: 3.5rem;
}
#taskModal #taskTimerControls {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.task-timer-btns {
    display: flex;
    gap: 0.35rem;
}
.task-timer-play {
    color: var(--success) !important;
    border-color: var(--success);
}
.task-timer-play:hover {
    background: rgba(16, 185, 129, 0.1) !important;
}
.task-timer-pause {
    color: var(--warning) !important;
    border-color: var(--warning);
}
.task-timer-pause:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}
.task-timer-play:disabled,
.task-timer-pause:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.task-timer-display {
    font-family: 'IBM Plex Mono', 'SF Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    min-width: 6rem;
}
.task-timer-add-log {
    margin-left: auto;
}

/* Floating timer indicator (visible when timer is running) */
.task-timer-floating-indicator {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.task-timer-floating-indicator.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.task-timer-floating-name {
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-timer-floating-time {
    font-family: 'IBM Plex Mono', 'SF Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}
.task-timer-floating-play,
.task-timer-floating-pause {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}
.task-timer-floating-play:hover,
.task-timer-floating-pause:hover {
    background: rgba(255, 255, 255, 0.35);
}
.task-timer-floating-play:disabled,
.task-timer-floating-pause:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.task-timer-floating-play .material-icons,
.task-timer-floating-pause .material-icons {
    font-size: 1.25rem !important;
}

/* Task timer hint toast */
.task-timer-hint-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.25rem;
    background: var(--secondary);
    color: white;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.task-timer-hint-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Timer "other task" and "last paused" messages in modal */
.task-timer-other-msg {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}
.task-timer-last-paused {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--warning);
}
.task-timer-last-paused-text {
    font-size: 0.85rem;
    color: var(--text);
    flex: 1;
}

.label.is-invisible {
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#taskModal .control.has-icons-left .input,
#taskModal .control.has-icons-left .select select {
    padding-left: 2.25rem;
}

#taskModal .control.has-icons-left .icon.is-left {
    pointer-events: none;
    color: var(--text-light);
}

#taskModal .control.has-icons-left .select:not(.is-multiple):not(.is-loading)::after {
    z-index: 1;
}

/* Calendar Customization */
.fc {
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

/* Utility Classes */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.is-loading .material-icons {
    animation: spin 1s infinite linear;
}

/* Animations and Transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

.scale-in {
    transform: scale(0.95);
    opacity: 0;
    animation: scaleIn 0.3s ease-out forwards;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Card Hover Effects */
.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Button Hover Effects */
.button {
    border-radius: 0.5rem;
    transition: var(--transition);
    font-weight: 500;
}

.button.is-primary {
    background: var(--primary);
    border-color: transparent;
}

.button.is-primary:hover {
    background: var(--primary-dark);
}

.button-export-pdf {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(13, 148, 136, 0.3);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.button-export-pdf:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
}

.button-export-pdf:active {
    transform: translateY(1px);
}

.button:active {
    transform: translateY(1px);
}

/* Notification Animation */
.notification {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Table Row Hover */
tr {
    transition: background-color 0.2s ease;
}

/* Form Input Focus Effects */
.input, .select select {
    border-radius: 0.5rem;
    border-color: var(--border);
    transition: var(--transition);
}

.input:focus, .select select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Icon Animations */
.material-icons {
    transition: transform 0.2s ease;
}

.button:hover .material-icons {
    transform: scale(1.1);
}

/* Loading Animation */
.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.is-loading:after {
    animation: spinAround 0.5s infinite linear;
    border: 2px solid #dbdbdb;
    border-radius: 50%;
    border-right-color: transparent;
    border-top-color: transparent;
    content: "";
    height: 1em;
    width: 1em;
    position: absolute;
    right: calc(50% - (1em / 2));
    top: calc(50% - (1em / 2));
}

@keyframes spinAround {
    from { transform: rotate(0deg); }
    to { transform: rotate(359deg); }
}

/* Calendar Skeleton Loading Animation */
.calendar-skeleton {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
}

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

.skeleton-title {
    width: 200px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-nav {
    width: 150px;
    height: 32px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.skeleton-day {
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.skeleton-cell {
    background: var(--surface);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 1;
    padding: 8px;
    border: 1px solid #f0f0f0;
}

.skeleton-date {
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 50%;
    margin-bottom: 8px;
}

.skeleton-event {
    height: 20px;
    background: linear-gradient(90deg, var(--border) 0%, var(--background) 50%, var(--border) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.375rem;
    margin-bottom: 4px;
}

.skeleton-event.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* Calendar View Styles */
.fc-view-harness {
    background: var(--surface);
    border-radius: 8px;
}

/* Day/Week View Styles */
.fc-timegrid-slot {
    height: 3em !important;
}

.fc-timegrid-now-indicator-line {
    border-color: var(--primary);
}

.fc-timegrid-now-indicator-arrow {
    border-color: var(--primary);
    color: var(--primary);
}

/* List View Styles */
.fc-list-day-cushion {
    background-color: var(--surface-hover) !important;
}

.fc-list-event:hover td {
    background-color: var(--surface-hover) !important;
}

.fc-list-event-dot {
    border-width: 6px !important;
}

/* View Toggle Buttons */
.fc-button-group {
    gap: 4px;
}

.fc-button-primary {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    font-weight: normal !important;
    transition: all 0.2s ease;
}

.fc-button-primary:hover {
    background-color: var(--surface-hover) !important;
    border-color: var(--text-light) !important;
}

.fc-button-active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

/* Today Button */
.fc-today-button {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.fc-today-button:disabled {
    opacity: 0.7 !important;
}

/* Event Styles */
.fc-event {
    border-radius: 0.375rem;
    border: none !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    transition: var(--transition);
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Time Slots */
.fc-timegrid-slot-label {
    font-size: 0.85em;
    color: var(--text-light);
}

/* Current Time Indicator */
.fc-timegrid-now-indicator-line {
    border-width: 2px;
}

/* List View Tags */
.fc-list-event .tag {
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.85em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .fc-header-toolbar {
        flex-direction: column;
        gap: 1rem;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .fc-view-harness {
        height: auto !important;
    }
}

/* Reports Table Styles */
.reports-table td {
    vertical-align: middle !important;
}

.reports-table .image {
    overflow: hidden;
}

.reports-table .image img {
    object-fit: cover;
    width: 32px;
    height: 32px;
    background-color: #0c00ff;
}
.image img{
    background-color: #0c00ff;
}
.reports-table .tag {
    font-weight: 500;
}

/* Animation for table rows */
.reports-table tr.fade-in {
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

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

/* Chart Styles */
.card canvas {
    max-height: 300px;
    width: 100% !important;
}

.chart-container {
    position: relative;
    margin: auto;
    height: 300px;
}

/* Chart Card Hover Effect */
.card:hover .card-header {
    background-color: var(--surface-hover);
    transition: background-color 0.3s ease;
}

/* Adjust specific text elements for better typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 600;
}

.title {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.subtitle {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 500;
}

.button {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 500;
}

.tag {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 500;
    border-radius: 9999px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.label {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 500;
}

.input, .select select, .textarea {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.notification {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.card-header-title {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 600;
}

.menu-label {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 600;
}

/* Chart text adjustments */
.chart-container {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Adjust modal text */
.modal-card-title {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-weight: 600;
}

/* Table text */
table {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

th {
    font-weight: 600;
}

/* Navigation text */
.navbar {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}
.navbar.is-primary {
    background-color: var(--primary);
    color: #fff;
}

.navbar-item {
    font-weight: 500;
}

/* Navbar Who's Online (admin only): stacked avatars + popover */
.navbar-whos-online-wrap.is-hidden {
    display: none !important;
}

.navbar-whos-online-wrap .navbar-item {
    padding: 0.5rem 0.75rem;
}

.navbar-whos-online {
    display: flex;
    align-items: center;
}

.navbar-whos-online-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.navbar-whos-online-stack {
    display: flex;
    align-items: center;
}

.navbar-whos-online-avatar {
    width: auto;

    border-radius: 50%;
    margin-left: -10px;
    border: 2px solid var(--primary);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.navbar-whos-online-avatar:first-child {
    margin-left: 0;
}

.navbar-whos-online-avatar:hover {
    transform: scale(1.08);
    z-index: 2;
}

.navbar-whos-online-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar-whos-online-avatar-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--primary);
    pointer-events: none;
}

.navbar-whos-online-more {
    width: 36px;
    height: 36px;
    margin-left: -10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.navbar-whos-online-more:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Popover (positioned fixed, below trigger) */
.navbar-whos-online-popover {
    position: fixed;
    z-index: 10001;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 220px;
    max-width: 320px;
    pointer-events: auto;
    display: none;
}

.navbar-whos-online-popover.is-visible {
    display: block;
}

.navbar-whos-online-popover-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
}

.navbar-whos-online-popover-item:hover {
    background: var(--surface-hover);
}

.navbar-whos-online-popover-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.navbar-whos-online-popover-avatar-wrap img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.navbar-whos-online-popover-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--surface);
}

.navbar-whos-online-popover-body {
    flex: 1;
    min-width: 0;
}

.navbar-whos-online-popover-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.navbar-whos-online-popover-email {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.1rem;
}

.navbar-whos-online-popover-view {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text);
    margin-top: 0.4rem;
}

.navbar-whos-online-popover-view-icon {
    font-size: 1rem;
    color: var(--primary);
}

.navbar-whos-online-popover-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.navbar-whos-online-popover-meta .material-icons {
    font-size: 0.9rem;
    vertical-align: middle;
    margin-right: 0.15rem;
}

.navbar-whos-online-popover-duration {
    display: inline-flex;
    align-items: center;
}

.navbar-whos-online-popover-login {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.navbar-whos-online-popover-login-icon {
    font-size: 0.9rem;
}

/* Status Tags */
.idle-event {
    background-color: var(--idle-bg) !important;
    color: var(--idle-text) !important;
    border-left: 3px solid var(--idle-text) !important;
}

.vacation-event {
    background-color: var(--vacation-bg) !important;
    color: var(--vacation-text) !important;
    border-left: 3px solid var(--vacation-text) !important;
}

/* Checkbox Styling */
.checkbox input[type="checkbox"] {
    border-radius: 0.25rem;
    border-color: var(--border);
}

.checkbox input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Update Team Grid Skeleton Styles */
.team-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.member-card-skeleton {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: 280px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Add top border animation */
.member-card-skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--primary-light) 0%,
        var(--info) 50%,
        var(--primary-light) 100%
    );
    background-size: 200% 100%;
    animation: shimmerBorder 2s infinite;
}

.member-header-skeleton {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.avatar-skeleton {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(90deg, 
        var(--border) 0%,
        var(--background) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    flex-shrink: 0;
}

.member-info-skeleton {
    flex: 1;
}

.name-skeleton {
    height: 24px;
    width: 70%;
    background: linear-gradient(90deg, 
        var(--border) 0%,
        var(--background) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.role-skeleton {
    height: 24px;
    width: 40%;
    background: linear-gradient(90deg, 
        var(--border) 0%,
        var(--background) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 999px;
}

.member-content-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email-skeleton {
    height: 20px;
    width: 80%;
    background: linear-gradient(90deg, 
        var(--border) 0%,
        var(--background) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
}

.projects-skeleton {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.project-tag-skeleton {
    height: 24px;
    width: 80px;
    background: linear-gradient(90deg, 
        var(--border) 0%,
        var(--background) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 999px;
}

.card-footer-skeleton {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    border-top: 1px solid var(--border);
    display: flex;
    padding: 0.5rem;
    gap: 0.5rem;
}

.action-button-skeleton {
    flex: 1;
    height: 100%;
    background: linear-gradient(90deg, 
        var(--border) 0%,
        var(--background) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes shimmerBorder {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

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

/* Sidebar footer: user info + logout at bottom */
.theme-preference {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.theme-preference-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.theme-preference-icon {
    font-size: 1rem !important;
    opacity: 0.9;
}

.theme-preference-btns {
    display: flex;
    gap: 0.35rem;
}

.theme-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-btn:hover {
    background: var(--border);
    color: var(--text);
}

.theme-btn.is-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 1023px) {
    .theme-preference {
        padding: 0.75rem 0;
        margin-bottom: 0.75rem;
    }
    .theme-btn {
        min-height: 40px;
        padding: 0.5rem;
    }
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-user-info {
    margin-bottom: 0.75rem;
    padding: 0;
}

.sidebar-user-info-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #0c00ff;
}

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

.sidebar-user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-email {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.sidebar-occasion-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
    animation: occasion-pulse 2s ease-in-out infinite;
}

.sidebar-occasion-badge .material-icons {
    font-size: 14px !important;
    color: white;
}

.sidebar-occasion-badge:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.sidebar-occasion-birthday {
    background: linear-gradient(135deg, #EC4899 0%, #F43F5E 100%);
    color: white;
}

.sidebar-occasion-anniversary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

@keyframes occasion-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

.sidebar-occasion-birthday { animation-name: occasion-pulse-birthday; }
@keyframes occasion-pulse-birthday {
    0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(236, 72, 153, 0); }
}

/* Occasion modal (birthday / work anniversary) */
.occasion-modal .modal-card {
    max-width: 380px;
    border-radius: 20px;
    overflow: visible;
    border: none;
    box-shadow: var(--shadow-lg);
}

.occasion-modal.is-active .occasion-modal-card {
    animation: occasion-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.occasion-modal-inner {
    position: relative;
    padding: 2rem 1.75rem;
    text-align: center;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.occasion-modal-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.occasion-modal-icon-wrap {
    margin-bottom: 1rem;
}

.occasion-modal-icon {
    font-size: 3rem !important;
    color: var(--primary);
    display: inline-flex;
    animation: occasion-icon-bounce 0.6s ease-out;
}

.occasion-modal-photo-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
}

.occasion-modal-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.occasion-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.occasion-modal-message {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.occasion-modal-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.occasion-modal-close {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
}

body.occasion-modal-open .occasion-modal-background {
    background: rgba(0, 0, 0, 0.5);
}

@keyframes occasion-modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes occasion-icon-bounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

[data-theme="dark"] .occasion-modal-inner {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .occasion-modal-glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
}


.sidebar-logout-btn,
#logoutButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

#logoutButton:hover {
    background: var(--error);
    color: white;
}

#logoutButton .material-icons {
    font-size: 1.25rem;
    flex-shrink: 0;
}

#logoutButton span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Adjust main content padding to account for fixed logout button */
.main-content {
    padding-bottom: 4rem;
}

/* To-Do AI recommendations */
.todo-ai-card .card-header-title {
    display: flex;
    align-items: center;
}
.todo-ai-card .card-header-title .material-icons.mr-2 { margin-right: 0.5rem; }
.todo-ai-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}
.todo-ai-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}
.todo-ai-empty-icon {
    font-size: 2.5rem !important;
    opacity: 0.5;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.todo-ai-empty-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 0.25rem 0;
}
.todo-ai-empty-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
    max-width: 280px;
}
.todo-ai-list ul.todo-ai-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.todo-ai-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.todo-ai-item:last-child { border-bottom: none; }
.todo-ai-bullet { color: var(--primary); font-size: 1.2rem !important; flex-shrink: 0; }
.is-hidden { display: none !important; }

/* AI Recommendations — timeline-style container (matches .timeline-container) */
.recommendations-timeline-wrapper {
    margin-top: 0.5rem;
}
.recommendations-timeline-container {
    padding: 1.25rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.recommendations-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--background);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: recommendationSlideIn 0.35s ease-out forwards;
    opacity: 0;
}
.recommendation-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}
.recommendation-step {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50%;
}
.recommendation-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.recommendation-icon {
    color: var(--primary);
    font-size: 1.25rem !important;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.recommendation-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
}
@keyframes recommendationSlideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.recommendations-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}
.recommendations-empty-icon {
    font-size: 3rem !important;
    opacity: 0.5;
    display: block;
    margin-bottom: 1rem;
}
.recommendations-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Leaderboard view — Monthly Heroes */
.game-view { max-width: 1000px; margin: 0 auto; padding: 0 1rem; }

.game-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 1rem;
}

.game-hero-monthly .game-hero-subtitle {
    max-width: 480px;
}

.game-year-select {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.35rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.game-year-select .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-year-label {
    font-weight: 600;
    color: var(--text);
    min-width: 2.5rem;
    text-align: center;
}

/* Monthly Hero featured card */
.game-monthly-hero-card {
    margin-bottom: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, var(--surface) 50%);
}

.game-monthly-hero-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 0 0 0 12px;
}

.game-monthly-hero-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.5rem 1rem;
}

.game-monthly-hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(251, 191, 36, 0.5);
    box-shadow: var(--shadow);
}

.game-monthly-hero-info {
    flex: 1;
    min-width: 0;
}

.game-monthly-hero-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.35rem 0;
}

.game-monthly-hero-tagline {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.game-monthly-hero-pts {
    display: inline-block;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.game-monthly-top3-rest {
    padding: 0.75rem 1.5rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

.game-monthly-top3-item {
    white-space: nowrap;
}

.game-monthly-medal {
    margin-right: 0.25rem;
}

.game-monthly-sep {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.game-monthly-empty .card-content {
    padding: 2rem !important;
}

/* Chart card */
.game-chart-card {
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.game-chart-header {
    background: var(--idle-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.game-chart-header .card-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.game-chart-header .card-header-title .material-icons {
    color: var(--primary);
}

.game-chart-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.game-chart-wrap {
    position: relative;
    height: 280px;
    padding: 1rem;
}

@media (max-width: 768px) {
    .game-chart-wrap {
        height: 240px;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .game-chart-wrap {
        height: 220px;
        padding: 0.5rem;
    }
}

/* Top 3 podium card (this month's winners) */
.game-top3-podium-card {
    margin-bottom: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.game-podium-header {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, var(--idle-bg) 100%);
    border-bottom: 1px solid var(--border);
}

.game-podium-header .card-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.game-podium-header .card-header-title .material-icons {
    color: #f59e0b;
}

.game-podium-top3 {
    margin-bottom: 0;
}

.game-podium-hero-label {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 999px;
}

.game-podium-pts-1 {
    color: var(--primary);
    font-size: 1.05rem;
}

.game-podium-empty {
    margin: 0;
}

.game-hero-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.game-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}
.game-hero-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0 0 1rem 0;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
.game-rules-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--idle-bg);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
}
.game-rules-pill .material-icons { font-size: 1rem !important; color: var(--primary); }
.game-rules-dot { opacity: 0.5; margin: 0 0.1rem; }

.game-empty { border-radius: 16px; }

/* Podium: 2nd — 1st — 3rd */
.game-podium-wrap {
    margin-bottom: 2rem;
}
.game-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
    min-height: 220px;
    padding: 0 0.5rem;
}
.game-podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 180px;
    padding: 1rem 0.5rem;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.game-podium-slot:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.game-podium-1 {
    order: 2;
    padding-bottom: 1.25rem;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--surface) 40%);
    border-color: rgba(99, 102, 241, 0.3);
    z-index: 2;
}
.game-podium-2 { order: 1; }
.game-podium-3 { order: 3; }
.game-podium-avatar-wrap {
    position: relative;
    margin-bottom: 0.75rem;
}
.game-podium-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.game-podium-1 .game-podium-avatar-wrap .game-podium-avatar {
    width: 88px;
    height: 88px;
    border-color: var(--primary-light);
}
.game-podium-medal {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    line-height: 1;
}
.game-podium-1 .game-podium-medal { font-size: 1.75rem; }
.game-podium-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.game-podium-pts {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
}
.game-podium-level {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* Rest of the pack (rank 4+) */
.game-rest-card {
    margin-top: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.game-rest-header {
    background: var(--idle-bg);
    border-bottom: 1px solid var(--border);
}
.game-rest-header .card-header-title { font-weight: 600; }
.game-rest-list { display: flex; flex-direction: column; }
.game-rest-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}
.game-rest-row:last-child { border-bottom: none; }
.game-rest-row:hover { background: var(--idle-bg); }
.game-rest-rank {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-light);
    min-width: 2rem;
}
.game-rest-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background-color: #0c00ff;
}
.game-rest-info { flex: 1; min-width: 0; }
.game-rest-name { display: block; font-weight: 600; color: var(--text); font-size: 0.95rem; }
.game-rest-email { display: block; font-size: 0.8rem; color: var(--text-light); }
.game-rest-recommendation {
    font-size: 0.85rem;
    color: var(--primary);
    margin: 0.35rem 0 0 0;
    font-style: italic;
}
.game-rest-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.game-rest-pts { font-size: 1rem; color: var(--primary); }

@media (max-width: 768px) {
    .game-view {
        padding: 0 0.75rem;
    }
    .game-hero-monthly .game-hero-title {
        font-size: 1.5rem;
    }
    .game-monthly-hero-content {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
    }
    .game-monthly-hero-name {
        font-size: 1.25rem;
    }
    .game-monthly-top3-rest {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        text-align: center;
    }
    .game-monthly-top3-rest .game-monthly-sep {
        display: block;
        margin: 0.25rem 0;
    }
    .game-chart-header {
        padding: 0.75rem 1rem;
    }
    .game-chart-header .card-header-title {
        font-size: 0.95rem;
    }
    .game-podium { flex-wrap: wrap; justify-content: center; gap: 1rem; min-height: 0; }
    .game-podium-slot { max-width: 140px; }
    .game-podium-avatar { width: 56px; height: 56px; }
    .game-podium-1 .game-podium-avatar-wrap .game-podium-avatar { width: 64px; height: 64px; }
    .game-rest-row { flex-wrap: wrap; }
    .game-rest-recommendation { width: 100%; }
}

@media (max-width: 480px) {
    .game-view {
        padding: 0 0.5rem;
    }
    .game-hero-monthly .game-hero-title {
        font-size: 1.35rem;
    }
    .game-monthly-hero-avatar {
        width: 64px;
        height: 64px;
    }
    .game-year-select {
        padding: 0.3rem 0.5rem;
    }
}

/* Add these styles for the loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: var(--primary);
}

.loading-icon {
    font-size: 48px;
    animation: rotate 1.5s infinite linear;
}

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

.loading-content p {
    margin-top: 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

/* Hide overlay when app is ready */
.app-loaded .loading-overlay {
    display: none;
}

/* PWA update banner */
.pwa-update-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}
.pwa-update-banner.is-visible {
    transform: translateY(0);
}
.pwa-update-banner-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}
.pwa-update-banner-icon {
    font-size: 2rem !important;
    opacity: 0.95;
}
.pwa-update-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.pwa-update-banner-text strong {
    font-size: 1rem;
}
.pwa-update-banner-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}
.pwa-update-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--surface);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pwa-update-banner-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Task modal – discard unsaved changes confirmation */
.task-discard-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.task-discard-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.task-discard-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.task-discard-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 1.75rem;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
    animation: task-discard-in 0.25s ease;
}
@keyframes task-discard-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.task-discard-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}
.task-discard-icon {
    font-size: 2rem !important;
}
.task-discard-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}
.task-discard-message {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-light);
}
.task-discard-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.task-discard-btn-keep {
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.task-discard-btn-keep:hover {
    background: var(--primary-dark);
    color: white;
    transform: scale(1.02);
}
.task-discard-btn-discard {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.task-discard-btn-discard:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.06);
}

/* Add these styles for the loading animation */
.rotating {
    animation: rotate 1s linear infinite;
}

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

/* Chart transition */
canvas {
    transition: opacity 0.3s ease;
}

/* Calendar Event Styles */
.calendar-event {
    position: relative;
    padding-right: 20px; /* Make room for delete icon */
    min-height: 24px;
    display: flex;
    align-items: center;
}

.delete-event-icon {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
    z-index: 5;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    padding: 2px;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

.delete-event-icon:hover {
    color: var(--error);
    background: rgba(255, 255, 255, 0.95) !important;
    transform: translateY(-50%) scale(1.1);
}

.event-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
    cursor: pointer;
}

/* Make sure events have proper z-index */
.fc-event {
    z-index: 1;
}

/* Ensure the delete icon is above other elements */
.fc-event .delete-event-icon {
    z-index: 2;
}

/* Edit Modal Specific Styles */
.modal-card-title.edit-mode {
    color: var(--info);
}

.modal-card-foot.edit-mode {
    background-color: var(--background);
}

/* Search styles */
#calendarSearch {
    min-width: 250px;
    transition: all 0.3s ease;
}

#calendarSearch:focus {
    min-width: 300px;
}

#clearSearch {
    transition: all 0.2s ease;
}

#clearSearch:hover {
    background-color: var(--surface-hover);
}

#clearSearch .material-icons {
    font-size: 18px;
    color: var(--text-light);
}

/* Highlight search matches */
.search-highlight {
    background-color: rgba(255, 255, 0, 0.3);
    border-radius: 2px;
    padding: 0 2px;
}

/* Smooth transitions for events */
.fc-event {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fc-event[style*="display: none"] {
    opacity: 0;
    transform: scale(0.95);
}

/* Member Summary Modal Styles */
.modal-card {
    max-width: 600px;
    width: 95%;
}

.project-card .box {
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary);
}

.project-card .box:hover {
    transform: translateX(5px);
}

.allocation-summary {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.allocation-summary .title {
    color: var(--primary);
}

.allocation-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.allocation-dates .tag {
    font-size: 0.85rem;
}

.progress {
    height: 0.75rem;
    border-radius: 100px;
}

.project-card .box[data-type="idle"] {
    border-left-color: #dbdbdb;
}

.project-card .box[data-type="vacation"] {
    border-left-color: #ffd975;
}

/* Animation for modal */
.modal-card {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.2s ease;
}

.modal.is-active .modal-card {
    transform: scale(1);
    opacity: 1;
}

/* Member card styles */
.member-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

.member-card .buttons {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.member-card:hover .buttons {
    opacity: 1;
}

/* Prevent button clicks from triggering card click */
.member-card .buttons .button {
    position: relative;
    z-index: 2;
}

/* Animation for cards */
.member-card {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton Loading Styles */
.skeleton-card {
    pointer-events: none;
    border: 1px solid var(--border);
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(110deg, var(--border) 8%, var(--surface-hover) 18%, var(--border) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

.skeleton-line {
    background: linear-gradient(110deg, var(--border) 8%, var(--surface-hover) 18%, var(--border) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 4px;
}

.skeleton-button {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: linear-gradient(110deg, var(--border) 8%, var(--surface-hover) 18%, var(--border) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

.skeleton-tags {
    display: flex;
    gap: 0.5rem;
}

.skeleton-tag {
    width: 80px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(110deg, var(--border) 8%, var(--surface-hover) 18%, var(--border) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

/* Add staggered animation delay for skeleton cards */
.team-skeleton .column:nth-child(1) .skeleton-card { animation-delay: 0s; }
.team-skeleton .column:nth-child(2) .skeleton-card { animation-delay: 0.1s; }
.team-skeleton .column:nth-child(3) .skeleton-card { animation-delay: 0.2s; }
.team-skeleton .column:nth-child(4) .skeleton-card { animation-delay: 0.3s; }
.team-skeleton .column:nth-child(5) .skeleton-card { animation-delay: 0.4s; }
.team-skeleton .column:nth-child(6) .skeleton-card { animation-delay: 0.5s; }

/* Role-specific styles */
.ux-card {
    border-left: 4px solid #9C27B0;
}

.ui-card {
    border-left: 4px solid #1976D2;
}

/* Custom purple color for UX Designer */
.tag.is-purple {
    background-color: #f3e5f5;
    color: #9C27B0;
}

.tag.is-purple .icon {
    color: #9C27B0;
}

/* Role tag styles */
.tag .icon {
    margin-right: 4px;
}

.tag .material-icons {
    font-size: 16px;
}

/* Card hover effects */
.ux-card:hover {
    border-color: #9C27B0;
    box-shadow: 0 2px 15px rgba(156, 39, 176, 0.1);
}

.ui-card:hover {
    border-color: #1976D2;
    box-shadow: 0 2px 15px rgba(25, 118, 210, 0.1);
}

/* Update skeleton loading for role differentiation */
.skeleton-card {
    border-left: 4px solid var(--border);
}

/* Enhanced Multi Month View Styles */
.fc-multimonth {
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Year title */
.fc-multimonth-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    padding: 1.25rem !important;
    color: var(--text) !important;
    background: var(--background);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem !important;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 2;
}

/* Month container */
.fc-multimonth-month {
    flex: 1;
    min-width: calc(33.333% - 1rem) !important;
    max-width: calc(33.333% - 1rem) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: 1rem !important;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.fc-multimonth-month:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    z-index: 3;
}

/* Month Headers */
.fc-multimonth-month-title {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    padding: 1rem !important;
    margin: 0 !important;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

/* Day header cells */
.fc-multimonth-header {
    background-color: var(--background) !important;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.fc-multimonth-header th {
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--text-light) !important;
}

/* Day cells */
.fc-multimonth-daygrid-day {
    min-height: 5rem !important;
}

.fc-multimonth-month td {
    padding: 0.25rem !important;
    height: auto !important;
    font-size: 0.9rem !important;
}

/* Today highlight */
.fc-multimonth-month .fc-day-today {
    background-color: var(--primary-light) !important;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Weekend days */
.fc-day-sat, .fc-day-sun {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Events styling */
.fc-multimonth-month .fc-daygrid-event {
    margin: 1px 2px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.2s ease;
    border: none !important;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.fc-multimonth-month .fc-daygrid-event:hover {
    transform: scale(1.02);
    z-index: 4;
    box-shadow: var(--shadow);
}

/* More events link */
.fc-multimonth-month .fc-daygrid-more-link {
    font-size: 0.75rem !important;
    color: var(--primary) !important;
    font-weight: 500 !important;
    padding: 0.25rem 0.5rem !important;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 4px;
    margin-top: 0.25rem;
    display: inline-block;
}

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
    .fc-multimonth-month {
        min-width: calc(50% - 1rem) !important;
        max-width: calc(50% - 1rem) !important;
    }
}

@media screen and (max-width: 768px) {
    .fc-multimonth {
        padding: 1rem;
        gap: 1rem;
    }
    
    .fc-multimonth-month {
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    .fc-multimonth-title {
        font-size: 1.25rem !important;
        padding: 1rem !important;
    }
}

/* Loading state with proper z-index */
.fc-multimonth.is-loading::after {
    z-index: 5;
}

/* Enhanced Todo View Styles */
.todo-container {
    margin-top: 1rem;
}

.todo-card {
    /* height: 100%; */
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}

.todo-card.is-today {
    border-top: 3px solid var(--primary);
}

.todo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.todo-card .card-header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
}

.todo-card .card-header-title {
    padding: 1.25rem;
}

.task-item {
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: var(--background);
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.task-item:hover {
    background-color: var(--surface);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.task-item .icon-text {
    align-items: center;
}

.task-item .material-icons {
    font-size: 1.2rem;
}

.task-content {
    padding-left: 0.5rem;
    border-left: 2px solid var(--border);
}

.task-progress .progress {
    height: 0.5rem;
    border-radius: 999px;
}

.todo-card .card-footer {
    background-color: var(--background);
    border-top: 1px solid var(--border);
    padding: 1rem;
}

.todo-card .card-footer-item {
    color: var(--text-light);
    justify-content: flex-start;
}

/* Task type badges */
.tag.is-medium {
    height: 2em;
    padding: 0 1em;
}

.tag.is-info.is-light {
    background-color: rgba(var(--info-rgb), 0.1);
    color: var(--info);
}

.tag.is-success.is-light {
    background-color: rgba(var(--success-rgb), 0.1);
    color: var(--success);
}

/* Progress bar colors */
.progress.is-success::-webkit-progress-value {
    background-color: var(--success);
}

.progress.is-danger::-webkit-progress-value {
    background-color: var(--error);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-card {
    animation: slideIn 0.3s ease-out forwards;
}

.todo-container .column:nth-child(1) .todo-card { animation-delay: 0s; }
.todo-container .column:nth-child(2) .todo-card { animation-delay: 0.1s; }
.todo-container .column:nth-child(3) .todo-card { animation-delay: 0.2s; }

/* Todo Column View (Kanban-style) */
.todo-columns-container {
    display: flex;
    gap: 1.5rem;
    min-height: 400px;
    padding: 1rem 0;
}

.todo-column {
    flex: 1;
    min-width: 280px;
    max-width: 360px;
    background: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.todo-column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    border-radius: 1rem 1rem 0 0;
}

.todo-column-header .material-icons {
    font-size: 1.25rem;
    color: var(--primary);
}

.todo-column-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.todo-column-count {
    background: var(--primary-light);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.todo-column-body {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    min-height: 200px;
}

.todo-column-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.todo-column-empty-icon {
    font-size: 2.5rem !important;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.todo-column-empty-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 0.25rem 0;
}

.todo-column-empty-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
    max-width: 200px;
}

.todo-column-body .todo-card {
    cursor: grab;
    user-select: none;
}

.todo-column-body .todo-card:active {
    cursor: grabbing;
}

.todo-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s, opacity 0.2s;
}

.todo-card:last-child {
    margin-bottom: 0;
}

.todo-card.is-dragging {
    opacity: 0.7;
    box-shadow: var(--shadow-lg);
}

.todo-card-drag-handle {
    color: var(--text-light);
    cursor: grab;
    flex-shrink: 0;
}

.todo-card-drag-handle .material-icons {
    font-size: 1.25rem;
}

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

.todo-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.todo-card-title.is-done {
    text-decoration: line-through;
    color: var(--text-light);
}

.todo-card-deadline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.todo-card-deadline .material-icons {
    font-size: 1rem;
}

.todo-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.todo-card-actions .button {
    padding: 0.35rem;
}

.todo-card-actions .material-icons {
    font-size: 1.1rem;
}

.todo-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.todo-view-header .title {
    color: var(--text);
}

.todo-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--surface);
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.todo-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.todo-tab:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.todo-tab.is-active {
    color: var(--primary);
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.12);
    font-weight: 500;
}

.todo-tab .material-icons {
    font-size: 1.1rem;
}

.todo-panel-header {
    margin-bottom: 1rem;
}

.todo-panel-followup {
    padding-top: 0.5rem;
}

.todo-followup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.todo-followup-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.todo-followup-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.todo-followup-empty-icon {
    font-size: 3rem !important;
    color: var(--text-light);
    opacity: 0.6;
    margin-bottom: 1rem;
}

.todo-followup-empty-text {
    font-size: 1rem;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.todo-followup-empty-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

.todo-followup-picker {
    margin-top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.todo-followup-pickerwrap {
    margin-bottom: 1rem;
}

.todo-followup-selectionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.todo-followup-selectionbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.todo-followup-selection-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.todo-followup-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.82rem;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.todo-followup-chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    object-fit: cover;
    flex-shrink: 0;
}

.todo-followup-chip-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-followup-chip-more {
    color: var(--text-light);
}

.todo-followup-picker-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.todo-followup-picker-title {
    font-weight: 700;
    color: var(--text);
}

.todo-followup-picker-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

.todo-followup-picker-search {
    margin-bottom: 0.75rem;
}

.todo-followup-picker-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.todo-followup-picker-list {
    max-height: 340px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface);
}

.todo-followup-pick-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.todo-followup-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.todo-followup-pick-row:last-child {
    border-bottom: none;
}

.todo-followup-pick-row:hover {
    background: var(--surface-hover);
}

.todo-followup-pick-row-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.todo-followup-pick-avatar {
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    object-fit: cover;
    flex-shrink: 0;
}

.todo-followup-pick-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.todo-followup-pick-name {
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-followup-pick-sub {
    font-size: 0.82rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-followup-picker-empty {
    padding: 0.75rem;
    color: var(--text-light);
}

.todo-followup-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    justify-content: center;
    color: var(--text-light);
}

.todo-followup-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.todo-followup-summary-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

.todo-followup-filter-chips {
    display: flex;
    gap: 0.35rem;
}

.todo-followup-chip-filter {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.todo-followup-chip-filter:hover {
    background: var(--background);
}

.todo-followup-chip-filter.is-active {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.todo-followup-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.todo-followup-card {
    background: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.todo-followup-card:focus-visible {
    outline: 3px solid rgba(var(--primary-rgb, 99, 102, 241), 0.35);
    outline-offset: 2px;
}

.todo-followup-card {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border);
}

.todo-followup-card:disabled {
    cursor: default;
    opacity: 0.7;
}

.todo-followup-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.todo-followup-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.todo-followup-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.todo-followup-card-meta {
    flex: 1;
    min-width: 0;
}

.todo-followup-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.todo-followup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.todo-followup-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.todo-followup-badge-hours {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.todo-followup-badge-progress {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.15);
    color: var(--primary);
}

.todo-followup-card-body {
    padding: 1.25rem;
}

.todo-followup-card-last-activity {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0 0.35rem;
}

.todo-followup-card-risk {
    font-size: 0.8rem;
    color: #b91c1c;
    margin: 0 0 0.5rem;
}

[data-theme="dark"] .todo-followup-card-risk {
    color: #f87171;
}

.todo-followup-recommendation {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
    margin: 0;
}

[data-theme="dark"] .todo-followup-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .todo-followup-badge-hours {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

[data-theme="dark"] .todo-followup-badge-progress {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.25);
}

[data-theme="dark"] .todo-followup-card-header {
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.1) 0%, transparent 100%);
}

/* Follow-up details drawer (sliding panel) */
.todo-followup-drawer-open {
    overflow: hidden;
}

.todo-followup-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
}

.todo-followup-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
}

[data-theme="dark"] .todo-followup-drawer-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.todo-followup-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(75vw, 1100px);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    outline: none;
}

.todo-followup-drawer.is-open {
    pointer-events: auto;
}

.todo-followup-drawer.is-open .todo-followup-drawer-overlay {
    opacity: 1;
}

.todo-followup-drawer.is-open .todo-followup-drawer-panel {
    transform: translateX(0);
}

.todo-followup-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.08) 0%, transparent 100%);
}

.todo-followup-drawer-body {
    padding: 1.25rem;
    overflow: auto;
}

.todo-followup-drawer-recommendation {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.todo-followup-drawer-recommendation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.todo-followup-drawer-recommendation-header > span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.todo-followup-drawer-recommendation-header .button {
    padding: 0.25rem 0.5rem;
}

.todo-followup-drawer-recommendation-header .material-icons {
    font-size: 1.1rem;
}

.todo-followup-drawer-recommendation-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.todo-followup-drawer-suggested-next {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.todo-followup-drawer-suggested-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}

.todo-followup-drawer-suggested-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text);
}

.todo-followup-drawer-insights {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.todo-followup-drawer-insight-row.is-hidden {
    display: none;
}

.todo-followup-drawer-insight-row {
    padding: 0.4rem 0.5rem;
    background: var(--idle-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.todo-followup-drawer-insight-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.todo-followup-drawer-insight-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text);
}

.todo-followup-drawer-foot {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--background);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.todo-followup-drawer-foot .button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.todo-followup-drawer-foot .button .icon {
    margin: 0;
}

.todo-followup-details-titlewrap {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.todo-followup-details-avatar {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgba(var(--primary-rgb, 99, 102, 241), 0.25);
}

.todo-followup-details-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.todo-followup-details-controls {
    position: relative;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.92) 100%);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem 0.9rem 0.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(6px);
}

.todo-followup-details-controls-top {
    display: flex;
    gap: 0.9rem;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.todo-followup-details-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.todo-followup-range-preset.button {
    border-radius: 9999px;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.todo-followup-range-preset.button:not(.is-primary) {
    background: var(--surface);
}

.todo-followup-range-preset.button:not(.is-primary):hover {
    background: var(--surface-hover);
}

.todo-followup-details-dates {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.todo-followup-details-dates .field {
    margin-bottom: 0;
}

.todo-followup-details-apply {
    min-width: 90px;
}

.todo-followup-range-summary {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
    color: var(--text-light);
    font-size: 0.85rem;
}

.todo-followup-range-summary-title {
    font-weight: 600;
    color: var(--text);
}

.todo-followup-range-summary-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--text);
}

.todo-followup-range-summary-meta {
    color: var(--text-light);
}

[data-theme="dark"] .todo-followup-details-controls {
    background: linear-gradient(180deg, rgba(30,41,59,0.98) 0%, rgba(30,41,59,0.9) 100%);
}

.todo-followup-details-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    color: var(--text-light);
}

.todo-followup-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.todo-followup-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
}

.todo-followup-kpi-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.todo-followup-kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.todo-followup-charts {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.todo-followup-chartbox {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.todo-followup-chartbox-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.todo-followup-chartbox canvas {
    width: 100% !important;
    height: 220px !important;
}

.todo-followup-details-tasks-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    margin: 0.5rem 0 0.75rem;
}

@media (max-width: 960px) {
    .todo-followup-details-controls {
        padding: 0.85rem 0.85rem 0.7rem;
    }
    .todo-followup-drawer-panel {
        width: 100vw;
    }
    .todo-followup-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .todo-followup-charts {
        grid-template-columns: 1fr;
    }
    .todo-followup-chartbox canvas {
        height: 200px !important;
    }
}

/* Timeline Todo View Styles */
.timeline-container {
    padding: 1rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.timeline {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

.timeline-day {
    flex: 1;
    min-width: 400px;
    background: var(--background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    position: relative;
}

.timeline-day.is-today {
    border-left: 4px solid var(--primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.timeline-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-task {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.2s ease;
}

.timeline-task:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.task-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 0.5rem;
}

.task-marker.is-info {
    background-color: var(--info);
}

.task-marker.is-success {
    background-color: var(--success);
}

.task-content {
    flex: 1;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

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

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

.task-project {
    font-size: 0.875rem;
    color: var(--text-light);
}

.timeline-task.completed {
    opacity: 0.7;
    background-color: var(--background);
    border-color: var(--border);
}

.timeline-task.completed .task-title {
    text-decoration: line-through;
    color: var(--text-light);
}

.timeline-task.completed .task-marker {
    opacity: 0.5;
}

.timeline-task.completed .task-project {
    opacity: 0.7;
}

.timeline-task.completed:hover {
    transform: none;
    box-shadow: none;
}

/* Improve button interactions */
.task-actions button {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.task-actions button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.delete-task:hover {
    background-color: var(--error) !important;
    color: white !important;
}

.complete-task:hover {
    background-color: var(--success) !important;
    color: white !important;
}

/* Add Task Modal Styles */
.modal-card {
    max-width: 480px;
}

.field.has-addons .input[type="number"] {
    width: 80px;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .timeline {
        flex-direction: column;
    }

    .timeline-day {
        min-width: 100%;
    }
}

/* Animations */
.timeline-task {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-day:nth-child(1) { animation-delay: 0s; }
.timeline-day:nth-child(2) { animation-delay: 0.1s; }
.timeline-day:nth-child(3) { animation-delay: 0.2s; }

/* Drag and Drop Styles */
.timeline-task {
    cursor: move;
    user-select: none;
    display: flex;
    gap: 0.5rem;
}

.timeline-task.is-dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary);
    background: var(--background);
}

.timeline-task .drag-handle {
    cursor: move;
    color: var(--text-light);
    opacity: 0.5;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
}

.timeline-task:hover .drag-handle {
    opacity: 1;
}

.timeline-tasks {
    min-height: 50px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.timeline-tasks:empty {
    padding: 1.5rem;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
}

.timeline-tasks:empty::after {
    content: 'Drop tasks here';
    color: var(--text-light);
    font-size: 0.9rem;
}

.timeline-tasks.drag-over {
    background-color: rgba(var(--primary-rgb), 0.05);
    border: 2px dashed var(--primary);
}

/* Adjust task layout for drag handle */
.timeline-task {
    position: relative;
    padding-left: 2rem;
}

.timeline-task .drag-handle {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* —— Tasks view —— */
.tasks-view-header {
    margin-bottom: 1rem;
}

.tasks-view-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 600;
}

.tasks-view-title .material-icons {
    color: var(--primary);
    font-size: 1.75rem !important;
}

/* Tasks filter bar */
.tasks-filters-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
}

.tasks-filters-bar-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tasks-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
}

.tasks-filter-row-main {
    width: 100%;
}

/* Tasks filter slide panel (left drawer, same width as sidebar) */
.tasks-filter-panel-overlay {
    position: fixed;
    inset: 0;
    top: 3.25rem;
    background: rgba(0, 0, 0, 0.35);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
body.tasks-filter-panel-open .tasks-filter-panel-overlay {
    opacity: 1;
    pointer-events: auto;
}

.tasks-filter-panel-drawer {
    position: fixed;
    top: 3.25rem;
    left: 0;
    width: 500px;
    max-width: 85vw;
    height: calc(100vh - 3.25rem);
    background: var(--surface);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (max-width: 768px) {
    .tasks-filter-panel-drawer {
        width: 100%;
        max-width: 100%;
    }
}
body.tasks-filter-panel-open .tasks-filter-panel-drawer {
    transform: translateX(0);
}

body.tasks-filter-panel-open {
    overflow: hidden;
}

.tasks-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--background);
}
.tasks-filter-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}
.tasks-filter-panel-title .material-icons {
    font-size: 1.25rem;
    color: var(--primary);
}
.tasks-filter-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.tasks-filter-panel-close:hover {
    background: var(--border);
    color: var(--text);
}

.tasks-filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    -webkit-overflow-scrolling: touch;
}
.tasks-filter-panel-fields {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 1rem;
    align-items: stretch;
}
.tasks-filter-panel-fields .tasks-filter-group {
    min-width: 0;
}

/* Filter panel: grouped sections */
.tasks-filter-sections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tasks-filter-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
}
.tasks-filter-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.tasks-filter-section-title .material-icons {
    font-size: 1.1rem;
    color: var(--primary);
}
.tasks-filter-section-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 0.75rem;
    padding: 0 1rem 1rem;
}
.tasks-filter-section-fields .tasks-filter-group {
    min-width: 0;
}
.tasks-filter-section-fields .tasks-filter-group-toggle {
    grid-column: 1 / -1;
}
.tasks-filter-date-range-row {
    grid-template-columns: 1fr 1fr;
}
.tasks-filter-date-range-row .tasks-filter-group {
    min-width: 0;
}

/* Single date range control: label + start/end inputs + reset */
.tasks-filter-date-range-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    grid-column: 1 / -1;
}
.tasks-filter-date-range-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.tasks-filter-date-range-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}
.tasks-filter-date-range-input-wrap {
    position: relative;
    width: 100%;
}
.tasks-filter-date-range-input {
    width: 100%;
    cursor: pointer;
}
.tasks-filter-date-range-input::placeholder {
    color: var(--text-light);
}
.tasks-filter-date-range-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tasks-filter-date-range-reset:hover {
    color: var(--text);
    background: var(--border);
    border-color: var(--text-light);
}
.tasks-filter-date-range-reset .material-icons {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .tasks-filter-section-fields {
        grid-template-columns: 1fr;
    }
    .tasks-filter-date-range-row {
        grid-template-columns: 1fr;
    }
    .tasks-filter-date-range-wrap {
        flex-direction: column;
    }
}

.tasks-filter-panel-clear {
    margin-top: 0.75rem;
    align-self: flex-start;
}

.tasks-filter-open-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
    padding: 0.55rem 1rem;
    min-height: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    background: var(--idle-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tasks-filter-open-panel:hover {
    background: var(--border);
    border-color: var(--text-light);
}
.tasks-filter-open-panel .material-icons {
    font-size: 1.25rem;
}
.tasks-filter-open-panel .tasks-filter-toggle-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
    color: white;
    background: var(--primary);
    border-radius: 9999px;
}

.tasks-filters-dropdowns {
    display: flex;
    flex-wrap: wrap;
    /* align-items: flex-end; */
    gap: 1rem 1.25rem;
    min-width: 0;
}

.tasks-filter-toggle-mobile {
    display: none;
}

.tasks-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.tasks-filter-group-toggle {
    width: 100%;
}

.tasks-filter-label-inline {
    flex-direction: row;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
}

.tasks-filter-label-inline .tasks-filter-toggle-icon {
    font-size: 1.1rem;
    color: var(--success);
}

.tasks-filter-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    padding-left: 1.75rem;
}

.tasks-filter-search {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

.tasks-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tasks-filter-label .material-icons {
    font-size: 1rem !important;
    opacity: 0.85;
}

.tasks-filter-input-wrap,
.tasks-filter-select-wrap {
    position: relative;
}

.tasks-filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tasks-filter-input::placeholder {
    color: var(--text-light);
}

.tasks-filter-input:hover {
    border-color: var(--text-light);
}

.tasks-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tasks-filter-date {
    padding-left: 0.75rem;
    min-width: 140px;
}

.tasks-filter-search .tasks-filter-input-wrap::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.tasks-filter-select {
    appearance: none;
    width: 100%;
    min-width: 130px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tasks-filter-select:hover {
    border-color: var(--text-light);
}

.tasks-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tasks-filter-select-wrap {
    position: relative;
}

.tasks-filter-select-wrap::after {
    content: '';
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.tasks-filter-divider {
    width: 1px;
    align-self: stretch;
    min-height: 2.5rem;
    background: linear-gradient(180deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
    margin: 0 0.25rem;
}

.tasks-filter-divider-mobile {
    display: none;
}

.tasks-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

.tasks-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tasks-filter-clear:hover {
    color: var(--text);
    border-color: var(--text-light);
    background: var(--idle-bg);
}

.tasks-filter-clear .material-icons {
    font-size: 1.1rem !important;
}

.tasks-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.tasks-filter-btn .material-icons {
    font-size: 1.15rem !important;
}

.tasks-filter-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.tasks-filter-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.tasks-filter-btn-export {
    background: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
}

.tasks-filter-btn-export:hover {
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.4);
    transform: translateY(-1px);
}

.tasks-filter-my-tasks {
    background: var(--idle-bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.tasks-filter-my-tasks:hover {
    background: var(--border);
    border-color: var(--text-light);
}
.tasks-filter-my-tasks.is-active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-dark);
}
.tasks-filter-my-tasks.is-active:hover {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* —— Tasks filters: responsive (tablet) —— */
@media (max-width: 900px) {
    .tasks-filters-dropdowns {
        flex-wrap: wrap;
    }
    .tasks-filter-group {
        min-width: 140px;
    }
}

/* —— Tasks filters: mobile —— */
@media (max-width: 768px) {
    .tasks-filters-bar {
        padding: 1rem;
        margin-bottom: 1.25rem;
        border-radius: 12px;
    }

    .tasks-filter-row-main {
        gap: 0.75rem;
    }

    .tasks-filter-search {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }

    .tasks-filter-toggle-mobile {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.6rem 1rem;
        min-height: 44px;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text);
        background: var(--idle-bg);
        border: 1px solid var(--border);
        border-radius: 10px;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .tasks-filter-toggle-mobile:hover {
        background: var(--border);
        border-color: var(--text-light);
    }

    .tasks-filter-toggle-mobile .material-icons:first-of-type {
        font-size: 1.25rem !important;
    }

    .tasks-filter-toggle-chevron {
        margin-left: 0.15rem;
        transition: transform 0.25s ease;
    }

    .tasks-filters-bar-open .tasks-filter-toggle-chevron {
        transform: rotate(180deg);
    }

    .tasks-filter-toggle-badge {
        min-width: 1.25rem;
        height: 1.25rem;
        padding: 0 0.35rem;
        font-size: 0.7rem;
        font-weight: 600;
        line-height: 1.25rem;
        text-align: center;
        color: white;
        background: var(--primary);
        border-radius: 9999px;
    }

    .tasks-filter-divider-desktop {
        display: none;
    }

    .tasks-filter-row-main .tasks-filter-search {
        order: 0;
    }

    .tasks-filter-row-main .tasks-filter-toggle-mobile {
        order: 1;
    }

    .tasks-filter-row-main .tasks-filter-actions {
        order: 2;
    }

    .tasks-filter-row-main .tasks-filter-divider-desktop {
        order: 3;
    }

    .tasks-filter-row-main .tasks-filters-panel {
        order: 4;
    }

    .tasks-filters-panel {
        flex: 1 1 100%;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        flex-wrap: nowrap;
        flex-direction: column;
        gap: 0;
        transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
    }

    .tasks-filters-bar-open .tasks-filters-panel {
        max-height: 520px;
        opacity: 1;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
        margin-top: 0.25rem;
    }

    .tasks-filters-dropdowns {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .tasks-filters-dropdowns .tasks-filter-group {
        width: 100%;
        min-width: 0;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border);
    }

    .tasks-filters-dropdowns .tasks-filter-group:last-child {
        border-bottom: none;
    }

    .tasks-filter-actions {
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Touch-friendly controls on mobile */
    .tasks-filter-input {
        min-height: 44px;
        padding: 0.65rem 0.85rem 0.65rem 2.25rem;
        font-size: 16px;
    }

    .tasks-filter-select {
        min-height: 44px;
        min-width: 0;
        padding: 0.65rem 2rem 0.65rem 0.85rem;
        font-size: 16px;
    }

    .tasks-filter-clear,
    .tasks-filter-btn {
        min-height: 44px;
        padding: 0.65rem 1rem;
    }

    .tasks-filter-btn-primary {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* —— Tasks filters: small mobile —— */
@media (max-width: 480px) {
    .tasks-filters-bar {
        padding: 0.85rem;
    }

    .tasks-view-header {
        margin-bottom: 0.75rem;
    }

    .tasks-view-title {
        font-size: 1.5rem;
    }

    .tasks-filter-label {
        font-size: 0.7rem;
    }

    .tasks-filter-toggle-mobile {
        padding: 0.55rem 0.85rem;
        font-size: 0.85rem;
    }

    .tasks-filter-toggle-text {
        display: inline;
    }

    .tasks-filter-actions {
        gap: 0.5rem;
    }

    .tasks-filter-btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }

    .tasks-filter-btn span:last-child {
        display: inline;
    }
}

/* Tasks summary bar (filtered results: total duration, progress vs estimate) */
.tasks-summary-bar {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.tasks-summary-bar.is-hidden {
    display: none !important;
}

/* Bulk actions bar */
.tasks-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}
.tasks-bulk-bar.is-hidden {
    display: none !important;
}
.tasks-bulk-bar-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    width: 100%;
}
.tasks-bulk-count {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.tasks-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tasks-bulk-actions .button {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border);
}
.tasks-bulk-actions .button:hover {
    background: var(--border);
    border-color: var(--text-light);
}
.tasks-bulk-actions .button.is-danger.is-light {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}
.tasks-bulk-actions .button.is-danger.is-light:hover {
    background: #fecaca;
}
.tasks-bulk-actions .button.is-warning.is-light {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
}
.tasks-bulk-actions .button.is-warning.is-light:hover {
    background: #fde68a;
}
.tasks-bulk-actions .button.is-info.is-light {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}
.tasks-bulk-actions .button.is-info.is-light:hover {
    background: #bfdbfe;
}
.tasks-bulk-actions .button.is-success.is-light {
    color: #047857;
    background: #d1fae5;
    border-color: #a7f3d0;
}
.tasks-bulk-actions .button.is-success.is-light:hover {
    background: #a7f3d0;
}
.tasks-table-checkbox { width: 2.5rem; text-align: center; }
.tasks-table-checkbox .checkbox { margin: 0; }
.tasks-table-checkbox-empty { display: inline-block; width: 1.25rem; }
.task-card-select-cb { margin-right: 0.5rem; }

@media screen and (max-width: 768px) {
    .tasks-bulk-bar-inner { flex-direction: column; align-items: stretch; }
    .tasks-bulk-actions { justify-content: flex-start; }
}

.tasks-summary-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tasks-summary-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2rem;
}
.tasks-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.tasks-summary-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.tasks-summary-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
}
.tasks-summary-stat-pct .tasks-summary-stat-value {
    color: var(--primary);
}
.tasks-summary-bar-wrap {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.tasks-summary-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Filter criteria summary above table/cards */
.tasks-filter-criteria-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
}
.tasks-filter-criteria-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-light);
    font-weight: 500;
}
.tasks-filter-criteria-label .material-icons {
    font-size: 1.1rem;
    opacity: 0.9;
}
.tasks-filter-criteria-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.tasks-filter-criteria-tag {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.tasks-filter-criteria-clear {
    margin-left: auto;
}

/* Timesheet view */
.timesheet-view {
    padding: 1rem 1.25rem;
    
    margin: 0 auto;
}
.timesheet-header {
    margin-bottom: 1rem;
}
.timesheet-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.timesheet-title .material-icons {
    color: var(--primary);
}
.timesheet-subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.35rem;
    margin-bottom: 0;
}
.timesheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.timesheet-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 200px;
    max-width: 340px;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.timesheet-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.15);
}

.timesheet-search-wrap .input {
    flex: 1;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.25rem 0;
    box-shadow: none !important;
}

.timesheet-search-wrap .input::placeholder {
    color: var(--text-light);
}

.timesheet-search-icon {
    color: var(--text-light);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.timesheet-toolbar .timesheet-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    margin: 0 -0.25rem;
}

.timesheet-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.timesheet-filter-group:hover {
    background: var(--surface-hover);
}

.timesheet-filter-icon {
    color: var(--primary);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.timesheet-filter-select {
    background: transparent !important;
    border: none !important;
    color: var(--text);
    min-width: 130px;
    font-size: 0.9rem;
    cursor: pointer;
}

.timesheet-week-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.timesheet-nav-btn {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.timesheet-nav-btn:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.08) !important;
}

.timesheet-nav-btn .material-icons {
    font-size: 1.4rem;
}

.timesheet-week-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    min-width: 180px;
    text-align: center;
    padding: 0 0.5rem;
}

.timesheet-today-btn {
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.1) !important;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    transition: background 0.2s ease, transform 0.15s ease;
}

.timesheet-today-btn:hover {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.18) !important;
    transform: translateY(-1px);
}

.timesheet-today-btn .material-icons {
    font-size: 1.15rem;
    vertical-align: middle;
    margin-right: 0.35rem;
}

@media (max-width: 768px) {
    .timesheet-view {
        padding: 0.75rem 1rem;
    }
    .timesheet-toolbar {
        padding: 1rem;
        gap: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }
    .timesheet-search-wrap {
        max-width: none;
    }
    .timesheet-toolbar .timesheet-filters {
        border-left: none;
        border-right: none;
        padding: 0;
        margin: 0;
        width: 100%;
        flex-wrap: wrap;
    }
    .timesheet-filter-group {
        flex: 1;
        min-width: 120px;
    }
    .timesheet-filter-select {
        min-width: 0;
    }
    .timesheet-week-nav {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        order: 1;
    }
    .timesheet-week-label {
        min-width: 140px;
        font-size: 0.9rem;
    }
    .timesheet-table-wrap {
        max-height: calc(100vh - 300px);
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        border-radius: 6px;
    }
    .timesheet-th,
    .timesheet-cell,
    .timesheet-task-name {
        padding: 0.5rem 0.35rem;
    }
    .timesheet-th:first-child {
        min-width: 120px;
        padding-left: 0.6rem;
    }
    .timesheet-total-row-label {
        min-width: 120px;
        padding-left: 0.6rem !important;
    }
    .timesheet-day-input {
        width: 2.8rem;
        min-width: 2.2rem;
        padding: 0.4rem 0.25rem !important;
        font-size: 0.875rem;
    }
    .timesheet-total-row td {
        padding: 0.5rem 0.35rem;
        font-size: 0.875rem;
    }
}
@media (max-width: 480px) {
    .timesheet-view {
        padding: 0.5rem 0.5rem;
    }
    .timesheet-header {
        margin-bottom: 0.75rem;
    }
    .timesheet-title {
        font-size: 1.25rem;
    }
    .timesheet-toolbar {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .timesheet-table-wrap {
        max-height: calc(100vh - 280px);
    }
    .timesheet-th:first-child {
        min-width: 100px;
    }
    .timesheet-total-row-label {
        min-width: 100px;
    }
    .timesheet-task-name {
        font-size: 0.85rem;
    }
    .timesheet-day-input {
        width: 2.5rem;
        min-width: 2rem;
    }
}
.timesheet-table-wrap {
    overflow: auto;
    overflow-x: auto;
    max-height: calc(100vh - 320px);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}
.timesheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.timesheet-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}
.timesheet-th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.timesheet-th:not(.timesheet-th-task) {
    
    min-width: 3.5rem;
}
.timesheet-th-day {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}
.timesheet-th-date {
    font-size: 0.75em;
    font-weight: 500;
    color: var(--text-light, #6b7280);
    letter-spacing: 0.02em;
    padding-left: 2px;
}
.timesheet-th-task {
    text-align: left;
    padding-left: 1rem;
    min-width: 160px;
}
.timesheet-th-remaining {
    min-width: 4rem;
    font-size: 0.8em;
}
.timesheet-cell-remaining {
    padding: 0.35rem 0.5rem;
    text-align: center;
    vertical-align: middle;
}
.timesheet-remaining-input {
    width: 3.5rem;
    min-width: 3rem;
    padding: 0.35rem 0.4rem !important;
    font-size: 0.85rem;
    text-align: center;
    background: var(--surface) !important;
    border-color: var(--border);
    color: var(--text);
}
.timesheet-remaining-total {
    font-weight: 700;
}
.timesheet-th-week-total {
    min-width: 5.5rem;
    font-size: 0.8em;
}
.timesheet-cell-week-total {
    padding: 0.35rem 0.5rem;
    text-align: center;
    vertical-align: middle;
    font-weight: 600;
}
.timesheet-week-total {
    font-weight: 700;
}
.timesheet-th:first-child {
    text-align: left;
    padding-left: 1rem;
    min-width: 160px;
}
.timesheet-group-row {
    background: var(--bg);
}
.timesheet-group-header {
    padding: 0.6rem 1rem !important;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--surface-hover);
    gap: 0.5rem;
}
.timesheet-group-icon {
    color: var(--primary);
    font-size: 1.2rem;
    position: relative; 
    top: 4px;
}
.timesheet-group-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    margin-left: 0.5rem;
}
.timesheet-row {
    border-bottom: 1px solid var(--border);
}
.timesheet-row:last-child {
    border-bottom: none;
}
.timesheet-row:hover {
    background: var(--bg);
}
.timesheet-task-name {
    padding: 0.6rem 1rem;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.timesheet-task-icon {
    color: var(--text-light);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.timesheet-task-name-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.timesheet-task-name-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
.timesheet-cell {
    padding: 0.5rem;
    text-align: center;
    color: var(--text);
}
.timesheet-cell-editable {
    padding: 0.35rem !important;
    vertical-align: middle;
}
.timesheet-day-input {
    width: 3.5rem;
    min-width: 2.5rem;
    padding: 0.35rem 0.4rem !important;
    font-size: 0.85rem;
    text-align: center;
    background: var(--surface) !important;
    border-color: var(--border);
    color: var(--text);
}
.timesheet-day-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 99, 102, 241), 0.2);
}
.timesheet-cell-disabled .timesheet-day-input {
    cursor: not-allowed;
    opacity: 0.7;
    background: var(--bg) !important;
}
/* Tooltip for disabled (pre–start date) cells: show hint via CSS content on hover */
.timesheet-cell-disabled {
    position: relative;
}
.timesheet-cell-disabled::after {
    content: attr(data-disabled-hint);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    width: max(200px, 18em);
    max-width: 280px;
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #fff;
    background: #374151;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: normal;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 20;
}
.timesheet-cell-disabled::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #374151;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 21;
}
.timesheet-cell-disabled:hover::after,
.timesheet-cell-disabled:hover::before {
    opacity: 1;
    visibility: visible;
}
.timesheet-empty .material-icons {
    font-size: 2.5rem;
    opacity: 0.5;
    display: block;
    margin-bottom: 0.5rem;
}

/* Total row: per-day totals, sticky at bottom when scrolling */
.timesheet-tfoot {
    position: sticky;
    bottom: 0;
    z-index: 2;
}
.timesheet-total-row {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}
.timesheet-total-row td {
    padding: 0.65rem 0.5rem;
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}
.timesheet-total-row-label {
    text-align: left !important;
    padding-left: 1rem !important;
    min-width: 160px;
}
.timesheet-day-total {
    font-weight: 700;
}

/* Weekend days (Fri–Sat): subtle background; light green when hours > 0 */
.timesheet-th-weekend {
    background: rgba(0, 0, 0, 0.04);
}
.timesheet-cell-weekend {
    background: rgba(0, 0, 0, 0.035);
}
.timesheet-cell-weekend-has-hours {
    background: rgba(34, 197, 94, 0.18) !important;
}
.timesheet-total-row .timesheet-cell-weekend {
    background: rgba(0, 0, 0, 0.15);
}
.timesheet-total-row .timesheet-cell-weekend-has-hours {
    background: rgba(34, 197, 94, 0.45) !important;
}
[data-theme="dark"] .timesheet-th-weekend {
    background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .timesheet-cell-weekend {
    background: rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .timesheet-cell-weekend-has-hours {
    background: rgba(34, 197, 94, 0.22) !important;
}
[data-theme="dark"] .timesheet-total-row .timesheet-cell-weekend {
    background: rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .timesheet-total-row .timesheet-cell-weekend-has-hours {
    background: rgba(34, 197, 94, 0.4) !important;
}

/* Timesheet: current day column highlight */
.timesheet-th-today {
    background: rgba(99, 102, 241, 0.18) !important;
    border-left: 1px solid rgba(99, 102, 241, 0.35);
    border-right: 1px solid rgba(99, 102, 241, 0.35);
}
.timesheet-cell-today {
    background: rgba(99, 102, 241, 0.12) !important;
}
.timesheet-total-row .timesheet-cell-today {
    background: rgba(99, 102, 241, 0.2) !important;
    font-weight: 600;
}
[data-theme="dark"] .timesheet-th-today {
    background: rgba(99, 102, 241, 0.25) !important;
    border-left-color: rgba(99, 102, 241, 0.45);
    border-right-color: rgba(99, 102, 241, 0.45);
}
[data-theme="dark"] .timesheet-cell-today {
    background: rgba(99, 102, 241, 0.15) !important;
}
[data-theme="dark"] .timesheet-total-row .timesheet-cell-today {
    background: rgba(99, 102, 241, 0.28) !important;
}

/* Timesheet dark theme enhancements */
[data-theme="dark"] .timesheet-view {
    background: transparent;
}
[data-theme="dark"] .timesheet-toolbar {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .timesheet-search-wrap {
    background: var(--background);
    border-color: var(--border);
}
[data-theme="dark"] .timesheet-search-wrap:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .timesheet-toolbar .timesheet-filters {
    border-color: var(--border);
}
[data-theme="dark"] .timesheet-filter-group {
    background: var(--background);
}
[data-theme="dark"] .timesheet-filter-group:hover {
    background: var(--surface-hover);
}
[data-theme="dark"] .timesheet-week-nav {
    background: var(--background);
    border-color: var(--border);
}
[data-theme="dark"] .timesheet-nav-btn {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .timesheet-nav-btn:hover {
    border-color: var(--primary-light) !important;
    color: var(--primary-light) !important;
    background: rgba(99, 102, 241, 0.2) !important;
}
[data-theme="dark"] .timesheet-today-btn {
    border-color: var(--primary-light) !important;
    color: var(--primary-light) !important;
    background: rgba(99, 102, 241, 0.2) !important;
}
[data-theme="dark"] .timesheet-today-btn:hover {
    background: rgba(99, 102, 241, 0.3) !important;
}
[data-theme="dark"] .timesheet-table-wrap {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .timesheet-th {
    background: var(--background);
    color: var(--text);
    border-bottom-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .timesheet-th-day,
[data-theme="dark"] .timesheet-th-date {
    color: var(--text-light);
}
[data-theme="dark"] .timesheet-group-header {
    background: var(--background);
    border-bottom-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .timesheet-group-icon {
    color: var(--primary-light);
}
[data-theme="dark"] .timesheet-group-count {
    color: var(--text-light);
}
[data-theme="dark"] .timesheet-row {
    border-bottom-color: var(--border);
}
[data-theme="dark"] .timesheet-row:hover {
    background: var(--surface-hover);
}
[data-theme="dark"] .timesheet-task-name {
    color: var(--text);
}
[data-theme="dark"] .timesheet-task-icon {
    color: var(--text-light);
}
[data-theme="dark"] .timesheet-task-name-link:hover {
    color: var(--primary-light);
}
[data-theme="dark"] .timesheet-cell {
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .timesheet-day-input,
[data-theme="dark"] .timesheet-remaining-input {
    background: var(--background) !important;
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .timesheet-day-input:focus,
[data-theme="dark"] .timesheet-remaining-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
[data-theme="dark"] .timesheet-cell-disabled .timesheet-day-input {
    background: rgba(0, 0, 0, 0.2) !important;
}
[data-theme="dark"] .timesheet-cell-week-total {
    color: var(--text);
}
[data-theme="dark"] .timesheet-tfoot {
    background: var(--surface);
}
[data-theme="dark"] .timesheet-total-row {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .timesheet-total-row td {
    border-top-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .timesheet-empty {
    color: var(--text-light);
}
[data-theme="dark"] .timesheet-empty .material-icons {
    color: var(--text-light);
    opacity: 0.4;
}

.tasks-list {
    min-height: 200px;
}

.tasks-list.tasks-view-table {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

/* Tasks view mode switcher */
.tasks-view-switcher {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .tasks-view-switcher-label,
    .tasks-view-switcher-btns {
        display: none !important;
    }
    .tasks-view-switcher {
        margin-bottom: 0.75rem;
    }
}

.tasks-view-switcher-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
}

.tasks-view-switcher-btns {
    display: inline-flex;
    background: var(--idle-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.tasks-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.tasks-view-btn:hover {
    color: var(--text);
    background: var(--surface);
}

.tasks-view-btn.is-active {
    color: var(--primary);
    background: var(--surface);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.tasks-view-btn .material-icons {
    font-size: 1.2rem !important;
}

/* Tasks sort controls – same design theme as filters and view switcher */
.tasks-sort-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--idle-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem 0.75rem 0.4rem 0.6rem;
}

.tasks-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: default;
}

.tasks-sort-label .material-icons {
    font-size: 1rem !important;
    opacity: 0.85;
}

.tasks-sort-select-wrap {
    position: relative;
}

.tasks-sort-select-wrap::after {
    content: '';
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.tasks-sort-select {
    appearance: none;
    min-width: 140px;
    padding: 0.4rem 2rem 0.4rem 0.65rem;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tasks-sort-select:hover {
    border-color: var(--text-light);
}

.tasks-sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Tasks list view: single column (default) */
.tasks-view-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Tasks cards view: 3 per row */
.tasks-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .tasks-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tasks-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Tasks table view */
.tasks-view-table {
    min-width: 0;
}
@media (max-width: 1024px) {
    .tasks-view-table {
        overflow: hidden;
    }
}

.tasks-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: block;
}

.tasks-table-wrap .tasks-table {
    /* width: max-content; */
    min-width: 960px;
}

.tasks-show-more-wrap {
    margin-top: 1rem;
    text-align: center;
}

/* Day grouping */
.tasks-day-group {
    margin-bottom: 1.5rem;
}
.tasks-day-group:last-child {
    margin-bottom: 0;
}
.tasks-day-group-header {
    
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    background: var(--background);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tasks-day-group-header .material-icons {
    font-size: 1.25rem;
    color: var(--primary);
    position: relative;
    top: 4px;
}
.tasks-day-count {
    margin-left: auto;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-light);
}
.tasks-day-total-hours-wrap {
    position: absolute;
    right: 10px;
    display: inline-flex;
    cursor: default;
}
.tasks-day-total-hours {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
}
.tasks-day-total-hours-popover {
    position: absolute;
    right: 0;
    bottom: 100%;
    transform: translateY(-6px);
    min-width: 220px;
    max-width: 320px;
    padding: 0.6rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.tasks-day-total-hours-wrap:hover .tasks-day-total-hours-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(-8px);
}
.tasks-day-hours-popover-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    padding: 0 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.tasks-day-hours-popover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}
.tasks-day-hours-popover-row:hover {
    background: var(--surface-hover);
}
.tasks-day-hours-popover-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.tasks-day-hours-popover-h {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--primary);
}
.tasks-day-group-header-row td.tasks-day-group-header {
    padding: 0.6rem 1rem;
    font-weight: 600;
    border-left: none;
    border-radius: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}
.tasks-day-group-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tasks-table th,
.tasks-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tasks-table th {
    font-weight: 600;
    color: var(--text);
    background: var(--idle-bg);
    white-space: nowrap;
}

.tasks-table th.tasks-table-actions {
    width: 1%;
    text-align: right;
}

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

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

.tasks-table-name {
    max-width: 220px;
}

.tasks-table-name-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    /* white-space: nowrap; */
    min-width: 200px;
}

.tasks-table-member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tasks-table-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #0c00ff;
}

.tasks-table-actions {
    white-space: nowrap;
    text-align: right;
}

.tasks-table-actions .button {
    margin-left: 0.25rem;
}

.tasks-table-note {
    max-width: 200px;
    font-size: 0.85rem;
    color: var(--text);
}

.tasks-table-note-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .tasks-table-wrap .tasks-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .tasks-table-wrap {
        font-size: 0.85rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 8px;
    }
    .tasks-table-wrap .tasks-table {
        min-width: 860px;
    }
    .tasks-table th,
    .tasks-table td {
        padding: 0.5rem 0.65rem;
    }
}

.task-card-empty .task-empty-icon {
    font-size: 48px;
}

/* Enhanced task card */
.task-card-enhanced {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.task-card-enhanced:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.2);
}

.task-card-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.task-accent-ahead {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
}

.task-accent-on-track {
    background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
}

.task-accent-over {
    background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
}

.task-accent-none {
    background: var(--text-light);
}

.task-card-body {
    position: relative;
    padding: 1.25rem 1.5rem;
    padding-top: 2.5rem;
}

/* Edit/Delete always top-right for easy reach */
.task-card-actions-top {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
}

.task-card-actions-top .button {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    transition: background 0.2s ease, color 0.2s ease;
}

.task-card-actions-top .button:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.task-card-actions-top .button .material-icons {
    font-size: 1.125rem;
}

.task-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.task-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.task-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border);
    background-color: #0c00ff;

}

.task-card-title-wrap {
    min-width: 0;
    flex: 1;
}

.task-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem 0;
    line-height: 1.35;
}

.task-card-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.task-card-meta-sep {
    color: var(--border);
    user-select: none;
}

.task-card-member-name,
.task-card-project,
.task-card-phase {
    color: var(--text-light);
}

.task-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.task-card-tags .tag {
    font-size: 0.75rem;
}

.task-card-tags .tag-icon {
    font-size: 13px;
    margin-right: 0.2rem;
    vertical-align: middle;
}

/* Hours row: expected · logged · remaining + status */
.task-card-hours-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--idle-bg);
    border-radius: 10px;
}

.task-card-hour-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
}

.task-card-hour-icon {
    font-size: 1rem !important;
    color: var(--text-light);
}

.task-card-hour-logged .task-card-hour-icon {
    color: var(--primary);
}

.task-card-hour-remaining .task-card-hour-icon {
    color: var(--text);
}

.task-card-status-pill {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.task-card-status-pill.task-status-ahead {
    background: rgba(16, 185, 129, 0.18);
    color: #059669;
}

.task-card-status-pill.task-status-on-track {
    background: rgba(59, 130, 246, 0.15);
    color: #2563EB;
}

.task-card-status-pill.task-status-over {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

.task-card-status-pill.task-status-none {
    background: var(--border);
    color: var(--text-light);
}

.task-card-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.task-card-date-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.task-card-dates .date-icon {
    font-size: 14px;
    vertical-align: middle;
}

.task-finished-indicator {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 500;
}

.task-finished-indicator.task-finished-under {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.task-finished-indicator.task-finished-on {
    background: rgba(59, 130, 246, 0.12);
    color: #2563EB;
}

.task-finished-indicator.task-finished-over {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

.task-finished-indicator.task-status-ahead {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.task-finished-indicator.task-status-on-track {
    background: rgba(59, 130, 246, 0.12);
    color: #2563EB;
}

.task-finished-indicator.task-status-over {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

.task-finished-indicator.task-status-none {
    background: var(--idle-bg);
    color: var(--text-light);
}

/* Task card note (estimation note) */
.task-card-note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.6rem;
    background: var(--idle-bg);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text);
    border-left: 3px solid var(--primary-light);
}

.task-card-note-icon {
    font-size: 1rem !important;
    color: var(--text-light);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.task-card-note-text {
    flex: 1;
    min-width: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

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

.task-hours-tag {
    font-size: 0.75rem;
    background: var(--idle-bg);
    color: var(--text);
}

.task-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
}

.task-status-badge.task-status-ahead {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.task-status-badge.task-status-on-track {
    background: rgba(59, 130, 246, 0.12);
    color: #2563EB;
}

.task-status-badge.task-status-over {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

.task-status-badge.task-status-none {
    background: var(--idle-bg);
    color: var(--text-light);
}

/* Burn-down area chart block */
.task-chart-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.task-chart-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.task-chart-wrap {
    position: relative;
    height: 200px;
    width: 100%;
    border-radius: 8px;
    background: var(--background);
    padding: 0.75rem;
}

.task-burndown-chart {
    width: 100% !important;
    height: 100% !important;
}

.task-fallback-progress {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

/* Mobile: simpler, less crowded task card */
.task-card-mobile .task-card-body {
    padding: 1rem 1.25rem;
    padding-top: 2.25rem;
}
.task-card-mobile .task-card-actions-top {
    top: 0.4rem;
    right: 0.4rem;
}
.task-card-mobile .task-card-avatar {
    width: 36px;
    height: 36px;
}
.task-card-mobile .task-card-title {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}
.task-card-mobile .task-card-meta-line {
    font-size: 0.75rem;
    gap: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.task-card-mobile .task-card-meta-line .task-card-member-name,
.task-card-mobile .task-card-meta-line .task-card-project {
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-card-mobile .task-card-header {
    margin-bottom: 0.6rem;
    gap: 0.4rem 0.75rem;
}
.task-card-mobile .task-card-tags {
    gap: 0.35rem;
}
.task-card-mobile .task-card-tags .task-card-status-pill {
    margin-left: 0;
    font-size: 0.7rem;
    padding: 0.18rem 0.45rem;
}
.task-card-mobile .task-card-hours-row {
    margin-bottom: 0.6rem;
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
}
.task-card-mobile .task-card-hour-pill {
    font-size: 0.75rem;
}
.task-card-mobile .task-card-hour-icon {
    font-size: 0.9rem !important;
}
.task-card-mobile .task-card-dates {
    margin-bottom: 0;
    gap: 0.75rem;
    font-size: 0.75rem;
}
.task-card-mobile .task-card-dates .date-icon {
    font-size: 13px;
}

@media (max-width: 768px) {
    .tasks-view-cards .task-card-enhanced {
        margin-bottom: 0.75rem;
    }
    .tasks-view-cards .tasks-day-group {
        margin-bottom: 1.25rem;
    }
    .tasks-view-cards .tasks-cards-grid {
        gap: 0.75rem;
    }
}

/* ========== Who's Online (admin) ========== */
.whos-online-view {
    max-width: 1200px;
    margin: 0 auto;
}

.whos-online-header {
    margin-bottom: 2rem;
}

.whos-online-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.whos-online-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 600;
}

.whos-online-title-icon {
    color: var(--primary);
    font-size: 1.75rem !important;
}

.whos-online-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.whos-online-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: whos-online-pulse 1.5s ease-in-out infinite;
}

@keyframes whos-online-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.whos-online-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.whos-online-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .whos-online-grid {
        grid-template-columns: 1fr;
    }
}

.whos-online-section {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.whos-online-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding: 1rem 1.25rem;
    margin: 0;
    background: var(--idle-bg);
    border-bottom: 1px solid var(--border);
}

.whos-online-section-title .material-icons {
    font-size: 0.65rem !important;
    color: var(--success);
}

.whos-online-section-recent .whos-online-section-title .material-icons {
    color: var(--text-light);
}

.whos-online-icon-muted {
    color: var(--text-light) !important;
}

.whos-online-count {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--surface);
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.whos-online-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
}

.whos-online-loading,
.whos-online-empty {
    padding: 1.5rem 1.25rem;
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
}

.whos-online-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    transition: var(--transition);
    margin: 0.25rem;
}

.whos-online-card:hover {
    background: var(--idle-bg);
}

.whos-online-card-status {
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-light);
}

.whos-online-card-status-online {
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.whos-online-card-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    margin-left: 1.25rem;
}

.whos-online-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.whos-online-card-online .whos-online-card-avatar {
    border-color: rgba(16, 185, 129, 0.4);
}

.whos-online-card-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--success);
    opacity: 0.4;
    animation: whos-online-pulse-ring 2s ease-out infinite;
}

@keyframes whos-online-pulse-ring {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 0; }
}

.whos-online-card-body {
    flex: 1;
    min-width: 0;
}

.whos-online-card-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.whos-online-card-email {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.whos-online-card-view {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
}

.whos-online-card-view-icon {
    font-size: 1rem !important;
    color: var(--primary);
}

.whos-online-card-meta {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.whos-online-card-duration,
.whos-online-card-lastseen {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.whos-online-card-duration .material-icons {
    font-size: 0.9rem !important;
}

.whos-online-card-login {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.whos-online-card-login-icon {
    font-size: 0.9rem !important;
} 


.checkbox:hover, .radio:hover, strong{
    color:inherit;
}
button {
    border-radius: 20px !important;
}