:root {
  --navy: #0b1530; --navy-2: #121f44; --blue: #3D7BFF; --teal: #22D3B6; --grad: linear-gradient(135deg, #3D7BFF, #22D3B6);
  --bg: #f4f6fb; --card: #ffffff; --line: #e4e8f1; --line-2: #eef1f7; --ink: #101828; --ink-2: #475467; --ink-3: #8a94a8;
  --ok: #12b76a; --ok-bg: #ecfdf3; --warn: #f79009; --warn-bg: #fffaeb; --bad: #f04438; --bad-bg: #fef3f2; --info-bg: #eef4ff;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06); --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: 'Sora', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
.muted { color: var(--ink-2); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; color: var(--ink-3); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }

.boot { height: 100vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--ink-2); }
.boot img { width: 44px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: #c9d1e1; background: #fafbfd; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #2f6bef; }
.btn.grad { background: var(--grad); border: 0; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld > span em { font-style: normal; color: var(--bad); }
.fld .hint { font-size: 11.5px; color: var(--ink-3); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 9px 11px; outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 123, 255, .15); }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 15px; }
.card-b { padding: 20px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.issued, .badge.Active, .badge.on { background: var(--ok-bg); color: #027a48; }
.badge.draft, .badge.Candidate { background: var(--info-bg); color: #3538cd; }
.badge.issuing, .badge.Notice, .badge.superseded { background: var(--warn-bg); color: #b54708; }
.badge.revoked, .badge.Exited, .badge.off { background: var(--bad-bg); color: #b42318; }
.badge.superadmin { background: #f4ebff; color: #6941c6; } .badge.hr { background: var(--info-bg); color: #3538cd; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; inset: auto -20% -40% auto; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(61, 123, 255, .35), transparent 65%); }
.auth-side h1 { font-size: 34px; line-height: 1.2; max-width: 460px; }
.auth-side p { color: #b9c3dc; max-width: 440px; }
.auth-eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; }
.auth-stats { display: flex; gap: 36px; margin-top: 34px; position: relative; z-index: 1; }
.auth-stats b { display: block; font: 700 28px var(--display); color: #fff; }
.auth-stats span { font-size: 12.5px; color: #8c99bd; }
.auth-awards { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; position: relative; z-index: 1; }
.award { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid #253462; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.award svg { color: var(--teal); width: 22px; height: 22px; }
.award b { display: block; font-size: 13px; color: #fff; } .award span { font-size: 11.5px; color: #8c99bd; }
.auth-mobile { display: none; }
.auth-mobile-awards { font-size: 11.5px; line-height: 1.5; color: var(--ink-2); font-weight: 500; }
.auth-points { display: grid; gap: 12px; margin-top: 28px; position: relative; z-index: 1; }
.auth-points div { display: flex; gap: 10px; align-items: flex-start; color: #d6ddee; font-size: 13.5px; }
.auth-points svg { color: var(--teal); margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.tabs { display: flex; background: var(--line-2); border-radius: 11px; padding: 4px; gap: 4px; margin: 22px 0 18px; }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.brand-row { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 18px; color: inherit; }
.brand-row img { width: 30px; }
.brand-row b { color: var(--blue); }
.auth-side .brand-row b { color: #7aa5ff; }
.err { background: var(--bad-bg); color: #b42318; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.note { background: var(--info-bg); color: #3538cd; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.note.warn { background: var(--warn-bg); color: #93370d; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c8d1e8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
.side .brand-row { color: #fff; padding: 4px 10px 18px; font-size: 16px; }
.side .brand-row small { display: block; font: 500 11px var(--font); color: #8c99bd; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sep { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f7ca3; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #c8d1e8; font-weight: 500; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(61, 123, 255, .28), rgba(61, 123, 255, .08)); color: #fff; }
.nav a.on svg { color: #7aa5ff; }
.side-foot { margin-top: auto; border-top: 1px solid #1d2a52; padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 11.5px; color: #8c99bd; }
.side-foot .btn { color: #c8d1e8; }
.side-foot .btn:hover { background: var(--navy-2); }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(244, 246, 251, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 { font-size: 19px; }
.topbar .crumb { font-size: 12px; color: var(--ink-3); }
.content { padding: 24px 28px 48px; max-width: 1400px; }
.menu-btn { display: none; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--blue); }
.kpi b { display: block; font: 700 28px var(--display); margin-top: 8px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qa { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; transition: .15s; }
.qa:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.qa .k-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; }
.qa b { display: block; font-size: 13.5px; } .qa span { font-size: 12px; color: var(--ink-3); }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-top: 20px; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fafbff; }
.tbl .r { text-align: right; } .tbl .nowrap { white-space: nowrap; }
.tbl input { padding: 6px 8px; height: 32px; }
.cell-main b { display: block; font-weight: 600; } .cell-main span { font-size: 12px; color: var(--ink-3); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty svg { width: 36px; height: 36px; color: var(--ink-3); margin-bottom: 8px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.filters input, .filters select { width: auto; min-width: 160px; height: 36px; padding: 6px 10px; }
.filters .grow { flex: 1; min-width: 220px; }

/* ---------- Template picker ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tpl-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: .15s; }
.tpl-card:hover { border-color: var(--blue); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tpl-card .k-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--info-bg); color: var(--blue); }
.tpl-card b { font-size: 14.5px; } .tpl-card p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.tpl-card .tiny { margin-top: auto; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
.editor > div { min-width: 0; }
.ed-form { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 4px; }
.ed-group h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.para { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.para + .para { margin-top: 10px; }
.para-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.para textarea { border: 0; border-radius: 0 0 10px 10px; min-height: 92px; }
.para textarea:focus { box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px dashed #b8c4dc; background: #f7f9fd; color: var(--ink-2); border-radius: 7px; padding: 3px 8px; font: 500 11.5px ui-monospace, Consolas, monospace; cursor: pointer; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.preview { background: #e9edf5; border-radius: 14px; border: 1px solid var(--line); padding: 20px; min-height: 400px; overflow: hidden; }
.preview-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.preview-pages .page { box-shadow: 0 6px 24px rgba(16, 24, 40, .16); }
.issues { display: flex; flex-direction: column; gap: 6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.facts dt { color: var(--ink-3); } .facts dd { margin: 0; font-weight: 500; word-break: break-all; }

/* ---------- Modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11, 21, 48, .48); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-h { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { font-size: 17px; }
.modal-b { padding: 16px 22px; overflow: auto; }
.modal-f { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line-2); }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; transition: .4s; border-left: 4px solid var(--teal); }
.toast.bad { border-left-color: var(--bad); } .toast.out { opacity: 0; transform: translateY(8px); }
.secret { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 14px; font: 600 15px ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--grad); width: 0; transition: width .3s; }

/* ---------- Employee portal ---------- */
.portal-top { background: var(--navy); color: #fff; }
.portal-top .in { max-width: 1040px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-top .btn { background: transparent; color: #fff; border-color: #2a3866; }
.portal-hero { background: linear-gradient(180deg, var(--navy), #18295a); color: #fff; padding: 8px 0 72px; }
.portal-hero .in { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.portal-hero h1 { font-size: 26px; } .portal-hero p { color: #b9c3dc; margin: 6px 0 0; }
.portal-body { max-width: 1040px; margin: -48px auto 40px; padding: 0 24px; display: flex; flex-direction: column; gap: 18px; }
.doc-list { display: flex; flex-direction: column; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.doc-item:last-child { border-bottom: 0; }
.doc-item .k-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--blue); flex: none; }
.doc-item .t { flex: 1; min-width: 0; } .doc-item .t b { display: block; } .doc-item .t span { font-size: 12px; color: var(--ink-3); }
.year-h { padding: 10px 20px; background: #fafbfd; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; border-bottom: 1px solid var(--line-2); }

/* ---------- Verify page ---------- */
.verify-body { background: var(--bg); }
.verify { max-width: 520px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 16px; }
.verify h1 { font-size: 28px; }
.verify form { display: flex; flex-direction: column; gap: 14px; }
.v-ok { border-left: 5px solid var(--ok); } .v-ok h2 { color: #027a48; }
.v-warn { border-left: 5px solid var(--warn); } .v-warn h2 { color: #b54708; }
.v-bad { border-left: 5px solid var(--bad); } .v-bad h2 { color: #b42318; }
.v-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; } .v-dl dt { color: var(--ink-3); } .v-dl dd { margin: 0; font-weight: 600; }

/* ---------- A4 document pages (rendered for preview and PDF) ---------- */
#measure, #render-root { position: fixed; left: -12000px; top: 0; pointer-events: none; }
.page { width: 794px; height: 1123px; background: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; color: #1f2937; font-family: var(--font); font-size: 12.5px; line-height: 1.62; flex: none; }
.pg-strip { height: 6px; background: linear-gradient(90deg, #3D7BFF, #22D3B6); flex: none; }
.pg-strip-b { height: 4px; }
.pg-wm { position: absolute; width: 420px; left: 187px; top: 360px; opacity: .035; }
.pg-mark { position: absolute; left: 0; right: 0; top: 470px; text-align: center; font: 800 150px var(--display); color: rgba(240, 68, 56, .09); transform: rotate(-28deg); letter-spacing: .08em; }
.pg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 26px 56px 18px; border-bottom: 1px solid #e5e9f2; margin: 0 0 0; flex: none; }
.pg-brand { display: flex; align-items: center; gap: 12px; }
.pg-brand img { width: 46px; height: 46px; }
.pg-word { font: 700 22px var(--display); color: #0b1530; letter-spacing: -.01em; }
.pg-word b { color: #3D7BFF; }
.pg-tag { font-size: 10.5px; color: #6b7280; letter-spacing: .06em; text-transform: uppercase; }
.pg-addr { text-align: right; font-size: 10px; line-height: 1.55; color: #4b5563; max-width: 330px; }
.pg-addr b { color: #0b1530; }
.pg-body { flex: 1; overflow: hidden; padding: 24px 56px 8px; position: relative; }
.pg-body .it { position: relative; }
.pg-foot { display: flex; align-items: center; gap: 14px; padding: 12px 56px 14px; border-top: 1px solid #e5e9f2; flex: none; }
.pg-qr { width: 58px; height: 58px; image-rendering: pixelated; }
.pg-fnote { flex: 1; font-size: 8.6px; line-height: 1.5; color: #6b7280; }
.pg-fnote b { color: #374151; }
.pg-num { font-size: 9px; color: #6b7280; white-space: nowrap; }
.d-title { font: 700 16px var(--display); text-align: center; letter-spacing: .12em; color: #0b1530; margin: 4px 0 14px; }
.d-ref { display: flex; justify-content: space-between; font-size: 11.5px; color: #374151; margin-bottom: 18px; }
.d-to { margin-bottom: 14px; }
.d-twimc { text-align: center; font-weight: 700; letter-spacing: .08em; text-decoration: underline; margin: 6px 0 18px; }
.d-subj { margin: 0 0 12px; }
.pg-body p { margin: 0 0 11px; text-align: justify; }
.d-close { margin-top: 18px; }
.d-sign { margin-top: 8px; }
.d-sig { height: 54px; max-width: 200px; object-fit: contain; display: block; margin: 8px 0 4px; }
.d-sig-gap { height: 30px; }
.d-sname { font-weight: 700; color: #0b1530; } .d-stitle { color: #4b5563; font-size: 11.5px; }
.d-h2 { font: 700 15px var(--display); color: #0b1530; margin: 4px 0 8px; }
.d-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 11.5px; color: #374151; margin-bottom: 14px; }
.d-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 11.5px; }
.d-table th { background: #0b1530; color: #fff; text-align: left; padding: 8px 10px; font-weight: 600; }
.d-table td { padding: 7px 10px; border-bottom: 1px solid #e5e9f2; }
.d-table tr:nth-child(even) td { background: #f8fafc; }
.d-table tr.tot td { background: #eef4ff !important; font-weight: 700; color: #0b1530; }
.d-table .r { text-align: right; }
.d-notes { margin: 0 0 16px; padding-left: 18px; font-size: 11px; color: #4b5563; } .d-notes li { margin-bottom: 3px; }
.d-accept { border: 1px solid #dbe3f0; border-radius: 10px; padding: 14px 16px; }
.d-accept h3 { font: 700 13px var(--display); margin-bottom: 6px; color: #0b1530; }
.d-sigrow { display: flex; gap: 24px; margin-top: 26px; }
.d-sigrow div { flex: 1; font-size: 11px; color: #6b7280; } .d-sigrow span { display: block; border-top: 1px solid #9ca3af; margin-bottom: 4px; }
.ph-miss { background: #fee4e2; color: #b42318; border-radius: 3px; padding: 0 2px; }
.p-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; border: 1px solid #e5e9f2; border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; }
.p-grid div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #edf0f6; font-size: 11.5px; }
.p-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.p-grid span { color: #6b7280; } .p-grid b { color: #111827; font-weight: 600; text-align: right; }
.p-table th:nth-child(3) { border-left: 2px solid #fff; } .p-table td:nth-child(3) { border-left: 1px solid #e5e9f2; }
.p-net { background: linear-gradient(135deg, #0b1530, #18295a); color: #fff; border-radius: 12px; padding: 16px 20px; margin: 4px 0 16px; }
.p-net div { display: flex; justify-content: space-between; align-items: baseline; }
.p-net span { color: #b9c3dc; font-size: 12px; } .p-net b { font: 700 22px var(--display); }
.p-net p { margin: 4px 0 0 !important; color: #d6ddee; font-size: 11.5px; text-align: left !important; }
.p-note { font-size: 10.5px; color: #6b7280; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .editor { grid-template-columns: 1fr; } .ed-form { position: static; max-height: none; } .kpis, .quick { grid-template-columns: repeat(2, 1fr); } .two-col { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; } .auth-side { display: none; }
  .auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
  .auth-mobile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 260px; left: -270px; transition: left .2s; }
  .shell.nav-open .side { left: 0; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px 40px; } .topbar { padding: 12px 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .kpis, .quick { grid-template-columns: 1fr 1fr; }
  .doc-item { flex-wrap: wrap; }
}

/* ---------- People module ---------- */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.big { font: 700 22px var(--display); display: block; }
.clock-card { display: flex; flex-direction: column; gap: 16px; }
.clock-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: var(--line-2); border-radius: 12px; padding: 12px; }
.clock-times span { display: block; font-size: 11.5px; color: var(--ink-3); } .clock-times b { font: 700 18px var(--display); }
.bal { margin-bottom: 12px; } .bal .progress { margin-top: 6px; height: 6px; }
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.bal-grid .big { margin: 4px 0; font-size: 28px; }
.pay-hi { background: linear-gradient(135deg, var(--navy), #18295a); color: #fff; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.pay-hi span { display: block; color: #b9c3dc; font-size: 12px; } .pay-hi b { font: 700 24px var(--display); }
.ann { padding: 14px 20px; border-bottom: 1px solid var(--line-2); } .ann:last-child { border-bottom: 0; } .ann p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.ann-card h3 { font-size: 16px; } .ann-card p { color: var(--ink-2); margin: 10px 0; }
.pin { width: 15px !important; height: 15px !important; color: var(--blue); margin-right: 6px; vertical-align: -2px; }
.date-ico { flex-direction: column; line-height: 1.05; gap: 0; } .date-ico b { font: 700 15px var(--display); } .date-ico span { font-size: 10px; text-transform: uppercase; }
.doc-item.past { opacity: .5; }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-align: center; padding-bottom: 6px; }
.cal-cell { min-height: 74px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.cal-cell b { font-size: 13px; } .cal-cell span { font-size: 10.5px; color: var(--ink-2); line-height: 1.3; }
.cal-cell.empty { border: 0; background: transparent; }
.cal-cell.present { background: var(--ok-bg); border-color: #abefc6; } .cal-cell.leave { background: var(--info-bg); border-color: #c7d7fe; }
.cal-cell.holiday { background: #fdf2fa; border-color: #fcceee; } .cal-cell.weekend { background: #fafbfd; } .cal-cell.weekend span { color: var(--ink-3); }
.cal-cell.absent { background: var(--bad-bg); border-color: #fecdca; } .cal-cell.today { outline: 2px solid var(--blue); outline-offset: 1px; }
.cal-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.cal-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cal-legend .present::before { background: #abefc6; } .cal-legend .leave::before { background: #c7d7fe; } .cal-legend .holiday::before { background: #fcceee; } .cal-legend .absent::before { background: #fecdca; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; margin-top: 14px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar div { width: 100%; max-width: 46px; background: var(--grad); border-radius: 8px 8px 3px 3px; }
.bar span { font-size: 11px; color: var(--ink-3); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px; }
.person { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.person > div:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .person span { font-size: 12.5px; color: var(--ink-2); }
.person a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow: auto; padding: 4px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; background: var(--line-2); font-size: 13.5px; }
.msg.hr { align-self: flex-start; background: var(--info-bg); } .msg.me { align-self: flex-end; background: #f2f4f7; }
.msg .tiny { margin-bottom: 4px; }
@media (max-width: 1180px) { .home-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 52px; padding: 5px; } .cal-cell span { display: none; }
  .bars { gap: 4px; }
}

/* Holiday year calendar */
.hol-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.year-cal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
.mini b { font-size: 12.5px; display: block; margin-bottom: 6px; }
.mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-g i { font-style: normal; font-size: 9.5px; color: var(--ink-3); }
.mini-g span { font-size: 11px; line-height: 22px; border-radius: 6px; color: var(--ink); }
.mini-g span.we { color: var(--ink-3); }
.mini-g span.hol { background: #e31b54; color: #fff; font-weight: 700; cursor: help; }
.mini-g span.now { outline: 2px solid var(--blue); outline-offset: -2px; }
.cal-legend .wkend::before { background: #e4e7ec; }
.cal-legend .holiday::before { background: #e31b54 !important; }
@media (max-width: 1180px) { .hol-layout { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .year-cal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-g span.wd { background: #12b76a; color: #fff; font-weight: 700; cursor: help; }
.cal-legend .workday::before { background: #12b76a; }
.bal-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.bal-mini div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.bal-mini span { font-size: 12px; color: var(--ink-2); } .bal-mini b { font: 700 20px var(--display); }
