/* ==================== CSS VARIABLES / THEMING ==================== */
:root,
[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --bg-modal-overlay: rgba(0, 0, 0, 0.5);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    --text-on-primary: #ffffff;

    --border-color: #e2e8f0;
    --border-focus: #3b82f6;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --success: #22c55e;
    --success-light: #f0fdf4;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #f1f5f9;

    --border-color: #334155;
    --border-focus: #60a5fa;

    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #1e3a5f;
    --success-light: #064e3b;
    --warning-light: #451a03;
    --danger-light: #450a0a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ==================== LOGIN MODAL ==================== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.2s ease;
}

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

.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1001;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 420px;
    width: 90%;
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-modal {
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: var(--text-on-primary);
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group select {
    cursor: pointer;
    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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: color var(--transition);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.error-message {
    margin-top: 16px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 13px;
    text-align: center;
}

[data-theme="dark"] .error-message {
    background: #451a1a;
    border-color: #7f1d1d;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    gap: 6px;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-spinner {
    align-items: center;
    gap: 8px;
}

/* ==================== APP LAYOUT ==================== */
#appContainer {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.logo i {
    font-size: 22px;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-sidebar);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 450;
    transition: all var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 12px 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--text-sidebar);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 12px;
}

.theme-toggle:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    display: block;
    color: var(--text-sidebar);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile .btn-icon {
    color: var(--text-sidebar);
    flex-shrink: 0;
}

.user-profile .btn-icon:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-toggle {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* ==================== PAGES ==================== */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card.clickable {
    cursor: pointer;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 450;
}

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.content-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    margin-bottom: 0;
}

.view-all-link {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all-link i {
    font-size: 11px;
    transition: transform var(--transition);
}

.view-all-link:hover i {
    transform: translateX(3px);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 36px 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    border-color: var(--border-focus);
}

.filter-search {
    width: 260px;
}

.results-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

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

/* ==================== APPLICATION ROWS (Expandable) ==================== */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.application-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.application-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.application-item.expanded {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.application-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}

.application-row:hover {
    background: var(--primary-light);
}

.applicant-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.applicant-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.applicant-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.applicant-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.application-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.job-tag {
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-new { background: #dbeafe; color: #1e40af; }
.status-under_review { background: #fef3c7; color: #92400e; }
.status-saved_for_later { background: #e0e7ff; color: #3730a3; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-hired { background: #d1fae5; color: #065f46; }

[data-theme="dark"] .status-new { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .status-under_review { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .status-saved_for_later { background: #312e81; color: #a5b4fc; }
[data-theme="dark"] .status-rejected { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .status-hired { background: #064e3b; color: #6ee7b7; }

.app-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.expand-indicator {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.application-item.expanded .expand-indicator {
    transform: rotate(180deg);
}

/* ==================== EXPANDED DETAIL PANEL ==================== */
.application-detail {
    display: none;
    border-top: 1px solid var(--border-color);
    padding: 24px;
    background: var(--bg-primary);
    animation: expandIn 0.2s ease;
}

@keyframes expandIn {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1000px; }
}

.application-item.expanded .application-detail {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-section h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-field .label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-field .value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 450;
}

.detail-field .value a {
    font-weight: 500;
}

/* Status controls in detail view */
.status-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.status-btn {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.status-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.status-btn.active {
    border-color: transparent;
}

.status-btn[data-status="new"].active { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.status-btn[data-status="under_review"].active { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.status-btn[data-status="saved_for_later"].active { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }
.status-btn[data-status="rejected"].active { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.status-btn[data-status="hired"].active { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }

[data-theme="dark"] .status-btn[data-status="new"].active { background: #1e3a5f; color: #93c5fd; border-color: #3b82f6; }
[data-theme="dark"] .status-btn[data-status="under_review"].active { background: #451a03; color: #fbbf24; border-color: #f59e0b; }
[data-theme="dark"] .status-btn[data-status="saved_for_later"].active { background: #312e81; color: #a5b4fc; border-color: #6366f1; }
[data-theme="dark"] .status-btn[data-status="rejected"].active { background: #450a0a; color: #fca5a5; border-color: #ef4444; }
[data-theme="dark"] .status-btn[data-status="hired"].active { background: #064e3b; color: #6ee7b7; border-color: #22c55e; }

/* Documents */
.documents-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    transition: all var(--transition);
    text-decoration: none;
}

.doc-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.doc-link i {
    font-size: 14px;
}

/* Action bar in detail */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.detail-actions .action-spacer {
    flex: 1;
}

/* Notes section */
.notes-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.notes-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.note-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.note-input-row input {
    flex: 1;
    padding: 8px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.note-input-row input:focus {
    border-color: var(--border-focus);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.note-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.note-content {
    flex: 1;
    min-width: 0;
}

.note-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.note-meta strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.note-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ==================== JOBS GRID ==================== */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.job-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

.job-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.job-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.job-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.job-active-badge {
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.job-active-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.job-active-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .job-active-badge.active {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .job-active-badge.inactive {
    background: #450a0a;
    color: #fca5a5;
}

.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.job-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.job-card-meta i {
    font-size: 12px;
    color: var(--text-muted);
}

.job-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.job-app-count {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.job-app-count i {
    color: var(--text-muted);
}

.job-card-actions {
    display: flex;
    gap: 6px;
}

/* ==================== SAVED CANDIDATES ==================== */
.saved-candidates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow var(--transition);
}

.saved-card:hover {
    box-shadow: var(--shadow-sm);
}

.saved-card-info {
    flex: 1;
    min-width: 0;
}

.saved-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.saved-card-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.saved-card-reason {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.saved-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==================== MODALS (non-login) ==================== */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.job-modal {
    max-width: 600px;
    width: 95%;
}

.job-modal form {
    padding: 24px;
}

.save-modal {
    max-width: 480px;
    width: 95%;
}

.save-modal form {
    padding: 24px;
}

.confirm-modal {
    max-width: 400px;
    width: 90%;
    padding: 32px;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.confirm-modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-modal p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.confirm-modal .modal-actions {
    justify-content: center;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 450;
    min-width: 280px;
    max-width: 420px;
    animation: toastIn 0.3s ease;
    color: #fff;
}

.toast.toast-success { background: #16a34a; }
.toast.toast-error { background: #dc2626; }
.toast.toast-info { background: #2563eb; }

.toast i {
    font-size: 16px;
    flex-shrink: 0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(16px) scale(0.95); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .search-box { width: 200px; }
    .filter-search { width: 200px; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-toggle {
        display: flex;
    }

    .search-box {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    .page-content { padding: 16px; }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .filter-select {
        flex: 1;
        min-width: 120px;
    }

    .filter-search {
        width: 100%;
    }

    .application-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .application-meta {
        flex-wrap: wrap;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-modal {
        padding: 28px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .action-spacer {
        display: none;
    }
}