/* ============================================================================
   SEED Global Education — Program Dossier
   Stylesheet (extracted from program_dossier.php)
   --------------------------------------------------------------------------
   Sections in this file (search by heading):
     1. Original styles (light + dark themes, layout, components)
     2. CRM-Grade Revamp — overrides at the bottom of this file
   ============================================================================ */

        :root {
            --teal-500: #0097b2;
            --teal-600: #007a91;
            --orange-500: #ff914d;
            --orange-600: #e67d3a;
            --purple-500: #a855f7;
            --green-500: #22c55e;
            --yellow-500: #eab308;
            --red-500: #ef4444;
            --gradient-teal: linear-gradient(135deg, #00d4ff, #0097b2);
            --gradient-orange: linear-gradient(135deg, #ff6b35, #ff914d);
            --gradient-purple: linear-gradient(135deg, #a855f7, #7c3aed);
            --gradient-green: linear-gradient(135deg, #22c55e, #16a34a);
            --gradient-yellow: linear-gradient(135deg, #eab308, #ca8a04);
            --ease: cubic-bezier(0.4, 0, 0.2, 1);
            --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
            --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 24px;
        }

        [data-theme="light"] {
            --bg-base: #f8fafc;
            --bg-surface: #ffffff;
            --bg-elevated: #f1f5f9;
            --bg-hover: #e2e8f0;
            --bg-input: #ffffff;
            --border-color: #e2e8f0;
            --border-light: #cbd5e1;
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --text-inverse: #ffffff;
            --accent: #0097b2;
            --accent-hover: #007a91;
            --accent-dim: rgba(0, 151, 178, 0.1);
            --accent-glow: rgba(0, 151, 178, 0.25);
            --header-bg: rgba(255, 255, 255, 0.85);
            --header-border: rgba(0, 0, 0, 0.06);
            --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
            --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.1);
            --table-header-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
            --table-header-text: #475569;
            --table-row-hover: rgba(0, 151, 178, 0.04);
            --mesh-1: rgba(0, 151, 178, 0.06);
            --mesh-2: rgba(255, 145, 77, 0.04);
            --mesh-3: rgba(168, 85, 247, 0.04);
            --scrollbar-track: #f1f5f9;
            --scrollbar-thumb: #cbd5e1;
            --scrollbar-thumb-hover: #94a3b8;
            --select2-bg: #ffffff;
            --select2-border: #e2e8f0;
            --select2-text: #0f172a;
            --select2-dropdown: #ffffff;
        }

        [data-theme="dark"] {
            --bg-base: #0a0a0f;
            --bg-surface: #12121a;
            --bg-elevated: #1a1a24;
            --bg-hover: #22222e;
            --bg-input: #1a1a24;
            --border-color: rgba(255, 255, 255, 0.06);
            --border-light: rgba(255, 255, 255, 0.1);
            --text-primary: #ffffff;
            --text-secondary: rgba(255, 255, 255, 0.7);
            --text-muted: rgba(255, 255, 255, 0.4);
            --text-inverse: #0f172a;
            --accent: #00d4ff;
            --accent-hover: #00b8db;
            --accent-dim: rgba(0, 212, 255, 0.15);
            --accent-glow: rgba(0, 212, 255, 0.4);
            --header-bg: rgba(10, 10, 15, 0.85);
            --header-border: rgba(255, 255, 255, 0.06);
            --card-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.4);
            --card-shadow-hover: 0 8px 32px -8px rgba(0, 0, 0, 0.5);
            --table-header-bg: linear-gradient(180deg, #1a1a24 0%, #12121a 100%);
            --table-header-text: rgba(255, 255, 255, 0.6);
            --table-row-hover: rgba(0, 212, 255, 0.08);
            --mesh-1: rgba(0, 212, 255, 0.12);
            --mesh-2: rgba(255, 107, 53, 0.08);
            --mesh-3: rgba(168, 85, 247, 0.08);
            --scrollbar-track: #12121a;
            --scrollbar-thumb: #00d4ff;
            --scrollbar-thumb-hover: #00b8db;
            --select2-bg: #1a1a24;
            --select2-border: rgba(255, 255, 255, 0.1);
            --select2-text: #ffffff;
            --select2-dropdown: #12121a;
        }

        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            font-size: 14px;
            line-height: 1.6;
            color: var(--text-primary);
            background: var(--bg-base);
            -webkit-font-smoothing: antialiased;
            transition: background 0.3s var(--ease), color 0.3s var(--ease);
        }

        .app-container {
            min-height: 100vh;
            position: relative;
        }

        .app-container::before {
            content: '';
            position: fixed;
            inset: 0;
            background: radial-gradient(at 20% 20%, var(--mesh-1) 0px, transparent 50%), radial-gradient(at 80% 10%, var(--mesh-2) 0px, transparent 50%), radial-gradient(at 0% 60%, var(--mesh-3) 0px, transparent 50%);
            pointer-events: none;
            z-index: 0;
            transition: background 0.5s var(--ease);
        }

        .header {
            position: sticky;
            top: 0;
            z-index: 100;
            background: var(--header-bg);
            backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid var(--header-border);
            transition: background 0.3s var(--ease);
        }

        .header-inner {
            max-width: 1600px;
            margin: 0 auto;
            padding: 0 32px;
            height: 72px;
            display: flex;
            align-items: center;
            gap: 24px;
        }

        .back-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.25s var(--ease);
            text-decoration: none;
        }

        .back-btn:hover {
            background: var(--bg-hover);
            color: var(--accent);
            border-color: var(--accent);
            transform: translateX(-2px);
        }

        .back-btn svg {
            width: 20px;
            height: 20px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .logo-mark {
            width: 42px;
            height: 42px;
            background: var(--gradient-teal);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 30px -8px var(--accent-glow);
        }

        .logo-mark svg {
            width: 24px;
            height: 24px;
            color: white;
        }

        .logo-text {
            font-size: 18px;
            font-weight: 800;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .nav-tabs {
            display: flex;
            align-items: center;
            gap: 4px;
            background: var(--bg-elevated);
            padding: 5px;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-color);
        }

        .nav-tab {
            position: relative;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 18px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            background: none;
            border: none;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.25s var(--ease);
            white-space: nowrap;
        }

        .nav-tab:hover {
            color: var(--text-secondary);
            background: var(--bg-hover);
        }

        .nav-tab.active {
            color: var(--text-primary);
            background: var(--bg-surface);
            box-shadow: var(--card-shadow);
        }

        .nav-tab svg {
            width: 16px;
            height: 16px;
            opacity: 0.6;
        }

        .nav-tab.active svg {
            opacity: 1;
        }

        .theme-toggle {
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.25s var(--ease);
        }

        .theme-toggle:hover {
            background: var(--bg-hover);
            color: var(--accent);
            border-color: var(--accent);
        }

        .theme-toggle svg {
            width: 20px;
            height: 20px;
            transition: transform 0.3s var(--ease-spring);
        }

        .theme-toggle:hover svg {
            transform: rotate(15deg);
        }

        .theme-toggle .icon-sun,
        .theme-toggle .icon-moon {
            display: none;
        }

        [data-theme="light"] .theme-toggle .icon-moon {
            display: block;
        }

        [data-theme="dark"] .theme-toggle .icon-sun {
            display: block;
        }

        .user-level-badge {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 44px;
            padding: 0 16px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            transition: all 0.25s var(--ease);
        }

        .user-level-badge svg {
            width: 16px;
            height: 16px;
        }

        .user-level-badge:hover {
            background: var(--bg-hover);
            border-color: var(--accent);
            color: var(--accent);
        }

        .header-actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .btn {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            height: 44px;
            padding: 0 22px;
            font-size: 14px;
            font-weight: 600;
            font-family: inherit;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.25s var(--ease);
            border: none;
            text-decoration: none;
            overflow: hidden;
        }

        .btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
            opacity: 0;
            transition: opacity 0.25s;
        }

        .btn:hover::before {
            opacity: 1;
        }

        .btn-primary {
            background: var(--gradient-teal);
            color: white;
            box-shadow: 0 0 30px -8px var(--accent-glow);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 50px -8px var(--accent-glow);
        }

        .btn-accent {
            background: var(--gradient-orange);
            color: white;
            box-shadow: 0 0 30px -8px rgba(255, 145, 77, 0.4);
        }

        .btn-accent:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 50px -8px rgba(255, 145, 77, 0.5);
        }

        .btn-ghost {
            background: var(--bg-elevated);
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
        }

        .btn-ghost:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
            border-color: var(--border-light);
        }

        .btn svg {
            width: 18px;
            height: 18px;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
        }

        .main {
            position: relative;
            z-index: 1;
            max-width: 1600px;
            margin: 0 auto;
            padding: 32px;
        }

        .tab-panel {
            display: none;
            animation: slideUp 0.5s var(--ease-out);
        }

        .tab-panel.active {
            display: block;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .page-hero {
            margin-bottom: 28px;
        }

        .hero-title {
            font-size: 38px;
            font-weight: 800;
            letter-spacing: -0.03em;
            line-height: 1.15;
            color: var(--text-primary);
        }

        .hero-subtitle {
            font-size: 15px;
            color: var(--text-muted);
            margin-top: 6px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 28px;
        }

        .stat-card {
            position: relative;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: 22px;
            overflow: hidden;
            transition: all 0.3s var(--ease);
            box-shadow: var(--card-shadow);
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--gradient-teal);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .stat-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--card-shadow-hover);
        }

        .stat-card:hover::before {
            opacity: 1;
        }

        .stat-card.accent::before {
            background: var(--gradient-orange);
        }

        .stat-card.purple::before {
            background: var(--gradient-purple);
        }

        .stat-icon {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--accent-dim);
            border-radius: var(--radius-md);
            color: var(--accent);
            margin-bottom: 14px;
        }

        .stat-card.accent .stat-icon {
            background: rgba(255, 145, 77, 0.12);
            color: var(--orange-500);
        }

        .stat-card.purple .stat-icon {
            background: rgba(168, 85, 247, 0.12);
            color: var(--purple-500);
        }

        .stat-icon svg {
            width: 20px;
            height: 20px;
        }

        .stat-value {
            font-size: 32px;
            font-weight: 800;
            color: var(--text-primary);
            letter-spacing: -0.02em;
            line-height: 1;
        }

        .stat-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            margin-top: 6px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .command-bar {
            /*
            display: flex;
            align-items: center;
            gap: 16px;
            */
            padding: 14px 18px;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            margin-bottom: 20px;
            box-shadow: var(--card-shadow);
            flex-wrap: wrap;
        }

        .search-box {
            position: relative;
            flex: 1;
            min-width: 320px;
        }

        .search-tags-container {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            min-height: 46px;
            padding: 6px 12px 6px 44px;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            transition: all 0.25s var(--ease);
            cursor: text;
        }

        .search-tags-container:focus-within {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-dim);
        }

        .search-tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 30px;
            padding: 0 10px;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            background: var(--accent-dim);
            border: 1px solid var(--accent);
            border-radius: 6px;
            animation: tagPop 0.2s var(--ease-spring);
            white-space: nowrap;
        }

        .search-group {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            border: 1.5px dashed var(--accent);
            border-radius: 8px;
            background: var(--accent-dim);
            animation: tagPop 0.25s var(--ease-spring);
            position: relative;
        }

        .search-group .search-tag {
            animation: none;
            background: var(--bg-elevated);
        }

        .search-group-close {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            background: none;
            border: 1px solid transparent;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 50%;
            transition: all 0.15s;
            padding: 0;
            margin-left: 2px;
            flex-shrink: 0;
        }

        .search-group-close:hover {
            background: rgba(239, 68, 68, 0.12);
            border-color: rgba(239, 68, 68, 0.3);
            color: #ef4444;
        }

        .search-group-close svg {
            width: 10px;
            height: 10px;
        }

        .search-op {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 36px;
            height: 24px;
            padding: 0 8px;
            font-size: 10px;
            font-weight: 700;
            font-family: inherit;
            letter-spacing: 0.5px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s var(--ease);
            border: 1px solid;
            flex-shrink: 0;
            position: relative;
            user-select: none;
        }

        .search-op.op-and {
            background: color-mix(in srgb, var(--accent) 12%, transparent);
            color: var(--accent);
            border-color: color-mix(in srgb, var(--accent) 35%, transparent);
        }

        .search-op.op-and:hover {
            background: color-mix(in srgb, var(--accent) 22%, transparent);
            border-color: var(--accent);
            transform: scale(1.05);
        }

        .search-op.op-or {
            background: color-mix(in srgb, #f59e0b 10%, transparent);
            color: #b45309;
            border-color: color-mix(in srgb, #f59e0b 35%, transparent);
        }

        [data-theme="dark"] .search-op.op-or {
            color: #fbbf24;
        }

        .search-op.op-or:hover {
            background: color-mix(in srgb, #f59e0b 20%, transparent);
            border-color: #f59e0b;
            transform: scale(1.05);
        }

        .search-op-tooltip {
            display: none;
            position: absolute;
            bottom: calc(100% + 6px);
            left: 50%;
            transform: translateX(-50%);
            padding: 4px 8px;
            font-size: 10px;
            font-weight: 500;
            letter-spacing: 0;
            white-space: nowrap;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 5px;
            color: var(--text-secondary);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            z-index: 10;
            pointer-events: none;
        }

        .search-op:hover .search-op-tooltip {
            display: block;
        }

        .search-new-group-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            height: 26px;
            padding: 0 10px;
            font-size: 11px;
            font-weight: 600;
            font-family: inherit;
            color: var(--text-muted);
            background: var(--bg-elevated);
            border: 1px dashed var(--border-color);
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s var(--ease);
            white-space: nowrap;
            flex-shrink: 0;
        }

        .search-new-group-btn:hover {
            color: var(--accent);
            border-color: var(--accent);
            background: var(--accent-dim);
        }

        .search-new-group-btn svg {
            width: 12px;
            height: 12px;
        }

        @keyframes tagPop {
            from {
                transform: scale(0.8);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .search-tag-remove {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            background: none;
            border: none;
            color: var(--accent);
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.15s;
            padding: 0;
        }

        .search-tag-remove:hover {
            background: var(--accent);
            color: white;
        }

        .search-tag-remove svg {
            width: 12px;
            height: 12px;
        }

        .search-input-inline {
            flex: 1;
            min-width: 100px;
            height: 30px;
            padding: 0;
            font-size: 14px;
            font-family: inherit;
            color: var(--text-primary);
            background: transparent;
            border: none;
            outline: none;
        }

        .search-input-inline::placeholder {
            color: var(--text-muted);
        }

        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            pointer-events: none;
            z-index: 1;
        }

        .search-hint {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: var(--text-muted);
            pointer-events: none;
        }

        .search-hint kbd {
            padding: 2px 6px;
            font-size: 10px;
            font-weight: 600;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: 4px;
        }

        .bar-divider {
            width: 1px;
            height: 28px;
            background: var(--border-color);
        }

        .quick-filters {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 1rem;
        }

        .filter-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 36px;
            padding: 0 14px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            background: transparent;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s var(--ease);
        }

        .filter-chip:hover {
            color: var(--text-secondary);
            border-color: var(--border-light);
            background: var(--bg-hover);
        }

        .filter-chip.active {
            color: var(--accent);
            border-color: var(--accent);
            background: var(--accent-dim);
        }

        .filter-chip svg {
            width: 15px;
            height: 15px;
        }

        .result-count {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--text-muted);
        }

        .result-count strong {
            font-size: 17px;
            font-weight: 700;
            color: var(--accent);
        }

        .table-container {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--card-shadow);
        }

        .table-scroll {
            max-height: 80vh;
            overflow: auto;
        }

        /* Hide the NATIVE horizontal scrollbar — we use our custom sticky one
           below the table instead. Vertical scrolling still works normally.
           Webkit-based browsers (Chrome / Safari / Edge / Opera) supported here. */
        .table-scroll::-webkit-scrollbar:horizontal {
            height: 0;
            display: none;
        }

        .table-scroll::-webkit-scrollbar {
            width: 8px;
            height: 0;  /* horizontal hidden — see rule above */
        }

        .table-scroll::-webkit-scrollbar-track {
            background: var(--scrollbar-track);
        }

        .table-scroll::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb);
            border-radius: 4px;
        }

        .table-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--scrollbar-thumb-hover);
        }

        #dossierTable {
            width: 100%;
            min-width: 1740px;
            border-collapse: collapse;
        }

        #dossierTable thead th {
            position: sticky;
            top: 0;
            z-index: 10;
            background: var(--table-header-bg);
            color: var(--table-header-text);
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 16px 14px;
            text-align: left;
            white-space: nowrap;
            border-bottom: 1px solid var(--border-color);
        }

        #dossierTable tbody td {
            position: relative;
            z-index: 1;
        }

        /* Column 1: Checkbox — sticky */
        #dossierTable th:nth-child(1),
        #dossierTable tbody td:nth-child(1) {
            position: sticky;
            left: 0;
            z-index: 5;
            background-color: var(--bg-primary, #fff) !important;
            width: 40px;
            min-width: 40px;
            max-width: 40px;
            text-align: center;
            padding: 8px 6px;
        }

        /* Column 2: University Name — sticky */
        #dossierTable th:nth-child(2),
        #dossierTable tbody td:nth-child(2) {
            position: sticky;
            left: 40px;
            z-index: 5;
            background-color: var(--bg-primary, #fff) !important;
        }

        /* Column 3: School Name — sticky */
        #dossierTable th:nth-child(3),
        #dossierTable tbody td:nth-child(3) {
            position: sticky;
            left: 190px;
            z-index: 5;
            background-color: var(--bg-primary, #fff) !important;
        }

        /* Column 4: Program Name — sticky with shadow */
        #dossierTable th:nth-child(4),
        #dossierTable tbody td:nth-child(4) {
            position: sticky;
            left: 340px;
            z-index: 5;
            box-shadow: 4px 0 8px rgba(0, 0, 0, 0.1);
            background-color: var(--bg-primary, #fff) !important;
        }

        /* Corner cells (frozen header + frozen column) need highest z-index */
        #dossierTable thead th:nth-child(1),
        #dossierTable thead th:nth-child(2),
        #dossierTable thead th:nth-child(3),
        #dossierTable thead th:nth-child(4) {
            z-index: 15;
        }

        /* Shadow on column 4 for visual depth */
        #dossierTable th:nth-child(4),
        #dossierTable td:nth-child(4) {
            box-shadow: 4px 0 8px rgba(0, 0, 0, 0.15);
        }

        /* Dark mode sticky bg fix */
        [data-theme="dark"] #dossierTable th:nth-child(1),
        [data-theme="dark"] #dossierTable tbody td:nth-child(1),
        [data-theme="dark"] #dossierTable th:nth-child(2),
        [data-theme="dark"] #dossierTable tbody td:nth-child(2),
        [data-theme="dark"] #dossierTable th:nth-child(3),
        [data-theme="dark"] #dossierTable tbody td:nth-child(3),
        [data-theme="dark"] #dossierTable th:nth-child(4),
        [data-theme="dark"] #dossierTable tbody td:nth-child(4) {
            background-color: var(--bg-primary, #1a1a2e) !important;
        }

        /* Narrow columns: Duration (12) and Credential Evaluation (13) */
        #dossierTable th:nth-child(12),
        #dossierTable th:nth-child(13) {
            max-width: 80px;
            white-space: normal;
            word-wrap: break-word;
            text-align: center;
        }

        #dossierTable td:nth-child(12),
        #dossierTable td:nth-child(13) {
            max-width: 80px;
            white-space: nowrap;
            text-align: center;
        }

        /* Row checkbox styling */
        .row-select-cb,
        .select-all-cb {
            width: 16px;
            height: 16px;
            accent-color: var(--accent);
            cursor: pointer;
            margin: 0;
            vertical-align: middle;
        }

        #dossierTable tbody tr.row-unchecked {
            opacity: 0.45;
            transition: opacity 0.15s;
        }

        #dossierTable tbody tr.row-unchecked:hover {
            opacity: 0.7;
        }

        .export-selection-info {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 500;
        }

        .export-selection-count {
            font-weight: 700;
            color: var(--accent);
        }

        #dossierTable tbody td {
            padding: 14px;
            font-size: 13px;
            color: var(--text-secondary);
            border-bottom: 1px solid var(--border-color);
            transition: all 0.15s;
        }

        #dossierTable tbody tr {
            transition: all 0.2s var(--ease);
        }

        #dossierTable tbody tr:hover {
            background: var(--table-row-hover);
        }

        #dossierTable tbody tr:hover td {
            color: var(--text-primary);
        }

        .cell-primary {
            font-weight: 600;
            color: var(--text-primary);
        }

        .cell-truncate {
            max-width: 180px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .cell-mono {
            font-family: 'SF Mono', 'Monaco', monospace;
            font-size: 12px;
            font-weight: 500;
            color: var(--accent);
        }

        .status-dot {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            font-size: 12px;
            font-weight: 700;
        }

        .status-dot.yes {
            background: var(--gradient-green);
            color: white;
            box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
        }

        .status-dot.no {
            background: var(--bg-elevated);
            color: var(--text-muted);
            border: 1px solid var(--border-color);
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            height: 24px;
            padding: 0 10px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            border-radius: 6px;
        }

        .badge-stem {
            background: var(--gradient-purple);
            color: white;
            box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
        }

        .link-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 7px 11px;
            font-size: 12px;
            font-weight: 600;
            color: var(--accent);
            background: var(--accent-dim);
            border-radius: 6px;
            text-decoration: none;
            transition: all 0.2s var(--ease);
        }

        .link-btn:hover {
            background: var(--accent);
            color: white;
            transform: translateX(3px);
        }

        .link-btn svg {
            width: 14px;
            height: 14px;
        }

        .dataTables_wrapper {
            font-size: 14px;
        }

        .dataTables_filter,
        .dt-buttons {
            display: none !important;
        }

        .dataTables_info {
            padding: 14px 18px;
            font-size: 13px;
            color: var(--text-muted);
        }

        .dataTables_paginate {
            padding: 14px 18px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            flex: 1;
        }

        .table-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--bg-elevated);
            border-top: 1px solid var(--border-color);
            flex-wrap: wrap;
        }

        .dataTables_paginate .paginate_button {
            min-width: 36px;
            height: 36px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            background: var(--bg-surface);
            border: 1px solid var(--border-color) !important;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s var(--ease);
        }

        .dataTables_paginate .paginate_button:hover {
            background: var(--accent-dim);
            border-color: var(--accent) !important;
            color: var(--accent);
        }

        .dataTables_paginate .paginate_button.current {
            background: var(--gradient-teal) !important;
            border-color: transparent !important;
            color: white !important;
            box-shadow: 0 0 20px -4px var(--accent-glow);
        }

        .form-wrapper {
            max-width: 680px;
            margin: 0 auto;
        }

        .form-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: var(--card-shadow);
        }

        .form-header {
            position: relative;
            padding: 36px;
            background: var(--gradient-teal);
            text-align: center;
            overflow: hidden;
        }

        .form-header::before {
            content: '';
            position: absolute;
            inset: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
        }

        .form-header h2 {
            position: relative;
            font-size: 26px;
            font-weight: 800;
            color: white;
            margin-bottom: 6px;
        }

        .form-header p {
            position: relative;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.8);
        }

        .form-body {
            padding: 36px;
        }

        .form-group {
            margin-bottom: 22px;
        }

        .form-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .form-label-hint {
            font-weight: 400;
            color: var(--text-muted);
        }

        .form-input,
        .form-select {
            width: 100%;
            height: 46px;
            padding: 0 14px;
            font-size: 14px;
            font-family: inherit;
            color: var(--text-primary);
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            transition: all 0.25s var(--ease);
        }

        .form-input:focus,
        .form-select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-dim);
        }

        .form-input::placeholder {
            color: var(--text-muted);
        }

        .form-row {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 18px;
        }

        .upload-zone {
            position: relative;
            padding: 36px;
            border: 2px dashed var(--border-light);
            border-radius: var(--radius-lg);
            text-align: center;
            cursor: pointer;
            transition: all 0.3s var(--ease);
            background: var(--bg-elevated);
        }

        .upload-zone:hover {
            border-color: var(--accent);
            background: var(--accent-dim);
        }

        .upload-zone.dragover {
            border-color: var(--accent);
            background: var(--accent-dim);
            transform: scale(1.02);
        }

        .upload-zone input[type="file"] {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
        }

        .upload-icon {
            width: 52px;
            height: 52px;
            margin: 0 auto 16px;
            color: var(--accent);
        }

        .upload-text {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 6px;
        }

        .upload-hint {
            font-size: 13px;
            color: var(--text-muted);
        }

        .file-preview {
            display: none;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            margin-top: 14px;
        }

        .file-preview.show {
            display: flex;
        }

        .file-icon {
            width: 42px;
            height: 42px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--gradient-teal);
            color: white;
            border-radius: var(--radius-md);
        }

        .file-info {
            flex: 1;
        }

        .file-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .file-size {
            font-size: 12px;
            color: var(--text-muted);
        }

        .file-remove {
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: var(--radius-md);
            transition: all 0.2s;
        }

        .file-remove:hover {
            background: rgba(239, 68, 68, 0.12);
            color: var(--red-500);
        }

        .file-input-wrapper {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .file-input-hint {
            font-size: 12px;
            color: var(--text-muted);
        }

        .info-banner {
            background: var(--accent-dim);
            border: 1px solid var(--accent);
            border-radius: var(--radius-lg);
            padding: 16px;
        }

        .info-banner ul {
            margin: 0;
            padding: 0;
            list-style-position: inside;
        }

        .progress-section {
            margin-top: 24px;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .progress-bar {
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            height: 10px;
            overflow: hidden;
        }

        #progressFill {
            background: var(--accent);
            height: 100%;
            width: 0%;
            transition: width 0.3s ease;
        }

        #progressLogs {
            margin-top: 16px;
            max-height: 200px;
            overflow-y: auto;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 12px;
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            font-size: 12px;
            line-height: 1.6;
            color: var(--text-primary);
        }

        #progressLogs::-webkit-scrollbar {
            width: 8px;
        }

        #progressLogs::-webkit-scrollbar-track {
            background: var(--scrollbar-track);
        }

        #progressLogs::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb);
            border-radius: 4px;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes shimmer {
            0% {
                transform: translateX(-100%);
            }

            100% {
                transform: translateX(100%);
            }
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 28px;
            padding-top: 22px;
            border-top: 1px solid var(--border-color);
        }

        .select2-container {
            width: 100% !important;
        }

        .select2-container--default .select2-selection--single,
        .select2-container--default .select2-selection--multiple {
            min-height: 46px !important;
            background: var(--select2-bg) !important;
            border: 1px solid var(--select2-border) !important;
            border-radius: var(--radius-md) !important;
        }

        .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height: 44px !important;
            padding-left: 14px !important;
            color: var(--select2-text) !important;
            font-size: 14px !important;
        }

        .select2-container--default .select2-selection--single .select2-selection__arrow {
            height: 44px !important;
        }

        .select2-container--default.select2-container--focus .select2-selection--single,
        .select2-container--default.select2-container--focus .select2-selection--multiple {
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 3px var(--accent-dim) !important;
        }

        .select2-dropdown {
            background: var(--select2-dropdown) !important;
            border: 1px solid var(--select2-border) !important;
            border-radius: var(--radius-md) !important;
            box-shadow: var(--card-shadow-hover) !important;
        }

        .select2-results__option {
            color: var(--text-secondary) !important;
            padding: 10px 14px !important;
        }

        .select2-results__option--highlighted[aria-selected] {
            background: var(--accent) !important;
            color: white !important;
        }

        .select2-search--dropdown .select2-search__field {
            background: var(--bg-input) !important;
            border: 1px solid var(--border-color) !important;
            color: var(--text-primary) !important;
            border-radius: var(--radius-sm) !important;
        }

        .results-section {
            margin-top: 28px;
            display: none;
        }

        .results-section.show {
            display: block;
        }

        .results-section-full {
            margin-top: 28px;
            display: none;
            width: 100%;
        }

        .results-section-full.show {
            display: block;
        }

        .result-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            overflow: hidden;
            margin-bottom: 18px;
            box-shadow: var(--card-shadow);
            transition: all 0.3s var(--ease);
        }

        .result-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--card-shadow-hover);
        }

        .result-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 22px;
            background: var(--bg-elevated);
            border-bottom: 1px solid var(--border-color);
        }

        .result-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .result-badge {
            font-size: 12px;
            font-weight: 600;
            padding: 5px 11px;
            background: var(--accent-dim);
            color: var(--accent);
            border-radius: 6px;
        }

        .result-body {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1px;
            background: var(--border-color);
        }

        .result-body.full-width {
            grid-template-columns: 1fr;
        }

        .result-item {
            padding: 14px 22px;
            background: var(--bg-surface);
        }

        .result-item.full-width {
            grid-column: 1 / -1;
            padding: 20px 22px;
        }

        .result-item-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            margin-bottom: 5px;
        }

        .result-item-value {
            font-size: 13px;
            color: var(--text-primary);
            font-weight: 500;
            line-height: 1.5;
        }

        .result-item-value a {
            word-break: break-all;
        }

        .nested-object {
            margin-left: 16px;
            border-left: 2px solid var(--border-color);
            padding-left: 12px;
            margin-top: 8px;
        }

        .nested-item {
            margin-bottom: 8px;
        }

        .nested-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 4px;
        }

        .nested-value {
            font-size: 13px;
            color: var(--text-primary);
        }

        .array-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-top: 4px;
        }

        .array-item {
            background: var(--bg-elevated);
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
        }

        .json-view {
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            font-size: 12px;
            line-height: 1.6;
            color: var(--text-primary);
            max-height: 500px;
            overflow-y: auto;
        }

        .json-view::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        .json-view::-webkit-scrollbar-track {
            background: var(--scrollbar-track);
        }

        .json-view::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb);
            border-radius: 4px;
        }

        .json-toggle-container {
            margin-top: 12px;
        }

        .drawer-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(6px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s var(--ease);
        }

        .drawer-backdrop.visible {
            opacity: 1;
            visibility: visible;
        }

        .drawer {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            width: 400px;
            background: var(--bg-surface);
            border-left: 1px solid var(--border-color);
            z-index: 201;
            transform: translateX(100%);
            transition: transform 0.4s var(--ease-out);
            display: flex;
            flex-direction: column;
        }

        .drawer.open {
            transform: translateX(0);
        }

        .drawer-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 22px;
            border-bottom: 1px solid var(--border-color);
        }

        .drawer-title {
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .drawer-close {
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }

        .drawer-close:hover {
            background: rgba(239, 68, 68, 0.12);
            border-color: var(--red-500);
            color: var(--red-500);
        }

        .drawer-body {
            flex: 1;
            overflow-y: auto;
            padding: 22px;
        }

        .drawer-section {
            margin-bottom: 24px;
        }

        .drawer-section.usa-region-section {
            background: var(--accent-dim);
            border: 1px solid var(--accent);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 24px;
            animation: slideInHighlight 0.4s var(--ease-out);
        }

        @keyframes slideInHighlight {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .drawer-section-label {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            margin-bottom: 10px;
        }

        .drawer-footer {
            padding: 22px;
            border-top: 1px solid var(--border-color);
            display: flex;
            gap: 12px;
        }

        .drawer-footer .btn {
            flex: 1;
        }

        .spinner {
            width: 18px;
            height: 18px;
            border: 2px solid transparent;
            border-top-color: currentColor;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--scrollbar-track);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb);
            border-radius: 5px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--scrollbar-thumb-hover);
        }

        @media (max-width: 1200px) {
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 1024px) {
            .header-inner {
                padding: 0 20px;
                gap: 16px;
            }

            .main {
                padding: 24px 20px;
            }

            .search-box {
                min-width: 100%;
            }
        }

        @media (max-width: 768px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .drawer {
                width: 100%;
            }

            .nav-tabs {
                display: none;
            }

            .hero-title {
                font-size: 28px;
            }

            .search-group {
                gap: 4px;
                padding: 3px 6px;
            }

            .search-tag {
                height: 26px;
                padding: 0 8px;
                font-size: 12px;
            }

            .search-op {
                min-width: 30px;
                height: 20px;
                padding: 0 6px;
                font-size: 9px;
            }

            .search-new-group-btn {
                height: 22px;
                padding: 0 8px;
                font-size: 10px;
            }

            .search-hint {
                display: none;
            }
        }

        /* Modal Styles */
        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 300;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s var(--ease);
        }

        .modal-backdrop.visible {
            opacity: 1;
            visibility: visible;
        }

        .modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            width: 90%;
            max-width: 700px;
            max-height: 80vh;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-xl);
            box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.5);
            z-index: 301;
            opacity: 0;
            visibility: hidden;
            transition: all 0.4s var(--ease-out);
            display: flex;
            flex-direction: column;
        }

        .modal.open {
            overflow: auto;
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .modal-content {
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .modal-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            padding: 28px;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-elevated);
        }

        .modal-title {
            font-size: 20px;
            font-weight: 800;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .modal-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .modal-close {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .modal-close:hover {
            background: rgba(239, 68, 68, 0.12);
            border-color: var(--red-500);
            color: var(--red-500);
        }

        .modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 28px;
        }

        .modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .modal-body::-webkit-scrollbar-track {
            background: var(--scrollbar-track);
        }

        .modal-body::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb);
            border-radius: 4px;
        }

        .modal-body::-webkit-scrollbar-thumb:hover {
            background: var(--scrollbar-thumb-hover);
        }

        .waiver-content {
            font-size: 14px;
            line-height: 1.7;
            color: var(--text-secondary);
            white-space: pre-wrap;
            word-wrap: break-word;
            background: var(--bg-elevated);
            padding: 20px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
        }

        .loading-spinner {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px;
            gap: 16px;
        }

        .loading-spinner p {
            font-size: 14px;
            color: var(--text-muted);
        }

        .modal-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            padding: 22px 28px;
            border-top: 1px solid var(--border-color);
            background: var(--bg-elevated);
        }

        .status-dot.clickable {
            cursor: pointer;
            transition: all 0.2s var(--ease);
        }

        .status-dot.clickable:hover {
            transform: scale(1.15);
            box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
        }

        .editable-cell {
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            border-bottom: 1px dashed var(--teal-500);
            transition: background 0.2s;
        }

        .editable-cell:hover {
            background: rgba(0, 151, 178, 0.1);
        }

        @media (max-width: 768px) {
            .modal {
                width: 95%;
                max-height: 90vh;
            }

            .modal-header,
            .modal-body,
            .modal-footer {
                padding: 20px;
            }
        }

        /* ================================
   My Proofs Section Styles
================================ */

        .proofs-section {
            margin-top: 40px;
        }

        /* ---------- Section Header ---------- */

        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .section-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .section-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* ---------- Grid ---------- */

        .proofs-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 20px;
        }

        /* ---------- Card ---------- */

        .proof-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--card-shadow);
            transition: all 0.3s var(--ease);
        }

        .proof-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--card-shadow-hover);
        }

        /* ---------- Card Header ---------- */

        .proof-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
            padding: 18px;
            background: var(--bg-elevated);
            border-bottom: 1px solid var(--border-color);
            overflow: hidden;
        }

        .proof-card-title {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .proof-card-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* ---------- Card Actions ---------- */

        .proof-card-actions {
            display: flex;
            gap: 6px;
            align-items: center;
            flex-shrink: 0;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .proof-action-btn {
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s var(--ease);
        }

        .proof-action-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-dim);
        }

        .proof-action-btn.delete:hover {
            border-color: var(--red-500);
            color: var(--red-500);
            background: rgba(239, 68, 68, 0.1);
        }

        .proof-add-status-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        }

        .edit-status-pill:hover {
            transform: translateY(-1px);
            opacity: 0.9;
        }

        .proof-action-btn svg {
            width: 16px;
            height: 16px;
        }

        /* ---------- Card Body ---------- */

        .proof-card-body {
            padding: 18px;
        }

        /* ---------- Meta Info ---------- */

        .proof-meta {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px;
        }

        .proof-meta-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .proof-meta-label {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
        }

        .proof-meta-value {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }

        /* ---------- Card Footer ---------- */

        .proof-card-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 18px;
            background: var(--bg-elevated);
            border-top: 1px solid var(--border-color);
        }

        .proof-date {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* ---------- Empty State ---------- */

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            background: var(--bg-surface);
            border: 1px dashed var(--border-color);
            border-radius: var(--radius-lg);
        }

        .empty-state-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 20px;
            color: var(--text-muted);
            opacity: 0.5;
        }

        .empty-state-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .empty-state-text {
            font-size: 14px;
            color: var(--text-muted);
        }

        /* ---------- Badges ---------- */

        .badge-status {
            font-size: 11px;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 6px;
        }

        .badge-status.applied {
            background: rgba(234, 179, 8, 0.15);
            color: var(--yellow-500);
        }

        .badge-status.admitted {
            background: rgba(34, 197, 94, 0.15);
            color: var(--green-500);
        }

        /* ---------- Buttons ---------- */

        .btn-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: #fff;
            box-shadow: 0 0 30px -8px rgba(239, 68, 68, 0.4);
        }

        .btn-danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 50px -8px rgba(239, 68, 68, 0.5);
        }

        .btn-sm {
            height: 36px;
            padding: 0 14px;
            font-size: 13px;
        }

        .btn-sm svg {
            width: 16px;
            height: 16px;
        }

        /* ---------- Current File ---------- */

        .current-file-info {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            margin-bottom: 12px;
        }

        .current-file-info .file-icon {
            width: 36px;
            height: 36px;
        }

        .current-file-info .file-name {
            flex: 1;
            font-size: 13px;
            color: var(--text-primary);
            word-break: break-all;
        }

        /* ---------- Responsive ---------- */

        @media (max-width: 768px) {
            .proofs-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ================================
   Controls (Search & Per Page)
================================ */

        .proofs-controls {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .proofs-search {
            position: relative;
            flex: 1;
            min-width: 280px;
            max-width: 400px;
        }

        .proofs-search .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            pointer-events: none;
        }

        .proofs-search .form-input {
            width: 100%;
            padding-left: 44px;
        }

        .proofs-filter .form-select {
            width: auto;
            min-width: 140px;
            height: 40px;
        }

        .proofs-filter-group {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .proofs-filter-group .filter-label {
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text-secondary, #64748b);
            white-space: nowrap;
            margin-right: 2px;
        }

        .filter-pill {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 0.3rem 0.75rem;
            border-radius: 50px;
            font-size: 0.78rem;
            font-weight: 600;
            cursor: pointer;
            border: 2px solid var(--border-color, #e2e8f0);
            background: var(--bg-card, #fff);
            color: var(--text-secondary, #64748b);
            transition: all 0.2s ease;
            user-select: none;
        }

        .filter-pill:hover {
            border-color: var(--border-light, #cbd5e1);
            background: var(--bg-hover, #f8fafc);
        }

        .filter-pill.active {
            border-color: var(--teal-600, #007a91);
            background: rgba(0, 151, 178, 0.08);
            color: var(--teal-600, #007a91);
            box-shadow: 0 0 0 1px rgba(0, 151, 178, 0.15);
        }

        .filter-pill.active .pill-dot {
            background: var(--teal-600, #007a91);
        }

        .pill-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--text-muted, #94a3b8);
            transition: background 0.2s ease;
        }

        /* Color variants for status pills */
        .filter-pill[data-color="blue"].active {
            border-color: #3b82f6;
            background: rgba(59, 130, 246, 0.08);
            color: #1e40af;
            box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
        }

        .filter-pill[data-color="blue"].active .pill-dot {
            background: #3b82f6;
        }

        .filter-pill[data-color="green"].active {
            border-color: #22c55e;
            background: rgba(34, 197, 94, 0.08);
            color: #166534;
            box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15);
        }

        .filter-pill[data-color="green"].active .pill-dot {
            background: #22c55e;
        }

        .filter-pill[data-color="purple"].active {
            border-color: #a855f7;
            background: rgba(168, 85, 247, 0.08);
            color: #6b21a8;
            box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.15);
        }

        .filter-pill[data-color="purple"].active .pill-dot {
            background: #a855f7;
        }

        .filter-pill[data-color="emerald"].active {
            border-color: #10b981;
            background: rgba(16, 185, 129, 0.08);
            color: #065f46;
            box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
        }

        .filter-pill[data-color="emerald"].active .pill-dot {
            background: #10b981;
        }

        .filter-pill[data-color="amber"].active {
            border-color: #f59e0b;
            background: rgba(245, 158, 11, 0.08);
            color: #92400e;
            box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
        }

        .filter-pill[data-color="amber"].active .pill-dot {
            background: #f59e0b;
        }

        .filter-divider {
            width: 1px;
            height: 24px;
            background: var(--border-color, #e2e8f0);
            margin: 0 4px;
        }

        .filter-clear-btn {
            display: none;
            align-items: center;
            gap: 4px;
            padding: 0.25rem 0.6rem;
            border-radius: 50px;
            font-size: 0.73rem;
            font-weight: 600;
            cursor: pointer;
            border: 1px dashed var(--border-color, #e2e8f0);
            background: transparent;
            color: var(--text-muted, #94a3b8);
            transition: all 0.2s ease;
        }

        .filter-clear-btn:hover {
            border-color: #ef4444;
            color: #ef4444;
            background: rgba(239, 68, 68, 0.05);
        }

        .filter-clear-btn.visible {
            display: inline-flex;
        }

        .proofs-filters-bar {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 16px;
            background: var(--bg-card, #fff);
            border: 1px solid var(--border-color, #e2e8f0);
            border-radius: 12px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .proofs-per-page {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            color: var(--text-secondary);
        }

        .proofs-per-page .form-select {
            width: auto;
            min-width: 70px;
            height: 40px;
            padding: 0 12px;
        }

        /* ================================
   Info
================================ */

        .proofs-info {
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 16px;
        }

        .proofs-info strong {
            color: var(--accent);
            font-weight: 700;
        }

        /* ================================
   Proofs Grid
================================ */

        .proofs-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 20px;
        }

        /* ================================
   Pagination
================================ */

        .proofs-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 24px;
            padding-top: 24px;
            border-top: 1px solid var(--border-color);
        }

        .pagination-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 40px;
            padding: 0 16px;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            color: var(--text-secondary);
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s var(--ease);
        }

        .pagination-btn:hover:not(:disabled) {
            background: var(--accent-dim);
            border-color: var(--accent);
            color: var(--accent);
        }

        .pagination-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .pagination-btn svg {
            width: 16px;
            height: 16px;
        }

        .pagination-pages {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .pagination-page {
            min-width: 40px;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s var(--ease);
        }

        .pagination-page:hover {
            background: var(--accent-dim);
            border-color: var(--accent);
            color: var(--accent);
        }

        .pagination-page.active {
            background: var(--gradient-teal);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 0 20px -4px var(--accent-glow);
        }

        .pagination-ellipsis {
            min-width: 40px;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: var(--text-muted);
        }

        /* ================================
   Empty & No Results States
================================ */

        .empty-state,
        .no-results-state {
            text-align: center;
            padding: 60px 20px;
            background: var(--bg-surface);
            border: 1px dashed var(--border-color);
            border-radius: var(--radius-lg);
        }

        .no-results-state {
            border-style: solid;
        }

        .empty-state-icon,
        .no-results-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 20px;
            color: var(--text-muted);
            opacity: 0.5;
        }

        .empty-state-title,
        .no-results-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .empty-state-text,
        .no-results-text {
            font-size: 14px;
            color: var(--text-muted);
        }

        /* ================================
   Search Highlight
================================ */

        .search-highlight {
            background: rgba(0, 151, 178, 0.2);
            padding: 1px 3px;
            border-radius: 3px;
        }

        /* ================================
   Responsive
================================ */

        @media (max-width: 768px) {

            .proofs-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .proofs-search {
                max-width: none;
            }

            .proofs-per-page {
                justify-content: flex-end;
            }

            .proofs-filters-bar {
                gap: 8px;
                padding: 8px 12px;
            }

            .filter-divider {
                display: none;
            }

            .proofs-filter-group {
                width: 100%;
            }

            .proofs-grid {
                grid-template-columns: 1fr;
            }

            .proofs-pagination {
                flex-wrap: wrap;
            }

            .pagination-pages {
                order: 3;
                width: 100%;
                justify-content: center;
                margin-top: 12px;
            }
        }

        /* Approval Badge in Header */
        .approval-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .approval-badge.approved {
            background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
            color: #065f46;
            border: 1px solid #6ee7b7;
            background: green;
            color: white;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-size: 15px;
            padding: 10px;
            font-weight: bolder;
        }

        .approval-badge.not-approved {
            background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
            border: 1px solid #fca5a5;
            background: #991b1b;
            color: white;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-size: 15px;
            padding: 10px;
            font-weight: bolder;
        }

        /* Approval Badge in Meta Section */
        .badge-approval {
            display: inline-flex;
            align-items: center;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
        }

        .badge-approved {
            background: #d1fae5;
            color: #065f46;
        }

        .badge-not-approved {
            background: #fee2e2;
            color: #991b1b;
        }

/* ============================================================================
   HUBSPOT-GRADE REBUILD
   ============================================================================
   Visual language: HubSpot CRM (2024 redesign).
     - Navy text on white surfaces, 1px soft borders, no shadows or gradients
     - Brand accent (SEED teal) used sparingly — primary CTAs, active state,
       link hovers. NOT in KPIs, cell backgrounds, or row hover.
     - Flat pastel status pills with optional text labels
     - Dense tables, clean rows, no column tinting, no zebra striping
     - White sidebar with specific hover/active states
     - Tabular numerics throughout for fees / counts / dates

   Layered on top of the legacy CSS — every legacy class still exists so JS
   keeps working. This block only re-skins.
   ============================================================================ */

/* ---- Tokens (HubSpot palette adapted to SEED teal) -------------------- */
:root {
    --hs-sidebar-w: 232px;
    --hs-sidebar-w-collapsed: 60px;
    --hs-topbar-h: 56px;
    --hs-row-h: 40px;
    --hs-content-pad: 24px;

    /* Border-radius scale */
    --hs-radius-sm: 4px;
    --hs-radius-md: 6px;
    --hs-radius-lg: 8px;
}

[data-theme="light"] {
    /* Surfaces */
    --hs-canvas:   #f5f8fa;   /* the page background — HubSpot's signature very-pale-blue */
    --hs-surface:  #ffffff;   /* cards, sidebar, topbar, table */
    --hs-elevated: #f5f8fa;   /* table header bg, hover surfaces */
    --hs-hover:    #eaf0f6;   /* row hover, nav hover */

    /* Borders */
    --hs-border-strong: #cbd6e2;   /* table cell borders, input borders */
    --hs-border:        #dfe3eb;   /* default subtle border */
    --hs-border-faint:  #eaf0f6;

    /* Text — HubSpot's signature dark navy palette */
    --hs-text:           #33475b;   /* primary */
    --hs-text-strong:    #2d3e50;   /* extra-bold headings */
    --hs-text-secondary: #516f90;
    --hs-text-muted:     #7c98b6;
    --hs-text-link:      #00a4bd;   /* HubSpot link teal — close to SEED's */

    /* SEED brand teal (kept) */
    --hs-accent:         #0097b2;
    --hs-accent-strong:  #007a91;
    --hs-accent-subtle:  #e6f5f8;   /* very pale teal for active backgrounds */
    --hs-accent-faint:   #f0fafc;

    /* Semantic — flat pastel, no gradients */
    --hs-success-fg: #00735c;
    --hs-success-bg: #d6f0e0;
    --hs-warning-fg: #985f00;
    --hs-warning-bg: #fff1d6;
    --hs-danger-fg:  #c8092f;
    --hs-danger-bg:  #ffd6dc;
    --hs-info-fg:    #00567a;
    --hs-info-bg:    #d6e9f5;
    --hs-violet-fg:  #5e3a8e;
    --hs-violet-bg:  #ece4f7;
    --hs-neutral-fg: var(--hs-text-secondary);
    --hs-neutral-bg: #eaf0f6;
}

[data-theme="dark"] {
    --hs-canvas:    #0e1521;
    --hs-surface:   #16202d;
    --hs-elevated:  #1e2a3b;
    --hs-hover:     #243349;

    --hs-border-strong: rgba(255, 255, 255, 0.10);
    --hs-border:        rgba(255, 255, 255, 0.06);
    --hs-border-faint:  rgba(255, 255, 255, 0.04);

    --hs-text:           #d4dde9;
    --hs-text-strong:    #ffffff;
    --hs-text-secondary: #94a8c0;
    --hs-text-muted:     #6f87a3;
    --hs-text-link:      #5dd3e6;

    --hs-accent:         #00bcd9;
    --hs-accent-strong:  #00d4f0;
    --hs-accent-subtle:  rgba(0, 188, 217, 0.14);
    --hs-accent-faint:   rgba(0, 188, 217, 0.07);

    --hs-success-fg: #6ddca4;
    --hs-success-bg: rgba(109, 220, 164, 0.14);
    --hs-warning-fg: #ffc857;
    --hs-warning-bg: rgba(255, 200, 87, 0.14);
    --hs-danger-fg:  #ff8497;
    --hs-danger-bg:  rgba(255, 132, 151, 0.14);
    --hs-info-fg:    #74bfdf;
    --hs-info-bg:    rgba(116, 191, 223, 0.14);
    --hs-violet-fg:  #b89cdb;
    --hs-violet-bg:  rgba(184, 156, 219, 0.14);
    --hs-neutral-fg: var(--hs-text-secondary);
    --hs-neutral-bg: rgba(255, 255, 255, 0.05);
}

/* Apply the HubSpot palette to existing CSS-vars so legacy components inherit cleanly */
[data-theme="light"] {
    --bg-base: var(--hs-canvas);
    --bg-surface: var(--hs-surface);
    --bg-elevated: var(--hs-elevated);
    --bg-hover: var(--hs-hover);
    --bg-input: var(--hs-surface);
    --border-color: var(--hs-border);
    --border-light: var(--hs-border-strong);
    --text-primary: var(--hs-text);
    --text-secondary: var(--hs-text-secondary);
    --text-muted: var(--hs-text-muted);
    --accent: var(--hs-accent);
    --accent-hover: var(--hs-accent-strong);
    --accent-dim: var(--hs-accent-subtle);
    --table-row-hover: var(--hs-hover);
}
[data-theme="dark"] {
    --bg-base: var(--hs-canvas);
    --bg-surface: var(--hs-surface);
    --bg-elevated: var(--hs-elevated);
    --bg-hover: var(--hs-hover);
    --bg-input: var(--hs-elevated);
    --border-color: var(--hs-border);
    --border-light: var(--hs-border-strong);
    --text-primary: var(--hs-text);
    --text-secondary: var(--hs-text-secondary);
    --text-muted: var(--hs-text-muted);
    --accent: var(--hs-accent);
    --accent-hover: var(--hs-accent-strong);
    --accent-dim: var(--hs-accent-subtle);
    --table-row-hover: var(--hs-hover);
}

body {
    background: var(--hs-canvas) !important;
    color: var(--hs-text) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Shell (single column, no sidebar) ----------------------------------- */
.crm-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--hs-canvas);
}

/* Hide all the legacy sidebar styles — sidebar markup has been removed */
.crm-sidebar,
.crm-sidebar-brand,
.crm-sidebar-brand-text,
.crm-sidebar-collapse,
.crm-sidebar-section-label,
.crm-sidebar-nav,
.crm-sidebar-footer,
.crm-mobile-menu { display: none !important; }

/* ---- Topbar (brand left, actions + utility right) ----------------------- */
.crm-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--hs-surface);
    border-bottom: 1px solid var(--hs-border);
    min-height: var(--hs-topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 var(--hs-content-pad);
}

.crm-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.crm-topbar-brand .logo-mark {
    width: 32px;
    height: 32px;
    border-radius: var(--hs-radius-md);
    background: var(--hs-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.crm-topbar-brand .logo-mark svg { width: 16px; height: 16px; }

.crm-topbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.crm-topbar-brand-text .logo-text {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--hs-text-strong);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.crm-topbar-page {
    font-size: 0.7rem;
    color: var(--hs-text-secondary);
    margin-top: 1px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-topbar-spacer { flex: 1; }

.crm-topbar .back-btn {
    width: 30px; height: 30px;
    border-radius: var(--hs-radius-md);
    border: 1px solid var(--hs-border);
    background: var(--hs-surface);
    color: var(--hs-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 100ms;
}
.crm-topbar .back-btn:hover { background: var(--hs-hover); color: var(--hs-text); }
.crm-topbar .back-btn svg { width: 13px; height: 13px; }

.crm-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.crm-topbar-actions .btn {
    font-size: 0.79rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--hs-radius-md);
    background-image: none;
    box-shadow: none;
    transition: all 100ms ease;
    line-height: 1.4;
    height: auto;
}
.crm-topbar-actions .btn svg { width: 13px; height: 13px; }
.crm-topbar-actions .btn.btn-ghost {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    color: var(--hs-text);
}
.crm-topbar-actions .btn.btn-ghost:hover {
    background: var(--hs-hover);
    border-color: var(--hs-border-strong);
}
.crm-topbar-actions .btn.btn-accent {
    background: var(--hs-accent);
    color: #fff;
    border: 1px solid var(--hs-accent);
}
.crm-topbar-actions .btn.btn-accent:hover {
    background: var(--hs-accent-strong);
    border-color: var(--hs-accent-strong);
}
.crm-topbar-actions .export-selection-info {
    font-size: 0.76rem;
    color: var(--hs-text-secondary);
    padding: 0 4px;
    font-weight: 500;
}
.crm-topbar-actions .export-selection-count {
    color: var(--hs-text-strong);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Utility cluster (theme + user badge) sits to the right of the action buttons,
   separated by a soft divider */
.crm-topbar-utility {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    margin-left: 4px;
    border-left: 1px solid var(--hs-border);
    height: 28px;
}
.crm-topbar-utility .theme-toggle {
    width: 30px; height: 30px;
    border-radius: var(--hs-radius-md);
    border: 1px solid var(--hs-border-strong);
    background: var(--hs-surface);
    color: var(--hs-text-secondary);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 100ms ease;
}
.crm-topbar-utility .theme-toggle:hover {
    background: var(--hs-hover);
    color: var(--hs-text);
}
.crm-topbar-utility .theme-toggle svg { width: 13px; height: 13px; }
.crm-topbar-utility .user-level-badge {
    background: var(--hs-elevated);
    border: 1px solid var(--hs-border);
    border-radius: 999px;
    padding: 4px 10px 4px 8px;
    font-size: 0.74rem;
    color: var(--hs-text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.4;
}
.crm-topbar-utility .user-level-badge svg { color: var(--hs-text-secondary); }

/* ---- Main / content area --------------------------------------------- */
.main {
    padding: var(--hs-content-pad) !important;
    max-width: none !important;
    margin: 0 !important;
    background: var(--hs-canvas);
}

.tab-panel .page-hero {
    padding: 0 0 16px 0;
    background: none;
    border: none;
    text-align: left;
}
.tab-panel .page-hero .hero-title {
    font-size: 1.4rem;
    background: none;
    -webkit-text-fill-color: var(--hs-text-strong);
    color: var(--hs-text-strong);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.tab-panel .page-hero .hero-subtitle {
    font-size: 0.84rem;
    color: var(--hs-text-secondary);
}

/* ---- CRM page header (Dossier) --------------------------------------- */
.crm-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.crm-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hs-text-strong);
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin: 0 0 3px 0;
}
.crm-page-subtitle {
    font-size: 0.84rem;
    color: var(--hs-text-secondary);
    margin: 0;
}
.crm-page-header-right .result-count {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-md);
    padding: 6px 12px;
    font-size: 0.76rem;
    color: var(--hs-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.crm-page-header-right .result-count strong {
    color: var(--hs-text-strong);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* ---- KPI strip — flat cards (HubSpot Dashboard tiles) ----------------- */
.crm-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.crm-kpi {
    /* Default (primary teal) — entire card is the colored tile */
    background: #d6eef3 !important;
    border: 1px solid rgba(0, 151, 178, 0.22) !important;
    border-radius: var(--hs-radius-lg) !important;
    padding: 18px 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    color: var(--hs-text-strong) !important;
    box-shadow: none !important;
    transition: border-color 120ms ease, transform 120ms ease;
    position: relative;
    overflow: hidden !important;
    min-height: 90px;
}

/* Light-mode tone variants — full-card pastels */
.crm-kpi[data-tone="info"]   { background: #d8e8f5 !important; border-color: rgba(59, 130, 246, 0.22) !important; }
.crm-kpi[data-tone="warn"]   { background: #fdebcb !important; border-color: rgba(245, 158, 11, 0.25) !important; }
.crm-kpi[data-tone="violet"] { background: #ebe0f7 !important; border-color: rgba(139, 92, 246, 0.25) !important; }

/* Wipe out any decorative ::before/::after from prior versions */
.crm-kpi::before, .crm-kpi::after { content: none !important; display: none !important; }

.crm-kpi:hover {
    border-color: rgba(0, 151, 178, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

/* Icon becomes a large watermark in the corner — fills visual presence,
   stays out of the way of the value/label */
.crm-kpi-icon {
    position: absolute !important;
    top: 50% !important;
    right: -10px !important;
    transform: translateY(-50%) !important;
    width: 88px !important;
    height: 88px !important;
    background: transparent !important;
    color: rgba(0, 151, 178, 0.22) !important;
    border: none !important;
    flex-shrink: 0;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.crm-kpi-icon svg {
    width: 88px !important;
    height: 88px !important;
    stroke-width: 1.4 !important;
}

/* Light-mode watermark colors per tone */
.crm-kpi[data-tone="info"]   .crm-kpi-icon { background: transparent !important; color: rgba(59, 130, 246, 0.22) !important; }
.crm-kpi[data-tone="warn"]   .crm-kpi-icon { background: transparent !important; color: rgba(245, 158, 11, 0.28) !important; }
.crm-kpi[data-tone="violet"] .crm-kpi-icon { background: transparent !important; color: rgba(139, 92, 246, 0.25) !important; }

/* Dark-mode: solid dark-tinted full cards (NOT rgba on bg, but rgba on watermark icon) */
[data-theme="dark"] .crm-kpi {
    background: #0c4555 !important;
    border-color: rgba(0, 188, 217, 0.30) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .crm-kpi[data-tone="info"]   { background: #1f3852 !important; border-color: rgba(147, 197, 253, 0.28) !important; }
[data-theme="dark"] .crm-kpi[data-tone="warn"]   { background: #3d2e15 !important; border-color: rgba(251, 191, 36, 0.28) !important; }
[data-theme="dark"] .crm-kpi[data-tone="violet"] { background: #2c1f44 !important; border-color: rgba(196, 181, 253, 0.28) !important; }
[data-theme="dark"] .crm-kpi:hover {
    border-color: rgba(0, 188, 217, 0.6) !important;
    box-shadow: 0 2px 12px rgba(0, 188, 217, 0.15) !important;
}

[data-theme="dark"] .crm-kpi-icon                            { background: transparent !important; color: rgba(93, 211, 230, 0.32) !important; border: none !important; }
[data-theme="dark"] .crm-kpi[data-tone="info"]   .crm-kpi-icon { background: transparent !important; color: rgba(147, 197, 253, 0.32) !important; }
[data-theme="dark"] .crm-kpi[data-tone="warn"]   .crm-kpi-icon { background: transparent !important; color: rgba(251, 191, 36, 0.36) !important; }
[data-theme="dark"] .crm-kpi[data-tone="violet"] .crm-kpi-icon { background: transparent !important; color: rgba(196, 181, 253, 0.32) !important; }

.crm-kpi-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    z-index: 1;
    /* sit above the watermark icon */
}
.crm-kpi-label {
    font-size: 0.78rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: rgba(15, 23, 42, 0.72) !important;
    font-weight: 600;
    margin-bottom: 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.crm-kpi-value {
    font-size: 1.7rem !important;
    font-weight: 800;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    text-shadow: none !important;
    background: none !important;
}

/* Per-tone label/value overrides for stronger contrast with the colored backgrounds */
.crm-kpi[data-tone="info"]   .crm-kpi-value { color: #0c1e36 !important; -webkit-text-fill-color: #0c1e36 !important; }
.crm-kpi[data-tone="warn"]   .crm-kpi-value { color: #3a2400 !important; -webkit-text-fill-color: #3a2400 !important; }
.crm-kpi[data-tone="violet"] .crm-kpi-value { color: #2a0e4f !important; -webkit-text-fill-color: #2a0e4f !important; }

[data-theme="dark"] .crm-kpi-label { color: rgba(255, 255, 255, 0.78) !important; }
[data-theme="dark"] .crm-kpi-value { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }
[data-theme="dark"] .crm-kpi[data-tone="info"]   .crm-kpi-value,
[data-theme="dark"] .crm-kpi[data-tone="warn"]   .crm-kpi-value,
[data-theme="dark"] .crm-kpi[data-tone="violet"] .crm-kpi-value {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* ---- Toolbar ---------------------------------------------------------- */
.crm-toolbar {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-lg);
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.crm-toolbar-search { display: flex; align-items: center; gap: 10px; }
.crm-toolbar-search .search-box { flex: 1; min-width: 0; }
.crm-toolbar .quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    border-top: none;
}
.crm-toolbar .quick-filters::before {
    content: "Quick filters";
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hs-text-muted);
    font-weight: 700;
    padding-right: 10px;
    margin-right: 2px;
    border-right: 1px solid var(--hs-border);
}

/* Search box re-skin (the legacy nested .search-tags-container) */
.search-tags-container {
    border-radius: var(--hs-radius-md) !important;
    border: 1px solid var(--hs-border-strong) !important;
    background: var(--hs-surface) !important;
    min-height: 36px !important;
    padding: 4px 10px 4px 38px !important;
}
.search-tags-container:focus-within {
    border-color: var(--hs-accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.12) !important;
}
.search-icon { color: var(--hs-text-muted); }
.search-input-inline {
    font-size: 0.84rem;
    color: var(--hs-text);
}
.search-input-inline::placeholder { color: var(--hs-text-muted); }
.search-hint { color: var(--hs-text-muted); }
.search-hint kbd {
    background: var(--hs-elevated);
    border: 1px solid var(--hs-border);
    color: var(--hs-text-secondary);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.66rem;
    font-family: inherit;
}

/* Filter chips */
.crm-toolbar .filter-chip {
    font-size: 0.74rem;
    padding: 5px 10px;
    border-radius: var(--hs-radius-md);
    border: 1px solid var(--hs-border-strong);
    background: var(--hs-surface);
    color: var(--hs-text);
    font-weight: 500;
    transition: all 100ms ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    background-image: none;
    box-shadow: none;
}
.crm-toolbar .filter-chip svg { width: 12px; height: 12px; color: var(--hs-text-secondary); }
.crm-toolbar .filter-chip:hover {
    background: var(--hs-hover);
    transform: none;
}
.crm-toolbar .filter-chip.active {
    background: var(--hs-accent-subtle);
    color: var(--hs-accent);
    border-color: var(--hs-accent);
    font-weight: 600;
}
.crm-toolbar .filter-chip.active svg { color: var(--hs-accent); }

/* ---- Table — HubSpot dense, clean ------------------------------------- */
.table-container {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-lg);
    box-shadow: none;
    overflow: hidden;
}

#dossierTable {
    font-size: 0.82rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
#dossierTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--hs-elevated) !important;
    color: var(--hs-text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 9px 14px;
    text-align: left;
    border-bottom: 1px solid var(--hs-border-strong);
    white-space: normal;
    line-height: 1.3;
    vertical-align: middle;
    min-width: 80px;
    /* Long status-column headers wrap to 2 lines instead of being clipped */
}
#dossierTable tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--hs-border);
    color: var(--hs-text);
    line-height: 1.4;
    vertical-align: middle;
    font-size: 0.82rem;
    background: var(--hs-surface);
}
#dossierTable tbody tr {
    background: var(--hs-surface);
    transition: background 80ms ease;
}
#dossierTable tbody tr:hover { background: var(--hs-hover); }
#dossierTable tbody tr:hover td { background: var(--hs-hover); }
#dossierTable tbody tr:last-child td { border-bottom: none; }

/* No zebra striping, no column tints — HubSpot keeps the grid clean */
#dossierTable tbody tr:nth-child(even),
#dossierTable tbody tr:nth-child(odd) { background: var(--hs-surface); }
#dossierTable td:nth-child(7),
#dossierTable td:nth-child(10),
#dossierTable td:nth-child(11) { background-image: none !important; }

/* Frozen first column (checkbox) — keep header always visible on horizontal scroll */
#dossierTable thead th:nth-child(1),
#dossierTable tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--hs-elevated) !important;
}
#dossierTable thead th:nth-child(1) { z-index: 11; }
#dossierTable tbody td:nth-child(1) { background: var(--hs-surface) !important; }
#dossierTable tbody tr:hover td:nth-child(1) { background: var(--hs-hover) !important; }

/* Center status columns */
#dossierTable td:nth-child(9),
#dossierTable td:nth-child(10),
#dossierTable td:nth-child(11),
#dossierTable td:nth-child(13),
#dossierTable td:nth-child(19),
#dossierTable td:nth-child(20),
#dossierTable td:nth-child(21),
#dossierTable td:nth-child(22) { text-align: center; }

/* Tabular numerics for fee + duration columns */
#dossierTable td:nth-child(7),
#dossierTable td:nth-child(8),
#dossierTable td:nth-child(12) {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
    text-align: right;
}

/* ---- Cells ------------------------------------------------------------ */

/* University name w/ initial badge — flat, HubSpot avatar feel */
#dossierTable .cell-univ-name {
    font-weight: 600;
    color: var(--hs-text-strong);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    font-size: 0.84rem;
    text-align: left;
    max-width: 240px;
}

/* Country / Region — flat text, no chip, no dot */
#dossierTable .cell-country {
    display: inline-block;
    padding: 0;
    border: none;
    background: none;
    border-radius: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--hs-text);
    white-space: nowrap;
}
#dossierTable .cell-country::before { content: none; }
#dossierTable .cell-region {
    font-size: 0.82rem;
    color: var(--hs-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Currency cell */
#dossierTable .cell-fee {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
    white-space: nowrap;
    justify-content: flex-end;
    width: 100%;
}
#dossierTable .cell-fee-amount {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--hs-text-strong);
    letter-spacing: -0.005em;
}
#dossierTable .cell-fee-cur {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--hs-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: none;
    padding: 0;
    border: none;
    line-height: 1;
}
#dossierTable .cell-fee--empty { color: var(--hs-text-muted); }

/* Duration */
#dossierTable .cell-duration {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    justify-content: flex-end;
    width: 100%;
}
#dossierTable .cell-duration-num {
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--hs-text-strong);
}
#dossierTable .cell-duration-unit {
    font-size: 0.7rem;
    color: var(--hs-text-muted);
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0;
}

/* Status pill — HubSpot flat pastel */
#dossierTable .status-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    min-width: 48px;
    padding: 0 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    line-height: 1;
    border: none;
    box-shadow: none !important;
    background-image: none !important;
    transition: filter 80ms ease;
}
#dossierTable .status-dot svg {
    display: none;
}
#dossierTable .status-dot.yes {
    background: var(--hs-success-bg) !important;
    color: var(--hs-success-fg) !important;
    border: none !important;
}
#dossierTable .status-dot.yes::after { content: "Yes"; }
#dossierTable .status-dot.no {
    background: var(--hs-neutral-bg) !important;
    color: var(--hs-text-muted) !important;
    font-size: 0.72rem;
    border: none !important;
}
#dossierTable .status-dot.no::after { content: "No"; }
/* Hide the literal '−' character but keep the styled pill */
#dossierTable .status-dot.no { font-size: 0; }
#dossierTable .status-dot.no::after { font-size: 0.72rem; }

#dossierTable .status-dot.yes.clickable { cursor: pointer; }
#dossierTable .status-dot.yes.clickable:hover {
    filter: brightness(0.96);
    transform: none !important;
}

/* Link chips — HubSpot subtle */
#dossierTable .link-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--hs-radius-sm);
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    color: var(--hs-text-link);
    border: 1px solid var(--hs-border-strong);
    transition: all 100ms ease;
    white-space: nowrap;
    line-height: 1.3;
}
#dossierTable .link-chip svg {
    width: 10px;
    height: 10px;
    stroke-width: 2;
    transition: transform 100ms;
}
#dossierTable .link-chip:hover {
    background: var(--hs-accent-subtle);
    border-color: var(--hs-accent);
    color: var(--hs-accent-strong);
    transform: none;
    box-shadow: none;
}
#dossierTable .link-chip:hover svg { transform: translate(1px, -1px); }

/* Scholarship link variants — keep distinct but flat */
#dossierTable .link-chip--amber {
    color: var(--hs-warning-fg);
    background: var(--hs-warning-bg);
    border-color: transparent;
}
#dossierTable .link-chip--amber:hover {
    background: var(--hs-warning-fg);
    color: #fff;
    border-color: var(--hs-warning-fg);
}
#dossierTable .link-chip--violet {
    color: var(--hs-violet-fg);
    background: var(--hs-violet-bg);
    border-color: transparent;
}
#dossierTable .link-chip--violet:hover {
    background: var(--hs-violet-fg);
    color: #fff;
    border-color: var(--hs-violet-fg);
}
#dossierTable .link-chip--teal {
    color: var(--hs-info-fg);
    background: var(--hs-info-bg);
    border-color: transparent;
}
#dossierTable .link-chip--teal:hover {
    background: var(--hs-accent);
    color: #fff;
    border-color: var(--hs-accent);
}

