/* =========================================================================
   HRM360 — stylesheet
   One file, no build step. Sections, in order:

     1. Tokens (colours, type, sizes)      6. Tables and lists
     2. Base                               7. Forms
     3. App shell (sidebar, topbar)        8. Page pieces (dashboard, profile, salary)
     4. Buttons, badges, alerts            9. Payslip document + print
     5. Panels, dropdown menus            10. Sign-in pages, responsive tweaks

   Palette taken from the ACT360 logo: orange #FF6600 and blue #3399CC.
   The button orange is a shade deeper so white text on it stays readable.
   ========================================================================= */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --orange: #FF6600;          /* brand orange (logo, stripes, accents) */
  --orange-btn: #C85000;      /* primary buttons: white text passes AA */
  --orange-btn-hover: #A94400;
  --orange-050: #FFF2E8;
  --orange-100: #FFE1CC;

  --blue: #3399CC;            /* brand blue */
  --blue-700: #1F6F99;        /* blue for text and links */
  --blue-800: #185A7D;
  --blue-050: #EAF5FB;
  --blue-100: #D3EAF6;

  --ink: #1C2B39;
  --ink-2: #3A4A59;
  --muted: #5B6B7A;
  --faint: #8A98A6;
  --line: #DCE5EC;
  --line-soft: #E9EFF4;
  --ground: #EEF3F7;
  --surface: #FFFFFF;
  --surface-2: #F6F9FB;

  --good: #12805C;  --good-bg: #E3F4EC;
  --warn: #9A5A06;  --warn-bg: #FFF3DC;
  --bad: #C0352B;   --bad-bg: #FDECEA;
  --violet: #5E46B0; --violet-bg: #EFEBFB;

  --font: "Barlow", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(28, 43, 57, .05), 0 4px 14px rgba(28, 43, 57, .04);
  --shadow-menu: 0 10px 30px rgba(28, 43, 57, .16);
  --sidebar: 280px;
  --gap: 14px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--blue-800); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-display); font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.icon { flex: none; vertical-align: middle; }
