/* ============================================================
   Bell Integration - Skills Search Tool
   Main stylesheet (light and dark themes)
   ============================================================ */

/* ---- Design tokens ---- */
/* All colours, fonts and radii are defined in static/css/theme.css (load it first).
   Never put a colour value in this file: use var(--token) or color-mix() of a token. */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-stack);
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--color-primary-light);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-text-primary);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    font-family: var(--font-stack);
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ---- Animations / Keyframes ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(80px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(80px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

.fade-in {
    animation: fadeIn var(--transition-slow) both;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease both;
}

/* Staggered card animations */
.fade-in:nth-child(1)  { animation-delay: 0.05s; }
.fade-in:nth-child(2)  { animation-delay: 0.10s; }
.fade-in:nth-child(3)  { animation-delay: 0.15s; }
.fade-in:nth-child(4)  { animation-delay: 0.20s; }
.fade-in:nth-child(5)  { animation-delay: 0.25s; }
.fade-in:nth-child(6)  { animation-delay: 0.30s; }
.fade-in:nth-child(7)  { animation-delay: 0.35s; }
.fade-in:nth-child(8)  { animation-delay: 0.40s; }
.fade-in:nth-child(9)  { animation-delay: 0.45s; }
.fade-in:nth-child(10) { animation-delay: 0.50s; }

/* ---- Glass Morphism ---- */
.glass {
    background: var(--color-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-sidebar);
    box-shadow: var(--sidebar-shadow);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    position: relative;
    padding: 16px 14px 14px;
}
/* Divider fades out at both ends instead of a full-width hard line */
.sidebar-header::after,
.sidebar-footer::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-card-border), transparent);
}
.sidebar-header::after { bottom: 0; }

.sidebar-logo {
    display: block;
    background: var(--color-sidebar);
    border-radius: 8px;
}

.logo-img {
    display: block;
    width: 148px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    background: transparent;
}

.logo-img-icon {
    display: none;
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-item:hover {
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    color: var(--color-text-primary);
}

.nav-item.active {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
}

.nav-item.active .nav-icon {
    color: var(--color-primary-light);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.sidebar-footer {
    position: relative;
    padding: 12px;
}
.sidebar-footer::before { top: 0; }

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.profile-photo-avatar {
    position: relative;
    overflow: hidden;
}

.profile-photo-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.profile-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.profile-photo-avatar.has-photo .profile-photo-img {
    opacity: 1;
}

.profile-photo-avatar.has-photo .profile-photo-initials {
    opacity: 0;
}

.share-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: capitalize;
}

.nav-logout {
    color: var(--color-text-muted);
}

.nav-logout:hover {
    background: color-mix(in srgb, var(--color-danger) 10%, transparent);
    color: var(--color-accent-red);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px 40px;
    /* NOTE: Do NOT use animation/transform here — it creates a stacking context
       that traps position:fixed modals inside .main-content.
       The fade-in is handled by main.js via an opacity transition instead. */
}

/* ---- Page Background Overlay ---- */
.page-bg-overlay {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* ---- Flash Messages ---- */
.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    animation: fadeIn var(--transition-base) both;
}

.flash-error, .flash-danger {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
    color: var(--color-danger);
}

.flash-success {
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
    color: var(--color-success);
}

.flash-info {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
    color: var(--color-primary-light);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    opacity: 0.6;
    cursor: pointer;
    padding: 0 4px;
    transition: opacity var(--transition-fast);
}

.flash-close:hover {
    opacity: 1;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}


/* Login card exit animation on form submit */
.login-container.login-exit {
    animation: loginCardExit 0.5s ease forwards;
}
@keyframes loginCardExit {
    to { opacity: 0; transform: scale(0.92) translateY(-20px); filter: blur(4px); }
}

/* ============================================================
   POST-LOGIN ENTRANCE ANIMATIONS
   Triggered when body has .post-login-enter class
   ============================================================ */
.post-login-enter .sidebar {
    animation: sidebarSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes sidebarSlideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.post-login-enter .main-content {
    animation: mainFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
@keyframes mainFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.post-login-enter .chat-panel {
    animation: chatSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both !important;
}
@keyframes chatSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.post-login-enter .search-initial-content {
    animation: contentReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}
@keyframes contentReveal {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    padding: 48px 40px;
    text-align: center;
    /* Dark glass card; the transparent white vertical logo blends into it */
    background: color-mix(in srgb, var(--color-shadow) 85%, transparent);
}

.login-logo {
    margin-bottom: 20px;
}

.login-logo-img {
    height: 132px;
    width: auto;
    object-fit: contain;
    /* Transparent PNG (white wordmark + colour swirl) sits directly on the dark card */
    background: transparent;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.input-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--color-text-muted);
    transition: stroke var(--transition-fast);
}

.input-group.focused .input-icon svg {
    stroke: var(--color-primary);
}

.login-input {
    padding-left: 48px !important;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
}

.login-sso-option {
    margin-top: 22px;
}

.btn-icon-right {
    width: 18px;
    height: 18px;
}

.login-flash {
    text-align: left;
    margin-bottom: 16px;
}

.login-footer-text {
    margin-top: 28px;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.4;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    box-shadow: 0 4px 20px color-mix(in srgb, var(--color-primary) 40%, transparent);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-card-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-card);
    color: var(--color-text-primary);
    border-color: var(--color-text-muted);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-on-status);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--color-danger) 30%, transparent);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 20px color-mix(in srgb, var(--color-danger) 40%, transparent);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-on-status);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-teams {
    background: linear-gradient(135deg, var(--brand-teams), color-mix(in srgb, var(--brand-teams) 80%, var(--bell-black)));
    color: var(--color-on-primary);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--brand-teams) 30%, transparent);
}

.btn-teams:hover:not(:disabled) {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-teams) 80%, var(--bell-white)), var(--brand-teams));
    box-shadow: 0 4px 20px color-mix(in srgb, var(--brand-teams) 40%, transparent);
    transform: translateY(-1px);
}

.btn-email {
    background: var(--color-info);
    color: var(--color-on-status);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--color-info) 30%, transparent);
}

.btn-email:hover:not(:disabled) {
    background: color-mix(in srgb, var(--color-info) 88%, var(--color-text-primary));
    box-shadow: 0 4px 20px color-mix(in srgb, var(--color-info) 40%, transparent);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-input-border);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-hover);
    color: var(--color-text-primary);
}

/* ---- Share to Teams Dialog ---- */
.teams-share-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn var(--transition-fast) ease;
}

.teams-share-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-base) ease;
}

.teams-share-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-card-border);
}

.teams-share-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.teams-share-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.teams-share-close:hover {
    color: var(--color-text-primary);
}

.teams-share-body {
    padding: 20px;
}

.teams-share-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.teams-share-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.teams-share-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-stack);
    transition: border-color var(--transition-fast);
}

.teams-share-input:focus {
    outline: none;
    border-color: var(--brand-teams);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-teams) 15%, transparent);
}

.teams-share-input::placeholder {
    color: var(--color-text-muted);
}

.teams-share-error {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--color-accent-red);
}

.teams-share-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-card-border);
}

.teams-share-footer .btn-spinner {
    display: inline-flex;
    align-items: center;
}

/* ---- Email Share Dialog ---- */
.email-share-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn var(--transition-fast) ease;
}

.email-share-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-base) ease;
}

.email-share-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-card-border);
}

.email-share-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.email-share-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.email-share-close:hover {
    color: var(--color-text-primary);
}

.email-share-body {
    padding: 20px;
}

.email-share-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.email-share-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.email-share-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-stack);
    transition: border-color var(--transition-fast);
}

.email-share-input:focus {
    outline: none;
    border-color: var(--color-info);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-info) 15%, transparent);
}

.email-share-input::placeholder {
    color: var(--color-text-muted);
}

.email-share-error {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--color-accent-red);
}

.email-share-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-card-border);
}

.email-share-footer .btn-spinner {
    display: inline-flex;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon:hover {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--color-primary-light);
}

.btn-icon-danger:hover {
    background: color-mix(in srgb, var(--color-danger) 10%, transparent);
    color: var(--color-accent-red);
}

/* ============================================================
   FORM INPUTS
   ============================================================ */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-stack);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

.form-select option {
    background: var(--color-card);
    color: var(--color-text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ---- Character Limit Counter ---- */
.textarea-limit-wrapper {
    position: relative;
}
.char-counter {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
    transition: color var(--transition-fast);
}
.char-counter.near-limit {
    color: var(--color-accent-orange);
}
.char-counter.at-limit {
    color: var(--color-accent-red);
    font-weight: 600;
}
.char-count {
    display: inline-block;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-help {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.required {
    color: var(--color-accent-red);
}

/* ============================================================
   TAGS / PILLS
   ============================================================ */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    transition: all var(--transition-fast);
    animation: fadeIn var(--transition-base) both;
}

.tag-skill {
    background: color-mix(in srgb, var(--color-tint) 8%, transparent);
    color: var(--color-text-primary);
    border: 1px solid color-mix(in srgb, var(--color-tint) 20%, transparent);
}

.tag-skill:hover {
    border-color: color-mix(in srgb, var(--color-primary) 55%, transparent);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.tag-sector {
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    color: var(--color-accent-green);
    border: 1px solid color-mix(in srgb, var(--color-success) 25%, transparent);
}

.tag-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    line-height: 1;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-more {
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-card-border);
}

/* Certification badges: tinted chip in the vendor colour, so no vendor fill
   (e.g. AWS orange) overpowers the card. --cert-text-mix (theme.css) keeps
   the label readable in both themes. */
.cert-badge {
    --cert-c: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: color-mix(in srgb, var(--cert-c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--cert-c) 45%, transparent);
    border-left: 3px solid var(--cert-c);
    color: color-mix(in srgb, var(--cert-c) var(--cert-text-mix), var(--color-text-primary));
}

.cert-aws      { --cert-c: var(--brand-aws); }
.cert-azure,
.cert-microsoft { --cert-c: var(--brand-microsoft); }
.cert-vmware   { --cert-c: var(--brand-vmware); }
.cert-redhat,
.cert-red-hat  { --cert-c: var(--brand-redhat); }
.cert-google   { --cert-c: var(--brand-google); }
.cert-comptia  { --cert-c: var(--brand-comptia); }
.cert-cisco    { --cert-c: var(--brand-cisco); }
.cert-hashicorp { --cert-c: var(--brand-hashicorp); }
.cert-cncf,
.cert-linux-foundation { --cert-c: var(--brand-cncf); }
.cert-other    { --cert-c: var(--color-text-muted); }

/* ---- Role Badges ---- */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-icon {
    width: 14px;
    height: 14px;
}

.role-admin {
    background: color-mix(in srgb, var(--role-admin) 15%, transparent);
    color: var(--role-admin);
    border: 1px solid color-mix(in srgb, var(--role-admin) 30%, transparent);
}

.role-manager {
    background: color-mix(in srgb, var(--role-manager) 15%, transparent);
    color: var(--role-manager);
    border: 1px solid color-mix(in srgb, var(--role-manager) 30%, transparent);
}

.role-employee {
    background: color-mix(in srgb, var(--role-employee) 15%, transparent);
    color: var(--role-employee);
    border: 1px solid color-mix(in srgb, var(--role-employee) 30%, transparent);
}

.role-linemanager {
    background: color-mix(in srgb, var(--role-linemanager) 15%, transparent);
    color: var(--role-linemanager);
    border: 1px solid color-mix(in srgb, var(--role-linemanager) 30%, transparent);
}

/* ---- Match Score Badge ---- */
.match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-accent-green);
    border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    margin-top: 8px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.page-title-icon {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.password-panel {
    max-width: 520px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    padding: 24px;
}

.password-form .btn {
    width: 100%;
    justify-content: center;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-purple {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
}

.stat-icon-green {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-accent-green);
}

.stat-icon-blue {
    background: color-mix(in srgb, var(--color-info) 15%, transparent);
    color: var(--color-info);
}

.stat-icon-orange {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-accent-orange);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

/* ---- Quick Action Cards ---- */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.action-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 28px;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--color-primary) 25%, transparent);
    color: var(--color-text-primary);
}

.action-card:hover::before {
    opacity: 1;
}

.action-card-large {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--color-primary-light);
}

.action-icon svg {
    width: 24px;
    height: 24px;
}

.action-icon-large {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.action-icon-large svg {
    width: 32px;
    height: 32px;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.action-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ---- Clickable Stat Cards ---- */
.stat-card-link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card-link:hover .stat-card {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}

/* ---- Chart Card Highlight (on stat click scroll) ---- */
.chart-card-highlight {
    box-shadow: 0 0 0 2px var(--color-primary), var(--shadow-lg) !important;
    transition: box-shadow 0.3s ease !important;
}

/* ============================================================
   DASHBOARD CHARTS & ANALYTICS
   ============================================================ */

/* ---- Charts Grid ---- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 8px;
}

.chart-card {
    grid-column: span 1;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.chart-card:hover {
    border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
    box-shadow: var(--shadow-md);
}

.chart-card-wide {
    grid-column: span 4;
}

.chart-card-half {
    grid-column: span 2;
}

/* Chart card inner layout */
.chart-card-header {
    padding: 20px 24px 0;
}

.chart-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.chart-card-body {
    padding: 16px 24px 20px;
    position: relative;
}

.chart-card-body-doughnut {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-card-body-bar {
    height: 400px;
    min-height: 300px;
}

/* ---- Drill-Down Modal ---- */
.drilldown-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.drilldown-modal-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    padding: 3px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

.drilldown-modal-body {
    padding: 0 !important;
    overflow-y: auto;
}

/* Employee rows in drill-down modal */
.drilldown-modal-list {
    display: flex;
    flex-direction: column;
}

.drilldown-modal-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-card-border) 30%, transparent);
    cursor: pointer;
    animation: drilldownFadeIn 0.35s ease both;
    transition: background var(--transition-fast),
                border-left-color var(--transition-fast);
    border-left: 3px solid transparent;
}

.drilldown-modal-row:last-child {
    border-bottom: none;
}

.drilldown-modal-row:hover {
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
    border-left-color: var(--color-primary);
}

.drilldown-modal-row:hover .drilldown-modal-chevron {
    opacity: 1;
    transform: translateX(0);
}

@keyframes drilldownFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar circle */
.drilldown-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Info block */
.drilldown-modal-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.drilldown-modal-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drilldown-modal-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right side: status + project */
.drilldown-modal-row-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.drilldown-modal-project {
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Chevron arrow */
.drilldown-modal-chevron {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--transition-fast);
}

/* Loading & error states */
.drilldown-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.drilldown-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-card-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.drilldown-error {
    padding: 20px 24px;
    color: var(--color-accent-red);
    font-size: 13px;
    text-align: center;
}

.drilldown-empty {
    padding: 40px 24px;
    color: var(--color-text-muted);
    font-size: 14px;
    text-align: center;
}

/* ---- Skill Explorer ---- */
.skill-explorer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-explorer-controls {
    display: flex;
    gap: 12px;
}

/* Searchable select component */
.searchable-select {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
}

.searchable-select-trigger:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.searchable-select-input {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-stack);
}

.searchable-select-input::placeholder {
    color: var(--color-text-muted);
}