/* Season chips — HubSpot pastel */
#dossierTable .cell-chip-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
#dossierTable .season-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    line-height: 1.6;
    letter-spacing: 0;
    white-space: nowrap;
}
.season-spring  { background: var(--hs-success-bg);  color: var(--hs-success-fg); border: none; }
.season-summer  { background: var(--hs-warning-bg);  color: var(--hs-warning-fg); border: none; }
.season-fall    { background: #ffe4d6;               color: #b34f10; border: none; }
.season-winter  { background: var(--hs-info-bg);     color: var(--hs-info-fg); border: none; }
.season-neutral { background: var(--hs-neutral-bg);  color: var(--hs-text-secondary); border: none; }
[data-theme="dark"] .season-fall    { background: rgba(255, 165, 100, 0.16); color: #ffb085; }

/* Deadline pill */
#dossierTable .deadline-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 7px;
    border-radius: var(--hs-radius-sm);
    font-size: 0.7rem;
    border: 1px solid var(--hs-border);
    background: var(--hs-elevated);
    line-height: 1.5;
    white-space: nowrap;
    color: var(--hs-text);
    box-shadow: none;
    position: relative;
}
#dossierTable .deadline-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--hs-text-muted);
}
#dossierTable .deadline-pill .deadline-season {
    font-weight: 700;
    color: var(--hs-text-strong);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
