:root {
  --ink: #17212b;
  --muted: #657181;
  --line: #d9e1ea;
  --line-strong: #c6d1dc;
  --panel: #ffffff;
  --paper: #fbfcff;
  --soft: #f6f4ff;
  --nav: #1d2330;
  --nav-soft: #313a4d;
  --accent: #00a78e;
  --accent-dark: #087568;
  --amber: #d47a00;
  --red: #b23535;
  --blue: #3366ff;
  --pink: #ff4fa3;
  --lime: #c7f464;
  --glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 42px rgba(31, 45, 61, 0.14);
  --shadow-soft: 0 10px 24px rgba(31, 45, 61, 0.09);
  --shadow-pop: 6px 6px 0 rgba(23, 33, 43, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 79, 163, 0.09), transparent 28%, rgba(0, 167, 142, 0.08) 60%, transparent 84%),
    linear-gradient(90deg, rgba(23, 33, 43, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 33, 43, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #fff9db 0%, #f6f4ff 44%, #e9fff9 100%);
  background-size: auto, 38px 38px, 38px 38px, auto;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  max-width: 100%;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-shell,
.main,
.view,
.topbar,
.metric-grid,
.content-grid,
.attendance-layout,
.overview-home-grid,
.overview-stack,
.panel,
.form-panel,
.table-wrap,
.mobile-card-list,
.mobile-record-card,
.action-row,
.dialog-actions,
.compact-action-form,
.data-stack,
.break-row {
  min-width: 0;
  max-width: 100%;
}

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

.mobile-appbar,
.mobile-tabbar,
.mobile-more-backdrop,
.mobile-only {
  display: none;
}

.desktop-only {
  display: revert;
}

.login-screen {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(115deg, rgba(255, 79, 163, 0.16), transparent 24%, rgba(0, 167, 142, 0.18) 58%, transparent 74%),
    linear-gradient(135deg, #fff6cf 0%, #f6f4ff 42%, #e6fff8 100%);
}

.login-screen::before,
.login-screen::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.login-screen::before {
  background:
    linear-gradient(90deg, rgba(23, 33, 43, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 33, 43, 0.055) 1px, transparent 1px),
    repeating-linear-gradient(115deg, transparent 0 68px, rgba(255, 79, 163, 0.08) 68px 72px, transparent 72px 142px),
    repeating-linear-gradient(25deg, transparent 0 84px, rgba(0, 167, 142, 0.09) 84px 88px, transparent 88px 164px);
  background-size: 34px 34px, 34px 34px, auto, auto;
  opacity: 0.82;
}

.login-screen::after {
  background:
    linear-gradient(115deg, transparent 0 24%, rgba(255, 255, 255, 0.42) 44%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 246, 207, 0.32) 0 12px, rgba(246, 244, 255, 0.3) 12px 24px, rgba(230, 255, 248, 0.3) 24px 36px);
  mix-blend-mode: soft-light;
  opacity: 0.52;
}

.login-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(460px, 100%);
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

.login-grid.onboarding-open {
  width: min(1180px, 100%);
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
}

.login-card {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  gap: 22px;
  border: 2px solid #17212b;
  border-radius: 8px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.08), transparent 24%),
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 10px 10px 0 #17212b;
  overflow: hidden;
}

.login-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 46px;
  content: "";
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.48) 0 8px, transparent 8px 14px),
    linear-gradient(135deg, var(--lime), var(--accent));
  transform: translate(24px, -16px) rotate(12deg);
  z-index: 0;
  pointer-events: none;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.onboarding-toggle {
  justify-self: start;
}

.onboarding-card {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 18px;
  border: 2px solid #17212b;
  border-radius: 8px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(0, 167, 142, 0.08), transparent 26%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 10px 10px 0 rgba(23, 33, 43, 0.72);
  overflow: hidden;
}

.onboarding-card h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.98;
}

.onboarding-card p {
  color: var(--muted);
  font-weight: 700;
}

.onboarding-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.onboarding-close {
  flex: 0 0 auto;
}

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

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

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

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

.login-card h1 {
  font-size: clamp(2.1rem, 8vw, 3.8rem);
  line-height: 0.95;
}

