/* ============================================
   Staff Dashboard — Additional Styles
   Base styles inherited from admin-dashboard.css
   ============================================ */

/* ─── Department sub-tabs ─── */
.staff-dept-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: wrap;
}
.staff-dept-tabs::-webkit-scrollbar { display: none; }

.staff-dept-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1.5px solid var(--pm-border);
    background: var(--pm-bg);
    color: var(--pm-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    position: relative;
}
.staff-dept-tab:hover {
    border-color: var(--pm-primary);
    color: var(--pm-primary);
}
.staff-dept-tab.active {
    background: var(--pm-primary);
    border-color: var(--pm-primary);
    color: #fff;
    font-weight: 600;
}
.staff-dept-tab .dept-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.staff-dept-tab.active .dept-color-dot {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}
.staff-dept-tab .pin-icon {
    font-size: 0.55rem;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
    padding: 2px;
}
.staff-dept-tab:hover .pin-icon,
.staff-dept-tab .pin-icon.pinned {
    opacity: 1;
}
.staff-dept-tab .pin-icon.pinned {
    color: var(--pm-primary);
}
.staff-dept-tab.active .pin-icon.pinned {
    color: #fff;
}

/* ─── Virtual category header icons ─── */
.staff-virtual-cat-icon {
    font-size: 0.85rem;
    color: var(--pm-primary);
    margin-right: 0.4rem;
    flex-shrink: 0;
}

/* ─── Empty state for department tab ─── */
.staff-dept-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--pm-text-secondary);
}
.staff-dept-empty i {
    font-size: 2.5rem;
    opacity: 0.25;
    display: block;
    margin-bottom: 0.75rem;
}
.staff-dept-empty h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pm-text);
    margin-bottom: 0.35rem;
}
.staff-dept-empty p {
    font-size: 0.85rem;
    margin: 0;
}

/* ─── Custom category header with edit/delete ─── */
.staff-cat-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* ─── No-access banner ─── */
.staff-no-access-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--pm-radius-sm);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--pm-text-secondary);
}
.staff-no-access-banner i {
    color: var(--pm-primary);
    font-size: 1rem;
}

/* ─── Department category grouping ─── */
.staff-dept-cat-group {
    margin-bottom: 1.25rem;
}
.staff-dept-cat-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--pm-border-light);
}
.staff-dept-cat-group-header h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pm-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0;
}

/* ─── Custom category inline edit ─── */
.staff-edit-group {
    padding: 0.75rem;
    border: 1px dashed var(--pm-border);
    border-radius: var(--pm-radius-sm);
    margin-bottom: 0.5rem;
    background: var(--pm-bg-secondary);
}
.staff-edit-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.staff-edit-group-header input {
    flex: 1;
}

/* ─── Staff dashboard tweaks ─── */
.staff-page-subtitle {
    font-size: 0.8rem;
    color: var(--pm-text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.staff-page-subtitle .user-dept-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.08);
    color: var(--pm-text-secondary);
}

/* ─── Presence on department checklist ─── */
.staff-presence-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--pm-text-secondary);
}
.staff-presence-bar .presence-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pm-success);
    animation: pm-pulse 2s ease-in-out infinite;
}

/* ─── Timed task enhancements for staff dashboard ─── */

/* Make timed tasks visually distinct with a stronger card treatment */
.pm-checklist-tab .pm-timed-group {
    border-left: 3px solid var(--pm-primary);
    background: linear-gradient(135deg, rgba(37,99,235,0.02) 0%, transparent 100%);
    border-radius: var(--pm-radius-sm);
    padding: 0.75rem 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.pm-checklist-tab .pm-timed-group:hover {
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}

/* Running state: pulsing red accent */
.pm-checklist-tab .pm-timed-group.pm-timed-running {
    border-left-color: var(--pm-danger);
    background: linear-gradient(135deg, rgba(239,68,68,0.03) 0%, transparent 100%);
}
.pm-checklist-tab .pm-timed-group.pm-timed-running:hover {
    box-shadow: 0 2px 8px rgba(239,68,68,0.1);
}

/* Completed state: green accent */
.pm-checklist-tab .pm-timed-group.completed {
    border-left-color: var(--pm-success);
    background: linear-gradient(135deg, rgba(16,185,129,0.03) 0%, transparent 100%);
}

/* Improved header layout */
.pm-checklist-tab .pm-timed-group .pm-group-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pm-checklist-tab .pm-timed-group .pm-group-header-left {
    gap: 0.5rem;
}
.pm-checklist-tab .pm-timed-group .pm-group-header-left .fa-stopwatch {
    font-size: 1rem;
}
.pm-checklist-tab .pm-timed-group .pm-group-title {
    font-size: 0.95rem;
}

/* Inline start/stop buttons in header */
.pm-checklist-tab .pm-timed-inline-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.85rem;
    border-radius: 6px;
    font-weight: 600;
    gap: 0.3rem;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(37,99,235,0.15);
    transition: all 0.15s;
}
.pm-checklist-tab .pm-timed-inline-btn:hover:not(:disabled) {
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}
/* Elapsed time inline in header */
.pm-checklist-tab .pm-timed-elapsed-inline {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}
/* Completed result inline below header */
.pm-checklist-tab .pm-timed-result-inline .pm-completed-info {
    color: var(--pm-success);
}

/* Description under timed task header */
.pm-checklist-tab .pm-timed-group .pm-group-desc {
    margin: 0.35rem 0 0;
    padding-left: 1.5rem;
    font-size: 0.82rem;
    color: var(--pm-text-secondary);
}

/* Badge improvements in timed header */
.pm-checklist-tab .pm-timed-group .pm-group-header-right {
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pm-checklist-tab .pm-timed-group .pm-group-header-right .pm-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

/* ─── Personal Checklist Settings Dropdown ─── */
.staff-settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    background: white;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-sm);
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    min-width: 260px;
    padding: 0.5rem;
    animation: pm-fadeIn 0.15s ease;
}
.staff-settings-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.5rem;
    border-radius: var(--pm-radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}
.staff-settings-toggle:hover {
    background: rgba(37,99,235,0.04);
}
.staff-settings-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pm-text);
    line-height: 1.2;
}
.staff-settings-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--pm-text-secondary);
    margin-top: 0.15rem;
    line-height: 1.3;
}

/* ─── Active Filter Bar ─── */
.staff-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(37,99,235,0.04);
    border: 1px solid rgba(37,99,235,0.10);
    border-radius: var(--pm-radius-sm);
    font-size: 0.72rem;
    color: var(--pm-text-secondary);
    flex-wrap: wrap;
}
.staff-filter-chip {
    background: rgba(37,99,235,0.10);
    color: var(--pm-primary);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.68rem;
    white-space: nowrap;
}
.staff-filter-clear {
    background: none;
    border: none;
    color: var(--pm-text-secondary);
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0;
    margin-left: auto;
    text-decoration: underline;
    transition: color 0.15s;
}
.staff-filter-clear:hover {
    color: var(--pm-primary);
}

/* ─── Reorder Buttons on Custom Categories ─── */
.pm-reorder-btn {
    font-size: 0.6rem !important;
    padding: 2px 5px !important;
    color: var(--pm-text-secondary);
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
}
.pm-reorder-btn:hover {
    opacity: 1;
    color: var(--pm-primary);
}

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