/* Take Five Healthcare Candidate Dashboard Styles - Updated Layout */

:root {
    --tf-primary: #0891b2;
    --tf-primary-dark: #0e7490;
    --tf-primary-light: #e0f2f4;
    --tf-accent: #1e293b;
    --tf-accent-light: #475569;
    --tf-success: #22c55e;
    --tf-warning: #f59e0b;
    --tf-danger: #ef4444;
    --tf-neutral: #64748b;
    --tf-bg: #f8fafc;
    --tf-surface: #ffffff;
    --tf-border: #e2e8f0;
    --tf-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --tf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Status colors for new 5-status system */
    --tf-status-active: #22c55e; /* Green */
    --tf-status-complete: #3b82f6; /* Blue */
    --tf-status-pending: #f59e0b; /* Orange/Yellow */
    --tf-status-incomplete: #ec4899; /* Pink */
    --tf-status-rejected: #ef4444; /* Red */
}

#tf-candidate-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--tf-bg);
    color: var(--tf-accent);
    line-height: 1.5;
}

/* Dashboard Header */
.tf-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--tf-primary) 0%, var(--tf-primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--tf-shadow-lg);
}

.tf-dashboard-header h1 {
    color: white !important;
    margin: 0 0 0.5rem 0;
    font-size: 2.25rem;
    font-weight: 700;
}

.tf-dashboard-header p {
    color: white;
    margin: 0;
    opacity: 0.9;
}

.tf-dashboard-stats {
    display: flex;
    gap: 2rem;
}

.tf-stat-item {
    text-align: center;
}

.tf-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.tf-stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.tf-dashboard-actions {
    display: flex;
    gap: 1rem;
}

.tf-refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.tf-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tf-refresh-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.tf-refresh-btn.loading .fa-sync-alt {
    animation: tf-spin 1s linear infinite;
}

/* Search and Filter Section */
.tf-search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--tf-surface);
    border-radius: 12px;
    border: 1px solid var(--tf-border);
    box-shadow: var(--tf-shadow);
}

/* Search row: input + advanced filter button side by side */
.tf-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

.tf-search-input {
    flex: 1 1 auto;
    min-width: 240px;
    max-width: 480px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tf-search-input:focus {
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

/* Advanced filter toggle button */
.tf-advanced-filter-btn {
    padding: 0.625rem 1rem;
    border: 1px solid var(--tf-primary);
    background: var(--tf-primary-light);
    color: var(--tf-primary-dark);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tf-advanced-filter-btn:hover {
    background: var(--tf-primary);
    color: white;
}

/* v3.13.0: Pressed-in look when a filter panel is open */
.tf-advanced-filter-btn.active {
    background: var(--tf-primary);
    color: white;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.tf-advanced-filter-btn.active .tf-filter-dot {
    background: white;
}

.tf-filter-dot {
    width: 8px;
    height: 8px;
    background: var(--tf-primary);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.tf-advanced-filter-btn:hover .tf-filter-dot {
    background: white;
}

/* Filter builder panel */
.tf-filter-builder {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    padding: 0.875rem;
}

.tf-filter-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tf-filter-builder-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--tf-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tf-logic-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tf-logic-label-text {
    font-size: 0.72rem;
    color: var(--tf-neutral);
}

.tf-logic-toggle {
    display: flex;
    border: 1px solid var(--tf-border);
    border-radius: 5px;
    overflow: hidden;
}

.tf-logic-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: var(--tf-surface);
    color: var(--tf-neutral);
    transition: all 0.15s ease;
}

.tf-logic-btn.active {
    background: var(--tf-primary);
    color: white;
}

/* Individual filter rule row */
.tf-filter-rule {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.tf-filter-rule-inner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
}

.tf-filter-rule-inner select,
.tf-filter-rule-inner input[type="text"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--tf-border);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--tf-bg);
    color: var(--tf-accent);
    min-width: 0; /* allow shrinking inside flex without overflow */
}

/* All three inputs (field / condition / value) share space equally */
.tf-filter-rule-inner > select,
.tf-filter-rule-inner > input[type="text"] {
    flex: 1 1 0;
}

.tf-filter-rule-logic {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--tf-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.tf-remove-rule-btn {
    width: 20px;
    height: 20px;
    background: #fee2e2;
    border: none;
    border-radius: 3px;
    color: #ef4444;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.tf-remove-rule-btn:hover {
    background: #ef4444;
    color: white;
}

/* Filter action buttons */
.tf-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.625rem;
    align-items: center;
}

.tf-add-rule-btn {
    font-size: 0.72rem;
    color: var(--tf-primary);
    background: none;
    border: 1px dashed var(--tf-primary);
    border-radius: 5px;
    padding: 0.28rem 0.65rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tf-add-rule-btn:hover {
    background: var(--tf-primary-light);
}

.tf-add-rule-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tf-clear-filters-btn {
    font-size: 0.72rem;
    color: var(--tf-neutral);
    background: none;
    border: 1px solid var(--tf-border);
    border-radius: 5px;
    padding: 0.28rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-clear-filters-btn:hover {
    background: var(--tf-border);
}

.tf-apply-filters-btn {
    font-size: 0.72rem;
    color: white;
    background: var(--tf-primary);
    border: none;
    border-radius: 5px;
    padding: 0.32rem 0.85rem;
    cursor: pointer;
    font-weight: 600;
    margin-left: auto;
    transition: background 0.2s ease;
}

.tf-apply-filters-btn:hover {
    background: var(--tf-primary-dark);
}

/* Active filter chips */
.tf-active-filter-chips {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    width: 100%;
}

.tf-chips-label {
    font-size: 0.7rem;
    color: var(--tf-neutral);
    font-weight: 500;
}

.tf-filter-chip {
    background: var(--tf-primary-light);
    color: var(--tf-primary-dark);
    border: 1px solid #bae6fd;
    border-radius: 20px;
    padding: 0.18rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: default;
}

.tf-chip-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.85rem;
    line-height: 1;
    border: none;
    background: none;
    color: var(--tf-primary-dark);
    padding: 0;
}

.tf-chip-remove:hover {
    opacity: 1;
}

.tf-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.tf-filter-tab {
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--tf-border);
    background: var(--tf-surface);
    color: var(--tf-neutral);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.tf-filter-tab:hover {
    background: var(--tf-primary-light);
    border-color: var(--tf-primary);
}

.tf-filter-tab.active {
    background: var(--tf-primary);
    border-color: var(--tf-primary);
    color: white;
}

/* Loading, Error, and Empty States */
.tf-loading {
    text-align: center;
    padding: 4rem;
    color: var(--tf-neutral);
}

.tf-spinner {
    border: 3px solid var(--tf-border);
    border-top: 3px solid var(--tf-primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: tf-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.tf-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.tf-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--tf-neutral);
}

.tf-empty-state p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Candidate Cards Grid - 2 columns */
.tf-candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(680px, 1fr));
    gap: 1.5rem;
    align-items: start; /* Prevent cards from stretching */
}

/* Individual Candidate Card - Reasonable height */
.tf-candidate-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    overflow: hidden; /* Keep overflow hidden to contain content */
    box-shadow: var(--tf-shadow);
    transition: all 0.3s ease;
    position: relative;
    max-height: 450px !important;
    height: 450px !important;
    min-height: 450px !important;
    display: flex;
    flex-direction: column;
}

