/* ========================================
   RecruitPro - HR Recruitment Management System
   Premium Dark Theme CSS
   ======================================== */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --accent-light: #22d3ee;

    /* Backgrounds */
    --bg-body: #0b0f1a;
    --bg-sidebar: #0f1423;
    --bg-surface: #151b2e;
    --bg-card: #1a2137;
    --bg-card-hover: #1f2847;
    --bg-input: #131928;
    --bg-hover: rgba(99, 102, 241, 0.08);
    --bg-active: rgba(99, 102, 241, 0.12);
    --bg-topbar: rgba(15, 20, 35, 0.85);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.08);
    --border-light: rgba(148, 163, 184, 0.12);
    --border-focus: var(--primary);

    /* Status */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Sizing */
    --sidebar-width: 272px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme */
body.light-theme {
    --bg-body: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(99, 102, 241, 0.06);
    --bg-active: rgba(99, 102, 241, 0.1);
    --bg-topbar: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(15, 23, 42, 0.08);
    --border-light: rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

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

button { cursor: pointer; border: none; background: none; font-family: inherit; }

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select { appearance: none; cursor: pointer; }

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-slow);
    overflow: hidden;
}

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

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

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-svg { width: 20px; height: 20px; color: #fff; }

.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.logo-tagline { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 16px; height: 16px; }

.sidebar-search {
    padding: 12px 16px;
    position: relative;
    flex-shrink: 0;
}

.sidebar-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    font-size: 12.5px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 8px 16px;
}

/* Menu Groups */
.menu-group { margin-bottom: 2px; }

.menu-group-label {
    padding: 16px 12px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Menu Items */
.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 7px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 450;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    gap: 10px;
    position: relative;
    text-align: left;
    white-space: nowrap;
}

.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }

.menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.menu-item:hover svg { opacity: 1; }

.menu-item.active {
    background: var(--bg-active);
    color: var(--primary-light);
    font-weight: 500;
}
.menu-item.active svg { opacity: 1; color: var(--primary-light); }

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.menu-item .menu-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.menu-item .menu-badge {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.menu-expand {
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
    flex-shrink: 0;
    opacity: 0.5;
}

.menu-item.expanded .menu-expand { transform: rotate(90deg); }

/* Sub Menu */
.sub-menu {
    display: none;
    padding-left: 16px;
}
.sub-menu.open { display: block; }

.sub-menu .menu-item {
    padding: 6px 12px 6px 22px;
    font-size: 12.5px;
    position: relative;
}

.sub-menu .menu-item::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    transform: translateY(-50%);
    transition: var(--transition);
}

.sub-menu .menu-item:hover::after,
.sub-menu .menu-item.active::after {
    background: var(--primary-light);
}

.sub-menu .menu-item.active::before { display: none; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

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

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.sidebar-user-role { display: block; font-size: 11px; color: var(--text-muted); }

.sidebar-user-menu {
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
}
.sidebar-user-menu svg { width: 16px; height: 16px; }
.sidebar-user-menu:hover { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
}

/* --- Top Bar --- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
    flex-shrink: 0;
}

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

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}
.mobile-menu-btn svg { width: 20px; height: 20px; }
.mobile-menu-btn:hover { background: var(--bg-hover); }

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

.breadcrumb-item { transition: var(--transition); }
.breadcrumb-item:hover { color: var(--text-primary); cursor: pointer; }
.breadcrumb-sep { opacity: 0.3; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

.topbar-search {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0 12px;
    gap: 8px;
    transition: var(--transition);
}
.topbar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.topbar-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }

.topbar-search input {
    border: none;
    background: none;
    padding: 7px 0;
    font-size: 13px;
    width: 220px;
    color: var(--text-primary);
}
.topbar-search input:focus { box-shadow: none; }

.topbar-search kbd {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: inherit;
}

.topbar-actions { display: flex; align-items: center; gap: 4px; }

.topbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}
.topbar-btn svg { width: 18px; height: 18px; }
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--error);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    margin: 0 8px;
}

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

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.topbar-user-role { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.topbar-user-chevron { width: 14px; height: 14px; color: var(--text-muted); }

/* --- Notification Panel --- */
.notification-panel {
    position: fixed;
    top: var(--topbar-height);
    right: 24px;
    width: 380px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

.notification-panel.open { display: block; }

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

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.notif-header h3 { font-size: 14px; font-weight: 600; }
.notif-mark-all { font-size: 12px; color: var(--primary-light); }
.notif-mark-all:hover { text-decoration: underline; }

.notif-list { overflow-y: auto; max-height: 400px; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--primary-glow); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-icon svg { width: 16px; height: 16px; }
.notif-icon.success { background: var(--success-bg); color: var(--success); }
.notif-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notif-icon.info { background: var(--info-bg); color: var(--info); }
.notif-icon.error { background: var(--error-bg); color: var(--error); }

.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 12.5px; color: var(--text-primary); line-height: 1.4; }
.notif-text strong { font-weight: 600; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* --- Page Content --- */
.page-content {
    flex: 1;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

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

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

.page-title-section {}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}
.page-subtitle { font-size: 13px; color: var(--text-secondary); }

.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-glow); }

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

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

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.kpi-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}
.kpi-card:hover::after { opacity: 1; }

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

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon.primary { background: var(--primary-glow); color: var(--primary-light); }
.kpi-icon.success { background: var(--success-bg); color: var(--success); }
.kpi-icon.warning { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.info { background: var(--info-bg); color: var(--info); }
.kpi-icon.error { background: var(--error-bg); color: var(--error); }
.kpi-icon.accent { background: rgba(6, 182, 212, 0.1); color: var(--accent); }

.kpi-trend { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
.kpi-trend svg { width: 14px; height: 14px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--error); }

.kpi-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.1; margin-bottom: 4px; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* --- Data Grid / Charts Row --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-bottom: 24px; }

