/* ===========================================
   SkillSync Enterprise — Design System
   =========================================== */

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

/* ── CSS Variables ── */
:root {
    --navy: #1e2d4a;
    --navy-light: #2c3f63;
    --navy-dark: #141f35;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff4ff;
    --success: #0f766e;
    --success-bg: #f0fdfa;
    --warn: #b45309;
    --warn-bg: #fffbeb;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --purple: #7c3aed;
    --purple-bg: #f5f3ff;

    /* Light theme */
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text: #1e293b;
    --text-2: #475569;
    --text-3: #94a3b8;
    --sidebar-bg: #1e2d4a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow: 0 4px 16px rgba(0, 0, 0, .08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .12);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #1a2540;
    --border: #334155;
    --border-hover: #475569;
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #475569;
    --sidebar-bg: #0f172a;
    --sidebar-text: #64748b;
    --sidebar-active: #f1f5f9;
    --accent-light: #1e3a8a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow: 0 4px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    --success-bg: #134e4a;
    --warn-bg: #451a03;
    --error-bg: #450a0a;
    --purple-bg: #2e1065;
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 14px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

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

img {
    max-width: 100%;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

ul {
    list-style: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 10px;
}

/* ── Auth / Login Page ── */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 480px;
}

.auth-left {
    background: linear-gradient(135deg, #1e2d4a 0%, #2563eb 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 64px;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-left-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: absolute;
    top: 40px;
    left: 64px;
}

.auth-left-brand .brand-mark {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-left-brand .brand-mark svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}

.auth-left-brand span {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.auth-headline {
    font-family: 'Playfair Display', serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    position: relative;
}

.auth-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.97rem;
    max-width: 380px;
    line-height: 1.7;
    position: relative;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 36px;
    position: relative;
}

.auth-feat {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
}

.auth-feat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ee7b7;
    flex-shrink: 0;
}

.auth-right {
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
}

.auth-form-wrap {
    width: 100%;
    max-width: 360px;
}

.auth-form-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-form-sub {
    color: var(--text-3);
    font-size: 0.83rem;
    margin-bottom: 32px;
}

.demo-credentials {
    background: var(--accent-light);
    border: 1px solid #bfcfef;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 24px;
}

.demo-credentials h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 8px;
}

.demo-cred-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-2);
    padding: 2px 0;
}

.demo-cred-item strong {
    color: var(--text);
}

/* ── App Layout ── */
.app-shell {
    display: grid;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition);
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-section-label {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.sidebar-brand-mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-mark svg {
    width: 15px;
    height: 15px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
}

.sidebar-brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

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

.sidebar-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    padding: 12px 8px 4px;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 7px;
    color: var(--sidebar-text);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.8);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-active);
    font-weight: 600;
}

.nav-item.active .nav-icon {
    color: var(--accent);
}

.nav-icon {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-label {
    flex: 1;
}

.nav-badge {
    font-size: 0.58rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 20px;
}

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

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

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.07);
}

.user-av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    text-transform: capitalize;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 60px;
}

/* ── Top Bar ── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-toggle {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    font-size: 1rem;
    transition: all var(--transition);
}

.topbar-toggle:hover {
    background: var(--bg);
    border-color: var(--border-hover);
}

.page-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 14px;
    transition: all var(--transition);
}

.topbar-search:focus-within {
    border-color: var(--accent);
    background: var(--surface);
}

.topbar-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.82rem;
    color: var(--text);
    width: 200px;
}

.topbar-search input::placeholder {
    color: var(--text-3);
}

.topbar-search span {
    color: var(--text-3);
    font-size: 0.85rem;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    font-size: 0.9rem;
    transition: all var(--transition);
    position: relative;
}

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

.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--error);
    border: 2px solid var(--surface);
    font-size: 0.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-badge {
    font-size: 0.67rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: capitalize;
    letter-spacing: 0.04em;
}

.role-badge.admin {
    background: var(--purple-bg);
    color: var(--purple);
}

.role-badge.hr {
    background: var(--accent-light);
    color: var(--accent);
}

.role-badge.manager {
    background: var(--success-bg);
    color: var(--success);
}

/* ── Page Content ── */
.page-content {
    padding: 28px;
    flex: 1;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header-left h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.page-header-left p {
    font-size: 0.82rem;
    color: var(--text-3);
}

.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--navy-light);
}

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

.btn-accent:hover {
    background: var(--accent-hover);
}

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

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--border-hover);
    background: var(--bg);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-2);
}

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

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

.btn-sm {
    padding: 5px 12px;
    font-size: 0.73rem;
}

.btn-lg {
    padding: 11px 26px;
    font-size: 0.9rem;
}

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

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.kpi-icon.blue {
    background: var(--accent-light);
}

.kpi-icon.green {
    background: var(--success-bg);
}

.kpi-icon.warn {
    background: var(--warn-bg);
}

.kpi-icon.purple {
    background: var(--purple-bg);
}

.kpi-change {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.kpi-change.up {
    color: var(--success);
}

.kpi-change.down {
    color: var(--error);
}

.kpi-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Charts Grid ── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.chart-card.wide {
    grid-column: span 2;
}

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

.chart-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}