#dossierTable .deadline-pill .deadline-date {
    font-weight: 500;
    color: var(--hs-text-secondary);
    font-variant-numeric: tabular-nums;
}
#dossierTable .deadline-pill.deadline-soon {
    background: var(--hs-danger-bg);
    border-color: transparent;
}
#dossierTable .deadline-pill.deadline-soon::before {
    background: var(--hs-danger-fg);
    box-shadow: 0 0 0 2px rgba(200, 9, 47, 0.15);
    animation: hsPulseDot 2s ease-in-out infinite;
}
#dossierTable .deadline-pill.deadline-soon .deadline-season,
#dossierTable .deadline-pill.deadline-soon .deadline-date { color: var(--hs-danger-fg); }
#dossierTable .deadline-pill.deadline-near {
    background: var(--hs-warning-bg);
    border-color: transparent;
}
#dossierTable .deadline-pill.deadline-near::before { background: var(--hs-warning-fg); box-shadow: none; animation: none; }
#dossierTable .deadline-pill.deadline-near .deadline-season,
#dossierTable .deadline-pill.deadline-near .deadline-date { color: var(--hs-warning-fg); }
#dossierTable .deadline-pill.deadline-past {
    opacity: 0.55;
    text-decoration: line-through;
    text-decoration-color: var(--hs-text-muted);
}
#dossierTable .deadline-pill.deadline-far::before { background: var(--hs-text-muted); }

