/* ============================================================
   🎨 CareerBlazor — Modern UI Styles
   ============================================================
   تم دمج وتحديث جميع الأنماط مع التصميم الحديث
   ============================================================ */

/* === UCAS Color System (Legacy Support) === */
:root {
    --ucas-blue:        #005baa;
    --ucas-blue-dark:   #00437e;
    --ucas-blue-light:  #4da3ff;
    --ucas-green:       #3e7d2c;
    --ucas-green-dark:  #346a25;
    --ucas-gradient:   linear-gradient(-45deg, #005baa, #3e7d2c 65%, #3e7d2c);
    --ucas-bg:          #f8fafc;
    --ucas-surface:     #ffffff;
    --ucas-border:      #e2e8f0;
    --ucas-text:        #0f172a;
    --ucas-text-muted:  #64748b;
    --ucas-success:     #4f9f37;
    --ucas-error:       #ef4444;
    --ucas-warning:     #f59e0b;
    --ucas-info:        #1a6fbd;
    --ucas-header-h:    64px;
}

/* === Dark Mode Variable Overrides === */
[data-theme="dark"] {
    --ucas-bg:          #0f172a;
    --ucas-surface:     #1e293b;
    --ucas-border:      #334155;
    --ucas-text:        #f1f5f9;
    --ucas-text-muted:  #94a3b8;
    --ucas-blue:        #4da3ff;
    --ucas-blue-dark:   #1a6fbd;
    --ucas-blue-light:  #8cc3ff;
    --ucas-green:       #7cc95f;
    --ucas-green-dark:  #4f9f37;
    --ucas-gradient:    linear-gradient(-45deg, #4da3ff, #7cc95f 65%, #7cc95f);
    --ucas-success:     #7cc95f;
    --ucas-error:       #f87171;
    --ucas-warning:     #fbbf24;
    --ucas-info:        #4da3ff;
}
[data-theme="dark"] .mud-input > input.mud-input-root,[data-theme="dark"] div.mud-input-slot.mud-input-root{
    color:#fff;
}
    [data-theme="dark"]
    .mud-tabs-tabbar {
        background-color: transparent;
    }
[data-theme="dark"] .mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol ,
[data-theme="dark"] .mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
    color: #fff;
}
/* === Base === */
html, body {
    font-family: 'Tajawal', 'Cairo', 'Inter', 'Tahoma', 'Arial', sans-serif;
    background-color: var(--ucas-bg);
    color: var(--ucas-text);
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

a { color: var(--ucas-blue); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--ucas-blue-dark); }

/* ============================================================
   🏗️ MODERN LAYOUT
   ============================================================ */

/* Legacy .modern-appbar / .modern-drawer-* / .modern-navmenu / .modern-main-content styles
   removed: the layout now uses .career-* classes from css/modern/sidebar.css. */

/* Brand (used by AnonymousLayout) */
.modern-brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    color: var(--ucas-text) !important;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--ucas-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 91, 170, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ucas-text);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--ucas-text-muted);
    font-weight: 500;
}

/* ============================================================
   📄 PAGE STYLES
   ============================================================ */

/* === Breadcrumb === */
.breadcrumb-container {
    background: var(--ucas-surface);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    border: 1px solid var(--ucas-border);
    box-shadow: var(--modern-shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-separator { 
    margin: 0 8px; 
    color: var(--ucas-text-muted);
    font-size: 12px;
}

/* === Section Card === */
.section-card {
    background: var(--ucas-surface);
    border: 1px solid var(--ucas-border);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--modern-shadow-card);
    transition: box-shadow 0.2s ease;
}

.section-card:hover {
    box-shadow: var(--modern-shadow-md);
}

.section-header {
    background: var(--ucas-gradient);
    color: #fff;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 16px 16px 0 0;
}

[data-theme="dark"] .section-header {
    /* the dark-mode --ucas-gradient is too light for white text */
    background: linear-gradient(-45deg, #00437e, #346a25 65%, #346a25);
}

.section-body { padding: 20px; }

/* === Form Section Title === */
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ucas-blue);
    border-bottom: 2px solid var(--ucas-blue);
    padding-bottom: 4px;
    margin-bottom: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title.green {
    color: var(--ucas-green);
    border-bottom-color: var(--ucas-green);
}

/* === CV Progress === */
.cv-progress-container {
    background: var(--ucas-surface);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--modern-shadow-card);
    border: 1px solid var(--ucas-border);
}

