@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root,
[data-theme = "dark"]{
    --sidebar-width: 240px;
    --header-height: 64px;

    --bg-primary: #0f1117;
    --bg-secondary: #161b27;
    --bg-card: #1c2235;
    --bg-card-hover: #212840;
    --bg-input: #1c2235;

    --sidebar-bg: #0b0e18;
    --sidebar-active: #1e2a45;
    --sidebar-hover: #141928;
    --sidebar-border: #1e2540;

    --header-bg: #0f1117;
    --header-border: #1e2540;

    --accent: #4f8ef7;
    --accent-hover: #3a7af5;
    --accent-glow: rgba(79, 142, 247, 0.15);

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #4f8ef7;
    --info-bg: rgba(79, 142, 247, 0.12);

    --text-primary: #e8eaf0;
    --text-secondary: #8b92a8;
    --text-muted: #555d73;
    --text-accent: #4f8ef7;

    --border: #1e2540;
    --border-light: #252d45;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);

    --filter-hover: #1e2a45;
    --bg-login: #0d1a30;
}
:root[data-theme = "light"]{
    --sidebar-width: 240px;
    --header-height: 64px;

    --bg-primary: #f0f4f8;
    --bg-secondary: #e8edf4;
    --bg-card: #ffffff;
    --bg-card-hover: #f7f9fc;
    --bg-input: #ffffff;

    --sidebar-bg: #1e293b;
    --sidebar-active: #2d3f5c;
    --sidebar-hover: #263247;
    --sidebar-border: #2d3f5c;

    --header-bg: #ffffff;
    --header-border: #e2e8f0;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.12);

    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.1);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-accent: #2563eb;

    --border: #e2e8f0;
    --border-light: #cbd5e1;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);

    --filter-hover: #94a3b8;
    --bg-login: #F1F3F9;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    animation: pageFadeIn 0.35s ease both;
}

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

/* Smooth reveal when a page's skeleton swaps to real content */
[data-page-content] {
    animation: contentReveal 0.45s ease both;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-logo .logo-initial {
    width: 34px;
    height: 34px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.14rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
}

.sidebar-logo .logo-text {
    font-size: 1.29rem;
    font-weight: 700;
    color: #e8eaf0;
    letter-spacing: -0.3px;
}

.sidebar-logo .logo-tagline {
    font-size: 0.71rem;
    color: #555d73;
    font-weight: 400;
    display: block;
    margin-top: -2px;
}

.sidebar-section {
    padding: 10px 12px;
    flex: 1;
}

.sidebar-section-label {
    font-size: 0.71rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555d73;
    padding: 8px 8px 4px;
    display: block;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #8b92a8;
    font-size: 0.96rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #e8eaf0;
    transform: translateX(2px);
}

.sidebar-nav li a:hover .nav-icon {
    transform: scale(1.12);
}

.sidebar-nav li a.active {
    background: var(--sidebar-active);
    color: var(--accent);
    border-left: 2px solid var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent-glow);
}

.nav-icon {
    font-size: 1.14rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.71rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px var(--accent-glow);
}

