/* ==============================================
   components.css
   Buttons, cards, tables, badges, modals, forms,
   toggles, inputs, tooltips, filters, charts,
   heatmaps, toasts, animations, and all other
   component-specific styles.
   ============================================== */

/* ============================================
   BUTTONS
   ============================================ */

.refresh-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.refresh-btn:active {
    background: var(--bg-active);
    border-color: var(--border-dark);
    transform: scale(0.98);
}

.timezone-badge {
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-light);
}

/* Role Switcher Button */
.role-switcher-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.role-switcher-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.role-switcher-btn:active {
    background: var(--bg-active);
    border-color: var(--border-dark);
    transform: scale(0.98);
}

/* Theme Toggle Switch */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle-switch {
    position: relative;
    width: 42px;
    height: 22px;
    background: var(--border-medium);
    border-radius: 11px;
    transition: background 0.3s ease;
    border: 1px solid var(--border-light);
}

.theme-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--bg-secondary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.dark-theme .theme-toggle-switch {
    background: var(--status-info);
}

body.dark-theme .theme-toggle-switch::after {
    transform: translateX(20px);
}

.theme-toggle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.theme-toggle-icon.sun {
    opacity: 1;
}

.theme-toggle-icon.moon {
    opacity: 0;
}

body.dark-theme .theme-toggle-icon.sun {
    opacity: 0;
}

body.dark-theme .theme-toggle-icon.moon {
    opacity: 1;
}

/* ============================================
   DARK THEME COMPONENT OVERRIDES
   ============================================ */

/* Dark theme adjustments for badges */
body.dark-theme .activity-badge.active {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.3);
}

body.dark-theme .activity-badge.recent {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border-color: rgba(210, 153, 34, 0.3);
}

body.dark-theme .activity-badge.stale {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border-color: rgba(255, 152, 0, 0.3);
}

body.dark-theme .manager-badge.top-manager,
body.dark-theme .manager-perf-role.top {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-color: rgba(88, 166, 255, 0.3);
}

body.dark-theme .manager-badge.account-manager {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.3);
}

body.dark-theme .manager-badge.whitelisted-user {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

body.dark-theme .manager-perf-role.whitelisted {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

/* Dark theme card hover effects - consistent and subtle */
body.dark-theme .request-card:hover,
body.dark-theme .breach-card:hover,
body.dark-theme .chat-overview-card:hover,
body.dark-theme .stat-card:hover,
body.dark-theme .manager-perf-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

body.dark-theme .breach-card {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-left: 3px solid var(--status-danger);
}

body.dark-theme .breach-card:hover {
    box-shadow: 0 2px 12px rgba(248, 81, 73, 0.25);
    border-color: var(--status-danger);
}

/* History cards have blue glow in dark theme too */
body.dark-theme .breach-card.history:hover {
    box-shadow: 0 2px 12px rgba(3, 102, 214, 0.3);
    border-color: var(--status-info);
}

body.dark-theme .chat-overview-card:hover {
    border-left-color: var(--status-info);
}

/* Dark theme interactive element hover consistency */
body.dark-theme .leaderboard-bar-segment:hover {
    filter: brightness(1.2);
}

body.dark-theme .heatmap-bar:hover {
    filter: brightness(1.15);
}

/* Dark theme - Refresh button enhancement */
body.dark-theme .refresh-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}

body.dark-theme .refresh-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

body.dark-theme .refresh-btn:active {
    background: var(--bg-active);
}

/* Dark theme - Date filter buttons less bright */
body.dark-theme .date-filter-tabs {
    background: var(--bg-tertiary);
}

body.dark-theme .date-filter-btn:hover {
    background: var(--bg-active);
}

/* Dark theme - Sort buttons consistent style */
body.dark-theme .sort-buttons {
    background: var(--bg-tertiary);
}

body.dark-theme .sort-btn:hover {
    background: var(--bg-active);
}

body.dark-theme .sort-btn.active {
    background: var(--status-info);
    color: white;
}

/* Ensure hover does not override active style in dark theme */
body.dark-theme .sort-btn.active:hover {
    background: var(--status-info);
    color: white;
}

/* ============================================
   LOADING / REFRESH ANIMATIONS
   ============================================ */

/* Loading animation for refresh button (background pulse) */
@keyframes refresh-pulse {
    0%, 100% {
        background-color: var(--bg-secondary);
        border-color: var(--border-medium);
    }
    50% {
        background-color: var(--bg-hover);
        border-color: var(--status-info);
    }
}

.refresh-btn.loading {
    animation: refresh-pulse 1s ease-in-out infinite;
    cursor: wait;
    opacity: 0.7;
}

body.dark-theme .refresh-btn.loading {
    animation: refresh-pulse 1s ease-in-out infinite;
}

@keyframes refresh-pulse {
    0%, 100% {
        background-color: var(--bg-secondary);
        border-color: var(--border-medium);
    }
    50% {
        background-color: var(--bg-hover);
        border-color: var(--status-info);
    }
}

/* ============================================
   SEARCH INPUT
   ============================================ */

.search-input {
    width: 100%;
    padding: 7px 12px 7px 36px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--status-info);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

/* ============================================
   FILTER TABS
   ============================================ */

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-hover);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--border-medium) transparent; /* Firefox */
}

/* Custom scrollbar for webkit browsers */
.filter-tabs::-webkit-scrollbar {
    height: 6px;
}