/* Rejected candidates: add space for returner section */
.tf-candidate-card[data-status="rejected"] {
    height: 550px !important;
    max-height: 550px !important;
    min-height: 550px !important;
}

.tf-candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tf-shadow-lg);
}

/* Status Badge - Top Right Corner */
.tf-candidate-status {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-left: auto;
}

/* Returner Badge - Shows next to status for returners */
.tf-returner-badge {
    position: absolute;
    top: 1rem;
    right: 8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    background: #e0f2f4;
    color: #0e7490;
    border: 1px solid #0891b2;
}

/* Manual Entry Badge - similar to returner but different color */
.tf-manual-badge {
    position: absolute;
    top: 1rem;
    right: 8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* When both badges are present, stack them */
.tf-candidate-card[data-is-manual="1"][data-is-returner="1"] .tf-manual-badge {
    top: 1rem;
    right: 8rem;
}

.tf-candidate-card[data-is-manual="1"][data-is-returner="1"] .tf-returner-badge {
    top: 3.5rem; /* Position below manual badge */
    right: 8rem;
}


.tf-status-active {
    background: #dcfce7;
    color: #166534;
}

.tf-status-complete {
    background: #dbeafe;
    color: #1e40af;
}

.tf-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.tf-status-incomplete {
    background: #fce7f3;
    color: #be185d;
}

.tf-status-rejected {
    background: #fef2f2;
    color: #991b1b;
}

/* Candidate Header - Minimal padding */
/* v3.11.0: Bumped from 50px to 80px to fit name row + email + alt email + phone + candidate ID without vertical squish */
.tf-candidate-header {
    display: flex;
    align-items: flex-start; /* v3.12.0: align to top so text block starts from top of header instead of centered into tight bundle */
    padding: 0.65rem 0.75rem 0.5rem 0.75rem !important; /* v3.12.0: slightly more breathing room */
    gap: 0.5rem;
    height: 85px !important; /* v4.2.1: fits name + email + phone + candidate ID */
    max-height: 85px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important; /* v4.2.1: prevent content bleeding into progress bar */
}

.tf-candidate-avatar {
    width: 2rem !important;
    height: 2rem !important;
    background: var(--tf-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem !important;
    flex-shrink: 0;
    margin-top: 1px; /* v3.12.0: nudge to align with first text row */
}

/* v3.12.0: Stack the text rows vertically with proper spacing between them */
.tf-candidate-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
    display: flex;
    flex-direction: column;
    gap: 2px; /* small but visible gap between name/email/phone/ID rows */
    min-height: 0;
}

/* v3.8.1: name + notes button on one line */
.tf-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.tf-name-row h3 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600;
    color: var(--tf-accent);
    line-height: 1.25 !important; /* v3.12.0: was 1.1 — was crushing the descenders */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.tf-candidate-info h3 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600;
    color: var(--tf-accent);
    line-height: 1.25 !important; /* v3.12.0: was 1.1 */
}

.tf-candidate-email {
    color: var(--tf-neutral);
    font-size: 0.8rem !important;
    margin: 0 !important;
    line-height: 1.3 !important; /* v3.12.0: was 1.1 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-candidate-id {
    color: var(--tf-primary);
    font-size: 0.8rem !important;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.3 !important; /* v3.12.0: was 1.1 */
    margin: 0 !important;
}

/* Delete button - replaces avatar */
.tf-btn-delete-candidate {
    width: 2rem !important;
    height: 2rem !important;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

.tf-btn-delete-candidate:hover {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
    transform: scale(1.1);
}

.tf-btn-delete-candidate:active {
    transform: scale(0.95);
}

/* Progress Section - Minimal padding */
.tf-progress-section {
    padding: 0.25rem 0.75rem !important;
    height: 28px !important;
    max-height: 28px !important;
    flex-shrink: 0 !important; /* Prevent flex from shrinking this */
}

.tf-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    color: var(--tf-accent);
}

.tf-progress-bar {
    width: 100%;
    height: 3px !important; /* Thinner */
    background: #f1f5f9;
    border-radius: 2px;
    overflow: hidden;
}

