/* StafforaHRM — Manage People. Empower Growth. */
:root {
    --sidebar-width: 260px;
    --primary: #0D3B8E;
    --primary-light: #1554B8;
    --primary-dark: #08275F;
    --accent: #208B81;
    --accent-light: #69C4B7;
    --success: #208B81;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #102433;
    --text-muted: #4A4A4A;
    --border: #e2e8f0;
    --sidebar-bg: #208B81;
    --sidebar-brand-bg: #0D3B8E;
}

* { box-sizing: border-box; }

body.app-body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #e8f1ff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform .3s;
}

.sidebar-brand {
    padding: 1.35rem 1.1rem 1.15rem;
    background: var(--sidebar-brand-bg);
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}

.sidebar-brand .brand-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ── StafforaHRM brand system ───────────────────────────── */
.brand-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .55rem;
}

.brand-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    padding: 6px;
    flex-shrink: 0;
}

.brand-icon-wrap--md {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    padding: 7px;
}

.brand-icon-wrap--lg {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(13, 59, 142, .18);
}

.brand-icon-wrap--hero {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
}

.brand-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-wordmark {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.brand-wordmark--md { font-size: 1.35rem; }
.brand-wordmark--lg { font-size: 1.65rem; }
.brand-wordmark--hero { font-size: 2rem; }

.brand-staffora { color: #fff; }
.brand-hrm { color: var(--accent-light); }

.brand-shell--login .brand-staffora,
.brand-shell--login .brand-hrm {
    color: var(--primary);
}
.brand-shell--login .brand-hrm { color: var(--accent); }

.brand-shell--careers .brand-staffora { color: #fff; }
.brand-shell--careers .brand-hrm { color: var(--accent-light); }
.brand-shell--careers .brand-powered {
    margin-top: .1rem;
    font-size: .75rem;
    color: rgba(255, 255, 255, .78);
}
.brand-shell--careers .brand-powered strong { color: #fff; }

.brand-shell--hero .brand-staffora { color: #fff; }
.brand-shell--hero .brand-hrm { color: var(--accent-light); }

.brand-tagline {
    margin: 0;
    color: rgba(255, 255, 255, .55);
    font-size: .58rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1.4;
    max-width: 200px;
}

.brand-tagline--decorated {
    color: var(--text-muted);
    font-size: .68rem;
    letter-spacing: .14em;
    display: flex;
    align-items: center;
    gap: .65rem;
    max-width: none;
}

.brand-tagline--decorated::before,
.brand-tagline--decorated::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1);
    max-width: 48px;
}

.brand-tagline--decorated::after {
    background: linear-gradient(90deg, #cbd5e1, transparent);
}

.brand-tagline--hero {
    color: rgba(255, 255, 255, .78);
    font-size: .72rem;
    letter-spacing: .16em;
    max-width: 280px;
}

.brand-shell--sidebar { gap: .55rem; }
.brand-shell--sidebar .brand-wordmark { margin-top: .1rem; }

.brand-powered {
    margin: .15rem 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: .68rem;
    letter-spacing: .04em;
    line-height: 1.35;
}

.brand-powered strong {
    color: #fff;
    font-weight: 700;
}

.sidebar-brand h5 {
    margin: 0;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-brand small {
    color: #94a3b8;
    font-size: .75rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-section {
    padding: .5rem 1.25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, .55);
    margin-top: .5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: all .2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,.14);
    color: #fff;
    border-left-color: #69C4B7;
}

.sidebar-nav a i { font-size: 1.1rem; width: 20px; text-align: center; }

.nav-group {
    margin: .2rem 0;
}

.nav-group summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    color: rgba(255, 255, 255, .88);
    font-size: .9rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    list-style: none;
    transition: all .2s;
}

.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover,
.nav-group[open] summary,
.nav-group summary.active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border-left-color: #69C4B7;
}

.nav-group summary > i:first-child {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-group summary span { flex: 1; }

.nav-group-chevron {
    width: auto;
    font-size: .72rem;
    transition: transform .2s;
}

.nav-group[open] .nav-group-chevron { transform: rotate(180deg); }

.nav-group-links {
    padding: .2rem 0 .35rem;
    background: rgba(0, 0, 0, .05);
}

.nav-group-links a {
    padding: .58rem 1.25rem .58rem 3.55rem;
    font-size: .84rem;
}

.nav-group-links a i {
    font-size: .95rem;
    width: 18px;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    gap: .75rem;
    background: rgba(0, 0, 0, .08);
}

.sidebar-user .avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: .9rem;
}

/* Main content */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.app-topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-content { padding: 1.5rem; }

.page-title { margin: 0; font-size: 1.4rem; font-weight: 700; }
.page-subtitle { margin: 0; color: var(--text-muted); font-size: .875rem; }

.app-topbar .topbar-icon-btn {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: .35rem .6rem;
}
.app-topbar .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-dropdown {
    min-width: 300px;
    max-width: 360px;
    max-height: 420px;
    overflow-y: auto;
}

.dash-measure-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.dash-measure-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.dash-measure-card {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: 1.1rem 1.2rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
a.dash-measure-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
    color: inherit;
}
.dash-measure-card .measure-top {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.dash-measure-card .measure-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.dash-measure-card .measure-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.dash-measure-card .measure-sub {
    font-size: .75rem;
    color: var(--text-muted);
}
.dash-measure-card.measure-green { border-top: 3px solid #10b981; }
.dash-measure-card.measure-green .measure-top { color: #059669; }
.dash-measure-card.measure-blue { border-top: 3px solid #3b82f6; }
.dash-measure-card.measure-blue .measure-top { color: #2563eb; }
.dash-measure-card.measure-red { border-top: 3px solid #ef4444; }
.dash-measure-card.measure-red .measure-top { color: #dc2626; }
.dash-measure-card.measure-amber { border-top: 3px solid #f59e0b; }
.dash-measure-card.measure-amber .measure-top { color: #d97706; }
.dash-measure-card.measure-teal { border-top: 3px solid #14b8a6; }
.dash-measure-card.measure-teal .measure-top { color: #0d9488; }
.dash-measure-card.measure-purple { border-top: 3px solid #8b5cf6; }
.dash-measure-card.measure-purple .measure-top { color: #7c3aed; }

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.green { background: #d1fae5; color: #059669; }
.stat-card .stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-card .stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-card .stat-icon.red { background: #fee2e2; color: #dc2626; }

.stat-card h3 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.stat-card p { margin: 0; color: var(--text-muted); font-size: .85rem; }

/* Cards */
.app-card {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.app-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-card-header h6 { margin: 0; font-weight: 600; }
.app-card-body { padding: 1.25rem; }

/* Tables */
.app-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.app-table th {
    background: #f8fafc;
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}
.app-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.app-table tr:hover td { background: #f8fafc; }

/* Badges */
.badge-pill {
    display: inline-block;
    padding: .35rem .75rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #d9f2ef; color: #0D3B8E; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-primary { background: #dce8f8; color: #0D3B8E; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* Notifications */
.notif-item {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-birthday { background: #fce7f3; color: #be185d; }

/* WFH punch buttons */
.wfh-actions { display: flex; gap: 1rem; }
.btn-wfh-in {
    background: var(--success); color: #fff; border: none;
    padding: 1rem 2rem; border-radius: 10px; font-weight: 600;
    font-size: 1rem; cursor: pointer; flex: 1;
}
.btn-wfh-out {
    background: var(--danger); color: #fff; border: none;
    padding: 1rem 2rem; border-radius: 10px; font-weight: 600;
    font-size: 1rem; cursor: pointer; flex: 1;
}
.btn-wfh-in:disabled, .btn-wfh-out:disabled { opacity: .5; cursor: not-allowed; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #f4f7fb;
}

.login-shell {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 980px;
    min-height: 100vh;
    margin: 0 auto;
}

.login-hero {
    display: none;
    background: linear-gradient(145deg, #08275F 0%, #0D3B8E 42%, #208B81 100%);
    color: #fff;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(105, 196, 183, .25), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(21, 84, 184, .3), transparent 40%);
    pointer-events: none;
}

.login-hero-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 360px;
    margin: 0 auto;
}

.login-hero-copy {
    margin-top: 2rem;
    color: rgba(255, 255, 255, .82);
    font-size: .95rem;
    line-height: 1.65;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: #f4f7fb;
}

.login-box {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 1.75rem 1.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 6px rgba(13, 59, 142, .04), 0 24px 48px rgba(13, 59, 142, .08);
    border: 1px solid rgba(226, 232, 240, .9);
}

.brand-shell--login {
    margin-bottom: 1.35rem;
}

.login-box .form-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
}

.login-box h2 { font-weight: 700; margin-bottom: .25rem; color: var(--primary); }

@media (min-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr 1fr;
        min-height: 100vh;
        max-width: none;
    }

    .login-hero { display: flex; }

    .login-panel {
        padding: 3rem 2.5rem;
    }

    .login-box {
        max-width: 400px;
        box-shadow: 0 8px 32px rgba(13, 59, 142, .1);
    }

    .brand-shell--login { display: none; }
}

.role-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.role-tab {
    flex: 1; padding: .6rem; text-align: center;
    border: 2px solid var(--border); border-radius: 8px;
    cursor: pointer; font-weight: 600; font-size: .85rem;
    background: #fff; color: var(--text-muted);
}
.role-tab.active { border-color: var(--accent); color: var(--primary); background: #ecf8f6; }

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-light);
    --bs-btn-hover-border-color: var(--primary-light);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
}

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

.btn-success {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #1a756d;
    --bs-btn-hover-border-color: #1a756d;
}

@media (max-width: 768px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

@media print {
    .app-sidebar, .app-topbar, .no-print { display: none !important; }
    .app-main { margin-left: 0; }
}

/* Company calendar */
.cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-grid th { background: #f8fafc; padding: .6rem; text-align: center; font-size: .75rem; text-transform: uppercase; color: #64748b; border: 1px solid var(--border); }
.cal-grid td { border: 1px solid var(--border); vertical-align: top; height: 80px; padding: .4rem; }
.cal-empty { background: #fafafa; }
.cal-day { background: #fff; }
.cal-weekend { background: #f1f5f9; }
.cal-holiday { background: #dbeafe; }
.cal-custom { background: #fef3c7; }
.cal-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-num { font-weight: 700; font-size: .9rem; }
.cal-label { font-size: .65rem; color: #475569; margin-top: .25rem; line-height: 1.2; }
.cal-day-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.cal-day-link:hover { background: rgba(14,165,233,.08); border-radius: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: #64748b; }
.cal-legend-item { display: flex; align-items: center; gap: .35rem; }
.cal-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-dot.weekend { background: #f1f5f9; border: 1px solid #cbd5e1; }
.cal-dot.holiday { background: #dbeafe; border: 1px solid #93c5fd; }
.cal-dot.custom { background: #fef3c7; border: 1px solid #fcd34d; }
.cal-dot.today { background: #fff; border: 2px solid var(--accent); }

/* Employee directory */
.view-tabs {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.view-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .15s;
}

.view-tab:hover {
    background: #f8fafc;
    color: var(--text);
}

.view-tab.active {
    background: #ecf8f6;
    color: var(--primary);
    border-color: #b8e4de;
}

.view-tab .tab-count {
    background: rgba(0,0,0,.06);
    padding: .1rem .45rem;
    border-radius: 10px;
    font-size: .72rem;
}

.view-tab.active .tab-count {
    background: rgba(13, 59, 142, .12);
}

.emp-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.emp-cell-btn {
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: .15rem 0;
    width: 100%;
    text-align: left;
    border-radius: 8px;
    transition: background .15s ease;
}

.emp-cell-btn:hover {
    background: rgba(13, 59, 142, .06);
}

.emp-cell-btn:hover .emp-name {
    color: var(--primary);
}

.emp-row:hover {
    background: rgba(248, 250, 252, .6);
}

.emp-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.emp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.emp-meta, .emp-contact {
    font-size: .8rem;
    color: var(--text-muted);
}

.emp-contact {
    color: var(--text);
    font-size: .85rem;
}

.device-map-banner {
    border-left: 4px solid var(--accent);
}

/* Attendance */
.live-feed-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.summary-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1rem;
}

.summary-mini-grid div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.summary-mini-grid span {
    font-size: .78rem;
}

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

.status-dot.online { background: #22c55e; }
.status-dot.offline { background: #ef4444; }

.app-table tr.row-absent td { background: #fef2f2; }
.app-table tr.row-half td { background: #fffbeb; }
.app-table tr.row-off td { background: #f8fafc; color: #64748b; }

@media print {
    .app-sidebar, .app-topbar, .no-print, .stat-grid { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; }
}

/* Recruitment pipeline */
.pipeline-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .75rem;
}

.pipeline-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: border-color .15s, box-shadow .15s;
}

.pipeline-stat:hover, .pipeline-stat.active {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(32, 139, 129, .15);
    color: inherit;
}

.pipeline-count {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.pipeline-label {
    font-size: .72rem;
    color: var(--text-muted);
}

.hiring-pipeline {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0;
    padding: .5rem 0;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    text-align: center;
}

.pipeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
}

.pipeline-step.done .pipeline-dot {
    background: #d1fae5;
    color: #059669;
    border-color: #10b981;
}

.pipeline-step.current .pipeline-dot {
    background: #dce8f8;
    color: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(13, 59, 142, .12);
}

.pipeline-step-label {
    font-size: .68rem;
    color: var(--text-muted);
    margin-top: .4rem;
    max-width: 90px;
    line-height: 1.2;
}

.pipeline-step.current .pipeline-step-label {
    color: var(--primary);
    font-weight: 600;
}

.pipeline-connector {
    flex: 1;
    min-width: 20px;
    height: 2px;
    background: #e2e8f0;
    margin-top: 20px;
}

.pipeline-connector.done {
    background: #10b981;
}

/* Offices */
.office-page-header .office-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.office-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.office-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.15rem 1.2rem 1rem;
    box-shadow: 0 1px 2px rgba(13, 59, 142, .04);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.office-card:hover {
    border-color: #c5e8e3;
    box-shadow: 0 8px 24px rgba(13, 59, 142, .08);
}

.office-card-top {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .65rem;
}

.office-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #ecf8f6;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.office-card-title {
    flex: 1;
    min-width: 0;
}

.office-card-title h6 {
    margin: 0 0 .15rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.office-code {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .04em;
}

.office-menu-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: .2rem .35rem;
}

.office-card-status {
    margin-bottom: .85rem;
}

.office-card-details {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-bottom: 1rem;
}

.office-detail {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.office-detail i {
    margin-top: .15rem;
    flex-shrink: 0;
}

.office-card-footer {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding-top: .85rem;
    border-top: 1px solid var(--border);
    font-size: .82rem;
    color: var(--primary);
    font-weight: 600;
}

.office-card-footer i {
    color: #7c3aed;
}

/* Departments */
.dept-page-header .dept-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.dept-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.dept-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 0 1rem;
    box-shadow: 0 1px 2px rgba(13, 59, 142, .04);
    overflow: hidden;
}

.dept-card-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.dept-card-top {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.15rem .65rem;
}

.dept-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #ecf8f6;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dept-card-title {
    flex: 1;
    min-width: 0;
}

.dept-card-title h6 {
    margin: 0 0 .2rem;
    font-weight: 700;
    font-size: 1rem;
}

.dept-code {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dept-card-desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 1.15rem .85rem;
}

.dept-card-team {
    border-top: 1px solid var(--border);
    padding: .85rem 1.15rem 0;
}

.policy-card {
    transition: box-shadow .15s ease, transform .15s ease;
}

a .policy-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.policy-body-content {
    line-height: 1.7;
    white-space: normal;
}

.handbook-viewer-card {
    overflow: hidden;
}

.handbook-pdf-frame {
    display: block;
    width: 100%;
    min-height: 75vh;
    height: calc(100vh - 220px);
    border: 0;
    background: #f8fafc;
}

.dept-team-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .65rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary);
}

.dept-team-head i {
    color: #7c3aed;
}

.dept-menu-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: .2rem .35rem;
}

.dept-team-empty {
    padding: .35rem 0 .25rem;
}

.dept-employee-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.dept-employee-list li {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.dept-employee-list li:last-child {
    border-bottom: none;
}

.dept-emp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dept-emp-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.dept-emp-info strong {
    display: block;
    font-size: .84rem;
    color: var(--text);
}

.dept-emp-info span {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dept-emp-link {
    padding: 0 .25rem;
    color: var(--accent);
}

/* Admin employee profile */
.emp-profile-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.emp-profile-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.emp-profile-breadcrumb a:hover {
    text-decoration: underline;
}

.emp-profile-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #0a2f6e, var(--primary) 55%, #1a6b62);
    border-radius: 18px;
    padding: 1.75rem 1.75rem 0;
    margin-bottom: 1.25rem;
    color: #fff;
    box-shadow: 0 18px 40px -18px rgba(13, 59, 142, .45);
}

.emp-profile-hero-bg {
    position: absolute;
    width: 280px;
    height: 280px;
    right: -80px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
    pointer-events: none;
}

.emp-profile-hero-inner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
}

.emp-profile-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: 3px solid rgba(255, 255, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}

.emp-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.emp-profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
}

.emp-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: center;
}

.emp-photo-upload-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}

.emp-photo-upload-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.emp-profile-hero-main h2 {
    color: #fff;
    font-size: 1.65rem;
    font-weight: 800;
}

.emp-profile-hero-main p {
    color: rgba(255, 255, 255, .85);
    margin-bottom: 0;
}

.emp-profile-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, .12);
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.emp-profile-stat {
    background: rgba(0, 0, 0, .12);
    padding: .85rem 1rem;
}

.emp-profile-stat small {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .72);
    margin-bottom: .2rem;
}

.emp-profile-stat strong {
    display: block;
    font-size: .92rem;
    color: #fff;
    line-height: 1.35;
}

.emp-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .75rem;
}

.emp-profile-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .85rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .15s;
}

.emp-profile-tab:hover {
    background: #f8fafc;
    color: var(--text);
}

.emp-profile-tab.active {
    background: #ecf8f6;
    color: var(--primary);
    border-color: #b8e4de;
}

.emp-info-grid small {
    display: block;
    margin-bottom: .15rem;
}

.emp-info-grid > div > div:last-child {
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 768px) {
    .emp-profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