.filter-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.filter-tabs::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.filter-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

.filter-tab {
    padding: 5px 12px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    color: var(--text-secondary);
}

.filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-light);
}

/* "More" button for role filter expansion */
.filter-tab-more {
    background: transparent;
    color: var(--text-tertiary);
    font-size: 11px;
    padding: 5px 8px;
    border: 1px dashed var(--border-light);
}

.filter-tab-more:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-style: solid;
}

/* Extra filter tabs - hidden by default */
.filter-tab-extra {
    display: none !important;
}
.filter-tab-extra.expanded {
    display: inline-flex !important;
}

/* Compact filter buttons */
.filter-tab-compact {
    padding: 5px 10px;
    font-size: 11px;
    min-width: auto;
}

/* No managers filter button - always show border like active state */
#no-managers-filter-btn {
    border: 1px solid var(--border-medium) !important;
    box-shadow: var(--shadow-sm);
}

#no-managers-filter-btn:hover {
    border-color: var(--border-dark) !important;
}

#no-managers-filter-btn.active {
    background: var(--bg-secondary);
    border-color: var(--border-dark) !important;
}

/* Stage filter button - always show border like active state */
#chat-stage-filter-btn .filter-tab-compact {
    border: 1px solid var(--border-medium) !important;
    box-shadow: var(--shadow-sm);
}

#chat-stage-filter-btn .filter-tab-compact:hover {
    border-color: var(--border-dark) !important;
}

/* Stage filter dropdown option styles */
.stage-filter-option:hover {
    background: var(--bg-hover) !important;
}

.stage-filter-option.active {
    background: var(--bg-hover) !important;
    font-weight: 600;
}

.filter-tab[data-filter="red"]:hover,
.filter-tab[data-filter="red"].active {
    background: #ffeef0;
    border-color: #ffc1c1;
}

.filter-tab[data-filter="red"].active {
    color: #d73a49;
}

.filter-tab[data-filter="yellow"]:hover,
.filter-tab[data-filter="yellow"].active {
    background: #fffbdd;
    border-color: #ffe599;
}

.filter-tab[data-filter="yellow"].active {
    color: #b08800;
}

.filter-tab[data-filter="green"]:hover,
.filter-tab[data-filter="green"].active {
    background: #e6ffe6;
    border-color: #b3f0b3;
}

.filter-tab[data-filter="green"].active {
    color: #22863a;
}

.filter-tab .count {
    margin-left: 4px;
    opacity: 0.7;
}

/* ============================================
   REQUEST CARDS
   ============================================ */

.request-card {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
    padding: 14px;
    transition: all 0.15s ease;
    border-left: 3px solid #d1d5da;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.request-card:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary);
}

.request-card.clickable {
    cursor: pointer;
}

.request-card.has-green {
    border-left-color: var(--status-success);
}

.request-card.has-yellow {
    border-left-color: #ffd33d;
}

.request-card.has-red {
    border-left-color: #d73a49;
}

.sla-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d73a49;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.chat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.priority-inline {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 4px;
}

.priority-dot.red {
    background: #d73a49;
}

.priority-dot.yellow {
    background: #ffd33d;
}

.priority-dot.green {
    background: var(--status-success);
}

.priority-dot.sla {
    background: #d73a49;
}

.card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.requester {
    font-weight: 500;
    color: var(--status-info);
}

.time-ago {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   BREACH CARDS
   ============================================ */

.breach-card {
    background: #ffeef0;
    border-radius: 6px;
    border: 1px solid #ffc1c1;
    padding: 14px;
    border-left: 3px solid #d73a49;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.breach-card:hover {
    box-shadow: 0 2px 8px rgba(215, 58, 73, 0.15);
    background: var(--bg-secondary);
    border-color: var(--status-danger);
}

/* History cards have blue glow instead of red */
.breach-card.history:hover {
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.15);
    border-color: var(--status-info);
}

.breach-card.clickable {
    cursor: pointer;
}

.breach-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.breach-chat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.breach-time {
    color: #d73a49;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    margin-left: 10px;
    text-align: right;
}

.breach-time-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.breach-message-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 8px 0 0 0;
    padding: 8px 10px;
    background: var(--bg-tertiary, rgba(0,0,0,0.03));
    border-radius: 6px;
    word-break: break-word;
}

.breach-message-inline {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 8px 0 0 0;
    padding: 6px 8px;
    background: var(--bg-tertiary, rgba(0,0,0,0.03));
    border-radius: 5px;
    word-break: break-word;
    font-style: italic;
}

.breach-managers-inline {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    line-height: 1.3;
}

.breach-managers-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.breach-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.breach-requester {
    font-weight: 500;
    color: var(--status-info);
}

.breach-exceeded {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.breach-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.breach-created {
    font-size: 11px;
    color: var(--text-tertiary);
}

.breach-priority-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breach-priority-badge.red {
    background: rgba(215, 58, 73, 0.15);
    color: #d73a49;
}

.breach-priority-badge.yellow {
    background: rgba(255, 193, 7, 0.15);
    color: #d97706;
}

/* AM SLA Breach Card Styles */
.breach-chat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.breach-chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.breach-priority {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.breach-elapsed {
    font-size: 14px;
    font-weight: 700;
    color: #d73a49;
}

.breach-card.warning .breach-elapsed {
    color: #d97706;
}

/* SLA Title Switcher */
.section-title-with-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sla-title-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sla-title-option {
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.4;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.sla-title-option:hover {
    opacity: 0.7;
}

.sla-title-option.active {
    opacity: 1;
}

.sla-title-divider {
    color: var(--text-tertiary);
    opacity: 0.3;
    font-weight: 400;
}

.sla-history-period-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-hover);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.sla-period-btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    color: var(--text-secondary);
}

.sla-period-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sla-period-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-medium);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* History breach card styling */
.breach-card.history {
    background: #f0f4ff;
    border-color: #c1d5ff;
    border-left-color: var(--status-info);
}