@keyframes hsPulseDot {
    0%, 100% { box-shadow: 0 0 0 2px rgba(200, 9, 47, 0.15); }
    50% { box-shadow: 0 0 0 5px rgba(200, 9, 47, 0.04); }
}

/* Geography chips */
#dossierTable .geo-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    line-height: 1.6;
    white-space: nowrap;
}
#dossierTable .geo-info    { background: var(--hs-info-bg);    color: var(--hs-info-fg); }
#dossierTable .geo-warm    { background: #ffe4d6;              color: #b34f10; }
#dossierTable .geo-amber   { background: var(--hs-warning-bg); color: var(--hs-warning-fg); }
#dossierTable .geo-violet  { background: var(--hs-violet-bg);  color: var(--hs-violet-fg); }
#dossierTable .geo-neutral { background: var(--hs-neutral-bg); color: var(--hs-text-secondary); }
[data-theme="dark"] #dossierTable .geo-warm { background: rgba(255, 165, 100, 0.16); color: #ffb085; }

/* Misc */
#dossierTable .cell-muted {
    color: var(--hs-text-muted);
    opacity: 1;
    font-weight: 500;
}
#dossierTable .editable-cell {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 100ms ease;
    padding-bottom: 1px;
}
#dossierTable .editable-cell:hover { border-bottom-color: var(--hs-accent); }

