.shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.shell > header { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem;
  background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.shell > header .title { font-weight: 700; font-size: 1.05rem; }
.shell > header .org { opacity: .85; font-size: .85rem; }
.shell > header .logo { width: 46px; height: 46px; border-radius: 8px; padding: 2px; background: #fff; object-fit: contain; }
.shell > header .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.shell > header .chip { background: rgba(255,255,255,.18); color: #fff; }
.shell > header .chip.bad { background: #B3261E; } .shell > header .chip.warn { background: #8A5A00; } .shell > header .chip.ok { background: rgba(255,255,255,.25); }
.shell > nav { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: .5rem 0; height: calc(100vh - 50px); position: sticky; top: 50px; }
.shell > nav .grp { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: .8rem 1rem .25rem; letter-spacing: .05em; }
.shell > nav a { display: flex; justify-content: space-between; padding: .42rem 1rem; color: var(--text); text-decoration: none; border-left: 4px solid transparent; font-size: .92rem; }
.shell > nav a:hover { background: var(--bg); }
.shell > nav a[aria-current=page] { border-left-color: var(--brand); background: var(--okbg); font-weight: 700; }
.shell > nav a .count { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; font-weight: 700; }
main { padding: 1.2rem 1.4rem 3rem; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .shell > nav { position: static; height: auto; } .grid2 { grid-template-columns: 1fr; } }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }
.diffsel td:first-child { width: 2rem; }

/* ---------------------------------------------------------------- paysheet / register documents */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pr-doc { color: #000; background: #fff; font-family: Arial, "Segoe UI", sans-serif; }
.pr-h1 { text-align: center; font-size: 15px; margin: 0 0 2px; }
.pr-h2 { text-align: center; font-size: 12.5px; margin: 4px 0 8px; font-weight: 700; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pr-table th, .pr-table td { border: 1px solid #555; padding: 3px 5px; }
.pr-table thead th { background: #E8F2EB; text-align: center; }
.pr-table tfoot td { font-weight: 700; background: #E8F2EB; }
.pr-table td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-table td.c { text-align: center; }
.pr-info th { text-align: left; background: #F4F7F5; width: 18%; }
.pr-draft { color: #B02A37; font-weight: 700; margin-top: 4px; font-size: 11px; }
.pr-sigs { display: flex; justify-content: space-between; margin-top: 38px; font-size: 11px; font-weight: 700; }
.pr-slip { border: 1px dashed #999; padding: 10px 14px; margin-bottom: 14px; }
.pr-legend { font-size: 9.5px; margin-top: 6px; }
.pr-reg { font-size: 9px; }
.pr-reg th, .pr-reg td { padding: 2px 2px; }
.pr-reg td.nm { white-space: nowrap; text-align: left; }
.pr-reg small { color: #555; }
.rg-a { background: #F8D7DA; } .rg-wo { background: #E9ECEF; } .rg-h { background: #D1E7DD; }
.rg-l { background: #FFF3CD; } .rg-r { background: #FFE5B4; } .rg-ot { background: #CFE2FF; }
.reg-scroll { overflow-x: auto; background: #fff; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius); }
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; }
  body.printing { background: #fff; }
  .pr-break { break-before: page; }
  .pr-break-after { break-after: page; }
  .pr-slip { break-inside: avoid; }
  .pr-table tr { break-inside: avoid; }
  .pr-table thead { display: table-header-group; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* signed-in user: icon + name in the header, with a menu (profile, change password, log out) */
.user-wrap { position: relative; }
.shell > header .user-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; text-align: left; }
.user-btn .u-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--brand); flex: none; }
.user-btn .u-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-btn .u-name { font-weight: 700; font-size: .9rem; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .u-role { font-size: .72rem; opacity: .85; }
.user-btn .u-caret { font-size: .75rem; opacity: .85; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 230px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(0,0,0,.2); padding: .35rem; }
.user-menu[hidden] { display: none; }
.user-menu .um-head { display: flex; flex-direction: column; padding: .55rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.user-menu .um-head span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.user-menu [role=menuitem] { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit;
  padding: .55rem .7rem; border-radius: 8px; cursor: pointer; }
.user-menu [role=menuitem]:hover, .user-menu [role=menuitem]:focus-visible { background: var(--okbg); outline: none; }
@media (max-width: 700px) { .user-btn .u-text { display: none; } .shell > header .user-btn { padding: .3rem; } }

/* My profile page */
.profile-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-top h2 { margin: 0; }
.p-avatar { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--brand), #0E6478); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem 1.2rem; margin: .5rem 0 1rem; }
.kv { display: flex; flex-direction: column; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.kv .k { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.kv .v { font-weight: 600; overflow-wrap: anywhere; }