.searchable-select-arrow {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    color: var(--color-text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.searchable-select.open .searchable-select-arrow {
    transform: rotate(180deg);
}

.searchable-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--color-shadow) 40%, transparent);
    z-index: 50;
    overflow: hidden;
}

.searchable-select.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.searchable-select-list::-webkit-scrollbar {
    width: 6px;
}

.searchable-select-list::-webkit-scrollbar-track {
    background: transparent;
}

.searchable-select-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-tint) 10%, transparent);
    border-radius: 3px;
}

.searchable-select-list::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-tint) 20%, transparent);
}

.searchable-select-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--color-text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.searchable-select-option.selected {
    background: color-mix(in srgb, var(--color-primary) 20%, transparent);
    font-weight: 500;
}

.searchable-select-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
}

.skill-explorer-placeholder {
    color: var(--color-text-muted);
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

/* Summary stats row */
.skill-explorer-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.skill-explorer-stat {
    flex: 1;
    min-width: 100px;
    padding: 16px 20px;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
    text-align: center;
    animation: drilldownFadeIn 0.4s ease both;
}

.skill-explorer-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.skill-explorer-stat-label {
    display: block;
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Employee list */
.skill-explorer-list {
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
}

.skill-explorer-list::-webkit-scrollbar {
    width: 6px;
}

.skill-explorer-list::-webkit-scrollbar-thumb {
    background: var(--color-card-border);
    border-radius: 3px;
}

.skill-explorer-employee {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-card-border) 30%, transparent);
    animation: drilldownFadeIn 0.35s ease both;
    transition: background var(--transition-fast),
                border-left-color var(--transition-fast);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.skill-explorer-employee:last-child {
    border-bottom: none;
}

.skill-explorer-employee:hover {
    background: color-mix(in srgb, var(--color-primary) 5%, transparent);
    border-left-color: var(--color-primary);
}

.skill-explorer-emp-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.skill-explorer-emp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.skill-explorer-emp-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.skill-explorer-emp-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 16px;
}

.skill-explorer-emp-project {
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.skill-explorer-results {
    min-height: 80px;
}

/* ---- Skill Cloud (semantic skill map, static/js/skill-cloud.js) ---- */
.skill-cloud {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skill-cloud-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-cloud-search {
    flex: 0 1 340px;
    min-width: 220px;
}

.skill-cloud-search-icon {
    width: 16px;
    height: 16px;
    margin-left: 12px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.skill-cloud-search .searchable-select-input {
    padding-left: 10px;
}

.searchable-select-option.skill-cloud-option-semantic {
    color: var(--color-primary-light);
    font-style: italic;
}

.skill-cloud-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.skill-cloud-anchor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--sc-color) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--sc-color) 60%, transparent);
}

.skill-cloud-anchor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-color);
}

.skill-cloud-anchor button {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-tint) 8%, transparent);
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.skill-cloud-anchor button:hover {
    background: color-mix(in srgb, var(--color-tint) 20%, transparent);
    color: var(--color-text-primary);
}

.skill-cloud-options {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.skill-cloud-toggle,
.skill-cloud-range {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.skill-cloud-toggle[hidden] {
    display: none;
}

.skill-cloud-toggle input,
.skill-cloud-range input {
    accent-color: var(--color-primary-light);
}

.skill-cloud-range input {
    width: 110px;
}

.skill-cloud-range span {
    min-width: 18px;
    color: var(--color-text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.skill-cloud-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.skill-cloud-top-label {
    flex-shrink: 0;
    padding-top: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.skill-cloud-top-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-cloud-chip {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--color-card-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 12px;
    transition: all var(--transition-fast);
}

.skill-cloud-chip small {
    margin-left: 4px;
    color: var(--color-text-muted);
    font-size: 10px;
}

.skill-cloud-chip:hover {
    border-color: var(--color-primary-light);
    color: var(--color-text-primary);
}

.skill-cloud-chip.active {
    color: var(--color-text-primary);
    border-color: var(--sc-color, var(--color-primary-light));
    background: color-mix(in srgb, var(--sc-color, var(--color-primary-light)) 25%, transparent);
}

.skill-cloud-stage {
    position: relative;
    height: 720px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-card-border);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.skill-cloud-stage svg {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    user-select: none;
}

.skill-cloud-stage svg:active {
    cursor: grabbing;
}

.skill-cloud-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

.skill-cloud-message[hidden] {
    display: none;
}

.skill-cloud-message svg {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    color: var(--color-primary-light);
    opacity: 0.7;
}

.skill-cloud-message span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.skill-cloud-message.is-error {
    color: var(--color-danger);
}

.skill-cloud-message.is-loading {
    background: color-mix(in srgb, var(--color-bg) 60%, transparent);
    backdrop-filter: blur(2px);
}

.skill-cloud-message .drilldown-spinner {
    margin-bottom: 8px;
}

.skill-cloud-zoom {
    position: absolute;
    right: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 3;
}

.skill-cloud-zoom[hidden] {
    display: none;
}

.skill-cloud-zoom button {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass-bg);
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1;
    backdrop-filter: blur(6px);
    transition: all var(--transition-fast);
}

.skill-cloud-zoom button:hover {
    color: var(--color-text-primary);
    border-color: var(--color-primary-light);
}

.skill-cloud-tooltip {
    position: absolute;
    z-index: 4;
    min-width: 220px;
    max-width: 300px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    border: 1px solid var(--color-glass-border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
    pointer-events: none;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.skill-cloud-tooltip[hidden] {
    display: none;
}

.sct-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.sct-meta {
    margin-top: 2px;
}

.sct-bar {
    display: flex;
    height: 5px;
    margin: 8px 0 10px;
    border-radius: 3px;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-tint) 6%, transparent);
}

.sct-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.sct-row b {
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
}

.sct-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sct-hint {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--color-tint) 6%, transparent);
    font-size: 11px;
    color: var(--color-text-muted);
}

/* SVG elements */
.sc-ring {
    fill: none;
    stroke: color-mix(in srgb, var(--color-text-secondary) 14%, transparent);
    stroke-dasharray: 2 6;
}

.sc-ring-label {
    fill: var(--color-text-muted);
    font-size: 10px;
    letter-spacing: 0.4px;
}

.sc-link {
    fill: none;
    stroke-linecap: round;
    transition: opacity var(--transition-fast);
}

/* Loosely related (weaker half): dotted */
.sc-link.is-far {
    stroke-dasharray: 1 5;
}

/* Focus skill -> common bubble */
.sc-link-common {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 2;
    stroke-opacity: 0.55;
    transition: opacity var(--transition-fast);
}

.sc-link-common.is-empty {
    stroke-dasharray: 5 6;
    stroke-opacity: 0.35;
}

/* Common bubble: people holding every focus skill */
.sc-node.is-common .sc-core {
    stroke: color-mix(in srgb, var(--color-accent) 50%, var(--color-text-primary));
    stroke-width: 2.5;
}

.sc-node.is-common .sc-count {
    fill: var(--color-on-accent);
}

.sc-node.is-common .sc-label {
    font-size: 13px;
    font-weight: 700;
    fill: var(--color-accent);
}

.sc-sublabel {
    fill: var(--color-text-secondary);
    font-size: 11px;
    text-anchor: middle;
    paint-order: stroke;
    stroke: var(--color-bg);
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Nobody has all the focus skills: hollow, dashed "0" */
.sc-node.is-common.is-empty .sc-core {
    fill: color-mix(in srgb, var(--color-accent) 6%, transparent);
    stroke: var(--color-accent);
    stroke-width: 2;
    stroke-dasharray: 4 4;
}

.sc-node.is-common.is-empty .sc-count {
    fill: var(--color-accent);
}

.sc-node {
    cursor: pointer;
    outline: none;
    transition: opacity var(--transition-fast);
}

.sc-node .sc-core {
    transition: stroke-width var(--transition-fast);
}

.sc-node:hover .sc-core,
.sc-node:focus-visible .sc-core {
    stroke-width: 2.5;
}

.sc-node.is-anchor .sc-core {
    stroke: color-mix(in srgb, var(--color-tint) 85%, transparent);
    stroke-width: 2.5;
}

/* Free-text topic (e.g. "reporting"): dashed rim marks it as not a skill */
.sc-node.is-topic .sc-core {
    stroke-dasharray: 5 4;
}

.skill-cloud-anchor-tag,
.sct-tag {
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-secondary);
    background: color-mix(in srgb, var(--color-tint) 8%, transparent);
}

.sc-node.is-selected .sc-core {
    stroke: var(--color-text-primary);
    stroke-width: 3;
}

.sc-selected-ring {
    fill: none;
    stroke: var(--color-text-primary);
    stroke-width: 1.5;
    stroke-dasharray: 3 4;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.sc-node.is-selected .sc-selected-ring {
    opacity: 0.8;
}

.sc-count {
    fill: var(--color-on-primary);
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.sc-label {
    fill: var(--color-text-primary);
    font-size: 11.5px;
    font-weight: 500;
    text-anchor: middle;
    paint-order: stroke;
    stroke: var(--color-bg);
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
}

.sc-node.is-anchor .sc-label {
    font-size: 15px;
    font-weight: 700;
    fill: var(--color-text-primary);
}

.skill-cloud-stage .is-dim {
    opacity: 0.14;
}

.skill-cloud-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.skill-cloud-legend[hidden] {
    display: none;
}

.skill-cloud-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.skill-cloud-legend i {
    display: inline-block;
    flex-shrink: 0;
}

.scl-bubble {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary-light);
}

.scl-line {
    width: 22px;
    height: 0;
    border-top: 2px solid var(--color-primary-light);
}

.scl-line.is-far {
    border-top-style: dotted;
}

.scl-common {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
}

.skill-cloud-legend span[hidden] {
    display: none;
}

.scl-ring i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
}

.scl-hint {
    margin-left: auto;
}

.skill-cloud-people {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 6px;
    animation: drilldownFadeIn 0.35s ease both;
}

.skill-cloud-people[hidden] {
    display: none;
}

.skill-cloud-people-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.skill-cloud-people-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.skill-cloud-people-title strong {
    color: var(--color-text-primary);
}

#skill-cloud-people-add[hidden],
#skill-cloud-clear[hidden] {
    display: none;
}

@media (max-width: 768px) {
    .skill-cloud-stage {
        height: 440px;
    }

    .skill-cloud-search {
        flex: 1 1 100%;
    }

    .skill-cloud-options {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .skill-cloud-top {
        flex-direction: column;
        gap: 6px;
    }

    .scl-hint {
        margin-left: 0;
    }
}

/* ============================================================
   DASHBOARD – SECTION TAB NAVIGATION
   ============================================================ */
.dash-section-nav {
    display: flex;
    gap: 4px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: 6px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.dash-section-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    flex: 1;
    justify-content: center;
}

.dash-section-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dash-section-tab:hover {
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.dash-section-tab.active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 15%, transparent), color-mix(in srgb, var(--color-primary) 10%, transparent));
    color: var(--color-primary-light);
    font-weight: 600;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.dash-section {
    display: none;
}

.dash-section.active {
    display: block;
    animation: dashSectionFadeIn 0.3s ease;
}

@keyframes dashSectionFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-card-subtitle {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ============================================================
   DASHBOARD – BENCH & RESOURCES SECTION
   ============================================================ */
.bench-loading,
.sector-loading,
.insights-loading {
    text-align: center;
    padding: 60px 0;
    color: var(--color-text-secondary);
}

.bench-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.bench-summary-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all var(--transition-base);
}

.bench-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.bench-summary-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.bench-summary-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bench-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.bench-panel {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.bench-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bench-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bench-panel-count {
    font-size: 12px;
    color: var(--color-text-muted);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    padding: 3px 10px;
    border-radius: 12px;
}

.bench-panel-body {
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Bench bar chart rows */
.bench-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    animation: dashSectionFadeIn 0.3s ease both;
}

.bench-bar-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    min-width: 120px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.bench-bar-track {
    flex: 1;
    height: 8px;
    background: color-mix(in srgb, var(--color-card-border) 40%, transparent);
    border-radius: 4px;
    overflow: hidden;
}

.bench-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bench-bar-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 28px;
    text-align: right;
}

/* Bench Employee List */
.bench-emp-list {
    max-height: 600px;
}

.bench-emp-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-card-border) 30%, transparent);
    cursor: pointer;
    transition: background var(--transition-fast), border-left-color var(--transition-fast);
    border-left: 3px solid transparent;
    animation: dashSectionFadeIn 0.3s ease both;
}

.bench-emp-card:last-child {
    border-bottom: none;
}

.bench-emp-card:hover {
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
    border-left-color: var(--color-primary);
}

.bench-emp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.bench-emp-info {
    flex: 1;
    min-width: 0;
}

.bench-emp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.bench-emp-title {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.bench-emp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.bench-skill-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
    border-radius: 10px;
}

.bench-sector-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
    border-radius: 10px;
}

.bench-emp-chevron {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--transition-fast);
}

.bench-emp-card:hover .bench-emp-chevron {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   DASHBOARD – HEATMAP HEADER & SELECTOR
   ============================================================ */
.heatmap-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.heatmap-selector {
    flex-shrink: 0;
}

.heatmap-category-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    padding: 8px 36px 8px 14px;
    color: var(--color-text-primary);
    font-size: 13px;
    font-family: var(--font-stack);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 180px;
}

.heatmap-category-select:hover {
    border-color: var(--color-primary);
}

.heatmap-category-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.heatmap-category-select option {
    background: var(--color-surface);
    color: var(--color-text-primary);
    padding: 8px;
}

/* ============================================================
   DASHBOARD – HEATMAP
   ============================================================ */
.heatmap-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
}

.heatmap-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
}

.heatmap-corner {
    width: 120px;
}

.heatmap-col-header {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 8px 6px;
    text-align: center;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    max-width: 40px;
    white-space: nowrap;
}

.heatmap-row-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
    padding: 8px 12px;
    white-space: nowrap;
    border-right: 1px solid var(--color-card-border);
}

.heatmap-cell {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 6px;
    border: 1px solid color-mix(in srgb, var(--color-card-border) 30%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
    min-width: 40px;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px color-mix(in srgb, var(--color-primary) 40%, transparent);
    z-index: 2;
    position: relative;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}

.heatmap-legend-swatch {
    width: 24px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid color-mix(in srgb, var(--color-tint) 8%, transparent);
}

.heatmap-legend-label {
    font-size: 11px;
    color: var(--color-text-muted);
    padding: 0 6px;
}

/* ============================================================
   DASHBOARD – READINESS SCORES
   ============================================================ */
.readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.readiness-card {
    background: color-mix(in srgb, var(--color-surface) 60%, transparent);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
    animation: dashSectionFadeIn 0.4s ease both;
}

.readiness-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.readiness-gauge {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.readiness-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.readiness-ring-bg {
    fill: none;
    stroke: color-mix(in srgb, var(--color-card-border) 60%, transparent);
    stroke-width: 3;
}

.readiness-ring-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.readiness-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
}

.readiness-info {
    flex: 1;
    min-width: 0;
}

.readiness-sector {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.readiness-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-primary);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.readiness-meta {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ============================================================
   DASHBOARD – CAPABILITY MAP (TREEMAP)
   ============================================================ */
.treemap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.treemap-sector {
    flex: 1 1 auto;
    min-width: 200px;
    background: color-mix(in srgb, var(--color-surface) 50%, transparent);
    border: 1px solid var(--color-card-border);
    border-left: 4px solid;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-base);
}

.treemap-sector:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.treemap-sector-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.treemap-sector-count {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
}

.treemap-skills {
    line-height: 2;
}

.treemap-skill-pill {
    display: inline;
    color: var(--color-text-secondary);
    cursor: default;
    transition: color var(--transition-fast);
    margin-right: 4px;
}

.treemap-skill-pill:hover {
    color: var(--color-text-primary);
}

.treemap-skill-pill sup {
    font-size: 0.6em;
    color: var(--color-primary-light);
    font-weight: 600;
}

/* ============================================================
   DASHBOARD – SMART ALERTS
   ============================================================ */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: color-mix(in srgb, var(--color-surface) 50%, transparent);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    transition: all var(--transition-base);
    animation: dashSectionFadeIn 0.3s ease both;
}