.metallic-word {
  display: inline-block;
  color: #c9a85b;
  background:
    linear-gradient(110deg, #6f5726 0%, #f7e7ac 18%, #fff9df 30%, #b88a2d 45%, #f4d67a 62%, #8d6a24 78%, #fff2b6 100%);
  background-size: 220% 100%;
  background-position: 55% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 8px 24px rgba(184, 138, 45, 0.22);
}

.login-subtitle {
  max-width: 34ch;
  color: var(--muted);
  font-weight: 700;
}

.login-brand span,
.login-note {
  color: var(--muted);
}

.login-note {
  margin: 0;
  font-size: 0.9rem;
}

.soft-rule {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  color: #f8fbff;
  background:
    linear-gradient(180deg, rgba(255, 79, 163, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(199, 244, 100, 0.08), transparent 34%),
    linear-gradient(160deg, #272133 0%, #17212b 52%, #102d37 100%);
  box-shadow: 12px 0 34px rgba(23, 33, 43, 0.18);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--blue) 52%, var(--accent));
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0, 167, 142, 0.2);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.brand-block strong,
.profile-card strong {
  display: block;
}

.brand-block span,
.profile-card span {
  color: #c8d3de;
  font-size: 0.9rem;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #aebdcb;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.role-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: #dbe6ef;
  background: transparent;
}

.role-tab.active {
  color: var(--ink);
  background: linear-gradient(135deg, #fff, #eafff8);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  font-weight: 800;
}

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

.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #e7eef6;
  background: transparent;
  text-align: left;
  overflow: hidden;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(0, 167, 142, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-item.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  content: "";
  background: linear-gradient(180deg, var(--lime), var(--accent));
}

.nav-item-biometric {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(199, 244, 100, 0.32);
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 167, 142, 0.12));
}

.nav-item-biometric::after,
.mobile-tab[data-mobile-view="biometrics"]::after,
.mobile-more-item[data-mobile-view="biometrics"]::after {
  content: "New";
  border-radius: 999px;
  padding: 2px 7px;
  color: #084c43;
  background: linear-gradient(135deg, #c7f464, #eafff8);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-item-biometric::after {
  margin-left: auto;
}

.mobile-tab[data-mobile-view="biometrics"],
.mobile-more-item[data-mobile-view="biometrics"] {
  position: relative;
}

.mobile-tab[data-mobile-view="biometrics"]::after {
  position: absolute;
  top: -7px;
  right: 4px;
}

.profile-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.main {
  min-width: 0;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0)),
    transparent;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(217, 225, 234, 0.72);
  border-radius: 8px;
  padding: 12px;
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

h2 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.top-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.top-actions > * {
  min-width: 0;
  max-width: 100%;
}

.top-actions select {
  width: auto;
  min-width: 180px;
  max-width: min(260px, 100%);
}

.live-clock {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(198, 209, 220, 0.9);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: linear-gradient(135deg, #fff, #f8fffd);
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.06);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.employee-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 36%),
    repeating-linear-gradient(120deg, transparent 0 18px, rgba(255, 255, 255, 0.05) 18px 20px, transparent 20px 42px),
    linear-gradient(135deg, #17212b, #3366ff 52%, #00a78e);
  box-shadow: var(--shadow);
}

.employee-hero::after {
  position: absolute;
  right: -20px;
  bottom: -34px;
  width: 220px;
  height: 96px;
  content: "";
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 8px, transparent 8px 16px),
    linear-gradient(135deg, rgba(199, 244, 100, 0.42), rgba(255, 79, 163, 0.24));
  transform: rotate(-10deg);
  opacity: 0.7;
  pointer-events: none;
}

.employee-hero > * {
  position: relative;
  z-index: 1;
}

.employee-hero .eyebrow,
.employee-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.employee-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.hero-badge {
  display: grid;
  min-width: 180px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  text-align: right;
}

.hero-badge span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-badge strong {
  font-size: 1.5rem;
}

.notice-board {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.3), transparent 34%),
    linear-gradient(90deg, #fff6cf, #eafff8);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.notice-board span {
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.notice-track {
  overflow: hidden;
  white-space: nowrap;
}

.notice-track strong {
  display: inline-block;
  min-width: 100%;
  animation: ticker-slide 18s linear infinite;
}

@keyframes ticker-slide {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.table-note {
  padding: 12px 14px;
  color: var(--accent-dark);
  background: #eafff8;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 800;
}

.profile-photo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 2px solid #fff;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.14);
}

.profile-photo-initials {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

select,
input,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #fbfdff);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(51, 102, 255, 0.12);
}

input[type="file"] {
  overflow: hidden;
  text-overflow: ellipsis;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--accent);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.table-wrap,
.form-panel {
  border: 1px solid rgba(198, 209, 220, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 252, 255, 0.98)),
    var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--pink));
  pointer-events: none;
}

