/* Silent Savannah HR — stylesheet */
:root {
  --green-900: #1f3d28;
  --green-800: #2f5d3a;
  --green-700: #3a6f47;
  --green-600: #4b7f52;
  --brand: #465b4e;
  --green-100: #e5efe6;
  --sand: #c98a3a;
  --sand-100: #f6ead6;
  --ink: #1c2620;
  --muted: #647067;
  --line: #e2e7e2;
  --bg: #f5f7f4;
  --card: #ffffff;
  --danger: #c0483c;
  --danger-100: #f9e4e1;
  --ok: #3a8f5f;
  --warn: #c98a3a;
  --shadow: 0 1px 2px rgba(20, 40, 25, 0.06), 0 4px 16px rgba(20, 40, 25, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5;
}
a { color: var(--green-700); text-decoration: none; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--green-900), var(--brand) 70%, #38493f); padding: 20px; }
.login-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  width: 100%; max-width: 380px; padding: 30px 32px 26px; text-align: center; }
.login-logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 4px auto 2px; }
.login-card p.sub { color: var(--muted); margin: 2px 0 20px; font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; }
.login-card form { text-align: left; }
.gbtn-wrap { display: flex; justify-content: center; min-height: 44px; margin: 4px 0 4px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0 12px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-foot { margin-top: 18px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); background: var(--green-100);
  padding: 10px 12px; border-radius: var(--radius-sm); }