.alert-card:hover {
    background: color-mix(in srgb, var(--color-surface) 80%, transparent);
    box-shadow: var(--shadow-sm);
}

.alert-clickable {
    cursor: pointer;
}

.alert-clickable:focus-visible {
    outline: 2px solid var(--color-primary-light);
    outline-offset: 2px;
}

.alert-chevron {
    width: 18px;
    height: 18px;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--color-text-muted);
    opacity: 0.6;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.alert-clickable:hover .alert-chevron {
    opacity: 1;
    transform: translateX(3px);
}

.alert-explore-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-surface) 50%, transparent);
    font-size: 13px;
    color: var(--color-text-muted);
}

.alert-critical {
    border-left-color: var(--color-danger);
}

.alert-critical .alert-icon-wrap {
    color: var(--color-danger);
}

.alert-warning {
    border-left-color: var(--color-warning);
}

.alert-warning .alert-icon-wrap {
    color: var(--color-warning);
}

.alert-info {
    border-left-color: var(--color-info);
}

.alert-info .alert-icon-wrap {
    color: var(--color-info);
}

.alert-success {
    border-left-color: var(--color-success);
}

.alert-success .alert-icon-wrap {
    color: var(--color-success);
}

.alert-icon-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-tint) 4%, transparent);
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.alert-message {
    font-size: 13px;
    color: var(--color-text-primary);
    line-height: 1.5;
}

/* ============================================================
   DASHBOARD – GAP ANALYSIS TABLE
   ============================================================ */
.gap-analysis-table {
    width: 100%;
}

.gap-row {
    display: grid;
    grid-template-columns: 140px 80px 1fr 120px 1fr;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-card-border) 30%, transparent);
    animation: dashSectionFadeIn 0.3s ease both;
}

.gap-row:last-child {
    border-bottom: none;
}

.gap-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: none;
    border-bottom: 1px solid var(--color-card-border);
}

.gap-col-sector {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.gap-col-readiness {
    font-size: 14px;
    text-align: center;
}

.gap-col-bar {
    min-width: 0;
}

.gap-bar-track {
    height: 8px;
    background: color-mix(in srgb, var(--color-card-border) 40%, transparent);
    border-radius: 4px;
    overflow: hidden;
}

.gap-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gap-col-bench {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
}

.gap-col-action {
    font-size: 12px;
}

.gap-rec {
    display: inline-block;
    padding-left: 10px;
    border-left: 3px solid;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* ============================================================
   DASHBOARD – EXPORT ACTIONS
   ============================================================ */
.export-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================
   DASHBOARD – RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 1200px) {
    .bench-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bench-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .gap-row {
        grid-template-columns: 120px 60px 1fr 100px 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .dash-section-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .dash-section-tab {
        flex: none;
        padding: 8px 14px;
        font-size: 12px;
    }

    .bench-grid {
        grid-template-columns: 1fr;
    }

    .bench-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .readiness-grid {
        grid-template-columns: 1fr;
    }

    .gap-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .gap-header {
        display: none;
    }
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-hero {
    text-align: center;
    margin-bottom: 12px;
    padding-top: 4px;
}

.search-hero-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark), var(--color-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-hero-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* ---- Search Bar ---- */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-bar-icon {
    position: absolute;
    left: 14px;
    top: 14px;
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-stack);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    /* Textarea-specific */
    resize: none;
    overflow-y: auto;
    min-height: 42px;
    max-height: 300px;
    line-height: 1.5;
    display: block;
}

/* Custom resize handle at bottom-right of the input wrapper */
.search-resize-handle {
    position: absolute;
    bottom: 2px;
    right: 6px;
    width: 20px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    color: var(--color-text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
    user-select: none;
}

.search-input-wrapper:hover .search-resize-handle,
.search-input:focus ~ .search-resize-handle {
    opacity: 0.6;
}

.search-resize-handle:hover {
    opacity: 1 !important;
    color: var(--color-primary-light);
}

/* ---- Autocomplete Dropdown ---- */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 500;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--color-shadow) 12%, transparent);
}

/* Autocomplete inside chat input area: drops upward */
.chat-input-area .autocomplete-dropdown {
    top: auto;
    bottom: 100%;
    border-top: 1px solid var(--color-card-border);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: 0 -8px 24px color-mix(in srgb, var(--color-shadow) 20%, transparent);
    margin-bottom: 4px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 52px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-primary);
    transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--color-hover);
}

.autocomplete-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.autocomplete-type.type-skill {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
}

.autocomplete-type.type-cert {
    background: color-mix(in srgb, var(--color-success) 18%, transparent);
    color: var(--color-accent-green);
}

.autocomplete-type.type-exam {
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
    color: var(--color-accent-orange);
}

.autocomplete-type.type-title {
    background: color-mix(in srgb, var(--color-info) 15%, transparent);
    color: var(--color-info);
}

.autocomplete-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-text mark {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: 600;
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.search-btn {
    padding: 10px 22px;
    font-size: 14px;
    flex-shrink: 0;
    height: 42px;
    align-self: flex-start;
}

.search-btn-spinner {
    display: flex;
    align-items: center;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, var(--color-tint) 30%, transparent);
    border-top-color: var(--color-on-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---- Scrollable results container ---- */
.search-results-scroll {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 4px;
    position: relative;
    z-index: 1;
}

.search-results-scroll::-webkit-scrollbar {
    width: 6px;
}

.search-results-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-scroll::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-tint) 10%, transparent);
    border-radius: 3px;
}

.search-results-scroll::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-tint) 20%, transparent);
}

/* ---- Inline Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 6px;
    animation: fadeIn var(--transition-base) both;
    position: relative;
    z-index: 100;
}

.filter-bar-items {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Individual filter dropdown */
.filter-dropdown {
    position: relative;
    z-index: 100;
}

.filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-stack);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-dropdown-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

/* Active state when selections exist */
.filter-dropdown-btn.has-selection {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary-light);
    font-weight: 600;
}

.filter-dropdown-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.filter-dropdown.open .filter-dropdown-chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.filter-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--color-shadow) 25%, transparent);
    z-index: 200;
    padding: 6px 0;
    animation: fadeIn 0.15s ease both;
}

.filter-dropdown.open .filter-dropdown-menu {
    display: block;
}

/* Clear button */
.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-family: var(--font-stack);
    font-size: 12px;
    cursor: pointer;
    border-radius: 20px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-clear-btn:hover {
    color: var(--color-accent-red);
    background: color-mix(in srgb, var(--color-danger) 10%, transparent);
}

/* ---- Filter Checkboxes (inside dropdown menus) ---- */

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
    user-select: none;
}

.filter-checkbox:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.filter-checkbox-mark {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 2px solid var(--color-card-border);
    border-radius: 4px;
    position: relative;
    transition: all 0.15s ease;
}

.filter-checkbox input[type="checkbox"]:checked ~ .filter-checkbox-mark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.filter-checkbox input[type="checkbox"]:checked ~ .filter-checkbox-mark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--color-on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox input[type="checkbox"]:checked ~ span:last-child {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* (clear-filters-btn removed — using .filter-clear-btn in inline bar) */

/* ---- Search Results ---- */
.search-results-section {
}

.results-header {
    margin-bottom: 8px;
}

.results-count {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    position: relative;
    transition: all var(--transition-base);
    animation: fadeIn var(--transition-slow) both;
    cursor: pointer;
}

.result-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
    background: var(--color-surface);
}
.result-card.card-selected {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

/* Card checkbox */
.card-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    width: 18px;
    height: 18px;
}
.card-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}
.card-checkbox-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-card-border);
    border-radius: 3px;
    background: var(--color-input-bg);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-checkbox input:checked + .card-checkbox-mark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.card-checkbox input:checked + .card-checkbox-mark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid var(--color-on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.card-checkbox:hover .card-checkbox-mark {
    border-color: var(--color-primary-light);
}

/* Bulk actions bar (right side of filter bar) */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.bulk-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    position: relative;
}
.bulk-select-all-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    z-index: 1;
}
.bulk-select-all-mark {
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-card-border);
    border-radius: 3px;
    background: var(--color-input-bg);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bulk-select-all-label input:checked + .bulk-select-all-mark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.bulk-select-all-label input:checked + .bulk-select-all-mark::after {
    content: '';
    width: 3px;
    height: 7px;
    border: solid var(--color-on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.bulk-select-all-label input:indeterminate + .bulk-select-all-mark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.bulk-select-all-label input:indeterminate + .bulk-select-all-mark::after {
    content: '';
    width: 8px;
    height: 2px;
    background: var(--color-on-primary);
    border: none;
    transform: none;
}
.bulk-count {
    font-weight: 600;
    color: var(--color-primary-light);
}
.bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bulk-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Row 1: name | title | location | score | actions — all inline */
.result-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 0;
    min-width: 0;
}

.result-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.result-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
}

/* Anonymous toggle button (next to spreadsheet export) — applies only to
   downloaded Word; on-screen cards always show real names so the manager
   can identify who they're downloading. */
.anonymous-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--color-card-border);
    color: var(--color-text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.anonymous-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.anonymous-toggle-btn[aria-pressed="true"] {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}
.anonymous-toggle-btn[aria-pressed="true"]:hover {
    background: var(--color-primary-light, var(--color-primary));
    color: var(--color-on-primary);
}

.result-title {
    font-size: 13px;
    color: var(--color-primary-light);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 120px;
}

.result-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    margin: 0;
}

.result-location svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Compact detail rows */
.result-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    margin-bottom: 0;
}

.result-certs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 0;
}

.result-sector {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    margin-bottom: 0;
}

.result-sector strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.result-summary {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-top: 4px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Actions sit at the right end of the header row */
.result-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.result-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
    gap: 3px;
}

.result-actions .btn svg {
    width: 12px !important;
    height: 12px !important;
}

/* ---- No Results ---- */
.no-results {
    text-align: center;
    padding: 40px 20px;
}
.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}
.no-results-icon {
    width: 64px;
    height: 64px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}
.no-results h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}
.no-results p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ============================================================
   ENHANCED INITIAL STATE
   ============================================================ */
.search-initial {
    position: relative;
    text-align: center;
    padding: 40px 20px 30px;
    overflow: hidden;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* -- Content (above canvas) -- */
.search-initial-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.search-initial-icon {
    width: 56px;
    height: 56px;
    color: var(--color-primary-light);
    margin-bottom: 16px;
    opacity: 0.7;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--color-primary) 40%, transparent));
}

.search-initial h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.search-initial p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
}

/* -- Quick-Chat Chips -- */
.search-initial-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
}
.search-initial-chip {
    display: inline-block;
    padding: 6px 14px;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-primary-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.search-initial-chip:hover {
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-color: var(--color-primary);
}

/* -- Feature cards row -- */
.feature-cards-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}
.feature-card {
    background: color-mix(in srgb, var(--color-card) 65%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
    border-radius: 14px;
    padding: 20px 18px 18px;
    width: 170px;
    text-align: center;
    opacity: 0;
    animation: featureCardIn 0.6s ease forwards, featureFloat 5s ease-in-out 0.8s infinite;
    transition: border-color 0.3s;
}
.feature-card:nth-child(1) { animation-delay: 0.1s, 0.9s; }
.feature-card:nth-child(2) { animation-delay: 0.25s, 1.6s; }
.feature-card:nth-child(3) { animation-delay: 0.4s, 2.3s; }

.feature-card:hover {
    border-color: var(--color-primary);
}

@keyframes featureCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes featureFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.feature-card-icon {
    margin-bottom: 10px;
}
.feature-card-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-primary-light);
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--color-primary) 30%, transparent));
}

.feature-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}
.feature-card-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* -- Responsive: stack feature cards on narrow screens -- */
@media (max-width: 640px) {
    .feature-cards-row { flex-direction: column; align-items: center; }
    .feature-card { width: 90%; max-width: 260px; }
}

/* ============================================================
   CONVERSATIONAL SEARCH LAYOUT
   ============================================================ */
.search-page-chat-layout {
    display: flex;
    gap: 0;
    height: 100vh;
    overflow: hidden;
    padding: 0 !important;
    margin: -32px -40px;
    width: calc(100% + 80px);
}

.search-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.search-page-chat-layout .search-results-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: none;
}

/* ---- Horizontal Filter Bar (top of results) ---- */
.filter-bar-collapsed {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-card-border);
    flex-shrink: 0;
    z-index: 50;
}

.filter-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.filter-icon-btn:hover {
    color: var(--color-primary-light);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.filter-icon-btn svg {
    width: 16px;
    height: 16px;
}
.filter-bar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-right: 4px;
}
.filter-bar-divider {
    width: 1px;
    height: 20px;
    background: var(--color-card-border);
    margin: 0 6px;
}
.filter-active-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    margin-left: 4px;
}
.filter-active-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
    border-radius: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.filter-active-tag:hover {
    background: color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.filter-active-tag .tag-remove {
    font-size: 14px;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
}
.filter-active-tag .tag-remove:hover {
    color: var(--color-accent-red);
}

/* ---- Filter Panel Overlay (dropdown from top) ---- */
.filter-panel-overlay {
    position: absolute;
    left: 0;
    top: 44px;
    right: 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-card-border);
    z-index: 60;
    display: flex;
    flex-direction: column;
    animation: slideDownFilter 0.2s ease both;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--color-shadow) 30%, transparent);
    max-height: 400px;
}

@keyframes slideDownFilter {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.filter-panel-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-card-border);
}
.filter-panel-overlay-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.filter-panel-close-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.filter-panel-close-btn:hover {
    color: var(--color-text-primary);
}
.filter-panel-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.filter-group {
    padding: 0;
    min-width: 150px;
}
.filter-group-title {
    padding: 0 0 4px 0;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-card-border);
}
.filter-panel-overlay .filter-checkbox {
    padding: 3px 0;
    font-size: 12px;
}
.filter-panel-overlay-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--color-card-border);
}

/* Results scroll fills remaining height */
.search-page-chat-layout .search-results-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Bulk actions bar inside chat layout */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 20px;
    border-bottom: 1px solid var(--color-card-border);
    flex-shrink: 0;
}

/* ---- Chat Panel ---- */
.chat-panel {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-card);
    box-shadow: var(--panel-shadow-left);
    position: relative;
    z-index: 2;
    height: 100%;
    animation: slideInFromRight 0.3s ease both;
}

@keyframes slideInFromRight {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 10px 16px;
    flex-shrink: 0;
}
/* Faded divider instead of a hard full-width line */
.chat-panel-header::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-card-border), transparent);
}