.sidebar-bottom {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-user:hover {
    background: var(--sidebar-hover);
}

.sidebar-user:hover .user-avatar {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.93rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease;
}

.user-info .user-name {
    font-size: 0.93rem;
    font-weight: 600;
    color: #e8eaf0;
    display: block;
}

.user-info .user-role {
    font-size: 0.79rem;
    color: #555d73;
    display: block;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.header {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

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

.header-title {
    font-size: 1.21rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.93rem;
    color: var(--text-muted);
}

.header-breadcrumb span {
    color: var(--text-secondary);
}

.header-breadcrumb .sep {
    color: var(--text-muted);
    font-size: 0.79rem;
}
.header-middle {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    gap: 8px;
    width: 400px;
    transition: border-color 0.15s;
    -webkit-border-radius: var(--radius-sm);
    -moz-border-radius: var(--radius-sm);
    -ms-border-radius: var(--radius-sm);
    -o-border-radius: var(--radius-sm);
}

.header-search:focus-within {
    border-color: var(--accent);
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.93rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

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

.search-icon {
    color: var(--text-muted);
    font-size: 0.93rem;
    flex-shrink: 0;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.93rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.header-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.header-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.header-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 3px 12px var(--accent-glow);
}

.header-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1.07rem;
    position: relative;
}

.header-icon-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.notif-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    top: 5px;
    right: 5px;
    border: 1.5px solid var(--header-bg);
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 4px var(--accent-glow); }
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.93rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.header-avatar:hover {
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: scale(1.05);
}

.header-user-info {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.header-user-info .h-name {
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-user-info .h-email {
    font-size: 0.79rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.93rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.back-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.page-body {
    padding: 28px;
    flex: 1;
    min-width: 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-width: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
}

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

.card-title {
    font-size: 1.07rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.96rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    -webkit-border-radius: var(--radius-sm);
    -moz-border-radius: var(--radius-sm);
    -ms-border-radius: var(--radius-sm);
    -o-border-radius: var(--radius-sm);
}

.btn[disabled] {
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0.85;
    animation: btn-spinner-spin 0.6s linear infinite;
    vertical-align: middle;
}

.btn-spinner-label {
    display: inline-block;
    margin-left: 7px;
    vertical-align: middle;
}

@keyframes btn-spinner-spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 0 14px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 12px var(--danger-bg);
}

.btn-sm {
    padding: 5px 11px;
    font-size: 0.86rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:hover .badge {
    transform: scale(1.05);
    box-shadow: 0 0 0 1px currentColor inset;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge-applied {
    background: rgba(79, 142, 247, 0.12);
    color: #4f8ef7;
}

.badge-interview {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.badge-offer {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.badge-pending {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.badge-saved {
    background: rgba(139, 162, 168, 0.1);
    color: #8b92a8;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label span.required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 13px;
    font-size: 0.96rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    outline: none;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.3s;

}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b92a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    gap: 16px;
}

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

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

.table-wrapper {
    overflow-x: auto;
}

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

thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

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

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

tbody td {
    padding: 12px 14px;
    font-size: 0.96rem;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Compact table view (Settings > Appearance > Interface Preferences) */
body.compact-table thead th {
    padding: 6px 14px;
}

body.compact-table tbody td {
    padding: 6px 14px;
    font-size: 0.88rem;
}

body.compact-table .company-cell .cl,
body.compact-table .company-cell .company-logo {
    width: 24px;
    height: 24px;
    font-size: 11px;
}

/* Hide status dot on badges (Settings > Appearance > Interface Preferences) */
body.hide-status-dot .badge::before {
    display: none;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state .empty-icon {
    font-size: 2.86rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1rem;
    max-width: 280px;
    line-height: 1.6;
}


::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE — mobile/tablet drawer nav + header + shared layout collapse
   ========================================================================== */

/* Hamburger button — hidden on desktop, shown at <=1024px */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.sidebar-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: background 0.15s;
}

.sidebar-toggle:hover span {
    background: var(--text-primary);
}

/* Dark backdrop behind the open drawer */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

body.sidebar-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }

    /* Sidebar becomes an off-canvas drawer */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 0 16px;
        gap: 10px;
    }

    .header-breadcrumb {
        display: none;
    }

    .header-search {
        width: 200px;
    }
}

@media (max-width: 860px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--header-height);
        padding: 12px 16px;
        row-gap: 10px;
    }

    .header-left {
        order: 1;
    }

    .header-right {
        order: 2;
    }

    .header-middle {
        order: 3;
        width: 100%;
        flex-basis: 100%;
        justify-content: center;
    }

    .header-search {
        width: 100%;
    }

    .header-user-info {
        display: none;
    }

    .header-right #logoutBtn {
        padding: 7px 10px;
    }
}

@media (max-width: 640px) {
    .header-icon-btn[data-tooltip="Notifications"] {
        display: none;
    }

    .header-title {
        font-size: 0.9rem;
    }

    .page-body {
        padding: 16px;
    }
}