:root {
  --bg: #f4f8fa;
  --surface: #ffffff;
  --surface-2: #eef6f7;
  --ink: #18252b;
  --muted: #607179;
  --line: #d9e5e7;
  --teal: #078d97;
  --teal-dark: #056a72;
  --orange: #b65d16;
  --orange-soft: #fff1e7;
  --green: #14845d;
  --red: #b42318;
  --sidebar: #10272c;
  --zathu-midnight: #07111d;
  --zathu-navy: #082f63;
  --zathu-blue: #0b4c8c;
  --zathu-gold: #ffc21c;
  --zathu-amber: #ec9d08;
  --zathu-steel: #76879a;
  --shadow: 0 18px 45px rgba(24, 37, 43, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: #eaf6f7;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.brand [data-brand-fallback] {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--teal-dark);
  font-size: 16px;
  font-weight: 900;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 3px;
  color: #9acbd0;
  font-size: 11px;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav button {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  color: #cfe8ea;
  background: transparent;
  border-radius: 7px;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.nav button:hover,
.nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-group.active > .nav-group-label {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-submenu {
  display: grid;
  gap: 3px;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 1px solid rgba(112, 199, 206, 0.35);
}

.nav-submenu button {
  grid-template-columns: 22px 1fr;
  padding: 8px 10px;
  color: #bad9dc;
  font-size: 12px;
  font-weight: 600;
}

.nav-submenu .nav-icon {
  width: 16px;
  height: 16px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  color: #70c7ce;
}

.access-box {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.access-box h3 {
  margin: 0 0 10px;
  font-size: 12px;
}

.role-switch {
  display: flex;
  gap: 6px;
}

.role-switch button {
  flex: 1;
  min-height: 32px;
  color: #d8eeee;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.role-switch button.active {
  color: var(--sidebar);
  background: #f6a94a;
}

.user-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.user-card strong {
  display: block;
  color: #fff;
  font-size: 12px;
}

.user-card span {
  color: #9acbd0;
  font-size: 11px;
  font-weight: 800;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  object-fit: cover;
  font-size: 12px;
  font-weight: 900;
}

.profile-btn {
  margin-bottom: 8px;
}

.logout-btn {
  width: 100%;
  min-height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #eaf6f7;
  font-size: 12px;
  font-weight: 850;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 16% 18%, rgba(31, 91, 154, 0.62), transparent 34%),
    radial-gradient(circle at 85% 80%, rgba(255, 194, 28, 0.2), transparent 28%),
    linear-gradient(135deg, var(--zathu-midnight) 0%, #081d37 48%, var(--zathu-navy) 100%);
}

.login-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(620px, 76vw);
  aspect-ratio: 1;
  left: -210px;
  bottom: -310px;
  border: 1px solid rgba(255, 194, 28, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 0 58px rgba(11, 76, 140, 0.1), 0 0 0 116px rgba(255, 194, 28, 0.04);
}

.login-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  top: -190px;
  right: -90px;
  border: 1px solid rgba(255, 194, 28, 0.2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 194, 28, 0.08), transparent 66%);
}

.login-panel {
  width: min(500px, 100%);
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(255, 194, 28, 0.5);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 249, 0.98));
  box-shadow: 0 28px 80px rgba(0, 7, 19, 0.46), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--zathu-navy), var(--zathu-gold) 52%, var(--zathu-amber));
}

.login-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  margin-bottom: 26px;
  text-align: center;
}

.login-brand img {
  display: block;
}

.login-logo-frame {
  display: block;
  width: 238px;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--zathu-gold);
  border-radius: 50%;
  background: var(--zathu-midnight);
  box-shadow: 0 16px 38px rgba(8, 47, 99, 0.34), 0 0 0 6px rgba(255, 194, 28, 0.12);
}

.login-zithu-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.22);
}

.login-brand h1 {
  margin: 0;
  color: var(--zathu-midnight);
  font-size: 28px;
  letter-spacing: -0.025em;
}

.login-brand p {
  margin: 5px 0 0;
  color: #516579;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form-heading {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
  text-align: center;
}