.chat-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.chat-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.chat-action-btn:hover {
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-tint) 5%, transparent);
}

/* ---- Chat Messages ---- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-bubble {
    max-width: 88%;
    animation: chatBubbleFadeIn 0.25s ease both;
}

@keyframes chatBubbleFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-bubble-user {
    align-self: flex-end;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: 14px 14px 4px 14px;
    padding: 8px 14px;
}

.chat-bubble-bot {
    align-self: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 14px 14px 14px 4px;
    padding: 8px 14px;
}

.chat-bubble-content {
    font-size: 13px;
    line-height: 1.5;
    color: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-bubble-bot .chat-bubble-content {
    color: var(--color-text-secondary);
}

/* ---- Typing Indicator ---- */
.chat-typing-indicator {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 14px 14px 14px 4px;
}
.chat-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--color-text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}
.chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-6px); opacity: 1; }
}

/* ---- Chat Input Area ---- */
.chat-input-area {
    position: relative;
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    flex-shrink: 0;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.chat-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.chat-input::placeholder {
    color: transparent; /* the animated suggestion (.typewriter-wrap) sits on top */
}

/* -- Typewriter suggestion shown inside the empty chat input -- */
.typewriter-wrap {
    position: absolute;
    left: 29px;
    right: 64px;
    bottom: 10px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    overflow: hidden;
    pointer-events: none;
}
.typewriter-prefix {
    color: var(--color-text-muted);
    font-weight: 500;
}
.typewriter-text {
    color: var(--color-primary-light);
    font-weight: 600;
    white-space: nowrap;
}
.typewriter-cursor {
    color: var(--color-primary);
    font-weight: 300;
    animation: cursorBlink 0.7s step-end infinite;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

/* ---- Chat Expand Button (when panel is collapsed) ---- */
.chat-expand-btn {
    position: fixed;
    right: 16px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--color-primary) 40%, transparent);
    z-index: 200;
    transition: all var(--transition-fast);
}
.chat-expand-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.08);
}

/* ---- Responsive: Chat Layout ---- */
@media (max-width: 1024px) {
    .chat-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .search-page-chat-layout {
        flex-direction: column;
        height: auto;
    }
    .chat-panel {
        width: 100%;
        height: 300px;
        box-shadow: none;
    }
    .filter-panel-overlay-body {
        flex-direction: column;
    }
}

/* ============================================================
   PROFILE FORM
   ============================================================ */
.profile-form {
    max-width: 900px;
}

.form-section {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-card-border);
}

.form-section-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-light);
    flex-shrink: 0;
}

.form-section-icon svg {
    width: 20px;
    height: 20px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
}

/* ---- Tag Input ---- */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    min-height: 46px;
    align-items: center;
    transition: all var(--transition-fast);
    cursor: text;
}

.tag-input-container:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-input {
    flex: 1;
    min-width: 150px;
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-stack);
    outline: none;
    padding: 2px 0;
}

.tag-input::placeholder {
    color: var(--color-text-muted);
}

.tag-suggestions {
    position: relative;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    z-index: 10;
}

.tag-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.tag-suggestion-item:hover,
.tag-suggestion-item.active {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--color-text-primary);
}

/* ============================================================
   ADMIN EMPLOYEE SEARCHABLE DROPDOWN
   ============================================================ */

#admin-employee-selector-section,
#employee-selector-section {
    position: relative;
    z-index: 100;
}

.form-section-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.admin-dropdown-wrapper {
    position: relative;
    z-index: 100;
}

.admin-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
    overflow: hidden;
}

.admin-search-input-container:focus-within .admin-search-icon {
    color: var(--color-primary-light);
}

.admin-employee-search-input {
    padding-left: 42px !important;
    padding-right: 36px !important;
    font-size: 15px !important;
    height: 48px;
}

.admin-search-clear {
    position: absolute;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    line-height: 1;
    z-index: 1;
}

.admin-search-clear:hover {
    color: var(--color-text-primary);
    background: var(--color-hover);
}

.admin-dropdown-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-md);
    max-height: 380px;
    overflow-y: auto;
    z-index: 500;
    box-shadow: 0 12px 40px color-mix(in srgb, var(--color-shadow) 60%, transparent), 0 0 0 1px color-mix(in srgb, var(--color-primary) 8%, transparent);
    animation: adminDropdownOpen 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.admin-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.admin-dropdown-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-primary) 30%, transparent);
    border-radius: 3px;
}

.admin-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-primary) 50%, transparent);
}

@keyframes adminDropdownOpen {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.admin-dropdown-create {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--color-accent-green);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-card-border);
    transition: all var(--transition-fast);
    position: sticky;
    top: 0;
    background: var(--color-card);
    z-index: 2;
}

.admin-dropdown-create:hover,
.admin-dropdown-create.active {
    background: color-mix(in srgb, var(--color-success) 8%, transparent);
}

.admin-dropdown-create-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    border: 1px dashed color-mix(in srgb, var(--color-success) 30%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.admin-dropdown-create:hover .admin-dropdown-create-icon {
    background: color-mix(in srgb, var(--color-success) 18%, transparent);
    border-color: color-mix(in srgb, var(--color-success) 50%, transparent);
    transform: scale(1.05);
}

.admin-dropdown-count {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 1px solid color-mix(in srgb, var(--color-card-border) 60%, transparent);
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.admin-dropdown-item:hover,
.admin-dropdown-item.active {
    background: var(--color-hover);
}

.admin-dropdown-item.selected {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-left-color: var(--color-primary);
}

.admin-dropdown-item.selected .admin-dropdown-avatar {
    background: color-mix(in srgb, var(--color-primary) 30%, transparent);
    border-color: var(--color-primary);
}

.admin-dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    color: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
}

.admin-dropdown-item:hover .admin-dropdown-avatar {
    background: color-mix(in srgb, var(--color-primary) 20%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.admin-dropdown-info {
    flex: 1;
    min-width: 0;
}

.admin-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.admin-dropdown-name mark {
    background: color-mix(in srgb, var(--color-success) 20%, transparent);
    color: var(--color-accent-green);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: 700;
}

.admin-dropdown-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.admin-dropdown-meta mark {
    background: color-mix(in srgb, var(--color-success) 20%, transparent);
    color: var(--color-accent-green);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: 600;
}

.admin-dropdown-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    padding: 3px 8px;
    background: color-mix(in srgb, var(--color-tint) 4%, transparent);
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--color-tint) 6%, transparent);
}

.admin-dropdown-location svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.admin-dropdown-location mark {
    background: color-mix(in srgb, var(--color-success) 20%, transparent);
    color: var(--color-accent-green);
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 600;
}

.admin-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

.admin-dropdown-empty svg {
    display: block;
    margin: 0 auto 12px;
    width: 40px;
    height: 40px;
    opacity: 0.3;
}

/* ---- Certifications ---- */
.certifications-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.cert-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 1fr auto;
    /* Order: Exam Number | Cert Name | Vendor | Expiry Date | Remove */
    gap: 12px;
    align-items: end;
    padding: 16px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    animation: fadeIn var(--transition-base) both;
}

.cert-row .form-group {
    margin-bottom: 0;
}

.cert-row .form-label {
    font-size: 11px;
    margin-bottom: 6px;
}

.cert-remove-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    align-self: end;
    margin-bottom: 2px;
}

.cert-remove-btn svg {
    width: 18px;
    height: 18px;
}

.cert-remove-btn:hover {
    color: var(--color-accent-red);
    background: color-mix(in srgb, var(--color-danger) 10%, transparent);
}

.btn-add-cert {
    align-self: flex-start;
}

/* --- Certification Exam Lookup Spinner --- */
.cert-lookup-spinner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.cert-spinner-icon {
    color: var(--color-primary);
}

.cert-spinner-text {
    font-style: italic;
}

/* --- Previous Employment Rows --- */
.prev-employment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.prev-emp-row {
    padding: 16px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    animation: fadeIn var(--transition-base) both;
}

.prev-emp-row-top {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr 0.8fr auto;
    gap: 12px;
    align-items: end;
}

.prev-emp-row .form-group {
    margin-bottom: 0;
}

.prev-emp-row .form-label {
    font-size: 11px;
    margin-bottom: 6px;
}

.prev-emp-desc-group {
    margin-top: 10px;
}

.prev-emp-desc-group textarea {
    resize: vertical;
    min-height: 48px;
}

/* ---- Form Actions ---- */
.form-actions {
    padding-top: 8px;
}

.btn-save {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: 0;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--color-text-primary);
}

.tab-btn.active {
    color: var(--color-primary-light);
    border-bottom-color: var(--color-primary);
}

/* Sub-tabs for Master Data */
.sub-tab-nav {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 4px;
    overflow-x: auto;
}

.sub-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sub-tab-btn:hover {
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

.sub-tab-btn.active {
    color: var(--color-on-primary);
    background: var(--color-primary);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.sub-tab-btn.active svg {
    stroke: var(--color-on-primary);
}

.sub-tab-panel {
    animation: fadeIn var(--transition-base) both;
}

.sub-tab-panel .system-card {
    margin-bottom: 0;
}

.tab-content {
    animation: fadeIn var(--transition-base) both;
}

.tab-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.tab-content-title {
    font-size: 18px;
    font-weight: 600;
}

/* ---- Data Table ---- */
.table-container {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-card-border);
}

.data-table td {
    padding: 14px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-card-border);
    color: var(--color-text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: color-mix(in srgb, var(--color-primary) 3%, transparent);
}

.table-actions {
    display: flex;
    gap: 4px;
}

.table-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ---- System Section ---- */
.system-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.system-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.system-card-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-card-border);
}

.system-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.system-card-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.system-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reindex-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-idle    { background: var(--color-text-muted); }
.status-active  { background: var(--color-accent-orange); animation: pulse 1s infinite; }
.status-success { background: var(--color-accent-green); }
.status-error   { background: var(--color-accent-red); }

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-green));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 36px;
    text-align: right;
}

.system-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.system-stat {
    text-align: center;
}

.system-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.system-stat-label {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ============================================================
   MASTER DATA MANAGEMENT
   ============================================================ */

.master-data-add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.master-data-add-form .form-input {
    flex: 1;
}

.master-data-count {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    padding-left: 4px;
}

.master-data-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}

.master-data-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-card-border);
    transition: background 0.15s ease, opacity 0.3s ease, transform 0.3s ease;
}

.master-data-item:last-child {
    border-bottom: none;
}

.master-data-item:hover {
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

.master-data-name {
    font-size: 14px;
    color: var(--color-text-primary);
    font-weight: 500;
}

.master-data-item .btn-icon {
    opacity: 0.4;
    transition: opacity 0.2s ease;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.master-data-item:hover .btn-icon {
    opacity: 1;
}

.master-data-item .btn-icon svg {
    width: 14px;
    height: 14px;
}

.master-data-empty {
    text-align: center;
    padding: 32px 24px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.master-data-list::-webkit-scrollbar {
    width: 6px;
}

.master-data-list::-webkit-scrollbar-track {
    background: transparent;
}

.master-data-list::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 3px;
}

.master-data-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* Certification master data — 3-field add form */
.master-cert-add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.master-cert-add-form .form-input {
    flex: 1;
    min-width: 140px;
}

.master-cert-add-form .form-select {
    flex: 0 0 160px;
    min-width: 120px;
}

/* Certification list item layout */
.master-cert-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.master-cert-exam {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary-light);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.master-cert-name {
    font-size: 14px;
    color: var(--color-text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.master-cert-vendor-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease both;
}

.modal {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease both;
}

.modal-large {
    max-width: 900px;
    height: 85vh;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-card-border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-tint) 5%, transparent);
}

/* ---- Modal Header Actions (nav + close) ---- */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.modal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-nav-btn svg {
    width: 16px;
    height: 16px;
}

.modal-nav-btn:hover:not(:disabled) {
    color: var(--color-text-primary);
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-nav-counter {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-body-preview {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-card-border);
    flex-shrink: 0;
}

.preview-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.preview-content {
    background: var(--color-card);
    border-radius: var(--radius-sm);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
    color: var(--color-text-muted);
}

/* ---- Profile Detail Modal (Inline) ---- */
.profile-detail {
    padding: 24px;
}

.profile-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-card-border);
}

.profile-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--color-on-primary);
    flex-shrink: 0;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.profile-detail-info {
    flex: 1;
    min-width: 0;
}

.profile-detail-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}

.profile-detail-title {
    font-size: 15px;
    color: var(--color-primary-light);
    font-weight: 500;
    margin-bottom: 4px;
}

.profile-detail-location {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.profile-detail-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.profile-detail-score .score-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-accent-green);
}

.profile-detail-score .score-label {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-detail-section {
    margin-bottom: 24px;
}

.profile-detail-section:last-child {
    margin-bottom: 0;
}

.profile-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-primary-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-detail-section-title svg {
    opacity: 0.7;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
    font-size: 11px;
    font-weight: 600;
}

.profile-detail-summary {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.profile-detail-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-skill-tag {
    display: inline-block;
    padding: 5px 14px;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary-light);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    transition: all var(--transition-fast);
}

.profile-skill-tag:hover {
    background: color-mix(in srgb, var(--color-primary) 20%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.profile-cert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.profile-cert-table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    background: color-mix(in srgb, var(--color-tint) 3%, transparent);
    border-bottom: 1px solid var(--color-card-border);
}

.profile-cert-table td {
    padding: 10px 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-tint) 4%, transparent);
    color: var(--color-text-primary);
}

.profile-cert-table tr:last-child td {
    border-bottom: none;
}

.profile-cert-table tr:hover td {
    background: color-mix(in srgb, var(--color-tint) 2%, transparent);
}

.cert-vendor-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: color-mix(in srgb, var(--color-info) 12%, transparent);
    color: var(--color-accent-blue);
}

.profile-detail-sectors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-sector-tag {
    display: inline-block;
    padding: 5px 14px;
    background: color-mix(in srgb, var(--color-success) 10%, transparent);
    color: var(--color-accent-green);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid color-mix(in srgb, var(--color-success) 20%, transparent);
}

