:root {
    --hris-bg: #F5F7FA;
    --hris-surface: #FFFFFF;
    --hris-primary: #155EEF;
    --hris-primary-dark: #0E4BC7;
    --hris-accent: #84CC16;
    --hris-text: #1E293B;
    --hris-text-secondary: #64748B;
    --hris-border: #E7EAF0;
    --hris-radius-lg: 24px;
    --hris-radius-md: 16px;
    --hris-radius-sm: 12px;
    --hris-shadow: 0 4px 24px rgba(30, 41, 59, 0.06);
    --hris-shadow-sm: 0 2px 10px rgba(30, 41, 59, 0.04);
    --sidebar-width: 264px;
    --sidebar-collapsed-width: 84px;
    --topbar-height: 72px;
}

* { box-sizing: border-box; }

body {
    background: var(--hris-bg);
    color: var(--hris-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14.5px;
}

a { text-decoration: none; }

.text-secondary-soft { color: var(--hris-text-secondary); }

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--hris-surface);
    border-right: 1px solid var(--hris-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: width .2s ease, transform .2s ease;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--hris-border);
    flex-shrink: 0;
}

.sidebar-brand .logo-badge {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--hris-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand .brand-text { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-section-title { display: none; }

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

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hris-text-secondary);
    padding: 16px 12px 6px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--hris-radius-sm);
    color: var(--hris-text);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 14px;
}

.nav-item i, .nav-item svg { flex-shrink: 0; width: 20px; height: 20px; }

.nav-item:hover { background: #F1F5FE; color: var(--hris-primary); }

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

.main-wrap {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left .2s ease;
}

.main-wrap.sidebar-collapsed { margin-left: var(--sidebar-collapsed-width); }

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

.content-area { padding: 24px; flex: 1; }

/* ---------- Cards ---------- */
.card-soft {
    background: var(--hris-surface);
    border: 1px solid var(--hris-border);
    border-radius: var(--hris-radius-md);
    box-shadow: var(--hris-shadow-sm);
}

.card-soft .card-header {
    background: transparent;
    border-bottom: 1px solid var(--hris-border);
    border-radius: var(--hris-radius-md) var(--hris-radius-md) 0 0 !important;
    font-weight: 600;
    padding: 16px 20px;
}

.card-soft .card-body { padding: 20px; }

.kpi-card {
    background: var(--hris-surface);
    border: 1px solid var(--hris-border);
    border-radius: var(--hris-radius-md);
    box-shadow: var(--hris-shadow-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpi-icon {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}

.kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.kpi-label { font-size: 13px; color: var(--hris-text-secondary); }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 500; }
.btn-sm { border-radius: 10px; }
.btn-primary { background: var(--hris-primary); border-color: var(--hris-primary); }
.btn-primary:hover { background: var(--hris-primary-dark); border-color: var(--hris-primary-dark); }
.btn-accent { background: var(--hris-accent); border-color: var(--hris-accent); color: #1a2e05; }
.btn-outline-primary { color: var(--hris-primary); border-color: var(--hris-primary); }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: 12px;
    border-color: var(--hris-border);
    padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--hris-primary);
    box-shadow: 0 0 0 3px rgba(21,94,239,.12);
}
.form-label { font-weight: 500; font-size: 13.5px; color: var(--hris-text); margin-bottom: 6px; }

/* ---------- Tables ---------- */
.table-soft { margin-bottom: 0; }
.table-soft thead th {
    background: #FAFBFD;
    border-bottom: 1px solid var(--hris-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hris-text-secondary);
    font-weight: 600;
    padding: 12px 16px;
}
.table-soft tbody td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid var(--hris-border); }
.table-soft tbody tr:last-child td { border-bottom: none; }

.badge-soft { border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 11.5px; }

.avatar-circle {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--hris-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    object-fit: cover;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--hris-text-secondary); }
.empty-state i { font-size: 42px; opacity: .4; }

/* ---------- Auth ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #EEF2FF 0%, #F5F7FA 100%);
}
.auth-card {
    background: #fff;
    border-radius: var(--hris-radius-lg);
    box-shadow: var(--hris-shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-wrap, .main-wrap.sidebar-collapsed { margin-left: 0; }
    .sidebar-backdrop {
        display: none;
        position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1025;
    }
    .sidebar-backdrop.show { display: block; }
}

.tab-nav-soft .nav-link {
    border-radius: 12px 12px 0 0;
    color: var(--hris-text-secondary);
    font-weight: 500;
    padding: 10px 18px;
}
.tab-nav-soft .nav-link.active { color: var(--hris-primary); border-bottom: 2px solid var(--hris-primary); background: transparent; }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--hris-border); }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before {
    content: ''; position: absolute; left: -28px; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--hris-primary); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--hris-border);
}
