/* HRMS stylesheet */
:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --border: #e3e7ef;
    --text: #1d2433;
    --muted: #6b7489;
    --primary: #2f5bea;
    --primary-dark: #2248c4;
    --primary-soft: #e8eefe;
    --green: #127a4a; --green-soft: #e3f6ec;
    --amber: #95600a; --amber-soft: #fdf2dc;
    --red: #b42318; --red-soft: #fde8e7;
    --blue: #1d5fa8; --blue-soft: #e4f0fc;
    --grey: #4b5565; --grey-soft: #eef0f4;
    --sidebar: #141b2d;
    --sidebar-text: #aeb6c9;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.25; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
code { background: var(--grey-soft); padding: .1rem .35rem; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap { max-width: 280px; word-wrap: break-word; }
.mt { margin-top: 1.25rem; }
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 1.25rem; }
.inline { display: inline; }
.plain { padding-left: 1rem; margin: 0; }
.plain li { margin-bottom: .35rem; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .75rem;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1.25rem; }
.brand-name { color: #fff; font-weight: 600; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 9px; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.1rem;
}
.nav a {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 8px;
    color: var(--sidebar-text); margin-bottom: 2px; font-size: .94rem;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem; background: var(--surface);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.page-title { margin: 0; flex: 1; font-size: 1.2rem; }
.menu-toggle { display: none; background: none; border: 0; padding: .3rem; cursor: pointer; color: var(--text); }
.menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.user-menu { display: flex; align-items: center; gap: .75rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; color: var(--text); }
.user-chip:hover { text-decoration: none; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta small { color: var(--muted); }
.avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary); font-weight: 700;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; flex-shrink: 0; }
.content { padding: 1.5rem; flex: 1; }
.footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--border); }