.tf-progress-fill {
    height: 100%;
    background: var(--tf-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Steps List - Reasonable height to fit all items */
.tf-forms-list {
    padding: 0.25rem 0.75rem 0.5rem 0.75rem !important;
    max-height: 350px !important;
    height: 350px !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    margin: 0 !important;
    flex-shrink: 0 !important; /* Prevent flex from shrinking this */
}

/* Rejected candidates: keep same height - the card expands below this */
/* No change needed - forms list stays 180px */

/* Custom scrollbar styling */
.tf-forms-list::-webkit-scrollbar {
    width: 2px;
}

.tf-forms-list::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 1px;
}

.tf-forms-list::-webkit-scrollbar-thumb {
    background: var(--tf-primary);
    border-radius: 1px;
}

.tf-forms-list::-webkit-scrollbar-thumb:hover {
    background: var(--tf-primary-dark);
}

.tf-form-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0 !important; /* Minimal vertical padding */
    border-bottom: 1px solid #f8fafc;
    min-height: 24px !important; /* Much smaller height */
    margin: 0 !important;
}

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

/* Left side - Icon and details */
.tf-form-info {
    display: flex;
    align-items: center;
    gap: 0.3rem !important; /* Tiny gap */
    flex: 1;
    min-width: 0; /* Allow text truncation if needed */
}

.tf-form-icon {
    width: 1.2rem !important; /* Smaller icons */
    height: 1.2rem !important;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem !important; /* Smaller emoji */
    flex-shrink: 0;
}

.tf-form-icon.tf-form-completed {
    background: #dcfce7;
    color: #166534;
}

.tf-form-icon.tf-form-not_started {
    background: #f8fafc;
    color: var(--tf-neutral);
}

.tf-form-icon.tf-form-not_required {
    background: #f3f4f6;
    color: #9ca3af;
}

.tf-form-details {
    min-width: 0; /* Allow text truncation */
}

.tf-form-details h4 {
    margin: 0 !important;
    font-size: 0.8rem !important;
    font-weight: 600;
    color: var(--tf-accent);
    line-height: 1.1 !important;
    white-space: nowrap; /* Keep on one line */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ... if too long */
}

.tf-form-date {
    font-size: 0.7rem !important;
    color: var(--tf-neutral);
    line-height: 1.1 !important;
    margin: 0 !important;
    white-space: nowrap;
}

/* Right side - Action buttons or status */
.tf-form-actions,
.tf-form-link,
.tf-form-status {
    flex-shrink: 0;
}

/* Action buttons container for external provider steps */
.tf-form-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* External Provider Link Button - Icon only, compact */
.tf-btn-external-link {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.15rem 0.3rem !important;
    border-radius: 3px;
    font-size: 0.7rem !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.tf-btn-external-link .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.tf-btn-external-link:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.1);
}

.tf-btn-external-link:active {
    transform: translateY(0);
}

/* Take Action and View Entry Buttons - ULTRA COMPACT */
.tf-btn-take-action, .tf-btn-view-entry {
    background: #f97316;
    color: white;
    border: none;
    padding: 0.15rem 0.4rem !important; /* Ultra small padding */
    border-radius: 3px;
    font-size: 0.7rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tf-btn-view-entry {
    background: #3b82f6; /* Blue for View buttons */
}

.tf-btn-take-action:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.1);
}

.tf-btn-view-entry:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.1);
}

.tf-btn-take-action:active, .tf-btn-view-entry:active {
    transform: translateY(0);
}

/* Status indicators - ULTRA COMPACT */
.tf-status-completed {
    color: var(--tf-success);
    font-weight: 600;
    font-size: 0.7rem !important;
    text-transform: uppercase;
    white-space: nowrap;
}

.tf-status-incomplete {
    color: var(--tf-neutral);
    font-weight: 500;
    font-size: 0.7rem !important;
    text-transform: uppercase;
    white-space: nowrap;
}

.tf-form-status {
    flex-shrink: 0;
    min-width: fit-content;
}

/* Loading state for buttons */
.tf-form-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tf-form-link.loading {
    pointer-events: none;
    opacity: 0.7;
}

.tf-form-link.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: tf-spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tf-dashboard-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .tf-dashboard-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tf-search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .tf-search-input {
        min-width: auto;
    }
    
    .tf-filter-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tf-candidates-grid {
        grid-template-columns: 1fr;
    }
    
    .tf-candidate-card {
        margin: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .tf-dashboard-header {
        padding: 1.5rem;
    }
    
    .tf-dashboard-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tf-stat-number {
        font-size: 1.75rem;
    }
    
    .tf-filter-tabs {
        flex-direction: column;
    }
    
    .tf-filter-tab {
        text-align: center;
    }
    
    .tf-candidate-header {
        padding: 1rem;
    }
    
    .tf-forms-list {
        padding: 0 1rem 1rem 1rem;
    }
    
    .tf-form-item {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .tf-btn-take-action {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Focus states for accessibility */
.tf-search-input:focus,
.tf-filter-tab:focus,
.tf-btn-take-action:focus {
    outline: 2px solid var(--tf-primary);
    outline-offset: 2px;
}

/* Smooth transitions for status changes */
.tf-candidate-card[data-status="incomplete"] {
    border-left: 4px solid var(--tf-status-incomplete);
}

.tf-candidate-card[data-status="pending"] {
    border-left: 4px solid var(--tf-status-pending);
}

.tf-candidate-card[data-status="complete"] {
    border-left: 4px solid var(--tf-status-complete);
}

.tf-candidate-card[data-status="active"] {
    border-left: 4px solid var(--tf-status-active);
}

.tf-candidate-card[data-status="rejected"] {
    border-left: 4px solid var(--tf-status-rejected);
}

/* Modal styles for form entry display */
.tf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.tf-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.tf-modal-active .tf-modal-content {
    transform: scale(1);
}

.tf-modal-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tf-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tf-accent);
    margin: 0;
}

.tf-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    line-height: 1;
}