#dossierTable .row-select-cb,
#dossierTable .select-all-cb {
    width: 14px;
    height: 14px;
    accent-color: var(--hs-accent);
    cursor: pointer;
}

/* DataTables paging — HubSpot style */
.dataTables_wrapper { background: var(--hs-surface); }
.dataTables_info {
    font-size: 0.76rem !important;
    color: var(--hs-text-secondary) !important;
    padding: 12px 16px !important;
    border-top: 1px solid var(--hs-border);
}
.dataTables_paginate {
    padding: 12px 16px !important;
    border-top: 1px solid var(--hs-border);
}
.dataTables_paginate .paginate_button {
    padding: 4px 9px !important;
    margin: 0 2px !important;
    border-radius: var(--hs-radius-sm) !important;
    font-size: 0.76rem !important;
    border: 1px solid var(--hs-border-strong) !important;
    background: var(--hs-surface) !important;
    color: var(--hs-text) !important;
    font-weight: 500;
}
.dataTables_paginate .paginate_button:hover {
    background: var(--hs-hover) !important;
    border-color: var(--hs-border-strong) !important;
    color: var(--hs-text-strong) !important;
}
.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
    background: var(--hs-accent) !important;
    color: #fff !important;
    border-color: var(--hs-accent) !important;
}
.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
    color: var(--hs-text-muted) !important;
    background: var(--hs-surface) !important;
    cursor: not-allowed;
}