.metric:nth-child(2n)::before {
  background: linear-gradient(90deg, var(--blue), var(--pink));
}

.metric:nth-child(3n)::before {
  background: linear-gradient(90deg, var(--lime), var(--accent));
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.attendance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 18px;
  align-items: start;
}

.attendance-layout > * {
  min-width: 0;
}

.overview-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.overview-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel,
.form-panel {
  position: relative;
  min-width: 0;
  overflow: clip;
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

@supports not (overflow: clip) {
  .panel,
  .form-panel {
    overflow: hidden;
  }
}

.panel::before,
.form-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 8px 8px 0 0;
  content: "";
  background: linear-gradient(90deg, rgba(0, 167, 142, 0.9), rgba(51, 102, 255, 0.76), rgba(255, 79, 163, 0.72));
  opacity: 0.36;
  pointer-events: none;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
}

.panel-title-row > * {
  min-width: 0;
  max-width: 100%;
}

.panel-title-row .action-row {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.panel-title-row h2 {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.panel-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.historical-payslip-panel {
  margin-top: 18px;
}

.historical-payslip-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin-bottom: 14px;
}

.historical-payslip-form .primary-button {
  align-self: end;
}

.historical-note-field {
  grid-column: span 2;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  overflow-wrap: anywhere;
}

.historical-payslip-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 8px 0 14px;
}

.historical-payslip-summary .break-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.historical-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.historical-payslip-table td,
.historical-payslip-table th {
  min-width: 118px;
}

.attention-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  box-shadow: 0 10px 18px rgba(255, 79, 163, 0.16);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.attention-pill.quiet {
  color: var(--accent-dark);
  background: #eafff8;
  box-shadow: none;
}

.leave-approval-panel {
  min-height: 148px;
}

.clean-nested-table {
  border: 0;
  box-shadow: none;
}

.month-switcher {
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff, #f8fffd);
}

.month-switcher .field {
  width: min(220px, 100%);
}

.employee-profile-panel {
  margin-top: 18px;
}

.profile-panel-head,
.staff-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-panel-head {
  margin-bottom: 14px;
}

.profile-panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.table-wrap {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.mobile-card-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.mobile-record-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.16), transparent 34%),
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--shadow-soft);
}

.mobile-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.mobile-record-head > div {
  min-width: 0;
}

.mobile-record-head strong {
  display: block;
  overflow-wrap: anywhere;
}

.mobile-record-head .status {
  flex: 0 1 auto;
  min-width: 0;
}

