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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --secondary: #64748b;
    --secondary-hover: #475569;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-text: #075985;
    --dark: #0f172a;
    --dark-surface: #1e293b;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #818cf8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 30px -10px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NAVBAR */
.navbar {
    background: #0f172a;
    color: #f8fafc;
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.nav-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(79, 70, 229, 0.25);
    border: 1px solid rgba(129, 140, 248, 0.3);
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 5px 12px 5px 6px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

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

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.2;
}

.user-role-badge {
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #818cf8;
}

/* MAIN CONTAINER */
.container {
    max-width: 1240px;
    margin: 28px auto;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
}

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

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

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

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

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

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

.page-title-group h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.025em;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 3px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
    color: #ffffff;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

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

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

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-danger-outline {
    background: transparent;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.btn-danger-outline:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 7px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-input-wrap {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    font-size: 0.95rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: #ffffff;
    transition: var(--transition);
    color: var(--text-main);
}

.search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.775rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #334155;
    vertical-align: middle;
}

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

tr:hover td {
    background-color: #f8fafc;
}

/* EMPLOYEE CELL */
.employee-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.employee-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.employee-email {
    font-size: 0.775rem;
    color: var(--text-muted);
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.badge-active .badge-dot { background: #10b981; }

.badge-inactive {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.badge-inactive .badge-dot { background: #ef4444; }

.badge-dept {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.badge-admin {
    background: #faf5ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}
.badge-admin .badge-dot { background: #9333ea; }

.badge-user {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.badge-user .badge-dot { background: #3b82f6; }

.salary-tag {
    font-family: 'Plus Jakarta Sans', monospace, sans-serif;
    font-weight: 700;
    color: #0f172a;
}

/* ACTIONS */
.actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* FORMS */
.form-card {
    max-width: 760px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid-full {
    grid-column: span 2;
}

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

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: #ffffff;
    color: var(--text-main);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
    color: var(--text-subtle);
}

.error-text {
    color: #dc2626;
    font-size: 0.775rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

/* CUSTOM SWITCH */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 6px;
}

.switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-input:checked + .switch-slider {
    background-color: var(--primary);
}

.switch-input:checked + .switch-slider::before {
    transform: translateX(20px);
}

/* FORM ACTIONS */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ALERTS */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

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

/* PROFILE VIEW */
.profile-card {
    max-width: 820px;
    margin: 0 auto;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.profile-avatar-lg {
    width: 76px;
    height: 76px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    flex-shrink: 0;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.detail-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
}

/* LOGIN SCREEN */
.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -80px;
    left: -80px;
    border-radius: 50%;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    width: 100%;
    max-width: 420px;
    padding: 38px 34px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.login-logo {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 14px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
}

.login-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    font-size: 1rem;
}

.input-with-icon input {
    padding-left: 42px;
}

.demo-credentials {
    margin-top: 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.8rem;
    color: #475569;
}

.demo-badge {
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.725rem;
    margin-right: 6px;
}

/* ERROR & 403 PAGES */
.error-card {
    max-width: 520px;
    margin: 60px auto;
    text-align: center;
    padding: 44px 32px;
}

.error-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.error-icon-wrap.danger {
    background: #fee2e2;
    color: #dc2626;
}

.error-icon-wrap.warning {
    background: #fef3c7;
    color: #d97706;
}

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

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-subtle);
    margin-bottom: 12px;
    display: inline-block;
}

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

/* FOOTER */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-subtle);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: #ffffff;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }
    .nav-brand { width: 100%; justify-content: space-between; }
    .nav-links { width: 100%; justify-content: flex-start; }
    .nav-user { width: 100%; justify-content: space-between; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid-full { grid-column: span 1; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .profile-hero { flex-direction: column; text-align: center; }
}