.cv-progress-label {
    font-size: 13px;
    color: var(--ucas-text-muted);
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cv-progress-bar {
    height: 10px;
    background: var(--ucas-bg);
    border-radius: 5px;
    overflow: hidden;
}

.cv-progress-fill {
    height: 100%;
    background: var(--ucas-gradient);
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Quick Tiles (Dashboard) === */
.tile-card {
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 16px;
    border: 2px solid var(--ucas-border);
    background: var(--ucas-surface);
    box-shadow: var(--modern-shadow-sm);
}

.tile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--modern-shadow-card-hover);
    border-color: var(--ucas-blue);
}

.tile-card.active-tile {
    border-color: var(--ucas-green);
    background: linear-gradient(135deg, rgba(62, 125, 44, 0.06), rgba(0, 91, 170, 0.04));
    box-shadow: 0 4px 12px rgba(62, 125, 44, 0.15);
}

/* === Action Tiles (Login) === */
.action-tile {
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 16px;
    border: 2px solid transparent;
    background: var(--ucas-surface);
    padding: 8px;
    box-shadow: var(--modern-shadow-sm);
}

.action-tile:hover {
    border-color: var(--ucas-blue);
    box-shadow: var(--modern-shadow-card-hover);
    transform: translateY(-3px);
}

.action-tile.active-tile {
    border-color: var(--ucas-green);
    background: linear-gradient(135deg, rgba(62, 125, 44, 0.08), transparent);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--ucas-text-muted);
}

.empty-state-icon { 
    font-size: 56px; 
    opacity: 0.3; 
    margin-bottom: 16px; 
}