.mobile-record-head span:not(.status),
.mobile-field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.mobile-field {
  min-width: 0;
  border: 1px solid rgba(217, 225, 234, 0.86);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.mobile-field strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.mobile-card-actions,
.mobile-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.mobile-card-actions > *,
.mobile-action-bar > * {
  flex: 1 1 128px;
  min-width: 0;
}

.mobile-record-card .inline-edit,
.mobile-record-card .compact-action-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.mobile-record-card input,
.mobile-record-card select,
.mobile-record-card textarea,
.mobile-record-card button {
  min-height: 44px;
}

.mobile-edit-details {
  min-width: 0;
}

.mobile-edit-details summary {
  min-height: 44px;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 900;
}

.mobile-edit-details[open] summary {
  margin-bottom: 10px;
}

.mobile-staff-form {
  margin-top: 10px;
}

.mobile-sheet-page {
  min-width: 0;
}

.mobile-scroll-hint {
  display: none;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.monthly-table {
  min-width: 1180px;
}

.leave-table {
  min-width: 1080px;
  table-layout: fixed;
}

.leave-table th,
.leave-table td {
  vertical-align: top;
}

.leave-col-employee,
.leave-cell-employee {
  width: 170px;
}

.leave-col-type {
  width: 120px;
}

.leave-col-dates {
  width: 180px;
}

.leave-col-days {
  width: 74px;
}

.leave-col-status,
.leave-cell-status {
  width: 140px;
}

.leave-col-action,
.leave-action-cell {
  width: 150px;
  min-width: 150px;
}

.leave-cell-reason {
  min-width: 0;
  overflow-wrap: anywhere;
}

.leave-action-cell .compact-action-form {
  width: 100%;
  min-width: 118px;
}

.leave-action-cell button,
.leave-action-cell select {
  min-width: 118px;
}

th,
td {
  min-width: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  background: linear-gradient(180deg, #fff, #f4f8fb);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover td {
  background: #fbfffd;
}

tr:last-child td {
  border-bottom: 0;
}

tfoot td {
  border-top: 2px solid var(--ink);
  background: linear-gradient(180deg, #fff, #eefaf8);
  font-weight: 800;
}

.status {
  display: inline-flex;
  min-width: 84px;
  max-width: 100%;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.status.pending {
  color: #6e4300;
  background: #fff0d7;
}

.status.approved {
  color: #0e5e34;
  background: #dcf5e8;
}

.status.applied {
  color: #0e5e34;
  background: #dcf5e8;
}

.status.needs-review {
  color: #6e4300;
  background: #fff0d7;
}

.status.present {
  color: #0e5e34;
  background: #dcf5e8;
}

.status.absent {
  color: #8b2323;
  background: #f9dddd;
}

.status.half-day {
  color: #765100;
  background: #fff4c9;
}

.status.hold {
  color: #765100;
  background: #fff4c9;
}

.status.weekly-off,
.status.holiday,
.status.approved-leave {
  color: #184f84;
  background: #e1eefc;
}

.status.rejected {
  color: #8b2323;
  background: #f9dddd;
}

.status.cancelled,
.status.denied {
  color: #5e6670;
  background: #edf0f3;
}

.status.paid {
  color: #0e5e34;
  background: #dcf5e8;
}

.status.processed-to-bank,
.status.processed-cash,
.status.payment-processed {
  color: #0e5e34;
  background: #dcf5e8;
}

.action-row,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.action-row > *,
.dialog-actions > * {
  min-width: 0;
}

.inline-edit {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.inline-edit input {
  width: 100%;
}

.compact-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  min-width: 0;
  max-width: 100%;
}

.compact-action-form input,
.compact-action-form select {
  min-height: 36px;
  width: 100%;
  min-width: 0;
}

.compact-action-form button {
  min-height: 36px;
  width: 100%;
  min-width: 88px;
}

.salary-status-form {
  display: grid;
  min-width: 150px;
  gap: 8px;
}

.salary-status-form .status {
  width: fit-content;
}

.salary-status-form select,
.salary-status-form button {
  min-height: 34px;
}

.attendance-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto auto;
  gap: 10px;
  align-items: end;
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.18), transparent 32%),
    linear-gradient(180deg, #fff, #f8fbff);
}

.attendance-toolbar .field {
  max-width: 260px;
}

.attendance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.attendance-actions button {
  flex: 1 1 84px;
  min-width: 0;
}

.attendance-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.attendance-check-list {
  display: grid;
  min-width: 0;
  max-height: 440px;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.attendance-check-row {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #f8fbff);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.attendance-check-row:focus-visible {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(51, 102, 255, 0.12);
}

.attendance-check-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.attendance-check-row > div:last-child {
  text-align: left;
}

.attendance-check-row span:not(.status) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.attendance-check-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attendance-open-hint {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent-dark) !important;
  background: #eafff8;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
}

.attendance-table {
  min-width: 760px;
}

.smart-attendance-card {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(198, 209, 220, 0.88);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.28), transparent 34%),
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--shadow);
}

.biometric-card {
  border-color: rgba(0, 167, 142, 0.34);
}

.biometric-card.biometric-inactive {
  background:
    linear-gradient(135deg, rgba(255, 240, 215, 0.56), transparent 36%),
    linear-gradient(180deg, #fff, #fbfdff);
}

.biometric-card.biometric-active {
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.34), transparent 34%),
    linear-gradient(180deg, #fff, #f3fffb);
}

.biometric-control-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(0, 167, 142, 0.24);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.16), transparent 42%),
    linear-gradient(180deg, #fff, #f8fffd);
}

.biometric-control-card strong {
  display: block;
  margin: 2px 0 4px;
}

.biometric-control-card p {
  margin: 0;
  color: var(--muted);
}

.biometric-enable-toggle {
  min-height: 44px;
  border: 1px solid #a9d7d3;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--accent-dark);
  background: #eafff8;
}

.native-biometric-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(51, 102, 255, 0.24);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(51, 102, 255, 0.1), transparent 42%),
    linear-gradient(180deg, #fff, #f8fbff);
}

.native-biometric-card h3 {
  margin: 2px 0 0;
}

.native-biometric-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.native-status-grid > div,
.native-prompt-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.native-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.native-status-grid strong,
.native-prompt-card strong {
  overflow-wrap: anywhere;
}