body.dark-theme .breach-card.history {
    background: rgba(3, 102, 214, 0.12);
    border-color: rgba(3, 102, 214, 0.3);
    border-left-color: var(--status-info);
}

.breach-card.history:hover {
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.15);
    border-color: var(--status-info);
}

/* ============================================
   MANAGERS POPUP
   ============================================ */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.popup-overlay.active {
    opacity: 1;
}

.managers-popup {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.popup-overlay.active .managers-popup {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.popup-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.popup-content {
    padding: 20px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
}

.popup-subtitle {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.popup-content .managers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.manager-item.unavailable {
    opacity: 0.7;
    background: rgba(150, 150, 150, 0.08);
    border-color: rgba(150, 150, 150, 0.3);
}

.manager-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.manager-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.break-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 193, 7, 0.2);
    color: #f59f00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-right: 4px;
}

.working-hours-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(150, 150, 150, 0.2);
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.manager-role {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.manager-role.top-manager {
    background: rgba(3, 102, 214, 0.15);
    color: var(--status-info);
}

.manager-role.manager {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.manager-role.account-manager {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.assigned-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-right: 4px;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state.compact {
    padding: 24px 20px;
}

.empty-state-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state.compact .empty-state-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state.compact h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
}

.empty-state.compact p {
    font-size: 12px;
}

.error-message {
    background: rgba(220, 53, 69, 0.08);
    border-left: 4px solid var(--status-danger);
    padding: 12px 16px;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
}

body.dark-theme .error-message {
    background: rgba(248, 81, 73, 0.15);
    border-left-color: var(--status-danger);
    color: #ff7b72;
}

/* ============================================
   CHAT OVERVIEW CARDS (Page 2)
   ============================================ */

.chat-overview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.15s ease;
    border-left: 3px solid var(--border-medium);
    text-decoration: none;
    color: inherit;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.chat-overview-card:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--text-tertiary);
}

.chat-overview-card.clickable {
    cursor: pointer;
}

.chat-overview-card.active {
    border-left-color: var(--status-success);
}

.chat-overview-card.recent {
    border-left-color: #ffd33d;
}

.chat-overview-card.stale {
    border-left-color: #fb8532;
}

.chat-overview-card.inactive {
    border-left-color: #959da5;
}

.chat-overview-card.chat-paused {
    opacity: 0.4;
    filter: grayscale(70%) brightness(0.9);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.chat-overview-card.chat-paused:hover {
    opacity: 0.55;
    filter: grayscale(60%) brightness(0.95);
}

/* Multi-Select Mode Styles */
.multi-select-btn {
    padding: 5px 10px;
    font-size: 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.multi-select-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

#bc-fab.multi-select-btn:hover {
    background: var(--accent-primary);
    opacity: 0.85;
    border-color: var(--accent-primary);
}

.multi-select-btn.active {
    background: var(--status-info);
    color: white;
    border-color: var(--status-info);
}

.chat-overview-card.multi-select-mode {
    cursor: pointer;
    position: relative;
}

.chat-overview-card.multi-select-mode::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    background: var(--bg-secondary);
    z-index: 10;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.chat-overview-card.multi-select-mode.selected::before {
    background: var(--status-info);
    border-color: var(--status-info);
}

.chat-overview-card.multi-select-mode.selected::after {
    content: '\2713';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    z-index: 11;
    line-height: 1;
}

.chat-overview-card.multi-select-mode .chat-overview-header {
    padding-left: 30px;
}

/* Floating Bulk Action Toolbar */
.bulk-action-toolbar {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    max-width: 95%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    animation: slideUp 0.3s ease forwards;
}

.bulk-action-toolbar .selected-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.bulk-action-toolbar .bulk-actions {
    display: flex;
    gap: 4px;
}

.bulk-action-btn {
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-medium);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    white-space: nowrap;
}

.bulk-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.bulk-action-btn.primary {
    background: var(--status-info);
    color: white;
    border-color: var(--status-info);
}

.bulk-action-btn.primary:hover {
    background: #0256b9;
}

.bulk-action-btn.danger {
    background: var(--status-danger);
    color: white;
    border-color: var(--status-danger);
}

.bulk-action-btn.danger:hover {
    background: #c82333;
}

.bulk-cancel-btn {
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.bulk-cancel-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.dark-theme .bulk-action-toolbar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ============================================
   BROADCAST / SEND PAGE STYLES
   ============================================ */

.bc-fmt-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.bc-fmt-btn:active { background: var(--bg-hover); }

.bc-preset-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}
.bc-preset-btn.bc-preset-active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.bc-preset-btn.bc-type-active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.bc-chat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.bc-chat-row:active { background: var(--bg-hover); }
.bc-chat-row:last-child { border-bottom: none; }

.bc-chat-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--accent-primary);
}