.sr-only {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ic-orange { color: var(--orange); }
.ic-blue { color: var(--blue); }
.ic-green { color: var(--good); }
.ic-red { color: var(--bad); }

/* HRM360 logo image (resources/views/components/logo.blade.php) */
.wordmark { display: block; height: 42px; width: auto; }
.brand-text { font-family: var(--font-display); color: var(--orange); font-weight: 700; }
.brand-text i { color: var(--blue); font-style: normal; }

/* 3. App shell ------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; padding: 12px; gap: 12px; }

.sidebar {
  position: sticky; top: 12px; align-self: flex-start;
  width: var(--sidebar); height: calc(100vh - 24px); flex: none;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 18px; }
.sidebar-logo { display: inline-flex; padding: 4px 10px 4px 2px; }
.sidebar-logo:hover { text-decoration: none; }
.sidebar .sidebar-close { display: none; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; margin-bottom: 2px;
  background: none; border: 0; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 600; text-align: left; cursor: pointer;
}
.nav-link span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link .icon { color: var(--ink-2); }
.nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--blue-050); color: var(--blue-800); box-shadow: inset 3px 0 0 var(--orange); }
.nav-link.is-active .icon { color: var(--blue-700); }
.nav-chevron { color: var(--faint) !important; transition: transform .18s ease; }
.nav-group-toggle .nav-chevron { transform: rotate(-90deg); }
.nav-group.is-open .nav-group-toggle .nav-chevron { transform: none; }
.nav-sub { display: none; padding: 2px 0 6px; }
.nav-group.is-open .nav-sub { display: block; }
.nav-sublink {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 2px 22px; padding: 8px 12px 8px 20px;
  color: var(--ink-2); border-radius: var(--radius-sm); font-size: 14.5px;
}
.nav-sublink .icon { color: var(--faint); }
.nav-sublink:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-sublink.is-active { background: var(--blue-050); color: var(--blue-800); font-weight: 600; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--line-soft); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 16px 10px 22px; margin-bottom: 12px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.topbar .menu-btn { display: none; }
.page-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 600; color: var(--ink); }
.page-title .icon { color: var(--blue-700); }
.page-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px;
  background: none; border: 0; border-radius: 999px; cursor: pointer; text-align: left;
}
.user-btn:hover { background: var(--surface-2); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 14.5px; }
.user-role { font-size: 12.5px; color: var(--muted); }
.user-chevron { color: var(--faint); }

.content { flex: 1; display: flex; flex-direction: column; gap: var(--gap); }
.content:focus { outline: none; }
.footer { padding: 18px 4px 6px; font-size: 13px; color: var(--muted); text-align: center; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(28, 43, 57, .38); }

/* Avatars */
.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  color: #fff; font-family: var(--font-display); font-weight: 600; letter-spacing: .02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar-md { width: 38px; height: 38px; font-size: 14px; }
.avatar-lg { width: 68px; height: 68px; font-size: 24px; }
.avatar.c1 { background: #1F6F99; }
.avatar.c2 { background: #3399CC; }
.avatar.c3 { background: #C85000; }
.avatar.c4 { background: #12805C; }
.avatar.c5 { background: #5E46B0; }
.avatar.c6 { background: #8A6A00; }

.person { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.person:hover { color: var(--blue-700); text-decoration: none; }
.person-block { display: flex; padding: 6px 0; }
.person-block > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.person-block strong { font-weight: 600; }
.person-block .muted { font-size: 13px; }

/* 4. Buttons, badges, alerts ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 15px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px; line-height: 1.2; white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background-color .15s ease, border-color .15s ease;
  max-width: 100%;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--orange-btn); color: #fff; }
.btn-primary:hover { background: var(--orange-btn-hover); color: #fff; }
.btn-secondary { background: var(--blue-700); color: #fff; }
.btn-secondary:hover { background: var(--blue-800); color: #fff; }
.btn-quiet { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-quiet:hover, .btn-quiet.is-on { background: var(--blue-050); border-color: var(--blue-100); color: var(--blue-800); }
.btn-danger-quiet { background: var(--surface); border-color: var(--line); color: var(--bad); }
.btn-danger-quiet:hover { background: var(--bad-bg); border-color: #F5C7C2; color: var(--bad); }
.btn-pill { border-radius: 999px; padding-left: 20px; padding-right: 20px; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13.5px; }
.btn-block { width: 100%; white-space: normal; text-align: center; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: none; border: 0; border-radius: var(--radius-sm); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn-danger:hover { background: var(--bad-bg); color: var(--bad); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--blue-050); color: var(--blue-800); }
.badge-orange { background: var(--orange-050); color: #A94400; }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-soft); }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid;
}
.alert p { flex: 1; padding-top: 1px; }
.alert-good { background: var(--good-bg); border-color: #BFE5D3; color: #0D5E44; }
.alert-bad { background: var(--bad-bg); border-color: #F5C7C2; color: #8E2219; }
.alert-close { background: none; border: 0; padding: 2px; color: inherit; opacity: .7; cursor: pointer; }
.alert-close:hover { opacity: 1; }

.note { padding: 11px 14px; border-radius: var(--radius); background: var(--blue-050); color: var(--blue-800); font-size: 14px; }
.note-warn { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); }
.note-warn a { color: inherit; font-weight: 600; text-decoration: underline; }

.back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

/* 5. Panels and menus ------------------------------------------------------ */
.panel {
  min-width: 0;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.panel-flush { padding: 0; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 18px; }
.panel-head-pad { padding: 16px 20px 0; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px; color: var(--muted); }
.panel:not(.panel-flush) > .empty { padding: 4px 0; }

.dropdown { position: relative; display: inline-block; }
.menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0;
  min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-menu);
}
.menu-head { padding: 6px 10px 8px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink); font-size: 14.5px; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.menu-item .icon { color: var(--muted); }
.menu-danger, .menu-danger .icon { color: var(--bad); }
.menu-danger:hover { background: var(--bad-bg); color: var(--bad); }
.menu-check .menu-item input { accent-color: var(--blue-700); width: 16px; height: 16px; }
.menu form { margin: 0; }
/* Row menus are positioned by app.js so a scrolling table cannot clip them. */
.menu.is-floating { position: fixed; top: auto; right: auto; }

/* 6. Tables and lists ------------------------------------------------------ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
}
.toolbar-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.search {
  display: flex; align-items: center; min-width: 230px;
  border-bottom: 1px solid var(--line); transition: border-color .15s ease;
}
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; min-width: 0; padding: 8px 4px; border: 0; background: none; outline: none; }
.search button { display: grid; place-items: center; padding: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.input-compact { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-height: 38px; }

.filters {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  margin: 0 18px 14px; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.filters .field { min-width: 200px; }
.filters-actions { display: flex; gap: 8px; }

.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: middle; }
.table thead th {
  background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13.5px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { border-bottom: 1px solid var(--line-soft); }
.table tbody tr:hover td { background: #FAFCFD; }
.table th.num, .table td.num { text-align: right; }
.table-grid th + th, .table-grid td + td { border-left: 1px solid var(--line-soft); }
.table-grid td { white-space: nowrap; }
.panel:not(.panel-flush) .table thead th { border-top: 0; }
.col-sn { width: 56px; text-align: center !important; color: var(--muted); }
.col-actions { width: 56px; text-align: right !important; white-space: nowrap; }
.row-actions { display: inline-flex; align-items: center; gap: 2px; }
.row-actions form { margin: 0; }
.sort { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.sort .icon { color: var(--faint); }
.sort:hover { color: var(--blue-700); text-decoration: none; }
/* Columns hidden with the Columns menu */
.table-wrap .is-col-hidden { display: none; }

.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; font-size: 14px;
}
.per-page { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.per-page select { padding: 4px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager-btn {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font-size: 14px; font-weight: 600;
}
a.pager-btn:hover { border-color: var(--blue-100); background: var(--blue-050); color: var(--blue-800); text-decoration: none; }
.pager-btn.is-current { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.pager-btn.is-disabled { color: #C2CDD6; border-color: var(--line-soft); }
.pager-gap { color: var(--muted); padding: 0 4px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line-soft); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); }
.list-row:hover { text-decoration: none; color: var(--ink); }
.list-row:hover strong { color: var(--blue-700); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.list-main .muted { font-size: 13px; }
.list-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table caption { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding-bottom: 4px; }
.mini-table th, .mini-table td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-weight: 400; text-align: left; }
.mini-table td.num { text-align: right; padding-left: 12px; }
.mini-table tfoot th, .mini-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line); }

.net-line {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--blue-050); color: var(--blue-800);
}
.net-line span { font-weight: 600; }
.net-line strong { font-family: var(--font-display); font-size: 22px; }
.net-line-lg strong { font-size: 26px; }
.net-line .num { white-space: normal; overflow-wrap: anywhere; text-align: right; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 0; }
.facts > div { padding: 9px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.facts-stack { grid-template-columns: 1fr; }

/* 7. Forms ----------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 26px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-wide { grid-column: span 2; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--bad); }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 4px; min-height: 40px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.field textarea { resize: vertical; min-height: 64px; }
.field select { cursor: pointer; }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: #9AA7B3; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom: 2px solid var(--blue); padding-bottom: 7px; background: #FBFDFE; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-bottom-color: var(--bad); }
.hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 13px; color: var(--bad); font-weight: 500; }
.form-actions { display: flex; justify-content: center; padding: 4px 0 8px; }
.form-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.form-with-aside > div { display: flex; flex-direction: column; gap: var(--gap); }
.preview { position: sticky; top: 12px; }
.preview .mini-table + .mini-table { margin-top: 16px; }
.input-with-button { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.input-with-button select { flex: 1 1 220px; min-width: 0; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue-700); }

/* Payslip line editor */
.lines + .lines { margin-top: 26px; }
.payslip-notes textarea { padding: 10px 12px !important; border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important; background: var(--surface) !important; line-height: 1.55; }
.payslip-notes textarea:focus { border-color: var(--blue) !important; box-shadow: 0 0 0 3px var(--blue-050); }
.lines-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.lines-table th { padding: 0 8px 6px; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.lines-table th:first-child { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.lines-table td { padding: 4px 8px 4px 0; }
.lines-table input {
  width: 100%; padding: 8px 10px; min-height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none;
}
.lines-table input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-050); }
.lines-table input.is-invalid { border-color: var(--bad); }
.lines-table input.num { text-align: right; }
.line-amount {
  padding: 8px 10px !important; background: var(--surface-2); border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.w-units { width: 90px; }
.w-money { width: 150px; text-align: right !important; }
.w-x { width: 42px; }
.lines-total-label { text-align: right; font-weight: 600; color: var(--ink-2); padding-right: 14px !important; }
.lines-total { padding: 8px 10px !important; font-weight: 700; border-top: 2px solid var(--line); }

/* 8. Page pieces ----------------------------------------------------------- */
/* Dashboard ---------------------------------------------------------------- */
/* Welcome banner: navy ground with the ACT360 ring drawn large behind it. */
.welcome {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 28px; align-items: center;
  padding: 30px 32px; border-radius: var(--radius-lg);
  background: #13354A; color: #fff;
}
.welcome::before {
  content: ""; position: absolute; pointer-events: none; border-radius: 50%;
  width: 560px; height: 560px; right: -200px; top: -300px;
  border: 44px solid rgba(51, 153, 204, .16); border-left-color: transparent; transform: rotate(-24deg);
}
.welcome > * { position: relative; z-index: 1; }
.welcome-date { color: #9EC3DA; font-size: 14px; }
.welcome h2 { margin-top: 4px; font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.welcome-lead { margin-top: 6px; color: #D5E6F0; font-size: 16px; max-width: 46ch; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn-on-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.welcome-payroll {
  padding: 20px 22px; border-radius: var(--radius-lg);
  background: #1B4560; border: 1px solid rgba(255, 255, 255, .14);
}
.wp-label { color: #9EC3DA; font-size: 13.5px; }
.wp-count { margin-top: 2px; color: #D5E6F0; }
.wp-count strong { font-family: var(--font-display); font-size: 38px; line-height: 1.1; color: #fff; margin-right: 4px; }
.wp-bar { height: 8px; margin: 12px 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.wp-bar span { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--orange); }
.wp-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 22px; margin: 0; }
.wp-facts dt { color: #9EC3DA; font-size: 12.5px; }
.wp-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wp-facts div + div { text-align: right; }

/* Team strip: five figures in one band, split by hairlines. */
.team-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.team-item { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: var(--ink); min-width: 0; }
.team-item + .team-item { border-left: 1px solid var(--line-soft); }
.team-item:hover { text-decoration: none; background: var(--surface-2); color: var(--ink); }
.team-item:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.team-item:last-child { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.team-item > span:last-child { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden; }
.team-item strong { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.team-item strong + span { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; }
.chip-blue { background: var(--blue-050); color: var(--blue-700); }
.chip-green { background: var(--good-bg); color: var(--good); }
.chip-grey { background: #EDF1F4; color: var(--muted); }
.chip-orange { background: var(--orange-050); color: #B04700; }
.chip-violet { background: var(--violet-bg); color: var(--violet); }

.dash-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.dash-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }

.count-pill { padding: 1px 10px; border-radius: 999px; background: var(--orange-050); color: #A94400; font-weight: 700; font-size: 13px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.todo-list li + li { border-top: 1px solid var(--line-soft); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.todo-main a { color: var(--ink); }
.todo-main .muted { font-size: 13px; }
.more-line { margin-top: 8px; }
.all-done { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--good-bg); color: #0D5E44; }

/* Today / Coming up */
.events-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.ev-card { border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.ev-card-today {
  background: linear-gradient(135deg, #FFF4EA 0%, #FFFFFF 70%);
  border: 1px solid #FFE1CC;
}
.ev-card-upcoming { background: var(--surface); border-top: 3px solid var(--blue); }
.ev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ev-head h2 { font-size: 18px; }
.ev-sub { font-size: 13px; color: var(--muted); }
.ev-count { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--orange-btn); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ev-head-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-050); color: var(--blue-700); flex: none; }

/* Today's date, large */
.ev-today-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 52px; height: 56px; border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid #FFD2B3; box-shadow: 0 2px 6px rgba(200, 80, 0, .12);
}
.ev-today-date .m { width: 100%; text-align: center; background: var(--orange-btn); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.ev-today-date .d { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 36px; color: var(--ink); }

.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .75); border: 1px solid var(--line-soft); color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ev-item:hover { text-decoration: none; color: var(--ink); transform: translateY(-1px); border-color: var(--blue-100); box-shadow: 0 4px 12px rgba(28, 43, 57, .08); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.ev-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.ev-detail { color: var(--muted); }
.ev-detail::before { content: "\00B7"; margin: 0 6px 0 0; }
.ev-title .ev-icon { width: 20px; height: 20px; border-radius: 6px; }
.ev-title .ev-icon .icon { width: 12px; height: 12px; }

.ev-icon { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; }
.ev-birthday { background: var(--orange-050); color: #B04700; }
.ev-anniversary { background: var(--blue-050); color: var(--blue-700); }
.ev-joining { background: var(--good-bg); color: var(--good); }
.ev-leaving { background: var(--bad-bg); color: var(--bad); }

/* Coming-up date tile */
.ev-date {
  display: flex; flex-direction: column; align-items: center; flex: none;
  width: 48px; padding: 4px 0 5px; border-radius: 10px; background: var(--blue-050); color: var(--blue-800); line-height: 1.1;
}
.ev-date .m { font-size: 11px; font-weight: 700; }
.ev-date .d { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.ev-date .w { font-size: 10.5px; color: var(--muted); }
.ev-when { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ev-empty { padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .7); border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.ev-more { margin-top: 10px; font-size: 13px; color: var(--muted); }

.dot-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dot-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #B9C5CF; }
.dot-good { color: var(--good); }
.dot-good::before { background: var(--good); }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 30px; grid-template-rows: auto auto; gap: 4px 10px; align-items: center; }
.bar-label { font-size: 14px; }
.bar-track { grid-column: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--blue-700)); }
.bar-value { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-family: var(--font-display); font-weight: 700; font-size: 18px; }

/* Dashboard tabs (Overview / Net Pay Reports) */
.page-tabs { position: relative; display: flex; gap: 4px; padding: 4px; align-self: flex-start; max-width: 100%; overflow-x: auto; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }
.page-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.page-tab:hover { text-decoration: none; color: var(--ink); background: var(--surface-2); }
.page-tab.is-active { background: #13354A; color: #fff; }

/* Net Pay Reports */
.report-filter { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.report-filter-form { display: flex; align-items: flex-end; gap: 10px; }
.report-filter .field { min-width: 180px; }
.report-filter p { max-width: 520px; }
.report { position: relative; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.report-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.rcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.rcard-net { grid-column: span 2; grid-row: span 2; justify-content: center; background: #13354A; color: #fff; }
.rcard-foot { margin-top: auto; padding-top: 8px; }
.rcard-label { font-size: 13px; color: var(--muted); }
.rcard-net .rcard-label { color: #9EC3DA; }
.rcard-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
.rcard-net .rcard-value { font-size: 34px; }
.rcard-value small { font-size: 14px; font-weight: 500; color: #9EC3DA; }
.rcard-value.minus { color: #B54500; }
.rcard-note { font-size: 12.5px; color: var(--muted); }
.rcard-net .rcard-note { color: #9EC3DA; }
.rcard-change { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.rcard-change.up { background: rgba(18, 128, 92, .25); color: #9FE2C4; }
.rcard-change.down { background: rgba(255, 102, 0, .2); color: #FFC49B; }

.chart-scroll { position: relative; overflow-x: auto; }
.chart { display: grid; grid-template-columns: repeat(12, minmax(34px, 1fr)); gap: 8px; height: 240px; min-width: 460px; align-items: end; }
.chart-years { grid-template-columns: repeat(auto-fit, minmax(60px, 120px)); justify-content: center; min-width: 0; }
.chart-col { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); min-width: 0; height: 100%; gap: 6px; color: var(--ink); text-align: center; }
a.chart-col:hover { text-decoration: none; }
a.chart-col:hover .chart-bar { filter: brightness(1.1); }
.chart-value { grid-row: 1; font-size: 11.5px; font-weight: 600; color: var(--ink-2); min-height: 16px; white-space: nowrap; overflow: hidden; }
.chart-track { grid-row: 2; position: relative; display: flex; align-items: flex-end; justify-content: center; border-bottom: 2px solid var(--line); }
.chart-bar { display: block; width: 70%; max-width: 44px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--blue), var(--blue-700)); transition: height .3s ease; }
.chart-bar.is-empty { height: 0 !important; }
.chart-label { grid-row: 3; font-size: 12px; color: var(--muted); overflow: hidden; }

.report-table tfoot th, .report-table tfoot td { padding: 12px 14px; background: var(--surface-2); border-top: 2px solid var(--line); font-weight: 700; }
.report-table tr.is-selected td { background: var(--blue-050); }
.delta { font-weight: 700; font-size: 13px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* Shown while the report reloads after changing the year */
.loading { display: none; }
.report.is-loading > :not(.loading) { opacity: .45; pointer-events: none; transition: opacity .15s ease; }
.report.is-loading .loading {
  display: flex; align-items: center; gap: 10px; position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow-menu);
}
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Settings */
.panel-head > div > p { margin-top: 3px; }
.count-pill-blue { background: var(--blue-050); color: var(--blue-800); }
.add-row { display: flex; align-items: flex-end; gap: 14px 18px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-soft); }
.add-row .field { flex: 1 1 220px; }
.add-row .btn { flex: none; }
.settings-table td { vertical-align: middle; }
.settings-table .row-actions { gap: 6px; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; background: none; color: var(--ink-2); }
.edit-row > td { background: var(--blue-050) !important; padding: 14px 16px !important; white-space: normal !important; }
.edit-form { display: flex; align-items: flex-end; gap: 12px 18px; flex-wrap: wrap; }
.edit-form .field { flex: 1 1 220px; }
.edit-form .field input, .edit-form .field select { background: var(--surface); padding-left: 10px; }
.edit-form .hint { flex-basis: 100%; }
.edit-actions { display: flex; gap: 8px; }
.inline-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.inline-filter select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); max-width: 100%; }

.template-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.template-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.template-main { flex: 1; min-width: 200px; }
.template-main h3 { font-size: 16px; margin-bottom: 2px; }

.template-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-stack textarea {
  min-height: 0; padding: 10px 12px !important; border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important;
  background: var(--surface) !important; line-height: 1.6; font-size: 15px;
}
.form-stack textarea:focus { border-color: var(--blue) !important; box-shadow: 0 0 0 3px var(--blue-050); }
.editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.editor-reset { margin-left: auto; }
.placeholder-panel { position: sticky; top: 12px; }
.placeholder-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.placeholder-list li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.placeholder-chip {
  padding: 3px 9px; border-radius: var(--radius-sm); border: 1px solid var(--blue-100); background: var(--blue-050);
  color: var(--blue-800); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; cursor: pointer;
}
.placeholder-chip:hover { background: var(--blue-100); }
.email-frame { display: block; width: 100%; height: 720px; border: 1px solid var(--line); border-radius: var(--radius); background: #EEF3F7; }

/* Employee Summary */
.toolbar-title { font-size: 18px; }
.summary-filters .field { min-width: 150px; flex: 1 1 150px; }
.summary-filters .field-grow { flex: 2 1 240px; }
.summary-filters input[type="month"] { min-width: 0; }
.person-two { display: flex; flex-direction: column; line-height: 1.25; }
.person-two strong { font-weight: 600; }
.period-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 14px 18px; }
.period-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-fields .input-compact { min-height: 36px; }
.salary-strip-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-items { margin-top: 18px; }

.profile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-sm { padding: 14px 18px; }
.profile-main { flex: 1; min-width: 220px; }
.profile-main h2 { font-size: 24px; }
.profile-sm .profile-main h2 { font-size: 19px; }
.profile-main h2 a { color: var(--ink); }
.profile-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 14px; }
.profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-actions form { margin: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }

.salary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.salary-strip > div { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.salary-strip > div + div { border-left: 1px solid var(--line-soft); }
.salary-strip span { font-size: 12.5px; color: var(--muted); }
.salary-strip strong { font-family: var(--font-display); font-size: 20px; text-align: left; }
.salary-strip .is-net { background: var(--blue-050); }
.salary-strip .is-net strong { color: var(--blue-800); }

.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.actionbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.actionbar-group { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 10px; border-right: 1px solid var(--line-soft); }
.actionbar-group form { margin: 0; }
.actionbar-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-left: auto; }
.actionbar-count { padding: 0 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.payslip-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(240px, 300px); gap: var(--gap); align-items: start; }
.payslip-side { display: flex; flex-direction: column; gap: var(--gap); }
.stack-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.stack-actions form { margin: 0; }
.side-delete { margin: 0; }

/* 9. Payslip document ------------------------------------------------------ */
/* The payslip's own styles live in resources/views/payslips/_document-styles.blade.php
   so the PDF uses exactly the same rules. Only the "paper" around it is here. */
.paper {
  position: relative;
  background: #fff; border-radius: 8px; padding: 34px 38px 30px; overflow-x: auto;
  box-shadow: 0 1px 3px rgba(28, 43, 57, .1), 0 8px 26px rgba(28, 43, 57, .07);
}
.paper .pslip { min-width: 640px; }

/* Latest / earlier payslip markers */
.badge-latest { background: #13354A; color: #fff; }
.superseded {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 14.5px;
}
.superseded p { flex: 1; min-width: 220px; }
.superseded .btn { background: var(--surface); }
tr.is-earlier td { color: var(--muted); }
tr.is-earlier .person { color: var(--ink-2); }

/* Latest / all switch above the payslip list */
.tabs { position: relative; display: inline-flex; max-width: 100%; overflow-x: auto; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; padding: 6px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { background: var(--surface); color: var(--blue-800); box-shadow: 0 1px 2px rgba(28, 43, 57, .12); }
.tab-count { font-size: 12px; color: var(--muted); font-weight: 500; }
.history-link { font-size: 13.5px; white-space: nowrap; }
.list-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 18px 12px; }
.list-head h2 { font-size: 18px; }

.print-page { background: var(--ground); }
.print-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  max-width: 820px; margin: 18px auto 12px; padding: 0 12px; font-size: 14px; color: var(--muted);
}
.paper-print { max-width: 820px; margin: 0 auto 40px; }

@page { size: A4; margin: 14mm; }
@media print {
  body, .print-page { background: #fff !important; }
  .print-bar, .sidebar, .topbar, .footer, .actionbar, .payslip-side, .crumbs, .alert { display: none !important; }
  .shell { padding: 0; display: block; }
  .paper, .paper-print { box-shadow: none; padding: 0; margin: 0; max-width: none; border-radius: 0; overflow: visible; }
  .payslip-layout { display: block; }
  .paper .pslip { min-width: 0; }
  .superseded, .tabs { display: none !important; }
  a { color: inherit; text-decoration: none; }
}

/* 10. Sign-in pages -------------------------------------------------------- */
body.auth { min-height: 100vh; display: flex; flex-direction: column; background: #F3F8FB; position: relative; overflow-x: hidden; }
.auth-ground { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.auth-wave { position: absolute; right: 0; top: 0; width: 52%; height: 100%; }
.auth-ring {
  position: absolute; left: -150px; bottom: -170px; width: 440px; height: 440px;
  border: 16px solid var(--orange); border-radius: 50%; border-left-color: transparent; border-bottom-color: transparent;
  transform: rotate(-12deg); opacity: .9;
}
.auth-brand, .auth-main, .auth-footer { position: relative; z-index: 1; }
.auth-brand { padding: 34px 0 0 14.5%; }
.auth-brand .wordmark { height: 56px; }
.auth-brand a:hover { text-decoration: none; }
.auth-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 30px 16px; }
.auth-card {
  width: 100%; max-width: 480px; padding: 26px 22px 22px;
  background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(28, 43, 57, .12);
}
.auth-title { font-family: var(--font); font-size: 21px; font-weight: 700; color: var(--ink); }
.auth-lead { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; }
.auth-note { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-050); color: var(--blue-800); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.line-field {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  border-bottom: 1px solid var(--line); color: var(--faint); transition: border-color .15s ease;
}
.line-field:focus-within { border-bottom-color: var(--blue); color: var(--blue-700); }
.line-field.has-error { border-bottom-color: var(--bad); }
.line-field input { flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: none; background: none; font-size: 16px; color: var(--ink); }
.line-field input::placeholder { color: #8796A3; }
.reveal { display: grid; place-items: center; padding: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.reveal .when-shown { display: none; }
.reveal[aria-pressed="true"] .when-shown { display: inline; }
.reveal[aria-pressed="true"] .when-hidden { display: none; }
.auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 16px 0 22px; font-size: 14.5px; }
.auth-row a { color: var(--blue-700); }
.auth-form .btn-primary { min-height: 56px; font-size: 16px; letter-spacing: .02em; }
.auth-back { margin-top: 18px; font-size: 14px; }
.auth-back a { display: inline-flex; align-items: center; gap: 4px; }
.auth-footer { padding: 18px; text-align: center; font-size: 13.5px; color: var(--ink-2); }
.auth-footer a { color: var(--ink-2); }
.error-card { text-align: left; }
.error-card .btn { margin-top: 20px; }
.error-code { font-family: var(--font-display); font-size: 54px; font-weight: 700; line-height: 1; color: var(--blue); margin-bottom: 8px; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 1280px) {
  .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rcard-net { grid-row: auto; }
  .dash-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-item:nth-child(4) { border-left: 0; }
  .team-item:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payslip-layout { grid-template-columns: minmax(0, 1fr); }
  .payslip-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
}

@media (max-width: 1080px) {
  .dash-two, .two-col { grid-template-columns: minmax(0, 1fr); }
  .template-editor { grid-template-columns: minmax(0, 1fr); }
  .placeholder-panel { position: static; }
  .placeholder-list { flex-direction: row; flex-wrap: wrap; }
  .placeholder-list .muted { display: none; }
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .form-with-aside { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .salary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .salary-strip-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .salary-strip-4 > div:nth-child(3) { border-left: 0; }
  .salary-strip-4 > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .salary-strip-4 > div:nth-child(4) { border-left: 1px solid var(--line-soft); }
  .salary-strip > div:nth-child(4) { border-left: 0; }
  .salary-strip > div:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
}

/* Below this width the sidebar slides in from the left. */
@media (max-width: 960px) {
  .shell { padding: 8px; gap: 0; }
  .sidebar {
    position: fixed; left: 8px; top: 8px; z-index: 50; height: calc(100vh - 16px);
    transform: translateX(calc(-100% - 16px)); transition: transform .22s ease;
  }
  .shell.is-menu-open .sidebar { transform: none; }
  .sidebar .sidebar-close, .topbar .menu-btn { display: inline-grid; }
  .topbar { padding-left: 8px; }
  .auth-wave { width: 70%; opacity: .45; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .welcome { padding: 24px 20px; }
  .page-tab { padding: 7px 12px; font-size: 14px; }
  .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rcard-net { grid-column: span 2; grid-row: auto; }
  .rcard { padding: 14px; }
  .rcard-value { font-size: 19px; }
  .rcard-net .rcard-value { font-size: 26px; }
  .chart { height: 200px; min-width: 0; gap: 4px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .chart-years { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
  .chart-value { visibility: hidden; }
  .chart-label { font-size: 10.5px; }
  .chart-bar { width: 80%; }
  .report-filter .field, .report-filter-form { width: 100%; }
  .welcome h2 { font-size: 26px; }
  .team-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-item { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
  .team-item:nth-child(-n+2) { border-top: 0; }
  .dash-three { grid-template-columns: minmax(0, 1fr); }
  .todo-list .btn-text { display: none; }
  .editor-reset { margin-left: 0; }
  .email-frame { height: 640px; }
  .add-row .btn { width: 100%; }
  .ev-detail { flex-basis: 100%; }
  .ev-detail::before { content: none; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .breakdown, .facts { grid-template-columns: 1fr; }
  .user-meta, .user-chevron { display: none; }
  .page-title { font-size: 19px; }
  .toolbar-end { width: 100%; margin-left: 0; }
  .search { flex: 1 1 100%; min-width: 0; order: 9; }
  .salary-strip { grid-template-columns: 1fr 1fr; }
  .salary-strip > div { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
  .actionbar-group { border-right: 0; padding-right: 0; }
  .actionbar-nav { margin-left: 0; width: 100%; justify-content: center; }
  .paper { padding: 20px 16px; }
  .lines-table, .lines-table tbody, .lines-table tr, .lines-table td { display: block; width: 100%; }
  .lines-table thead { display: none; }
  .lines-table tr[data-line] {
    display: grid; grid-template-columns: 1fr 1fr 1fr 42px; gap: 6px;
    padding: 10px 0; border-bottom: 1px solid var(--line-soft);
  }
  [data-lines="deductions"] tr[data-line] { grid-template-columns: 1fr 42px; }
  .lines-table tr[data-line] td:first-child { grid-column: 1 / -1; }
  [data-lines="deductions"] tr[data-line] td:first-child { grid-column: 1 / -1; }
  .lines-table td { padding: 0; }
  .lines-table tfoot tr { display: flex; justify-content: space-between; padding-top: 8px; }
  .lines-table tfoot td { width: auto; }
  .lines-table tfoot td:empty { display: none; }
  .auth-brand { padding: 24px 0 0 22px; }
  .auth-brand .wordmark { height: 44px; }
  .auth-ring { width: 260px; height: 260px; border-width: 11px; left: -120px; bottom: -130px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