.delete-confirm-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.delete-confirm-text strong {
    color: var(--color-text-primary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    min-width: 300px;
    max-width: 440px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    animation: slideInRight 0.4s ease both;
    box-shadow: var(--shadow-lg);
}

.toast.removing {
    animation: slideOutRight 0.3s ease both;
}

.toast-success {
    background: color-mix(in srgb, var(--color-success) 14%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
    color: var(--color-accent-green);
}

.toast-error {
    background: color-mix(in srgb, var(--color-danger) 14%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
    color: var(--color-danger);
}

.toast-info {
    background: color-mix(in srgb, var(--color-info) 14%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
    color: var(--color-primary-light);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 16px;
    margin-left: auto;
    transition: opacity var(--transition-fast);
}

.toast-close:hover {
    opacity: 1;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* ============================================================
   SKELETON SHIMMER LOADING
   ============================================================ */

@keyframes shimmer {
    0%   { background-position: -500px 0; }
    100% { background-position:  500px 0; }
}

@keyframes skeletonFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes skeletonFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.skeleton-container {
    padding: 8px 0;
    animation: skeletonFadeIn 0.3s ease both;
}

.skeleton-container.fade-out {
    animation: skeletonFadeOut 0.3s ease both;
}

.skeleton-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 10px;
    animation: skeletonFadeIn 0.4s ease both;
}

.skeleton-line {
    background: linear-gradient(90deg, var(--color-surface-hover) 25%, color-mix(in srgb, var(--color-tint) 10%, var(--color-surface-hover)) 37%, var(--color-surface-hover) 63%);
    background-size: 1000px 100%;
    animation: shimmer 1.8s infinite linear;
    border-radius: 4px;
    min-height: 12px;
}

/* --- Header row: avatar + name + title + badge + score --- */
.skeleton-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, var(--color-surface-hover) 25%, color-mix(in srgb, var(--color-tint) 10%, var(--color-surface-hover)) 37%, var(--color-surface-hover) 63%);
    background-size: 1000px 100%;
    animation: shimmer 1.8s infinite linear;
}

.skeleton-name {
    width: 120px;
    height: 14px;
}

.skeleton-title {
    width: 95px;
    height: 12px;
}

.skeleton-badge {
    width: 70px;
    height: 12px;
    margin-left: auto;
}

.skeleton-score {
    width: 30px;
    height: 12px;
    flex-shrink: 0;
}

/* --- Skills row: small pill bars --- */
.skeleton-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.skeleton-pill {
    height: 20px;
    border-radius: 10px;
}

/* --- Body text lines --- */
.skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-text {
    height: 10px;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 24px 20px;
    }

    .page-bg-overlay {
        left: 0;
        width: 100%;
    }

    .cert-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .cert-remove-btn {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .prev-emp-row-top {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Charts: 2-column on tablet */
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-card {
        grid-column: span 1;
    }

    .chart-card-wide {
        grid-column: span 2;
    }

    .chart-card-half {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .search-results-scroll {
        max-height: none;
        overflow-y: visible;
    }

    .skeleton-card {
        padding: 16px 18px;
    }

    .skeleton-skills .skeleton-pill:nth-child(n+5) {
        display: none;
    }

    .filter-bar-items {
        flex-wrap: wrap;
    }

    /* Charts: 1-column on mobile */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card,
    .chart-card-wide,
    .chart-card-half {
        grid-column: span 1;
    }

    .skill-explorer-summary {
        flex-direction: column;
    }

    .searchable-select {
        max-width: 100%;
    }

    .drilldown-modal-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .drilldown-modal-row-right {
        margin-left: auto;
    }

    .skill-explorer-employee {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .skill-explorer-emp-status {
        margin-left: 0;
    }

    .page-title {
        font-size: 22px;
    }

    .search-hero-title {
        font-size: 18px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .modal-large {
        max-width: 100%;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .result-card {
        padding: 10px 12px;
    }

    .result-card-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .result-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }

    .cert-row {
        grid-template-columns: 1fr;
    }

    .prev-emp-row-top {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .toast {
        min-width: auto;
        max-width: 90vw;
    }

    .profile-detail-header {
        flex-wrap: wrap;
    }

    .profile-detail-score {
        order: -1;
        flex-direction: row;
        gap: 6px;
        width: 100%;
        justify-content: flex-end;
        margin-bottom: -8px;
    }

    .profile-detail-score .score-value {
        font-size: 20px;
    }

    .profile-cert-table {
        font-size: 12px;
    }

    .profile-cert-table th,
    .profile-cert-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px 14px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .stat-card {
        padding: 18px;
    }

    .form-section {
        padding: 20px;
    }
}

/* ============================================================
   AVAILABILITY CALENDAR & STATUS BADGES
   ============================================================ */

/* Status badge on result card header */
.result-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-transform: uppercase;
}
.status-available {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-accent-green);
}
.status-on-project {
    background: color-mix(in srgb, var(--color-info) 15%, transparent);
    color: var(--color-accent-blue);
}
.status-partially-available {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-accent-orange);
}
.status-on-leave {
    background: color-mix(in srgb, var(--color-danger) 15%, transparent);
    color: var(--color-accent-red);
}
.status-project-leave {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-accent-orange);
}
.status-bench-leave {
    background: color-mix(in srgb, var(--color-danger) 15%, transparent);
    color: var(--color-accent-red);
}

/* Calendar container */
.avail-calendar {
    padding: 12px 0;
    max-width: 320px;
}
.avail-calendar-compact {
    max-width: 200px;
}

/* Calendar header with nav arrows */
.avail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.avail-header-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.avail-nav-btn {
    background: none;
    border: 1px solid var(--color-card-border);
    color: var(--color-text-secondary);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    padding: 0;
}
.avail-nav-btn:hover:not(:disabled) {
    background: var(--color-hover);
    border-color: var(--color-primary);
    color: var(--color-primary-light);
}
.avail-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.avail-nav-btn svg {
    width: 14px;
    height: 14px;
}

/* Day-of-week headers */
.avail-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}
.avail-dow {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 2px 0;
}

/* Calendar grid */
.avail-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.avail-day {
    aspect-ratio: 1;
    border-radius: 3px;
    position: relative;
    cursor: default;
    min-width: 0;
    background: var(--color-card-border);
}
.avail-day-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 500;
    color: color-mix(in srgb, var(--color-tint) 85%, transparent);
    pointer-events: none;
}
.avail-day.avail-empty {
    background: transparent;
}
.avail-day.avail-today {
    outline: 2px solid var(--color-primary-light);
    outline-offset: -1px;
    z-index: 1;
}

/* Status colors */
.avail-available {
    background: var(--color-accent-green);
}
.avail-on-project {
    background: var(--color-accent-blue);
}
.avail-partial {
    background: var(--color-accent-orange);
}
.avail-leave {
    background: var(--color-accent-red);
}

/* Tooltip */
.avail-tooltip {
    position: fixed;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--color-text-primary);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
}
.avail-tooltip-status {
    font-weight: 600;
    margin-bottom: 2px;
}
.avail-tooltip-project {
    color: var(--color-text-secondary);
    font-size: 11px;
}

/* Legend */
.avail-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}
.avail-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--color-text-secondary);
}
.avail-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Project assignments summary below calendar */
.avail-projects {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.avail-project-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.avail-project-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.avail-project-name {
    color: var(--color-text-primary);
    font-weight: 500;
}
.avail-project-dates {
    color: var(--color-text-muted);
    margin-left: auto;
    font-size: 10px;
}

/* Smooth calendar month transition */
.avail-calendar.avail-transitioning {
    pointer-events: none;
}
.avail-calendar.avail-fade-out {
    opacity: 0.3;
    transition: opacity 0.15s ease-out;
}
.avail-calendar.avail-fade-in {
    animation: availFadeIn 0.2s ease-in;
}
@keyframes availFadeIn {
    from { opacity: 0.3; }
    to   { opacity: 1; }
}

/* Availability section in profile modal */
.profile-detail-availability {
    margin-top: 4px;
}

/* Fallback text when calendar has no data */
.avail-no-data {
    display: block;
    padding: 12px;
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
    background: color-mix(in srgb, var(--color-tint) 3%, transparent);
    border-radius: 6px;
}

/* ============================================================
   SKILLS GAP / FITNESS ANALYSIS
   ============================================================ */

.skills-gap-loading {
    display: flex;
    align-items: center;
    padding: 12px 0;
}

.skills-gap-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--color-tint) 6%, transparent);
}

.skills-gap-ring {
    flex-shrink: 0;
}

.skills-gap-details {
    flex: 1;
    min-width: 0;
}

.skills-gap-summary {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.skills-gap-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sgap-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sgap-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-shadow) 20%, transparent);
}

.sgap-covered {
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    color: var(--color-success);
    border: 1px solid color-mix(in srgb, var(--color-success) 25%, transparent);
}

.sgap-missing {
    background: color-mix(in srgb, var(--color-warning) 8%, transparent);
    color: var(--color-warning);
    border: 1px dashed color-mix(in srgb, var(--color-warning) 40%, transparent);
}

/* Skills Gap + Availability side-by-side layout */
.skills-avail-row {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.skills-avail-col {
    flex: 1;
    min-width: 0;
}

.skills-gap-col {
    flex: 1;
}

.avail-col {
    flex: 1;
}

/* When skills gap has no data, let availability take full width */
.skills-gap-col:empty,
.skills-gap-col[style*="display: none"] {
    display: none !important;
}

.avail-col:has(+ .skills-gap-col:empty),
.avail-col:has(+ .skills-gap-col[style*="display: none"]) {
    flex: 1;
}

@media (max-width: 768px) {
    .skills-avail-row {
        flex-direction: column;
    }
}

/* Role skill pills in admin panel */
.role-skill-pill {
    display: inline-block;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--color-accent-purple);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-secondary); }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ============================================================
   BELL PROFILE - TABS, TIMELINE & SKILLS UTILIZATION
   ============================================================ */

/* ---- Profile Tab Navigation ---- */
.profile-tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-card-border);
}

.profile-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
    font-family: var(--font-stack);
}

.profile-tab-btn:hover {
    color: var(--color-text-primary);
}

.profile-tab-btn.active {
    color: var(--color-primary-light);
    border-bottom-color: var(--color-primary);
}

.profile-tab-btn svg {
    opacity: 0.7;
}

.profile-tab-btn.active svg {
    opacity: 1;
}

.profile-tab-content {
    animation: fadeIn 0.3s ease;
}

/* ---- Bell Timeline ---- */
.bell-timeline {
    position: relative;
    padding-left: 32px;
    min-height: 60px;
}

.timeline-line {
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark), transparent);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid var(--color-card);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent);
    z-index: 1;
}

.timeline-dot-active {
    background: var(--color-accent-green, var(--color-success));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 30%, transparent), 0 0 8px color-mix(in srgb, var(--color-success) 20%, transparent);
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 30%, transparent); }
    50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-success) 15%, transparent), 0 0 12px color-mix(in srgb, var(--color-success) 20%, transparent); }
}

.timeline-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timeline-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.timeline-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.timeline-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.timeline-card-sector {
    display: inline-block;
    padding: 2px 10px;
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    color: var(--color-accent-green);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
}

.timeline-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.timeline-card-duration {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.timeline-card-duration-badge {
    display: inline-block;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary-light);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.timeline-expand-icon {
    transition: transform var(--transition-fast);
    color: var(--color-text-muted);
}

.timeline-card-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.bell-skill-tag {
    display: inline-block;
    padding: 3px 10px;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary-light);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.timeline-card-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-card-border);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.timeline-detail-block {
    margin-bottom: 16px;
}

.timeline-detail-block:last-child {
    margin-bottom: 0;
}

.timeline-detail-block h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary-light);
    margin: 0 0 6px 0;
}

.timeline-detail-block p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
}

.timeline-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-card-border);
}

.bell-timeline-empty-text {
    text-align: center;
    padding: 32px 24px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ---- Skills Utilization Summary ---- */
.skills-utilization-grid {
    max-height: 320px;
    overflow-y: auto;
}

.util-table {
    width: 100%;
}

.util-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-card-border);
}

.util-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 8px;
    padding: 8px 12px;
    align-items: center;
    border-bottom: 1px solid color-mix(in srgb, var(--color-card-border) 30%, transparent);
    transition: background var(--transition-fast);
}

.util-table-row:hover {
    background: var(--color-hover);
}

.util-table-row:last-child {
    border-bottom: none;
}

.util-col-skill {
    font-size: 13px;
}

.util-col-time,
.util-col-projects {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}

.util-col-recent {
    font-size: 12px;
    font-weight: 500;
    text-align: right;
}

.util-recency-recent {
    color: var(--color-accent-green);
}

.util-recency-moderate {
    color: var(--color-accent-orange, var(--color-warning));
}

.util-recency-old {
    color: var(--color-text-muted);
}

/* ---- Preview Modal Bell Tab ---- */
.preview-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-card-border);
    margin-bottom: 16px;
}

.preview-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
    font-family: var(--font-stack);
}

.preview-tab-btn:hover {
    color: var(--color-text-primary);
}

.preview-tab-btn.active {
    color: var(--color-primary-light);
    border-bottom-color: var(--color-primary);
}

.preview-bell-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
}

.preview-bell-loading .spinner {
    margin-bottom: 12px;
}

/* Timeline action buttons — ghost style variant inside card details */
.timeline-card-actions .btn-danger {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
    color: var(--color-accent-red);
    border: 1px solid color-mix(in srgb, var(--color-danger) 25%, transparent);
    box-shadow: none;
}

.timeline-card-actions .btn-danger:hover {
    background: color-mix(in srgb, var(--color-danger) 20%, transparent);
}

.timeline-card-actions .btn-secondary {
    padding: 6px 14px;
    font-size: 12px;
}

.timeline-card-actions .btn-danger {
    padding: 6px 14px;
    font-size: 12px;
}

/* Responsive timeline */
@media (max-width: 768px) {
    .timeline-card-header {
        flex-direction: column;
        gap: 8px;
    }
    .timeline-card-meta {
        flex-wrap: wrap;
    }
    .util-table-header,
    .util-table-row {
        grid-template-columns: 1.5fr 1fr 0.5fr 1fr;
        font-size: 11px;
    }
    .profile-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============================================================
   SIDEBAR COLLAPSE / EXPAND
   ============================================================ */

/* Toggle button inside the sidebar */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    position: absolute;
    top: 20px;
    right: -13px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-text-muted);
    border-radius: 50%;
    color: var(--sidebar-text-strong);
    cursor: pointer;
    z-index: 110;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.sidebar-toggle:hover {
    color: var(--sidebar-text-strong);
    background: var(--sidebar-active-bg);
}
.sidebar-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-base);
}

/* Sidebar transition for collapse */
.sidebar {
    transition: width var(--transition-base);
    overflow: hidden;
}
.main-content {
    transition: margin-left var(--transition-base);
}
.page-bg-overlay {
    transition: left var(--transition-base), width var(--transition-base);
}

/* --- Collapsed state --- */
body.sidebar-collapsed .sidebar {
    width: 60px;
}
body.sidebar-collapsed .sidebar-header {
    padding: 10px 8px;
}
body.sidebar-collapsed .logo-img-full {
    display: none;
}
body.sidebar-collapsed .logo-img-icon {
    display: block;
    margin: 0 auto;
}
body.sidebar-collapsed .sidebar-logo {
    display: flex;
    justify-content: center;
}
body.sidebar-collapsed .sidebar-nav {
    padding: 16px 6px;
    align-items: center;
}
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 10px;
    width: 44px;
    gap: 0;
}
body.sidebar-collapsed .nav-item span {
    display: none;
}
body.sidebar-collapsed .sidebar-user-info {
    justify-content: center;
    padding: 6px;
}
body.sidebar-collapsed .sidebar-user-details {
    display: none;
}
body.sidebar-collapsed .sidebar-user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
}
body.sidebar-collapsed .sidebar-footer {
    padding: 8px 6px;
}
body.sidebar-collapsed .nav-logout {
    justify-content: center;
    padding: 10px;
}
body.sidebar-collapsed .nav-logout span {
    display: none;
}
body.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}
body.sidebar-collapsed .main-content {
    margin-left: 60px;
}
body.sidebar-collapsed .page-bg-overlay {
    left: 60px;
    width: calc(100% - 60px);
}