.tf-modal-close:hover {
    color: #334155;
}

/* v4.3.0: Modal header actions group (download + close) */
.tf-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tf-btn-download-pdf {
    background: #0891b2;
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tf-btn-download-pdf:hover {
    background: #0e7490;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tf-btn-download-pdf:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tf-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Form entry display styles (Gravity Forms inspired) */
.tf-entry-field {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.tf-entry-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tf-entry-label {
    font-weight: 600;
    color: var(--tf-accent);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.tf-entry-value {
    color: #374151;
    line-height: 1.5;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

.tf-entry-meta {
    background: #f8fafc;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #64748b;
}

/* Status update section in modal */
.tf-modal-actions {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.tf-status-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tf-status-controls label {
    font-weight: 600;
    color: var(--tf-accent);
    font-size: 0.875rem;
}

.tf-status-controls select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
}

.tf-modal-save-btn {
    background: var(--tf-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tf-modal-save-btn:hover {
    background: var(--tf-primary-dark);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tf-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .tf-modal-header, .tf-modal-body, .tf-modal-actions {
        padding: 1rem;
    }
    
    .tf-modal-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .tf-status-controls {
        justify-content: space-between;
    }
}

/* Returner Actions Section - For Rejected Candidates */
.tf-returner-actions {
    padding: 1rem;
    background: #fef2f2;
    border-top: 1px solid #fecaca;
    margin: 0; /* Remove any margin */
    flex-shrink: 0; /* Don't shrink */
}

.tf-rejection-reason {
    color: #991b1b;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    text-align: center;
}

/* v3.10.0: .tf-btn-mark-returner rules removed — replaced by the corner
   .tf-returner-star toggle (defined at end of file). */

/* === APPROVAL SYSTEM STYLES (v3.6.0) === */

/* Approval button states */
.tf-btn-approved {
    background-color: #10b981 !important;
    color: white !important;
}

.tf-btn-approved:hover {
    background-color: #059669 !important;
}

.tf-btn-rejected {
    background-color: #ef4444 !important;
    color: white !important;
}

.tf-btn-rejected:hover {
    background-color: #dc2626 !important;
}

/* Approval counter section - separate from progress */
.tf-approval-section {
    padding: 0.25rem 0.75rem !important;
    height: 18px !important;
    max-height: 18px !important;
    display: flex;
    align-items: center;
    flex-shrink: 0 !important; /* Prevent flex from shrinking this */
}

/* Approval counter */
.tf-approval-counter {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

/* v3.8.1: notes button — see .tf-name-row above */

.tf-btn-notes {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.tf-btn-notes:hover {
    background: #e0f2fe;
    border-color: #0891b2;
    color: #0891b2;
}

.tf-notes-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    line-height: 1;
}

/* Approval controls in modal */
.tf-approval-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tf-approval-controls label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.tf-approval-controls select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
}

.tf-approval-controls select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Approval history */
.tf-approval-history {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    border-left: 3px solid #3b82f6;
}

/* Mark Rejected button for external providers */
.tf-btn-mark-rejected {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
    margin-left: 0.25rem !important;
    background-color: #ef4444 !important;
    color: white !important;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-btn-mark-rejected:hover {
    background-color: #dc2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tf-btn-mark-rejected:active {
    transform: translateY(0);
}

.tf-btn-mark-rejected:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* === PAGINATION STYLES === */
.tf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.tf-pagination-info {
    color: #0891b2 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-right: 1rem;
}

.tf-pagination-button {
    background: #0891b2 !important;
    border: 2px solid #0e7490 !important;
    color: white !important;
    padding: 0.75rem 1.25rem !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem !important;
    font-weight: 600 !important;
    min-width: 50px;
    text-align: center;
}

.tf-pagination-button:hover:not(:disabled) {
    background: #0e7490 !important;
    border-color: #155e75 !important;
    color: white !important;
    transform: translateY(-2px);
}

.tf-pagination-button.active {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: white !important;
}

.tf-pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tf-pagination-ellipsis {
    color: var(--tf-neutral);
    padding: 0 0.25rem;
}

/* Search Results Message */
.tf-search-results {
    text-align: center;
    padding: 1rem;
    color: #0891b2;
    font-size: 0.95rem;
    font-weight: 600;
    background: #e0f2f4;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Gender Indicator */
.tf-gender-indicator {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    opacity: 0.8;
}

/* v3.9.0: Applied X days ago badge */
.tf-applied-badge {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.62rem;
    color: #0369a1;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* v3.9.0: Responsive adjustments for filter builder */
@media (max-width: 768px) {
    .tf-filter-builder-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tf-filter-rule-inner {
        flex-wrap: wrap;
    }

    .tf-filter-rule-inner select:first-child,
    .tf-filter-rule-inner select:nth-child(2) {
        min-width: auto;
        flex: 1;
    }

    .tf-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tf-advanced-filter-btn {
        justify-content: center;
    }
}

/* =====================================================================
   v3.10.0: Heard-about-us filter, phone on cards, returner star toggle,
   50/50 search layout, returners-only toggle
   ===================================================================== */

/* 50/50 split: search input on the left, filter tabs on the right */
.tf-search-row-split {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.tf-search-row-split .tf-search-input-wrap {
    flex: 0 1 auto;
    min-width: 200px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tf-search-row-split .tf-search-input-wrap .tf-search-input {
    flex: 1;
    min-width: 0;
    width: 200px;
}

.tf-search-row-split .tf-filter-tabs {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
}

/* Returners-only toggle tab */
.tf-returners-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tf-returners-toggle[data-active="1"] {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: white !important;
}

.tf-returners-toggle-icon {
    color: #f59e0b;
    font-size: 0.95rem;
    line-height: 1;
}

.tf-returners-toggle[data-active="1"] .tf-returners-toggle-icon {
    color: white;
}

/* v3.11.0: Sort dropdown — "distinct control" treatment.
   Sits inside .tf-filter-tabs alongside the filter buttons, but visually reads
   as a separate control (not another button) via:
   - soft left-side divider to signal "new cluster"
   - explicit "Sort:" label
   - native-looking select with chevron, lighter background than buttons */
.tf-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    border-left: 1px solid var(--tf-border);
    /* match filter-tab vertical footprint so row aligns */
    height: calc(0.625rem * 2 + 0.875rem * 1.4);
}

.tf-sort-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tf-neutral);
    text-transform: uppercase;
    letter-spacing: 0.25px;
    white-space: nowrap;
}

.tf-sort-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    background-color: var(--tf-bg);
    color: var(--tf-accent);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    /* native select chevron — kept so it obviously reads as a dropdown */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3e%3cpath d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem 1rem;
}

.tf-sort-select:hover {
    border-color: var(--tf-primary);
    background-color: var(--tf-surface);
}

.tf-sort-select:focus {
    outline: none;
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

/* Mobile: drop the left divider and let the sort wrap to its own line */
@media (max-width: 768px) {
    .tf-sort-wrap {
        padding-left: 0;
        margin-left: 0;
        border-left: none;
        width: 100%;
        height: auto;
    }
    .tf-sort-select {
        flex: 1;
    }
}

/* Phone number display on candidate cards (next to email) */
.tf-candidate-phone {
    color: var(--tf-neutral);
    font-size: 0.75rem !important; /* v3.12.0: bumped from 0.7 to match email (readability) */
    margin: 0 !important;
    line-height: 1.3 !important; /* v3.12.0: match email/id rows */
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Click-to-toggle returner star badge */
/* v3.11.0: Moved into header flow (was position:absolute top-right) so it sits side-by-side
   with the status badge without overlap. It's the last child of .tf-candidate-header. */
.tf-returner-star {
    z-index: 3;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--tf-border);
    border-radius: 999px;
    padding: 3px 10px 3px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tf-neutral);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    line-height: 1;
    flex-shrink: 0;
    align-self: flex-start;
    white-space: nowrap;
}

.tf-returner-star:hover {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tf-returner-star-icon {
    font-size: 0.9rem;
    line-height: 1;
    color: #d4d4d8;
    transition: color 0.2s ease;
}

.tf-returner-star:hover .tf-returner-star-icon {
    color: #f59e0b;
}

.tf-returner-star-label {
    display: inline-block;
}

/* Active state — candidate IS marked as returner */
.tf-returner-star-active {
    background: #f59e0b;
    border-color: #d97706;
    color: white;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.tf-returner-star-active .tf-returner-star-icon {
    color: #fffbeb;
}

.tf-returner-star-active:hover {
    background: #d97706;
    border-color: #b45309;
    color: white;
}

.tf-returner-star-active:hover .tf-returner-star-icon {
    color: white;
}

/* v3.11.0: Removed the margin-right clearance rule — the star is now in the
   header flex flow (side-by-side with the status badge), no overlap possible. */

/* Pulse briefly when toggled so user sees the change */
@keyframes tf-returner-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.tf-returner-star.tf-just-toggled {
    animation: tf-returner-pulse 0.3s ease;
}

/* Mobile — stack search above filter tabs again */
@media (max-width: 768px) {
    .tf-search-row-split {
        flex-direction: column;
        align-items: stretch;
    }

    .tf-search-row-split .tf-search-input-wrap,
    .tf-search-row-split .tf-filter-tabs {
        flex: 1 1 100%;
        min-width: 0;
        justify-content: flex-start;
    }

    .tf-returner-star {
        padding: 2px 8px 2px 6px;
        font-size: 0.6rem;
    }

    .tf-returner-star-label {
        display: none; /* icon only on narrow screens */
    }
}

/* ═══════════════════════════════════════════════════ */
/* v4.0.0: MAIN TAB NAVIGATION                        */
/* ═══════════════════════════════════════════════════ */
.tf-main-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--tf-border);
    margin-bottom: 1.5rem;
}
.tf-main-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-bottom: 2.5px solid transparent;
    background: none;
    color: var(--tf-neutral);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tf-main-tab:hover { color: var(--tf-accent); }
.tf-main-tab.active {
    color: var(--tf-primary);
    border-bottom-color: var(--tf-primary);
}
.tf-tab-content { display: none; }
.tf-tab-content.tf-tab-active { display: block; }

/* Sub-tabs (Admin tab) */
.tf-admin-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
}
.tf-sub-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #f1f5f9;
    color: var(--tf-neutral);
    transition: all 0.2s;
    font-family: inherit;
}
.tf-sub-tab:hover { background: #e2e8f0; }
.tf-sub-tab.active { background: var(--tf-primary); color: white; }
.tf-subtab-content { display: none; }
.tf-subtab-content.tf-subtab-active { display: block; }

/* ═══════════════════════════════════════════════════ */
/* REPORTS                                             */
/* ═══════════════════════════════════════════════════ */
.tf-report-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 1rem;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
}
.tf-report-view-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-right: auto;
}
.tf-report-btn {
    padding: 5px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--tf-border);
    background: white;
    color: var(--tf-neutral);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.tf-report-btn:hover { background: var(--tf-primary-light); border-color: var(--tf-primary); }
.tf-report-btn.active { background: var(--tf-primary-light); border-color: var(--tf-primary); color: var(--tf-primary-dark); }
.tf-report-filters {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}
.tf-report-select {
    font-size: 0.75rem;
    padding: 5px 8px;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    background: white;
    color: var(--tf-accent-light);
    font-family: inherit;
}
.tf-report-content {
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    overflow: hidden;
    padding: 12px;
}
.tf-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.tf-report-table th {
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--tf-neutral);
    border-bottom: 1px solid var(--tf-border);
    background: #f8fafc;
}
.tf-report-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}
.tf-report-table tr:hover td { background: #fafbfc; }
.tf-report-bar { display: flex; align-items: center; gap: 8px; }
.tf-report-bar-track { flex: 1; height: 6px; background: #f1f5f9; border-radius: 3px; }
.tf-report-bar-fill { height: 100%; border-radius: 3px; }
.tf-report-export-btn {
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--tf-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}
.tf-report-export-btn:hover { background: var(--tf-primary-dark); }
.tf-report-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.tf-clickable-num {
    color: var(--tf-primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-weight: 600;
}
.tf-clickable-num:hover { color: var(--tf-primary-dark); text-decoration-style: solid; }

/* Custom date range */
.tf-custom-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--tf-border);
    margin-bottom: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}
.tf-custom-date-range label { font-weight: 600; color: var(--tf-neutral); }
.tf-custom-date-range input[type="date"] {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
}
.tf-apply-date-btn {
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--tf-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}

/* Drilldown chip */
.tf-drilldown-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--tf-primary-light);
    border: 1px solid var(--tf-primary);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tf-primary-dark);
    margin-bottom: 12px;
}
.tf-drilldown-close {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--tf-primary-dark);
    font-weight: 700;
    padding: 0 4px;
}

