:root {
    --primary-color: #1a73e8;
    --secondary-color: #34a853;
    --warning-color: #fbbc04;
    --danger-color: #ea4335;
    --dark-bg: #1f1f1f;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-hover: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1557b0 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
    font-weight: 700;
}

.header-static-info {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.static-info-item {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.static-label {
    font-size: 0.75rem;
    opacity: 0.95;
    font-weight: 600;
    white-space: nowrap;
}

.static-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 0;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 99;
    margin-top: 10px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid transparent;
    background: var(--light-bg);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

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

.tab-icon {
    font-size: 1.2rem;
}

.tab-label {
    font-size: 0.95rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

.stat-card-clickable:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-card-clickable:active {
    transform: translateY(-1px);
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 6px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Main Content */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.dashboard-section:hover {
    box-shadow: var(--shadow-hover);
}

.dashboard-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.dashboard-section h3 {
    font-size: 1.3rem;
    margin: 20px 0 15px 0;
    color: var(--text-primary);
}

/* Chart Grid */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.chart-container {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    min-height: 300px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 25px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: var(--primary-color);
    color: white;
}

th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

th.sortable .sort-indicator {
    margin-left: 8px;
    opacity: 0.4;
    font-size: 0.75em;
}

th.sortable .sort-indicator::before {
    content: "⇅";
}

th.sortable.sort-asc .sort-indicator {
    opacity: 1;
}

th.sortable.sort-asc .sort-indicator::before {
    content: "▲";
}

th.sortable.sort-desc .sort-indicator {
    opacity: 1;
}

th.sortable.sort-desc .sort-indicator::before {
    content: "▼";
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--light-bg);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Pipeline Cards */
.pipeline-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.pipeline-card {
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pipeline-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.pipeline-card h3 {
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    opacity: 0.9;
    color: white;
}

.pipeline-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.pipeline-card.pipeline {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pipeline-card.interview {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pipeline-card.offer {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ff8c00 100%);
}

.pipeline-card.accepted {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pipeline-card.started {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0f9d58 100%);
}

.pipeline-card.rejected {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c53929 100%);
}

/* Timeline Styles */
.timeline-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.timeline-shortcuts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timeline-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.timeline-date-range label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.timeline-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.timeline-date-range input[type="date"]:hover,
.timeline-date-range input[type="date"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.timeline-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.timeline-btn:hover {
    background: var(--primary-color);
    color: white;
}

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

.timeline-container {
    position: relative;
    padding: 20px 0;
    margin: 30px 0;
}

.timeline-item {
    position: relative;
    padding: 20px 0 20px 40px;
    border-left: 3px solid var(--primary-color);
    margin-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 25px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.timeline-content {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.timeline-content h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.timeline-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
}

.badge-started {
    background: #d4edda;
    color: #155724;
}

.badge-accepted {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-offer {
    background: #fff3cd;
    color: #856404;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 30px;
    color: var(--text-secondary);
}

.confidential {
    color: var(--danger-color);
    font-weight: 700;
    margin-top: 10px;
}

/* Overview Tab Specific Styles */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.summary-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, #0f9d58 100%);
    transition: width 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.mini-chart {
    height: 200px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.metric-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-content h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.metric-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Data Controls */
/* Filter Toggle Button */
.filter-toggle-container {
    margin-bottom: 20px;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}

.filter-toggle-btn:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.filter-icon {
    font-size: 1.2em;
}

.filter-text {
    flex: 1;
}

.filter-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.filter-count:empty {
    display: none;
}

.toggle-arrow {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.toggle-arrow.open {
    transform: rotate(180deg);
}

/* Filters Section - Collapsible */
.filters-section {
    overflow: visible;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    max-height: 0;
    position: relative;
    z-index: 100; /* Ensure filters appear above table */
}

.filters-section.show {
    opacity: 1;
    max-height: 3000px; /* Increased to accommodate dropdown menus */
    margin-bottom: 20px;
    overflow: visible;
}

/* View Mode Controls */
.view-mode-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.view-mode-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background-color: rgba(26, 115, 232, 0.05);
}

.radio-label input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.radio-label span {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Data Controls - Multi-row Layout */
.data-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    overflow: visible;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    overflow: visible;
}

.data-controls input {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    flex: 1;
    min-width: 250px;
}

.data-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Custom Dropdown with Checkboxes */
.custom-dropdown {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.dropdown-toggle {
    width: 100%;
    padding: 12px 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.dropdown-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.dropdown-toggle.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.selection-count {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
    margin-left: 6px;
}

.selection-count:empty {
    display: none;
}

.dropdown-arrow {
    margin-left: auto;
    padding-left: 10px;
    font-size: 0.7em;
    transition: transform 0.3s;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 450px;
    margin-top: 4px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    max-height: 350px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

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

.dropdown-menu label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 12px;
    border-bottom: 1px solid var(--light-bg);
}

.dropdown-menu label:last-child {
    border-bottom: none;
}

.dropdown-menu label:hover {
    background-color: var(--light-bg);
}

.dropdown-menu input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.dropdown-menu label span {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.clear-filters-btn {
    padding: 12px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

/* Chart Container Full Width */
.chart-container-full {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    min-height: 300px;
}

/* Data source badge */
.data-source-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.source-email1 {
    background: #e3f2fd;
    color: #1565c0;
}

.source-email2 {
    background: #f3e5f5;
    color: #6a1b9a;
}

.source-email1-acceptances {
    background: #e8f5e9;
    color: #2e7d32;
}

.source-email2-offers-q1 {
    background: #fff3e0;
    color: #ef6c00;
}

.source-email1-pipeline {
    background: #e1f5fe;
    color: #0277bd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    .header-static-info {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }

    .static-info-item {
        flex: 1;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .header-stats {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-section {
        padding: 20px;
    }

    .tab-navigation {
        overflow-x: scroll;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .view-mode-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .data-controls {
        flex-direction: column;
    }

    .filter-row {
        flex-direction: column;
    }

    .data-controls input,
    .data-controls select,
    .clear-filters-btn {
        width: 100%;
        min-width: unset;
    }
}

/* Status badges in tables */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-started {
    background: #d4edda;
    color: #155724;
}

.status-accepted {
    background: #d1ecf1;
    color: #0c5460;
}

.status-offer {
    background: #fff3cd;
    color: #856404;
}

.status-interview {
    background: #f8d7da;
    color: #721c24;
}

.status-pipeline {
    background: #e2e3e5;
    color: #383d41;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

/* Highlight positive/negative numbers */
.positive {
    color: var(--secondary-color);
    font-weight: 600;
}

.negative {
    color: var(--danger-color);
    font-weight: 600;
}

.neutral {
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

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

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1557b0 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.close-modal {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.country-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.country-breakdown-table thead {
    background-color: var(--light-bg);
    position: sticky;
    top: 0;
}

.country-breakdown-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.country-breakdown-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.country-breakdown-table tbody tr:hover {
    background-color: var(--light-bg);
    transition: background-color 0.2s;
}

.country-breakdown-table td:first-child {
    font-weight: 500;
    color: var(--primary-color);
}

.country-breakdown-table td:not(:first-child) {
    text-align: center;
    font-weight: 600;
}

/* Clickable metric card */
.metric-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination-info select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pagination-info select:hover {
    border-color: var(--primary-color);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-controls button {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

#pageNumbers {
    display: flex;
    gap: 5px;
}

.page-number {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.page-number:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-number.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.page-ellipsis {
    padding: 8px 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-info,
    .pagination-controls {
        justify-content: center;
        width: 100%;
    }

    .pagination-controls button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .page-number {
        padding: 8px 10px;
        min-width: 35px;
        font-size: 13px;
    }

    /* Timeline date range mobile styles */
    .timeline-date-range {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .timeline-date-range label {
        font-size: 13px;
    }

    .timeline-date-range input[type="date"] {
        width: 100%;
        font-size: 13px;
    }
}

/* ================================
   Metric Modal Styles
   ================================ */

/* Modal overlay */
.metric-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

/* Modal content container */
.metric-modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

/* Modal header */
.metric-modal-header {
    padding: 24px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1557b0 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* Close button */
.metric-modal-close {
    color: white;
    font-size: 32px;
    font-weight: 300;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.metric-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Modal body */
.metric-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Metric detail sections */
.metric-detail-section {
    margin-bottom: 28px;
}

.metric-detail-section:last-child {
    margin-bottom: 0;
}

.metric-detail-section h4 {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.metric-detail-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
}

/* Calculation formula styles */
.calculation-formula {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-family: 'Courier New', monospace;
}

.formula {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.formula-breakdown {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 20px;
}

.formula-result {
    font-size: 18px;
    color: var(--secondary-color);
    font-weight: 700;
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    text-align: center;
}

/* Metric numbers grid */
.metric-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.metric-number-card {
    background: var(--light-bg);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-number-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.metric-number-card.highlight {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid var(--primary-color);
}

.metric-number-card.full-width {
    grid-column: 1 / -1;
}

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

.metric-number-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-number-card.highlight .metric-number-value {
    font-size: 32px;
}

/* Clickable metric cards */
.metric-card.clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card.clickable::after {
    content: '🔍';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.metric-card.clickable:hover::after {
    opacity: 0.7;
}

.metric-card.clickable:active {
    transform: translateY(-2px);
}

/* Insights styling */
.metric-detail-section p strong {
    color: var(--primary-color);
}

/* Responsive modal */
@media (max-width: 768px) {
    .metric-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .metric-modal-header {
        padding: 20px;
    }

    .metric-modal-header h3 {
        font-size: 18px;
    }

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

    .metric-numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-number-card.full-width {
        grid-column: 1 / -1;
    }
}

/* ==========================================
   RECRUITMENT FUNNEL TABLE STYLES
   ========================================== */

.funnel-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.funnel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.funnel-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1557b0 100%);
    color: white;
}

.funnel-table th {
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

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

.funnel-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.funnel-table tbody tr:hover {
    background-color: #f8f9fa;
}

.funnel-table tbody tr:last-child {
    border-bottom: none;
}

.funnel-table td {
    padding: 14px 12px;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

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

.funnel-table .metric-label {
    font-weight: 600;
    text-align: left;
    background-color: #f1f3f4;
    color: var(--text-primary);
    font-size: 0.95em;
}

.funnel-cell {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-primary);
}

.funnel-cell.clickable {
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.2s;
    position: relative;
}

.funnel-cell.clickable:hover {
    background-color: #e8f0fe;
    transform: scale(1.05);
}

.funnel-cell.clickable::after {
    content: '🔍';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    opacity: 0;
    transition: opacity 0.2s;
}

.funnel-cell.clickable:hover::after {
    opacity: 0.6;
}

.funnel-cell.total {
    background-color: #fff3cd;
    font-weight: 700;
    font-size: 1.1em;
    color: #856404;
}

.funnel-cell.total.clickable {
    color: #1557b0;
}

.funnel-cell.total.clickable:hover {
    background-color: #fff9e6;
}

/* Summary Metrics Clickable Styles */
.summary-metric-clickable {
    transition: all 0.2s ease;
}

.summary-metric-clickable:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-2px);
}

.summary-metric-clickable:active {
    transform: translateY(0);
}

/* Responsive design for funnel table */
@media (max-width: 1200px) {
    .funnel-table {
        font-size: 0.85em;
    }

    .funnel-table th,
    .funnel-table td {
        padding: 10px 8px;
    }
}

/* ==========================================
   REGIONS TABLE SPECIFIC STYLES
   ========================================== */

.regions-tables-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.country-funnel-container {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: visible;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.country-funnel-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.country-funnel-title {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.1em;
    color: var(--text-primary);
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.country-total-badge {
    font-size: 0.85em;
    font-weight: 500;
    background: var(--primary-color);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

/* Highlight UK country */
.country-funnel-container.highlight-country {
    border: 2px solid #f97316;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.country-funnel-container.highlight-country .country-funnel-title {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-bottom-color: #f97316;
}

.country-funnel-container.highlight-country .country-total-badge {
    background: #f97316;
}

/* Country funnel table specific */
.country-funnel-container .funnel-table-container {
    padding: 1rem;
    box-shadow: none;
    overflow-x: auto;
}

.country-funnel-table {
    margin: 0 !important;
    font-size: 0.85em;
}

.country-funnel-table th,
.country-funnel-table td {
    padding: 10px 8px;
    font-size: 0.9em;
}

.country-funnel-table th {
    white-space: nowrap;
}

.country-funnel-table .metric-label {
    white-space: nowrap;
}

/* Responsive grid - removed grid-based media query as we now use horizontal scrolling */

@media (max-width: 768px) {
    .country-funnel-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .country-total-badge {
        align-self: flex-start;
    }
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(234, 67, 53, 0.15);
    border: 1px solid rgba(234, 67, 53, 0.3);
    border-radius: 4px;
    color: #f28b82;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(234, 67, 53, 0.25);
}
