/* Remote Opus HR portal — shared design system (matches the payslip brand) */
@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --green: #1A4731;
  --green-2: #0F2318;
  --green-soft: #E8F5EE;
  --rule: #2E7D52;
  --ink: #1f2933;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e7eaed;
  --line-soft: #eef1f3;
  --surface: #ffffff;
  --plane: #f6f8f7;
  --good: #0b7a3d;
  --bad: #c0392b;
  --warn: #e0a400;
  --shadow: 0 1px 2px rgba(16,32,24,.04), 0 4px 16px rgba(16,32,24,.05);
}
body.dark {
  --green-soft: #1e352b;
  --ink: #e7ebe9;
  --ink-2: #aeb6b2;
  --muted: #859089;
  --line: #29342e;
  --line-soft: #202a25;
  --surface: #18221d;
  --plane: #0f1613;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.35);
}
body.dark .st.active { background: #12281c; color: #5fd48a; }
body.dark .st.project { background: #16233a; color: #82b4ff; }
body.dark .st.other { background: #232b27; color: var(--ink-2); }
body.dark .lv-new { background: #16233a; color: #82b4ff; }
body.dark .lv-mid { background: #2c2510; color: #e2b45c; }
body.dark .lv-senior { background: #1e352b; color: #6ee7a8; }
body.dark input, body.dark textarea, body.dark select { background: #0f1613; color: var(--ink); border-color: var(--line); }
body.dark .bar2 .t, body.dark .bar-track, body.dark .bar-track { background: #222a27; }
.sidebar .foot .theme-toggle { width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #cfe0d9; border-radius: 9px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sidebar .foot .theme-toggle:hover { background: rgba(255,255,255,.15); }
.sidebar .foot .punch-status { font-size: 11px; color: #cfe0d9; margin-bottom: 7px; font-weight: 600; }
.sidebar .foot .punch-sb { width: 100%; background: #fff; color: var(--green); border: none; border-radius: 9px;
  padding: 10px 12px; font-size: 13px; font-weight: 700; margin-bottom: 8px; cursor: pointer; }
.sidebar .foot .punch-sb.out { background: #f4c86b; color: #5a4300; }
.sidebar .foot .punch-sb:hover { filter: brightness(.95); }
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
/* File inputs specifically must NOT use display:none (via [hidden] or this
   class) to stay invisible: Chrome opens the native file picker fine either
   way, but silently refuses to attach the chosen file(s) to an input that
   isn't actually in the render tree - the change/input events never carry
   any files, so nothing happens. This keeps it invisible without display:none. */
input[type="file"].file-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html, body { height: 100%; }
body {
  font-family: "Source Sans 3", system-ui, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--plane); font-size: 14px; line-height: 1.45;
}
.serif { font-family: "DM Serif Display", Georgia, serif; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--green); color: #dfeae5; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 20px; }
.sidebar .brand .name { font-size: 21px; font-weight: 700; color: #fff; }
.sidebar .brand .tag { font-size: 11px; color: #9dc2b3; margin-top: 1px; }
.sidebar .user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .user .avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--green);
  font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; }
.sidebar .user .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sidebar .user .uname { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; }
.sidebar .user .urole { color: #9dc2b3; font-size: 11px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: #cfe0d9; font-weight: 500; font-size: 14px; transition: background .12s, color .12s; }
.nav a .ico { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: #fff; color: var(--green); font-weight: 600; }
.nav a.active .ico { opacity: 1; }
.nav .soon { margin-left: auto; font-size: 9px; letter-spacing: .5px; text-transform: uppercase;
  color: #9dc2b3; border: 1px solid #3a6b58; border-radius: 20px; padding: 1px 6px; }
/* a message needs to go out but nothing's connected to send it - see layout.js */
.nav .navalert { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #ff6b5e; flex: 0 0 auto; }
/* collapsible nav group (e.g. Team → Scorecards/Tasks/Attendance/…) */
.nav .group { display: flex; flex-direction: column; }
.nav .parent { display: flex; align-items: center; gap: 2px; }
.nav .parent > a { flex: 1; min-width: 0; }
.nav .twist { flex-shrink: 0; background: none; border: none; color: #9dc2b3; cursor: pointer;
  padding: 8px; border-radius: 8px; display: flex; align-items: center; }
.nav .twist:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav .twist svg { width: 13px; height: 13px; transition: transform .16s ease; }
.nav .group.open .twist svg { transform: rotate(90deg); }
.nav .children { display: flex; flex-direction: column; gap: 2px; margin: 3px 0 6px 21px;
  padding-left: 10px; border-left: 1px solid rgba(255,255,255,.13); }
.nav .group:not(.open) .children { display: none; }
.nav .children a { padding: 8px 11px; font-size: 13px; }
.nav .children a .ico { width: 16px; height: 16px; }
.nav .parent > a.branch { color: #fff; }
.sidebar .foot { margin-top: auto; padding-top: 16px; font-size: 11px; color: #82a99a; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
#topbar-actions { display: flex; gap: 8px; align-items: center; }
#topbar-actions select { width: auto; display: inline-block; padding: 7px 10px; font-size: 13px; }
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.content { padding: 24px 28px 60px; }

/* hamburger button that opens the sidebar as a drawer — hidden on desktop,
   shown by the mobile breakpoint below */
.menu-btn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px;
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; margin-right: 2px; }
.menu-btn svg { width: 19px; height: 19px; }
.menu-btn:hover { border-color: var(--rule); color: var(--green); }

/* ---------- mobile: sidebar becomes a drawer, spacing tightens, targets grow ---------- */
@media (max-width: 880px) {
  .layout { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; max-width: 84vw; z-index: 70;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,16,13,.5); z-index: 65; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; row-gap: 10px; }
  #topbar-actions { flex-wrap: wrap; }
  .content { padding: 14px 12px 40px; }
  .topbar h1 { font-size: 18px; }

  /* touch targets: bigger tap area, and 16px inputs so iOS doesn't zoom on focus */
  .btn { min-height: 42px; padding: 10px 16px; }
  .btn.sm { min-height: 36px; }
  .iconbtn { min-height: 34px; padding: 6px 10px; }
  input, textarea, select { font-size: 16px; padding: 10px 12px; }

  /* stat tiles: 2-up instead of cramming per the desktop minmax */
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 12px 13px; }
  .tile .v { font-size: 22px; }

  .tasks-cols { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 20px; background: var(--green-soft); color: var(--green); }
.pill.gray { background: #eef1f3; color: var(--ink-2); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--green); background: var(--green); color: #fff; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--green-2); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fff; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green-soft); border-color: var(--rule); }
label { font-size: 12px; color: var(--ink-2); font-weight: 600; }

.grid { display: grid; gap: 16px; }
/* grid/flex items default to a content-based min-width, so a wide row (e.g. a
   button bar or table) inside a grid cell can silently push the whole page
   wider than the viewport instead of wrapping/scrolling in place. */
.grid > * { min-width: 0; }
/* wrap any data table in this so IT scrolls sideways on a narrow screen instead
   of forcing the whole page wider than the viewport */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.muted { color: var(--muted); }
.tabnum { font-variant-numeric: tabular-nums; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; box-shadow: var(--shadow); }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 27px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.tile .d { font-size: 12px; font-weight: 600; margin-top: 2px; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--muted); }

/* empty-state for stub pages */
.stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 80px 20px; color: var(--muted); }
.stub .big { font-size: 22px; color: var(--ink); font-weight: 700; }
.stub .badge { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--green);
  background: var(--green-soft); padding: 4px 12px; border-radius: 20px; font-weight: 700; }

/* must-change-password banner */
.mustchange { background: #fff8e6; border: 1px solid #f0dca0; color: #7a5b00; border-radius: 11px;
  padding: 11px 15px; font-size: 13.5px; font-weight: 500; margin-bottom: 18px; }
body.dark .mustchange { background: #2c2510; border-color: #4a3d12; color: #e2b45c; }
.mustchange a { color: var(--green); font-weight: 700; }
.imp-banner { display: flex; align-items: center; gap: 12px; background: #eaf1ff; border: 1px solid #b9ceff; color: #20437d;
  border-radius: 11px; padding: 10px 15px; font-size: 13.5px; font-weight: 500; margin-bottom: 18px; }
.imp-banner button { margin-left: auto; background: #20437d; color: #fff; border: none; border-radius: 8px; padding: 7px 13px; font-weight: 600; font-size: 13px; }
.imp-banner button:hover { background: #163258; }
body.dark .imp-banner { background: #16233a; border-color: #2a3f66; color: #a9c6ff; }
/* incomplete-profile nudge: for the EMPLOYEE, on their own portal, every page */
.profile-bar { display: flex; align-items: center; gap: 12px; background: #fdecea; border: 1px solid #f3c4bc; color: #7a231a;
  border-radius: 11px; padding: 10px 15px; font-size: 13.5px; font-weight: 500; margin-bottom: 18px; }
.profile-bar a { margin-left: auto; background: #c0392b; color: #fff; border: none; border-radius: 8px; padding: 7px 13px;
  font-weight: 600; font-size: 13px; white-space: nowrap; }
.profile-bar a:hover { background: #a5301f; }
body.dark .profile-bar { background: #3a1f1c; border-color: #5c342c; color: #f4a99c; }

/* priority + status chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; text-transform: capitalize; }
.chip.p-high { background: #fdecea; color: #c0392b; } .chip.p-normal { background: var(--green-soft); color: var(--green); } .chip.p-low { background: #eef1f3; color: var(--ink-2); }
.chip.s-todo { background: #eef1f3; color: var(--ink-2); } .chip.s-doing { background: #e7f0ff; color: #2563c9; } .chip.s-done { background: #e5f6ec; color: var(--good); }
body.dark .chip.p-high { background: #3a1f1c; } body.dark .chip.s-doing { background: #16233a; color: #82b4ff; } body.dark .chip.s-done { background: #12281c; color: #5fd48a; }

/* task cards */
.tasks-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.tcol { background: var(--plane); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tcol h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--shadow); }
.tcard .tt { font-weight: 600; font-size: 14px; }
.tcard .tn { color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: pre-wrap; }
.tcard .tmeta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tcard .tmeta .due { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tcard .tmeta .due.over { color: var(--bad); }
.tcard .acts { display: flex; gap: 6px; margin-left: auto; }
.iconbtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.iconbtn:hover { border-color: var(--rule); color: var(--green); }
.iconbtn.danger:hover { border-color: var(--bad); color: var(--bad); }

/* leaderboard podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 22px; }
.spot { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 14px; text-align: center; box-shadow: var(--shadow); }
.spot.first { border-color: #e7c66b; box-shadow: 0 8px 26px rgba(206,163,58,.22); }
.spot .medal { font-size: 26px; } .spot.first .medal { font-size: 34px; }
.spot .rk { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.spot .nm { font-weight: 700; font-size: 15px; margin-top: 6px; }
.spot .rl { color: var(--muted); font-size: 12px; }
.spot .sc { font-size: 26px; font-weight: 800; color: var(--green); margin-top: 8px; letter-spacing: -.5px; }
.spot .sc small { font-size: 12px; color: var(--muted); font-weight: 600; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line-soft); }
.rank-row .no { width: 26px; text-align: center; font-weight: 800; color: var(--muted); }
.rank-row .who { font-weight: 600; } .rank-row .who small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.rank-row .kp { margin-left: auto; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.rank-row .dl { font-size: 12px; font-weight: 700; width: 44px; text-align: right; }
.rank-row.me { background: var(--green-soft); border-radius: 10px; }

/* announcements / events feed */
.feed { display: grid; gap: 12px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; box-shadow: var(--shadow); }
.post.pinned { border-color: var(--rule); }
.post .ph { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; flex-wrap: wrap; }
.post .ph .type { font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.post .ph .type.event { background: #e7f0ff; color: #2563c9; } .post .ph .type.announcement { background: var(--green-soft); color: var(--green); }
body.dark .post .ph .type.event { background: #16233a; color: #82b4ff; }
.post .ph .when { color: var(--muted); font-size: 12px; margin-left: auto; }
.post h3 { font-size: 16px; margin-bottom: 4px; }
.post .bd { color: var(--ink-2); font-size: 13.5px; white-space: pre-wrap; line-height: 1.55; }
.post .ev { margin-top: 9px; font-size: 12.5px; font-weight: 600; color: var(--green); display: flex; gap: 14px; flex-wrap: wrap; }

/* toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--bad); }

/* ---- scrolling news ticker (employee portal) ---- */
.ticker { overflow: hidden; background: linear-gradient(120deg, var(--green-2), var(--green)); color: #fff;
  padding: 9px 0; position: sticky; top: 0; z-index: 60; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.ticker-track { display: flex; width: max-content; animation: roTick 30s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker .grp { display: flex; gap: 56px; padding-right: 56px; align-items: center; }
.ticker .it { font-size: 13px; white-space: nowrap; opacity: .95; }
.ticker .it b { font-weight: 800; }
.ticker .it a { color: #fff; text-decoration: underline; font-weight: 700; }
@keyframes roTick { to { transform: translateX(-50%); } }

/* ---- national ID card: number + front/back scans (admin editors + self-service) ---- */
.idc-row { display: flex; gap: 14px; flex-wrap: wrap; }
.idc-slot { flex: 1 1 210px; min-width: 190px; }
.idc-lab { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.idc-prev { position: relative; display: flex; align-items: center; justify-content: center; height: 120px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--green-soft); overflow: hidden;
  color: var(--muted); font-size: 11.5px; text-align: center; }
.idc-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.idc-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.idc-btns .lk { border: 1px solid var(--line); background: none; border-radius: 8px; padding: 5px 10px;
  font-weight: 600; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.idc-btns .lk:hover { border-color: var(--green); color: var(--green); }
.idc-btns .rm { color: var(--bad); }
.idc-btns .rm:hover { border-color: var(--bad); color: var(--bad); }
.idc-hint { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
input.idc-num { letter-spacing: .4px; font-variant-numeric: tabular-nums; }
/* read-only view (profile page) */
.idc-view { display: flex; gap: 12px; flex-wrap: wrap; }
.idc-view a { flex: 1 1 190px; min-width: 170px; display: block; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--green-soft); text-decoration: none; }
.idc-view img { display: block; width: 100%; height: 130px; object-fit: contain; background: var(--surface); }
.idc-view .cap { font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding: 6px 9px; }
.idc-none { color: var(--muted); font-size: 12.5px; }