/* Report metric cards */
.tf-report-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1rem;
}
.tf-report-metric {
    background: #f8fafc;
    border-radius: 8px;
    padding: 13px 14px;
    text-align: center;
}
.tf-report-metric-label { font-size: 0.7rem; color: var(--tf-neutral); margin-bottom: 2px; }
.tf-report-metric-val { font-size: 1.375rem; font-weight: 600; }
.tf-report-metric-note { font-size: 0.65rem; margin-top: 2px; }

/* Bottleneck banner */
.tf-bottleneck-banner {
    padding: 10px 16px;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    font-size: 0.75rem;
    color: #991b1b;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════ */
/* WORKFLOWS & EMAIL TEMPLATES                        */
/* ═══════════════════════════════════════════════════ */
.tf-workflow-item {
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin-bottom: 10px;
}
.tf-workflow-trigger { font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }
.tf-workflow-actions { font-size: 0.75rem; color: var(--tf-accent-light); line-height: 1.9; }
.tf-workflow-actions div::before { content: "→ "; color: var(--tf-primary); }
.tf-workflow-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.tf-email-card {
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
}
.tf-email-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.tf-email-card-name { font-size: 0.8rem; font-weight: 600; }
.tf-email-card-type {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}
.tf-email-card-trigger { font-size: 0.7rem; color: var(--tf-neutral); margin-bottom: 6px; }
.tf-email-preview-box {
    background: #f8fafc;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--tf-accent-light);
    font-style: italic;
}
.tf-badge-new {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ═══════════════════════════════════════════════════ */
/* TOOLS TAB                                           */
/* ═══════════════════════════════════════════════════ */
.tf-tools-section {
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.tf-tools-header { font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; }
.tf-tools-desc { font-size: 0.7rem; color: var(--tf-neutral); margin-bottom: 14px; line-height: 1.5; }
.tf-tools-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.tf-tools-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.tf-tools-badge-green { background: #dcfce7; color: #166534; }
.tf-tools-badge-amber { background: #fef3c7; color: #92400e; }
.tf-tools-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.tf-tools-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--tf-neutral);
    border-bottom: 1px solid var(--tf-border);
    background: #f8fafc;
}
.tf-tools-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--tf-accent-light);
}

.tf-tool-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.tf-tool-green { background: #f0fdf4; }
.tf-tool-amber { background: #fffbeb; }
.tf-tool-info { flex: 1; min-width: 200px; }
.tf-tool-name { font-size: 0.8rem; font-weight: 600; }
.tf-tool-desc { font-size: 0.7rem; color: var(--tf-neutral); margin-top: 2px; }
.tf-tool-input-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tf-tool-input {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
    width: 180px;
}
.tf-tool-btn {
    padding: 5px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s;
}
.tf-tool-btn:hover { transform: translateY(-1px); }
.tf-tool-btn-teal { background: var(--tf-primary); color: white; }
.tf-tool-btn-teal:hover { background: var(--tf-primary-dark); }
.tf-tool-btn-green { background: #22c55e; color: white; }
.tf-tool-btn-green:hover { background: #16a34a; }
.tf-tool-btn-amber { background: #f59e0b; color: white; }
.tf-tool-btn-amber:hover { background: #d97706; }
.tf-tools-output {
    background: #f8fafc;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
    font-family: monospace;
    font-size: 0.75rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
}

/* Toast notification */
.tf-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    display: none;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: tf-fadeIn 0.25s ease;
}
.tf-toast.visible { display: flex; align-items: center; gap: 8px; }
@keyframes tf-fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 768px) {
    .tf-main-tabs { overflow-x: auto; }
    .tf-report-controls { flex-direction: column; align-items: stretch; }
    .tf-report-filters { margin-left: 0; }
    .tf-report-metrics { grid-template-columns: 1fr; }
    .tf-admin-sub-tabs { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════ */
/* v4.2.0: TASK QUEUE                                  */
/* ═══════════════════════════════════════════════════ */
.tf-task-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.tf-task-metric {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
}
.tf-task-metric-label { font-size: 0.7rem; color: var(--tf-neutral); margin-bottom: 2px; }
.tf-task-metric-val { font-size: 1.375rem; font-weight: 600; }
.tf-task-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    align-items: center;
}
.tf-task-filter {
    padding: 0 12px;
    height: 30px !important;
    line-height: 28px;
    box-sizing: border-box !important;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--tf-border);
    background: white;
    color: var(--tf-neutral);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    vertical-align: middle;
}
select.tf-task-filter {
    padding: 0 24px 0 8px !important;
    height: 30px !important;
    line-height: 28px;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-color: white !important;
    min-height: 0 !important;
    max-height: 30px !important;
}
.tf-task-filter:hover { background: var(--tf-primary-light); border-color: var(--tf-primary); }
.tf-task-filter.active { background: var(--tf-primary-light); border-color: var(--tf-primary); color: var(--tf-primary-dark); }
.tf-task-list {
    background: white;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    overflow: hidden;
}
.tf-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.tf-task-item:last-child { border-bottom: none; }
.tf-task-item:hover { background: #fafbfc; }
.tf-task-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tf-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tf-primary-dark);
    flex-shrink: 0;
}
.tf-task-info { flex: 1; min-width: 0; }
.tf-task-name { font-size: 0.8rem; font-weight: 500; }
.tf-task-detail {
    font-size: 0.7rem;
    color: var(--tf-neutral);
    margin-top: 2px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.tf-task-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.tf-task-badge-overdue { background: #fef2f2; color: #991b1b; }
.tf-task-badge-normal { background: #fef3c7; color: #92400e; }
.tf-task-badge-critical { background: #fce7f3; color: #be185d; }
.tf-task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tf-task-btn {
    padding: 5px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s;
}
.tf-task-btn:hover { transform: translateY(-1px); }
.tf-task-btn-review { background: var(--tf-primary); color: white; }
.tf-task-btn-review:hover { background: var(--tf-primary-dark); }
.tf-task-btn-chase { background: #ef4444; color: white; }
.tf-task-btn-chase:hover { background: #dc2626; }
.tf-task-btn-action { background: var(--tf-primary); color: white; }
.tf-task-btn-action:hover { background: var(--tf-primary-dark); }
.tf-task-empty {
    text-align: center;
    padding: 2rem;
    color: var(--tf-neutral);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .tf-task-metrics { grid-template-columns: repeat(2, 1fr); }
    .tf-task-item { flex-wrap: wrap; }
    .tf-task-actions { width: 100%; justify-content: flex-end; }
}

/* v4.3.0: Status filter button tooltips */
.tf-filter-tab {
    position: relative;
}
.tf-filter-tab[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    animation: tf-tooltip-in 0.15s ease 1s both;
}
.tf-filter-tab[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    z-index: 100;
    pointer-events: none;
    animation: tf-tooltip-in 0.15s ease 1s both;
}
@keyframes tf-tooltip-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* v4.2.2: Pipeline column header tooltips */
.tf-pipeline-th {
    position: relative;
    cursor: help;
}
.tf-pipeline-th::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: none;
}
.tf-pipeline-th:hover::after {
    opacity: 1;
    visibility: visible;
    animation: tf-tooltip-in 0.15s ease 0.4s both;
}
.tf-pipeline-th::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: none;
}
.tf-pipeline-th:hover::before {
    opacity: 1;
    visibility: visible;
    animation: tf-tooltip-in 0.15s ease 0.4s both;
}
.tf-pipeline-th-label {
    border-bottom: 1px dotted #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════
   v4.6.0: Confirmation gate, notes tabs, system tag, success banner
   ═══════════════════════════════════════════════════════════════ */

/* Success banner (showSuccess created the element but it was never styled) */
.tf-success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Notes panel filter tabs (All / Staff / System) */
.tf-notes-tab {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--tf-border);
    background: var(--tf-surface);
    color: var(--tf-neutral);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.tf-notes-tab:hover {
    background: var(--tf-primary-light);
    border-color: var(--tf-primary);
}

.tf-notes-tab.active {
    background: var(--tf-primary);
    border-color: var(--tf-primary);
    color: #fff;
}

/* Small marker distinguishing auto-generated (system) notes from staff notes */
.tf-note-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
}

.tf-note-tag-system {
    background: #e2e8f0;
    color: #475569;
}

/* Confirmation popup reason box focus state */
#tf-confirm-reason:focus {
    outline: none;
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

#tf-confirm-yes:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   v4.7.0: Full-screen takeover + left sidebar (cyan kept, cards untouched)
   Layout-only — no functional classes/IDs changed.
   ═══════════════════════════════════════════════════════════════ */

/* Stop the page behind from scrolling, and hide theme chrome behind the takeover.
   The admin bar (#wpadminbar) and our own tf- popups/modals are kept visible. */
body.tf-dashboard-active { overflow: hidden !important; }
body.tf-dashboard-active > *:not(#tf-candidate-dashboard):not(#wpadminbar):not([id^="tf-"]):not(script):not(style):not(link):not(noscript) {
    display: none !important;
}

/* ── Full-screen shell ── */
#tf-candidate-dashboard.tf-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99990;
    display: flex;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: var(--tf-bg);
}
body.admin-bar #tf-candidate-dashboard.tf-fullscreen { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar #tf-candidate-dashboard.tf-fullscreen { top: 46px; }
}

/* Body-level modals/popups must sit ABOVE the takeover so they still open on top */
.tf-modal-overlay { z-index: 100000 !important; }

/* ── Sidebar (cyan, matching the dashboard's existing palette) ── */
.tf-sidebar {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0.875rem;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--tf-primary) 0%, var(--tf-primary-dark) 100%);
    color: #fff;
}
.tf-sidebar-logo {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    padding: 0 0.5rem 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.tf-sidebar-logo span {
    display: block;
    font-weight: 400;
    font-size: 0.95rem;
    opacity: 0.85;
}
.tf-sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }

/* Re-style the relocated .tf-main-tab buttons as vertical sidebar items.
   Higher specificity (.tf-sidebar .tf-main-tab) overrides the old top-strip rules. */
.tf-sidebar .tf-main-tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    margin: 0;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: none;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tf-sidebar .tf-main-tab:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tf-sidebar .tf-main-tab.active { background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 600; }
.tf-sidebar-ico { font-size: 1rem; line-height: 1; }
.tf-sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
}

/* ── Main column ── */
.tf-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tf-main-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem 2.5rem;
}
/* The header now behaves as a topbar fixed at the top of the main column */
.tf-main > .tf-dashboard-header {
    flex-shrink: 0;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

/* ── Responsive: sidebar folds into a top strip on narrow screens (no JS needed) ── */
@media (max-width: 768px) {
    #tf-candidate-dashboard.tf-fullscreen { flex-direction: column; }
    .tf-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .tf-sidebar-logo, .tf-sidebar-footer { display: none; }
    .tf-sidebar-nav { flex-direction: row; gap: 0.4rem; }
    .tf-sidebar .tf-main-tab { width: auto; white-space: nowrap; padding: 0.5rem 0.8rem; }
    .tf-main-scroll { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   v4.8.0: Cohesion pass — sidebar logo + neutral icons, slim white
   topbar, branding card. (Cards still untouched.)
   ═══════════════════════════════════════════════════════════════ */

/* ── Sidebar brand (logo badge + name) ── */
.tf-sidebar-brand {
    text-align: center;
    padding: 0 0.5rem 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.tf-sidebar-logo-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.tf-sidebar-logo-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.tf-sidebar-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
}

/* ── Neutral line icons in the sidebar nav ── */
.tf-sidebar-ico {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    opacity: 0.85;
}
.tf-sidebar .tf-main-tab.active .tf-sidebar-ico { opacity: 1; }

/* ── Slim, professional white topbar (replaces the heavy cyan banner) ── */
.tf-main > .tf-dashboard-header {
    background: var(--tf-surface);
    color: var(--tf-accent);
    padding: 0.8rem 2rem;
    border-bottom: 1px solid var(--tf-border);
    align-items: center;
}
.tf-main > .tf-dashboard-header .tf-dashboard-stats { gap: 1.5rem; }
.tf-main > .tf-dashboard-header .tf-stat-item { text-align: left; }
.tf-main > .tf-dashboard-header .tf-stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--tf-accent);
    margin-bottom: 0;
}
.tf-main > .tf-dashboard-header .tf-stat-label {
    font-size: 0.6rem;
    opacity: 1;
    color: var(--tf-neutral);
    letter-spacing: 0.05em;
}
.tf-main > .tf-dashboard-header .tf-refresh-btn {
    background: var(--tf-surface);
    color: var(--tf-neutral);
    border: 1px solid var(--tf-border);
    padding: 0.5rem 1rem;
}
.tf-main > .tf-dashboard-header .tf-refresh-btn:hover {
    background: var(--tf-primary-light);
    border-color: var(--tf-primary);
    color: var(--tf-primary);
}

/* ── Branding card (Settings tab) ── */
.tf-branding-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}
.tf-branding-preview .tf-sidebar-logo-badge {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--tf-border);
}
.tf-branding-fields {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.tf-brand-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tf-accent);
    margin-top: 0.5rem;
}
.tf-brand-colour-row { display: flex; align-items: center; gap: 0.75rem; }
.tf-brand-colour-row input[type="color"] {
    width: 48px; height: 34px;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    padding: 2px;
    background: #fff;
    cursor: pointer;
}
.tf-brand-colour-hex { font-size: 0.82rem; color: var(--tf-neutral); font-family: ui-monospace, monospace; }
.tf-brand-reset {
    background: none;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    padding: 0.32rem 0.65rem;
    font-size: 0.72rem;
    color: var(--tf-neutral);
    cursor: pointer;
}
.tf-brand-reset:hover { border-color: var(--tf-primary); color: var(--tf-primary); }
.tf-branding-actions { display: flex; align-items: center; gap: 0.85rem; margin-top: 0.85rem; }
.tf-brand-status { font-size: 0.82rem; font-weight: 600; }
.tf-brand-note { font-size: 0.72rem; color: var(--tf-neutral); margin: 0.35rem 0 0; }