.native-prompt-card {
  display: grid;
  gap: 10px;
  border-color: rgba(0, 167, 142, 0.34);
  background: #f2fffb;
}

.native-prompt-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.smart-attendance-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.smart-attendance-hero h2 {
  margin-bottom: 6px;
}

.smart-attendance-hero p,
.smart-event-card p {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.smart-action-grid button {
  min-height: 48px;
}

.smart-note-field textarea {
  min-height: 64px;
}

.smart-event-list,
.smart-review-list,
.smart-office-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.smart-event-card,
.smart-office-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.smart-event-card strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}

.smart-review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.smart-review-actions button {
  min-height: 38px;
}

.smart-setup-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.smart-office-card .form-grid {
  gap: 10px;
}

.checkbox-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}

.attendance-calendar-body {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #f8fbff;
}

.attendance-calendar-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.attendance-calendar-summary div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.attendance-calendar-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.attendance-calendar-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}

.attendance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attendance-legend span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.attendance-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.attendance-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.attendance-day {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f0f3f6;
}

.attendance-day strong {
  font-size: 0.94rem;
}

.attendance-day span {
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.attendance-day.present,
.attendance-legend i.present {
  color: #0e5e34;
  border-color: #9bd7b3;
  background: #dcf5e8;
}

.attendance-day.absent,
.attendance-legend i.absent {
  color: #8b2323;
  border-color: #efabab;
  background: #f9dddd;
}

.attendance-day.half-day,
.attendance-legend i.half-day {
  color: #765100;
  border-color: #f0d06b;
  background: #fff4c9;
}

.attendance-day.holiday,
.attendance-legend i.holiday {
  color: #765100;
  border-color: #efd77f;
  background: #fff6cf;
}

.attendance-day.approved-leave,
.attendance-legend i.approved-leave {
  color: #184f84;
  border-color: #a9ccef;
  background: #e1eefc;
}

.attendance-day.unmarked,
.attendance-legend i.unmarked {
  color: #5e6670;
  border-color: #d7dde4;
  background: #edf0f3;
}

.attendance-day.muted-cell {
  min-height: 76px;
  background: transparent;
}

.monthly-edit {
  display: grid;
  grid-template-columns: minmax(240px, 1fr);
  gap: 10px;
  align-items: stretch;
  min-width: 280px;
}

.row-editor {
  min-width: 300px;
}

.row-editor summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid #a9d7d3;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--accent-dark);
  background: linear-gradient(135deg, #eefaf8, #fff);
  box-shadow: 0 8px 16px rgba(0, 167, 142, 0.08);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.row-editor summary::-webkit-details-marker {
  display: none;
}

.row-editor[open] summary {
  margin-bottom: 10px;
}

.monthly-edit-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.monthly-edit-group > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.monthly-edit-group label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.monthly-edit-group input,
.monthly-edit-group select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
}

.process-group {
  grid-template-columns: minmax(0, 1fr) auto;
}

.process-group > span {
  grid-column: 1 / -1;
}

.process-group label {
  min-width: 0;
}

.data-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.data-stack span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.data-stack b {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.calendar-cell {
  display: grid;
  align-content: start;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #fbfdff);
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.calendar-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.holiday-cell {
  border-color: #b9d8d4;
  background: linear-gradient(135deg, #effaf8, #fff);
}

.off-cell {
  background:
    repeating-linear-gradient(135deg, rgba(101, 113, 129, 0.08) 0 8px, transparent 8px 16px),
    #f0f3f6;
}

.muted-cell {
  background: transparent;
  border-style: dashed;
}

.policy-preview {
  border: 1px solid #b9d8d4;
  border-radius: 8px;
  padding: 10px;
  color: var(--accent-dark);
  background: linear-gradient(135deg, #effaf8, #fff);
  font-size: 0.9rem;
}

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

.help-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.help-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.help-card li {
  margin: 7px 0;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.hub-card,
.post-card,
.mini-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow);
}

.hub-card,
.post-card,
.mini-panel,
.request-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hub-card p,
.post-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.profile-score-card {
  border: 2px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(199, 244, 100, 0.26), transparent 34%),
    linear-gradient(135deg, #fff6cf, #fff, #eafff8);
  box-shadow: var(--shadow-pop);
}

.profile-score-card strong {
  display: block;
  margin: 6px 0;
  font-size: 2rem;
}

.post-stack {
  display: grid;
  gap: 10px;
}

.post-card h3 {
  margin: 6px 0;
}

.post-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pinned-post {
  border-color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.1), transparent 30%),
    #fff6cf;
  box-shadow: var(--shadow-pop);
}

.welcome-card {
  background:
    linear-gradient(135deg, rgba(51, 102, 255, 0.1), transparent 32%),
    #eefaf8;
}

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

.culture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

.request-stack {
  display: grid;
  gap: 14px;
}

.request-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow-soft);
}