/* === Status Chips === */
.status-applied    { background: rgba(26, 111, 189,0.12) !important; color: #005baa !important; }
.status-pending    { background: rgba(245,158,11,0.12) !important; color: #d97706 !important; }
.status-rejected   { background: rgba(239,68,68,0.12) !important; color: #dc2626 !important; }
.status-accepted  { background: rgba(98, 187, 71,0.12) !important; color: #3e7d2c !important; }

/* === Buttons === */
.btn-ucas-primary {
    background: var(--ucas-gradient) !important;
    color: #fff !important;
    border: none;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 91, 170, 0.25) !important;
    transition: all 0.2s ease !important;
}

.btn-ucas-primary:hover { 
    opacity: 0.95;
    box-shadow: 0 6px 20px rgba(0, 91, 170, 0.35) !important;
    transform: translateY(-1px);
}

/* ============================================================
   🎯 MUD BLAZOR OVERRIDES
   ============================================================ */

/* === MudCard === */
.mud-card {
    border-radius: 16px !important;
    box-shadow: var(--modern-shadow-card) !important;
    transition: all 0.25s ease !important;
}

.mud-card:hover {
    box-shadow: var(--modern-shadow-md) !important;
}

.mud-card-header { 
    border-bottom: 1px solid var(--ucas-border); 
    padding: 16px 20px !important;
}

.mud-card-content {
    padding: 20px !important;
}

/* === MudTabs === */
.mud-tabs .mud-tabs-header { 
    background: var(--ucas-surface); 
    border-bottom: 2px solid var(--ucas-border);
    border-radius: 16px 16px 0 0 !important;
}

.mud-tab {
    padding: 12px 20px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.mud-tab.mud-tab-active { 
    border-bottom: 3px solid var(--ucas-blue) !important; 
    color: var(--ucas-blue) !important; 
    font-weight: 700 !important; 
}

/* === MudTable === */
.mud-table {
    border-radius: 12px !important;
    overflow: hidden !important;
}

    .mud-table th {
        background: var(--modern-primary-700) !important;
        color: #fff !important;
        font-weight: 600;
        font-size: 13px;
        padding: 12px 16px !important;
    }

.mud-table th .mud-table-sort-label {
    color: rgba(255,255,255,0.9) !important;
}

.mud-table td {
    padding: 10px 16px !important;
}

/* === MudChip === */
.mud-chip {
    font-weight: 600 !important;
    border-radius: 8px !important;
}

/* === MudAlert === */
.mud-alert {
    border-radius: 12px !important;
}

/* === MudButton === */
.mud-button {
    border-radius: 10px !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.mud-button-filled {
    box-shadow: 0 4px 14px rgba(0, 91, 170, 0.2) !important;
}

/* === MudDialog === */
.mud-dialog {
    border-radius: 20px !important;
}

.mud-dialog-content {
    padding: 24px !important;
}

/* === MudSelect / MudTextField === */
.mud-input {
    border-radius: 10px !important;
}

.mud-input-outlined-border {
    border-color: var(--ucas-border) !important;
    border-radius: 10px !important;
}

.mud-input.mud-input-filled {
    border-radius: 10px !important;
    background: var(--ucas-bg) !important;
}

/* === MudProgressLinear === */
.mud-progress-linear {
    border-radius: 4px !important;
}

/* === MudSnackbar === */
.mud-snackbar {
    border-radius: 12px !important;
}

/* ============================================================
   ⚠️ ERROR UI
   ============================================================ */
#blazor-error-ui {
    background: var(--modern-error-bg);
    color: #991b1b;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: none;
    inset-inline: 0;
    padding: 12px 20px;
    position: fixed;
    z-index: 1000;
}

.modern-error-content {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.modern-error-link {
    color: var(--ucas-blue) !important;
    font-weight: 600;
    margin-right: auto;
}

.modern-error-dismiss {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    color: #991b1b;
    padding: 4px 8px;
}

/* ============================================================
   📱 RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .brand-subtitle { display: none; }
    .brand-title { font-size: 14px; }
    .section-body { padding: 12px; }
    .mud-card-content { padding: 12px !important; }
}

@media (max-width: 768px) {
    .mud-button, .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }
    .mud-card { margin-bottom: 12px; }
    .mud-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mud-input-control { margin-bottom: 12px; }
    .mud-tabs .mud-tab { padding: 10px 12px; font-size: 12px; }
    .mud-grid-item { margin-bottom: 8px; }
    .mud-alert { padding: 10px !important; }
    .mud-dialog { max-width: 95vw !important; max-height: 90vh; }
}

/* === Touch Device Fixes === */
@media (hover: none) and (pointer: coarse) {
    .mud-button-base:hover { background: inherit; }
    .mud-list-item { min-height: 48px; }
    .mud-drawer-content, .mud-navmenu {
        -webkit-overflow-scrolling: touch;
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   📊 DASHBOARD STYLES
   ============================================================ */

.modern-dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

/* === Welcome Banner === */
.welcome-banner {
    background: var(--modern-gradient-primary);
    border-radius: var(--modern-radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--modern-shadow-card);
    color: white;
}

.welcome-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.welcome-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 14px;
    opacity: 0.9;
}

.welcome-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--modern-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.welcome-avatar .mud-icon {
    color: white !important;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--modern-surface);
    border: 1px solid var(--modern-border);
    border-radius: var(--modern-radius-lg);
    padding: 20px;
    box-shadow: var(--modern-shadow-card);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--modern-gradient-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.stat-card:hover::before { opacity: 1; }

.stat-card:hover {
    box-shadow: var(--modern-shadow-card-hover);
    transform: translateY(-2px);
    border-color: var(--modern-primary-200);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--modern-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon.bg-blue { background: var(--modern-primary-50); color: var(--modern-primary-600); }
.stat-card-icon.bg-green { background: var(--modern-secondary-50); color: var(--modern-secondary-600); }
.stat-card-icon.bg-purple { background: #f3e8ff; color: #7c3aed; }
.stat-card-icon.bg-orange { background: var(--modern-accent-50); color: var(--modern-accent-600); }

.stat-card-content { flex: 1; }

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--modern-text-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    color: var(--modern-text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.stat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

/* === Jobs Grid === */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Single .job-card definition (Dashboard, Jobs, RecommendedJobs, Applications). */
.job-card {
    background: var(--modern-surface);
    border: 1px solid var(--modern-border);
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: var(--modern-shadow-sm);
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.job-card:hover {
    box-shadow: 0 8px 30px rgba(0, 91, 170,0.12) !important;
    transform: translateY(-3px);
    border-color: var(--modern-primary-200);
}

.job-card-expired { opacity: 0.6; }

.job-card-expired:hover {
    transform: none;
    box-shadow: none !important;
}

.job-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 91, 170, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.description-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Jobs page header (moved from Jobs.razor) === */
.jobs-header { padding: 8px 0; }

.jobs-title {
    font-weight: 800 !important;
    background: linear-gradient(135deg, #005baa, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .jobs-title {
    background: linear-gradient(135deg, #8cc3ff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
}

.jobs-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.jobs-search .mud-input { border-radius: 10px; }

.job-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--modern-border);
}

.job-icon {
    width: 40px;
    height: 40px;
    background: var(--modern-primary-50);
    border-radius: var(--modern-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.job-info { flex: 1; }

.job-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--modern-text-primary);
    margin-bottom: 4px;
}

.job-deadline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--modern-text-muted);
}

.job-card-body {
    padding: 12px 20px;
}

.job-status {
    display: inline-flex;
}

.job-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--modern-border);
    background: var(--modern-surface-soft);
}

/* === Applied Jobs List === */
.applied-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.applied-job-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--modern-surface-soft);
    border: 1px solid var(--modern-border);
    border-radius: var(--modern-radius-md);
    transition: all 0.2s ease;
}

.applied-job-item:hover {
    background: var(--modern-surface-hover);
    border-color: var(--modern-primary-200);
}

.applied-job-icon {
    width: 40px;
    height: 40px;
    background: var(--modern-primary-50);
    border-radius: var(--modern-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.applied-job-info { flex: 1; min-width: 0; }

.applied-job-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--modern-text-primary);
    margin-bottom: 4px;
}

.applied-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--modern-text-muted);
}

.applied-job-status { flex-shrink: 0; }

/* === Section Variants === */
.section-header-warning {
    background: linear-gradient(135deg, var(--modern-accent-50), var(--modern-surface)) !important;
    color: var(--modern-accent-700) !important;
}

.section-header-error {
    background: linear-gradient(135deg, var(--modern-error-bg), var(--modern-surface)) !important;
    color: var(--modern-error) !important;
}

/* === Password Form === */
.password-form {
    max-width: 500px;
}

@media (max-width: 768px) {
    .welcome-content {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jobs-grid {
        grid-template-columns: 1fr;
    }
    
    .applied-job-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-banner {
        padding: 20px;
    }
    
    .welcome-text h1 {
        font-size: 20px;
    }
}

/* === Modern Footer === */
.modern-footer {
    background: var(--ucas-surface);
    border-top: 1px solid var(--ucas-border);
    padding: 24px 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 36px;
    height: 36px;
    background: var(--ucas-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.footer-brand-text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--ucas-text);
}

.footer-brand-text small {
    font-size: 12px;
    color: var(--ucas-text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--ucas-text-muted);
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--ucas-blue);
}

.footer-copy {
    font-size: 12px;
    color: var(--ucas-text-muted);
}

@media (max-width: 600px) {
    .modern-footer {
        padding: 20px 16px;
    }
    
    .footer-links {
        gap: 12px;
    }
    
    .footer-brand {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-brand-text {
        text-align: center;
    }
}

/* ============================================================
   🚨 Global Error Boundary
   ============================================================ */
.global-error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 20px;
    direction: rtl;
}

.global-error-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.4s ease-out;
}

/* @keyframes fadeInUp lives in css/modern/animations.css */

.global-error-icon {
    font-size: 72px !important;
    margin-bottom: 20px;
    color: var(--ucas-error) !important;
}

.global-error-card h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 14px 0;
}