.chart-card-sub {
    font-size: 0.7rem;
    color: var(--text-3);
}

.chart-container {
    position: relative;
}

/* ── Data Table ── */
.data-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

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

.table-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.table-count {
    font-size: 0.72rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-3);
    padding: 2px 8px;
    border-radius: 20px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 6px 12px;
    transition: all var(--transition);
}

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

.search-input input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.78rem;
    color: var(--text);
    width: 160px;
}

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

.filter-select {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 0.78rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}

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

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

.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th:hover {
    color: var(--text);
}

.data-table th .sort-icon {
    margin-left: 4px;
    opacity: 0.4;
}

.data-table th.sorted .sort-icon {
    opacity: 1;
    color: var(--accent);
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-2);
    transition: background var(--transition);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--surface-2);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.77rem;
    color: var(--text-3);
}

.pagination-btns {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    cursor: pointer;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

/* ── Employee Elements ── */
.emp-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emp-av-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 1.5px solid var(--border);
}

.emp-name-cell {
    font-weight: 600;
    color: var(--text);
    font-size: 0.82rem;
}

.emp-email {
    font-size: 0.72rem;
    color: var(--text-3);
}

/* ── Skill Tags ── */
.skill-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.skill-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.skill-tag.default {
    background: var(--bg);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.skill-tag.accent {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid #bfcfef;
}

.skill-tag.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #99f6e4;
}

.skill-tag.warn {
    background: var(--warn-bg);
    color: var(--warn);
    border: 1px solid #fde68a;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.67rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: capitalize;
    white-space: nowrap;
}

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

.status-badge.active,
.status-badge.open {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.active::before,
.status-badge.open::before {
    background: var(--success);
}

.status-badge.in-progress {
    background: var(--accent-light);
    color: var(--accent);
}

.status-badge.in-progress::before {
    background: var(--accent);
}

.status-badge.closed,
.status-badge.inactive {
    background: var(--bg);
    color: var(--text-3);
}

.status-badge.closed::before,
.status-badge.inactive::before {
    background: var(--text-3);
}

.status-badge.pending {
    background: var(--warn-bg);
    color: var(--warn);
}

.status-badge.pending::before {
    background: var(--warn);
}

/* ── Proficiency Pill ── */
.prof-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.67rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}

.prof-pill.beginner {
    background: var(--warn-bg);
    color: var(--warn);
}

.prof-pill.intermediate {
    background: var(--accent-light);
    color: var(--accent);
}

.prof-pill.expert {
    background: var(--success-bg);
    color: var(--success);
}

/* ── Match Score ── */
.match-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-bar {
    width: 56px;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.match-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.match-fill.high {
    background: var(--success);
}

.match-fill.mid {
    background: var(--accent);
}

.match-fill.low {
    background: var(--warn);
}

.match-pct {
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 38px;
}

.match-pct.high {
    color: var(--success);
}

.match-pct.mid {
    color: var(--accent);
}

.match-pct.low {
    color: var(--warn);
}

/* ── Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

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

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

.card-icon {
    font-size: 1.3rem;
}

.card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
}

.card-sub {
    font-size: 0.78rem;
    color: var(--text-3);
    line-height: 1.5;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 7px;
    margin-top: 14px;
}

/* ── Progress Bars ── */
.progress-item {
    margin-bottom: 14px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
}

.progress-track {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.7s ease;
}

.progress-fill.blue {
    background: var(--accent);
}

.progress-fill.green {
    background: var(--success);
}

.progress-fill.purple {
    background: var(--purple);
}

.progress-fill.navy {
    background: var(--navy);
}

/* ── Modal / Dialog ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.modal-backdrop.open .modal {
    transform: none;
}

.modal.wide {
    max-width: 740px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.modal-sub {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 2px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-2);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}

.form-label .req {
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.82rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

select.form-control {
    cursor: pointer;
}

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

.form-hint {
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 4px;
}

.form-error {
    font-size: 0.7rem;
    color: var(--error);
    margin-top: 4px;
    display: none;
}

.form-control.error {
    border-color: var(--error);
}

.form-control.error+.form-error {
    display: block;
}

.skill-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.skill-input-row .form-control {
    flex: 1;
}

.skill-tags-dynamic {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.skill-tag-dynamic {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid #bfcfef;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 5px;
}

.skill-tag-dynamic button {
    background: none;
    border: none;
    color: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ── Skill Matrix ── */
.matrix-wrap {
    overflow-x: auto;
}

.matrix-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 0.73rem;
}

.matrix-table th,
.matrix-table td {
    padding: 9px 14px;
    border: 1px solid var(--border);
    text-align: center;
}

.matrix-table th {
    background: var(--surface-2);
    font-weight: 700;
    color: var(--text-2);
    white-space: nowrap;
}

.matrix-table th.emp-col {
    text-align: left;
    min-width: 140px;
}

.matrix-table td {
    color: var(--text-2);
}

.matrix-cell-0 {
    background: var(--bg);
    color: var(--text-3);
}

.matrix-cell-1 {
    background: #fff7ed;
    color: #9a3412;
}