/* --- Tables --- */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.table-toolbar-right { display: flex; align-items: center; gap: 8px; }

.table-search {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    gap: 6px;
}
.table-search svg { width: 14px; height: 14px; color: var(--text-muted); }
.table-search input {
    border: none;
    background: none;
    padding: 7px 0;
    font-size: 12.5px;
    width: 200px;
}
.table-search input:focus { box-shadow: none; }

.table-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.table-filter:hover { border-color: var(--primary); color: var(--text-primary); }
.table-filter svg { width: 14px; height: 14px; }

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

thead { background: var(--bg-surface); }

th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}
th:hover { color: var(--text-primary); }

td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tr:hover td { background: var(--bg-hover); color: var(--text-primary); }

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

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

.pagination-info { }

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    transition: var(--transition);
}
.pagination-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination-btn.active { background: var(--primary); color: #fff; }
.pagination-btn svg { width: 14px; height: 14px; }

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.badge-primary { background: var(--primary-glow); color: var(--primary-light); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg-surface); color: var(--text-muted); }

/* --- Avatar --- */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; border-radius: var(--radius); }

/* --- Stats Bar --- */
.stats-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    flex: 1;
    min-width: 150px;
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-info {}
.stat-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 11px; color: var(--text-muted); }

/* --- Activity Feed --- */
.activity-feed {}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-content { flex: 1; }
.activity-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* --- Schedule Card --- */
.schedule-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    transition: var(--transition);
}
.schedule-item:hover { border-color: var(--border-light); background: var(--bg-hover); }

.schedule-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
}
.schedule-hour { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.schedule-period { font-size: 10px; color: var(--text-muted); }

.schedule-divider {
    width: 2px;
    background: var(--primary);
    border-radius: 1px;
    flex-shrink: 0;
}

.schedule-info { flex: 1; }
.schedule-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.schedule-desc { font-size: 12px; color: var(--text-muted); }

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary); }
.tab-btn .tab-count {
    font-size: 10px;
    padding: 1px 6px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* --- Forms Layout --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
.form-full { grid-column: 1 / -1; }

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

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

textarea { min-height: 80px; resize: vertical; }

.form-section {
    margin-bottom: 28px;
}
.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

/* --- Checkbox & Radio --- */
.checkbox-group, .radio-group { display: flex; flex-direction: column; gap: 8px; }

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-item input, .radio-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* --- Pipeline / Kanban --- */
.pipeline {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.pipeline-column {
    min-width: 260px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.pipeline-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}
.pipeline-count {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--text-muted);
}

.pipeline-body { padding: 12px; }

.pipeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.pipeline-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.pipeline-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.pipeline-card-role { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.pipeline-card-footer { display: flex; align-items: center; justify-content: space-between; }

/* --- Calendar Grid --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-day-header {
    padding: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-surface);
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    background: var(--bg-card);
    position: relative;
}
.calendar-day.other-month { opacity: 0.4; }
.calendar-day.today { background: var(--primary-glow); }

.calendar-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.calendar-day.today .calendar-date { color: var(--primary-light); font-weight: 700; }

.calendar-event {
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* --- Funnel Chart --- */
.funnel { margin: 20px 0; }

.funnel-step {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.funnel-bar-container { flex: 1; position: relative; }

.funnel-bar {
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    transition: width 0.8s ease;
}

.funnel-label { min-width: 140px; font-size: 12.5px; color: var(--text-secondary); }
.funnel-value { min-width: 50px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-state-text { font-size: 13px; color: var(--text-muted); max-width: 400px; margin-bottom: 20px; }

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

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: toastIn 0.3s ease;
}

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

.toast-icon { flex-shrink: 0; }
.toast-icon svg { width: 18px; height: 18px; }
.toast-message { font-size: 13px; color: var(--text-primary); flex: 1; }
.toast-close { color: var(--text-muted); padding: 4px; }
.toast-close svg { width: 14px; height: 14px; }
.toast-close:hover { color: var(--text-primary); }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 24px; }

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

/* --- Chart Container --- */
.chart-container {
    position: relative;
    width: 100%;
    padding: 8px;
}

.chart-container canvas { max-width: 100%; }

/* --- Tag --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

/* --- Stepper --- */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}
.step.active .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.completed .step-dot { background: var(--success); border-color: var(--success); color: #fff; }

.step-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--primary-light); font-weight: 500; }
.step.completed .step-label { color: var(--success); }

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border-light);
    margin: 0 8px;
}
.step.completed + .step-line, .step.completed .step-line { background: var(--success); }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

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

    .mobile-menu-btn { display: flex; }

    .topbar { padding: 0 16px; }
    .topbar-search { display: none; }
    .topbar-user-info { display: none; }

    .page-content { padding: 16px; }
    .page-header { flex-direction: column; }

    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-search input { width: 100%; }

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

    .pipeline { flex-direction: column; }
    .pipeline-column { min-width: unset; }
}

/* --- Custom Scrollbar for sidebar --- */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* --- Animations --- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* --- Profile Card --- */
.profile-card {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info { flex: 1; }
.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-role { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.profile-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.profile-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.profile-meta-item svg { width: 14px; height: 14px; }

/* --- Detail Grid --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.detail-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.detail-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.3px; }
.detail-value { font-size: 13px; color: var(--text-primary); font-weight: 500; }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.timeline-content { }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.timeline-desc { font-size: 12.5px; color: var(--text-secondary); }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* --- List Group --- */
.list-group {}
.list-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}
.list-group-item:last-child { border-bottom: none; }
.list-group-item:hover { background: var(--bg-hover); }

/* --- Chart Legend Custom --- */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
}

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

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.d-flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.overflow-auto { overflow: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