.global-error-card p {
    font-size: 15px;
    color: #555;
    margin: 0 0 28px 0;
    line-height: 1.7;
}

.global-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .global-error-card {
        padding: 32px 20px;
    }

    .global-error-card h2 {
        font-size: 22px;
    }

    .global-error-actions {
        flex-direction: column;
    }

    .global-error-actions .mud-button {
        width: 100%;
    }
}

/* ============================================================
   🌙 DARK MODE ELEMENT OVERRIDES
   ============================================================ */

/* === Status Chips (hardcoded colors) === */
[data-theme="dark"] .status-applied  { background: rgba(77, 163, 255,0.15) !important; color: #4da3ff !important; }
[data-theme="dark"] .status-pending  { background: rgba(251,191,36,0.15) !important; color: #fbbf24 !important; }
[data-theme="dark"] .status-rejected { background: rgba(248,113,113,0.15) !important; color: #f87171 !important; }
[data-theme="dark"] .status-accepted { background: rgba(52,217,153,0.15) !important; color: #7cc95f !important; }
[data-theme="dark"] .mud-dialog {
    background: #1d262a !important;
}
[data-theme="dark"] p.mud-typography.mud-typography-body2,
[data-theme="dark"] .mud-typography-body1,
[data-theme="dark"] .mud-typography-caption {
    color: #ddd !important;
}
[data-theme="dark"] .mud-typography-h2,
[data-theme="dark"] .mud-typography-h4,
[data-theme="dark"] .mud-typography-h5,
[data-theme="dark"] .mud-typography-h6,
[data-theme="dark"] .mud-typography-subtitle1 {
    color: #fff;
}
[data-theme="dark"] .mud-expand-panel,
[data-theme="dark"] .mud-paper {
    background-color: rgb(30 41 59);
}
/* === MudTable header: same rule as light mode (--modern-primary-700 + white text);
   in dark mode --modern-primary-700 resolves to #005baa. === */
[data-theme="dark"] .mud-simple-table.mud-table-striped .mud-table-container table tbody tr:nth-of-type(odd),
[data-theme="dark"] .mud-table-striped .mud-table-container .mud-table-root .mud-table-body:not(.mud-table-body-virtualized) .mud-table-row:nth-of-type(odd) {
    background: rgba(255,255,255,.04) !important;
}
/* === Error UI === */
[data-theme="dark"] #blazor-error-ui {
    background: rgba(248,113,113,0.12);
    color: #f87171;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] .modern-error-dismiss {
    color: #f87171;
}

/* === Global Error Boundary === */
[data-theme="dark"] .global-error-card {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .global-error-card h2 {
    color: #f1f5f9;
}

[data-theme="dark"] .global-error-card p {
    color: #cbd5e1;
}

/* === Stat Card Icons (hardcoded bg/purple) === */
[data-theme="dark"] .stat-card-icon.bg-purple { background: #312e81; color: #a78bfa; }
[data-theme="dark"] .stat-card-icon.bg-blue   { background: rgba(77, 163, 255,0.15); color: #4da3ff; }
[data-theme="dark"] .stat-card-icon.bg-green  { background: rgba(52,217,153,0.15); color: #7cc95f; }
[data-theme="dark"] .stat-card-icon.bg-orange { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* === Tile Card active (hardcoded rgba gradients) === */
[data-theme="dark"] .tile-card.active-tile {
    background: linear-gradient(135deg, rgba(52,217,153,0.10), rgba(77, 163, 255,0.08));
    box-shadow: 0 4px 12px rgba(52,217,153,0.20);
}

[data-theme="dark"] .action-tile.active-tile {
    background: linear-gradient(135deg, rgba(52,217,153,0.12), transparent);
}

/* === Brand icon box-shadow === */
[data-theme="dark"] .brand-icon {
    box-shadow: 0 4px 12px rgba(77, 163, 255,0.30);
}

/* === Footer logo box-shadow === */
[data-theme="dark"] .footer-logo {
    box-shadow: 0 4px 12px rgba(77, 163, 255,0.30);
}

/* === MudButton filled shadow === */
[data-theme="dark"] .mud-button-filled {
    box-shadow: 0 4px 14px rgba(77, 163, 255,0.25) !important;
}

/* === Btn primary shadow === */
[data-theme="dark"] .btn-ucas-primary {
    box-shadow: 0 4px 14px rgba(77, 163, 255,0.30) !important;
}

[data-theme="dark"] .btn-ucas-primary:hover {
    box-shadow: 0 6px 20px rgba(77, 163, 255,0.40) !important;
}

/* === Welcome banner: dark-mode --modern-gradient-primary is too light for white text === */
[data-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg, #005baa, #00437e);
}

[data-theme="dark"] .welcome-text p {
    opacity: 0.8;
}

/* === Welcome avatar background === */
[data-theme="dark"] .welcome-avatar {
    background: rgba(255,255,255,0.10);
}

/* === CV Progress container (hardcoded box-shadow inset) === */
[data-theme="dark"] .cv-progress-bar {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

/* === Empty state === */
[data-theme="dark"] .empty-state {
    opacity: 0.8;
}

/* ============================================================
   🧩 GLOBAL FIXES
   ============================================================ */

/* Bootstrap .text-muted is a fixed grey (unreadable on dark surfaces) — follow the theme. */
.text-muted {
    color: var(--modern-text-secondary) !important;
}

/* Job rich-text (JobDetails .jd-html-content): pasted HTML must not overflow the card. */
.jd-html-content img {
    max-width: 100%;
    height: auto;
}

.jd-html-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* ============================================================
   🔥 VACANCY SPOTLIGHT (Dashboard) — hero, countdowns, badges
   Colours come from the theme tokens; urgency uses amber/red.
   ============================================================ */
:root {
    --vac-soon:      #d97706;
    --vac-soon-bg:   #fef3c7;
    --vac-today:     #dc2626;
    --vac-today-bg:  #fee2e2;
    --vac-ok:        #3e7d2c;
    --vac-new:       #7c3aed;
    --vac-new-bg:    #ede9fe;
}
[data-theme="dark"] {
    --vac-soon:      #fbbf24;
    --vac-soon-bg:   rgba(251,191,36,0.14);
    --vac-today:     #f87171;
    --vac-today-bg:  rgba(248,113,113,0.16);
    --vac-ok:        #7cc95f;
    --vac-new:       #c4b5fd;
    --vac-new-bg:    rgba(196,181,253,0.14);
}

/* --- Hero banner --- */
.vacancy-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(120deg, #00437e 0%, #005baa 45%, #3e7d2c 130%);
    box-shadow: 0 10px 30px rgba(0, 91, 170, 0.25);
    animation: fadeInUp 0.5s ease both;
}
.vacancy-hero-done {
    background: linear-gradient(120deg, #346a25 0%, #3e7d2c 60%, #005baa 140%);
    box-shadow: 0 10px 30px rgba(62, 125, 44, 0.22);
}
.vacancy-hero-glow {
    position: absolute;
    inset-inline-end: -60px;
    top: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 70%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}
.vacancy-hero-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.18);
    font-size: 30px;
}
.vacancy-hero-icon .mud-icon-root { font-size: 30px; color: #fff; }
.vacancy-hero:not(.vacancy-hero-done) .vacancy-hero-icon { animation: heroWiggle 3.5s ease-in-out infinite; }
.vacancy-hero-text { flex: 1; min-width: 0; position: relative; }
.vacancy-hero-text h2 { font-size: 19px; font-weight: 800; margin: 0 0 6px; line-height: 1.5; }
.vacancy-hero-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.vacancy-hero-text .job-countdown {
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    padding: 1px 10px;
    border-radius: 999px;
}
.vacancy-hero-cta {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    color: #00437e;
    background: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vacancy-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.vacancy-hero-cta:focus-visible { outline: 3px solid rgba(255,255,255,0.7); outline-offset: 2px; }
.vacancy-hero-cta .mud-icon-root { animation: bounce 2s ease-in-out infinite; }

@keyframes heroWiggle {
    0%, 86%, 100% { transform: rotate(0); }
    89% { transform: rotate(-12deg); }
    92% { transform: rotate(10deg); }
    95% { transform: rotate(-6deg); }
}

/* --- Live job cards --- */
.job-card-live {
    position: relative;
    animation: fadeInUp 0.45s ease backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
    border-top: 3px solid var(--vac-ok);
}
.job-card-live.urgency-soon  { border-top-color: var(--vac-soon); }
.job-card-live.urgency-today { border-top-color: var(--vac-today); animation: fadeInUp 0.45s ease backwards, urgentGlow 2.2s ease-in-out 0.6s infinite; animation-delay: calc(var(--i, 0) * 70ms), 0.6s; }
.job-card-live.urgency-unknown { border-top-color: var(--modern-border); }
.job-card-applied { opacity: 0.72; border-top-color: var(--modern-border) !important; }
.job-card-applied:hover { opacity: 1; }

@keyframes urgentGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50%      { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18); }
}

.job-ribbons {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    display: flex;
    gap: 6px;
    z-index: 1;
}
.job-ribbons:empty { display: none; }
.job-ribbon {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    animation: scaleIn 0.35s ease backwards;
    animation-delay: calc(var(--i, 0) * 70ms + 0.25s);
}
.ribbon-new   { color: var(--vac-new);   background: var(--vac-new-bg); }
.ribbon-soon  { color: var(--vac-soon);  background: var(--vac-soon-bg); }
.ribbon-today { color: #fff; background: var(--vac-today); animation: scaleIn 0.35s ease backwards, pulse 1.6s ease-in-out 0.6s infinite; }

/* keep the title clear of the ribbons */
.job-card-live .job-card-header { padding-top: 40px; }

.job-timer { padding: 12px 20px 4px; }
.job-timer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--vac-ok);
}
.urgency-soon  .job-timer-row { color: var(--vac-soon); }
.urgency-today .job-timer-row { color: var(--vac-today); }
.urgency-today .job-timer-row .mud-icon-root { animation: pulse 1.2s ease-in-out infinite; }

.job-timer-track {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: var(--modern-border);
    overflow: hidden;
}
.job-timer-fill {
    height: 100%;
    width: var(--pct);
    border-radius: inherit;
    background: linear-gradient(90deg, #4f9f37, #3e7d2c);
    transform-origin: right center;   /* RTL: the bar drains toward the start */
    margin-inline-start: 0;
    animation: timerGrow 0.9s ease-out both;
    animation-delay: calc(var(--i, 0) * 70ms + 0.2s);
}
.urgency-soon  .job-timer-fill { background: linear-gradient(90deg, #fbbf24, #d97706); }
.urgency-today .job-timer-fill { background: linear-gradient(90deg, #f87171, #dc2626); }

@keyframes timerGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 600px) {
    .vacancy-hero { flex-direction: column; text-align: center; padding: 20px 16px; }
    .vacancy-hero-text p { justify-content: center; }
    .vacancy-hero-cta { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .vacancy-hero, .vacancy-hero-glow, .vacancy-hero-icon, .vacancy-hero-cta .mud-icon-root,
    .job-card-live, .job-ribbon, .job-timer-fill, .urgency-today .job-timer-row .mud-icon-root {
        animation: none !important;
    }
}