/* --- Hover expand (collapsed sidebar only) --- */
body.sidebar-collapsed .sidebar:hover,
body.sidebar-collapsed.role-switcher-open .sidebar {
    width: 260px;
    box-shadow: 8px 0 24px color-mix(in srgb, var(--color-shadow) 40%, transparent);
    z-index: 200;
}
body.sidebar-collapsed .sidebar:hover .logo-img-full,
body.sidebar-collapsed.role-switcher-open .sidebar .logo-img-full {
    display: block;
}
body.sidebar-collapsed .sidebar:hover .logo-img-icon,
body.sidebar-collapsed.role-switcher-open .sidebar .logo-img-icon {
    display: none;
}
body.sidebar-collapsed .sidebar:hover .sidebar-header,
body.sidebar-collapsed.role-switcher-open .sidebar .sidebar-header {
    padding: 16px 14px 14px;
}
body.sidebar-collapsed .sidebar:hover .sidebar-nav,
body.sidebar-collapsed.role-switcher-open .sidebar .sidebar-nav {
    padding: 16px 12px;
    align-items: stretch;
}
body.sidebar-collapsed .sidebar:hover .nav-item,
body.sidebar-collapsed.role-switcher-open .sidebar .nav-item {
    justify-content: flex-start;
    padding: 12px 16px;
    width: auto;
    gap: 12px;
}
body.sidebar-collapsed .sidebar:hover .nav-item span,
body.sidebar-collapsed.role-switcher-open .sidebar .nav-item span {
    display: inline;
}
body.sidebar-collapsed .sidebar:hover .sidebar-user-info,
body.sidebar-collapsed.role-switcher-open .sidebar .sidebar-user-info {
    padding: 10px 12px;
}
body.sidebar-collapsed .sidebar:hover .sidebar-user-details,
body.sidebar-collapsed.role-switcher-open .sidebar .sidebar-user-details {
    display: flex;
}
body.sidebar-collapsed .sidebar:hover .sidebar-user-avatar,
body.sidebar-collapsed.role-switcher-open .sidebar .sidebar-user-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
}
body.sidebar-collapsed .sidebar:hover .sidebar-footer,
body.sidebar-collapsed.role-switcher-open .sidebar .sidebar-footer {
    padding: 12px;
}
body.sidebar-collapsed .sidebar:hover .nav-logout,
body.sidebar-collapsed.role-switcher-open .sidebar .nav-logout {
    justify-content: flex-start;
    padding: 12px 16px;
}
body.sidebar-collapsed .sidebar:hover .nav-logout span,
body.sidebar-collapsed.role-switcher-open .sidebar .nav-logout span {
    display: inline;
}
/* Light / dark switch in the sidebar footer (static/js/theme.js) */
.nav-theme-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.nav-theme-toggle:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
}

.nav-theme-toggle:focus-visible,
.theme-switch button:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Show only the action that applies: in dark, offer light; in light, offer dark */
:root[data-theme="dark"] .theme-icon-moon,
:root[data-theme="dark"] .theme-label-to-dark,
:root[data-theme="light"] .theme-icon-sun,
:root[data-theme="light"] .theme-label-to-light {
    display: none !important;
}

/* ============================================================
   DisplayCards – Stacked skewed card component
   ============================================================ */

.dc-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem 4rem;
    opacity: 0;
    animation: dcFadeIn 0.7s ease forwards;
}

@keyframes dcFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dc-stack {
    display: grid;
    grid-template-areas: 'stack';
    place-items: center;
}

.dc-card {
    grid-area: stack;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22rem;
    height: 9rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-card-border);
    background: var(--color-glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
    transition: transform 0.7s cubic-bezier(.4,0,.2,1),
                border-color var(--transition-base),
                background var(--transition-base);
    overflow: hidden;
}

/* Gradient fade on the right edge (mimics the original after pseudo-element) */
.dc-card::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -5%;
    height: 110%;
    width: 20rem;
    background: linear-gradient(to left, var(--color-bg), transparent);
    pointer-events: none;
}

/* Dimmed overlay for background cards */
.dc-card--dimmed .dc-card__overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-bg) 50%, transparent);
    transition: opacity 0.7s ease;
    z-index: 2;
    pointer-events: none;
}

.dc-card--dimmed {
    filter: grayscale(100%);
    transition: transform 0.7s cubic-bezier(.4,0,.2,1),
                filter 0.7s ease,
                border-color var(--transition-base);
}

/* Hover: lift card, remove grayscale, hide overlay */
.dc-card--hover {
    border-color: color-mix(in srgb, var(--color-tint) 20%, transparent) !important;
    background: var(--color-surface) !important;
    filter: grayscale(0%) !important;
    z-index: 10;
}

.dc-card--hover .dc-card__overlay {
    opacity: 0;
}

/* Back card hover: lift up */
.dc-card--dimmed.dc-card--hover[data-dc-index="0"] {
    transform: translateX(0px) translateY(-40px) skewY(-8deg) !important;
}

.dc-card--dimmed.dc-card--hover[data-dc-index="1"] {
    transform: translateX(64px) translateY(-4px) skewY(-8deg) !important;
}

/* Front card hover: slight lift */
.dc-card--hover[data-dc-index="2"] {
    transform: translateX(128px) translateY(40px) skewY(-8deg) !important;
}

/* Card inner elements */
.dc-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.dc-card__icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0.25rem;
    width: 1.6rem;
    height: 1.6rem;
    flex-shrink: 0;
}

.dc-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
}

.dc-card__icon svg {
    width: 0.9rem;
    height: 0.9rem;
    max-width: 0.9rem;
    max-height: 0.9rem;
}

.dc-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 1;
}

.dc-card__desc {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text-primary);
    z-index: 1;
}

.dc-card__date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    z-index: 1;
}

/* Responsive: scale down on smaller screens */
@media (max-width: 900px) {
    .dc-wrapper { padding: 2rem 0.5rem 3rem; }
    .dc-card { width: 17rem; height: 7.5rem; font-size: 0.92rem; }
    .dc-card::after { width: 14rem; }
    .dc-card--dimmed.dc-card--hover[data-dc-index="0"] {
        transform: translateX(0px) translateY(-30px) skewY(-8deg) !important;
    }
    .dc-card--dimmed.dc-card--hover[data-dc-index="1"] {
        transform: translateX(48px) translateY(-4px) skewY(-8deg) !important;
    }
    .dc-card--hover[data-dc-index="2"] {
        transform: translateX(96px) translateY(30px) skewY(-8deg) !important;
    }
    .dc-card[data-dc-index="0"] { transform: translateX(0) translateY(0) skewY(-8deg); }
    .dc-card[data-dc-index="1"] { transform: translateX(48px) translateY(30px) skewY(-8deg); }
    .dc-card[data-dc-index="2"] { transform: translateX(96px) translateY(60px) skewY(-8deg); }
}

@media (max-width: 600px) {
    .dc-wrapper { padding: 1.5rem 0 2rem; }
    .dc-card { width: 14rem; height: 6.5rem; font-size: 0.82rem; }
    .dc-card::after { width: 10rem; }
    .dc-card[data-dc-index="0"] { transform: translateX(0) translateY(0) skewY(-6deg); }
    .dc-card[data-dc-index="1"] { transform: translateX(36px) translateY(24px) skewY(-6deg); }
    .dc-card[data-dc-index="2"] { transform: translateX(72px) translateY(48px) skewY(-6deg); }
}

/* =========================================================================
   Spreadsheet Export Modal (dark theme — uses design tokens)
   ========================================================================= */

.bulk-divider {
    width: 1px;
    height: 22px;
    background: var(--color-card-border);
    margin: 0 6px;
    align-self: center;
}

.export-modal-overlay {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.export-modal {
    width: 720px;
    max-width: 92vw;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.export-modal-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-card) 100%);
    border-bottom: 1px solid var(--color-card-border);
}

.export-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.export-modal-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: var(--radius-md);
    background: var(--color-success);
    color: var(--color-on-status);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-success) 30%, transparent);
    flex-shrink: 0;
}

.export-modal-icon svg {
    width: 22px;
    height: 22px;
}

.export-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.export-modal-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.export-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
    background: var(--color-card);
}

.export-section {
    margin-bottom: 22px;
}

.export-section:last-child {
    margin-bottom: 0;
}

.export-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.export-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
}

.export-section-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.export-link-btn {
    background: none;
    border: 0;
    color: var(--color-primary-light);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 4px;
    transition: color var(--transition-fast);
}

.export-link-btn:hover {
    color: var(--color-text-primary);
    text-decoration: underline;
}

.export-link-divider {
    color: var(--color-text-muted);
    -webkit-user-select: none;
    user-select: none;
}

.export-columns-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.export-col-group {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.export-col-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent-green);
    margin-bottom: 8px;
}

.export-col-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-primary);
    -webkit-user-select: none;
    user-select: none;
}

.export-col-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--color-accent-green);
    cursor: pointer;
    flex-shrink: 0;
}

.export-col-checkbox:hover { color: var(--color-primary-light); }

.export-format-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.export-format-pill {
    position: relative;
    cursor: pointer;
    display: block;
}

.export-format-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.export-format-pill-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--color-surface);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.export-format-pill:hover .export-format-pill-body {
    border-color: var(--color-primary);
}

.export-format-pill input[type="radio"]:checked + .export-format-pill-body {
    border-color: var(--color-accent-green);
    background: color-mix(in srgb, var(--color-success) 8%, transparent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--color-success) 16%, transparent);
}

.export-format-pill-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    flex-shrink: 0;
}

.export-format-pill-icon svg { width: 18px; height: 18px; }

.export-format-pill-icon-xlsx { background: var(--color-accent-green); }
.export-format-pill-icon-csv  { background: var(--color-primary); }

.export-format-pill-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.export-format-pill-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 1px;
}

.export-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--color-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-surface);
}

.export-footer-hint {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.export-footer-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 640px) {
    .export-columns-grid { grid-template-columns: 1fr; }
    .export-format-row { grid-template-columns: 1fr; }
}

/* ============================================================
   IDENTITY GRID — read-only Graph-managed profile fields
   ============================================================ */
.identity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.identity-card-row {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--color-surface) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 14%, transparent);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.identity-card-row:hover {
    border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
    background: color-mix(in srgb, var(--color-surface) 72%, transparent);
}

.identity-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary-light);
    flex-shrink: 0;
}

.identity-card-icon svg {
    width: 20px;
    height: 20px;
}

.identity-card-body {
    min-width: 0;
}

.identity-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.identity-card-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.35;
    word-break: break-word;
    display: block;
}

.identity-card-value--empty {
    font-weight: 500;
    font-style: italic;
    color: var(--color-text-muted);
}

.identity-card-value--link {
    text-decoration: none;
    transition: color var(--transition-fast);
}

.identity-card-value--link:hover:not(.identity-card-value--empty) {
    color: var(--color-primary-light);
    text-decoration: none;
}

@media (max-width: 720px) {
    .identity-grid {
        grid-template-columns: 1fr;
    }
    .identity-card-row {
        padding: 12px 14px;
        grid-template-columns: 36px 1fr;
        gap: 12px;
    }
    .identity-card-icon {
        width: 36px;
        height: 36px;
    }
    .identity-card-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================================
   Sign-in and role selection: split screen (templates/auth_base.html)
   The artwork panel is always dark (see .auth-art in theme.css).
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

.auth-body {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    min-height: 100vh;
}

.auth-art {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 56px;
    padding: 48px 48px 32px;
    color: var(--color-text-primary);
    background: var(--sidebar-bg) var(--auth-artwork) center 78% / cover no-repeat;
    overflow: hidden;
}

.auth-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, color-mix(in srgb, var(--bell-black) 55%, transparent) 100%);
    pointer-events: none;
}

.auth-art > * {
    position: relative;
}

.auth-art-logo {
    width: 196px;
    height: auto;
    display: block;
}

.auth-art-rule {
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: var(--bell-gradient-mark);
    margin-bottom: 18px;
}

.auth-art-product {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text-primary);
}

.auth-art-tagline {
    margin-top: 10px;
    max-width: 32ch;
    font-size: 16px;
    color: var(--color-text-secondary);
}

.auth-art-foot {
    margin-top: auto;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.auth-pane {
    display: flex;
    flex-direction: column;
    padding: 28px 48px 40px;
    background: var(--color-bg);
}

.auth-pane-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.auth-pane-top .theme-switch {
    margin-left: auto;
}

.theme-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--color-card-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.theme-switch button svg {
    width: 15px;
    height: 15px;
}

.theme-switch button[aria-pressed="true"] {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.auth-who {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.auth-who strong {
    color: var(--color-text-primary);
}

.auth-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 13px;
    font-weight: 700;
}

.auth-content {
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding-block: 40px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-title {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-text-primary);
    text-wrap: balance;
}

.auth-subtitle {
    margin-top: 8px;
    font-size: 15px;
    color: var(--color-text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.auth-input-wrap {
    position: relative;
    display: block;
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--color-input-border);
    border-radius: 6px;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-input:focus {
    outline: none;
    border-color: var(--color-input-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-input-focus) 22%, transparent);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.auth-btn svg {
    width: 16px;
    height: 16px;
}

.auth-spinner {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
    border-top-color: currentColor;
    animation: spin 0.7s linear infinite;
}

.auth-spinner[hidden] {
    display: none;
}

.auth-btn.is-loading {
    cursor: progress;
}

.auth-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-btn.is-loading,
.auth-btn.is-disabled {
    pointer-events: none;
}

.auth-btn-primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.auth-btn-primary:hover {
    background: var(--color-primary-dark);
    color: var(--color-on-primary);
}

.auth-btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border-color: var(--color-input-border);
}

.auth-btn-secondary:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text-primary);
}

.auth-btn:focus-visible,
.role-option:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-card-border);
}

.auth-note {
    font-size: 13px;
    color: var(--color-text-muted);
}

.auth-flashes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-flash {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    border-left: 3px solid var(--color-info);
    background: color-mix(in srgb, var(--color-info) 12%, var(--color-surface));
    color: var(--color-text-primary);
}

.auth-flash-error {
    border-left-color: var(--color-danger);
    background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface));
}

.auth-flash-success {
    border-left-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 12%, var(--color-surface));
}

/* Role options */
.role-options {
    border: 0;
    display: grid;
    gap: 0;
}

/* Open list, not cards: rows separated by faded hairlines (same as the sidebar divider) */
.role-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 12px;
    font: inherit;
    text-align: left;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.role-option::before,
.role-option:last-child::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--color-card-border), transparent);
}

.role-option:last-child::after {
    top: auto;
    bottom: 0;
}

.role-option:hover {
    background: color-mix(in srgb, var(--color-tint) 5%, transparent);
}

.role-option:hover .role-option-name,
.role-option:focus-visible .role-option-name,
.role-option.is-loading .role-option-name {
    color: var(--color-primary-light);
}

.role-option-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--color-primary-light) 14%, transparent);
    color: var(--color-primary-light);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.role-option-icon svg {
    width: 20px;
    height: 20px;
}

