::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #1e293b;
}
::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.spinner {
    border: 3px solid #334155;
    border-top: 3px solid #ef4233;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.toast-enter {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-exit {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: #334155;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.nav-link {
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: #1e293b;
}

.nav-link.active {
    background: #1e293b;
    border-left: 3px solid #ef4233;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.status-dot.inactive {
    background: #64748b;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #475569;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.on {
    background: #ef4233;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.on::after {
    transform: translateX(20px);
}

/* ─── Sort Carets ────────────────────────────────────────────── */

.sort-caret {
    display: inline-block;
    margin-left: 4px;
    vertical-align: middle;
    width: 0;
    height: 0;
}
.sort-asc {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #ef4233;
}
.sort-desc {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #ef4233;
}

/* ─── View Toggle ─────────────────────────────────────────────── */

.view-toggle-wrapper {
    display: flex;
    background: #1e293b;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #334155;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    color: #e2e8f0;
}

.view-toggle-btn.active {
    background: #ef4233;
    color: white;
    box-shadow: 0 1px 3px rgba(239, 66, 51, 0.3);
}

/* ─── User List Cards ─────────────────────────────────────────── */

.user-list-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-list-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(239, 66, 51, 0.3);
    transform: translateX(2px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: #334155;
    flex-shrink: 0;
    transition: box-shadow 0.2s;
}

.user-avatar.active {
    background: linear-gradient(135deg, #1e3a2f, #1a3540);
    box-shadow: 0 0 0 2px #22c55e40;
}

.user-avatar.lg {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

/* ─── Detail Drawer ───────────────────────────────────────────── */

.user-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.user-detail-overlay.visible {
    opacity: 1;
}

.user-detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 560px;
    max-width: 90vw;
    background: #111827;
    border-left: 1px solid #1f2937;
    z-index: 50;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
}

.user-detail-drawer.open {
    transform: translateX(0);
}

/* ─── User list card active accent ───────────────────────────── */

.user-list-card.is-active-user {
    border-left: 2px solid rgba(34, 197, 94, 0.4);
}

/* ─── Status Badge ────────────────────────────────────────────── */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    background: color-mix(in srgb, var(--badge-color, #475569) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--badge-color, #475569) 40%, transparent);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Date Preset Buttons ─────────────────────────────────────── */

.date-preset-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: 1px solid #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.date-preset-btn:hover {
    color: #e2e8f0;
    border-color: #475569;
    background: rgba(30, 41, 59, 0.6);
}

.date-preset-btn.active {
    color: white;
    background: rgba(239, 66, 51, 0.15);
    border-color: rgba(239, 66, 51, 0.5);
}

/* ─── Drawer Preset Buttons ───────────────────────────────────── */

.drawer-preset-btn {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: 1px solid #283447;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.drawer-preset-btn:hover {
    color: #cbd5e1;
    border-color: #374151;
}

.drawer-preset-btn.active {
    color: white;
    background: rgba(239, 66, 51, 0.15);
    border-color: rgba(239, 66, 51, 0.4);
}

/* ─── Gantt Now-line ──────────────────────────────────────────── */

.gantt-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4233;
    opacity: 0.6;
    pointer-events: none;
    transform: translateX(-50%);
}

.gantt-now-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #ef4233;
}

/* ─── Gantt user row hover ────────────────────────────────────── */

.gantt-user-row:hover {
    background: rgba(55, 65, 81, 0.25) !important;
}

/* ─── Drawer sparkline timeline bar ──────────────────────────── */

.drawer-timeline-bar {
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    width: 100%;
    background: rgba(51, 65, 85, 0.4);
}

.drawer-timeline-bar > div {
    min-width: 1px;
}

/* ─── Activity Timeline (in drawer) ──────────────────────────── */

.activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    position: relative;
    transition: background 0.15s;
}

.activity-row:hover {
    background: rgba(30, 41, 59, 0.5);
}

.activity-row.is-active {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.activity-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