/* Grid */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.grid > .card, .stack > .card { margin-bottom: 0; }
.card h2 + h2, .card form h2 { margin-top: 1.25rem; }
.card form h2:first-of-type { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; margin: 0; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-head h2 { margin-bottom: .2rem; }
.profile-head p { margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .88rem; }

/* Forms */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 500; color: #344054; }
input, select, textarea {
    font: inherit; font-size: .94rem; color: var(--text); background: #fff; border: 1px solid #cfd5e1;
    border-radius: 8px; padding: .5rem .65rem; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
label.checkbox { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
fieldset.weekdays { border: 1px solid var(--border); border-radius: 8px; margin: 1rem 0 0; padding: .75rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
fieldset.weekdays legend { font-size: .88rem; font-weight: 500; padding: 0 .3rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filters { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.filters input, .filters select { width: auto; }
.filters input[type="search"] { min-width: 260px; }
.filters label { font-size: .8rem; }
.review-form { display: flex; flex-direction: column; gap: .35rem; align-items: flex-end; }
.review-form input { width: 170px; font-size: .85rem; padding: .35rem .5rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .92rem;
    font-weight: 500; padding: .5rem 1rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
    background: var(--grey-soft); color: var(--text); text-decoration: none; line-height: 1.3;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; }
.btn-secondary { background: var(--surface); border-color: #cfd5e1; color: var(--text); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: .3rem .65rem; font-size: .83rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .65rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th.right, .table td.right { text-align: right; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #f9fafc; }
.table tbody tr:hover { background: #fafbfd; }
.table tfoot th { border-bottom: 0; }
.table.compact th, .table.compact td { padding: .45rem .5rem; }
.table td input, .table td select { min-width: 110px; padding: .35rem .5rem; }
.table tr.is-past td { color: var(--muted); }
.edit-row td { background: var(--primary-soft); }

/* Badges */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-grey { background: var(--grey-soft); color: var(--grey); }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; transition: opacity .6s; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-success { background: var(--green-soft); color: var(--green); border-color: #b9e6cf; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: #f6c5c1; }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: #bcd7f5; }
.alert.fade { opacity: 0; }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Lists and details */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.details { display: grid; grid-template-columns: 160px 1fr; gap: .5rem 1rem; margin: 0; }
.details dt { color: var(--muted); font-size: .9rem; }
.details dd { margin: 0; }
.details.two-col { grid-template-columns: 140px 1fr 140px 1fr; margin-bottom: 1.25rem; }
.meta { display: flex; gap: 2rem; margin: 0 0 1rem; flex-wrap: wrap; }
.meta dt { color: var(--muted); font-size: .82rem; }
.meta dd { margin: 0; font-weight: 600; }
.announcement h3 { margin-bottom: .1rem; }
.announcement + .announcement { border-top: 1px solid var(--border); padding-top: .75rem; }

/* Bars */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: .75rem; margin-bottom: .6rem; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--grey-soft); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bar-value { text-align: right; font-weight: 600; }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

/* Pagination */
.pagination { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a { padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: .88rem; }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .gap { padding: .3rem .4rem; color: var(--muted); }

/* Payslip */
.payslip { max-width: 900px; }
.payslip-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--text); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.payslip-head h2, .payslip-head h3 { margin-bottom: .25rem; }
.net-pay { display: flex; justify-content: space-between; align-items: center; background: var(--primary-soft); border-radius: 8px; padding: 1rem 1.25rem; margin: 1.25rem 0; font-size: 1.1rem; }
.net-pay strong { font-size: 1.5rem; color: var(--primary-dark); }

/* Auth and installer */
.auth-body { display: flex; align-items: flex-start; justify-content: center; min-height: 100vh; padding: 3rem 1rem; background: linear-gradient(160deg, #eef2fb 0%, #f7f8fb 100%); }
.auth-card, .install-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08); padding: 2rem; width: 100%; }
.auth-card { max-width: 420px; margin-top: 4vh; }
.install-card { max-width: 760px; }
.install-card h2 { margin-top: 1.75rem; font-size: 1.05rem; }
.install-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.5rem; }
.install-head h1 { margin: 0; }
.install-head p { margin: 0; }
.install-head .brand-mark { width: 44px; height: 44px; font-size: 1.3rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { padding: .35rem 0; }
.checklist .ok { color: var(--green); }
.checklist .fail { color: var(--red); font-weight: 600; }

/* Recruitment */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.pipeline-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; color: var(--text); box-shadow: var(--shadow); }
.pipeline-step:hover { text-decoration: none; border-color: var(--primary); }
.pipeline-step.active { border-color: var(--primary); background: var(--primary-soft); }
.pipeline-step .stat-value { font-size: 1.35rem; }
.prose { line-height: 1.65; margin-bottom: 1rem; overflow-wrap: anywhere; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Public careers pages */
.public-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.public-inner { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.public-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.public-header .public-inner { display: flex; align-items: center; justify-content: space-between; padding-top: .8rem; padding-bottom: .8rem; }
.public-brand { display: flex; align-items: center; gap: .65rem; font-weight: 600; font-size: 1.05rem; color: var(--text); }
.public-brand:hover { text-decoration: none; }
.public-main { flex: 1; padding-top: 1.75rem; padding-bottom: 2.5rem; }
.public-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; padding: 1.1rem 0; background: var(--surface); }
.hero { background: linear-gradient(135deg, var(--primary) 0%, #5b3fd6 100%); color: #fff; border-radius: 14px; padding: 2.25rem 2rem; margin-bottom: 1.5rem; }
.hero h1 { font-size: 1.9rem; margin-bottom: .5rem; }
.hero p { margin: 0; opacity: .92; max-width: 620px; font-size: 1.05rem; }
.careers-filters { margin-bottom: 1rem; }
.careers-filters input[type="search"] { flex: 1; min-width: 240px; }
.job-list { display: flex; flex-direction: column; gap: .85rem; }
.job-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--text); margin: 0; transition: border-color .15s, box-shadow .15s; }
.job-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 4px 14px rgba(47, 91, 234, .12); }
.job-card h2 { margin-bottom: .4rem; color: var(--primary-dark); }
.job-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex-shrink: 0; }
.job-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.job-card .job-tags { margin: 0; }
.job-tags span { background: var(--grey-soft); color: var(--grey); border-radius: 999px; padding: .15rem .65rem; font-size: .82rem; }
.job-detail h1 { font-size: 1.6rem; }
.job-detail h2 { margin-top: 1.25rem; }
.job-detail #apply h2 { margin-top: 0; }
.thank-you { max-width: 640px; margin: 1rem auto; text-align: center; padding: 2.5rem 2rem; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* Portals */
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.portal-label { color: #7f8aa3; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.portal-switch { display: block; margin: 1.25rem .5rem 0; padding: .55rem .7rem; border: 1px dashed rgba(255, 255, 255, .2); border-radius: 8px; color: var(--sidebar-text); font-size: .85rem; }
.portal-switch:hover { color: #fff; text-decoration: none; border-color: rgba(255, 255, 255, .45); }
.portal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.public-links { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.public-links a:not(.btn) { color: var(--muted); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem 1rem; margin-bottom: .5rem; }
.stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.feedback { margin: .5rem 0 1rem; padding: .6rem .9rem; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 8px 8px 0; }
input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* Responsive */
@media (max-width: 1100px) {
    .grid-sidebar { grid-template-columns: 1fr; }
    .stats, .stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: none; box-shadow: 4px 0 20px rgba(0, 0, 0, .25); }
    .menu-toggle { display: inline-flex; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .user-meta { display: none; }
    .content { padding: 1rem; }
    .topbar { padding: .7rem 1rem; }
    .details, .details.two-col { grid-template-columns: 130px 1fr; }
    .filters input[type="search"] { min-width: 0; width: 100%; }
    .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .job-card { flex-direction: column; align-items: flex-start; }
    .job-card-side { align-items: flex-start; }
    .hero { padding: 1.5rem 1.25rem; }
    .hero h1 { font-size: 1.5rem; }
    .public-links a:not(.btn) { display: none; }
}

/* Print */
@media print {
    .sidebar, .topbar, .footer, .no-print, .alert { display: none !important; }
    body, .content { background: #fff; padding: 0; }
    .card { box-shadow: none; border: 0; padding: 0; }
    .net-pay { border: 1px solid #000; }
}