/* Beginner */
.matrix-cell-2 {
    background: #fffbeb;
    color: var(--warn);
}

/* Emerging */
.matrix-cell-3 {
    background: #eff4ff;
    color: var(--accent);
}

/* Intermediate */
.matrix-cell-4 {
    background: #f0fdfa;
    color: var(--success);
}

/* Advanced */
.matrix-cell-5 {
    background: #f0fdfa;
    color: #065f46;
    font-weight: 700;
}

/* Expert */
.matrix-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-2);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ── Match Engine ── */
.match-result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition);
    margin-bottom: 10px;
}

.match-result-card:hover {
    box-shadow: var(--shadow);
}

.match-rank {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-3);
    min-width: 32px;
    text-align: center;
}

.match-rank.top1 {
    color: #f59e0b;
}

.match-rank.top2 {
    color: var(--text-2);
}

.match-rank.top3 {
    color: #cd7f32;
}

.match-info {
    flex: 1;
}

.match-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.match-detail {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 2px;
}

.match-skills-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 7px;
}

.match-score-big {
    text-align: right;
}

.match-pct-big {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
}

.match-pct-big.high {
    color: var(--success);
}

.match-pct-big.mid {
    color: var(--accent);
}

.match-pct-big.low {
    color: var(--warn);
}

.match-pct-label {
    font-size: 0.65rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.match-breakdown {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    justify-content: flex-end;
}

.breakdown-item {
    font-size: 0.67rem;
    color: var(--text-3);
}

.breakdown-item strong {
    color: var(--text-2);
}

/* ── Recommendations ── */
.rec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
}

.rec-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.rec-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.rec-desc {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.6;
}

.rec-meta {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ── Notifications ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 380px;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

.toast.info {
    border-left: 3px solid var(--accent);
}

.toast.warn {
    border-left: 3px solid #f59e0b;
}

.toast-icon {
    font-size: 1rem;
}

.toast-msg {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

.toast-close {
    color: var(--text-3);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ── Analytics Page ── */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.analytics-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.analytics-card.full {
    grid-column: span 2;
}

/* ── Skill Gap Analysis ── */
.gap-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gap-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gap-skill {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    min-width: 120px;
}

.gap-bar-track {
    flex: 1;
    height: 7px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.gap-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--error);
    transition: width 0.7s ease;
}

.gap-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--error);
    min-width: 60px;
    text-align: right;
}

/* ── Certification Tracker ── */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.cert-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: box-shadow var(--transition);
}

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

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.cert-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.cert-issuer {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 2px;
}

.cert-expiry {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
}

.cert-expiry.valid {
    background: var(--success-bg);
    color: var(--success);
}

.cert-expiry.expiring {
    background: var(--warn-bg);
    color: var(--warn);
}

.cert-expiry.expired {
    background: var(--error-bg);
    color: var(--error);
}

.cert-holders {
    font-size: 0.75rem;
    color: var(--text-3);
}

.cert-weight {
    display: flex;
    gap: 3px;
    margin-top: 10px;
}

.cert-star {
    font-size: 0.7rem;
}

.cert-star.filled {
    color: #f59e0b;
}

.cert-star.empty {
    color: var(--border);
}

/* ── Performance Section ── */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.perf-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
}

/* ── Empty State ── */
.empty-state {
    padding: 64px 24px;
    text-align: center;
    color: var(--text-3);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 14px;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 7px;
}

.empty-state p {
    font-size: 0.82rem;
    max-width: 300px;
    margin: 0 auto 18px;
    line-height: 1.6;
}

/* ── Loading ── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 14px;
    color: var(--text-3);
    font-size: 0.85rem;
}

/* ── Section Divider ── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin: 24px 0 16px;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Info Row / Grid ── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.info-item {}

.info-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 4px;
}

.info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

/* ── Alert Boxes ── */
.alert {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-msg {
    flex: 1;
    line-height: 1.5;
}

.alert.info {
    background: var(--accent-light);
    border: 1px solid #bfcfef;
    color: var(--accent);
}

.alert.success {
    background: var(--success-bg);
    border: 1px solid #99f6e4;
    color: var(--success);
}

.alert.warn {
    background: var(--warn-bg);
    border: 1px solid #fde68a;
    color: var(--warn);
}

.alert.error {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    color: var(--error);
}

/* ── Settings ── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.settings-nav .settings-nav-item {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.82rem;
    color: var(--text-2);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

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

.settings-nav .settings-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.settings-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.settings-sub {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-bottom: 24px;
}

/* ── Toggle Switches ── */
.toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-wrap:last-child {
    border: none;
}

.toggle-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.toggle-desc {
    font-size: 0.72rem;
    color: var(--text-3);
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle.on {
    background: var(--accent);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
}

.toggle.on::after {
    transform: translateX(18px);
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .chart-card.wide {
        grid-column: span 2;
    }

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

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

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

@media (max-width: 960px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

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

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

    .chart-card.wide {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .page-content {
        padding: 16px;
    }

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

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

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

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

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

    .analytics-card.full {
        grid-column: span 1;
    }

    .auth-right {
        padding: 32px 24px;
    }

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

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

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