.login-form-heading strong {
  color: var(--zathu-midnight);
  font-size: 18px;
}

.login-form-heading span {
  color: #516579;
  font-size: 12px;
  line-height: 1.5;
}

.login-form .field label {
  color: var(--zathu-navy);
}

.login-form .field input {
  min-height: 48px;
  border-color: #bcc9d5;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
}

.login-form .field input:hover {
  border-color: var(--zathu-steel);
}

.login-form .field input:focus {
  outline: 4px solid rgba(255, 194, 28, 0.2);
  border-color: var(--zathu-blue);
  box-shadow: 0 0 0 1px rgba(11, 76, 140, 0.12);
}

.login-form .field input[readonly] {
  color: #516579;
  background: #edf2f6;
}

.login-form .btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 1px solid #0a3c73;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--zathu-navy), var(--zathu-blue));
  box-shadow: 0 10px 24px rgba(8, 47, 99, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.login-form .btn:hover {
  border-color: #d78a00;
  background: linear-gradient(135deg, #0b3d79, #0c579e);
  box-shadow: 0 12px 28px rgba(8, 47, 99, 0.3), 0 0 0 3px rgba(255, 194, 28, 0.16);
}

.platform-login-link {
  color: var(--zathu-blue);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.platform-login-link:hover {
  color: #9a6100;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-assistance {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.login-text-button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--zathu-blue);
  padding: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.login-text-button:hover {
  color: #9a6100;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-error {
  padding: 10px 12px;
  border-radius: 7px;
  background: #fee8e5;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.login-notice {
  padding: 10px 12px;
  border: 1px solid #a9c8e5;
  border-radius: 7px;
  background: #edf6ff;
  color: var(--zathu-navy);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.login-help {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-help strong {
  color: var(--ink);
}

.login-help button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--teal-dark);
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}

.main {
  min-width: 0;
  padding: 18px;
}

.topbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.page-title h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
}

.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search,
.period-select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.search {
  width: min(380px, 32vw);
  padding: 0 14px;
}

.period-select {
  padding: 0 12px;
  font-weight: 700;
}

.db-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2f2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.db-status.database {
  background: #e7f7ef;
  color: var(--green);
}

.db-status.saving,
.db-status.connecting {
  background: var(--orange-soft);
  color: var(--orange);
}

.db-status.local {
  background: #fee8e5;
  color: var(--red);
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  background: var(--teal);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.btn.secondary {
  background: #e9f3f5;
  color: var(--teal-dark);
}

.btn.warning {
  background: var(--orange);
}

.btn.danger {
  background: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 16px;
  align-items: start;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.panel,
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.kpi {
  padding: 15px;
  min-height: 96px;
}

.kpi .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi .value {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.kpi .note {
  margin-top: 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 750;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}

.chip.active {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--surface-2);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8fbfc;
  font-size: 11px;
  text-transform: uppercase;
}

tr {
  cursor: pointer;
}

tr:hover,
tr.selected {
  background: #f0fafb;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.status.approved {
  background: #e7f7ef;
  color: var(--green);
}

.status.pending {
  background: var(--orange-soft);
  color: var(--orange);
}

.status.rejected {
  background: #fee8e5;
  color: var(--red);
}

.status.active {
  background: #e7f7ef;
  color: var(--green);
}

.status.probation,
.status.expiring {
  background: var(--orange-soft);
  color: var(--orange);
}

.status.suspended,
.status.exited {
  background: #fee8e5;
  color: var(--red);
}

.inspector {
  position: sticky;
  top: 18px;
}

.employee-card {
  padding: 16px;
}

.employee-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.employee-head h2 {
  margin: 0;
  font-size: 19px;
}

.employee-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.net-pay {
  margin: 16px 0;
  padding: 15px;
  border-radius: var(--radius);
  background: var(--sidebar);
  color: #fff;
}

.net-pay .label {
  color: #9acbd0;
  font-size: 12px;
  font-weight: 800;
}

.net-pay .amount {
  margin-top: 5px;
  font-size: 28px;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}

.field input[type="color"] {
  padding: 4px;
}

.field input,
.field select {
  min-height: 36px;
  padding: 0 10px;
}

.field textarea {
  min-height: 84px;
  padding: 10px;
  resize: vertical;
}

.section-title {
  margin: 16px 0 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calc-list {
  display: grid;
  gap: 8px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.calc-row strong {
  font-weight: 900;
}

.deduction-editor,
.benefit-editor,
.lunch-editor,
.masm-editor,
.benefit-overtime {
  display: grid;
  gap: 10px;
}

.entry-deductions,
.entry-benefits,
.entry-lunch,
.entry-masm {
  padding: 16px;
}

.deduction-editor-head,
.benefit-editor-head,
.lunch-editor-head,
.masm-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.deduction-editor-head span,
.benefit-editor-head span,
.lunch-editor-head span,
.masm-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.deduction-editor-head strong,
.benefit-editor-head strong,
.lunch-editor-head strong,
.masm-editor-head strong {
  font-size: 14px;
  font-weight: 900;
}

.deduction-list,
.benefit-list,
.lunch-list,
.masm-list {
  display: grid;
  gap: 8px;
}

.deduction-row,
.benefit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.8fr) 32px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.masm-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(130px, 0.85fr) minmax(150px, 1.2fr) minmax(110px, 0.8fr) 32px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.lunch-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(150px, 1.2fr) minmax(80px, 0.55fr) minmax(110px, 0.8fr) minmax(100px, 0.7fr) 32px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.lunch-total {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.readonly-value {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.settings-default-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.deduction-empty,
.benefit-empty,
.lunch-empty,
.masm-empty {
  padding: 11px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.deduction-editor.compact .deduction-row,
.benefit-editor.compact .benefit-row,
.lunch-editor.compact .lunch-row,
.masm-editor.compact .masm-row {
  grid-template-columns: 1fr;
}

.rule-panel {
  padding: 14px 16px;
}

.rule-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.rule-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.search-panel {
  display: grid;
  gap: 14px;
}

.search-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.search-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.search-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.search-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.schedule-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.schedule-card span,
.schedule-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.hr-grid {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.hr-kpis .kpi {
  min-height: 88px;
}

.hr-summary {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.hr-summary div,
.hr-metric-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hr-summary span,
.hr-metric-grid span,
.document-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.hr-summary strong,
.hr-metric-grid strong {
  font-size: 12px;
  text-align: right;
}

.hr-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 14px;
}

.hr-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.hr-tabs button.active {
  border-color: var(--teal);
  background: var(--surface-2);
  color: var(--teal-dark);
}

.hr-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.bank-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.bank-summary div {
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.bank-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bank-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  font-weight: 900;
}

.payslip-grid {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.payslip-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.payslip-action-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 146px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.payslip-action-card span,
.payslip-action-card small,
.payslip-person span,
.payslip-title p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.payslip-action-card strong {
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.payslip-action-card .btn {
  width: 100%;
}

.payslip-action-card .btn:first-of-type {
  margin-top: auto;
}

.payslip-message {
  margin: 0 16px 16px;
  padding: 11px 12px;
  border: 1px solid #b8e6cc;
  border-radius: 7px;
  background: #e7f7ef;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.payslip-preview {
  position: sticky;
  top: 18px;
}

.payslip-document {
  color: #111;
  background: #fff;
}

.payslip-document.bw {
  filter: grayscale(1);
}

.payslip-document.colour .payslip-title {
  margin: -16px -16px 16px;
  padding: 16px;
  border-radius: 7px 7px 0 0;
  background: var(--teal);
  color: #fff;
}

.payslip-document.colour .payslip-title p,
.payslip-document.colour .payslip-title .status {
  color: #fff;
}

.payslip-document.colour .net-pay {
  background: var(--orange);
  border-color: var(--orange);
}

.payslip-document.colour .net-pay .label,
.payslip-document.colour .net-pay .amount {
  color: #fff;
}

.payslip-title {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.payslip-title img {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.payslip-title h2 {
  margin: 0;
  font-size: 18px;
}

.payslip-title p {
  margin: 4px 0 0;
}

.payslip-person {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.payslip-person strong {
  font-size: 15px;
}

.payslip-table-wrap table,
.payslip-table {
  min-width: 0;
}

.payslip-table td:last-child,
.payslip-table th:last-child {
  text-align: right;
}

.deduct-amount {
  color: var(--red);
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 39, 44, 0.58);
}

.payslip-modal {
  width: min(820px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
}

.modal-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.payslip-modal-body {
  padding: 22px;
}

.payslip-document.large {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #111;
}

.payslip-document.large .payslip-title {
  padding-bottom: 18px;
  border-bottom: 2px solid #111;
}

.payslip-document.large .payslip-person,
.payslip-document.large .net-pay {
  border-color: #111;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.hr-metric-grid div {
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.timeline,
.document-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.timeline div,
.document-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.timeline div {
  grid-template-columns: 1fr;
}

.timeline strong,
.document-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.document-item button.status {
  min-height: 28px;
  border: 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.bulk-import {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.bulk-import textarea {
  width: 100%;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bulk-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.data-entry-page {
  display: grid;
  gap: 16px;
}

.data-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.data-entry-header h2 {
  margin: 0;
  font-size: 18px;
}

.data-entry-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.data-entry-notice {
  padding: 12px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 900;
}

.data-entry-notice.success {
  border: 1px solid #b8e6cc;
  background: #e7f7ef;
  color: var(--green);
}

.data-entry-notice.error {
  border: 1px solid #f8beb8;
  background: #fee8e5;
  color: var(--red);
}

.data-entry-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.data-entry-tools select {
  min-width: 250px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}

.data-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.data-entry-forms {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.entry-section {
  overflow: hidden;
}

.entry-form-grid {
  padding: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.data-entry-summary {
  position: sticky;
  top: 18px;
}

.data-entry-picker {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.data-entry-picker input {
  width: 100%;
  margin: 8px 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}

.data-entry-employee-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.data-entry-employee-option {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.data-entry-employee-option:hover,
.data-entry-employee-option.selected {
  border-color: var(--primary);
  background: #eef7f4;
}

.data-entry-employee-name {
  font-size: 13px;
  font-weight: 800;
}

.data-entry-employee-option small,
.data-entry-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.data-entry-empty {
  margin: 5px 0;
}

.entry-readiness {
  display: grid;
  gap: 8px;
}

.entry-readiness div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.entry-readiness span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.entry-readiness strong {
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.paye-band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.paye-band-editor .paye-band-grid {
  grid-template-columns: minmax(0, 1fr) 88px 36px;
}

.paye-band-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.paye-band-grid input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.department-manager {
  display: grid;
  gap: 8px;
}

.department-add,
.department-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.department-row {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 140px) 82px 78px;
}

.department-add input,
.department-row input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  min-width: 0;
}

.department-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.department-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.department-row label span {
  text-align: left;
}

.department-row .btn,
.department-add .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.paye-module-body {
  padding: 16px;
}

.paye-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.paye-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.settings-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-layout {
  align-items: start;
}

.profile-form {
  display: grid;
  gap: 18px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfb;
}

.profile-hero strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.profile-hero span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.profile-avatar,
.profile-summary-avatar {
  width: 68px;
  height: 68px;
  border-color: rgba(7, 141, 151, 0.22);
  background: var(--teal-dark);
  color: #fff;
  font-size: 20px;
}

.profile-summary-avatar {
  margin: 2px 0 16px;
}

.profile-picture-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-picture-preview {
  flex: 0 0 auto;
}

.profile-picture-avatar {
  width: 76px;
  height: 76px;
  border-color: rgba(7, 141, 151, 0.24);
  background: var(--teal-dark);
  color: #fff;
  font-size: 22px;
}

.profile-picture-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-picture-controls span {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.profile-picture-button {
  position: relative;
  overflow: hidden;
}

.profile-picture-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.company-settings {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.company-profile-tools,
.company-profile-add {
  display: grid;
  gap: 8px;
}

.company-profile-tools {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.company-profile-add {
  grid-template-columns: minmax(0, 1fr) auto;
}

.company-profile-tools select,
.company-profile-add input {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.company-preview {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.company-preview-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
}

.company-preview strong,
.company-preview span {
  display: block;
}

.company-preview strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.company-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.approvals {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.approval-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 16px 0;
}

.approval-bulk-bar > div {
  display: grid;
  min-width: 118px;
  margin-right: auto;
}

.approval-bulk-bar strong {
  font-size: 18px;
  font-weight: 950;
}

.approval-bulk-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.approval-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.approval-select {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.approval-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.approval-item h3 {
  margin: 0;
  font-size: 13px;
}

.approval-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.approval-actions {
  display: flex;
  gap: 6px;
}

.approval-actions.compact {
  min-width: 154px;
}

.approval-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.approval-btn.approve {
  background: #e7f7ef;
  color: var(--green);
}

.approval-btn.reject {
  background: #fee8e5;
  color: var(--red);
}

.approval-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mini-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-weight: 900;
}

.mini-btn.ok {
  background: #e7f7ef;
  color: var(--green);
}

.mini-btn.no {
  background: #fee8e5;
  color: var(--red);
}

.access-grid,
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.access-card,
.scheme-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfdfd;
}

.access-card h3,
.scheme-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.user-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.user-active-check,
.user-status-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.user-active-check {
  min-height: 38px;
}

.user-create-actions {
  grid-column: span 3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.user-create-actions .btn {
  min-width: 150px;
}

.inline-message {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inline-message a {
  color: var(--teal-dark);
  font-weight: 850;
}

.user-table input,
.user-table select {
  min-height: 34px;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.user-table .mini-btn {
  width: auto;
  min-width: 54px;
  font-size: 11px;
}

.user-table-actions {
  display: flex;
  gap: 6px;
}

.switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  padding: 3px;
  background: #cfdcde;
}

.switch span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.switch.on {
  background: var(--teal);
}

.switch.on span {
  transform: translateX(18px);
}

.placeholder-panel {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-text,
  .nav span:not(.nav-icon),
  .access-box h3,
  .role-switch {
    display: none;
  }

  .nav button {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .nav-submenu {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .nav-submenu button {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-default-grid {
    grid-template-columns: 1fr;
  }

  .data-entry-layout {
    grid-template-columns: 1fr;
  }

  .payslip-grid {
    grid-template-columns: 1fr;
  }

  .payslip-preview {
    position: static;
  }

  .data-entry-summary {
    position: static;
  }

  .entry-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspector {
    position: static;
  }
}

@media (max-width: 760px) {
  .login-shell {
    padding: 18px;
  }

  .login-panel {
    padding: 28px 24px;
    border-radius: 18px;
  }

  .login-brand {
    gap: 16px;
    margin-bottom: 22px;
  }

  .login-logo-frame {
    width: min(210px, 100%);
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 10px;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    width: 48px;
  }

  .nav-group {
    grid-auto-flow: column;
    grid-auto-columns: 48px;
  }

  .nav-submenu {
    display: contents;
  }

  .nav-submenu button {
    width: 48px;
  }

  .access-box {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .data-entry-header {
    align-items: stretch;
    flex-direction: column;
  }

  .data-entry-tools {
    justify-content: stretch;
  }

  .data-entry-tools select,
  .data-entry-tools .btn {
    width: 100%;
  }

  .payslip-actions {
    grid-template-columns: 1fr;
  }

  .deduction-row,
  .benefit-row,
  .lunch-row,
  .masm-row,
  .department-row,
  .approval-item {
    grid-template-columns: 1fr;
  }

  .department-row > span {
    text-align: left;
  }

  .approval-select {
    justify-self: start;
  }

  .search {
    width: 100%;
  }

  .kpi-grid,
  .access-grid,
  .rules-grid,
  .bank-summary,
  .search-summary,
  .schedule-grid,
  .user-create-form,
  .form-grid,
  .entry-form-grid {
    grid-template-columns: 1fr;
  }

  .user-create-actions {
    grid-column: 1;
    flex-direction: column;
  }
}