/* ---- Mobile ----------------------------------------------------------- */
@media (max-width: 1024px) {
    .crm-kpi-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    :root { --hs-content-pad: 14px; }
    .crm-topbar { gap: 8px; padding: 8px 14px; flex-wrap: wrap; }
    .crm-topbar-brand-text .logo-text { font-size: 0.78rem; }
    .crm-topbar-page { display: none; }
    .crm-topbar-actions .export-selection-info { display: none; }
    .crm-topbar-actions .btn { padding: 5px 10px; }
    .crm-topbar-utility { padding-left: 6px; margin-left: 0; }
    .crm-topbar-utility .user-level-badge span { display: none; }
    .crm-page-header { flex-direction: column; align-items: stretch; gap: 8px; }
    .crm-kpi-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
    .crm-kpi { padding: 12px !important; gap: 10px !important; }
    .crm-kpi-value { font-size: 1.25rem !important; }
    #dossierTable { font-size: 0.74rem; }
    #dossierTable thead th, #dossierTable tbody td { padding: 8px 10px; }
}

/* ============================================================================
   TABLE v3 — robustness + polish
   ----------------------------------------------------------------------------
   Restores the university-badge styles (reverted JS still renders them),
   adds sensible column min-widths so headers stop wrapping into junk,
   sticky first-column shadow on horizontal scroll, refined sort indicators,
   loading skeleton, premium empty state, and cell-level micro-polish.
   ============================================================================ */

/* ---- Column min-widths: prevents the awful header wrapping we saw ----- */
#dossierTable                                                           { table-layout: auto; }
#dossierTable thead th:nth-child(1),
#dossierTable tbody td:nth-child(1)  { width: 40px; min-width: 40px; }                      /* checkbox */
#dossierTable thead th:nth-child(2)  { min-width: 220px; }                                  /* university */
#dossierTable thead th:nth-child(3)  { min-width: 170px; }                                  /* school */
#dossierTable thead th:nth-child(4)  { min-width: 220px; }                                  /* program name (now clickable, slightly wider) */
#dossierTable thead th:nth-child(5)  { min-width: 100px; }                                  /* country */
#dossierTable thead th:nth-child(6)  { min-width: 110px; }                                  /* region */
#dossierTable thead th:nth-child(7)  { min-width: 130px; }                                  /* tuition */
#dossierTable thead th:nth-child(8)  { min-width: 100px; }                                  /* app fee */
#dossierTable thead th:nth-child(9)  { min-width: 90px;  }                                  /* waiver */
#dossierTable thead th:nth-child(10) { min-width: 110px; }                                  /* scholarship */
#dossierTable thead th:nth-child(11) { min-width: 90px;  }                                  /* STEM */
#dossierTable thead th:nth-child(12) { min-width: 90px;  }                                  /* duration */
#dossierTable thead th:nth-child(13) { min-width: 110px; }                                  /* credential eval */
#dossierTable thead th:nth-child(14) { min-width: 110px; }                                  /* deadline */
#dossierTable thead th:nth-child(14) { min-width: 140px; }                                  /* available intakes */
#dossierTable thead th:nth-child(15) { min-width: 220px; }                                  /* geographies of focus — wider so 2-per-row pills breathe */
#dossierTable thead th:nth-child(19) { min-width: 100px; }                                  /* 16th year */
#dossierTable thead th:nth-child(20) { min-width: 110px; }                                  /* english */
#dossierTable thead th:nth-child(21) { min-width: 90px;  }                                  /* gmat */
#dossierTable thead th:nth-child(22) { min-width: 100px; }                                  /* work exp */

/* Allow header text to wrap cleanly within those widths */
#dossierTable thead th {
    line-height: 1.25;
    padding-top: 11px;
    padding-bottom: 11px;
    vertical-align: middle;
}

/* ---- Restore university acronym badge (JS still renders it) ----------- */
#dossierTable .cell-univ {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 220px;
    text-align: left;
}
#dossierTable .cell-univ-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--hs-radius-md);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: hsl(var(--badge-hue, 200), 38%, 30%);
    background: hsl(var(--badge-hue, 200), 65%, 94%);
    border: 1px solid hsl(var(--badge-hue, 200), 50%, 86%);
    text-transform: uppercase;
}
[data-theme="dark"] #dossierTable .cell-univ-badge {
    color: hsl(var(--badge-hue, 200), 70%, 78%);
    background: hsla(var(--badge-hue, 200), 50%, 32%, 0.5);
    border-color: hsla(var(--badge-hue, 200), 50%, 45%, 0.35);
}

/* ---- Sticky-column edge: always a subtle shadow so the frozen first column
   reads as separate from the scrollable content. Pure CSS, no JS hook. -- */
.table-scroll {
    position: relative;
    overflow-x: auto;
}
#dossierTable thead th:nth-child(1),
#dossierTable tbody td:nth-child(1) {
    box-shadow: 4px 0 8px -4px rgba(15, 23, 42, 0.08), inset -1px 0 0 0 var(--hs-border);
}
[data-theme="dark"] #dossierTable thead th:nth-child(1),
[data-theme="dark"] #dossierTable tbody td:nth-child(1) {
    box-shadow: 4px 0 12px -4px rgba(0, 0, 0, 0.5), inset -1px 0 0 0 var(--hs-border);
}

/* ---- Sort indicators: cleaner than DataTables defaults --------------- */
/* ---- Sort indicators: stacked triangles (HubSpot/Notion style) ------- */
#dossierTable thead th.sorting,
#dossierTable thead th.sorting_asc,
#dossierTable thead th.sorting_desc {
    cursor: pointer;
    position: sticky;
    user-select: none;
    padding-right: 22px !important;
}

/* Up triangle (▲) — sits above center */
#dossierTable thead th.sorting::before,
#dossierTable thead th.sorting_asc::before,
#dossierTable thead th.sorting_desc::before {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -7px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid var(--hs-text-muted);
    opacity: 0.35;
    transition: opacity 120ms ease, border-bottom-color 120ms ease, border-top-color 120ms ease;
}

/* Down triangle (▼) — sits below center */
#dossierTable thead th.sorting::after,
#dossierTable thead th.sorting_asc::after,
#dossierTable thead th.sorting_desc::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: 2px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--hs-text-muted);
    opacity: 0.35;
    transition: opacity 120ms ease, border-top-color 120ms ease, border-bottom-color 120ms ease;
    /* clear any inherited mask/gradient from earlier versions */
    background: none !important;
    -webkit-mask: none !important;
    mask: none !important;
}

/* Hover: both triangles get slightly more visible */
#dossierTable thead th.sorting:hover::before,
#dossierTable thead th.sorting:hover::after { opacity: 0.65; }

/* Sorted ascending: up triangle is solid teal, down is faded */
#dossierTable thead th.sorting_asc::before {
    border-bottom-color: var(--hs-accent);
    opacity: 1;
}
#dossierTable thead th.sorting_asc::after {
    opacity: 0.2;
}

/* Sorted descending: down triangle is solid teal, up is faded */
#dossierTable thead th.sorting_desc::after {
    border-top-color: var(--hs-accent);
    opacity: 1;
}
#dossierTable thead th.sorting_desc::before {
    opacity: 0.2;
}

/* Hide DataTables' default arrow image */
#dossierTable thead th.sorting,
#dossierTable thead th.sorting_asc,
#dossierTable thead th.sorting_desc { background-image: none !important; }

/* ---- Cell content polish --------------------------------------------- */

/* University name reads slightly larger when paired with a badge */
#dossierTable .cell-univ-name {
    font-weight: 600;
    color: var(--hs-text-strong);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    font-size: 0.84rem;
    text-align: left;
    letter-spacing: -0.005em;
}

/* School name + program name — secondary weight so the university stays primary */
#dossierTable td:nth-child(3),
#dossierTable td:nth-child(4) {
    color: var(--hs-text);
    font-weight: 500;
}
#dossierTable td:nth-child(4) { font-weight: 600; color: var(--hs-text-strong); }

/* Currency — tighter */
#dossierTable .cell-fee {
    gap: 4px;
}

/* Status pills — give them a subtle ring for definition */
#dossierTable .status-dot.yes {
    box-shadow: 0 0 0 1px rgba(0, 115, 92, 0.10) inset !important;
}
#dossierTable .status-dot.no {
    box-shadow: 0 0 0 1px rgba(124, 152, 182, 0.10) inset !important;
}
[data-theme="dark"] #dossierTable .status-dot.yes {
    box-shadow: 0 0 0 1px rgba(109, 220, 164, 0.12) inset !important;
}
[data-theme="dark"] #dossierTable .status-dot.no {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

/* Link chips read as "buttons" without being heavy */
#dossierTable .link-chip {
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
}
#dossierTable .link-chip:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: 1px;
}

/* Deadline pill: tighter, with a soft inner ring */
#dossierTable .deadline-pill {
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04) inset;
}
[data-theme="dark"] #dossierTable .deadline-pill {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* Season + geo chips — slightly tighter, ring for definition */
#dossierTable .season-chip,
#dossierTable .geo-chip {
    padding: 2px 9px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04) inset;
}
[data-theme="dark"] #dossierTable .season-chip,
[data-theme="dark"] #dossierTable .geo-chip {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* ---- Row hover: cleaner left-edge accent + bg ------------------------ */
#dossierTable tbody tr {
    position: relative;
}
#dossierTable tbody tr td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
}
#dossierTable tbody tr:hover td {
    background: var(--hs-hover) !important;
}
#dossierTable tbody tr:hover td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--hs-accent);
}

/* ---- Loading skeleton (DataTables 'processing' state) ---------------- */
.dataTables_processing {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-border) !important;
    border-radius: var(--hs-radius-md) !important;
    color: var(--hs-text-secondary) !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    padding: 14px 22px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
    top: 50% !important;
    left: 50% !important;
    margin-top: -22px !important;
    margin-left: -90px !important;
    width: 180px !important;
    height: 44px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.dataTables_processing::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--hs-border-strong);
    border-top-color: var(--hs-accent);
    animation: hsSpinner 700ms linear infinite;
}
@keyframes hsSpinner { to { transform: rotate(360deg); } }

/* ---- Empty state: replaces "No data available in table" -------------- */
#dossierTable tbody td.dataTables_empty {
    text-align: center !important;
    padding: 60px 20px !important;
    color: var(--hs-text-muted) !important;
    font-weight: 500;
    font-size: 0.88rem;
    background: var(--hs-surface) !important;
    border-bottom: none !important;
    position: relative;
}
#dossierTable tbody td.dataTables_empty::before {
    content: "";
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--hs-elevated);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c98b6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    border: 1px solid var(--hs-border);
}

/* ---- Fade in rows on first paint (subtle, premium feel) -------------- */
#dossierTable tbody tr {
    animation: hsRowIn 220ms ease both;
}
@keyframes hsRowIn {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Don't animate during user interactions / paginate */
#dossierTable tbody tr:nth-child(n+15) { animation: none; }

/* ---- Pagination + info row: tighter footer --------------------------- */
.dataTables_wrapper {
    display: flex;
    flex-direction: column;
}
.dataTables_info,
.dataTables_paginate {
    border-top: 1px solid var(--hs-border) !important;
    background: var(--hs-elevated) !important;
}
.dataTables_info {
    padding: 11px 18px !important;
}
.dataTables_paginate {
    padding: 8px 14px !important;
}
.dataTables_paginate .paginate_button {
    margin: 0 1px !important;
    min-width: 30px;
    text-align: center;
    transition: all 100ms ease;
}
.dataTables_paginate .paginate_button.previous,
.dataTables_paginate .paginate_button.next {
    font-weight: 600;
}

/* ---- Horizontal scroll subtle gradient hint at right edge ------------ */
.table-scroll {
    background:
        radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.05), transparent) right center / 16px 100% no-repeat;
    background-attachment: local;
}
[data-theme="dark"] .table-scroll {
    background:
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.4), transparent) right center / 16px 100% no-repeat;
    background-attachment: local;
}

/* ============================================================================
   FILTER CHIP DROPDOWN (tri-state for required-type filters)
   ============================================================================ */

.filter-chip-group {
    position: relative;
    display: inline-block;
}

.filter-chip.filter-chip--menu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 5px 6px 5px 10px;
    border-radius: var(--hs-radius-md);
    border: 1px solid var(--hs-border-strong);
    background: var(--hs-surface);
    color: var(--hs-text);
    cursor: pointer;
    transition: all 100ms ease;
    line-height: 1.3;
    white-space: nowrap;
}
.filter-chip.filter-chip--menu:hover {
    background: var(--hs-hover);
}
.filter-chip-leading {
    width: 13px;
    height: 13px;
    color: var(--hs-text-secondary);
    flex-shrink: 0;
}

.filter-chip-label {
    color: var(--hs-text);
}

/* The state badge — shows current value (All / Required / Not required) */
.filter-chip-state {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--hs-elevated);
    color: var(--hs-text-secondary);
    border: 1px solid var(--hs-border);
    line-height: 1.4;
    transition: all 120ms ease;
}
.filter-chip-state[data-state="yes"] {
    background: var(--hs-success-bg);
    color: var(--hs-success-fg);
    border-color: transparent;
}
.filter-chip-state[data-state="no"] {
    background: var(--hs-danger-bg);
    color: var(--hs-danger-fg);
    border-color: transparent;
}

.filter-chip-caret {
    width: 11px;
    height: 11px;
    color: var(--hs-text-muted);
    transition: transform 140ms ease;
    flex-shrink: 0;
    margin-right: 2px;
}

/* Active state (any non-"All" selection) — chip outline switches to brand teal */
.filter-chip.filter-chip--menu.active {
    border-color: var(--hs-accent);
    background: var(--hs-accent-faint);
}
.filter-chip.filter-chip--menu.active .filter-chip-leading {
    color: var(--hs-accent);
}

/* Menu open: hover OR clicked-open (.is-open class set by JS) */
.filter-chip-group:hover .filter-chip-menu,
.filter-chip-group.is-open .filter-chip-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.filter-chip-group:hover .filter-chip-caret,
.filter-chip-group.is-open .filter-chip-caret {
    transform: rotate(180deg);
}

