/* JK Sales premium UI layer
   Presentation only: no business logic, data or permission changes. */

:root {
  --jk-blue-50: #f4f8ff;
  --jk-blue-100: #eaf2ff;
  --jk-blue-200: #d7e6ff;
  --jk-blue-300: #b7d2ff;
  --jk-blue-500: #3478f6;
  --jk-blue-600: #2563eb;
  --jk-blue-700: #1d4ed8;
  --jk-blue-800: #1e40af;
  --jk-ink: #17243b;
  --jk-ink-soft: #40516b;
  --jk-muted: #6f7f95;
  --jk-line: #dce7f7;
  --jk-line-strong: #c6d8f2;
  --jk-surface: #ffffff;
  --jk-canvas: #f5f8fd;
  --jk-success: #0f9f82;
  --jk-success-soft: #e9f8f3;
  --jk-warning: #a86608;
  --jk-warning-soft: #fff7df;
  --jk-danger: #d6384b;
  --jk-danger-soft: #fff0f2;
  --jk-radius-sm: 10px;
  --jk-radius-md: 14px;
  --jk-radius-lg: 18px;
  --jk-radius-xl: 22px;
  --jk-shadow-sm: 0 1px 2px rgba(23,36,59,.04), 0 6px 18px rgba(37,99,235,.045);
  --jk-shadow-md: 0 2px 4px rgba(23,36,59,.05), 0 14px 34px rgba(37,99,235,.07);
  --jk-focus: 0 0 0 4px rgba(37,99,235,.16);
  --jk-control: 48px;
  --jk-nav-height: 76px;
  --jk-content: 1180px;
  --jk-speed: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  background: var(--jk-canvas);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body,
body.module-body {
  margin: 0;
  color: var(--jk-ink);
  background: var(--jk-canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-authenticated,
body.module-body { padding-bottom: calc(var(--jk-nav-height) + env(safe-area-inset-bottom) + 22px); }

body::before { display: none !important; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--jk-blue-600);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

/* Shell and header */
.app-shell { min-height: 100svh; background: transparent; }
.main,
.module-main {
  width: min(var(--jk-content), calc(100% - 32px));
  margin-inline: auto;
}
.module-main { padding: 24px 0 42px; }
.module-main--narrow { max-width: 860px; }

.topbar.employee-unified-topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  min-height: 76px;
  padding: 10px max(18px, calc((100vw - var(--jk-content)) / 2));
  padding-left: max(78px, calc((100vw - var(--jk-content)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(198,216,242,.9);
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 22px rgba(23,36,59,.045);
  backdrop-filter: saturate(135%) blur(10px);
}

.topbar.employee-unified-topbar .topbar__brand {
  min-width: 0;
  padding-left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(23,36,59,.12);
}
.topbar__identity { min-width: 0; }
.topbar__identity h1 {
  margin: 0;
  color: var(--jk-ink);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 800;
}
.topbar__welcome {
  margin-top: 5px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--jk-muted);
  font-size: 14px;
  line-height: 1.2;
}
.topbar__welcome strong { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--jk-ink-soft); }
.role-pill {
  margin-left: 4px;
  padding: 3px 8px;
  border: 1px solid var(--jk-blue-200);
  border-radius: 999px;
  color: var(--jk-blue-700);
  background: var(--jk-blue-50);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.global-controls { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.language-form {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--jk-blue-300);
  border-radius: 999px;
  background: var(--jk-surface);
}
.language-button {
  min-width: 52px;
  min-height: 40px;
  padding: 8px 14px;
  display: inline-grid;
  place-items: center;
  color: var(--jk-blue-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: background var(--jk-speed), color var(--jk-speed), transform var(--jk-speed);
}
.language-button.is-active { color: #fff; background: var(--jk-blue-600); }
.language-button:active { transform: scale(.97); }
.notification-bell {
  min-height: 40px;
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 11px;
  color: var(--jk-ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--jk-speed), color var(--jk-speed);
}
.notification-bell:hover { color: var(--jk-blue-700); background: var(--jk-blue-50); }
.notification-bell svg { fill: none; stroke: currentColor; stroke-width: 1.9; }
.notification-bell__count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--jk-muted);
  background: #edf2f9;
  font-size: 11px;
}
.notification-bell.has-unread .notification-bell__count { color: #fff; background: var(--jk-danger); }

/* Navigation */
.nav-toggle-button {
  position: fixed;
  z-index: 96;
  top: 18px;
  left: max(16px, calc((100vw - var(--jk-content)) / 2 - 62px));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--jk-blue-200);
  border-radius: 14px;
  color: var(--jk-blue-700);
  background: #fff;
  box-shadow: var(--jk-shadow-sm);
  cursor: pointer;
  font-size: 0;
  transition: transform var(--jk-speed), box-shadow var(--jk-speed), background var(--jk-speed);
}
.nav-toggle-button::before { content: "☰"; font-size: 20px; line-height: 1; }
.nav-toggle-button:hover { background: var(--jk-blue-50); box-shadow: var(--jk-shadow-md); }
.nav-toggle-button:active { transform: scale(.95); }
.section-nav.employee-module-nav,
.section-nav {
  position: fixed;
  z-index: 94;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(304px, 82vw);
  padding: 82px 16px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  border-right: 1px solid var(--jk-line);
  background: #fff;
  box-shadow: 18px 0 48px rgba(23,36,59,.14);
  transform: translateX(-105%);
  transition: transform 220ms ease;
}
.nav-toggle:checked ~ .section-nav { transform: translateX(0); }
.nav-scrim { position: fixed; z-index: 92; inset: 0; visibility: hidden; opacity: 0; background: rgba(20,33,53,.38); transition: opacity 220ms ease, visibility 220ms; }
.nav-toggle:checked ~ .nav-scrim { visibility: visible; opacity: 1; }
.section-nav__item {
  min-height: 46px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--jk-ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: color var(--jk-speed), background var(--jk-speed), border-color var(--jk-speed), transform var(--jk-speed);
}
.section-nav__item:hover { color: var(--jk-blue-700); background: var(--jk-blue-50); border-color: var(--jk-blue-100); transform: translateX(2px); }
.section-nav__item.is-active { color: var(--jk-blue-700); background: var(--jk-blue-100); border-color: var(--jk-blue-200); }
.nav-section-label { margin: 15px 10px 3px; color: var(--jk-muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.module-link__badge { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--jk-danger); font-size: 11px; }
.nav-logout-form { margin-top: auto; padding-top: 15px; border-top: 1px solid var(--jk-line); }
.nav-logout-button { width: 100%; min-height: 44px; border: 1px solid #f2cbd1; border-radius: 12px; color: var(--jk-danger); background: var(--jk-danger-soft); font-weight: 800; cursor: pointer; }

.mobile-bottom-nav {
  position: fixed;
  z-index: 88;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: calc(var(--jk-nav-height) + env(safe-area-inset-bottom));
  padding: 7px max(10px, calc((100vw - 760px) / 2)) calc(7px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(var(--mobile-nav-count), minmax(0,1fr));
  gap: 4px;
  border-top: 1px solid var(--jk-line);
  background: rgba(255,255,255,.98);
  box-shadow: 0 -10px 30px rgba(23,36,59,.075);
  backdrop-filter: saturate(140%) blur(12px);
}
.mobile-bottom-nav__item {
  min-width: 0;
  min-height: 58px;
  padding: 7px 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  color: #63738a;
  text-decoration: none;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  transition: color var(--jk-speed), background var(--jk-speed), transform var(--jk-speed);
}
.mobile-bottom-nav__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bottom-nav__item.is-active { color: var(--jk-blue-700); background: var(--jk-blue-50); }
.mobile-bottom-nav__item:active { transform: scale(.96); }
.mobile-bottom-nav__icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.quick-add-button {
  position: fixed;
  z-index: 87;
  right: max(18px, calc((100vw - var(--jk-content)) / 2));
  bottom: calc(var(--jk-nav-height) + env(safe-area-inset-bottom) + 16px);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 18px;
  color: #fff;
  background: var(--jk-blue-600);
  box-shadow: 0 12px 28px rgba(37,99,235,.3);
  text-decoration: none;
  font-size: 27px;
  font-weight: 500;
  transition: transform var(--jk-speed), background var(--jk-speed), box-shadow var(--jk-speed);
}
.quick-add-button:hover { background: var(--jk-blue-700); box-shadow: 0 15px 32px rgba(37,99,235,.34); }
.quick-add-button:active { transform: scale(.94); }

/* Content hierarchy */
h1, h2, h3, p { overflow-wrap: anywhere; }
.section-header,
.module-section-heading,
.report-header,
.admin-dashboard-header,
.admin-chart-heading,
.staff-commission-heading,
.staff-accounts-heading,
.activity-log-heading,
.commission-rules-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-header h2,
.module-section-heading h2,
.report-header h2,
.admin-dashboard-header h2,
.admin-chart-heading h2,
.staff-commission-heading h2,
.staff-accounts-heading h2,
.activity-log-heading h2,
.commission-rules-heading h2 {
  margin: 0;
  color: var(--jk-ink);
  font-size: clamp(20px, 2.5vw, 27px);
  line-height: 1.18;
  letter-spacing: -.025em;
}
.eyebrow { margin: 0 0 7px; color: var(--jk-blue-700); font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.module-breadcrumb { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--jk-muted); font-size: 13px; }
.module-breadcrumb a { color: var(--jk-blue-700); font-weight: 700; text-decoration: none; }
.module-breadcrumb strong { color: var(--jk-ink-soft); }

.panel,
.form-panel,
.chart-panel,
.target-panel,
.module-card,
.receipt-section,
.account-section,
.admin-account-panel,
.staff-commission-card,
.staff-account-card,
.activity-card,
.record-card,
.request-card,
.history-card,
.entitlement-card,
.type-setting-card {
  border: 1px solid var(--jk-line);
  border-radius: var(--jk-radius-lg);
  background: var(--jk-surface);
  box-shadow: var(--jk-shadow-sm);
}
.panel,
.form-panel,
.chart-panel,
.target-panel,
.module-card,
.account-section,
.admin-account-panel { padding: clamp(18px, 2.6vw, 28px); }
.panel:hover,
.module-card:hover,
.staff-commission-card:hover,
.record-card:hover { border-color: var(--jk-line-strong); }
.module-stack,
.form-grid { display: grid; gap: 18px; }
.module-main > * + * { margin-top: 18px; }
.dashboard-grid,
.stat-grid,
.balance-grid,
.target-grid,
.admin-grid,
.admin-dashboard-stats { gap: 16px; }

.module-hero,
.receipt-intro,
.commission-hero,
.account-page-header {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid var(--jk-blue-200);
  border-radius: var(--jk-radius-xl);
  color: var(--jk-ink);
  background: linear-gradient(110deg, #fff 0%, var(--jk-blue-50) 100%);
  box-shadow: var(--jk-shadow-sm);
}
.module-hero::after,
.receipt-intro::after,
.commission-hero::after,
.account-page-header::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--jk-blue-600);
}
.module-hero h1,
.receipt-intro h1,
.commission-hero h1,
.account-page-header h1 { margin: 0; color: var(--jk-ink); font-size: clamp(25px, 4vw, 38px); line-height: 1.1; letter-spacing: -.04em; }
.module-hero p:last-child,
.receipt-intro p:last-child,
.commission-hero p:last-child,
.account-page-header p:last-child { max-width: 680px; margin: 10px 0 0; color: var(--jk-ink-soft); }

/* Buttons and forms */
.button,
button.button,
.receipt-photo-button,
.admin-chart-filter__submit,
.admin-dashboard-filter__submit,
.sales-entry-submit,
.account-save,
.account-profile-save,
.admin-account-save {
  min-height: 46px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--jk-blue-600);
  border-radius: 12px;
  color: #fff;
  background: var(--jk-blue-600);
  box-shadow: 0 7px 15px rgba(37,99,235,.16);
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: transform var(--jk-speed), background var(--jk-speed), border-color var(--jk-speed), box-shadow var(--jk-speed), opacity var(--jk-speed);
}
.button:hover,
button.button:hover { background: var(--jk-blue-700); border-color: var(--jk-blue-700); box-shadow: 0 9px 19px rgba(37,99,235,.22); }
.button:active,
button.button:active { transform: translateY(1px) scale(.985); }
.button.secondary,
button.button.secondary,
.receipt-photo-button.secondary { color: var(--jk-blue-700); border-color: var(--jk-blue-200); background: var(--jk-blue-50); box-shadow: none; }
.button.secondary:hover,
button.button.secondary:hover { border-color: var(--jk-blue-300); background: var(--jk-blue-100); }
.button.danger,
button.button.danger { color: var(--jk-danger); border-color: #f1cbd1; background: var(--jk-danger-soft); box-shadow: none; }
.button.compact,
button.button.compact { min-height: 38px; padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.button:disabled,
button:disabled { cursor: wait; opacity: .62; transform: none !important; box-shadow: none !important; }
.is-submitting { position: relative; padding-right: 42px !important; }
.is-submitting::after {
  content: "";
  position: absolute;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: jk-spin .7s linear infinite;
}

.field,
.module-field,
.receipt-field { display: grid; gap: 7px; }
.field > label,
.module-field > span,
.receipt-field > span,
.payer-field > legend { color: var(--jk-ink-soft); font-size: 13px; font-weight: 800; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: var(--jk-control);
  padding: 11px 13px;
  border: 1px solid var(--jk-line-strong);
  border-radius: 11px;
  color: var(--jk-ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(23,36,59,.02);
  transition: border-color var(--jk-speed), box-shadow var(--jk-speed), background var(--jk-speed);
}
textarea { min-height: 106px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--jk-blue-300); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--jk-blue-600); box-shadow: var(--jk-focus); }
input:disabled, input[readonly], select:disabled, textarea:disabled { color: #65758b; background: #f3f6fa; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--jk-blue-600); }
.hint, small { color: var(--jk-muted); }
.field-error { min-height: 0; margin: 0; color: var(--jk-danger); font-size: 13px; font-weight: 650; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--jk-danger); background: #fffafb; }

/* Data and statuses */
.amount,
.commission-amount,
.admin-dashboard-stat strong,
.admin-chart-total,
.record-card__converted,
.record-converted,
.balance-card strong,
.stat-tile strong,
.entry-metric strong,
.staff-commission-card__metric strong {
  color: var(--jk-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.amount, .commission-amount { font-weight: 850; }
.stat-tile,
.admin-dashboard-stat,
.balance-card {
  padding: 18px;
  border: 1px solid var(--jk-line);
  border-radius: var(--jk-radius-md);
  background: #fff;
  box-shadow: var(--jk-shadow-sm);
}
.admin-dashboard-stat__icon,
.receipt-intro__icon,
.account-page-header__icon,
.activity-card__icon,
.staff-avatar,
.admin-account-avatar {
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--jk-blue-700);
  background: var(--jk-blue-100);
}
.status-pill,
.admin-account-status {
  min-height: 27px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
  white-space: nowrap;
}
.status-approved, .status-paid, .status-pill--safe, .status-pill--on { color: #087961; border-color: #c4eadf; background: var(--jk-success-soft); }
.status-pending, .status-pending_document, .status-more_info { color: var(--jk-warning); border-color: #f2dda0; background: var(--jk-warning-soft); }
.status-rejected, .status-cancelled { color: var(--jk-danger); border-color: #f1cbd1; background: var(--jk-danger-soft); }
.status-pill--off { color: var(--jk-muted); border-color: var(--jk-line); background: #f3f6fa; }
.progress-bar,
.chart-row__track,
.staff-commission-card__progress { overflow: hidden; border-radius: 999px; background: #eaf0f7; }
.progress-bar > span,
.chart-row__track > span,
.staff-commission-card__progress > span { display: block; min-width: 3px; height: 100%; border-radius: inherit; background: var(--jk-blue-600); }

/* Tables and records */
.table-wrap { overflow: auto; border: 1px solid var(--jk-line); border-radius: var(--jk-radius-lg); background: #fff; box-shadow: var(--jk-shadow-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { padding: 13px 15px; color: var(--jk-muted); background: #f7f9fc; font-size: 11px; font-weight: 850; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 14px 15px; border-top: 1px solid #edf2f8; color: var(--jk-ink-soft); vertical-align: middle; }
tbody tr { transition: background var(--jk-speed); }
tbody tr:hover { background: #f8fbff; }
.entry-actions,
.inline-actions,
.module-actions,
.decision-actions,
.request-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.entry-actions .button { min-height: 34px; padding: 4px 7px; border: 0; background: transparent; box-shadow: none; }
.entry-actions .button.secondary { color: var(--jk-blue-700); }
.entry-actions .button.danger { color: var(--jk-danger); }

.staff-commission-list,
.staff-account-list,
.activity-list,
.records-grid,
.request-list,
.history-list,
.notice-list { display: grid; gap: 14px; }
.staff-commission-card,
.staff-account-card,
.activity-card,
.record-card,
.request-card,
.history-card { padding: 18px; transition: border-color var(--jk-speed), box-shadow var(--jk-speed), transform var(--jk-speed); }
.staff-commission-card:hover,
.staff-account-card:hover,
.record-card:hover { box-shadow: var(--jk-shadow-md); transform: translateY(-1px); }
.staff-commission-card__toggle,
.activity-card__toggle { min-height: 42px; color: var(--jk-blue-700); border: 0; border-radius: 10px; background: var(--jk-blue-50); font-weight: 800; cursor: pointer; }

/* Monthly staff sales: keep figures and target guidance crisp at phone scale. */
#staff-commission .staff-commission-heading > div { max-width: 720px; }
#staff-commission .staff-commission-heading p:last-child {
  color: var(--jk-ink-soft);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
}
#staff-commission .staff-commission-card { padding: 0; }
#staff-commission .staff-commission-card__person strong {
  color: var(--jk-ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.25;
}
#staff-commission .staff-commission-card__person small,
#staff-commission .staff-commission-card__metric small,
#staff-commission .staff-commission-card__progress small {
  color: #53657d;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
}
#staff-commission .staff-commission-card__metric strong {
  color: var(--jk-ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
}
#staff-commission .staff-commission-card__progress {
  overflow: visible;
  border-radius: 0;
  background: transparent;
}
#staff-commission .staff-commission-card__progress > .staff-commission-card__tier {
  display: flex;
  width: 100%;
  min-width: 0;
  height: auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border-radius: 0;
  background: transparent;
}
#staff-commission .staff-commission-card__tier strong {
  color: var(--jk-ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
#staff-commission .commission-progress {
  height: 10px;
  background: #e7eef9;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .04);
}
#staff-commission .commission-progress > span { background: var(--jk-blue-600); }
#staff-commission .staff-commission-card__progress > small strong {
  color: var(--jk-ink-soft);
  font-weight: 850;
}
#staff-commission .staff-commission-card__toggle b {
  color: var(--jk-blue-700);
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 760px) {
  #staff-commission .staff-commission-heading h2 { font-size: 22px; }
  #staff-commission .staff-commission-heading p:last-child { font-size: 13px; }
  #staff-commission .staff-commission-card > summary { gap: 14px 12px; padding: 17px; }
  #staff-commission .staff-commission-card__metric { padding: 12px; }
  #staff-commission .staff-commission-card__toggle {
    width: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
  }
}

/* Notifications, alerts and empty states */
.message,
.module-alert {
  padding: 13px 15px;
  border: 1px solid var(--jk-line);
  border-radius: 12px;
  color: var(--jk-ink-soft);
  background: #fff;
  box-shadow: var(--jk-shadow-sm);
}
.message.success,
.module-alert--success { color: #087961; border-color: #c4eadf; background: var(--jk-success-soft); }
.module-alert--warning { color: var(--jk-warning); border-color: #f2dda0; background: var(--jk-warning-soft); }
.module-alert--error { color: #a82234; border-color: #f1cbd1; background: var(--jk-danger-soft); }
.empty-state {
  min-height: 140px;
  padding: 30px 22px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--jk-line-strong);
  border-radius: var(--jk-radius-lg);
  color: var(--jk-muted);
  background: #fbfcff;
  text-align: center;
}
.empty-state::before { content: "—"; display: block; color: var(--jk-blue-400, #73a3ff); font-size: 28px; line-height: 1; }
.notice-card.is-unread { border-left: 4px solid var(--jk-blue-600); background: #fbfdff; }
.notice-card__head,
.history-card__head,
.record-detail__top,
.request-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* Receipts, claim and account */
.receipt-form,
.claim-layout,
.account-form,
.admin-employee-layout,
.admin-notification-layout,
.leave-layout { display: grid; gap: 16px; }
.receipt-section { position: relative; padding: 20px; display: flex; align-items: flex-start; gap: 14px; }
.receipt-section__number { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 10px; color: var(--jk-blue-700); background: var(--jk-blue-100); font-size: 13px; font-weight: 850; }
.receipt-page .receipt-section__number { color: #fff; font-size: 14px; font-weight: 900; line-height: 1; }
.receipt-section__body { min-width: 0; flex: 1; }
.receipt-section__body h2 { margin: 0 0 13px; font-size: 16px; }
.receipt-photo-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.receipt-photo-button { position: relative; overflow: hidden; }
.receipt-photo-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.receipt-preview { margin-top: 14px; padding: 12px; border: 1px solid var(--jk-line); border-radius: 14px; background: #f8faff; }
.receipt-preview img { width: 100%; max-height: 360px; border-radius: 10px; object-fit: contain; background: #eef3f9; }
.payer-field { margin: 0; padding: 0; border: 0; }
.payer-field > label { min-height: 70px; padding: 13px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--jk-line); border-radius: 13px; background: #fff; cursor: pointer; }
.payer-field > label:has(input:checked) { border-color: var(--jk-blue-500); background: var(--jk-blue-50); box-shadow: var(--jk-focus); }
.payer-field small { display: block; margin-top: 3px; }
.receipt-identity,
.account-privacy-notice,
.privacy-notice { padding: 14px; border: 1px solid var(--jk-blue-200); border-radius: 12px; color: var(--jk-ink-soft); background: var(--jk-blue-50); }
.receipt-submit-bar { position: sticky; z-index: 10; bottom: calc(var(--jk-nav-height) + env(safe-area-inset-bottom) + 7px); padding: 12px; border: 1px solid var(--jk-line); border-radius: 16px; background: rgba(255,255,255,.97); box-shadow: 0 12px 30px rgba(23,36,59,.14); }
.receipt-submit { width: 100%; }
.upload-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: #e8eef7; }
.upload-progress > div span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--jk-blue-600); transition: width 240ms ease; }
.receipt-success { padding: clamp(24px,4vw,40px); border: 1px solid #c4eadf; border-radius: var(--jk-radius-xl); background: #fff; box-shadow: var(--jk-shadow-md); }
.receipt-success__icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; color: #fff; background: var(--jk-success); font-size: 27px; }
.receipt-success dl { display: grid; gap: 0; border: 1px solid var(--jk-line); border-radius: 14px; overflow: hidden; }
.receipt-success dl div { padding: 11px 14px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--jk-line); }
.receipt-success dl div:first-child { border-top: 0; }
.receipt-success dd { margin: 0; color: var(--jk-ink); font-weight: 800; text-align: right; }
.record-receipt-link { color: var(--jk-blue-700); font-weight: 800; }
.record-card { overflow: hidden; }
.record-card img { border-radius: 12px; object-fit: cover; }

/* Modal and overlays */
.modal-backdrop,
.quick-sales-modal { position: fixed; z-index: 120; inset: 0; padding: 20px; align-items: center; justify-content: center; background: rgba(19,31,51,.46); backdrop-filter: blur(3px); }
.modal {
  width: min(720px, 100%);
  max-height: calc(100svh - 40px);
  overflow: auto;
  border: 1px solid var(--jk-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(17,30,50,.24);
  animation: jk-modal-in 200ms ease both;
}
.modal__header { position: sticky; z-index: 3; top: 0; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--jk-line); background: rgba(255,255,255,.97); }
.modal__header h2 { margin: 0; font-size: 22px; }
.modal__body { padding: 20px; }

/* Login */
.login-page { min-height: 100svh; padding: 28px; display: grid; place-items: center; background: var(--jk-canvas); }
.login-card { width: min(1040px,100%); overflow: hidden; border: 1px solid var(--jk-line); border-radius: 24px; background: #fff; box-shadow: var(--jk-shadow-md); }
.login-panel { padding: clamp(24px,5vw,52px); }
.login-visual img { width: 100%; height: 100%; object-fit: cover; }

.jk-toast-region { position: fixed; z-index: 200; top: 92px; right: 18px; width: min(380px, calc(100vw - 36px)); display: grid; gap: 10px; pointer-events: none; }
.jk-toast { padding: 13px 15px; border: 1px solid var(--jk-line); border-left: 4px solid var(--jk-blue-600); border-radius: 13px; color: var(--jk-ink); background: #fff; box-shadow: var(--jk-shadow-md); animation: jk-toast-in 220ms ease both; }
.jk-toast--success { border-left-color: var(--jk-success); }
.jk-toast--error { border-left-color: var(--jk-danger); }

.jk-ui-ready .panel,
.jk-ui-ready .module-card,
.jk-ui-ready .form-panel,
.jk-ui-ready .chart-panel { animation: jk-rise 260ms ease both; }

@keyframes jk-spin { to { transform: rotate(360deg); } }
@keyframes jk-rise { from { opacity: .7; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes jk-modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes jk-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (min-width: 1100px) {
  body.is-authenticated,
  body.module-body { padding-bottom: 28px; }
  .mobile-bottom-nav { left: 50%; right: auto; width: min(760px, calc(100% - 40px)); transform: translateX(-50%); border: 1px solid var(--jk-line); border-bottom: 0; border-radius: 18px 18px 0 0; }
  .quick-add-button { bottom: 94px; }
  .main, .module-main { padding-bottom: 92px; }
}

@media (max-width: 760px) {
  :root { --jk-nav-height: 72px; --jk-control: 48px; }
  body, body.module-body { font-size: 15px; }
  .main, .module-main { width: min(100% - 24px, var(--jk-content)); }
  .module-main { padding-top: 16px; }
  .topbar.employee-unified-topbar {
    min-height: 70px;
    padding: 9px 12px 9px 68px;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
  }
  .brand-logo { width: 42px; height: 42px; flex-basis: 42px; border-radius: 11px; }
  .topbar__brand { flex: 1 1 auto; min-width: 0; gap: 9px; overflow: hidden; }
  .topbar__identity h1 { max-width: 165px; font-size: 15px; }
  .topbar__welcome { margin-top: 4px; font-size: 12px; }
  .topbar__welcome strong { max-width: 78px; }
  .role-pill { padding: 2px 6px; font-size: 9px; }
  .notification-bell { width: 38px; padding: 7px; justify-content: center; }
  .notification-bell__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .notification-bell__count { position: absolute; margin: -26px -25px 0 0; min-width: 17px; height: 17px; font-size: 9px; }
  .global-controls { flex: 0 0 auto; flex-wrap: nowrap; gap: 4px; }
  .language-button { min-width: 42px; min-height: 36px; padding: 7px 9px; font-size: 13px; }
  .nav-toggle-button { top: 13px; left: 12px; }
  .panel, .form-panel, .chart-panel, .target-panel, .module-card, .account-section, .admin-account-panel { padding: 17px; }
  .module-hero, .receipt-intro, .commission-hero, .account-page-header { padding: 20px; align-items: flex-start; }
  .module-hero h1, .receipt-intro h1, .commission-hero h1, .account-page-header h1 { font-size: 26px; }
  .module-breadcrumb { display: none; }
  .dashboard-grid, .stat-grid, .balance-grid, .target-grid, .admin-grid, .admin-dashboard-stats { grid-template-columns: 1fr !important; }
  .form-grid.two,
  .module-form-grid,
  .account-identity-grid,
  .account-profile-grid,
  .account-profile-grid--three,
  .admin-request-grid,
  .sales-entry-amount-grid,
  .amount-currency-grid { grid-template-columns: 1fr !important; }
  .receipt-photo-actions { grid-template-columns: 1fr; }
  .receipt-section { padding: 16px; gap: 11px; }
  .receipt-section__number { width: 27px; height: 27px; flex-basis: 27px; }
  .receipt-success dl div { align-items: flex-start; flex-direction: column; gap: 3px; }
  .receipt-success dd { text-align: left; }
  .receipt-success__actions, .module-actions, .decision-actions { display: grid; grid-template-columns: 1fr; }
  .receipt-success__actions .button, .module-actions .button, .decision-actions .button { width: 100%; }
  .section-header, .module-section-heading, .report-header, .admin-dashboard-header, .admin-chart-heading, .staff-commission-heading, .staff-accounts-heading, .activity-log-heading, .commission-rules-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .sales-entry-table, .sales-entry-table tbody { display: grid; gap: 12px; }
  .sales-entry-table thead { display: none; }
  .sales-entry-table tr { padding: 15px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 14px; border: 1px solid var(--jk-line); border-radius: 16px; background: #fff; box-shadow: var(--jk-shadow-sm); }
  .sales-entry-table td {
    min-width: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 4px;
    border: 0;
    line-height: 1.25;
  }
  .sales-entry-table td::before {
    min-width: 0;
    color: var(--jk-muted);
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .02em;
  }
  .sales-entry-table .entry-metric {
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
  }
  .sales-entry-table .entry-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--jk-line);
  }
  .sales-entry-table .entry-actions::before { display: none; }
  .sales-entry-table .entry-actions .inline-actions {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
  }
  .sales-entry-table .entry-actions .inline-form { width: auto; margin: 0; }
  .sales-entry-table .entry-actions .button {
    min-height: 40px;
    padding: 8px 7px;
  }
  .modal-backdrop, .quick-sales-modal { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: calc(100svh - 18px); padding-bottom: env(safe-area-inset-bottom); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .modal__header { padding: 15px 16px; }
  .modal__body { padding: 16px; }
  .quick-add-button {
    right: 14px;
    bottom: calc(var(--jk-nav-height) + env(safe-area-inset-bottom) + 13px);
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
  }
  .quick-add-button > span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    font-size: 30px;
    line-height: 1;
  }
  .quick-add-button > small {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .jk-toast-region { top: 78px; right: 12px; width: calc(100vw - 24px); }
}

@media (max-width: 430px) {
  .topbar__identity h1 { max-width: 126px; font-size: 13px; }
  .brand-logo { width: 39px; height: 39px; flex-basis: 39px; }
  .topbar__welcome > span:first-child { display: none; }
  .language-button { min-width: 38px; padding-inline: 7px; }
  .notification-bell { width: 34px; }
  .mobile-bottom-nav { padding-inline: 4px; gap: 1px; }
  .mobile-bottom-nav__item { padding-inline: 1px; font-size: 9.5px; }
  .mobile-bottom-nav__icon { width: 21px; height: 21px; }
  .receipt-section { padding: 14px; }
}

@media (max-width: 370px) {
  .topbar.employee-unified-topbar { padding-right: 8px; padding-left: 62px; gap: 5px; }
  .topbar__brand { gap: 6px; }
  .brand-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .topbar__identity h1 { max-width: 100px; font-size: 12px; }
  .notification-bell { width: 32px; }
  .language-button { min-width: 34px; padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .button, .status-pill, .mobile-bottom-nav__item.is-active { border: 1px solid ButtonText; }
}