.request-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.request-head p {
  margin: 0;
  color: var(--muted);
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.review-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.mini-panel {
  box-shadow: none;
}

.mini-panel > strong {
  display: block;
  margin-bottom: 10px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.post-pin-row {
  width: fit-content;
  max-width: 100%;
  min-height: 40px;
}

.staff-details-table {
  min-width: 1040px;
}

.staff-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  align-items: end;
}

.staff-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.staff-form button {
  justify-self: start;
}

.staff-form legend {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.staff-form label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
}

.staff-form input,
.staff-form select {
  min-height: 34px;
  width: 100%;
  padding: 6px 8px;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.staff-doc-links {
  grid-column: 1 / -1;
  margin: 0;
}

.doc-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #a9d7d3;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: linear-gradient(135deg, #eefaf8, #fff);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.muted-doc {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  border-radius: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(23, 33, 43, 0.07);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-color: rgba(255, 255, 255, 0.16);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--blue));
  box-shadow: 0 12px 24px rgba(0, 167, 142, 0.18);
}

.secondary-button {
  color: var(--accent-dark);
  border-color: #a9d7d3;
  background: linear-gradient(135deg, #eefaf8, #fff);
}

.ghost-button {
  color: var(--ink);
  border-color: var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #ff4f73);
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--ink);
  border-color: var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.salary-breakdown {
  display: grid;
  gap: 10px;
}

.break-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.break-row span,
.break-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.break-row strong {
  text-align: right;
}

.break-row:last-child {
  border-bottom: 0;
  font-weight: 900;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(51, 102, 255, 0.05) 0 8px, transparent 8px 18px),
    linear-gradient(180deg, #fff, #fbfdff);
}

dialog {
  width: min(980px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.24);
}

dialog::backdrop {
  background: rgba(18, 27, 37, 0.48);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#payslipPreview {
  padding: 18px;
  background: #eef7f5;
}

.payslip-paper {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 22px 64px rgba(23, 33, 43, 0.14);
  font-size: 0.88rem;
  line-height: 1.35;
}

.payslip-paper::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--blue) 48%, var(--pink));
}

.payslip-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
  padding-top: 8px;
}

.payslip-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.payslip-logo,
.payslip-logo-fallback {
  flex: 0 0 auto;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  object-fit: contain;
  font-weight: 900;
}

.payslip-brand h2 {
  margin: 3px 0;
  font-size: 1.45rem;
}

.payslip-brand p,
.payslip-net-card p,
.payslip-footnote p {
  margin: 0;
  color: var(--muted);
}

.payslip-brand span,
.payslip-kicker,
.payslip-info-row span,
.payslip-line span,
.payslip-mini-strip span,
.payslip-note span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.payslip-net-card {
  display: grid;
  gap: 5px;
  border-radius: 16px;
  padding: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--blue) 58%, var(--accent));
  box-shadow: 0 14px 34px rgba(51, 102, 255, 0.22);
}

.payslip-net-card span,
.payslip-net-card p {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.payslip-net-card strong {
  font-size: 1.7rem;
  line-height: 1;
}

.payslip-status-pill {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payslip-mini-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.payslip-mini-strip div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: #f8fbff;
}

.payslip-mini-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}

.payslip-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.payslip-card,
.payslip-money-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background: #fff;
}

.payslip-money-card {
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.payslip-card h3,
.payslip-money-card h3 {
  margin: 0 0 9px;
  font-size: 0.9rem;
}

.payslip-info-row,
.payslip-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #edf1f5;
}

.payslip-info-row:last-child,
.payslip-line:last-child {
  border-bottom: 0;
}

.payslip-info-row strong,
.payslip-line strong {
  text-align: right;
}

.payslip-money-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.payslip-subhead {
  margin: 10px 0 3px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payslip-subhead:first-of-type {
  margin-top: 0;
}

.payslip-line.total {
  margin-top: 5px;
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  font-weight: 900;
}

.payslip-line.highlight strong {
  color: var(--accent);
  font-size: 1rem;
}

.payslip-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 12px;
  background: #fff6cf;
}

.payslip-note strong {
  display: block;
  margin-top: 4px;
}