/* The menu itself */
.filter-chip-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    min-width: 180px;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-lg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10), 0 2px 4px rgba(15, 23, 42, 0.04);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
    pointer-events: none;
}
[data-theme="dark"] .filter-chip-menu {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hover bridge: prevent menu from closing when moving cursor across the gap
   between trigger and menu. Pure CSS — uses an invisible padding zone. */
.filter-chip-menu::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    height: 6px;
}

.filter-chip-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 10px 7px 8px;
    border-radius: var(--hs-radius-md);
    border: none;
    background: transparent;
    color: var(--hs-text);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 100ms ease;
    line-height: 1.3;
}
.filter-chip-option:hover {
    background: var(--hs-hover);
}
.filter-chip-option-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--hs-border-strong);
    background: var(--hs-surface);
    flex-shrink: 0;
    position: relative;
    transition: all 120ms ease;
}
.filter-chip-option[aria-checked="true"] .filter-chip-option-dot {
    border-color: var(--hs-accent);
    background: var(--hs-accent);
    box-shadow: inset 0 0 0 3px var(--hs-surface);
}
.filter-chip-option[aria-checked="true"] {
    color: var(--hs-text-strong);
    font-weight: 600;
}

/* Tonal accents on the option dots so users can pre-read the state */
.filter-chip-option[data-value="yes"]:hover .filter-chip-option-dot {
    border-color: var(--hs-success-fg);
}
.filter-chip-option[data-value="no"]:hover .filter-chip-option-dot {
    border-color: var(--hs-danger-fg);
}
.filter-chip-option[data-value="yes"][aria-checked="true"] .filter-chip-option-dot {
    border-color: var(--hs-success-fg);
    background: var(--hs-success-fg);
}
.filter-chip-option[data-value="no"][aria-checked="true"] .filter-chip-option-dot {
    border-color: var(--hs-danger-fg);
    background: var(--hs-danger-fg);
}

/* Mobile: dropdown becomes left-aligned to keep within viewport */
@media (max-width: 640px) {
    .filter-chip-menu {
        left: auto;
        right: 0;
        min-width: 160px;
    }
}

/* ============================================================================
   PROGRAM NAME CELL — clickable link variant (replaces Program Link column)
   ============================================================================ */

#dossierTable .cell-program,
#dossierTable .cell-program-link {
    font-weight: 600;
    color: var(--hs-text-strong);
    line-height: 1.35;
    font-size: 0.84rem;
    letter-spacing: -0.005em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Plain (non-link) program name */
#dossierTable .cell-program {
    color: var(--hs-text-strong);
}

/* Clickable program name — visually identical to plain text by default,
   reveals link affordance on row hover (HubSpot/Linear pattern) */
#dossierTable .cell-program-link {
    color: var(--hs-text-strong);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: color 100ms ease;
}

#dossierTable .cell-program-link-icon {
    width: 12px;
    height: 12px;
    margin-left: 5px;
    color: var(--hs-text-muted);
    opacity: 1;
    transition: color 100ms ease, transform 100ms ease;
    display: inline-block;
    vertical-align: -1px;
    flex-shrink: 0;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

/* Subtle nudge of the arrow on hover so it feels alive without being noisy */
#dossierTable tbody tr:hover .cell-program-link-icon,
#dossierTable .cell-program-link:hover .cell-program-link-icon,
#dossierTable .cell-program-link:focus-visible .cell-program-link-icon {
    transform: translate(1px, 0);
}

#dossierTable .cell-program-link:hover {
    color: var(--hs-accent);
    text-decoration: underline;
    text-decoration-color: var(--hs-accent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}
#dossierTable .cell-program-link:hover .cell-program-link-icon {
    color: var(--hs-accent);
}

#dossierTable .cell-program-link:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: 2px;
    border-radius: 3px;
    color: var(--hs-accent);
}


/* ============================================================================
   SEARCH STRIP — single-line chip strip, plain-language operators
   ============================================================================
   Compact single-line layout. Tags + inline operator pills + input field.
   Operators show lowercase plain-English labels (or / and) that toggle on click.
   ============================================================================ */

.search-box.search-box--strip {
    border: 1px solid var(--hs-border-strong);
    background: var(--hs-surface);
    border-radius: var(--hs-radius-md);
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    min-height: 38px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search-box--strip:focus-within {
    border-color: var(--hs-accent);
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.10);
}
.search-box--strip > .search-icon {
    color: var(--hs-text-muted);
    flex-shrink: 0;
    /* Override legacy absolute positioning — in the new strip, icon is a flex item */
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
}

/* The horizontal chip strip — wraps gracefully when many tags */
.search-strip {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    cursor: text;
    padding: 4px 0;
    line-height: 1;
}

/* Group wrapper — visually groups multi-tag clusters */
.search-strip .search-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.search-strip .search-group.is-multi {
    background: var(--hs-elevated);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-sm);
    padding: 2px 5px;
}

/* Tag chip */
.search-strip .search-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--hs-accent-subtle);
    color: var(--hs-accent-strong);
    border: 1px solid rgba(0, 151, 178, 0.22);
    border-radius: var(--hs-radius-sm);
    padding: 2px 4px 2px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="dark"] .search-strip .search-tag {
    background: rgba(0, 188, 217, 0.16);
    border-color: rgba(0, 188, 217, 0.28);
}
.search-strip .search-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--hs-accent);
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background-color 100ms ease;
}
.search-strip .search-tag-remove:hover {
    background: rgba(0, 151, 178, 0.18);
}
.search-strip .search-tag-remove svg {
    width: 10px;
    height: 10px;
    stroke-linecap: round;
    stroke-width: 2.4;
}

/* Operator pill — quiet, lowercase by default */
.search-strip .search-op {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: var(--hs-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 100ms ease;
    user-select: none;
    position: relative;
}
.search-strip .search-op:hover {
    background: var(--hs-hover);
    color: var(--hs-text);
    border-color: var(--hs-border-strong);
}
.search-strip .search-op:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: 1px;
}

/* Intra-group "or" (default) — minimal gray text */
.search-strip .search-op-intra { /* default styling above is enough */ }

/* Intra-group flipped to "and" — accent so user sees they've changed it */
.search-strip .search-op-intra.op-and {
    color: var(--hs-accent-strong);
    background: var(--hs-accent-faint);
    border-color: rgba(0, 151, 178, 0.30);
    font-weight: 700;
}

/* Inter-group operator — slightly more visual weight to mark group boundary */
.search-strip .search-op-inter {
    color: var(--hs-text-secondary);
    background: var(--hs-elevated);
    border-color: var(--hs-border);
    margin: 0 3px;
    font-weight: 700;
}
.search-strip .search-op-inter.op-or {
    color: var(--hs-accent-strong);
    background: var(--hs-accent-faint);
    border-color: rgba(0, 151, 178, 0.30);
}

/* The visible input — fills remaining space when empty, shrinks to content when typing
   so the ghost operator sits right next to the cursor */
.search-strip-input {
    flex: 1;
    min-width: 140px;
    border: none;
    outline: none;
    background: transparent;
    padding: 4px 0;
    font-size: 0.84rem;
    font-family: inherit;
    color: var(--hs-text);
}
.search-strip-input:not(:placeholder-shown) {
    /* When user has typed text, JS sets explicit width via sizeInputToContent().
       flex:0 prevents it from being stretched back to fill space. */
    flex: 0 0 auto;
    min-width: 1ch;
}
.search-strip-input::placeholder {
    color: var(--hs-text-muted);
    font-weight: 400;
}

/* Right-side keyboard hints */
.search-strip-meta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hs-text-muted);
    font-size: 0.7rem;
}
.search-strip-meta .meta-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.search-strip-meta kbd {
    background: var(--hs-elevated);
    border: 1px solid var(--hs-border);
    color: var(--hs-text-secondary);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.66rem;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.4;
}

/* Mobile */
@media (max-width: 640px) {
    .search-strip-meta { display: none; }
}

/* ---- Ghost operator pair: expandable preview while typing ------------ */
/* Hidden by default; JS adds .is-visible when input has typed text.
   Shows the active operator pill; alt operator pill is collapsed and reveals on hover.
   Click either pill → commits the typed word + applies that operator. */

.search-strip .search-op-ghost-pair {
    display: none;
    align-items: center;
    gap: 2px;
    padding: 0;
    border-radius: 4px;
    background: transparent;
    transition: gap 180ms ease, padding 180ms ease, background-color 180ms ease;
}
.search-strip .search-op-ghost-pair.is-visible {
    display: inline-flex;
    animation: hsGhostFadeIn 200ms ease both;
}
@keyframes hsGhostFadeIn {
    from { opacity: 0; transform: translateY(-1px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* On pair hover: a tiny background shows the pills are grouped */
.search-strip .search-op-ghost-pair:hover {
    gap: 3px;
    padding: 2px;
    background: var(--hs-elevated);
}

/* Each ghost button — base style */
.search-strip .search-op-ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    border: 1px dashed transparent;
    border-radius: 3px;
    background: transparent;
    color: var(--hs-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    transition: max-width 200ms ease,
                padding 200ms ease,
                opacity 160ms ease,
                color 120ms ease,
                background-color 120ms ease,
                border-color 120ms ease,
                border-style 120ms ease;
    user-select: none;
    overflow: hidden;
    /* Visible: max-width and opacity set per state below */
}

/* Active button — always visible, dashed border, accent-tinted at low opacity */
.search-strip .search-op-ghost-btn.is-active {
    max-width: 60px;
    opacity: 0.65;
    border-style: dashed;
    border-color: rgba(0, 151, 178, 0.35);
    color: var(--hs-accent-strong);
}

/* Alt button — collapsed by default (zero width, no padding) */
.search-strip .search-op-ghost-btn:not(.is-active) {
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
    border-width: 0;
}

/* Hover the pair → reveal the alt button */
.search-strip .search-op-ghost-pair:hover .search-op-ghost-btn:not(.is-active) {
    max-width: 60px;
    padding-left: 8px;
    padding-right: 8px;
    opacity: 0.65;
    pointer-events: auto;
    border-width: 1px;
    border-style: dashed;
    border-color: var(--hs-border-strong);
}

/* Hover the pair → also tighten the active button */
.search-strip .search-op-ghost-pair:hover .search-op-ghost-btn.is-active {
    opacity: 0.85;
}

/* Hover ANY individual button → full prominence (commits-ready visual) */
.search-strip .search-op-ghost-btn:hover {
    opacity: 1 !important;
    border-style: solid !important;
    background: var(--hs-accent-faint) !important;
    color: var(--hs-accent-strong) !important;
    border-color: var(--hs-accent) !important;
}

/* Inter-group ghost (uppercase, bolder) — matches existing static inter pill */
.search-strip .search-op-ghost-pair--inter .search-op-ghost-btn {
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.search-strip .search-op-ghost-pair--inter .search-op-ghost-btn.is-active {
    color: var(--hs-accent-strong);
    border-color: rgba(0, 151, 178, 0.40);
}


/* ---- Fuzzy / Exact mode toggle ---------------------------------------- */
.search-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    background: var(--hs-elevated);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-sm, 4px);
    flex-shrink: 0;
    line-height: 1;
}
.search-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: var(--hs-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    border-radius: 3px;
    cursor: pointer;
    transition: color 120ms ease, background-color 140ms ease, box-shadow 140ms ease;
    white-space: nowrap;
    user-select: none;
}
.search-mode-btn:hover:not(.is-active) {
    color: var(--hs-text);
}
.search-mode-btn.is-active {
    background: var(--hs-surface);
    color: var(--hs-accent-strong);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.search-mode-btn:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: 1px;
}

/* ---- Search-mode info button + popover -------------------------------- */
.search-mode-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.search-mode-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--hs-text-muted);
    border-radius: 50%;
    cursor: help;
    transition: color 120ms ease, background-color 120ms ease;
    line-height: 1;
}
.search-mode-info-btn:hover {
    color: var(--hs-accent-strong);
    background: var(--hs-accent-faint);
}
.search-mode-info-btn:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: 2px;
}

.search-mode-info-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    max-width: 340px;
    padding: 14px 16px;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    border-radius: var(--hs-radius-md, 6px);
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
    z-index: 1000;
    /* Hidden by default; shown when hovering the i-button OR the popover itself */
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}

/* Invisible bridge above the popover so the cursor can travel from the (i)
   button down to the popover without crossing dead space (avoids flicker) */
.search-mode-info-popover::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
}

/* Show the popover when hovering the (i) button (next sibling) OR the popover */
.search-mode-info-btn:hover + .search-mode-info-popover,
.search-mode-info-btn:focus-visible + .search-mode-info-popover,
.search-mode-info-popover:hover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 140ms ease, transform 140ms ease, visibility 0s;
}

/* Mirror the (i) button's "active" look while popover is showing */
.search-mode-info-btn:hover {
    color: var(--hs-accent-strong);
    background: var(--hs-accent-faint);
}
.search-mode-info-popover .popover-arrow {
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: var(--hs-surface);
    border-left: 1px solid var(--hs-border-strong);
    border-top: 1px solid var(--hs-border-strong);
    transform: rotate(45deg);
}
.search-mode-info-popover .popover-title {
    margin: 0 0 10px 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--hs-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-mode-info-popover .popover-item {
    margin: 0 0 12px 0;
}
.search-mode-info-popover .popover-item:last-child {
    margin-bottom: 0;
}
.search-mode-info-popover .popover-mode-name {
    display: inline-block;
    margin-bottom: 4px;
    padding: 2px 8px;
    background: var(--hs-accent-faint);
    color: var(--hs-accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.01em;
}
.search-mode-info-popover .popover-desc {
    margin: 4px 0 4px 0;
    font-size: 0.82rem;
    color: var(--hs-text);
    line-height: 1.4;
}
.search-mode-info-popover .popover-example {
    margin: 0;
    font-size: 0.76rem;
    color: var(--hs-text-muted);
    line-height: 1.5;
}
.search-mode-info-popover .popover-example code {
    display: inline-block;
    padding: 1px 5px;
    margin: 0 1px;
    background: var(--hs-elevated);
    border: 1px solid var(--hs-border);
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.74rem;
    color: var(--hs-text);
}
.search-mode-info-popover .popover-example em {
    font-style: normal;
    font-weight: 600;
    color: var(--hs-text);
}
.search-mode-info-popover .popover-example strong {
    color: var(--hs-danger, #d04848);
    font-weight: 700;
}

/* ---- Operator-aware filter group (Country / Geography / School Type) -- */
.op-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Operator dropdown — small, sits above the value control */
.op-filter-operator {
    width: 100%;
    height: 36px;
    padding: 0 28px 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 6px);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='currentColor' stroke-width='1.5'%3e%3cpath d='M1 1l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.op-filter-operator option {
    /* Native option dropdown: ensure dark bg in dark mode */
    background-color: var(--bg-input);
    color: var(--text-primary);
}
.op-filter-operator:hover {
    border-color: var(--accent);
}
.op-filter-operator:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Value-wrap container — toggles which child is visible based on data-mode */
.op-filter-value {
    width: 100%;
}
.op-filter-value[data-mode="hidden"] {
    display: none;
}
.op-filter-value[data-mode="text"] .select2-container { display: none !important; }
.op-filter-value[data-mode="text"] select { display: none; }
.op-filter-value[data-mode="single"] .select2-container { display: block; }
.op-filter-value[data-mode="multi"] .select2-container { display: block; }

/* Free-text input for contains/starts_with/ends_with */
.op-filter-text {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--select2-border);
    border-radius: var(--radius-md, 6px);
    background-color: var(--select2-bg);
    color: var(--select2-text);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.op-filter-text:hover { border-color: var(--accent); }
.op-filter-text:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.op-filter-text::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Empty-state hint when operator is is_null / is_not_null */
.op-filter-empty-hint {
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md, 6px);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    text-align: center;
}

/* ---- Select2 multi-select chip (the picked-value pill inside the box) - */
/* Theme-aware so the "client" / "USA" / "India" tags are readable in both modes */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--accent-dim) !important;
    border: 1px solid var(--border-light) !important;
    color: var(--text-primary) !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    margin-top: 6px !important;
    margin-right: 4px !important;
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--text-secondary) !important;
    margin-right: 6px !important;
    font-weight: 700 !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--accent) !important;
    background-color: transparent !important;
}
/* Search box inside the multi-select */
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    color: var(--text-primary) !important;
    font-family: inherit !important;
}
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder {
    color: var(--text-muted) !important;
}
/* The placeholder text inside an empty single-select Select2 */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}
/* The clear (×) button on a single-select Select2 (allowClear) */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--text-secondary) !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--accent) !important;
}