.role-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.role-option-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.role-option-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.role-option-go {
    flex: none;
    margin-left: auto;
    display: grid;
    place-items: center;
    color: var(--color-text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.role-option-go svg {
    width: 18px;
    height: 18px;
}

.role-option:hover .role-option-go,
.role-option:focus-visible .role-option-go {
    color: var(--color-primary-light);
    transform: translateX(3px);
}

.role-option:hover .role-option-icon,
.role-option:focus-visible .role-option-icon,
.role-option.is-loading .role-option-icon {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

/* Only the hovered / focused row highlights; the chosen row stays highlighted while loading */
.role-option:focus-visible,
.role-option.is-loading {
    background: color-mix(in srgb, var(--color-tint) 5%, transparent);
}

.role-option-spinner {
    display: none;
    width: 20px;
    height: 20px;
    margin-left: auto;
    color: var(--color-primary-light);
}

.role-option.is-loading .role-option-spinner {
    display: block;
}

.role-option.is-loading .role-option-go {
    display: none;
}

.role-options .role-option {
    cursor: pointer;
}

.auth-form.is-busy .role-option {
    cursor: progress;
}

.auth-form.is-busy .role-option:not(.is-loading) {
    opacity: 0.5;
}

@media (max-width: 860px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-art {
        flex-direction: row;
        align-items: flex-end;
        gap: 16px;
        min-height: 150px;
        padding: 22px;
        background-position: center 80%;
    }

    .auth-art-logo {
        width: 132px;
    }

    .auth-art-rule,
    .auth-art-tagline,
    .auth-art-foot {
        display: none;
    }

    .auth-art-product {
        font-size: 20px;
    }

    .auth-pane {
        padding: 20px 16px 32px;
    }

    .auth-content {
        padding-block: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input,
    .auth-btn,
    .role-option,
    .role-option-icon {
        transition: none;
    }

    .auth-spinner {
        animation-duration: 1.6s;
    }
}

/* ---------- Search visibility bar (profile page, admin / line manager) ---------- */
.visibility-bar {
    margin-bottom: 16px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.visibility-bar.is-hidden {
    background: color-mix(in srgb, var(--color-warning) 10%, var(--color-surface));
    border-color: color-mix(in srgb, var(--color-warning) 40%, transparent);
}
.visibility-bar-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.visibility-bar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-text-muted);
}
.visibility-bar.is-hidden .visibility-bar-icon { color: var(--color-warning); }
.visibility-bar-text { flex: 1; min-width: 0; }
.visibility-bar-title { font-weight: 600; font-size: 14px; }
.visibility-bar-status {
    font-size: 12px;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}
.vis-switch {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: var(--color-border);
    transition: background .15s;
}
.vis-switch:disabled { opacity: .6; cursor: default; }
.vis-switch.is-on { background: var(--color-warning); }
.vis-switch:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.vis-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-surface);
    transition: transform .15s;
}
.vis-switch.is-on .vis-switch-knob { transform: translateX(18px); }
.visibility-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--color-text-muted);
}
.visibility-comment {
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: pre-wrap;
}
.visibility-history { margin-top: 8px; font-size: 12px; }
.visibility-history summary {
    cursor: pointer;
    color: var(--color-text-muted);
    width: fit-content;
}
.visibility-history-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}
.visibility-history-list li {
    padding: 6px 0;
    border-top: 1px solid var(--color-border);
}
.hidden-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-warning) 35%, transparent);
}

/* ============================================================
   PREMIUM SURFACES
   One shared look for the main cards/panels: soft gradient sheen,
   softer border, layered shadow. Tokens live in theme.css.
   Placed last so it wins over the per-card rules above; hover/selected
   rules (higher specificity) keep working.
   ============================================================ */
.stat-card,
.action-card,
.chart-card,
.bench-panel,
.bench-summary-card,
.form-section,
.table-container,
.system-card,
.timeline-card,
.password-panel {
    background: var(--card-surface);
    border-color: var(--card-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.result-card {
    background: var(--card-surface);
    border-color: var(--card-border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
}
.result-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.chat-bubble-bot,
.chat-typing-indicator {
    background: var(--card-surface);
    border-color: var(--card-border-soft);
    box-shadow: var(--card-shadow);
}
.chat-bubble-bot { padding: 12px 16px; }

/* ============================================================
   SEARCH PAGE POLISH: filter strip, action bar, result hover, chat panel
   (no hard divider lines; depth comes from shadows, tokens in theme.css)
   ============================================================ */

/* Filter strip: a raised bar instead of a line-bordered strip */
.filter-bar-collapsed {
    border-bottom: none;
    padding: 8px 18px;
    background: var(--card-surface);
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--color-shadow) 55%, transparent),
                inset 0 -1px 0 color-mix(in srgb, var(--color-tint) 4%, transparent);
}
.filter-icon-btn { border-radius: var(--radius-md); }
.filter-icon-btn:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 30%, transparent); }
#clear-filters-btn { border-radius: 50%; border: 1px solid var(--card-border-soft); }
.filter-bar-divider {
    width: 1px; height: 22px; margin: 0 8px;
    background: linear-gradient(180deg, transparent, var(--color-card-border), transparent);
}
.filter-active-tag {
    padding: 4px 11px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
    font-weight: 600;
}

/* Selection / download toolbar: rounded floating action bar */
.bulk-actions-bar {
    border-bottom: none;
    margin: 14px 20px 0;
    padding: 8px 14px;
    gap: 12px;
    background: var(--card-surface);
    border: 1px solid var(--card-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}
.bulk-actions-bar .btn { min-height: 34px; border-radius: var(--radius-md); }
.bulk-actions-bar .btn-success:hover {
    box-shadow: 0 0 20px color-mix(in srgb, var(--color-success) 40%, transparent);
}
.bulk-actions-bar .btn-primary:hover {
    box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary) 40%, transparent);
}
.bulk-divider { background: linear-gradient(180deg, transparent, var(--color-card-border), transparent); }

/* Result count: bold figure, muted qualifier */
.results-count { font-size: 15px; font-weight: 700; color: var(--color-text-primary); }
.results-count .results-count-note { font-weight: 500; color: var(--color-text-muted); }
.search-page-chat-layout .search-results-scroll { padding-top: 18px; }

/* Result cards: lift and pink edge on hover (matches Data Explorer rows) */
.result-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover), inset 3px 0 0 var(--color-primary);
}

/* Chat panel: clearly a separate raised surface */
.chat-panel {
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 6%, var(--color-card)) 0, var(--color-card) 180px);
}
.chat-action-btn { border-radius: 50%; }
.chat-input {
    background: var(--card-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}
.chat-input:focus {
    box-shadow: var(--card-shadow), 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.chat-send-btn {
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--color-primary) 35%, transparent);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.chat-send-btn:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--color-primary) 50%, transparent); transform: translateY(-1px); }

@media (max-width: 768px) {
    .bulk-actions-bar { margin: 10px 12px 0; }
}

/* ============================================================
   COMPACT APP PAGES (every signed-in page)
   Smaller type and tighter spacing for shared building blocks, scoped to
   .main-content so the sign-in screens are untouched. Page-specific CSS that
   loads later (data-explorer.css, the profile block below) can still refine this.
   ============================================================ */
@media (min-width: 1025px) {
    .main-content { padding: 20px 32px; }
}
.main-content .page-header { margin-bottom: 18px; }
.main-content .page-title { font-size: 22px; gap: 10px; }
.main-content .page-title-icon { width: 22px; height: 22px; }
.main-content .page-subtitle { font-size: 13px; margin-top: 4px; }
.main-content .section-title { font-size: 17px; }
.main-content .stat-value { font-size: 24px; }

.main-content .btn { padding: 8px 16px; font-size: 13px; gap: 6px; }
.main-content .btn-sm { padding: 6px 12px; font-size: 12px; }

.main-content .form-input,
.main-content .form-select,
.main-content .form-textarea { padding: 9px 12px; font-size: 13px; }
.main-content .form-label { font-size: 12px; }
.main-content .form-section-title { font-size: 16px; }

/* ============================================================
   PROFILE PAGE POLISH (employee / line manager / admin profile)
   One raised card per section. Everything inside a card is flat:
   no boxes-in-boxes, rows are split by faded hairlines instead of borders.
   Only real inputs keep a box. Colours come from theme.css tokens.
   ============================================================ */

/* Section card: soft accent hairline along the top edge */
.profile-page .form-section {
    position: relative;
    padding: 30px 32px 28px;
    margin-bottom: 28px;
}
.profile-page .form-section::before {
    content: "";
    position: absolute;
    top: 0; left: 28px; right: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-primary) 55%, transparent), transparent);
    pointer-events: none;
}

/* Section header: glowing icon tile, faded divider instead of a hard line */
.profile-page .form-section-header {
    border-bottom: none;
    padding-bottom: 20px;
    margin-bottom: 22px;
    position: relative;
}
.profile-page .form-section-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--color-card-border), transparent 85%);
}
.profile-page .form-section-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--color-primary) 24%, transparent),
        color-mix(in srgb, var(--color-primary) 8%, transparent));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 22%, transparent),
                0 6px 16px color-mix(in srgb, var(--color-primary) 14%, transparent);
}
.profile-page .form-section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

/* Identity: one flat 2x2 block, no card per field */
.profile-page .identity-grid {
    gap: 0 40px;
    margin-bottom: 24px;
}
.profile-page .identity-card-row {
    background: none;
    border: none;
    border-radius: 0;
    padding: 16px 0;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    position: relative;
}
.profile-page .identity-card-row::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--color-card-border) 90%, transparent), transparent);
}
/* last row of each column has no divider */
.profile-page .identity-card-row:nth-last-child(-n+5):nth-child(n+3)::after { display: none; }
.profile-page .identity-card-row:hover { background: none; border: none; }
.profile-page .identity-card-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.profile-page .identity-card-icon svg { width: 17px; height: 17px; }
.profile-page .identity-card-label { font-size: 10.5px; letter-spacing: 1.4px; margin-bottom: 3px; }
.profile-page .identity-card-value { font-size: 15.5px; font-weight: 600; }

/* Labels: quieter, so values and inputs lead */
.profile-page .form-label {
    font-size: 11.5px;
    letter-spacing: 1.2px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}
.profile-page .form-group { margin-bottom: 26px; }
.profile-page .form-group:last-child { margin-bottom: 0; }

/* Inputs: softer edge, inner depth, clear glowing focus */
.profile-page .form-input,
.profile-page .form-select,
.profile-page .form-textarea,
.profile-page .tag-input-container {
    border-color: color-mix(in srgb, var(--color-input-border) 70%, transparent);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--color-shadow) 30%, transparent);
}
.profile-page .form-input:hover,
.profile-page .form-select:hover,
.profile-page .form-textarea:hover,
.profile-page .tag-input-container:hover {
    border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-input-border));
}
.profile-page .form-input:focus,
.profile-page .form-select:focus,
.profile-page .form-textarea:focus,
.profile-page .tag-input-container:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.profile-page .tag-input-container { padding: 10px 14px; min-height: 50px; }
.profile-page .form-help { margin-top: 8px; }
.profile-page .tag { padding: 4px 11px; font-size: 12px; }

/* Certification / previous-employment rows: flat, split by hairlines (no box around inputs) */
.profile-page .certifications-list,
.profile-page .prev-employment-list { gap: 0; }
.profile-page .cert-row,
.profile-page .prev-emp-row {
    background: none;
    border: none;
    border-radius: 0;
    padding: 20px 0;
    position: relative;
}
.profile-page .cert-row:first-child,
.profile-page .prev-emp-row:first-child { padding-top: 4px; }
/* keep row fields on one baseline with the delete button (beats the generic .form-group margin above) */
.profile-page .cert-row .form-group,
.profile-page .prev-emp-row .form-group { margin-bottom: 0; }
.profile-page .cert-row .form-input,
.profile-page .cert-row .form-select,
.profile-page .prev-emp-row .form-input,
.profile-page .prev-emp-row .form-select { height: 46px; }
.profile-page .cert-remove-btn { margin-bottom: 0; height: 46px; width: 46px; }

/* "No expiry" checkbox sits in the label row so the row height does not change */
.cert-expiry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.cert-expiry-head .form-label { margin-bottom: 0; }
.cert-no-expiry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
    line-height: 1;
}
.cert-no-expiry input { accent-color: var(--color-primary); margin: 0; cursor: pointer; }
.cert-no-expiry:hover { color: var(--color-text-primary); }
.cert-expiry:disabled { opacity: 0.45; cursor: not-allowed; }
.profile-page .cert-row + .cert-row::before,
.profile-page .prev-emp-row + .prev-emp-row::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--color-card-border), transparent 90%);
}
.profile-page .btn-add-cert {
    margin-top: 8px;
    border-style: dashed;
    border-radius: var(--radius-md);
    background: transparent;
}
.profile-page .btn-add-cert:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-light);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

/* Bell tab: timeline cards sit flat on the section card */
.profile-page .timeline-card {
    background: color-mix(in srgb, var(--color-tint) 3%, transparent);
    border-color: color-mix(in srgb, var(--color-card-border) 60%, transparent);
    box-shadow: none;
    border-radius: var(--radius-md);
}
.profile-page .timeline-card:hover {
    background: color-mix(in srgb, var(--color-primary) 5%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    box-shadow: inset 3px 0 0 var(--color-primary);
}
.profile-page .skills-utilization-grid { padding-right: 4px; }

/* Tabs: faded baseline, glowing active underline */
.profile-page .profile-tab-nav {
    border-bottom: none;
    position: relative;
    margin-bottom: 28px;
}
.profile-page .profile-tab-nav::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--color-card-border), transparent 90%);
}
.profile-page .profile-tab-btn { margin-bottom: 0; position: relative; z-index: 1; }
.profile-page .profile-tab-btn.active {
    border-bottom-color: var(--color-primary);
    box-shadow: 0 10px 18px -12px var(--color-primary);
}

/* Save: gradient button with glow, right-aligned instead of a full-width bar */
.profile-page .form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 40px;
}
.profile-page .btn-save {
    width: auto;
    min-width: 220px;
    padding: 14px 32px;
    font-size: 15px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 35%, transparent);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.profile-page .btn-save:hover {
    box-shadow: 0 14px 32px color-mix(in srgb, var(--color-primary) 50%, transparent);
    transform: translateY(-1px);
}

/* "Last updated" chip next to the Personal Information title */
.profile-page .profile-updated-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: color-mix(in srgb, var(--color-success) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
    border-radius: 999px;
    white-space: nowrap;
}
.profile-page .profile-updated-chip[data-state="none"] { display: none; }
.profile-page .profile-updated-chip[data-state="overdue"] {
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-warning) 50%, transparent);
}
.profile-page .savebar-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
}
.profile-page .profile-updated-chip[data-state="overdue"] .savebar-dot { background: var(--color-warning); }

/* Floating Save / No changes needed, fixed to the bottom-right of the screen.
   .profile-page and .profile-tab-content must not keep a transform (see below),
   otherwise position:fixed would anchor to them instead of the viewport. */
.profile-page.fade-in,
.profile-page .profile-tab-content { animation-name: profileFade; }
@keyframes profileFade { from { opacity: 0; } to { opacity: 1; } }