.payslip-stamp {
  border: 1px dashed var(--accent);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.payslip-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.dialog-actions {
  justify-content: flex-end;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 8px;
  color: #fff;
  background: #182430;
  box-shadow: var(--shadow);
}

.muted-doc:hover,
.doc-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(0, 167, 142, 0.1);
}

@media (hover: hover) {
  .primary-button:hover,
  .secondary-button:hover,
  .ghost-button:hover,
  .danger-button:hover,
  .icon-button:hover,
  .role-tab:hover,
  .nav-item:hover {
    transform: translateY(-1px);
  }

  .metric:hover,
  .panel:hover,
  .form-panel:hover,
  .help-card:hover,
  .hub-card:hover,
  .post-card:hover,
  .request-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 22px 48px rgba(31, 45, 61, 0.16);
    transform: translateY(-2px);
  }

  .attendance-check-row:hover,
  .calendar-cell:hover {
    border-color: #a9d7d3;
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
  }
}

@media (max-width: 1180px) {
  .content-grid,
  .overview-home-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar > div:first-child {
    flex: 1 1 260px;
    min-width: 0;
  }

  .top-actions {
    flex: 1 1 320px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  *,
  *::before,
  *::after {
    min-width: 0;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  .mobile-card-list.mobile-only {
    display: grid;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .table-wrap {
    overflow-x: auto;
  }

  dialog {
    width: min(760px, calc(100% - 20px));
    max-width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    overflow: hidden;
  }

  #payslipPreview,
  #attendanceCalendarPreview {
    max-height: calc(100dvh - 156px);
    overflow-y: auto;
  }

  .sidebar {
    display: none;
  }

  .profile-card {
    margin-top: 0;
  }

  .mobile-appbar {
    position: sticky;
    top: 0;
    z-index: 16;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid rgba(217, 225, 234, 0.78);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-appbar .brand-block {
    min-width: 0;
  }

  .mobile-appbar .brand-mark {
    width: 40px;
    height: 40px;
  }

  .mobile-appbar span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-appbar strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .mobile-menu-button {
    min-width: 74px;
    min-height: 40px;
  }

  .mobile-tabbar {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 18;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid rgba(198, 209, 220, 0.9);
    border-radius: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px rgba(23, 33, 43, 0.2);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-tab {
    min-width: 0;
    min-height: 48px;
    border: 0;
    border-radius: 7px;
    padding: 4px 6px;
    color: var(--muted);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 900;
  }

  .mobile-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--ink), var(--accent));
    box-shadow: 0 10px 18px rgba(0, 167, 142, 0.18);
  }

  .mobile-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    display: grid;
    align-items: end;
    padding: 12px;
    background: rgba(18, 27, 37, 0.42);
  }

  .mobile-more-sheet {
    display: grid;
    max-height: min(78dvh, 620px);
    gap: 14px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 24px 64px rgba(23, 33, 43, 0.28);
  }

  .mobile-more-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-more-head h2 {
    margin-bottom: 0;
  }

  .mobile-role-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px;
    background: #f8fbff;
  }

  .mobile-role-switch button {
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-weight: 900;
  }

  .mobile-role-switch button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--accent));
  }

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

  .mobile-more-group {
    display: grid;
    gap: 7px;
  }

  .mobile-more-group + .mobile-more-group {
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .mobile-more-group-title {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .mobile-more-item {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fbfdff;
    text-align: left;
  }

  .mobile-more-item span,
  .mobile-more-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-more-item strong {
    color: var(--accent-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
  }

  .mobile-more-item.active {
    border-color: #a9d7d3;
    background: #eafff8;
  }

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

  .content-grid,
  .attendance-layout,
  .login-grid,
  .review-grid,
  .historical-payslip-form,
  .historical-payslip-summary {
    grid-template-columns: 1fr;
  }

  .login-grid.onboarding-open {
    width: min(460px, 100%);
    grid-template-columns: 1fr;
  }

  .onboarding-card {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  * {
    min-width: 0;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  .mobile-card-list.mobile-only {
    display: grid;
  }

  .main {
    padding: 14px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .mobile-appbar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .mobile-tabbar {
    right: 8px;
    left: 8px;
  }

  .mobile-tab {
    min-height: 50px;
    font-size: 0.72rem;
  }

  .login-screen {
    min-height: 100dvh;
    padding: 12px;
    place-items: stretch;
    overflow-x: hidden;
  }

  .login-grid,
  .login-grid.onboarding-open {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
    gap: 14px;
  }

  .login-card,
  .onboarding-card {
    align-self: center;
    width: 100%;
    max-width: calc(100vw - 24px);
    min-width: 0;
    padding: 20px;
    box-shadow: 5px 5px 0 #17212b;
  }

  .onboarding-head {
    display: grid;
    gap: 10px;
  }

  .onboarding-close {
    justify-self: start;
  }

  .onboarding-form,
  .form-grid,
  .field,
  label,
  .login-note {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
    font-size: 16px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    min-height: 44px;
    white-space: normal;
  }

  input[type="file"] {
    min-height: 48px;
    padding: 10px 8px;
    font-size: 14px;
  }

  .topbar,
  .payslip-hero,
  .employee-hero,
  .smart-attendance-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    margin-bottom: 14px;
    padding: 10px;
    overflow: hidden;
  }

  .topbar > div:first-child {
    display: none;
  }

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

  .top-actions > * {
    width: 100%;
  }

  .top-actions select {
    width: 100%;
    max-width: 100%;
  }

  .top-actions .live-clock {
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 36px;
    font-size: 0.78rem;
    white-space: normal;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .historical-note-field {
    grid-column: auto;
  }

  .historical-payslip-form .primary-button,
  .historical-payslip-form .checkbox-row,
  .historical-row-actions > * {
    width: 100%;
  }

  .hero-badge {
    width: 100%;
    text-align: left;
  }

  .nav-list,
  .content-grid,
  .attendance-layout,
  .overview-home-grid,
  .hub-grid,
  .help-grid,
  .mini-grid,
  .culture-grid,
  .two-col,
  .review-grid,
  .self-profile-form,
  .staff-form,
  .monthly-edit-group,
  .compact-action-form,
  .attendance-toolbar,
  .payslip-info-grid,
  .payslip-money-grid,
  .payslip-note {
    grid-template-columns: 1fr;
  }

  .smart-action-grid,
  .smart-review-actions,
  .native-status-grid,
  .native-prompt-actions,
  .biometric-control-card {
    grid-template-columns: 1fr;
  }

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

  .metric {
    padding: 14px;
  }

  .payslip-paper {
    border-radius: 14px;
    padding: 18px;
  }

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

  .payslip-footnote {
    flex-direction: column;
  }

  .attendance-toolbar .field {
    max-width: none;
  }

  .attendance-check-row {
    grid-template-columns: 1fr;
  }

  .attendance-check-row > div:last-child {
    text-align: left;
  }

  .attendance-calendar-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-month-grid {
    gap: 4px;
  }

  .attendance-day {
    min-height: 58px;
    padding: 6px;
  }

  .attendance-day span {
    font-size: 0.6rem;
    overflow-wrap: anywhere;
  }

  .notice-board {
    grid-template-columns: 1fr;
  }

  .break-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .break-row strong {
    text-align: left;
  }

  .metric strong {
    font-size: 1.35rem;
    overflow-wrap: anywhere;
  }

  table {
    min-width: 640px;
  }

  .monthly-table,
  .staff-details-table {
    min-width: 760px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .calendar-head {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }

  .calendar-cell {
    min-height: 54px;
    padding: 6px 4px;
  }

  .calendar-cell strong {
    font-size: 0.86rem;
  }

  .calendar-cell span {
    font-size: 0.52rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .attendance-month-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .mobile-field-grid {
    grid-template-columns: 1fr;
  }

  .mobile-card-actions,
  .mobile-action-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .mobile-scroll-hint {
    display: block;
  }

  dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .dialog-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }

  #payslipPreview,
  #attendanceCalendarPreview {
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .metric-grid,
  .payslip-mini-strip,
  .attendance-calendar-summary {
    grid-template-columns: 1fr;
  }

  .calendar-cell {
    min-height: 48px;
  }

  .calendar-label {
    font-size: 0.58rem;
  }

  .mobile-tab {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-screen::before,
  .login-screen::after {
    animation: none;
  }

  .metallic-word {
    animation: none;
    background-position: 55% 50%;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body * {
    visibility: hidden;
  }

  #payslipPreview,
  #payslipPreview * {
    visibility: visible;
  }

  #payslipPreview {
    position: fixed;
    inset: 0;
    padding: 0;
    background: #fff;
  }

  .payslip-paper {
    max-width: none;
    border-radius: 12px;
    box-shadow: none;
    break-inside: avoid;
  }

  .payslip-paper::before,
  .payslip-net-card {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