/* ---- Per-chip Contains/Exact mode visual --------------------------------
   Each chip stores its own match mode. Visual cues:
     • Fuzzy (Contains, default) → solid border, accent tint
     • Exact (whole-word)        → dashed border, deeper tint, target icon
   Click chip body to toggle. Clicking the X still removes the chip. */

.search-tag {
    cursor: pointer;
    transition: border-style 140ms ease, border-color 140ms ease,
                background-color 140ms ease, box-shadow 140ms ease;
    user-select: none;
    position: relative;
}
.search-tag:hover {
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-tag:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Fuzzy (Contains) — current default visual, kept the same */
.search-tag.is-fuzzy {
    border-style: solid;
}

/* Exact (whole-word) — dashed border + slightly stronger background */
.search-tag.is-exact {
    border-style: dashed;
    border-width: 1.5px;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Tiny target icon prefixed onto exact-mode chips so the mode is recognizable
   even at a glance (and not relying on dashed border alone, which is subtle). */
.search-tag.is-exact .search-tag-text::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    vertical-align: -1px;
    background-color: var(--accent);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><circle cx='12' cy='12' r='6'/><circle cx='12' cy='12' r='2'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><circle cx='12' cy='12' r='6'/><circle cx='12' cy='12' r='2'/></svg>");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* Make sure the X-button click area doesn't inherit the chip's pointer cursor look */
.search-tag-remove { cursor: pointer; }

/* ---- Geography of Focus column — pills wrap 2 per row -----------------
   Switch the chip-group from inline-flex to a 2-column grid specifically
   when it contains geo-chips. Grid + comfortable gap = pills don't crowd. */
#dossierTable .cell-chip-group:has(.geo-chip) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 6px;
    align-items: start;
    width: 100%;
    padding: 2px 0;
}
#dossierTable .cell-chip-group:has(.geo-chip) .geo-chip {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    padding: 4px 8px;        /* extra vertical padding so chips don't touch */
    line-height: 1.3;
    white-space: normal;     /* let long names like "SouthEast Asia" wrap if column is narrow */
    text-align: center;
    min-height: 22px;
}

/* ── Sticky horizontal scrollbar ──────────────────────────────────
   A horizontal scrollbar placed as a sibling AFTER `.table-container`
   (outside its overflow:hidden context), so `position: sticky` works
   against the page scroll. JS mirrors the table's horizontal scroll
   position bidirectionally. Visibility toggled via `--visible` modifier. */
.h-scrollbar {
    /* Hidden by default; shown only when table overflows horizontally */
    display: none;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 14px;
    background: var(--bg-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e4e4e7);
    border-top: none;
    border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
    margin-top: -1px;  /* sit flush against the table-container's bottom border */
    /* Stick to the viewport bottom while user is scrolling the page */
    position: sticky;
    bottom: 0;
    z-index: 10;
}
.h-scrollbar.h-scrollbar--visible {
    display: block;
}
.h-scrollbar-inner {
    height: 1px;
    /* width is set dynamically by JS to match the table's scrollWidth */
}
/* Make the sticky scrollbar more prominent than the native one */
.h-scrollbar::-webkit-scrollbar {
    height: 12px;
}
.h-scrollbar::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #f1f5f9);
    border-radius: 6px;
}
.h-scrollbar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #cbd5e1);
    border-radius: 6px;
}
.h-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #94a3b8);
}
/* Firefox */
.h-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #cbd5e1) var(--scrollbar-track, #f1f5f9);
}

/* ── Length-menu styling (page size selector) ─────────────────────
   DataTables injects `<div class="dataTables_length"><label>Show <select>...</select></label></div>`.
   We move it into `.table-footer` via initComplete; this just makes it look right. */
.table-footer .dataTables_length {
    display: inline-flex;
    align-items: center;
    margin-right: 16px;
}
.table-footer .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #475569);
}
.table-footer .dataTables_length select {
    padding: 4px 24px 4px 10px;
    border: 1px solid var(--border-color, #d4d4d8);
    border-radius: 6px;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #0f172a);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.table-footer .dataTables_length select:hover {
    border-color: var(--accent, #0097b2);
}
.table-footer .dataTables_length select:focus {
    outline: none;
    border-color: var(--accent, #0097b2);
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.12);
}
[data-theme="dark"] .table-footer .dataTables_length select {
    background-color: var(--bg-input, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}

/* ── Multi-select quick filter chips ──────────────────────────────
   For Country, Geography Focus, Intakes — chips that open a popover
   with a search box and checkboxes for multi-value selection. */
.filter-chip-group--multi {
    position: relative;
}
.filter-chip-menu--multi {
    /* Larger popover than the tri-state menus */
    min-width: 240px;
    max-width: 320px;
    padding: 0;
    overflow: hidden;
}

/* Search box at top */
.filter-chip-menu-search {
    padding: 8px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    background: var(--bg-elevated, #f8fafc);
}
.filter-chip-menu-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color, #d4d4d8);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #0f172a);
    box-sizing: border-box;
}
.filter-chip-menu-search input:focus {
    outline: none;
    border-color: var(--accent, #0097b2);
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.12);
}

/* List of checkbox items */
.filter-chip-menu-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}
.filter-chip-menu-list:empty::before {
    content: 'No options';
    display: block;
    padding: 16px;
    color: var(--text-muted, #667085);
    font-size: 13px;
    text-align: center;
}

/* Each checkbox item */
.filter-chip-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-primary, #0f172a);
    transition: background 0.12s;
}
.filter-chip-checkbox-item:hover {
    background: var(--accent-dim, #e6f6f8);
}
.filter-chip-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent, #0097b2);
    margin: 0;
}
.filter-chip-checkbox-item.hidden {
    display: none;
}

/* Select All row — visually separated from individual options */
.filter-chip-select-all {
    font-weight: 600;
    border-bottom: 1px solid var(--border-light, #e2e8f0);
    margin-bottom: 2px;
    padding-bottom: 8px;
    color: var(--accent, #0097b2);
}
.filter-chip-select-all:hover {
    background: var(--accent-dim, #e6f6f8);
}

/* Footer with Clear button */
.filter-chip-menu-footer {
    padding: 6px 8px;
    border-top: 1px solid var(--border-light, #f1f5f9);
    background: var(--bg-elevated, #f8fafc);
    display: flex;
    justify-content: flex-end;
}
.filter-chip-clear {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-color, #d4d4d8);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.12s;
}
.filter-chip-clear:hover {
    background: var(--bg-surface, #fff);
    border-color: var(--accent, #0097b2);
    color: var(--accent-dark, #007a91);
}

/* Dark mode adjustments */
[data-theme="dark"] .filter-chip-menu-search,
[data-theme="dark"] .filter-chip-menu-footer {
    background: var(--bg-elevated, #0f172a);
}
[data-theme="dark"] .filter-chip-menu-search input {
    background: var(--bg-input, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}

/* ── Calendar (intake date) quick-filter chip ─────────────────────
   Popover with a legend (date → season mapping) and a native <input type="date">.
   The chip itself has a `title` attribute for hover tooltip showing the legend. */
.filter-chip-group--calendar {
    position: relative;
}
.filter-chip-menu--calendar {
    min-width: 300px;
    max-width: 360px;
    padding: 0;
    overflow: hidden;
}

/* Legend block at top of popover */
.calendar-legend {
    padding: 10px 12px;
    background: var(--bg-elevated, #f8fafc);
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.calendar-legend-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #667085);
    margin-bottom: 8px;
}
.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-secondary, #475569);
}
.calendar-legend-item .legend-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}
.calendar-legend-item .legend-range {
    min-width: 70px;
    font-weight: 500;
    color: var(--text-primary, #0f172a);
}
.calendar-legend-item .legend-arrow {
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
}
.calendar-legend-item .legend-season {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}
/* Season dot colors — match the season chip tones */
.legend-dot.legend-spring { background: #16a34a; }   /* green */
.legend-dot.legend-summer { background: #f59e0b; }   /* amber */
.legend-dot.legend-fall   { background: #8b5cf6; }   /* violet */

/* Date input section — range (From → To) */
.calendar-input-wrap {
    padding: 12px;
}
.calendar-range-wrap {
    padding: 10px 12px 12px;
}
.calendar-range-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}
.calendar-range-field {
    flex: 1;
    min-width: 0;
}
.calendar-range-separator {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-bottom: 7px;
    color: var(--text-muted, #94a3b8);
}
.calendar-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 6px;
}
.calendar-input-wrap input[type="date"],
.calendar-range-field input[type="date"] {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid var(--border-color, #d4d4d8);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary, #0f172a);
    background: var(--bg-surface, #fff);
    box-sizing: border-box;
    font-family: inherit;
    cursor: pointer;
}
.calendar-input-wrap input[type="date"]:focus,
.calendar-range-field input[type="date"]:focus {
    outline: none;
    border-color: var(--accent, #0097b2);
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.12);
}

/* Dark-mode adjustments */
[data-theme="dark"] .calendar-legend {
    background: var(--bg-elevated, #0f172a);
}
[data-theme="dark"] .calendar-input-wrap input[type="date"],
[data-theme="dark"] .calendar-range-field input[type="date"] {
    background: var(--bg-input, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
    color-scheme: dark;
}

/* ── Calendar chip when placed in the topbar ──────────────────────
   Lives next to the #filterBtn (funnel icon) — the popover needs to
   anchor to this group, not the quick-filters row. */
.crm-topbar-actions .filter-chip-group--calendar {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.crm-topbar-actions .filter-chip-group--calendar .filter-chip {
    /* Align height/padding with the sibling btn-ghost (#filterBtn) */
    height: 36px;
}
.crm-topbar-actions .filter-chip-group--calendar .filter-chip-menu--calendar {
    /* Drop the popover below the chip, right-aligned so it doesn't
       overflow off-screen on narrow viewports */
    top: calc(100% + 6px);
    right: 0;
    left: auto;
}

/* ── Sticky columns 2 & 3 — conditional compact wrap ──────────────
   These rules only kick in when the user has horizontally scrolled
   (JS toggles `.is-h-scrolled` on `.table-scroll`). In that state,
   columns 2 (University), 3 (School), and 4 (Program) stack up
   visually as sticky-left. We narrow them and let the text wrap so
   long names remain fully readable without ellipsis — and the right
   side of the table gets more breathing room. */
.table-scroll.is-h-scrolled #dossierTable tbody td:nth-child(2),
.table-scroll.is-h-scrolled #dossierTable tbody td:nth-child(3),
.table-scroll.is-h-scrolled #dossierTable tbody td:nth-child(4),
.table-scroll.is-h-scrolled #dossierTable thead th:nth-child(2),
.table-scroll.is-h-scrolled #dossierTable thead th:nth-child(3),
.table-scroll.is-h-scrolled #dossierTable thead th:nth-child(4) {
    /* Tighter padding to remove extra spacing */
    padding-left: 8px;
    padding-right: 8px;
    max-width: 150px;
    width: 150px;
    white-space: normal;
    word-break: break-word;
}
/* University Name — drop the line-clamp so all words wrap freely */
.table-scroll.is-h-scrolled #dossierTable .cell-univ-name {
    max-width: 140px;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.3;
}
/* School Name — drop the truncate/ellipsis, wrap instead */
.table-scroll.is-h-scrolled #dossierTable .cell-truncate {
    max-width: 140px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.3;
    display: block;
    -webkit-line-clamp: unset;
}
/* Program Name (and link variant) — drop the line-clamp + webkit-box so
   it wraps freely on every line without ellipsis. */
.table-scroll.is-h-scrolled #dossierTable .cell-program,
.table-scroll.is-h-scrolled #dossierTable .cell-program-link {
    max-width: 140px;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.3;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
}
/* Remove the extra right-side padding + icon margin on the program
   column when sticky-stacked, so there's no unused horizontal space. */
.table-scroll.is-h-scrolled #dossierTable tbody td:nth-child(4),
.table-scroll.is-h-scrolled #dossierTable thead th:nth-child(4) {
    padding-right: 4px !important;
    max-width: 140px;
    width: 140px;
}
.table-scroll.is-h-scrolled #dossierTable .cell-program-link-icon {
    margin-left: 2px;
}
/* Shift sticky-left offsets to match the narrower widths so columns
   sit flush against each other (40px checkbox + 150px each column) */
.table-scroll.is-h-scrolled #dossierTable th:nth-child(3),
.table-scroll.is-h-scrolled #dossierTable tbody td:nth-child(3) {
    left: 190px;
}
.table-scroll.is-h-scrolled #dossierTable th:nth-child(4),
.table-scroll.is-h-scrolled #dossierTable tbody td:nth-child(4) {
    left: 340px;
}

/* ── Quick filters Reset button ───────────────────────────────────
   Sits at the right end of the .quick-filters row. Subtle ghost-style
   button that clears every chip in the quick filter strip + the
   calendar chip in the topbar. */
.quick-filters-reset {
    margin-left: auto;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--hs-border, #d4d4d8);
    border-radius: 6px;
    color: var(--hs-text-muted, #667085);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.12s ease;
    height: 32px;
    line-height: 1;
    white-space: nowrap;
}
.quick-filters-reset:hover {
    background: var(--bg-elevated, #f8fafc);
    border-color: var(--accent, #0097b2);
    color: var(--accent, #0097b2);
}
.quick-filters-reset:active {
    transform: scale(0.97);
}
.quick-filters-reset svg {
    flex-shrink: 0;
}
[data-theme="dark"] .quick-filters-reset:hover {
    background: var(--bg-input, #1e293b);
}