.profile-fab {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100vw - 56px);
}
.profile-fab .btn { box-shadow: 0 10px 24px color-mix(in srgb, var(--color-shadow) 40%, transparent); }
.profile-fab .btn-save {
    width: auto;
    min-width: 0;
    padding: 12px 26px;
    font-size: 14px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 40%, transparent);
}
.profile-fab .btn-secondary {
    padding: 12px 18px;
    font-size: 14px;
    border-radius: var(--radius-lg);
    background: var(--color-card);
}
.profile-fab .fab-unsaved {
    display: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
    background: var(--color-card);
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--color-shadow) 35%, transparent);
}
.profile-fab[data-state="dirty"] .fab-unsaved { display: inline-block; }
.profile-fab[data-state="dirty"] #confirm-profile-btn,
.profile-fab[data-state="new"] #confirm-profile-btn { display: none; }
.profile-fab[data-state="dirty"] .btn-save { animation: fab-pulse 1.8s ease-in-out infinite; }
@keyframes fab-pulse {
    50% { box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 40%, transparent),
                      0 0 0 6px color-mix(in srgb, var(--color-primary) 18%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
    .profile-fab[data-state="dirty"] .btn-save { animation: none; }
}
/* keep the last form section clear of the floating buttons */
.profile-page #profile-form { padding-bottom: 88px; }

/* ---- Compact profile page ----
   The page title is redundant (sidebar + tabs already say where you are), so it is
   visually hidden but kept for screen readers. Type and spacing are scaled down so
   more of the form fits on screen. */
.profile-page .profile-page-header {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.main-content:has(.profile-page) { padding-top: 16px; }

.profile-page .profile-tab-nav { margin-bottom: 16px; }
.profile-page .profile-tab-btn { padding: 9px 16px; font-size: 13px; gap: 6px; }
.profile-page .profile-tab-btn svg { width: 15px !important; height: 15px !important; }

.profile-page .form-section { padding: 20px 24px 20px; margin-bottom: 16px; }
.profile-page .form-section::before { left: 24px; right: 24px; }
.profile-page .form-section-header { padding-bottom: 14px; margin-bottom: 14px; gap: 12px; }
.profile-page .form-section-icon { width: 34px; height: 34px; }
.profile-page .form-section-icon svg { width: 17px; height: 17px; }
.profile-page .form-section-title { font-size: 16px; }
.profile-page .form-section-subtitle { font-size: 12px; }

.profile-page .identity-grid { margin-bottom: 14px; }
.profile-page .identity-card-row { padding: 10px 0; grid-template-columns: 30px 1fr; gap: 12px; }
.profile-page .identity-card-icon { width: 30px; height: 30px; }
.profile-page .identity-card-icon svg { width: 15px; height: 15px; }
.profile-page .identity-card-label { font-size: 10px; letter-spacing: 1.2px; margin-bottom: 2px; }
.profile-page .identity-card-value { font-size: 13.5px; }

.profile-page .form-label { font-size: 10.5px; letter-spacing: 1px; margin-bottom: 7px; }
.profile-page .form-group { margin-bottom: 18px; }
.profile-page .form-input,
.profile-page .form-select,
.profile-page .form-textarea { padding: 9px 12px; font-size: 13px; }
.profile-page .form-textarea { min-height: 84px; }
.profile-page .tag-input-container { padding: 7px 10px; min-height: 40px; }
.profile-page .tag-input-container input { font-size: 13px; }
.profile-page .tag { padding: 3px 9px; font-size: 11.5px; }
.profile-page .form-help,
.profile-page .char-counter { font-size: 11.5px; }

.profile-page .cert-row,
.profile-page .prev-emp-row { padding: 14px 0; }
.profile-page .cert-row .form-input,
.profile-page .cert-row .form-select,
.profile-page .prev-emp-row .form-input,
.profile-page .prev-emp-row .form-select { height: 40px; }
.profile-page .cert-remove-btn { height: 40px; width: 40px; }

.profile-page .profile-updated-chip { padding: 3px 10px; font-size: 11px; }
.profile-fab .btn-save { padding: 10px 22px; font-size: 13px; }
.profile-fab .btn-secondary { padding: 10px 16px; font-size: 13px; }
.profile-page #profile-form { padding-bottom: 72px; }

@media (max-width: 720px) {
    .profile-fab { right: 12px; left: 12px; bottom: 12px; max-width: none; }
    .profile-fab .btn { flex: 1; justify-content: center; }
}

@media (max-width: 720px) {
    .profile-page .form-section { padding: 22px 18px; }
    .profile-page .identity-grid { gap: 0; }
    .profile-page .identity-card-row:nth-last-child(-n+5):nth-child(n+3)::after { display: block; }
    .profile-page .identity-card-row:last-of-type::after { display: none; }
    .profile-page .btn-save { width: 100%; }
}

/* ===== SEARCH RESULT CONTROLS (Min match / Results) + Word bulk-count prompt ===== */
.bulk-actions-bar { flex-wrap: wrap; }
.result-ctl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
}
.result-ctl-label { white-space: nowrap; font-weight: 600; }
.result-ctl-select,
.result-ctl-input {
    min-height: 34px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    color: var(--color-text-primary);
    background: transparent;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), color var(--transition-fast);
}
.result-ctl-select { cursor: pointer; }
.result-ctl-input { width: 72px; }
.result-ctl-select:hover,
.result-ctl-select:focus,
.result-ctl-input:focus { border-color: var(--color-primary); outline: none; }
.result-ctl-select option { background: var(--color-surface); color: var(--color-text-primary); }
.bulk-count-modal { max-width: 440px; }
.bulk-count-info { margin: 0 0 14px; color: var(--color-text-secondary); font-size: 14px; line-height: 1.5; }
.bulk-count-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font-weight: 600; }
.bulk-count-field .result-ctl-input { width: 96px; }

/* ---- FILTERS POPOVER (button at the end of the results toolbar) ---- */
.filter-pop-wrap { position: relative; margin-left: auto; flex-shrink: 0; }
.filter-toggle-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; color: var(--color-text-secondary);
    border: 1px solid var(--color-card-border); border-radius: var(--radius-md);
}
.filter-toggle-btn:hover,
.filter-toggle-btn[aria-expanded="true"],
.filter-toggle-btn.has-filters {
    color: var(--color-primary-light);
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.filter-toggle-badge {
    min-width: 18px; height: 18px; padding: 0 5px;
    align-items: center; justify-content: center;
    border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 1;
    background: var(--color-primary); color: var(--color-on-primary);
}
.filter-pop-wrap .filter-panel-overlay {
    left: auto; right: 0; top: calc(100% + 8px);
    width: 380px; max-width: calc(100vw - 32px);
    max-height: min(70vh, 520px);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    animation: slideDownFilter 0.15s ease both;
}
.filter-pop-wrap .filter-panel-overlay-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; align-content: start;
}
.filter-pop-wrap .filter-group { min-width: 0; }
@media (max-width: 480px) {
    .filter-pop-wrap .filter-panel-overlay-body { grid-template-columns: 1fr; }
}


/* ---- Themed dropdowns (Min match / Results) ---- */
.result-ctl-label {
    font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    color: var(--color-text-muted);
}
.ss-select { position: relative; display: inline-block; }
.ss-select-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ss-select-btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 34px; min-width: 92px; padding: 0 10px 0 14px;
    font: inherit; font-size: 13px; font-weight: 600;
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-tint) 5%, transparent);
    border: 1px solid var(--card-border-soft);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.ss-select-btn:hover,
.ss-select.is-open .ss-select-btn,
.ss-select-btn:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--color-primary) 55%, transparent);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent);
}
.ss-select-chevron { width: 14px; height: 14px; color: var(--color-text-muted); transition: transform var(--transition-fast); }
.ss-select.is-open .ss-select-chevron { transform: rotate(180deg); color: var(--color-primary-light); }
.ss-select-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
    min-width: 100%; padding: 6px;
    background: var(--card-surface);
    border: 1px solid var(--card-border-soft);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px -10px color-mix(in srgb, var(--color-shadow) 65%, transparent);
    animation: slideDownFilter 0.15s ease both;
}
.ss-select-menu[hidden] { display: none; }
.ss-select-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
    padding: 7px 10px; font: inherit; font-size: 13px; white-space: nowrap; text-align: left;
    color: var(--color-text-secondary);
    background: none; border: none; border-radius: var(--radius-sm); cursor: pointer;
}
.ss-select-opt:hover,
.ss-select-opt:focus-visible {
    outline: none; color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
}
.ss-select-opt.is-selected { color: var(--color-primary-light); font-weight: 700; }
.ss-select-opt.is-selected::after {
    content: ""; width: 10px; height: 6px; margin-left: 8px;
    border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translateY(-2px);
}
.result-ctl-input {
    background: color-mix(in srgb, var(--color-tint) 5%, transparent);
    border-color: var(--card-border-soft);
}

.filter-group-empty { font-size: 12px; color: var(--color-text-muted); }
.filter-group-options { display: flex; flex-direction: column; }

/* ============================================================
   LINE MANAGER – no reportee selected yet
   ============================================================ */
.lm-empty-state { display: none; text-align: center; padding: 48px 16px; color: var(--color-text-muted); }
.lm-empty-title { font-size: 16px; font-weight: 600; color: var(--color-text-primary); margin: 0 0 6px; }
.lm-empty-text { margin: 0; font-size: 14px; }
.profile-page[data-lm-no-selection="true"] .lm-empty-state { display: block; }
.profile-page[data-lm-no-selection="true"] #profile-tab-nav,
.profile-page[data-lm-no-selection="true"] #personal-tab-content,
.profile-page[data-lm-no-selection="true"] #bell-tab-content,
.profile-page[data-lm-no-selection="true"] #save-section,
.profile-page[data-lm-no-selection="true"] #visibility-section { display: none !important; }

/* ============================================================
   ROLE SWITCHER FLYOUT (sidebar "Switch Role", static/js/role-switcher.js)
   ============================================================ */
.nav-switch-role[aria-expanded="true"] {
    background: var(--color-hover);
    color: var(--color-text-primary);
}

.role-switcher {
    position: fixed;
    left: calc(var(--sidebar-width) + 12px);
    bottom: var(--rs-bottom, 16px);
    width: 340px;
    max-width: calc(100vw - var(--sidebar-width) - 28px);
    padding: 14px;
    /* Frosted glass: translucent surface over a blurred backdrop, hairline light edge */
    background: color-mix(in srgb, var(--color-surface) 62%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid color-mix(in srgb, var(--color-tint) 16%, transparent);
    border-radius: var(--radius-lg);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 color-mix(in srgb, var(--color-tint) 18%, transparent);
    z-index: 150;
    /* Slides in from the sidebar side; visibility keeps it out of the tab order when closed */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-16px) scale(0.98);
    transform-origin: 0 calc(100% - var(--rs-arrow-bottom, 30px));
    /* Fade out (closing): a touch quicker than the fade in, then drop out of the tab order */
    transition: opacity 240ms ease-in-out, transform 240ms cubic-bezier(0.4, 0, 0.6, 1), visibility 0s linear 240ms;
    will-change: opacity, transform;
}

/* No backdrop-filter support: fall back to a solid surface so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .role-switcher {
        background: var(--color-surface);
    }
}

body.sidebar-collapsed .role-switcher {
    left: 72px;
    max-width: calc(100vw - 96px);
}

/* While the flyout is open the collapsed sidebar stays expanded (same look as hover), so it never
   slides over the panel and the pointer stays on the button */
body.sidebar-collapsed.role-switcher-open .role-switcher {
    left: calc(var(--sidebar-width) + 12px);
    max-width: calc(100vw - var(--sidebar-width) - 28px);
}

.role-switcher.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    /* Fade in (opening): slow, soft landing */
    transition: opacity 340ms ease-out, transform 420ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.role-switcher-title {
    position: relative;
    margin: 2px 8px 6px;
    padding-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Faded hairline (same as the sidebar header divider): under the title and between roles */
.role-switcher-title::after,
.role-switcher-item + .role-switcher-item::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--color-card-border), transparent);
}

.role-switcher-title::after {
    top: auto;
    bottom: 0;
}

.role-switcher-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

/* Pointer on the left edge, aimed at the Switch Role button (position set in role-switcher.js).
   Rotated square: its left and bottom edges draw the "<", the gradient fills only the outer half. */
.role-switcher::before {
    content: "";
    position: absolute;
    left: -7px;
    bottom: calc(var(--rs-arrow-bottom, 30px) - 7px);
    width: 14px;
    height: 14px;
    transform: rotate(45deg);
    background: linear-gradient(to top right, color-mix(in srgb, var(--color-surface) 80%, transparent) 50%, transparent 50%);
    border-left: 1px solid color-mix(in srgb, var(--color-tint) 16%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--color-tint) 16%, transparent);
    pointer-events: none;
}

.role-switcher-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 10px;
    font: inherit;
    text-align: left;
    color: var(--color-text-primary);
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.role-switcher-item:hover:not(:disabled) {
    background: color-mix(in srgb, var(--color-tint) 6%, transparent);
}

.role-switcher-item:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

.role-switcher-item:disabled {
    cursor: default;
}

/* Current role: no box, just the accent name and a "Current" marker */
.role-switcher-item.is-current .role-switcher-name {
    color: var(--color-primary-light);
}

.role-switcher-item.is-loading {
    background: color-mix(in srgb, var(--color-tint) 6%, transparent);
}

.role-switcher.is-busy .role-switcher-item:not(.is-loading) {
    opacity: 0.45;
}

.role-switcher.is-busy .role-switcher-item {
    cursor: progress;
    pointer-events: none;
}

/* One icon colour for every role */
.role-switcher-icon {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: var(--color-primary-light);
    background: color-mix(in srgb, var(--color-primary-light) 14%, transparent);
}

.role-switcher-icon svg {
    width: 18px;
    height: 18px;
}

.role-switcher-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.role-switcher-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.role-switcher-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.role-switcher-badge {
    flex: none;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary-light);
}

.role-switcher-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary-light);
    box-shadow: 0 0 8px color-mix(in srgb, var(--color-primary-light) 70%, transparent);
}

/* Narrow screens: sits over the content as a bottom card */
@media (max-width: 1024px) {
    .role-switcher,
    body.sidebar-collapsed .role-switcher {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
        transform: translateY(14px) scale(0.98);
        transform-origin: center bottom;
        z-index: 250;
    }

    .role-switcher::before {
        display: none;
    }

    .role-switcher.is-open {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .role-switcher,
    .role-switcher.is-open {
        transform: none;
        transition: opacity 120ms linear, visibility 0s linear 120ms;
    }

    .role-switcher.is-open {
        transition: opacity 120ms linear, visibility 0s;
    }
}

/* Search page: cancel exactly the .main-content padding at each breakpoint
   (the compact-pages block lowered it to 20px 32px, so the old -32px -40px
   pulled the toolbar flush against the top edge). */
@media (min-width: 1025px) {
    .search-page-chat-layout { margin: -20px -32px; width: calc(100% + 64px); }
}
@media (max-width: 1024px) {
    .search-page-chat-layout { margin: -24px -20px; width: calc(100% + 40px); }
}
@media (max-width: 480px) {
    .search-page-chat-layout { margin: -16px -14px; width: calc(100% + 28px); }
}

/* Search results: tighter spacing (toolbar gap, list gap, card padding) */
.search-page-chat-layout .search-results-scroll { padding: 10px 20px 12px; }
.search-page-chat-layout .results-grid { gap: 6px; }
.search-page-chat-layout .result-card { padding: 8px 14px; }
.search-page-chat-layout .result-skills { margin-top: 4px; }
.search-page-chat-layout .result-certs { margin-top: 3px; }
.search-page-chat-layout .result-summary { margin-top: 3px; }
