@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./assets/plus-jakarta-sans-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 200 800;
}

:root {
  --primary: #1b5ae8;
  --primary-dark: #1448c5;
  --primary-light: #eef1ff;
  --ink: #0b1026;
  --muted: #5a6480;
  --line: #e6e9f2;
  --surface: #f6f8fc;
  --panel: #fff;
  --sidebar: 232px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
h1, h2, p { margin: 0; }
svg, img { display: block; flex: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 30; border-radius: 8px; padding: 8px 12px; background: white; color: var(--primary); }
.muted { color: var(--muted); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  width: var(--sidebar);
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 25px 16px 15px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 7px; padding: 0 8px; align-self: flex-start; }
.brand img { width: 115px; height: auto; }
.brand span { padding: 3px 7px; border-radius: 6px; color: var(--primary-dark); background: var(--primary-light); font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.company {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin: 30px 0 25px;
  padding: 10px;
}
.company > div:last-child, .account > div { min-width: 0; }
.company strong, .account strong, .person strong, .request-row strong { display: block; font-size: .88rem; font-weight: 750; }
.company strong { overflow-wrap: anywhere; }
.account strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company small, .account small, .person small, .request-row small, .cell-meta { display: block; color: var(--muted); font-size: .78rem; margin-top: 1px; }
.tile { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; }
.company .tile { width: 35px; height: 35px; border-radius: 9px; }
.tone-blue { color: var(--primary-dark); background: var(--primary-light); }
.tone-green { color: #08785a; background: #e4f6ef; }
.tone-amber { color: #9d5210; background: #fff1df; }
.tone-violet { color: #6940b8; background: #f0eafe; }
.tone-rose { color: #aa315e; background: #fceaf1; }
.tone-slate { color: #465271; background: #eff1f6; }
.nav-heading { padding: 0 11px; margin: 0 0 8px; font-size: .75rem; font-weight: 750; color: var(--muted); }
.workspace-heading { margin-top: 27px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 11px; margin: 3px 0; border-radius: 9px; font-size: .9rem; font-weight: 650; color: #4e5c78; }
.nav-link:hover { background: #f5f7fc; color: var(--primary-dark); }
.nav-link[aria-current] { background: var(--primary-light); color: var(--primary-dark); font-weight: 800; }
.nav-link[aria-current]::after { position: absolute; content: ""; width: 3px; height: 16px; left: 0; top: calc(50% - 8px); border-radius: 5px; background: var(--primary); }
.sidebar-foot { margin-top: auto; padding-top: 34px; }
.demo-card { display: flex; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #f8faff; }
.demo-card .tile { width: 26px; height: 26px; border-radius: 7px; }
.demo-card strong { display: block; font-size: .82rem; }
.demo-card p { margin: 1px 0 5px; color: var(--muted); font-size: .75rem; }
.demo-card .text-button { font-size: .75rem; text-align: left; }

.workspace { margin-left: var(--sidebar); }
.topbar { height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 30px; background: var(--panel); border-bottom: 1px solid var(--line); }
.crumb, .top-actions, .top-date, .account { display: flex; align-items: center; }
.crumb { gap: 10px; font-size: .86rem; }
.crumb-root, .crumb-divider, .top-date { color: var(--muted); }
.crumb strong { font-weight: 750; }
.top-actions { gap: 17px; }
.top-date { gap: 7px; white-space: nowrap; font-size: .82rem; font-weight: 650; }
.top-separator { width: 1px; height: 27px; background: var(--line); }
.account { gap: 9px; max-width: 235px; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font-size: .75rem; font-weight: 800; }
.mobile-menu, .scrim { display: none !important; }
.main { width: 100%; max-width: 1510px; margin: auto; padding: 28px 30px 38px; outline: none; }
.page-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.page-heading { margin: 0 0 22px; }
.page-heading h1 { font-size: clamp(1.7rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.21; }
.page-heading p { color: var(--muted); margin-top: 6px; font-size: .92rem; }
.heading-actions:empty { display: none; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; min-height: 38px; font-size: .85rem; font-weight: 750; white-space: nowrap; color: var(--ink); background: transparent; }
.primary { background: var(--primary); color: #fff; box-shadow: 0 2px 3px #12398b20; }
.primary:hover { background: var(--primary-dark); }
.secondary { border-color: #dfe5f0; background: #fff; color: #2e3b58; }
.secondary:hover, .icon-button:hover { background: var(--primary-light); }
.danger { background: #fff1f2; border-color: #f9d4dc; color: #a52448; }
.danger:hover { background: #fce2e8; }
.text-button { display: inline-flex; align-items: center; font-size: .85rem; color: var(--primary-dark); font-weight: 750; white-space: nowrap; }
button.text-button { min-height: 0; padding: 0; border: 0; }
.text-button:hover { text-decoration: underline; }
.icon-button { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(108deg, #154fda 0%, #1b5ae8 52%, #316bed 100%);
  color: #fff;
  border-radius: 15px;
  padding: 20px 25px 23px;
  min-height: 169px;
}
.hero-lines { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.hero-lines span { position: absolute; display: block; left: 66%; top: 50%; width: 280px; height: 280px; border: 1px solid #ffffff32; border-radius: 48px; transform: translateY(-38%) rotate(-30deg); }
.hero-lines span:nth-child(2) { left: 72%; width: 300px; height: 300px; }
.hero-lines span:nth-child(3) { left: 78%; width: 320px; height: 320px; }
.hero-lines span:nth-child(4) { left: 84%; width: 340px; height: 340px; }
.hero-date { display: flex; align-items: center; gap: 7px; width: fit-content; padding: 3px 8px; background: #ffffff24; border-radius: 6px; font-size: .77rem; font-weight: 700; }
.hero h2 { font-size: 1.57rem; letter-spacing: -.045em; line-height: 1.2; margin: 9px 0 4px; font-weight: 800; }
.hero p { margin-bottom: 12px; font-size: .9rem; color: #f1f5ff; }
.hero-button { background: #fff; color: #1246be; min-height: 33px; padding: 6px 10px; font-size: .78rem; }
.hero-button:hover { background: #eaf0ff; }
.hero-button:focus-visible { outline-color: white; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin: 16px 0; }
.metric, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 2px 4px #202f5e04; min-width: 0; }
.metric { padding: 13px 16px 15px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.metric-top > span:first-child { font-size: .87rem; color: #46536d; font-weight: 700; }
.metric-top .tile { width: 34px; height: 34px; border-radius: 9px; }
.metric > strong { display: block; margin-top: 3px; font-size: 1.76rem; line-height: 1.1; letter-spacing: -.055em; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric > p { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 15px; margin-bottom: 16px; }
.panel-heading { padding: 16px 18px; }
.panel h2 { font-size: 1.04rem; font-weight: 800; letter-spacing: -.025em; }
.panel-heading p { font-size: .8rem; margin-top: 2px; color: var(--muted); }
.chart-scroll { overflow: auto; padding: 0 16px; }
.attendance-chart { width: 100%; min-width: 355px; height: auto; font-size: 13px; }
.attendance-chart text { fill: var(--muted); }
.gridline { stroke: #e5eaf4; stroke-dasharray: 3 3; }
.bar-present { fill: var(--primary); }
.bar-late { fill: #9dbafa; }
.legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; padding: 3px 14px 15px; color: var(--muted); font-size: .76rem; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 8px; height: 8px; background: var(--primary); border-radius: 2px; }
.legend span + span i { background: #9dbafa; }
.request-list { padding: 0 17px 10px; }
.request-row { display: flex; width: 100%; gap: 9px; padding: 10px 0; align-items: center; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.request-row:hover { background: #f7f9ff; }
.request-row .avatar { width: 32px; height: 32px; font-size: .69rem; }
.request-chevron { margin-left: auto; color: var(--muted); }
.recent { overflow: hidden; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: .88rem; }
thead { color: #4d5b79; background: #f6f8fe; }
th { font-weight: 750; font-size: .78rem; }
th, td { padding: 12px 16px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 18px; }
tbody tr:hover { background: #fafbff; }
.person { display: flex; align-items: center; gap: 9px; }
.person .avatar { width: 33px; height: 33px; font-size: .71rem; }
.badge { display: inline-block; border-radius: 20px; padding: 3px 9px; font-size: .75rem; font-weight: 750; }
.empty { display: grid; place-items: center; text-align: center; padding: 32px 14px; border-top: 1px solid var(--line); }
.empty strong { margin-top: 9px; font-size: .9rem; }
.empty p { color: var(--muted); font-size: .8rem; margin-top: 3px; }

.row-actions, .filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.filters { padding: 0 18px 15px; }
select, input, textarea { min-width: 0; min-height: 39px; border: 1px solid #dfe5f0; border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #fff; font-size: .86rem; }
select { appearance: none; padding-right: 29px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235a6480' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-position: right 7px center; background-repeat: no-repeat; background-size: 16px; }
select.compact { min-height: 32px; font-size: .78rem; padding-block: 4px; }
textarea { resize: vertical; }
.search-field { position: relative; max-width: 360px; width: 100%; }
.search-field svg { position: absolute; inset: 11px auto auto 10px; color: var(--muted); }
.search-field input { width: 100%; padding-left: 33px; }

.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.report-card { padding: 20px; }
.report-card h2 { margin: 10px 0 4px; }
.report-card p { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.settings-panel { max-width: 690px; }

dialog { width: min(94vw, 535px); max-height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--ink); box-shadow: 0 20px 85px #17213f38; }
dialog::backdrop { background: #10183978; }
.dialog-header { display: flex; justify-content: space-between; gap: 9px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.03em; }
.dialog-header p, .form-note { margin-top: 4px; font-size: .88rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 16px 20px 20px; }
.full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field label { font-size: .85rem; font-weight: 750; }
.form-error { padding: 8px 10px; border-radius: 7px; color: #982145; background: #fce9ed; font-size: .82rem; }
dialog > .form-error { margin: 12px 20px 0; }
.dialog-footer { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 9px; padding: 12px 0 0; }
.dialog-footer > .text-button:first-child { margin-right: auto; }
dialog > .dialog-footer { padding: 15px 20px 20px; }
.details { padding: 15px 20px 0; margin: 0; display: grid; gap: 12px; }
.details div { display: grid; grid-template-columns: 108px 1fr; gap: 7px; }
.details dt { color: var(--muted); font-size: .86rem; }
.details dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.access-note { padding: 16px 20px 0; font-size: .9rem; }
#toast { position: fixed; z-index: 5; display: flex; align-items: center; gap: 8px; right: 18px; bottom: 18px; max-width: calc(100vw - 36px); padding: 9px 14px 9px 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: .87rem; font-weight: 750; box-shadow: 0 8px 24px #1e315525; visibility: hidden; }
#toast.visible { visibility: visible; }
#toast .tile { width: 27px; height: 27px; border-radius: 7px; }

@media (min-width: 1530px) {
  .main { padding-inline: 38px; }
  .hero { padding-block: 25px; }
}
@media (max-width: 1070px) {
  :root { --sidebar: 203px; }
  .main, .topbar { padding-inline: 20px; }
  .metrics { gap: 10px; }
  .metric { padding-inline: 11px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.42fr) minmax(0,1fr); gap: 10px; }
  .panel-heading { padding-inline: 14px; }
  .chart-scroll { padding-inline: 10px; }
}
@media (max-width: 850px) {
  .sidebar { visibility: hidden; transform: translateX(-100%); transition: transform .2s ease, visibility 0s linear .2s; width: 235px; }
  .sidebar.open { visibility: visible; transform: none; transition-delay: 0s; }
  .workspace { margin: 0; }
  .mobile-menu { display: grid !important; }
  .scrim { display: block !important; position: fixed; z-index: 3; inset: 0; border: 0; background: #111c3b65; }
}
@media (max-width: 615px) {
  .main, .topbar { padding-inline: 14px; }
  .topbar { height: 58px; gap: 5px; }
  .top-date, .top-separator, .crumb-root, .crumb-divider, .account > div { display: none; }
  .crumb { gap: 5px; }
  .main { padding-top: 17px; }
  .page-heading { align-items: flex-start; margin-bottom: 15px; flex-wrap: wrap; }
  .page-heading p { margin-top: 4px; }
  .hero { padding: 17px; }
  .hero-lines span { left: 73%; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid, .report-grid { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; flex-wrap: wrap; }
  .panel-heading > .row-actions { max-width: 100%; }
  .form-grid { padding-inline: 14px; }
  .dialog-header { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
[hidden] { display: none !important; }
.settings-section { margin-bottom: 16px; }
.settings-section .access-note { padding-bottom: 18px; }
.integration-body { display: grid; gap: 12px; padding: 0 18px 16px; color: var(--muted); font-size: .88rem; }
.integration-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.integration-body form { align-items: end; }
.payroll-more { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: .88rem; }
.payroll-more summary { color: var(--primary-dark); font-weight: 700; cursor: pointer; }
.payroll-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; }
.portal-toolbar { margin: 17px 0; }
.leave-balance { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px; background: var(--primary-light); color: var(--primary-dark); font-size: .84rem; font-weight: 750; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.portal-grid .panel, .roster .table-scroll { overflow: hidden; }
.roster .table-scroll { overflow-x: auto; }
.roster th:first-child, .roster td:first-child { position: sticky; left: 0; z-index: 1; min-width: 155px; background: #fff; box-shadow: 1px 0 var(--line); }
.roster th:first-child { background: #f6f8fe; }
.roster td:not(:first-child) { min-width: 106px; padding: 6px; }
.roster-shift { display: grid; width: 100%; gap: 1px; padding: 7px 9px; text-align: left; border: 1px solid #dce6fc; border-radius: 8px; background: #edf3ff; color: #173d98; font-size: .77rem; }
.roster-shift:hover { background: #e3edff; }
.roster-shift small { color: var(--muted); font-size: .71rem; }
.roster-add { margin: auto; }
.help-line { margin: 14px 0; font-size: .9rem; color: var(--muted); }
.payslip { padding: 15px 21px 4px; }
.payslip h3 { margin: 0 0 13px; }
.payslip h3 small { margin-left: 5px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.payslip dl { margin: 0; }
.payslip dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.payslip dd { margin: 0; font-variant-numeric: tabular-nums; }
.payslip .pay-total { font-weight: 800; color: var(--primary-dark); }
@media (max-width: 920px) {
  .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 615px) {
  .portal-grid table { white-space: normal; font-size: .81rem; }
  .portal-grid th, .portal-grid td { padding: 9px 8px; }
  .portal-grid th { font-size: .74rem; }
  .portal-grid th:first-child, .portal-grid td:first-child { padding-left: 12px; }
  .portal-grid .badge, .portal-grid .text-button { font-size: .74rem; }
  .roster th:first-child, .roster td:first-child { min-width: 130px; }
  .roster td:not(:first-child) { min-width: 96px; }
}
@media print {
  body > :not(dialog), dialog .dialog-footer, dialog .icon-button { display: none !important; }
  body, :root { background: white; }
  dialog:has(.payslip) { position: static; display: block; width: min(100%, 650px); max-height: none; margin: 0; border: 0; box-shadow: none; }
  dialog::backdrop { background: transparent; }
}