.bc-chat-title {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bc-chat-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.bc-chat-badge.active { background: rgba(40,167,69,0.1); color: #22863a; }
.bc-chat-badge.paused { background: rgba(255,193,7,0.1); color: #b08800; }
body.dark-theme .bc-chat-badge.active { color: #3fb950; }
body.dark-theme .bc-chat-badge.paused { color: #d29922; }

.bc-send-button {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.bc-send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.bc-send-button.sending {
    opacity: 0.7;
    cursor: wait;
}

.bc-result-filter {
    padding: 4px 10px;
    font-size: 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}
.bc-result-filter.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.bc-result-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}
.bc-result-row:last-child { border-bottom: none; }
.bc-result-row .bc-result-icon { flex-shrink: 0; font-size: 14px; }
.bc-result-row .bc-result-title { flex: 1; color: var(--text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-result-row .bc-result-error { font-size: 11px; color: var(--status-danger); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bc-summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
.bc-summary-card .bc-summary-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.bc-summary-card .bc-summary-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.bc-retry-button {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    background: var(--status-warning);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.bc-history-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s ease;
}
.bc-history-item:hover { background: var(--bg-hover); }
.bc-history-item:last-child { border-bottom: none; }
.bc-history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.bc-history-id { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.bc-history-status { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.bc-history-status.completed { background: rgba(40,167,69,0.1); color: #22863a; }
.bc-history-status.failed { background: rgba(220,53,69,0.1); color: #dc3545; }
.bc-history-status.cancelled { background: rgba(108,117,125,0.1); color: #6c757d; }
.bc-history-status.pending, .bc-history-status.queued, .bc-history-status.running, .bc-history-status.pending_confirmation { background: rgba(0,123,255,0.1); color: #007bff; }
.bc-history-status.expired { background: rgba(108,117,125,0.1); color: #6c757d; }
body.dark-theme .bc-history-status.completed { color: #3fb950; }
body.dark-theme .bc-history-status.failed { color: #f85149; }
body.dark-theme .bc-history-status.cancelled, body.dark-theme .bc-history-status.expired { color: #8b949e; }
body.dark-theme .bc-history-status.pending, body.dark-theme .bc-history-status.queued, body.dark-theme .bc-history-status.running, body.dark-theme .bc-history-status.pending_confirmation { color: #58a6ff; }
.bc-history-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.bc-history-msg { font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bc-history-stats { font-size: 11px; color: var(--text-secondary); margin-top: 4px; display: flex; gap: 12px; }
.bc-history-detail { display: none; margin-top: 8px; border-top: 1px solid var(--border-light); padding-top: 8px; }
.bc-history-detail.open { display: block; }
.bc-detail-loading { text-align: center; padding: 10px; color: var(--text-tertiary); font-size: 11px; }
.bc-detail-list { max-height: 200px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.bc-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 11px; border-bottom: 1px solid var(--border-light); }
.bc-detail-row:last-child { border-bottom: none; }
.bc-detail-chat { color: var(--text-primary); font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 8px; }
.bc-detail-status { flex-shrink: 0; font-size: 10px; padding: 1px 6px; border-radius: 3px; }
.bc-detail-status.sent { background: rgba(40,167,69,0.1); color: #22863a; }
.bc-detail-status.failed { background: rgba(220,53,69,0.1); color: #dc3545; }
body.dark-theme .bc-detail-status.sent { color: #3fb950; }
body.dark-theme .bc-detail-status.failed { color: #f85149; }
.bc-detail-error { font-size: 10px; color: var(--text-tertiary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-detail-empty { text-align: center; padding: 10px; color: var(--text-tertiary); font-size: 11px; }

/* ============================================
   CHAT OVERVIEW HEADER & META
   ============================================ */

.chat-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.chat-overview-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.activity-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

.activity-badge.active {
    background: rgba(40, 167, 69, 0.08);
    color: #22863a;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.activity-badge.recent {
    background: rgba(255, 193, 7, 0.08);
    color: #b08800;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.activity-badge.stale {
    background: rgba(255, 152, 0, 0.08);
    color: #a04100;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.activity-badge.inactive {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.chat-overview-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-label {
    font-weight: 600;
}

.managers-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.manager-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: fit-content;
    white-space: nowrap;
    /* Default style for non-functional/unknown roles */
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.manager-badge.top-manager {
    background: rgba(3, 102, 214, 0.08);
    color: #0366d6;
    border: 1px solid rgba(3, 102, 214, 0.2);
}

.manager-badge.account-manager {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.manager-badge.support-manager {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.manager-badge.whitelisted-user {
    background: rgba(251, 191, 36, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.role-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.3px;
}

/* Unassigned Manager Badge */
.manager-badge.manager-unassigned {
    opacity: 0.4;
    filter: grayscale(60%);
    position: relative;
}

.manager-badge.manager-unassigned::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
}

/* ============================================
   AM CARD STYLES
   ============================================ */

.am-card {
    border-left-width: 4px;
    border-left-color: var(--status-info);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* AM SLA Urgency Colors */
.am-card.am-urgency-green {
    border-left-color: #28a745;
}

.am-card.am-urgency-yellow {
    border-left-color: #ffc107;
}

.am-card.am-urgency-red {
    border-left-color: #dc3545;
}

.am-card.am-urgency-blue {
    border-left-color: #007bff;
}

.am-card.stage-warning {
    border-left-color: var(--status-warning);
    background: rgba(255, 193, 7, 0.03);
}

.stage-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

.stage-badge.stage-1 {
    background: rgba(3, 102, 214, 0.08);
    color: #0366d6;
    border: 1px solid rgba(3, 102, 214, 0.2);
}

.stage-badge.stage-2 {
    background: rgba(251, 191, 36, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.stage-badge.stage-3 {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stage-badge.stage-4 {
    background: rgba(40, 167, 69, 0.08);
    color: #22863a;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.stage-badge.stage-5 {
    background: rgba(0, 123, 255, 0.08);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

/* LIVE badge clickable style */
.stage-badge.stage-5.live-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stage-badge.stage-5.live-clickable:hover {
    background: rgba(0, 123, 255, 0.15);
    transform: scale(1.05);
}

.stage-badge.stage-5.live-clickable:active {
    transform: scale(0.98);
}

/* LIVE card styles */
.am-card-live {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.02) 0%, rgba(40, 167, 69, 0.02) 100%);
}

.live-status-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 12px 0;
    padding: 8px 12px;
    background: rgba(40, 167, 69, 0.08);
    border-radius: 8px;
    text-align: center;
}

.am-activity-live {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.am-activity-live .am-activity-item {
    flex: 1;
    min-width: 100px;
}

.stage-progress {
    display: flex;
    align-items: center;
    margin: 12px 0;
    padding: 0 8px;
}

.stage-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-hover);
    color: var(--text-tertiary);
    border: 2px solid var(--border-medium);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.stage-step:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stage-step.active {
    background: rgba(3, 102, 214, 0.08);
    color: #0366d6;
    border-color: #0366d6;
}

.stage-step.active:hover {
    background: rgba(3, 102, 214, 0.15);
}

.stage-step.current {
    background: #0366d6;
    color: white;
    border-color: #0366d6;
    box-shadow: 0 0 0 4px rgba(3, 102, 214, 0.15);
}

.stage-step.current:hover {
    background: #0052a3;
}

/* Stage urgency colors for current stage bubble */
.stage-step.current.stage-urgency-green {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

.stage-step.current.stage-urgency-yellow {
    background: #ffc107;
    border-color: #ffc107;
    color: #000;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.15);
}

.stage-step.current.stage-urgency-red {
    background: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

.stage-step.current.stage-urgency-blue {
    background: #007bff;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}

.stage-connector {
    flex: 1;
    height: 2px;
    background: var(--border-medium);
    margin: 0 4px;
    transition: background 0.3s ease;
}

.stage-connector.active {
    background: #0366d6;
}

.am-metrics {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 6px;
}

.am-metric {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.am-metric-icon {
    font-size: 18px;
}

.am-metric-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.am-metric-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.am-metric-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.am-activity {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.am-activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.am-activity-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.am-activity-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* vs Average status colors */
.am-activity-value.vs-avg-fast {
    color: #28a745;
}
.am-activity-value.vs-avg-good {
    color: #20c997;
}
.am-activity-value.vs-avg-normal {
    color: var(--text-primary);
}
.am-activity-value.vs-avg-warning {
    color: #ffc107;
}
.am-activity-value.vs-avg-slow {
    color: #dc3545;
}
.am-activity-value.vs-avg-none {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Chat Notes */
.am-note {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-primary);
}

.am-note-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.am-note-add {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

.am-note-btn {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.am-note-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Note Modal */
.note-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

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

.note-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.note-modal-overlay.active .note-modal {
    transform: scale(1);
}

.note-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.note-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
}

.note-modal-body {
    padding: 20px;
}

.note-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.note-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.note-char-count {
    text-align: right;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.note-char-count.warning {
    color: #ffc107;
}

.note-char-count.error {
    color: #dc3545;
}

.note-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.note-btn-save {
    padding: 8px 20px;
    background: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.note-btn-save:hover {
    background: #0056b3;
}

.note-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.note-btn-cancel {
    padding: 8px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.note-btn-delete {
    padding: 8px 16px;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-right: auto;
}

.note-btn-delete:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* ============================================
   SORT CONTROLS
   ============================================ */

.sort-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.sort-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-buttons {
    display: flex;
    gap: 4px;
    background: var(--bg-hover);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.sort-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
}

.sort-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Sort Toggle Button - matches filter-tab dimensions */
.sort-toggle-btn {
    padding: 5px 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    min-width: 44px;
    text-align: center;
}

.sort-toggle-btn:hover {
    background: var(--bg-hover);
}

.sort-toggle-btn:active {
    transform: scale(0.98);
}

/* ============================================
   DATE FILTER TABS
   ============================================ */

.date-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--bg-hover);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.date-filter-btn {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    white-space: nowrap;
}

.date-filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.date-filter-btn.active {
    background: var(--status-info);
    color: white;
}

/* ============================================
   EXPORT PDF BUTTON
   ============================================ */

.export-pdf-btn {
    padding: 7px 16px;
    border: 1px solid var(--border-medium);
    background: var(--status-info);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.export-pdf-btn:hover {
    background: #0256c2;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.export-pdf-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.export-pdf-btn.loading {
    opacity: 0.7;
    cursor: wait;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Dark theme adjustments */
body.dark-theme .export-pdf-btn {
    background: var(--status-info);
}

body.dark-theme .export-pdf-btn:hover {
    background: #4493f8;
}

/* Mobile: compact date filter buttons and stack export button */
@media (max-width: 600px) {
    .date-filter-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .export-pdf-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.15s ease;
}

.breach-card {
    background: rgba(215, 58, 73, 0.08);
    border: 1px solid rgba(215, 58, 73, 0.2);
    border-left: 3px solid var(--status-danger);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card-detail {
    font-size: 11px;
    color: #959da5;
    margin-top: 8px;
}

/* ============================================
   MANAGER PERFORMANCE CARDS
   ============================================ */

.manager-perf-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.manager-perf-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
    transform: translateY(-2px);
}

.manager-perf-card::after {
    content: '\270F\FE0F';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.manager-perf-card:hover::after {
    opacity: 0.6;
}

.manager-perf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    padding-right: 24px;
    border-bottom: 1px solid var(--border-light);
}

.manager-perf-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.manager-perf-role {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.manager-perf-role.top {
    background: rgba(3, 102, 214, 0.08);
    color: #0366d6;
    border: 1px solid rgba(3, 102, 214, 0.2);
}

.manager-perf-role.support {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.manager-perf-role.account {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.manager-perf-role.whitelisted {
    background: rgba(251, 191, 36, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.manager-perf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.manager-perf-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.manager-perf-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.manager-perf-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.manager-perf-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.manager-perf-meta-item {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.manager-perf-meta-item strong {
    color: var(--text-primary);
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

/* Employee settings modal should appear above employee database modal */
#manager-settings-modal {
    z-index: 10001;
}

/* Vacation modal should appear above all other modals */
#vacation-modal {
    z-index: 10002;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--status-info);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.form-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--status-info);
}

.checkbox-item label {
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 48px;
    height: 26px;
    appearance: none;
    background: var(--border-medium);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid var(--border-light);
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--status-info);
}

.toggle-switch input[type="checkbox"]:checked::before {
    transform: translateX(22px);
}

.toggle-switch-label {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-helper {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Role Options in Modal */
.role-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.role-option:hover:not(.disabled) {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.role-option.active {
    background: var(--bg-hover);
    border-color: var(--status-info);
    box-shadow: 0 0 0 1px var(--status-info);
}

.role-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.role-option-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.role-option-content {
    flex: 1;
}

.role-option-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.role-option-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.role-option-check {
    font-size: 18px;
    color: var(--status-info);
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.role-option.active .role-option-check {
    opacity: 1;
}

/* "Show More" button in role switcher */
.role-option-more {
    background: var(--bg-hover);
    border-style: dashed;
    border-color: var(--border-light);
}

.role-option-more:hover {
    background: var(--bg-active);
    border-color: var(--border-medium);
}

.role-option-more .role-option-icon {
    font-size: 16px;
    color: var(--text-tertiary);
}

.role-option-more .role-option-name {
    color: var(--text-secondary);
}

/* Extra role options - hidden by default */
.role-option-extra {
    display: none !important;
}
.role-option-extra.expanded {
    display: flex !important;
}

/* ============================================
   CSV DROPDOWN (Mobile)
   ============================================ */

.csv-dropdown-mobile {
    display: none;
    position: relative;
}

.csv-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

.csv-dropdown-menu.show {
    display: block;
}

.csv-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.csv-dropdown-menu button:hover {
    background: var(--bg-tertiary);
}

.csv-dropdown-menu button:first-child {
    border-bottom: 1px solid var(--border-light);
}

/* Only show border if there are multiple items */
.csv-dropdown-menu button:only-child {
    border-bottom: none;
}

/* Schedule CSV dropdown for mobile */
.schedule-csv-dropdown-mobile {
    display: none;
    position: relative;
}

.db-btn-compact {
    padding: 6px 12px !important;
    min-width: auto !important;
    font-size: 14px;
}

/* ============================================
   TABLE STYLES (Employee Database)
   ============================================ */

.db-search-box {
    padding: 6px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
}

.db-search-box:focus {
    outline: none;
    border-color: var(--status-info);
}

.db-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-secondary);
}

.db-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-tertiary);
}

.db-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-medium);
    border-right: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
    position: relative;
}

.db-table th:hover {
    background: var(--bg-hover);
}

.db-table th:last-child {
    border-right: none;
}

.db-sort-indicator {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    opacity: 0.5;
}

.db-sort-indicator.active {
    opacity: 1;
    color: var(--status-info);
}

.db-table tbody tr {
    transition: background 0.1s;
}

.db-table tbody tr:hover {
    background: var(--bg-hover);
}

.db-table tbody tr.selected {
    background: rgba(3, 102, 214, 0.1);
}

.db-table tbody tr.unsaved {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
}

.db-table tbody tr.inactive {
    opacity: 0.5;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 0, 0, 0.02) 10px,
        rgba(255, 0, 0, 0.02) 20px
    );
}

.db-table tbody tr.inactive .db-cell {
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.db-table td {
    padding: 0;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    position: relative;
}

.db-table td:last-child {
    border-right: none;
}

.db-cell {
    padding: 10px 16px;
    min-height: 42px;
    cursor: text;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-cell:focus {
    background: var(--bg-secondary);
    box-shadow: inset 0 0 0 2px var(--status-info);
    z-index: 5;
    position: relative;
}

.db-cell:empty:before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    font-style: italic;
}

/* Dropdown select styling for department */
select.db-select {
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

select.db-select:focus {
    background-color: var(--bg-secondary);
    box-shadow: inset 0 0 0 2px var(--status-info);
}

select.db-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px;
}

.db-row-number {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    font-weight: 500;
    user-select: none;
    cursor: pointer;
    min-width: 50px;
}

.db-row-number:hover {
    background: var(--bg-hover);
}

.db-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.db-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.db-empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.db-empty-subtext {
    font-size: 14px;
}

.db-filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    min-width: 120px;
}

.db-filter-select:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.db-filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

/* ============================================
   BUTTONS (General)
   ============================================ */

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 110px;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--status-info);
    color: white;
}

.btn-primary:hover {
    background: #0256c2;
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Delete Button */
.btn-danger {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-danger:hover {
    background: var(--bg-hover);
}

/* ============================================
   TAGS
   ============================================ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--status-info);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag-remove {
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-small {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
    gap: 4px;
}

/* Quick-select tag buttons in modal */
#modal-quick-tags .filter-tab {
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#modal-quick-tags .filter-tab:not(.active) {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

#modal-quick-tags .filter-tab:not(.active):hover {
    background: var(--bg-active);
    border-color: var(--border-medium);
}

#modal-quick-tags .filter-tab.active {
    background: var(--status-info);
    color: white;
    border-color: var(--status-info);
}

.quick-tag-delete {
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 0 2px;
    border-radius: 3px;
}

.quick-tag-delete:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    color: var(--status-danger);
}

.quick-tag-btn.active .quick-tag-delete:hover,
.filter-tab.active .quick-tag-delete:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ============================================
   TIMEZONE PREVIEW
   ============================================ */

.timezone-preview {
    margin-top: 8px;
    padding: 10px;
    background: var(--bg-hover);
    border-radius: 4px;
    border-left: 3px solid var(--accent-primary);
    font-size: 13px;
    line-height: 1.6;
}

.timezone-preview-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.timezone-preview-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.timezone-preview-time {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.timezone-preview-diff {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-primary);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.manager-time-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.manager-time-diff {
    color: var(--text-tertiary);
    font-size: 11px;
}

.clickable-stat {
    cursor: pointer;
    position: relative;
}

.clickable-stat::after {
    content: '\1F50D';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clickable-stat:hover::after {
    opacity: 0.6;
}

.clickable-stat:hover {
    background: var(--bg-hover);
    border-radius: 4px;
}

/* Custom scrollbar for break history modal */
#break-history-content::-webkit-scrollbar {
    width: 8px;
}

#break-history-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

#break-history-content::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

#break-history-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   CUSTOM CONFIRMATION MODAL
   ============================================ */

.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.custom-confirm-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-confirm-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.custom-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.custom-confirm-body {
    padding: 20px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.custom-confirm-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.custom-confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-confirm-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.custom-confirm-btn-cancel:hover {
    background: var(--bg-hover);
}

.custom-confirm-btn-confirm {
    background: var(--status-info);
    color: white;
}

.custom-confirm-btn-confirm:hover {
    background: #0256c2;
}

.custom-confirm-btn-confirm.danger {
    background: var(--status-danger);
}

.custom-confirm-btn-confirm.danger:hover {
    background: #c82333;
}

/* ============================================
   ADD / BATCH MANAGER BUTTONS
   ============================================ */

.add-manager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--status-info);
    color: white;
    border: none;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    padding: 0;
    vertical-align: middle;
}

.add-manager-btn:hover {
    background: #0256c2;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.3);
}

.add-manager-btn:active {
    transform: scale(0.95);
}

.batch-manager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--status-success);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 6px;
    padding: 0;
    vertical-align: middle;
}

.batch-manager-btn:hover {
    background: #28a745;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.batch-manager-btn:active {
    transform: scale(0.95);
}

/* Batch Modal specific styles */
.batch-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.batch-textarea:focus {
    outline: none;
    border-color: var(--status-info);
}

/* ============================================
   PERFORMANCE LEADERBOARD
   ============================================ */

.leaderboard-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.leaderboard-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-hover);
    transition: all 0.15s ease;
}

.leaderboard-item:hover {
    background: var(--bg-tertiary);
}

.leaderboard-rank {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    width: 32px;
    text-align: center;
}

.leaderboard-rank.top-1 {
    color: #d4af37;
}

.leaderboard-rank.top-2 {
    color: #c0c0c0;
}

.leaderboard-rank.top-3 {
    color: #cd7f32;
}

.leaderboard-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 12px;
}

.leaderboard-bar-container {
    flex: 2;
    height: 32px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 12px;
}

.leaderboard-bar {
    height: 100%;
    display: flex;
    transition: width 0.5s ease;
    position: relative;
}

.leaderboard-bar-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
    min-width: 20px;
}

.leaderboard-bar-segment:not(:last-child) {
    border-right: 1px solid rgba(255,255,255,0.3);
}

.leaderboard-bar-segment.green {
    background: var(--gradient-success);
}

.leaderboard-bar-segment.yellow {
    background: var(--gradient-warning);
    color: var(--text-primary);
}

.leaderboard-bar-segment.red {
    background: var(--gradient-danger);
}

.leaderboard-bar-segment:hover {
    filter: brightness(1.1);
    transform: scaleY(1.05);
}

.segment-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #24292e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
    z-index: 10;
}

.leaderboard-bar-segment:hover .segment-tooltip {
    opacity: 1;
}

.leaderboard-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

/* ============================================
   ACTIVITY HEATMAP
   ============================================ */

.activity-heatmap-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
    margin-top: 40px;
}

.activity-heatmap-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.heatmap-bars-container {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 250px;
    padding: 30px 0 10px 0;
    background: var(--gradient-heatmap-bg);
}

.heatmap-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.heatmap-bar-wrapper.clickable-bar {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.heatmap-bar-wrapper.clickable-bar:hover {
    transform: translateY(-2px);
}

.heatmap-bar-wrapper.clickable-bar:active {
    transform: translateY(0);
}

.heatmap-bar {
    width: 100%;
    background: var(--gradient-chart-normal);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 4px;
    box-shadow: 0 -1px 3px rgba(3, 102, 214, 0.2);
    z-index: 1;
}

.heatmap-bar:hover {
    background: var(--gradient-chart-normal-hover);
    transform: scaleY(1.05);
    transform-origin: bottom;
    z-index: 10;
}

.clickable-bar .heatmap-bar:hover {
    box-shadow: 0 -2px 8px rgba(3, 102, 214, 0.4);
}

.heatmap-bar.peak {
    background: var(--gradient-chart-peak);
}

.heatmap-bar.low {
    background: var(--gradient-chart-low);
}

.heatmap-bar.none {
    background: var(--border-light);
    min-height: 2px;
}

.heatmap-hour-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    transform: rotate(-45deg);
    transform-origin: center;
    width: 30px;
    text-align: center;
    margin-top: 4px;
}

.heatmap-count-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #24292e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
    z-index: 9999;
}

.heatmap-bar:hover .heatmap-count-tooltip {
    opacity: 1;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.heatmap-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.heatmap-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* ============================================
   SCHEDULE VIEW STYLES
   ============================================ */

.db-view-tabs {
    display: flex;
    gap: 0;
    margin-left: 20px;
}

.db-view-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.db-view-tab:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.db-view-tab:last-child {
    border-radius: 0 6px 6px 0;
}

.db-view-tab.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff !important;
}

.db-view-tab:hover:not(.active) {
    background: var(--bg-tertiary);
}

/* Team tabs for schedule view */
.schedule-team-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.schedule-team-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.schedule-team-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.schedule-team-tab:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Date range controls */
.schedule-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.schedule-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-nav-btn {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.schedule-nav-btn:hover {
    background: var(--bg-tertiary);
}

.schedule-month-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
    text-align: center;
}

.schedule-date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-date-input {
    padding: 6px 10px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
}

.schedule-legend {
    display: none;
    gap: 16px;
    margin-left: auto;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.working { background: #22c55e; }
.legend-color.off { background: #6b7280; }
.legend-color.vacation { background: #f59e0b; }
.legend-color.covering { background: #3b82f6; }

/* Schedule grid cells */
.schedule-header-cell {
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.schedule-header-cell.weekend {
    background: var(--bg-tertiary);
}

.schedule-header-cell.name-col {
    position: sticky;
    left: 0;
    z-index: 20;
    min-width: 150px;
    text-align: left;
    padding-left: 12px;
}

.schedule-header-day {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-header-weekday {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.schedule-cell {
    padding: 6px 4px;
    text-align: center;
    font-size: 11px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    min-width: 50px;
    position: relative;
}

.schedule-cell.clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.schedule-cell.clickable:hover {
    background: rgba(59, 130, 246, 0.1);
}

.schedule-cell.name-col.clickable:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.schedule-cell.weekend {
    background: rgba(107, 114, 128, 0.1);
}

.schedule-cell.weekend.clickable:hover {
    background: rgba(59, 130, 246, 0.15);
}

.schedule-cell.name-col {
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    z-index: 5;
    text-align: left;
    padding-left: 12px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 150px;
}

.schedule-cell-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.schedule-shift {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.schedule-shift.working {
    background: rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

.schedule-shift.off {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.schedule-shift.vacation {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.schedule-shift.covering {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
}

.schedule-extra-info {
    font-size: 9px;
    color: var(--text-tertiary);
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Half-shift coverage badges */
.schedule-half-badge {
    display: inline-flex;
    align-items: center;
    font-size: 8px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 2px;
    vertical-align: middle;
}

.schedule-half-badge.first-half {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.3) 50%, transparent 50%);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.schedule-half-badge.second-half {
    background: linear-gradient(90deg, transparent 50%, rgba(139, 92, 246, 0.3) 50%);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.schedule-half-badge.custom-hours {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
    letter-spacing: -0.3px;
}

.schedule-coverage-row {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    color: var(--text-tertiary);
    max-width: 70px;
    overflow: hidden;
}

.schedule-coverage-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 45px;
}

.schedule-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.schedule-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.schedule-empty-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.schedule-empty-subtext {
    font-size: 13px;
    margin-top: 8px;
}

/* Pending save indicator */
tr.pending-save {
    background: rgba(59, 130, 246, 0.1) !important;
}

tr.pending-save td:first-child::before {
    content: '\2022';
    color: #3b82f6;
    font-weight: bold;
    margin-right: 4px;
}

/* Fix dark/light theme for schedule elements */
.schedule-header-cell.name-col {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.schedule-cell.name-col {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Fix view tab active state visibility */
.db-view-tab {
    background: var(--bg-secondary);
}

.db-view-tab.active {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

.db-view-tab:not(.active) {
    color: var(--text-primary);
}

.db-view-tab:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   ANIMATIONS & KEYFRAMES
   ============================================ */

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes fadeInPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Inline style from line 6206 */
@keyframes salesSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