/* ---------- App launcher ---------- */
.launcher { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 500px at 50% -200px, var(--green-100), var(--bg) 60%); }
.launch-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 34px; background: var(--card); border-bottom: 1px solid var(--line); }
.launch-top .logo { display: flex; align-items: center; gap: 14px; }
.launch-top .logo .brand-full { height: 50px; width: auto; display: block; }
.launch-top .logo .brand-tag { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.launch-body { max-width: 1040px; margin: 0 auto; padding: 52px 24px 70px; width: 100%; }
.launch-hero h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.3px; }
.launch-hero p { margin: 0; font-size: 15px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin-top: 34px; }
.app-card { position: relative; display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: .18s ease; overflow: hidden; }
.app-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--c, var(--green-600)); }
.app-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(20, 40, 25, .16); border-color: var(--c, var(--green-600)); }
.app-ic { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; line-height: 1; }
.app-name { font-size: 19px; font-weight: 700; margin-top: 16px; }
.app-desc { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 36px; }
.app-open { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--c, var(--green-700)); }
.app-open span { transition: .18s; display: inline-block; }
.app-card:hover .app-open span { transform: translateX(4px); }
.app-lvl { position: absolute; top: 16px; right: 16px; font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.applink { display: flex; align-items: center; gap: 8px; color: #a9c3b0; font-size: 12px; padding: 2px 8px 12px; text-decoration: none; }
.applink:hover { color: #fff; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--green-900); color: #dfe9e0; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.sidebar .logo .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--green-600);
  display: grid; place-items: center; font-weight: 800; color: #fff; }
.sidebar .logo b { font-size: 15px; color: #fff; letter-spacing: .2px; }
.sidebar .logo span { display: block; font-size: 11px; color: #9fbfa6; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #cfe0d2; font-weight: 500; font-size: 13.5px; }
.nav a .ic { width: 18px; text-align: center; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.active { background: var(--green-600); color: #fff; }
.nav .group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #789a80;
  padding: 14px 12px 6px; }
.sidebar .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar .foot .foot-logo { width: 132px; height: auto; opacity: .55; display: block; }
.sidebar .foot .foot-email { font-size: 11px; color: #789a80; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 30px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .titlewrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.navToggle { display: none; background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px 8px; margin-right: 2px; flex: none; }
.nav-backdrop { display: none; }
.user { display: flex; align-items: center; gap: 14px; }
.user .user-meta { line-height: 1.25; }
.user .user-name { font-weight: 600; font-size: 13.5px; }
.user .user-email { font-size: 12px; color: var(--muted); }
.user .btn { margin-left: 6px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green-100); color: var(--green-800);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.content { padding: 24px 26px 60px; max-width: 1200px; width: 100%; }

/* ---------- Home ("My Work Today") ---------- */
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; margin-bottom: 8px; }
@media (max-width: 820px) { .home-grid { grid-template-columns: 1fr; } }
.task-line { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-line:last-child { border-bottom: none; }
.task-line .task-main { min-width: 0; }
.task-line .task-status { width: auto; min-width: 130px; flex: none; }
.attn-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; margin: 0 -6px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.attn-row:hover { background: #f6f8f6; }
.notice { background: var(--sand-100); color: #8a5a1a; border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 10px; }
.notice a { color: inherit; font-weight: 700; }

/* ---------- Work board ---------- */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .board { grid-template-columns: 1fr; } }
.board-col { background: #f4f6f4; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 60px; }
.board-col-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 2px 4px 10px; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-bottom: 9px; cursor: pointer; box-shadow: 0 1px 2px rgba(20,30,22,.04); }
.task-card:hover { border-color: #c3cfc5; }
.task-card .tc-title { font-size: 13.5px; margin-bottom: 3px; }
.task-card .tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.task-card .task-status { width: 100%; margin-top: 8px; font-size: 12px; padding: 5px 8px; }

/* ---------- Generic ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cols-2,.cols-3,.cols-4 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: 260px; max-width: 84vw;
    z-index: 60; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 3px 0 22px rgba(0,0,0,.28); }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(20,30,22,.5); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .navToggle { display: inline-flex; align-items: center; }
  .topbar { padding: 12px 14px; }
  .content { padding: 16px 14px 90px; }
  .nav a { padding: 12px 12px; font-size: 15px; }
  .nav .group-label { font-size: 11px; }
  input, select, textarea { font-size: 16px; }   /* stop iOS zooming on focus */
  .btn { padding: 10px 14px; font-size: 14px; }
  .btn.sm { padding: 7px 11px; font-size: 12.5px; }
  .user .user-meta { display: none; }             /* keep the top bar compact */
  .modal-back { place-items: end center; }
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
}

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.section-head h3 { margin: 0; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer;
  font-size: 13px; transition: .12s; }
.btn:hover { border-color: #c8d2c9; }
.btn.primary { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn.primary:hover { background: var(--green-700); }
.btn.sand { background: var(--sand); border-color: var(--sand); color: #fff; }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger-100); }
.btn.danger:hover { background: var(--danger-100); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--green-700); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfa; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.green { background: var(--green-100); color: var(--green-800); }
.badge.sand { background: var(--sand-100); color: #8a5a1a; }
.badge.red { background: var(--danger-100); color: var(--danger); }
.badge.grey { background: #eef1ee; color: var(--muted); }
.badge.blue { background: #e4eef7; color: #2c5c86; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Forms */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px){ .form-grid { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; }
fieldset legend { font-size: 12px; font-weight: 700; color: var(--green-700); padding: 0 6px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; }
.tabs button.active { color: var(--green-700); border-bottom-color: var(--green-600); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(20,30,22,.45); display: grid; place-items: center;
  z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 820px; }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal .m-head h3 { margin: 0; font-size: 16px; }
.modal .m-body { padding: 20px; }
.modal .m-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; background: #fff; }
.x-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }

/* Toast */
#toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 13px;
  box-shadow: var(--shadow); animation: slideup .2s; max-width: 340px; }
.toast.ok { background: var(--green-700); }
.toast.err { background: var(--danger); }
@keyframes slideup { from { transform: translateY(8px); opacity: 0; } }

/* Charts */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bar-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bar-chart .bar { width: 100%; max-width: 34px; background: var(--green-600); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .3s; }
.bar-chart .cap { font-size: 10.5px; color: var(--muted); }
.bar-chart .val { font-size: 10.5px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; }
.hbar { height: 10px; border-radius: 5px; background: var(--green-100); overflow: hidden; }
.hbar > i { display: block; height: 100%; background: var(--green-600); border-radius: 5px; }

.progress-ring { display: inline-grid; place-items: center; }

/* Payslip print */
.payslip { font-size: 13px; }
.payslip .prow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.payslip .ptot { display: flex; justify-content: space-between; padding: 8px 0; font-weight: 700; border-top: 2px solid var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px){ .two-col { grid-template-columns: 1fr; } }

.emp-head { display: flex; align-items: center; gap: 16px; }
.emp-head .big-avatar { width: 60px; height: 60px; border-radius: 14px; background: var(--green-100); color: var(--green-800);
  display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { grid-template-columns: 1fr; } .content { padding: 0; }
  .modal-back { position: static; background: none; } .modal { box-shadow: none; max-height: none; }
}