/* ═══════════════════════════════════════════════════════════════
   v4.8.1: Email templates — enquiry-style card grid
   ═══════════════════════════════════════════════════════════════ */
.tf-email-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
}
/* Card sits in the grid; override the old list-item spacing */
.tf-email-grid .tf-email-card {
    margin-bottom: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--tf-shadow);
    transition: box-shadow 0.2s ease;
}
.tf-email-grid .tf-email-card:hover { box-shadow: var(--tf-shadow-lg); }
.tf-email-grid .tf-email-card-header { align-items: flex-start; gap: 8px; }
.tf-email-grid .tf-email-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--tf-accent);
}
.tf-email-grid .tf-email-card-type {
    flex-shrink: 0;
    white-space: nowrap;
}
/* Trigger as a soft amber pill, like the enquiry .etr */
.tf-email-grid .tf-email-card-trigger {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 500;
    color: #b45309;
    background: #fff8f0;
    border: 1px solid #fde9d2;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    line-height: 1.4;
}
.tf-email-subject {
    font-size: 0.72rem;
    color: var(--tf-accent);
    margin-bottom: 8px;
    line-height: 1.4;
}
.tf-email-subject span {
    display: inline-block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6rem;
    color: var(--tf-neutral);
    margin-right: 6px;
}
/* Body shown directly in a scrollable mono block (enquiry style) */
.tf-email-body {
    background: #f8fafc;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0 0 10px;
    font-size: 0.72rem;
    line-height: 1.55;
    color: #475569;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 11rem;
    overflow-y: auto;
    font-family: ui-monospace, 'DM Sans', system-ui, sans-serif;
}
.tf-email-actions { margin-top: auto; display: flex; gap: 8px; }
.tf-email-copy {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    color: var(--tf-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tf-email-copy:hover { background: var(--tf-primary-light); border-color: var(--tf-primary); }
.tf-email-copy.tf-copied { background: #dcfce7; border-color: #86efac; color: #166534; }
