:root {
  color-scheme: light;
  --bg: #eef5ff;
  --panel: #ffffff;
  --solid: #ffffff;
  --soft: #f7faff;
  --ink: #0b1f3a;
  --muted: #6e7c92;
  --faint: #a4afbf;
  --line: rgba(30, 56, 92, 0.1);
  --line-strong: rgba(30, 56, 92, 0.18);
  --accent: #2478f2;
  --accent-dark: #0b56c2;
  --accent-quiet: #eaf3ff;
  --cyan: #16b8c4;
  --cyan-soft: #e9fbfd;
  --blue: var(--accent);
  --blue-soft: var(--accent-quiet);
  --green: #10a783;
  --green-soft: #e8f8f3;
  --gold: #d88a22;
  --gold-soft: #fff5e4;
  --red: #d94d4d;
  --red-soft: #fff0f0;
  --gray-soft: #f1f5fa;
  --shadow: 0 18px 46px rgba(31, 75, 122, 0.1);
  --shadow-soft: 0 8px 24px rgba(31, 75, 122, 0.07);
  --radius: 8px;
}

.payroll-calc-actions a.ghost-button {
  text-decoration: none;
}

/* Employee files navigation and personal center */
.module-nav .nav-subgroup {
  display: grid;
  gap: 4px;
  margin: 2px 0;
}

.module-nav .nav-subgroup-title {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #53657a;
  font-size: 12px;
  font-weight: 750;
}

.module-nav .nav-subgroup.active .nav-subgroup-title {
  color: #176fca;
}

.module-nav .nav-subgroup-items {
  display: grid;
  gap: 3px;
  margin-left: 22px;
  padding-left: 10px;
  border-left: 1px solid #d9e4ef;
}

.module-nav .nav-subgroup-items > button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.employee-portal-admin {
  display: grid;
  gap: 16px;
}

.employee-portal-heading > div:first-child {
  max-width: 720px;
}

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

.employee-portal-metrics article {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 15px 16px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #fff;
}

.employee-portal-metrics span {
  color: #66788c;
  font-size: 11px;
}

.employee-portal-metrics strong {
  grid-row: span 2;
  align-self: center;
  color: #142a44;
  font-size: 25px;
  line-height: 1;
}

.employee-portal-metrics small {
  overflow: hidden;
  color: #8a98a8;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-workspace {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(350px, 390px);
  align-items: start;
  gap: 16px;
}

.employee-portal-directory {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #fff;
}

.employee-portal-directory-head {
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(260px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #e5ecf3;
}

.employee-portal-directory-head h3 {
  margin: 0 0 3px;
  color: #172b43;
  font-size: 16px;
}

.employee-portal-directory-head span {
  color: #7e8d9d;
  font-size: 10px;
}

.employee-portal-directory-head .search-box {
  width: 100%;
}

.employee-portal-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5ecf3;
  background: #f8fafc;
}

.employee-portal-filter-grid select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid #d7e1eb;
  border-radius: 7px;
  color: #334b65;
  background-color: #fff;
  font-size: 10px;
}

.employee-portal-directory-list {
  display: grid;
  max-height: min(880px, calc(100vh - 270px));
  overflow: auto;
}

.employee-portal-person {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 92px;
  align-items: start;
  gap: 11px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #e9eef4;
  color: #1e334c;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.employee-portal-person:hover {
  background: #f7faff;
}

.employee-portal-person.is-selected {
  z-index: 1;
  background: #edf6ff;
  box-shadow: inset 3px 0 #1680ef;
}

.employee-portal-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #176cbb;
  background: #e7f3ff;
  font-weight: 850;
}

.employee-portal-person-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.employee-portal-person-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.employee-portal-person-title strong {
  font-size: 13px;
}

.employee-portal-person-title em {
  padding: 2px 5px;
  border-radius: 5px;
  color: #9c6710;
  background: #fff2d5;
  font-size: 9px;
  font-style: normal;
}

.employee-portal-person-org {
  overflow: hidden;
  color: #687b8f;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-person-meta,
.employee-portal-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.employee-portal-person-meta i,
.employee-portal-issues i,
.employee-portal-complete {
  padding: 2px 5px;
  border-radius: 5px;
  color: #6c7c8d;
  background: #eff3f7;
  font-size: 8px;
  font-style: normal;
}

.employee-portal-person-meta .is-green,
.employee-portal-complete { color: #187456; background: #e8f7f1; }
.employee-portal-person-meta .is-gold { color: #966610; background: #fff3dc; }
.employee-portal-person-meta .is-red,
.employee-portal-issues i { color: #b34646; background: #fff0f0; }

.employee-portal-person-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 3px;
  padding-top: 2px;
}

.employee-portal-person-side small {
  color: #95a2af;
  font-size: 8px;
}

.employee-portal-person-side b {
  max-width: 92px;
  overflow: hidden;
  color: #6e8092;
  font-size: 9px;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-clear-filter {
  width: 100%;
  padding: 10px;
  border: 0;
  border-top: 1px solid #dce6f1;
  color: #176fca;
  background: #f2f8ff;
  font-size: 10px;
  cursor: pointer;
}

.employee-portal-preview {
  position: sticky;
  top: 12px;
  min-width: 0;
}

.employee-portal-preview-shell {
  display: grid;
  gap: 10px;
}

.employee-portal-preview-tools {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #fff;
}

.employee-portal-preview-tools > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.employee-portal-preview-tools strong {
  color: #172d47;
  font-size: 12px;
}

.employee-portal-preview-tools span,
.employee-portal-readonly {
  color: #75879a;
  font-size: 9px;
}

.employee-portal-preview-tools > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.employee-portal-preview-tools button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 9px;
}

.employee-portal-preview-tools button .app-icon {
  width: 13px;
  height: 13px;
}

.employee-portal-phone {
  position: relative;
  padding: 19px 8px 8px;
  border: 1px solid #cbd6e2;
  border-radius: 26px;
  background: #17283b;
  box-shadow: 0 14px 32px rgba(30, 50, 73, .14);
}

.employee-portal-phone-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 72px;
  height: 5px;
  border-radius: 5px;
  background: #566778;
  transform: translateX(-50%);
}

.employee-portal-phone-screen {
  height: min(920px, calc(100vh - 208px));
  min-height: 560px;
  padding: 9px;
  overflow: auto;
  border-radius: 19px;
  background: #eef4fb;
}

.employee-portal-preview-loading,
.employee-portal-preview-empty {
  min-height: 460px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #77899b;
  text-align: center;
}

.employee-portal-preview-loading > span {
  width: 26px;
  height: 26px;
  border: 3px solid #cfe1f5;
  border-top-color: #1680ef;
  border-radius: 50%;
  animation: employee-portal-spin .8s linear infinite;
}

@keyframes employee-portal-spin { to { transform: rotate(360deg); } }

.employee-portal-qr {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 10px 0 24px;
  text-align: center;
}

.employee-portal-qr img {
  width: min(100%, 340px);
  padding: 12px;
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #fff;
}

.employee-portal-qr p,
.employee-portal-drawer-copy p {
  margin: 0;
  color: #6d7e90;
  font-size: 11px;
  line-height: 1.7;
}

.employee-portal-drawer-copy {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #d5e4f3;
  border-radius: 9px;
  background: #f1f7fe;
}

.employee-portal-drawer-form .span-2 {
  grid-column: 1 / -1;
}

.employee-portal-drawer-form textarea {
  width: 100%;
  resize: vertical;
}

.employee-portal-switch {
  display: flex !important;
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: center;
}

.employee-portal-switch input {
  width: 16px !important;
  height: 16px !important;
}

.employee-portal-drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e9f1;
}

.employee-portal-correction-list {
  display: grid;
  gap: 10px;
}

.employee-portal-correction-list article {
  padding: 14px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #fff;
}

.employee-portal-correction-list header,
.employee-portal-correction-list footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.employee-portal-correction-list header div {
  display: grid;
  gap: 2px;
}

.employee-portal-correction-list header span,
.employee-portal-correction-list footer > span {
  color: #8190a0;
  font-size: 9px;
}

.employee-portal-correction-list header em {
  padding: 4px 7px;
  border-radius: 6px;
  color: #176fca;
  background: #eaf4ff;
  font-size: 9px;
  font-style: normal;
}

.employee-portal-correction-list dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.employee-portal-correction-list dl > div {
  padding: 9px;
  border-radius: 7px;
  background: #f6f8fb;
}

.employee-portal-correction-list dt {
  color: #8795a4;
  font-size: 8px;
}

.employee-portal-correction-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #263d57;
  font-size: 11px;
  font-weight: 700;
}

.employee-portal-correction-list article > p {
  color: #64768a;
  font-size: 10px;
}

.employee-portal-correction-list footer > div {
  display: flex;
  gap: 6px;
}

@media (max-width: 1240px) {
  .employee-portal-workspace {
    grid-template-columns: 1fr;
  }

  .employee-portal-preview {
    position: static;
    width: min(100%, 420px);
    margin-inline: auto;
  }

  .employee-portal-directory-list {
    max-height: 650px;
  }
}

@media (max-width: 900px) {
  .module-nav .nav-subgroup,
  .module-nav .nav-subgroup-items {
    display: contents;
  }

  .module-nav .nav-subgroup-title {
    display: none;
  }

  .module-nav .nav-subgroup-items > button {
    min-height: 44px;
    padding: 9px 10px;
  }

  .employee-portal-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-portal-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .employee-portal-directory-head {
    grid-template-columns: 1fr;
  }

  .employee-portal-metrics {
    grid-template-columns: 1fr;
  }

  .employee-portal-person {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 12px;
  }

  .employee-portal-avatar {
    width: 36px;
    height: 36px;
  }

  .employee-portal-person-side {
    display: none;
  }

  .employee-portal-phone-screen {
    min-height: 500px;
    height: 78vh;
  }

  .employee-portal-correction-list footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Annual leave center: performance-workbench visual language */
.attendance-leaves-view {
  display: grid;
  gap: 12px;
  color: var(--ink);
}

.annual-leave-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 136px;
  padding: 24px 26px;
  border: 1px solid #cfe2fb;
  border-left: 5px solid #1687f8;
  border-radius: 8px;
  background: #eef6ff;
  box-shadow: 0 14px 34px rgba(23, 80, 145, 0.08);
}

.annual-leave-hero .eyebrow,
.annual-form-intro > span,
.annual-account-summary > div > span,
.annual-rule-card-head > div > span {
  margin: 0 0 5px;
  color: #0878e8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.annual-leave-hero h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.annual-leave-hero > div > p:last-child {
  max-width: 760px;
  margin: 8px 0 0;
  color: #53657a;
  line-height: 1.65;
}

.annual-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 8px;
  flex: 0 0 auto;
}

.annual-hero-stats span {
  min-width: 92px;
  padding: 12px;
  border: 1px solid rgba(126, 174, 226, 0.42);
  border-radius: 8px;
  color: #61748a;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  text-align: center;
}

.annual-hero-stats strong {
  display: block;
  margin-bottom: 2px;
  color: #10233d;
  font-size: 24px;
}

.leave-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  border: 1px solid #dce7f4;
  border-radius: 8px;
  background: #f4f8fc;
}

.leave-section-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: #68788b;
  background: transparent;
  font-weight: 760;
  cursor: pointer;
}

.leave-section-tabs button.active {
  color: #076fd5;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 77, 134, 0.1);
}

.annual-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 13px 16px;
  border: 1px solid #dfe9f4;
  border-radius: 8px;
  background: #fff;
}

.annual-panel-toolbar > div:first-child strong,
.annual-panel-toolbar > div:first-child span {
  display: block;
}

.annual-panel-toolbar > div:first-child span {
  margin-top: 4px;
  line-height: 1.5;
}

.annual-leave-filter {
  border-color: #dfe9f4;
  background: #f8fbff;
}

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

.annual-kpi-grid article {
  position: relative;
  min-height: 112px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid #d8e6f6;
  border-top: 4px solid #1687f8;
  border-radius: 8px;
  background: #f5f9ff;
}

.annual-kpi-grid article.cyan { border-top-color: #16a8c8; background: #f0fbfd; }
.annual-kpi-grid article.gold { border-top-color: #d99b22; background: #fff9ed; }
.annual-kpi-grid article.mint { border-top-color: #27a879; background: #effaf6; }
.annual-kpi-grid span,
.annual-kpi-grid small { display: block; color: #66778a; }
.annual-kpi-grid strong { display: inline-block; margin: 9px 5px 0 0; font-size: 28px; color: #13243a; }
.annual-kpi-grid small { display: inline; font-size: 11px; }

.annual-ledger-table-wrap {
  border-color: #dce7f3;
  border-radius: 8px;
}

.annual-ledger-table th,
.annual-ledger-table td {
  padding-inline: 10px;
}

.annual-cell-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.annual-available-value { color: #12835d; }

.annual-empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  border: 1px dashed #bfd6ed;
  border-radius: 8px;
  color: #6c7d90;
  background: #f7fbff;
  text-align: center;
}

.annual-empty-state.compact { min-height: 76px; }
.annual-empty-state .app-icon { width: 24px; height: 24px; color: #1585ee; }
.annual-empty-state strong { color: #1c3048; }

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

.annual-rule-card {
  padding: 18px;
  border: 1px solid #cfe0f3;
  border-left: 4px solid #1887f6;
  border-radius: 8px;
  background: #f5f9ff;
}

.annual-rule-card.company {
  border-color: #c8e9dd;
  border-left-color: #24a477;
  background: #f1faf7;
}

.annual-rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.annual-rule-card h3 { margin: 0; font-size: 18px; }
.annual-rule-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.annual-rule-card dl div { padding: 9px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.78); }
.annual-rule-card dt { color: #7a8999; font-size: 10px; }
.annual-rule-card dd { margin: 3px 0 0; color: #20344b; font-weight: 700; }

.annual-form-intro {
  padding: 16px 18px;
  border: 1px solid #cee1f6;
  border-left: 4px solid #1887f6;
  border-radius: 8px;
  background: #f1f7ff;
}

.annual-form-intro h3 { margin: 0; font-size: 20px; }
.annual-form-intro p { margin: 6px 0 0; color: #627489; line-height: 1.55; }
.annual-rule-options { display: flex; flex-wrap: wrap; gap: 20px; margin: 8px 0 14px; }
.annual-weekday-field { margin: 0 0 14px; padding: 12px; border: 1px solid #dce7f3; border-radius: 8px; }
.annual-weekday-field legend { padding: 0 6px; color: #52657b; font-weight: 760; }
.annual-weekday-field label { display: inline-flex; align-items: center; gap: 5px; margin: 4px 14px 4px 0; font-weight: 650; }
.annual-weekday-field input { width: auto; }

.sticky-form-actions {
  position: sticky;
  bottom: -1px;
  z-index: 3;
  margin-top: 10px;
  padding: 12px 0 2px;
  background: var(--surface);
  box-shadow: 0 -12px 24px rgba(255, 255, 255, 0.9);
}

.annual-account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #cfe2f7;
  border-radius: 8px;
  background: #f1f7ff;
}

.annual-account-summary.approval { border-left: 4px solid #1887f6; }
.annual-account-summary h3 { margin: 0; font-size: 21px; }
.annual-account-summary p { margin: 4px 0 0; color: #687a8e; }
.annual-account-summary > strong { color: #0c75da; font-size: 34px; text-align: right; }
.annual-account-summary > strong small { display: block; color: #687a8e; font-size: 11px; }

.annual-detail-metrics,
.annual-balance-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 18px;
}

.annual-detail-metrics span,
.annual-balance-flow span {
  padding: 11px;
  border: 1px solid #dfe9f4;
  border-radius: 8px;
  color: #708093;
  background: #fff;
  font-size: 11px;
}

.annual-detail-metrics strong,
.annual-balance-flow strong { display: block; margin-top: 4px; color: #172b43; font-size: 19px; }
.annual-account-detail section { margin-top: 18px; }

.annual-history-list,
.annual-ledger-list { display: grid; gap: 7px; }
.annual-history-list article,
.annual-ledger-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 12px; border: 1px solid #e0e9f3; border-radius: 8px; background: #fff; }
.annual-history-list article div span,
.annual-ledger-list article div span { display: block; margin-top: 3px; color: #68798c; }
.annual-history-list article > small,
.annual-ledger-list article > small { grid-column: 1 / -1; color: #8793a1; }
.annual-ledger-list b { color: #17825e; }
.annual-ledger-list b.negative { color: #c64848; }

.annual-balance-flow { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.annual-balance-flow > b { color: #1485ee; font-size: 22px; }
.annual-approval-warnings { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.annual-approval-warnings span { padding: 7px 9px; border-radius: 6px; font-size: 11px; font-weight: 730; }
.annual-approval-warnings .ok { color: #157453; background: #eaf8f2; }
.annual-approval-warnings .warn { color: #93630b; background: #fff4d8; }
.annual-approval-warnings .danger { color: #b03c3c; background: #fff0f0; }
.annual-approval-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.annual-approval-dates article { padding: 10px; border: 1px solid #dde8f3; border-radius: 8px; background: #f9fbfe; }
.annual-approval-dates article > * { display: block; }
.annual-approval-dates article span,
.annual-approval-dates article small { margin-top: 3px; color: #6c7d90; }
.annual-approval-dates article small.warning { color: #a66e08; }

.annual-impact-confirm { max-width: 720px; margin: 0 auto; }
.annual-impact-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; color: #0878e8; background: #e9f4ff; }
.annual-impact-icon .app-icon { width: 24px; height: 24px; }
.annual-impact-confirm h3 { margin: 14px 0 4px; font-size: 22px; }
.annual-impact-confirm > p { color: #68798c; }
.annual-impact-confirm dl { display: grid; gap: 7px; margin: 16px 0; }
.annual-impact-confirm dl div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 7px; background: #f4f8fc; }
.annual-impact-confirm dt { color: #637589; font-weight: 720; }
.annual-impact-confirm dd { margin: 0; color: #1e344d; }

@media (max-width: 900px) {
  .annual-leave-hero { align-items: flex-start; flex-direction: column; }
  .annual-hero-stats { width: 100%; }
  .annual-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .annual-rule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .annual-leave-hero { min-height: 0; padding: 18px; }
  .annual-leave-hero h2 { font-size: 22px; }
  .annual-hero-stats span { min-width: 0; padding: 8px 5px; }
  .annual-hero-stats strong { font-size: 20px; }
  .leave-section-tabs { grid-template-columns: 1fr; gap: 3px; }
  .annual-panel-toolbar { align-items: stretch; flex-direction: column; }
  .annual-panel-toolbar .row-actions { display: grid; grid-template-columns: 1fr; }
  .annual-panel-toolbar button { width: 100%; }
  .annual-kpi-grid { grid-template-columns: 1fr 1fr; }
  .annual-kpi-grid article { min-height: 94px; padding: 13px; }
  .annual-kpi-grid strong { font-size: 23px; }
  .annual-rule-card dl,
  .annual-detail-metrics,
  .annual-approval-dates { grid-template-columns: 1fr; }
  .annual-account-summary { align-items: flex-start; }
  .annual-account-summary > strong { font-size: 28px; }
  .annual-impact-confirm dl div { grid-template-columns: 1fr; gap: 3px; }

  .annual-ledger-table-wrap { overflow: visible; }
  .annual-ledger-table,
  .annual-ledger-table tbody { display: block; width: 100%; }
  .annual-ledger-table thead { display: none; }
  .annual-ledger-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 8px; padding: 10px; border: 1px solid #dce7f3; border-radius: 8px; background: #fff; }
  .annual-ledger-table td { display: block !important; min-height: 48px; padding: 7px !important; border: 0 !important; }
  .annual-ledger-table td::before { display: block; margin-bottom: 3px; color: #7b8998; font-size: 9px; font-weight: 700; }
  .annual-ledger-table td:nth-child(1),
  .annual-ledger-table td:nth-child(12) { grid-column: 1 / -1; }
  .annual-ledger-table td:nth-child(2)::before { content: "年假类型"; }
  .annual-ledger-table td:nth-child(3)::before { content: "年度额度"; }
  .annual-ledger-table td:nth-child(4)::before { content: "上年结转"; }
  .annual-ledger-table td:nth-child(5)::before { content: "人工调整"; }
  .annual-ledger-table td:nth-child(6)::before { content: "已休"; }
  .annual-ledger-table td:nth-child(7)::before { content: "已批准待休"; }
  .annual-ledger-table td:nth-child(8)::before { content: "审批中"; }
  .annual-ledger-table td:nth-child(9)::before { content: "可申请"; }
  .annual-ledger-table td:nth-child(10)::before { content: "有效期"; }
  .annual-ledger-table td:nth-child(11)::before { content: "最近休假"; }
  .annual-ledger-table .table-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .annual-ledger-table .mini-button { width: 100%; }
}


:root {
  --z-topbar: 20;
  --z-overlay: 900;
  --z-lock-overlay: 1000;
  --z-toast: 1100;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

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

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.topbar,
.metric-card,
.side-panel,
.content-panel,
.drawer-panel,
.confirm-dialog,
.lock-card {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.04);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-color: var(--line);
  border-radius: 20px;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(36, 120, 242, 0.24);
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 2px;
  font-size: clamp(20px, 1.45vw, 24px);
  font-weight: 760;
  line-height: 1.1;
}

.brand-block h1 {
  white-space: nowrap;
}

h2 {
  font-size: 20px;
  font-weight: 760;
}

h3 {
  font-size: 16px;
}

.month-control {
  display: grid;
  gap: 6px;
}

.role-control {
  display: grid;
  gap: 6px;
}

.top-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

.top-controls .month-control {
  width: 154px;
}

.top-controls .role-control {
  width: 136px;
}

.system-file-inputs {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.role-chip {
  display: inline-flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--accent);
  padding: 0 12px;
  font-weight: 760;
  box-shadow: none;
}

.role-chip:hover {
  border-color: rgba(36, 120, 242, 0.2);
  background: var(--accent-quiet);
}

.role-chip:disabled {
  opacity: 1;
  color: var(--muted);
}

body.is-locked .app-shell {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

label > span,
.month-control label,
.role-control label {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(48, 72, 63, 0.48);
  box-shadow: 0 0 0 4px rgba(48, 72, 63, 0.11);
}

input[readonly][data-auto-calculated="true"] {
  background: var(--soft);
  color: var(--muted);
  cursor: not-allowed;
}

.panel-actions,
.drawer-actions > div,
.confirm-actions,
.row-actions,
.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.panel-actions {
  align-items: center;
}

.row-actions {
  flex-wrap: nowrap;
  gap: 5px;
}

.leave-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.leave-toolbar strong {
  display: block;
  margin-bottom: 4px;
}

.leave-rule-section {
  margin-top: 18px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-weight: 700;
}

.checkbox-line input {
  width: auto;
}

.icon-button,
.primary,
.ghost-button,
.danger-button,
.text-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}

.icon-button,
.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  box-shadow: none;
}

.primary {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  box-shadow: 0 10px 22px rgba(36, 120, 242, 0.22);
}

.danger-button {
  border: 1px solid rgba(169, 81, 73, 0.18);
  background: rgba(247, 238, 238, 0.86);
  color: var(--red);
  padding: 0 16px;
}

.text-button {
  min-height: 30px;
  background: transparent;
  color: var(--accent);
  padding: 0 4px;
  font-size: 13px;
}

.icon-button:hover,
.ghost-button:hover,
.mini-button:hover,
.circle-button:hover,
.text-button:hover {
  border-color: var(--line-strong);
  background: var(--soft);
}

.icon-button svg,
.search-box svg,
.circle-button svg,
.mini-button svg,
.text-button svg,
.primary svg,
.ghost-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
}

.app-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
  flex: 0 0 auto;
}

.mini-button .app-icon {
  width: 15.5px;
  height: 15.5px;
}

.file-action {
  position: relative;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

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

.metric-card {
  display: grid;
  min-height: 94px;
  align-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-color: var(--line);
  border-radius: 14px;
}

.metric-card.strong {
  border-color: rgba(36, 120, 242, 0.16);
  background: #fff;
}

.metric-card.alert {
  border-color: rgba(216, 138, 34, 0.16);
  background: #fff;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.metric-card:nth-child(2)::before {
  background: var(--cyan);
}

.metric-card:nth-child(3)::before {
  background: var(--green);
}

.metric-card.alert::before {
  background: var(--gold);
}

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

.metric-card strong {
  overflow: hidden;
  font-size: clamp(22px, 1.9vw, 30px);
  font-weight: 780;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.side-panel,
.content-panel {
  border-radius: 20px;
  border-color: var(--line);
}

.side-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 12px;
}

.content-panel {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

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

.module-nav button,
.module-nav .module-link,
.task-row,
.dept-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.module-nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: 700;
}

.module-nav .module-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
}

.module-nav .module-link:hover {
  border-color: rgba(36, 120, 242, 0.16);
  background: var(--accent-quiet);
  color: var(--accent);
}

.module-nav button[hidden] {
  display: none !important;
}

.module-nav .app-icon {
  width: 17px;
  height: 17px;
  color: var(--faint);
}

.module-nav button.active,
.task-row.active,
.dept-row.active {
  border-color: rgba(36, 120, 242, 0.18);
  background: var(--accent-quiet);
  color: var(--accent);
}

.module-nav button.active .app-icon {
  color: var(--accent);
}

.module-nav .module-link:hover .app-icon {
  color: var(--accent);
}

.task-row,
.dept-row {
  background: var(--soft);
  border-color: var(--line);
}

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

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 120, 242, 0.12);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.task-list,
.department-list {
  display: grid;
  gap: 8px;
}

.quick-grid,
.card-list {
  display: grid;
  gap: 12px;
}

.quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: min(720px, 100%);
}

.toolbar input,
.toolbar select {
  min-height: 38px;
}

.toolbar input {
  min-width: min(360px, 100%);
  flex: 1 1 280px;
}

.toolbar select {
  width: auto;
  min-width: 160px;
}

.view-stack {
  display: grid;
  gap: 16px;
}

.view-stack > .section-heading:first-child {
  min-height: 48px;
}

.view-stack .table-wrap {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.view-stack > .task-list,
.view-stack > .card-list {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 12px;
}

.task-item strong,
.task-item small {
  display: block;
  min-width: 0;
}

.task-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.view-stack .settings-grid,
.view-stack .report-grid,
.view-stack .report-insight-grid {
  padding: 0;
}

.record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.record-card strong,
.record-card span {
  display: block;
}

.record-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.danger-text {
  color: var(--red);
}

.dept-row strong,
.dept-row span,
.task-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-row strong,
.task-row span {
  font-size: 14px;
}

.dept-row span,
.task-row strong,
.muted {
  color: var(--muted);
  font-size: 12px;
}

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

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(140px, 0.55fr)) auto;
  gap: 8px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.table-toolbar.simple {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.table-toolbar.employee-toolbar {
  grid-template-columns: minmax(0, 1fr);
}

.table-toolbar.payroll-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 210px) minmax(150px, 210px) auto;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 40px;
}

.selection-count {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(36, 120, 242, 0.16);
  border-radius: 999px;
  background: var(--accent-quiet);
  color: var(--accent);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.table-wrap,
.apple-table-wrap,
.employee-table-wrap,
.archive-table-wrap,
.attendance-table-wrap,
.payroll-calc-table-wrap,
.report-table-wrap,
.logs-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.apple-data-card > .table-wrap,
.apple-data-card > .apple-table-wrap,
.apple-data-card .apple-table-wrap {
  border: 0;
  border-radius: 0;
}

table,
.apple-data-table,
.employee-table,
.attendance-table,
.payroll-calc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 12px;
}

thead th {
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  min-height: 56px;
  padding: 11px 12px;
  border-bottom: 1px solid #ededf0;
  background: var(--panel);
  color: var(--ink);
  line-height: 1.4;
  vertical-align: middle;
}

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

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

td.number,
th.number {
  font-variant-numeric: tabular-nums;
}

.person-cell strong,
.org-cell strong,
.apple-person strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.person-cell span,
.org-cell span,
.apple-person small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.apple-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-quiet);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 720;
}

.pill,
.badge,
.lock-badge,
.status-toggle {
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
}

.row-actions,
.table-actions,
.employee-actions,
.payslip-actions,
.payroll-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.mini-button,
.payslip-action {
  min-width: 32px;
  width: 32px;
  min-height: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.mini-button.text-mini,
.mini-button.wide-mini {
  width: auto;
  padding: 0 8px;
}

.mini-button:hover:not(:disabled),
.payslip-action:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--soft);
  box-shadow: none;
  transform: none;
}

.mini-button.danger,
.payslip-action.danger,
.danger-button {
  border-color: rgba(216, 58, 72, 0.18);
  background: var(--red-soft);
  color: var(--red);
}

.empty-state {
  min-height: 170px;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.empty-state.inline {
  min-height: 90px;
}

/* Dashboard */

.dashboard-hero,
.todo-hero {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.42fr);
  align-items: stretch;
  gap: 20px;
  margin: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.dashboard-hero::before,
.dashboard-hero::after {
  display: none;
}

.dashboard-hero > div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.dashboard-hero .eyebrow {
  color: var(--accent-dark) !important;
  font-size: 9px;
  letter-spacing: 0;
}

.dashboard-hero h2 {
  margin-top: 5px;
  color: var(--ink) !important;
  font-size: 32px;
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted) !important;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.dashboard-hero .hero-pills {
  gap: 6px;
  margin-top: 14px;
}

.dashboard-hero .hero-pills button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--muted) !important;
  font-size: 10px;
  font-weight: 620;
  box-shadow: none;
}

.dashboard-hero .hero-pills button:hover {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink) !important;
  transform: none;
}

.hero-status-card,
.payroll-progress-card {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 2px 0 2px 20px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.hero-status-card > span,
.hero-status-card > small {
  color: var(--muted) !important;
  font-size: 10px;
}

.hero-status-card > strong {
  color: var(--ink);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0;
}

.progress-track,
.health-track {
  height: 6px;
  border-radius: 3px;
  background: var(--gray-soft);
  overflow: hidden;
}

.progress-fill,
.health-track span {
  border-radius: 3px;
  background: var(--accent);
  animation: none;
}

.payroll-progress-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.payroll-progress-meta > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.payroll-progress-meta span,
.payroll-progress-meta b {
  color: var(--muted) !important;
  font-size: 9px;
}

.payroll-progress-meta b {
  margin-top: 2px;
  color: var(--ink) !important;
  font-size: 11px;
}

.dashboard-hero-actions {
  gap: 6px;
  margin-top: 3px;
}

.dashboard-hero-actions .ghost-button,
.dashboard-hero-actions .primary,
.dashboard-hero-actions .payroll-entry-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.dashboard-hero-actions .payroll-entry-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.dashboard-hero-actions .payroll-entry-button span,
.dashboard-hero-actions .payroll-entry-button svg {
  color: inherit;
}

.dashboard-panel {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.section-heading {
  min-height: 34px;
  align-items: start;
  gap: 10px;
  margin-bottom: 12px;
}

.section-heading h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

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

.todo-card,
.todo-overview-panel .todo-card,
.todo-overview-panel .todo-card.red,
.todo-overview-panel .todo-card.gold,
.todo-overview-panel .todo-card.green,
.todo-overview-panel .todo-card.blue,
.todo-overview-panel .todo-card.purple,
.todo-overview-panel .todo-card.muted {
  min-width: 0;
  min-height: 94px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.todo-overview-panel .todo-card.red { border-left-color: var(--red); }
.todo-overview-panel .todo-card.gold { border-left-color: var(--gold); }
.todo-overview-panel .todo-card.green { border-left-color: var(--green); }
.todo-overview-panel .todo-card.blue { border-left-color: var(--accent); }
.todo-overview-panel .todo-card.purple { border-left-color: #7d62b3; }
.todo-overview-panel .todo-card.muted { border-left-color: var(--faint); }

.todo-card:hover {
  border-color: var(--line-strong);
  background: var(--soft);
  box-shadow: none;
  transform: none;
}

.todo-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.todo-card strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 740;
  line-height: 1;
  letter-spacing: 0;
}

.todo-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  align-items: start;
  gap: 10px;
}

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

.dashboard-side-stack .dashboard-panel {
  margin: 0;
}

.task-list,
.care-list,
.compact-list {
  display: grid;
  gap: 0;
}

.task-item,
.care-row,
.compact-list > div,
.compact-list .probation-row {
  min-width: 0;
  min-height: 54px;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.task-item:last-child,
.care-row:last-child,
.compact-list > div:last-child {
  border-bottom: 0;
}

.task-item:hover,
.care-row:hover,
.compact-list > div:hover {
  background: var(--soft);
  box-shadow: none;
  transform: none;
}

.care-icon,
.top-rank {
  border-radius: 7px;
  background: var(--accent-quiet);
  color: var(--accent-dark);
}

/* Employees */

.employee-health-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.65fr);
  gap: 9px;
  margin: 0;
}

.employee-health-card,
.employee-status-card {
  min-width: 0;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.employee-health-card h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.employee-health-card p,
.employee-status-card p {
  color: var(--muted);
  font-size: 10px;
}

.employee-health-card > strong {
  color: var(--green);
  font-size: 28px;
  font-weight: 740;
  letter-spacing: 0;
}

.health-meta {
  gap: 12px;
}

.health-meta span,
.health-meta b {
  font-size: 10px;
}

.employee-donut {
  width: 76px;
  height: 76px;
  background: conic-gradient(var(--accent) var(--employee-health), var(--gray-soft) 0);
}

.employee-donut::before {
  inset: 9px;
  background: var(--panel);
}

.employee-toolbar {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.employee-search-row,
.employee-filter-row {
  display: contents;
}

.employee-search-box {
  grid-column: span 2;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 40px;
  border: 0;
  background: transparent;
}

.employee-search-box input {
  min-height: 40px;
  padding-left: 38px;
}

.employee-filter-row .select-pill,
.employee-filter-row select,
.employee-filter-row .selection-count {
  width: 100%;
  min-width: 0;
}

.employee-special-filter-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(8, 127, 245, 0.16);
  border-radius: 8px;
  background: var(--accent-quiet);
  box-shadow: none;
}

.employee-archive-section {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.employee-archive-section .section-heading {
  margin-bottom: 10px;
}

/* Exceptions */

.apple-grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  align-items: stretch;
  gap: 9px;
}

.apple-exception-list,
.exception-list.compact,
.apple-advice-stack {
  display: grid;
  gap: 0;
  padding: 0 15px;
}

.exception-card,
.apple-advice-stack article {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.exception-card:last-child,
.apple-advice-stack article:last-child {
  border-bottom: 0;
}

.exception-card strong,
.apple-advice-stack strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.exception-card p,
.apple-advice-stack span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.exception-card .ghost-button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 9px;
  font-size: 10px;
}

/* Reports */

.reports-module .report-tabs {
  width: max-content;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
}

.report-pane {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.report-hero {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.report-hero::before,
.report-hero::after {
  display: none;
}

.report-hero .eyebrow {
  color: var(--accent-dark);
  font-size: 9px;
}

.report-hero h3 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 730;
  letter-spacing: 0;
}

.report-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.report-hero-total {
  min-width: 220px;
  padding: 3px 0 3px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: right;
  box-shadow: none;
}

.report-hero-total span,
.report-hero-total small {
  color: var(--muted) !important;
  font-size: 10px;
}

.report-hero-total strong {
  margin: 5px 0;
  color: var(--ink) !important;
  font-size: 24px;
  font-weight: 740;
  letter-spacing: 0;
}

.report-grid.report-kpis,
.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.report-card {
  min-width: 0;
  min-height: 96px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.report-card span,
.report-card small {
  color: var(--muted);
  font-size: 10px;
}

.report-card strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 740;
  letter-spacing: 0;
}

.report-visual-grid,
.report-visual-grid.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.report-visual-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-panel,
.report-insight {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.report-panel-head h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
  letter-spacing: 0;
}

.report-panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.report-insight {
  min-height: 104px;
  border-left: 3px solid var(--accent);
}

.report-insight.green { border-left-color: var(--green); }
.report-insight.gold { border-left-color: var(--gold); }
.report-insight.red { border-left-color: var(--red); }
.report-insight.blue { border-left-color: var(--accent); }

.report-insight span,
.report-insight small {
  color: var(--muted);
  font-size: 10px;
}

.report-insight strong {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.bar-list,
.component-list,
.top-list {
  margin-top: 14px;
}

.bar-track {
  height: 7px;
  border-radius: 4px;
  background: var(--gray-soft);
}

.bar-fill {
  border-radius: 4px;
  background: var(--accent);
}

.chart-svg {
  width: 100%;
  max-height: 240px;
  color: var(--muted);
}

/* Import configuration, audit and security */

.apple-grid.import-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  align-items: start;
  gap: 9px;
}

.mapping-intro.apple-info {
  margin: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(8, 127, 245, 0.14);
  border-radius: 8px;
  background: var(--accent-quiet);
}

.mapping-intro strong {
  color: var(--ink);
  font-size: 11px;
}

.mapping-intro span {
  color: var(--muted);
  font-size: 10px;
}

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

.apple-mapping-grid label,
.mapping-grid label {
  min-width: 0;
}

.apple-mapping-grid label > span,
.mapping-grid label > span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.apple-mapping-grid input,
.mapping-grid input {
  min-height: 40px;
  border-radius: 8px;
  font-size: 11px;
}

.mapping-side-card .apple-advice-stack,
.exception-advice-card .apple-advice-stack {
  padding: 0 14px;
}

.settings-grid.apple-settings-grid,
.apple-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.settings-card {
  min-width: 0;
  min-height: 190px;
  display: grid;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.settings-card span,
.settings-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.settings-card strong {
  margin: 8px 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.settings-card button {
  width: max-content;
  min-height: 36px;
  align-self: end;
  margin-top: 14px;
  padding: 0 10px;
  font-size: 10px;
}

.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 9px;
}

.backup-status-panel,
.backup-history-panel,
.backup-status-card {
  min-width: 0;
}

.backup-status-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.backup-status-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.backup-status-card span,
.backup-status-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* Inputs, drawers, dialogs and notifications */

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 8px;
  background-color: var(--panel);
  color: var(--ink);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 127, 245, 0.12);
}

.drawer-overlay,
.confirm-overlay,
.lock-overlay {
  background: rgba(29, 29, 31, 0.34);
  backdrop-filter: blur(8px);
}

.drawer-panel {
  width: min(800px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px 12px 12px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.18);
}

.drawer-header,
.drawer-actions {
  min-height: 62px;
  padding: 12px 18px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.drawer-header h2 {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 730;
  line-height: 1.2;
  letter-spacing: 0;
}

.circle-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

#drawerBody {
  padding: 14px 18px 18px;
  overflow-y: auto;
}

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

.form-grid label,
.form-section label {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 580;
}

.form-grid label > span,
.form-section label > span {
  display: block;
  margin-bottom: 5px;
}

.form-grid input,
.form-grid select,
.form-section input,
.form-section select,
.form-section textarea,
.inline-field-row select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  font-size: 12px;
}

.form-section textarea {
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}

.form-section {
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.employee-participation-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.employee-participation-toggle {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.employee-participation-toggle:has(input:checked) {
  border-color: rgba(8, 127, 245, 0.22);
  background: var(--accent-quiet);
}

.employee-participation-toggle strong {
  color: var(--ink);
  font-size: 11px;
}

.employee-participation-toggle small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.inline-field-row {
  gap: 7px;
}

.inline-field-row .add-store-button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 10px;
}

.drawer-actions .primary,
.drawer-actions .ghost-button,
.drawer-actions .danger-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  box-shadow: none;
}

.confirm-dialog {
  width: min(430px, calc(100vw - 24px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.18);
}

.confirm-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-quiet);
  color: var(--accent-dark);
}

.confirm-dialog h2 {
  font-size: 20px;
  font-weight: 730;
  letter-spacing: 0;
}

.confirm-dialog p,
.confirm-details {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.lock-overlay {
  background: rgba(245, 245, 247, 0.9);
}

.lock-card {
  width: min(380px, calc(100vw - 28px));
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.12);
}

.lock-card .brand-mark {
  border-radius: 10px;
  background: var(--accent);
  box-shadow: none;
}

.lock-card h1 {
  font-size: 22px;
  font-weight: 740;
  letter-spacing: 0;
}

.lock-card p {
  color: var(--muted);
  font-size: 12px;
}

.lock-card input,
.lock-card button {
  min-height: 42px;
  border-radius: 8px;
}

.toast {
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid rgba(29, 29, 31, 0.18);
  border-radius: 8px;
  background: #1d1d1f;
  color: #fff;
  box-shadow: 0 12px 32px rgba(29, 29, 31, 0.18);
  font-size: 11px;
}

.dashboard-panel,
.metric-card,
.apple-metric,
.apple-data-card,
.settings-card,
.report-panel,
.report-insight,
.report-card,
.backup-status-card,
.employee-health-card,
.employee-status-card {
  transition: border-color 140ms ease, background-color 140ms ease;
}

.dashboard-panel:hover,
.metric-card:hover,
.apple-metric:hover,
.apple-data-card:hover,
.settings-card:hover,
.report-panel:hover,
.report-insight:hover,
.report-card:hover,
.backup-status-card:hover,
.employee-health-card:hover,
.employee-status-card:hover {
  border-color: var(--line-strong);
  filter: none;
  box-shadow: none;
  transform: none;
}

@media (max-width: 1180px) {
  .todo-overview-panel .todo-grid,
  .todo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .report-visual-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .apple-grid.import-config-grid,
  .security-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  }
}

@media (max-width: 1050px) {
  .topbar.apple-commandbar {
    grid-template-columns: minmax(200px, 1fr) auto;
    gap: 8px 12px;
  }

  .top-search-shell {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }

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

  .side-panel {
    top: 132px;
    max-height: calc(100vh - 144px);
  }

  .module-nav button,
  .module-nav .module-link {
    padding-inline: 8px;
  }

  .dashboard-hero,
  .todo-hero {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 0.42fr);
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  }

  .apple-toolbar {
    grid-template-columns: minmax(220px, 1fr) auto auto;
  }

  .apple-toolbar .selection-count {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    padding: 8px 8px 20px;
  }

  .topbar.apple-commandbar {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0;
    padding: 9px;
    border-radius: 10px;
  }

  .brand-block h1 {
    font-size: 16px;
  }

  .top-search-shell {
    min-height: 42px;
  }

  .top-controls {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 42px 42px minmax(170px, auto);
    gap: 6px;
  }

  .month-control,
  .top-icon-button,
  .role-control,
  .role-chip {
    height: 42px;
    min-height: 42px;
  }

  .month-control {
    width: 100%;
    min-width: 0;
  }

  .top-icon-button {
    width: 42px;
  }

  .role-control,
  .role-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .role-chip {
    grid-template-columns: 30px minmax(0, 1fr) 12px;
    padding: 4px 7px;
  }

  .role-avatar {
    width: 30px;
    height: 30px;
  }

  .workspace {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
  }

  .side-panel {
    position: relative;
    top: auto;
    width: 100%;
    max-height: none;
    padding: 5px;
    overflow: hidden;
    border-radius: 10px;
  }

  .module-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .side-panel .nav-section-label,
  .side-panel .nav-health-card {
    display: none !important;
  }

  .module-nav button,
  .module-nav .module-link {
    min-width: max-content;
    flex: 0 0 auto;
    grid-template-columns: 17px auto;
    min-height: 38px;
    padding: 0 10px;
  }

  .module-nav .nav-count {
    display: none;
  }

  .content-panel {
    min-height: 0;
  }

  .apple-page-head,
  .panel-header,
  .attendance-module .attendance-apple-head,
  .payroll-calc-page .payroll-calc-hero {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
    padding: 15px !important;
    border-radius: 10px;
  }

  .panel-header {
    align-items: stretch;
  }

  .apple-page-title h2,
  .panel-header h2,
  .attendance-module .apple-page-title h2,
  .payroll-calc-page .payroll-calc-hero h2 {
    font-size: 24px !important;
    line-height: 1.2;
  }

  .apple-head-actions,
  .panel-actions,
  .attendance-module .apple-head-actions,
  .payroll-calc-page .payroll-calc-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  .apple-head-actions > button,
  .panel-actions > button,
  .attendance-module .apple-head-actions > button,
  .payroll-calc-page .payroll-calc-actions > button {
    width: 100%;
    min-width: 0;
  }

  .apple-metrics,
  .report-grid.report-kpis,
  .report-kpis,
  .attendance-stats,
  .payroll-calc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
  }

  .apple-metric,
  .report-card,
  .attendance-stats .stat-card,
  .payroll-calc-kpis .payroll-calc-kpi {
    min-height: 92px;
  }

  .dashboard-hero,
  .todo-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 17px;
    border-radius: 10px;
  }

  .dashboard-hero h2 {
    font-size: 27px;
  }

  .hero-status-card,
  .payroll-progress-card {
    padding: 16px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .todo-overview-panel .todo-grid,
  .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dashboard-grid,
  .employee-health-grid,
  .apple-grid.two,
  .apple-grid.import-config-grid,
  .security-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

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

  .employee-search-box {
    grid-column: 1 / -1;
  }

  .apple-toolbar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  .apple-toolbar .apple-search {
    grid-column: 1 / -1;
  }

  .apple-toolbar .apple-segmented {
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
  }

  .apple-toolbar .apple-segmented button {
    flex: 1 0 auto;
  }

  .report-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 15px;
  }

  .report-hero-total {
    min-width: 0;
    padding: 13px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .report-visual-grid,
  .report-visual-grid.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-grid.apple-settings-grid,
  .apple-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-card {
    min-height: 160px;
  }

  .drawer-panel {
    width: calc(100vw - 12px);
    max-width: none;
    max-height: calc(100vh - 12px);
    margin: 6px;
    border-radius: 10px;
  }

  .drawer-header,
  .drawer-actions {
    padding-inline: 12px;
  }

  #drawerBody {
    padding: 12px;
  }
}

@media (max-width: 620px) {
  .topbar.apple-commandbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-search-shell,
  .top-controls {
    grid-column: 1;
  }

  .top-controls {
    grid-template-columns: minmax(145px, 1fr) 42px 42px;
  }

  .role-control {
    grid-column: 1 / -1;
  }

  .role-chip {
    max-width: none;
  }

  .payroll-progress-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .apple-mapping-grid,
  .mapping-grid,
  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .employee-participation-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-search-box,
  .employee-filter-row > *,
  .employee-filter-row .selection-count {
    grid-column: 1;
  }

  .apple-head-actions,
  .panel-actions,
  .attendance-module .apple-head-actions,
  .payroll-calc-page .payroll-calc-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .apple-metrics,
  .report-grid.report-kpis,
  .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .apple-metric strong,
  .report-card strong {
    font-size: 21px;
  }

  .todo-overview-panel .todo-grid,
  .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dashboard-panel {
    padding: 13px;
  }

  .settings-card {
    min-height: 0;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 390px) {
  .apple-metrics,
  .report-grid.report-kpis,
  .report-kpis,
  .attendance-stats,
  .payroll-calc-kpis {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .todo-overview-panel .todo-grid,
  .todo-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button span,
body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button svg {
  color: #fff !important;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button:not(.payroll-entry-button) span,
body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button:not(.payroll-entry-button) svg {
  color: var(--ink) !important;
}

.table-wrap {
  background: #fff;
  overflow: auto;
}

.account-center {
  display: grid;
  gap: 18px;
  background: #eaf4ff;
  padding: 0 0 18px;
}

.account-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

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

.account-panel-head h2 {
  margin: 0;
}

.account-panel-head p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-table-wrap,
.permission-matrix-wrap {
  overflow: auto;
}

.account-table,
.permission-matrix-table {
  min-width: 980px;
}

.account-table th,
.account-table td,
.permission-matrix-table th,
.permission-matrix-table td {
  padding: 16px 20px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid #dce8f5;
  background: #f4f8fd;
  color: var(--ink);
}

.role-hr { background: #e8f7ef; border-color: #c6eed8; color: #0b8b55; }
.role-student { background: #eef6ff; border-color: #cfe4ff; color: #1263cf; }
.role-boss { background: #f3eeff; border-color: #dfd5ff; color: #6946d8; }
.role-admin { background: #fff0f2; border-color: #ffd0d7; color: #c63b4b; }

.permission-matrix-table td:first-child {
  min-width: 220px;
}

.permission-matrix-table td:first-child strong,
.permission-matrix-table td:first-child span {
  display: block;
}

.permission-matrix-table td:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 1px solid #dbe7f4;
  border-radius: 14px;
  background: #f7fbff;
}

.perm-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  min-width: 48px;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.perm-toggle input {
  accent-color: var(--accent);
  width: 12px;
  height: 12px;
}

.perm-toggle:has(input:checked) {
  color: #0b8b55;
  border-color: #c6eed8;
  background: #e9f8f0;
}

.permission-matrix-table th,
.permission-matrix-table td {
  padding: 10px 16px;
}

.permission-matrix-table tbody tr:hover {
  background: #f7fbff;
}

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

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  backdrop-filter: blur(16px);
}

td {
  font-size: 14px;
}

tbody tr {
  background: #fff;
}

tbody tr:hover,
tbody tr.selected-row {
  background: var(--accent-quiet);
}

.select-col {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.select-col input,
.row-select {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.person-cell {
  display: grid;
  gap: 3px;
}

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

.person-cell span {
  color: var(--muted);
  font-size: 12px;
}

.org-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.org-cell strong,
.org-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-cell span {
  color: var(--muted);
  font-size: 12px;
}

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.actions-col {
  width: 188px;
}

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

.payroll-actions {
  justify-content: flex-start;
}

.channel-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.channel-cell strong,
.channel-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-cell span {
  color: var(--muted);
  font-size: 12px;
}

.status-toggle {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.status-toggle.green {
  border-color: rgba(38, 132, 89, 0.18);
  background: var(--green-soft);
  color: var(--green);
}

.status-toggle.gold {
  border-color: rgba(186, 138, 28, 0.2);
  background: var(--gold-soft);
  color: var(--gold);
}

.status-toggle:hover {
  filter: brightness(0.98);
}

.payslip-table {
  min-width: 1360px;
  table-layout: fixed;
}

.payslip-table .actions-col {
  width: 500px;
}

.payslip-actions {
  min-width: 462px;
  justify-content: flex-start;
  gap: 7px;
}

.employee-table {
  min-width: 0;
  table-layout: fixed;
}

.employee-table th,
.employee-table td {
  padding-inline: 10px;
}

.employee-table td {
  overflow: hidden;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) {
  width: 11.5%;
}

.employee-table th:nth-child(2),
.employee-table td:nth-child(2) {
  width: 13.5%;
}

.employee-table th:nth-child(3),
.employee-table td:nth-child(3),
.employee-table th:nth-child(5),
.employee-table td:nth-child(5),
.employee-table th:nth-child(6),
.employee-table td:nth-child(6),
.employee-table th:nth-child(8),
.employee-table td:nth-child(8),
.employee-table th:nth-child(9),
.employee-table td:nth-child(9) {
  width: 5.6%;
}

.employee-table th:nth-child(4),
.employee-table td:nth-child(4) {
  width: 7.2%;
}

.employee-table th:nth-child(7),
.employee-table td:nth-child(7) {
  width: 16.4%;
}

.employee-table th:nth-child(10),
.employee-table td:nth-child(10) {
  width: 7.8%;
}

.employee-actions-col {
  width: 16.8%;
  min-width: 0;
}

.employee-actions {
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 5px;
}

.employee-actions .mini-button {
  flex: 0 0 auto;
  min-width: 34px;
}

.employee-actions .wide-mini {
  min-width: 62px;
}

.employee-actions .text-mini {
  padding-inline: 7px;
}

.employee-actions .text-mini span {
  white-space: nowrap;
}

.contract-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contract-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.contract-cell small.danger-text {
  color: var(--red);
}

.contract-cell small.warning-text {
  color: #b7791f;
}

.contract-cell .badge {
  justify-self: start;
}

.contract-progress-cell {
  gap: 6px;
}

.contract-period-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.contract-period-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.contract-progress-track span {
  display: block;
  width: var(--contract-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #30d158);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.22);
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease;
}

.contract-progress-cell.is-aging .contract-progress-track span {
  background: linear-gradient(90deg, #0a84ff, #ffcc00);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.2);
}

.contract-progress-cell.is-soon .contract-progress-track span {
  background: linear-gradient(90deg, #ffcc00, #ff9f0a);
  box-shadow: 0 0 12px rgba(255, 159, 10, 0.2);
}

.contract-progress-cell.is-expired .contract-progress-track span {
  background: linear-gradient(90deg, #ff453a, #ff9f0a);
  box-shadow: 0 0 12px rgba(255, 69, 58, 0.18);
}

.health-certificate-cell {
  max-width: none;
  min-width: 0;
  white-space: normal;
}

.health-certificate-line {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.health-certificate-line .badge {
  flex: 0 0 auto;
}

.health-certificate-line span {
  min-width: 0;
  overflow: visible;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.contract-not-signed-cell {
  min-height: 52px;
  align-content: center;
  justify-items: start;
}

.contract-not-signed-cell small {
  color: var(--muted);
  font-weight: 800;
}

.health-certificate-cell .contract-progress-track {
  height: 5px;
}

.health-certificate-cell.is-health-active .contract-progress-track span {
  background: linear-gradient(90deg, #0a84ff, #30d158);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .contract-progress-track span {
    transition: none;
  }
}

.mini-button,
.circle-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.mini-button {
  width: 29px;
  height: 29px;
  border-radius: var(--radius);
}

.mini-button.text-mini {
  display: inline-flex;
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  gap: 4px;
  font-size: 12px;
  font-weight: 760;
}

.mini-button.wide-mini {
  min-width: 82px;
}

.payslip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 66px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.payslip-action svg {
  width: 16px;
  height: 16px;
}

.payslip-action:hover {
  border-color: var(--line-strong);
  background: var(--soft);
}

.payslip-action:disabled {
  cursor: default;
  opacity: 0.56;
  background: #f8fafc;
}

.payslip-action.danger {
  color: var(--red);
  border-color: rgba(169, 81, 73, 0.18);
}

.payslip-action.danger:hover {
  background: rgba(247, 238, 238, 0.86);
  border-color: rgba(169, 81, 73, 0.32);
}

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

.file-field {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.file-field input {
  min-height: 40px;
  border: 1px dashed rgba(36, 120, 242, 0.26);
  border-radius: var(--radius);
  background: var(--accent-quiet);
  padding: 9px;
}

.store-select-field {
  display: grid;
  gap: 8px;
}

.inline-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.add-store-button {
  min-height: 38px;
  padding: 0 12px;
}

.mini-button.danger {
  border-color: rgba(217, 77, 77, 0.2);
  color: var(--red);
}

.mini-button.danger:hover {
  background: var(--red-soft);
}

.danger-mini {
  border-color: rgba(217, 77, 77, 0.2);
  color: var(--red);
}

.danger-mini:hover {
  background: var(--red-soft);
}

.circle-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.badge,
.pill-button,
.batch-code {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.badge.green,
.pill-button.ok {
  border-color: rgba(56, 96, 81, 0.14);
  background: var(--green-soft);
  color: var(--green);
}

.badge.red,
.pill-button.warning {
  border-color: rgba(169, 81, 73, 0.14);
  background: var(--red-soft);
  color: var(--red);
}

.badge.gold {
  border-color: rgba(127, 111, 72, 0.14);
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.blue,
.batch-code {
  border-color: rgba(48, 72, 63, 0.14);
  background: var(--accent-quiet);
  color: var(--accent);
}

.badge.muted {
  border-color: rgba(33, 39, 36, 0.08);
  background: var(--gray-soft);
  color: var(--muted);
}

.pill-button {
  cursor: pointer;
}

.status-select {
  width: auto;
  min-width: 92px;
  min-height: 28px;
  border-radius: 999px;
  padding: 2px 26px 2px 10px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  cursor: pointer;
}

.status-select.tone-green {
  border-color: rgba(16, 167, 131, 0.16);
  background: var(--green-soft);
  color: var(--green);
}

.status-select.tone-gold {
  border-color: rgba(216, 138, 34, 0.18);
  background: var(--gold-soft);
  color: var(--gold);
}

.status-select.tone-red {
  border-color: rgba(217, 77, 77, 0.16);
  background: var(--red-soft);
  color: var(--red);
}

.status-select.tone-muted {
  border-color: rgba(33, 39, 36, 0.08);
  background: var(--gray-soft);
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--muted);
}

.empty-state.inline {
  min-height: 130px;
}

.empty-state strong {
  color: var(--ink);
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 16px 18px 0;
  padding: 22px;
  border: 1px solid rgba(36, 120, 242, 0.12);
  border-radius: 16px;
  background: linear-gradient(90deg, #eef6ff 0%, #ffffff 68%);
  border-bottom: 1px solid var(--line);
}

.dashboard-hero p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-pills span,
.hero-pills button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(36, 120, 242, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 720;
}

.hero-pills button:hover {
  border-color: rgba(36, 120, 242, 0.24);
  background: #fff;
}

.hero-status-card {
  display: grid;
  min-width: 260px;
  gap: 7px;
  border: 1px solid rgba(36, 120, 242, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.hero-status-card span,
.hero-status-card small {
  color: var(--muted);
  font-size: 12px;
}

.hero-status-card strong {
  font-size: 26px;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 4px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 0;
}

.workflow-step {
  display: grid;
  gap: 5px;
  min-height: 88px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.workflow-step span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
}

.workflow-step strong {
  font-size: 14px;
}

.workflow-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.workflow-step.done {
  border-color: rgba(16, 167, 131, 0.13);
  background: var(--green-soft);
}

.workflow-step.current {
  border-color: rgba(36, 120, 242, 0.24);
  background: var(--accent-quiet);
  box-shadow: inset 0 0 0 1px rgba(36, 120, 242, 0.08), var(--shadow-soft);
}

.workflow-step.pending {
  opacity: 0.62;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
  padding: 14px 18px;
}

.dashboard-panel {
  border-top: 0;
  padding: 16px 18px;
}

.dashboard-grid .dashboard-panel,
.quick-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.dashboard-side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.quick-panel {
  margin: 0 18px;
}

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

.quick-app {
  display: grid;
  min-height: 104px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  padding: 12px;
  text-align: center;
}

.quick-app > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(36, 120, 242, 0.16);
}

.quick-app:nth-child(2n) > span {
  background: var(--cyan);
}

.quick-app:nth-child(3n) > span {
  background: var(--green);
}

.quick-app strong {
  font-size: 14px;
}

.quick-app small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.todo-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.todo-card:hover {
  border-color: rgba(36, 120, 242, 0.2);
  background: #fff;
}

.todo-card.red {
  border-color: rgba(217, 77, 77, 0.16);
  background: var(--red-soft);
}

.todo-card.gold {
  border-color: rgba(216, 138, 34, 0.18);
  background: var(--gold-soft);
}

.todo-card.green {
  border-color: rgba(16, 167, 131, 0.16);
  background: var(--green-soft);
}

.todo-card.blue {
  border-color: rgba(36, 120, 242, 0.18);
  background: var(--accent-quiet);
}

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

.todo-card strong {
  font-size: 28px;
}

.quick-links-panel .section-heading {
  margin-bottom: 8px;
}

.compact-quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-quick-app {
  min-height: 74px;
  padding: 10px;
}

.compact-quick-app > span {
  width: 32px;
  height: 32px;
}

.care-list {
  display: grid;
  gap: 9px;
}

.care-row,
.department-card {
  display: grid;
  width: 100%;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  text-align: left;
}

.care-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
}

.care-icon,
.department-card-icon {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-quiet);
  color: var(--accent);
}

.care-icon {
  width: 36px;
  height: 36px;
}

.care-row strong,
.care-row small,
.department-card strong,
.department-card small {
  display: block;
}

.care-row small,
.department-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.care-row em,
.department-card em {
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.department-overview-panel {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

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

.department-card {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  min-height: 112px;
  align-content: start;
  padding: 12px;
}

.department-card-icon {
  width: 38px;
  height: 38px;
}

.department-card em {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
}

.department-card.active,
.department-card:hover,
.care-row:hover {
  border-color: rgba(36, 120, 242, 0.18);
  background: var(--accent-quiet);
}

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

.compact-list div {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.compact-list span {
  color: var(--muted);
  font-size: 12px;
}

.exception-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.exception-summary article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.exception-summary span {
  color: var(--muted);
  font-size: 12px;
}

.exception-summary strong {
  font-size: 24px;
}

.exception-list {
  display: grid;
  gap: 10px;
  padding: 16px 22px 22px;
}

.exception-list.compact {
  padding: 16px 22px 22px;
}

.compact-header {
  border-top: 1px solid var(--line);
}

.exception-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.exception-card strong,
.exception-card p {
  display: block;
  margin-top: 6px;
}

.exception-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mapping-intro {
  display: grid;
  gap: 4px;
  margin: 16px 22px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 14px;
}

.mapping-intro span {
  color: var(--muted);
  font-size: 12px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 0 22px 22px;
}

.mapping-grid label {
  display: grid;
  gap: 6px;
}

.batch-split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.batch-split span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
}

.batch-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 16px;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 20px 22px 4px;
}

.report-hero h3 {
  margin-top: 4px;
  font-size: 24px;
}

.report-hero p {
  margin-top: 6px;
  color: var(--muted);
}

.report-hero-total {
  display: grid;
  min-width: 240px;
  gap: 4px;
  border: 1px solid rgba(36, 120, 242, 0.14);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, var(--accent-quiet));
  padding: 14px 16px;
  text-align: right;
}

.report-hero-total span,
.report-hero-total small {
  color: var(--muted);
  font-size: 12px;
}

.report-hero-total strong {
  font-size: 24px;
}

.report-kpis {
  padding-top: 14px;
}

.report-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 22px 18px;
}

.report-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

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

.report-card strong {
  font-size: 22px;
}

.report-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 22px 18px;
}

.report-visual-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-panel,
.report-insight {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

/* ==================== 工资计算 ==================== */

.payroll-calc-page {
  display: grid;
  gap: 18px;
}

.payroll-calc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 12%, rgba(36, 120, 242, 0.12), transparent 34%),
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--shadow-soft);
}

.payroll-calc-hero h2 {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 840;
}

.payroll-calc-hero p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 640;
}

.hero-pills,
.payroll-calc-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pills {
  margin-top: 14px;
}

.hero-pills > span:not(:has(.badge)) {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--solid);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.payroll-calc-actions {
  justify-content: flex-end;
  max-width: 460px;
}

.payroll-calc-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--solid);
  overflow-x: auto;
}

.payroll-calc-tabs button {
  flex: 0 0 auto;
  border-radius: 12px;
  background: transparent;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 760;
}

.payroll-calc-tabs button.active {
  background: var(--accent-quiet);
  color: var(--accent);
}

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

.payroll-calc-step {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--solid);
  padding: 12px;
}

.payroll-calc-step > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--gray-soft);
  color: var(--muted);
  font-weight: 850;
}

.payroll-calc-step.done > span {
  background: var(--accent);
  color: #fff;
}

.payroll-calc-step strong,
.payroll-calc-step small {
  display: block;
}

.payroll-calc-step strong {
  font-size: 13px;
}

.payroll-calc-step small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.payroll-calc-step .calc-step-warning {
  display: block;
  margin-top: 6px;
  color: #c2410c;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.35;
}

.payroll-calc-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.payroll-calc-kpi {
  min-height: 116px;
  border-color: var(--line);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-soft);
}

.payroll-calc-kpi.green {
  border-left-color: var(--green);
}

.payroll-calc-kpi.red {
  border-color: rgba(217, 77, 77, 0.24);
  border-left-color: var(--red);
  background: var(--red-soft);
}

.payroll-advance-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
}

.payroll-advance-card h3 {
  margin: 2px 0 6px;
}

.payroll-advance-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.payroll-advance-controls label {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.payroll-advance-controls select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

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

.payroll-dept-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--solid);
  box-shadow: var(--shadow-soft);
}

.payroll-dept-card {
  padding: 18px;
}

.payroll-dept-card > div:first-child {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dept-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.payroll-dept-card h3 {
  font-size: 18px;
}

.payroll-dept-card small {
  color: var(--muted);
  font-weight: 680;
}

.payroll-dept-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.payroll-dept-card dt,
.payroll-dept-card dd {
  margin: 0;
}

.payroll-dept-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.payroll-dept-card dd {
  margin-top: 3px;
  font-weight: 850;
}

.payroll-calc-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px 160px auto;
  gap: 10px;
}

.payroll-calc-table-wrap {
  border-radius: 18px;
}

.payroll-calc-table {
  width: 100%;
  min-width: 2660px;
  border-collapse: collapse;
  font-size: 13px;
}

.payroll-calc-table th,
.payroll-calc-table td,
.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.payroll-calc-table th,
.mini-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.payroll-calc-table .number,
.mini-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.payroll-calc-table .strong {
  font-weight: 880;
}

.calc-more-button {
  margin-top: 10px;
}

.payroll-rule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.payroll-rule-explanation {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(36, 154, 95, 0.07);
  border: 1px solid rgba(36, 154, 95, 0.18);
}

.payroll-rule-explanation strong {
  color: var(--ink);
  line-height: 1.55;
}

.payroll-rule-explanation p,
.payroll-rule-explanation small {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.performance-bonus-scheme-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.bonus-scheme-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(218, 145, 36, 0.32);
  border-radius: 14px;
  background: rgba(218, 145, 36, 0.07);
}

.bonus-scheme-active-banner.is-active {
  border-color: rgba(36, 154, 95, 0.28);
  background: rgba(36, 154, 95, 0.07);
}

.bonus-scheme-active-banner > div {
  display: grid;
  gap: 3px;
}

.bonus-scheme-active-banner span,
.bonus-scheme-active-banner small {
  color: var(--muted);
  font-size: 11px;
}

.bonus-scheme-active-banner strong {
  color: var(--ink);
  font-size: 14px;
}

.performance-bonus-scheme-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.performance-bonus-scheme-card {
  min-width: 0;
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.performance-bonus-scheme-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.performance-bonus-scheme-card > header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.performance-bonus-scheme-card > header strong {
  color: var(--ink);
  font-size: 14px;
}

.performance-bonus-scheme-card > header span,
.performance-bonus-scheme-card dt {
  color: var(--muted);
  font-size: 10px;
}

.bonus-scheme-rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bonus-scheme-rule-chips > span {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-bonus-scheme-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.performance-bonus-scheme-card dl > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.performance-bonus-scheme-card dd {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-scheme-actions {
  flex-wrap: wrap;
}

.bonus-policy-document-field,
.bonus-rule-prorate,
.employee-job-level-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.bonus-policy-document-field {
  align-items: flex-start;
  flex-direction: column;
}

.bonus-policy-document-field span,
.bonus-rule-prorate span,
.employee-job-level-confirm strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.bonus-policy-document-field small,
.employee-job-level-confirm small {
  color: var(--muted);
  font-size: 10px;
}

.performance-bonus-rule-editors {
  display: grid;
  gap: 12px;
}

.performance-bonus-rule-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(38, 123, 236, 0.025);
}

.performance-bonus-rule-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.job-level-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(38, 123, 236, 0.22);
  border-radius: 10px;
  background: rgba(38, 123, 236, 0.05);
}

.job-level-guidance.is-blocking {
  border-color: rgba(211, 67, 67, 0.28);
  background: rgba(211, 67, 67, 0.06);
}

.job-level-guidance strong,
.job-level-guidance span {
  color: var(--ink);
  font-size: 11px;
}

.job-level-guidance span {
  flex: 1;
  color: var(--muted);
}

.employee-job-level-confirm > span {
  display: grid;
  gap: 2px;
}

.job-level-approval-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 10px;
}

.job-level-history {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.job-level-history > strong {
  color: var(--ink);
  font-size: 11px;
}

.job-level-history > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.4fr) minmax(0, 1fr);
  gap: 8px;
  color: var(--ink);
  font-size: 10px;
}

.job-level-history small {
  color: var(--muted);
}

.payroll-bonus-match-summary {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.payroll-bonus-match-summary > div {
  display: grid;
  gap: 2px;
  padding-left: 9px;
  border-left: 3px solid var(--gold);
}

.payroll-bonus-match-summary > div.is-awarded { border-left-color: var(--green); }
.payroll-bonus-match-summary > div.is-blocking { border-left-color: var(--red); }

.payroll-bonus-match-summary strong,
.payroll-bonus-match-summary span {
  color: var(--ink);
  font-size: 10px;
}

.payroll-bonus-match-summary span { color: var(--muted); }

.bonus-impact-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.bonus-impact-summary span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}

.bonus-impact-table-wrap {
  max-height: 46vh;
  overflow: auto;
}

.bonus-impact-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.bonus-impact-table-wrap th,
.bonus-impact-table-wrap td {
  padding: 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.payroll-recalculation-card {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(218, 145, 36, 0.32);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 249, 235, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 30px rgba(133, 84, 12, 0.08);
}

.payroll-recalculation-card.is-ready {
  border-color: rgba(38, 123, 236, 0.28);
  background: linear-gradient(135deg, rgba(238, 246, 255, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 30px rgba(38, 123, 236, 0.08);
}

.payroll-recalculation-card.is-current {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border-color: rgba(36, 154, 95, 0.24);
  background: rgba(36, 154, 95, 0.055);
  box-shadow: none;
}

.payroll-recalculation-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
}

.payroll-recalculation-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: rgba(38, 123, 236, 0.10);
}

.payroll-recalculation-card.is-blocking .payroll-recalculation-icon {
  color: #9a6416;
  background: rgba(218, 145, 36, 0.13);
}

.payroll-recalculation-card.is-current .payroll-recalculation-icon {
  color: var(--green);
  background: rgba(36, 154, 95, 0.10);
}

.payroll-recalculation-icon .app-icon {
  width: 21px;
  height: 21px;
}

.payroll-recalculation-head > div:nth-child(2),
.payroll-recalculation-card.is-current > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.payroll-recalculation-card span,
.payroll-recalculation-card small {
  color: var(--muted);
  font-size: 11px;
}

.payroll-recalculation-card strong {
  color: var(--ink);
  font-size: 15px;
}

.payroll-recalculation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.payroll-recalculation-summary > span {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.payroll-recalculation-summary > span strong {
  font-size: 13px;
}

.payroll-recalculation-summary.is-dialog {
  margin: 12px 0;
}

.payroll-missing-level-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payroll-missing-level-list .mini-button {
  min-width: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 10px 11px;
  text-align: left;
}

.payroll-missing-level-list .mini-button strong,
.payroll-missing-level-list .mini-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-missing-level-list .mini-button strong {
  font-size: 12px;
}

.payroll-missing-level-list .mini-button span {
  grid-column: 1;
  font-size: 10px;
}

.payroll-missing-level-list .mini-button em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
}

.payroll-recalculation-confirm-note {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--ink);
  background: rgba(38, 123, 236, 0.07);
}

.payroll-recalculation-confirm-note span {
  color: var(--muted);
  font-size: 11px;
}

.payroll-recalculation-table-wrap {
  max-height: 48vh;
}

.payroll-recalculation-table-wrap td > strong,
.payroll-recalculation-table-wrap td > small {
  display: block;
}

.payroll-recalculation-table-wrap td > small {
  margin-top: 3px;
  color: var(--muted);
}

.payroll-recalculation-table-wrap .is-positive { color: var(--green); }
.payroll-recalculation-table-wrap .is-negative { color: var(--red); }

.panel-card {
  padding: 18px;
}

.payroll-rule-form {
  margin-top: 14px;
}

.rule-note {
  margin-top: 12px;
  line-height: 1.6;
}

.probation-department-rule {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.72));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.probation-department-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.probation-department-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.probation-department-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}

.probation-department-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.probation-department-option {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.probation-department-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.probation-department-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.62);
  transition: 0.18s ease;
}

.probation-department-option input:checked + span {
  border-color: rgba(0, 113, 227, 0.28);
  color: #0b63ce;
  background: rgba(0, 113, 227, 0.10);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.65), 0 10px 22px rgba(0, 113, 227, 0.08);
}

.payroll-performance-rate-card {
  grid-column: 1 / -1;
}

.payroll-paid-rest-card {
  grid-column: 1 / -1;
}

.payroll-rule-toggle {
  min-height: 68px;
}

.payroll-rule-toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.paid-rest-simulator {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
}

.paid-rest-sim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.paid-rest-sim-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.paid-rest-sim-head span,
.paid-rest-sim-output p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.paid-rest-sim-form {
  margin-top: 0;
}

.paid-rest-sim-output {
  display: grid;
  gap: 10px;
}

.paid-rest-sim-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.paid-rest-sim-metrics div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.paid-rest-sim-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.paid-rest-sim-metrics strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .paid-rest-sim-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.performance-rate-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.performance-rate-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(130px, 180px));
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 255, 0.74));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.performance-rate-row > div,
.performance-rate-row label {
  display: grid;
  gap: 5px;
}

.performance-rate-row strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.performance-rate-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.performance-rate-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  text-align: right;
}

@media (max-width: 900px) {
  .payroll-rule-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .performance-bonus-scheme-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .performance-bonus-scheme-card dl,
  .bonus-impact-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bonus-scheme-active-banner,
  .job-level-guidance {
    align-items: flex-start;
    flex-direction: column;
  }

  .payroll-recalculation-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .payroll-recalculation-actions {
    grid-column: 1 / -1;
  }

  .payroll-recalculation-summary,
  .payroll-missing-level-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-rate-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.calc-detail,
.calc-detail-block {
  display: grid;
  gap: 14px;
}

.calc-detail-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.calc-detail-block h4 {
  margin: 6px 0 0;
}

body[data-hr-view] .drawer-panel.payroll-review-drawer {
  width: min(1180px, calc(100vw - 24px));
}

.payroll-final-review {
  padding: 18px;
  border: 1px solid rgba(38, 123, 236, 0.24);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(239, 247, 255, 0.9), rgba(255, 255, 255, 0.98));
}

.payroll-final-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.payroll-final-review-head > div {
  display: grid;
  gap: 4px;
}

.payroll-final-review-head h4,
.payroll-final-review-head small,
.payroll-final-review-head .eyebrow {
  margin: 0;
}

.payroll-final-review-head small,
.payroll-final-review-table td > small,
.payroll-final-review-table td > strong + small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.payroll-final-review-table td > strong + small {
  display: block;
  margin-top: 3px;
}

.payroll-final-review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.payroll-final-review-summary > span {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 10px;
}

.payroll-final-review-summary strong {
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.payroll-final-review-summary .is-total {
  border-color: rgba(36, 154, 95, 0.28);
  background: rgba(36, 154, 95, 0.07);
}

.payroll-final-review-summary .is-total strong {
  color: var(--green);
}

.payroll-final-review-table-wrap {
  max-height: 48vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.payroll-final-review-table {
  min-width: 880px;
}

.payroll-final-review-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--soft);
}

.payroll-final-review-table th,
.payroll-final-review-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.payroll-final-review-table tr.is-reviewed {
  background: rgba(125, 92, 246, 0.04);
}

.payroll-final-review-table tr.is-changed {
  background: rgba(38, 123, 236, 0.08);
  box-shadow: 3px 0 0 var(--accent) inset;
}

.payroll-final-review-input {
  min-width: 132px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.payroll-final-review-input:focus-within {
  border-color: rgba(38, 123, 236, 0.58);
  box-shadow: 0 0 0 3px rgba(38, 123, 236, 0.1);
}

.payroll-final-review-input span {
  color: var(--muted);
  font-weight: 750;
}

.payroll-final-review-input input {
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.payroll-final-review-reason {
  display: grid;
  gap: 7px;
}

.payroll-final-review-reason > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.payroll-final-review-reason small {
  color: var(--muted);
  font-weight: 500;
}

.payroll-final-review-reason textarea {
  width: 100%;
  resize: vertical;
}

@media (max-width: 760px) {
  .payroll-final-review {
    padding: 12px;
  }

  .payroll-final-review-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .payroll-final-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-panel {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
}

.report-panel-head h3 {
  font-size: 16px;
}

.report-panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.bar-meta strong {
  color: var(--ink);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-soft);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.component-list {
  display: grid;
  gap: 10px;
}

.component-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.component-row strong {
  font-size: 13px;
}

.component-row small {
  color: var(--muted);
  font-size: 12px;
}

.component-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--faint);
}

.component-dot.blue {
  background: var(--accent);
}

.component-dot.green {
  background: var(--green);
}

.component-dot.gold {
  background: var(--gold);
}

.component-dot.red {
  background: var(--red);
}

.report-insight {
  display: grid;
  gap: 7px;
  min-height: 118px;
  align-content: center;
  padding: 15px;
}

.report-insight span,
.report-insight small {
  color: var(--muted);
  font-size: 12px;
}

.report-insight strong {
  font-size: 16px;
}

.report-insight.blue {
  background: linear-gradient(135deg, #fff, var(--accent-quiet));
}

.report-insight.green {
  background: linear-gradient(135deg, #fff, var(--green-soft));
}

.report-insight.gold {
  background: linear-gradient(135deg, #fff, var(--gold-soft));
}

.report-insight.red {
  background: linear-gradient(135deg, #fff, var(--red-soft));
}

.report-table-wrap {
  margin: 0 22px 22px;
}

.report-card strong {
  overflow: hidden;
  font-size: clamp(21px, 1.8vw, 28px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-insight-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.report-insight-card:hover {
  border-color: rgba(36, 120, 242, 0.18);
  background: var(--soft);
}

.report-insight-icon {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: span 3;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-quiet);
  color: var(--accent);
}

.report-insight-icon .app-icon {
  width: 21px;
  height: 21px;
}

.report-insight-card > span:not(.report-insight-icon),
.report-insight-card small {
  color: var(--muted);
  font-size: 12px;
}

.report-insight-card strong {
  font-size: 24px;
  line-height: 1.05;
}

.report-insight-card.green .report-insight-icon {
  background: var(--green-soft);
  color: var(--green);
}

.report-insight-card.gold .report-insight-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.report-insight-card.red .report-insight-icon {
  background: var(--red-soft);
  color: var(--red);
}

.report-insight-card.blue .report-insight-icon {
  background: var(--accent-quiet);
  color: var(--accent);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  padding: 0 22px 22px;
}

.split-grid section,
.import-report-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.table-wrap.compact table {
  min-width: 760px;
}

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

.alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 11px;
}

.alert-row strong,
.alert-row span {
  display: block;
}

.alert-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.alert-row > span:last-child {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.import-report-panel {
  margin: 0 22px 22px;
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.import-record {
  align-items: start;
}

.warning-text {
  color: var(--red) !important;
}

.batch-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

.batch-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.batch-card-head strong,
.batch-card-head span,
.settings-card span,
.settings-card strong,
.settings-card p {
  display: block;
}

.batch-card-head span,
.settings-card span,
.settings-card p {
  color: var(--muted);
  font-size: 12px;
}

.batch-total {
  margin: 12px 0 7px;
  font-size: 25px;
  font-weight: 780;
}

.settings-card strong {
  margin: 7px 0;
  font-size: 22px;
}

.settings-card p {
  min-height: 42px;
  line-height: 1.5;
}

.settings-card button {
  margin-top: 14px;
}

.backup-status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 12px;
  padding: 18px 22px 0;
}

.backup-status-card {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

.backup-status-card.compact {
  display: grid;
  align-content: start;
}

.backup-status-card span,
.backup-status-card p {
  color: var(--muted);
  font-size: 12px;
}

.backup-status-card strong {
  display: block;
  margin: 6px 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.backup-status-card p {
  line-height: 1.5;
}

.backup-status-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
  gap: 8px;
}

.drawer-overlay,
.confirm-overlay,
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  background: rgba(11, 31, 58, 0.28);
  backdrop-filter: blur(12px);
}

.drawer-overlay.open,
.drawer-overlay.active,
.confirm-overlay.open,
.confirm-overlay.active,
.lock-overlay.open,
.lock-overlay.active {
  display: flex;
}

.drawer-overlay {
  justify-content: flex-end;
}

.drawer-panel {
  width: min(820px, 100%);
  height: 100%;
  overflow: auto;
  padding: 20px;
  background: var(--solid);
}

.drawer-overlay.shift-rule-overlay {
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 14px 20px;
}

.drawer-panel.shift-rule-shell {
  width: min(1480px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  height: calc(100vh - 28px);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  border: 1px solid rgba(210, 225, 244, 0.94);
  border-radius: 32px;
  background: rgba(248, 251, 255, 0.97);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
}

.drawer-panel.shift-rule-shell .drawer-header {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 18px 28px 10px;
  border-bottom: 1px solid rgba(214, 226, 242, 0.82);
  background: rgba(248, 251, 255, 0.92);
  backdrop-filter: blur(18px) saturate(1.1);
}

.drawer-panel.shift-rule-shell .drawer-title-row {
  min-width: 0;
}

.drawer-panel.shift-rule-shell .drawer-title-row h2 {
  font-size: 24px;
  line-height: 1.2;
}

.drawer-panel.shift-rule-shell #drawerBody {
  padding: 0 24px 108px;
}

.drawer-panel.shift-rule-shell .drawer-actions {
  display: none;
}

.drawer-header,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.drawer-actions {
  position: sticky;
  bottom: -20px;
  margin: 20px -20px -20px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.drawer-form.custom-drawer-shell > .drawer-actions,
.drawer-panel.custom-drawer-shell > .drawer-actions {
  display: none;
}

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

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

.form-grid label,
.form-section label {
  display: grid;
  gap: 6px;
}

.form-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.employee-participation-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.employee-participation-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.employee-participation-toggle:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.42);
  background: var(--accent-quiet);
}

.employee-participation-toggle input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.employee-participation-toggle strong,
.employee-participation-toggle small {
  display: block;
}

.employee-participation-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.employee-participation-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.confirm-overlay {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.confirm-dialog,
.lock-card {
  width: min(540px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-color: var(--line);
  border-radius: 14px;
  padding: 22px;
  background: #fff;
}

.confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--accent-quiet);
  color: var(--accent);
}

.confirm-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-dialog h2 {
  margin-bottom: 8px;
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.55;
}

.confirm-details {
  margin-top: 16px;
}

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

.confirm-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.confirm-record strong,
.confirm-record span {
  display: block;
}

.confirm-record span,
.confirm-more {
  color: var(--muted);
  font-size: 12px;
}

.confirm-record > div:last-child {
  text-align: right;
}

.confirm-actions {
  margin-top: 20px;
}

.lock-overlay {
  z-index: var(--z-lock-overlay);
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 12%, rgba(43, 126, 244, 0.12), transparent 32%),
    linear-gradient(180deg, #f6f9ff 0%, #eef5ff 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lock-card {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.lock-card .brand-mark {
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-toast);
  display: none;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.show,
.toast.active {
  display: block;
}

/* ==================== 考勤核算页面 ==================== */

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb-sep {
  color: var(--faint);
  margin: 0 6px;
  font-weight: 400;
}
.breadcrumb-current {
  color: var(--ink);
  font-weight: 720;
}

/* 4 个 tab 切换 */
.attendance-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.attendance-tab {
  background: none;
  border: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.attendance-tab:hover {
  color: var(--ink);
}
.attendance-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 5 步步骤条 */
.attendance-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--soft);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  overflow-x: auto;
}
.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.stepper-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 720;
  font-size: 14px;
  color: var(--muted);
  background: var(--solid);
  border: 1px solid var(--line-strong);
}
.stepper-num-done {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.stepper-num-warn {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}
.stepper-num-pending {
  background: var(--solid);
  color: var(--muted);
  border-color: var(--line-strong);
}
.stepper-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}
.stepper-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.stepper-status {
  font-size: 12px;
  color: var(--muted);
}
.stepper-status-done { color: var(--green); }
.stepper-status-warn { color: var(--gold); }
.stepper-status-pending { color: var(--muted); }
.stepper-chev {
  color: var(--faint);
  font-size: 20px;
  margin: 0 4px;
  flex-shrink: 0;
}

/* 考勤核心统计卡片 */
.attendance-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 86px;
  box-shadow: var(--shadow-soft);
}
.stat-card-alert {
  background: var(--red-soft);
  border-color: rgba(217, 77, 77, 0.25);
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.stat-card-alert .stat-label { color: var(--red); font-weight: 600; }
.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.stat-value-row strong {
  font-size: 24px;
  font-weight: 720;
  color: var(--ink);
  letter-spacing: 0;
}
.stat-card-alert .stat-value-row strong { color: var(--red); }
.stat-value-row em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}
.stat-sub {
  font-size: 12px;
  color: var(--muted);
}
.stat-card-alert .stat-sub { color: var(--red); font-weight: 600; }

/* 过滤栏（考勤专用） */
.attendance-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
}
.attendance-filter-bar .search-box {
  flex: 1 1 320px;
  min-width: 260px;
  max-width: none;
}
.attendance-filter-bar .select-pill,
.attendance-filter-bar button {
  flex: 0 0 auto;
}
.attendance-filter-bar .select-pill {
  width: auto;
  min-width: 118px;
}
.select-pill {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--solid);
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.select-pill:hover {
  border-color: var(--line-strong);
}

/* 表格（考勤专用） */
.attendance-table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.attendance-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13px;
}
.attendance-summary-table {
  min-width: 1340px;
}
.attendance-daily-table {
  min-width: 1160px;
  table-layout: fixed;
}
.attendance-daily-table th:nth-child(1),
.attendance-daily-table td:nth-child(1) {
  width: 42px;
}
.attendance-daily-table th:nth-child(2),
.attendance-daily-table td:nth-child(2) {
  width: 104px;
}
.attendance-daily-table th:nth-child(3),
.attendance-daily-table td:nth-child(3) {
  width: 128px;
}
.attendance-daily-table th:nth-child(4),
.attendance-daily-table td:nth-child(4),
.attendance-daily-table th:nth-child(5),
.attendance-daily-table td:nth-child(5) {
  width: 96px;
}
.attendance-daily-table th:nth-child(6),
.attendance-daily-table td:nth-child(6),
.attendance-daily-table th:nth-child(7),
.attendance-daily-table td:nth-child(7) {
  width: 132px;
}
.attendance-daily-table th:nth-child(8),
.attendance-daily-table td:nth-child(8),
.attendance-daily-table th:nth-child(9),
.attendance-daily-table td:nth-child(9),
.attendance-daily-table th:nth-child(10),
.attendance-daily-table td:nth-child(10),
.attendance-daily-table th:nth-child(11),
.attendance-daily-table td:nth-child(11) {
  width: 96px;
}
.attendance-daily-table th:nth-child(12),
.attendance-daily-table td:nth-child(12) {
  width: 82px;
}
.attendance-daily-table th:nth-child(13),
.attendance-daily-table td:nth-child(13) {
  width: 88px;
}
.attendance-import-table {
  min-width: 1180px;
}
.attendance-table th {
  text-align: left;
  padding: 12px 10px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
.attendance-table .th-sub {
  font-size: 11px;
  color: var(--faint);
  font-weight: 500;
}
.attendance-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.35;
}
.attendance-table tr:hover td {
  background: var(--soft);
}
.attendance-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.attendance-minute-cell {
  display: inline-grid;
  justify-items: end;
  gap: 2px;
  min-width: 72px;
}
.attendance-minute-cell strong {
  font-size: 14px;
  font-weight: 820;
}
.attendance-minute-cell small {
  display: block;
  max-width: 126px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  white-space: normal;
}
.attendance-table .number.strong {
  font-weight: 700;
  color: var(--ink);
}
.attendance-table .unit {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  margin-left: 2px;
}
.attendance-table .person-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 104px;
}
.attendance-table .person-cell strong {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.attendance-table .person-cell .badge {
  align-self: flex-start;
  min-height: 22px;
  padding: 1px 8px;
  font-family: inherit;
  font-size: 11px;
}
.attendance-table .sub-text {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.attendance-table .date-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  min-width: 100px;
}
.attendance-table .punch-cell {
  min-width: 112px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.attendance-table .file-name-cell {
  max-width: 260px;
  min-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-import-status-cell {
  min-width: 180px;
}

.attendance-import-status-cell small {
  display: block;
  margin-top: 6px;
  max-width: 360px;
  color: var(--muted);
  line-height: 1.45;
  white-space: normal;
}

.attendance-table .actions-col {
  width: 156px;
  min-width: 156px;
}
.attendance-table .table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.attendance-table .table-actions .mini-button {
  display: inline-flex;
  width: auto;
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
  line-height: 1;
  font-size: 12px;
  font-weight: 760;
}

.attendance-correction-request-row td {
  background: linear-gradient(90deg, rgba(255, 248, 232, .82), rgba(255,255,255,.96));
}
.attendance-correction-request-row:hover td {
  background: linear-gradient(90deg, rgba(255, 243, 215, .9), rgba(255,255,255,.98)) !important;
}
.attendance-correction-month {
  display: grid;
  gap: 3px;
  min-width: 86px;
}
.attendance-correction-month strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.attendance-correction-month span,
.attendance-correction-summary small {
  color: var(--muted);
  font-size: 11px;
}
.attendance-correction-summary-cell {
  min-width: 430px;
}
.attendance-correction-summary {
  display: grid;
  gap: 7px;
}
.attendance-correction-summary > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.attendance-correction-summary > div > strong {
  color: #a76008;
  font-size: 13px;
}
.attendance-correction-summary > div > span {
  color: var(--muted);
  font-size: 11px;
}
.attendance-correction-summary p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attendance-correction-request-drawer {
  max-width: 720px;
}
.attendance-correction-drawer {
  display: grid;
  gap: 18px;
}
.attendance-correction-request-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.attendance-correction-request-meta > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.attendance-correction-request-meta span,
.attendance-correction-request-note > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.attendance-correction-request-meta strong {
  color: var(--ink);
  font-size: 14px;
}
.attendance-correction-request-note {
  padding: 18px;
  border: 1px solid #efd6aa;
  border-radius: 16px;
  background: #fff9ed;
}
.attendance-correction-request-note p {
  margin: 9px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.attendance-correction-request-scope,
.attendance-correction-request-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.attendance-correction-request-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.attendance-correction-request-actions button {
  min-height: 40px;
}

@media (max-width: 720px) {
  .attendance-correction-request-meta {
    grid-template-columns: 1fr;
  }
  .attendance-correction-request-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .attendance-correction-request-actions button {
    width: 100%;
  }
}

/* 状态 pill */
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.pill-green {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(16, 167, 131, 0.18);
}
.pill-orange {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: rgba(216, 138, 34, 0.2);
}
.pill-blue {
  background: var(--blue-soft);
  color: var(--accent);
  border-color: rgba(36, 120, 242, 0.18);
}
.pill-red {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(217, 77, 77, 0.18);
}
.pill-muted {
  background: var(--gray-soft);
  color: var(--muted);
  border-color: var(--line);
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--soft);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.attendance-pagination {
  border-top: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
}
.page-info {
  flex-shrink: 0;
}
.page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--solid);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  padding: 0 8px;
}
.page-btn:hover:not(:disabled) {
  background: var(--soft);
  border-color: var(--line-strong);
}
.page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-ellipsis {
  min-width: 24px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  user-select: none;
}
.page-jump {
  display: flex;
  align-items: center;
  gap: 4px;
}
.jump-input {
  width: 50px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  padding: 0 4px;
}

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--soft);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--accent);
  background: var(--blue-soft);
  color: var(--accent);
}
.upload-zone strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.upload-zone p {
  margin: 0;
  font-size: 12px;
}
.upload-zone svg {
  width: 36px;
  height: 36px;
}

.upload-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--soft);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.upload-meta label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.attendance-import-section,
.attendance-import-history,
.attendance-summary-view,
.attendance-daily-view,
.attendance-anomalies-view {
  margin-bottom: 18px;
}

.attendance-import-view .section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.attendance-import-view .section-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.attendance-import-view .muted {
  font-size: 12px;
  color: var(--muted);
}

.mini-button.ghost {
  background: transparent;
  color: var(--muted);
}
.mini-button.ghost:hover {
  background: var(--soft);
  color: var(--ink);
}

/* ==================== 班次规则 tab ==================== */

.attendance-shifts-view {
  margin-bottom: 18px;
}
.shifts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.shifts-toolbar .muted {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.shift-card-grid {
  display: grid;
  gap: 16px;
}
.shift-group-card {
  --shift-tone: #2478f2;
  overflow: hidden;
  border: 1px solid #d7e5f6;
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 42px rgba(32, 82, 138, .08);
}
.shift-group-card header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #dbe8f6;
  background:
    radial-gradient(circle at right top, color-mix(in srgb, var(--shift-tone) 16%, transparent), transparent 34%),
    linear-gradient(180deg, #fff, #f7fbff);
}
.shift-group-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--shift-tone), #0fb8c8);
}
.shift-group-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}
.shift-group-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.shift-tone-blue { --shift-tone: #2478f2; }
.shift-tone-teal { --shift-tone: #14b8a6; }
.shift-tone-amber { --shift-tone: #e79520; }
.shift-tone-violet { --shift-tone: #7267f0; }
.shift-tone-slate { --shift-tone: #64748b; }
.shift-rule-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.shift-rule-tile {
  border: 1px solid #e0eaf5;
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}
.shift-rule-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.shift-rule-top strong,
.shift-rule-top span {
  display: block;
}
.shift-rule-top strong {
  font-size: 15px;
  font-weight: 880;
}
.shift-rule-top span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.shift-rule-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.shift-rule-metrics div {
  border: 1px solid #e4edf7;
  border-radius: 14px;
  background: #f8fbff;
  padding: 10px 12px;
}
.shift-rule-metrics span,
.shift-rule-metrics b {
  display: block;
}
.shift-rule-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.shift-rule-metrics b {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
}
.shift-breaks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.shift-breaks strong {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.shift-breaks span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2267c7;
  border: 1px solid #cfe3fb;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}
.shifts-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}
.shifts-table th {
  text-align: left;
  padding: 12px 10px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.shifts-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.shifts-table tr:hover td {
  background: var(--soft);
}
.shifts-table .actions-col,
.shifts-actions-col {
  width: 128px;
  min-width: 128px;
}
.shift-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.shift-actions .mini-button {
  width: auto;
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
  line-height: 1;
}

/* 班次编辑抽屉 */
.form-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.form-section label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 500;
}
.form-section input,
.form-section select {
  margin-top: 4px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}
.attendance-shift-choice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}
.form-section label.attendance-shift-choice,
.attendance-shift-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(153, 184, 226, 0.6);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.88));
  color: var(--text);
  box-shadow: 0 8px 22px rgba(19, 74, 132, 0.06);
}
.attendance-shift-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}
.attendance-shift-choice-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.attendance-shift-choice-main strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}
.attendance-shift-choice-main em,
.attendance-shift-choice-meta small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}
.attendance-shift-choice-meta {
  display: grid;
  gap: 3px;
  min-width: 116px;
  text-align: right;
}
.attendance-shift-choice-meta b {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
@media (max-width: 640px) {
  .attendance-shift-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .attendance-shift-choice-meta {
    grid-column: 2;
    min-width: 0;
    text-align: left;
  }
}
.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 14px !important;
  color: var(--ink) !important;
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.meal-break-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.meal-break-row input[type="time"] {
  width: 100px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.meal-break-row input[type="number"] {
  width: 64px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}
.meal-break-row .mini-button {
  padding: 0 8px;
  height: 28px;
  font-size: 14px;
}

/* Attendance shift rule editor */
.shift-rule-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  max-width: none;
  overflow-x: hidden;
}

.shift-editor-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 22px;
  border: 1px solid #dbeafe;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(232, 243, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 40px rgba(15, 23, 42, 0.06);
}

.shift-editor-hero > div {
  min-width: 0;
}

.shift-editor-hero h3 {
  margin: 4px 0 8px;
  font-size: 26px;
  letter-spacing: 0;
}

.shift-editor-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.shift-active-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 184px;
  padding: 16px 22px;
  border: 1px solid #d6e5f8;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.shift-active-switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

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

.shift-editor-card {
  min-width: 0;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #dce9f8;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.shift-editor-card-wide {
  grid-column: 1 / -1;
}

.shift-editor-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.shift-editor-card-head > span {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: #e8f2ff;
  color: #0875e1;
  font-weight: 950;
}

.shift-editor-card-head > div {
  min-width: 0;
}

.shift-editor-card-head h4 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.shift-editor-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shift-editor-card-head .shift-add-break {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

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

.shift-editor-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shift-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

.shift-field input,
.shift-field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #dce6f2;
  border-radius: 17px;
  outline: none;
  background: linear-gradient(180deg, #fff, #f9fbff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.shift-field input[type="time"] {
  padding-right: 34px;
  font-size: 18px;
  letter-spacing: 0;
}

.shift-field input:focus,
.shift-field select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.shift-formula-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f3f8ff;
  color: #53657d;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.shift-meal-break-list {
  display: grid;
  gap: 12px;
}

.shift-meal-break-row.meal-break-row {
  display: grid;
  grid-template-columns: minmax(126px, 1fr) 18px minmax(126px, 1fr) minmax(78px, 0.6fr) 28px 40px;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid #dce9f8;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff, #f8fbff);
}

.shift-meal-break-row.meal-break-row input[type="time"],
.shift-meal-break-row.meal-break-row input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #dce6f2;
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.shift-meal-wave,
.shift-meal-unit {
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.shift-meal-unit {
  text-align: left;
}

.shift-remove-break {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #fecdd3;
  border-radius: 14px;
  background: #fff1f2;
  color: #e11d48;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.shift-remove-break .app-icon {
  width: 18px;
  height: 18px;
}

.shift-formula-preview {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  background: #f7fbff;
}

.shift-formula-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.shift-formula-preview-head span {
  color: var(--muted);
  font-size: 12px;
}

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

.shift-formula-preview-row {
  min-width: 0;
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: #fff;
}

.shift-formula-preview-row span,
.shift-formula-preview-row strong,
.shift-formula-preview-row small {
  display: block;
}

.shift-formula-preview-row span,
.shift-formula-preview-row small {
  color: var(--muted);
  font-size: 12px;
}

.shift-formula-preview-row strong {
  margin-top: 5px;
  line-height: 1.45;
}

.shift-formula-preview-row small {
  margin-top: 6px;
  line-height: 1.45;
}

.shift-recalc-warning {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid #d97706;
  background: #fff8eb;
  color: #8a4b08 !important;
  font-size: 13px;
}

.shift-editor-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.shift-editor-status[data-tone="error"] {
  color: #dc2626;
}

.shift-editor-status[data-tone="success"] {
  color: #059669;
}

.shift-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 0 0;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0), #f8fbff 30%);
}

@media (max-width: 1180px) {
  .drawer-overlay.shift-rule-overlay {
    padding: 12px 14px;
  }

  .drawer-panel.shift-rule-shell {
    width: min(980px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    height: calc(100vh - 24px);
    border-radius: 28px;
  }

  .shift-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .drawer-overlay.shift-rule-overlay {
    padding: 6px;
  }

  .drawer-panel.shift-rule-shell {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    border-radius: 24px;
  }

  .drawer-panel.shift-rule-shell .drawer-header {
    padding: 16px 18px 10px;
  }

  .drawer-panel.shift-rule-shell #drawerBody {
    padding: 0 14px 96px;
  }

  .shift-editor-hero {
    grid-template-columns: 1fr;
    align-items: flex-start;
    padding: 18px;
    border-radius: 24px;
  }

  .shift-active-switch {
    width: 100%;
    min-width: 0;
  }

  .shift-editor-grid,
  .shift-editor-fields,
  .shift-editor-three {
    grid-template-columns: 1fr;
  }

  #shiftFormulaPreview,
  .employee-participation-panel {
    grid-template-columns: 1fr;
  }

  .shift-meal-break-row.meal-break-row {
    grid-template-columns: 1fr auto 1fr;
  }

  .shift-meal-break-row.meal-break-row input[type="number"] {
    grid-column: 1 / 2;
  }

  .shift-meal-unit {
    grid-column: 2 / 3;
    text-align: center;
  }

  .shift-remove-break {
    grid-column: 3 / 4;
    justify-self: end;
  }
}

/* ============================================================
   2026-07-14 Information density and responsive usability pass
   ============================================================ */

.mobile-nav-toggle,
.employee-mobile-list,
.attendance-summary-mobile-list {
  display: none;
}

.compact-empty-state {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--gray-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.compact-empty-state .app-icon {
  width: 16px;
  height: 16px;
}

/* Employee filters and phone summaries */
.employee-filter-row {
  align-items: center;
}

.employee-more-filters {
  position: relative;
  min-width: 126px;
}

.employee-more-filters > summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.employee-more-filters > summary::-webkit-details-marker,
.mobile-record-details > summary::-webkit-details-marker,
.row-action-menu > summary::-webkit-details-marker,
.payroll-breakdown > summary::-webkit-details-marker,
.shift-group-summary::-webkit-details-marker {
  display: none;
}

.employee-more-filters > summary .app-icon {
  width: 15px;
  height: 15px;
}

.employee-more-filter-grid {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 20;
  width: min(520px, 70vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--solid);
  box-shadow: 0 14px 34px rgba(31, 58, 92, 0.14);
}

.employee-more-filter-grid select {
  width: 100%;
  min-width: 0;
}

.employee-result-count,
.log-result-count {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  white-space: nowrap;
}

.employee-mobile-card,
.attendance-summary-mobile-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.employee-mobile-card > header,
.attendance-summary-mobile-card > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.employee-mobile-person,
.attendance-summary-mobile-card > header > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.employee-mobile-person strong,
.attendance-summary-mobile-card > header strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.employee-mobile-person span,
.attendance-summary-mobile-card > header span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-mobile-status,
.attendance-mobile-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.employee-mobile-keyline,
.attendance-mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.employee-mobile-keyline > span,
.attendance-mobile-metrics > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  background: var(--solid);
}

.employee-mobile-keyline small,
.attendance-mobile-metrics small,
.mobile-detail-grid small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.employee-mobile-keyline strong,
.attendance-mobile-metrics strong,
.mobile-detail-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.mobile-record-details {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.mobile-record-details > summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.mobile-record-details[open] .details-chevron {
  transform: rotate(180deg);
}

.details-chevron {
  transition: transform 160ms ease;
}

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

.mobile-detail-grid > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.employee-mobile-actions,
.attendance-mobile-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.employee-mobile-actions .mini-button,
.attendance-mobile-actions .mini-button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

/* Payroll calculation: core table plus expandable groups */
.payroll-calc-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.payroll-results-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

.payroll-results-table th,
.payroll-results-table td {
  min-width: 0;
  padding: 9px 6px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.payroll-results-table th:nth-child(1) { width: 8%; }
.payroll-results-table th:nth-child(2) { width: 10%; }
.payroll-results-table th:nth-child(3) { width: 6%; }
.payroll-results-table th:nth-child(4) { width: 7%; }
.payroll-results-table th:nth-child(5) { width: 8%; }
.payroll-results-table th:nth-child(6) { width: 9%; }
.payroll-results-table th:nth-child(7) { width: 8%; }
.payroll-results-table th:nth-child(8) { width: 8%; }
.payroll-results-table th:nth-child(9) { width: 8%; }
.payroll-results-table th:nth-child(10) { width: 6%; }
.payroll-results-table th:nth-child(11) { width: 7%; }
.payroll-results-table th:nth-child(12) { width: 15%; }

.payroll-results-table .payroll-calc-actions-col {
  width: 15%;
  min-width: 0;
  max-width: none;
}

.payroll-result-row > td:first-child,
.payroll-results-table > thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--solid);
}

.payroll-result-row > td:last-child,
.payroll-results-table > thead th:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--solid);
}

.payroll-results-table > thead th:first-child,
.payroll-results-table > thead th:last-child {
  z-index: 4;
  background: var(--gray-soft);
}

.payroll-org-cell,
.payroll-core-stack {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.payroll-org-cell strong,
.payroll-org-cell span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-org-cell span,
.payroll-core-stack small {
  color: var(--muted);
  font-size: 9px;
}

.payroll-core-stack > span {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.positive-number {
  color: var(--green);
}

.deduction-number {
  color: var(--red);
}

.payroll-detail-row > td {
  position: static !important;
  padding: 0 8px 7px !important;
  border-top: 0;
  background: var(--solid) !important;
}

.payroll-breakdown {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--gray-soft);
}

.payroll-breakdown > summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.payroll-breakdown > summary > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.payroll-breakdown > summary .app-icon {
  width: 13px;
  height: 13px;
}

.payroll-breakdown > summary small {
  font-size: 10px;
}

.payroll-breakdown-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1.3fr 0.9fr;
  gap: 8px;
  padding: 0 8px 8px;
}

.payroll-breakdown-group {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--solid);
}

.payroll-breakdown-group h4 {
  margin: 0 0 7px;
  font-size: 11px;
}

.payroll-breakdown-group > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 9px;
}

.payroll-breakdown-group span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.payroll-breakdown-group small {
  color: var(--muted);
  font-size: 9px;
}

.payroll-breakdown-group strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clearer forms: calculated and manually entered values */
.form-group-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.form-group-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.form-group-card > header > div {
  display: grid;
  gap: 3px;
}

.form-group-card > header strong {
  color: var(--ink);
  font-size: 14px;
}

.form-group-card > header span {
  color: var(--muted);
  font-size: 11px;
}

.form-group-card > header em {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.calculated-input-group {
  border-color: rgba(38, 123, 236, 0.24);
  background: rgba(38, 123, 236, 0.035);
}

.calculated-input-group > header em {
  background: var(--blue-soft);
  color: var(--accent);
}

.manual-input-group {
  border-color: rgba(218, 145, 36, 0.26);
  background: rgba(218, 145, 36, 0.035);
}

.manual-input-group > header em {
  background: var(--gold-soft);
  color: #9a5c06;
}

.form-group-card .form-grid,
.form-group-card.form-section {
  margin: 0;
}

/* Payslip actions stay readable without a wall of icons */
.payslip-actions {
  position: relative;
  flex-wrap: nowrap !important;
}

.row-action-menu {
  position: relative;
}

.row-action-menu > summary {
  min-width: 48px;
  min-height: 36px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.row-action-menu > summary .app-icon {
  width: 14px;
  height: 14px;
}

.row-action-menu > summary span {
  font-size: 9px;
  font-weight: 700;
}

.row-action-menu-popover {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 30;
  width: 152px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--solid);
  box-shadow: 0 14px 32px rgba(31, 58, 92, 0.16);
}

.row-action-menu-popover .payslip-action {
  width: 100%;
  min-height: 34px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 9px;
}

.payslip-table td:last-child,
.payslip-table .payslip-actions {
  overflow: visible;
}

/* Audit filters and readable values */
.logs-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(128px, 170px)) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--gray-soft);
}

.logs-toolbar .apple-search,
.logs-toolbar select {
  width: 100%;
  min-width: 0;
}

.log-message-details > summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 620;
}

.log-message-details p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: normal;
}

/* Attendance hierarchy, pagination and compact secondary pages */
.attendance-context-strip {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 8px 12px;
  border-block: 1px solid var(--line);
  color: var(--muted);
}

.attendance-context-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.attendance-context-strip .app-icon {
  width: 14px;
  height: 14px;
}

.attendance-context-strip strong {
  color: var(--ink);
}

.attendance-context-strip .is-locked,
.attendance-context-strip .is-locked strong {
  color: var(--green);
}

.attendance-pagination {
  width: 100%;
  display: grid !important;
  grid-template-columns: minmax(120px, 1fr) auto auto auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
  padding: 9px 10px;
}

.attendance-pagination .page-info {
  justify-self: start;
}

.attendance-pagination > select {
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px;
  flex: 0 0 108px !important;
}

.attendance-pagination .page-nav,
.attendance-pagination .page-jump {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
}

.leave-empty-state {
  margin-bottom: 2px;
}

.leave-rule-section {
  margin-top: 0;
}

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

.holiday-table {
  width: 100%;
}

.holiday-month-row td {
  padding: 7px 10px !important;
  border-block: 1px solid var(--line);
  background: var(--gray-soft) !important;
}

.holiday-month-row td::before {
  display: none !important;
}

.holiday-month-row strong {
  color: var(--ink);
  font-size: 12px;
}

.holiday-month-row span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 10px;
}

/* Shift rules: collapsed groups, compact rows and persistent footer */
.shift-card-grid {
  gap: 8px;
}

.shift-group-card {
  border-radius: 8px;
  box-shadow: none;
}

.shift-group-summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel);
  cursor: pointer;
  list-style: none;
}

.shift-group-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 14px;
  background: var(--shift-tone);
}

.shift-group-copy {
  min-width: 0;
}

.shift-group-card h3 {
  font-size: 15px;
}

.shift-group-card p {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
}

.shift-group-expand {
  color: var(--accent);
  font-size: 0;
  font-weight: 700;
  white-space: nowrap;
}

.shift-group-expand::after {
  content: "展开规则";
  font-size: 11px;
}

.shift-group-card[open] .shift-group-expand::after {
  content: "收起规则";
}

.shift-rule-list {
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.shift-rule-tile {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(420px, 2fr) minmax(130px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--solid);
}

.shift-rule-tile:last-child {
  border-bottom: 0;
}

.shift-rule-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
}

.shift-rule-metrics div {
  min-width: 0;
  padding: 6px 7px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.shift-rule-metrics span {
  font-size: 9px;
}

.shift-rule-metrics b {
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-breaks {
  margin: 0;
  gap: 4px;
}

.shift-breaks strong,
.shift-breaks span {
  font-size: 10px;
}

.shift-actions {
  margin: 0;
  flex-wrap: nowrap;
}

body[data-hr-view] .drawer-panel.shift-rule-shell {
  overflow: hidden;
  border-radius: 10px;
}

body[data-hr-view] .drawer-panel.shift-rule-shell #drawerBody {
  padding: 0 18px 12px !important;
}

body[data-hr-view] .drawer-panel.shift-rule-shell .drawer-actions {
  position: relative;
  bottom: auto;
  z-index: 12;
  display: flex !important;
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--solid);
  box-shadow: 0 -8px 20px rgba(31, 58, 92, 0.06);
}

.shift-editor-actions {
  display: none;
}

.shift-editor-hero {
  min-height: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--gray-soft);
}

.shift-editor-hero h3 {
  margin-top: 3px;
  font-size: 20px;
}

.shift-editor-hero p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
}

.shift-active-switch {
  min-height: 42px;
  padding: 7px 12px;
  border-radius: 8px;
}

.shift-editor-grid {
  gap: 9px;
  margin-top: 9px;
}

.shift-editor-card {
  padding: 11px;
  border-radius: 8px;
  box-shadow: none;
}

.shift-editor-card-head {
  gap: 8px;
  margin-bottom: 9px;
}

.shift-editor-card-head > span {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
}

.shift-editor-card-head h4 {
  font-size: 14px;
}

.shift-editor-card-head p,
.shift-formula-card {
  font-size: 10px;
}

.shift-editor-fields {
  gap: 8px;
}

.shift-editor-fields input,
.shift-editor-fields select,
.shift-meal-break-row input {
  min-height: 38px;
}

.shift-formula-preview {
  margin-top: 9px;
  padding: 10px;
  border-radius: 8px;
}

.shift-formula-preview-row {
  padding: 8px;
}

/* Flatten repeated containers and keep the sidebar status legible. */
body[data-hr-view] .apple-page-head,
body[data-hr-view] .panel-header,
body[data-hr-view] .apple-data-card,
body[data-hr-view] .apple-metric,
body[data-hr-view] .attendance-stepper,
body[data-hr-view] .attendance-stats .stat-card {
  border-radius: 8px;
  box-shadow: none;
}

.nav-health-card p {
  font-size: 10px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
}

@media (min-width: 761px) and (max-width: 1180px) {
  .payroll-results-table th:nth-child(3),
  .payroll-results-table td:nth-child(3),
  .payroll-results-table th:nth-child(5),
  .payroll-results-table td:nth-child(5),
  .payroll-results-table th:nth-child(10),
  .payroll-results-table td:nth-child(10) {
    display: none;
  }

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

  .shift-rule-tile {
    grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) auto;
  }

  .shift-breaks {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .topbar.apple-commandbar .top-search-shell {
    display: none !important;
  }

  .topbar.apple-commandbar {
    gap: 6px;
    padding: 7px !important;
    overflow: visible;
  }

  .topbar.apple-commandbar .brand-block {
    min-height: 34px;
  }

  .topbar.apple-commandbar .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .topbar.apple-commandbar .brand-block .eyebrow {
    display: none;
  }

  .topbar.apple-commandbar .brand-block h1 {
    font-size: 15px;
  }

  .topbar.apple-commandbar .top-controls {
    grid-template-columns: minmax(112px, 1fr) 38px 38px minmax(104px, 0.8fr) !important;
    gap: 5px;
  }

  .topbar.apple-commandbar .month-control,
  .topbar.apple-commandbar .top-icon-button,
  .topbar.apple-commandbar .role-control,
  .topbar.apple-commandbar .role-chip {
    height: 38px;
    min-height: 38px;
  }

  .topbar.apple-commandbar .top-icon-button {
    width: 38px;
  }

  .topbar.apple-commandbar .role-control {
    grid-column: auto;
  }

  .topbar.apple-commandbar .role-chip {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 3px 6px;
  }

  .topbar.apple-commandbar .role-avatar {
    width: 26px;
    height: 26px;
  }

  .topbar.apple-commandbar .role-copy small,
  .topbar.apple-commandbar .role-chip > .app-icon {
    display: none;
  }

  .topbar.apple-commandbar .role-copy strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-panel {
    overflow: visible !important;
  }

  .mobile-nav-toggle {
    width: 100%;
    min-height: 40px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: var(--gray-soft);
    color: var(--ink);
    text-align: left;
  }

  .mobile-nav-toggle .app-icon {
    width: 17px;
    height: 17px;
  }

  .mobile-nav-toggle span {
    font-size: 12px;
    font-weight: 720;
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-chevron {
    transform: rotate(180deg);
  }

  .side-panel .module-nav:not(.mobile-open) {
    display: none !important;
  }

  .side-panel .module-nav.mobile-open {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
    overflow: visible !important;
  }

  .side-panel .module-nav.mobile-open button,
  .side-panel .module-nav.mobile-open .module-link {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px;
    justify-content: flex-start;
    white-space: normal;
  }

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

  .logs-toolbar .apple-search,
  .logs-toolbar .log-result-count {
    grid-column: 1 / -1;
  }

  .shift-rule-tile {
    grid-template-columns: 1fr;
  }

  .shift-rule-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shift-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body[data-hr-view="logs"] .logs-table,
  body[data-hr-view="logs"] .logs-table tbody {
    width: 100% !important;
    display: block !important;
  }

  body[data-hr-view="logs"] .logs-table thead {
    display: none !important;
  }

  body[data-hr-view="logs"] .logs-table tbody {
    display: grid !important;
    gap: 8px;
  }

  body[data-hr-view="logs"] .logs-table tbody tr {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 7px 10px !important;
    padding: 11px 12px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: var(--panel) !important;
    box-shadow: none !important;
  }

  body[data-hr-view="logs"] .logs-table tbody td {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body[data-hr-view="logs"] .logs-table tbody td::before {
    display: none !important;
  }

  body[data-hr-view="logs"] .logs-table tbody td:nth-child(1) {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 10px;
  }

  body[data-hr-view="logs"] .logs-table tbody td:nth-child(2) {
    align-self: center;
    font-size: 12px;
    font-weight: 700;
  }

  body[data-hr-view="logs"] .logs-table tbody td:nth-child(3) {
    justify-self: end;
  }

  body[data-hr-view="logs"] .logs-table tbody td:nth-child(4) {
    grid-column: 1 / -1;
    padding-top: 6px !important;
    border-top: 1px solid var(--line) !important;
    font-size: 11px;
    line-height: 1.5;
  }

  body[data-hr-view="logs"] .logs-table tbody td:nth-child(5) {
    align-self: center;
    color: var(--muted);
    font-size: 10px;
  }

  body[data-hr-view="logs"] .logs-table tbody td:nth-child(6) {
    justify-self: end;
  }

  body[data-hr-view="logs"] .logs-table tbody tr:has(td[colspan]) {
    display: block !important;
  }

  body[data-hr-view="attendance"] .attendance-apple-head {
    gap: 8px;
    padding: 11px !important;
  }

  body[data-hr-view="attendance"] .attendance-apple-head .apple-page-title > p:last-child,
  body[data-hr-view="attendance"] .breadcrumb-sep,
  body[data-hr-view="attendance"] .breadcrumb-current {
    display: none;
  }

  body[data-hr-view="attendance"] .attendance-apple-head h2 {
    font-size: 22px !important;
  }

  .attendance-tabs {
    min-height: 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    overflow: visible;
  }

  .attendance-tab {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 0 4px;
    font-size: 10px;
    white-space: normal;
  }

  .attendance-stepper {
    min-height: 66px;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 7px 5px;
    overflow: visible;
  }

  .attendance-stepper .stepper-chev {
    display: none;
  }

  .attendance-stepper .stepper-item {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    text-align: center;
  }

  .attendance-stepper .stepper-num {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .attendance-stepper .stepper-meta strong {
    display: block;
    font-size: 8px;
    line-height: 1.2;
    white-space: normal;
  }

  .attendance-stepper .stepper-status {
    display: none;
  }

  body[data-hr-view="attendance"] .attendance-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px;
  }

  body[data-hr-view="attendance"] .attendance-stats .stat-card {
    min-height: 72px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 3px;
    padding: 8px;
  }

  body[data-hr-view="attendance"] .attendance-stats .stat-value-row strong {
    font-size: 18px;
  }

  body[data-hr-view="attendance"] .attendance-stats .stat-sub {
    justify-self: start;
    font-size: 8px;
    text-align: left;
  }

  .attendance-context-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 8px;
  }

  .employee-table-wrap,
  .archive-table-wrap,
  .attendance-summary-desktop {
    display: none !important;
  }

  .employee-mobile-list,
  .attendance-summary-mobile-list {
    display: grid;
    gap: 8px;
  }

  .employee-more-filters {
    position: static;
  }

  .employee-more-filters > summary {
    width: 100%;
  }

  .employee-more-filter-grid {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 6px;
    box-shadow: none;
  }

  body[data-hr-view="employees"] .employee-filter-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="employees"] .employee-more-filters,
  body[data-hr-view="employees"] .employee-result-count {
    grid-column: 1 / -1;
  }

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

  .attendance-pagination {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
  }

  .attendance-pagination .page-nav,
  .attendance-pagination .page-jump {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .payroll-result-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 12px !important;
  }

  .payroll-result-row > td {
    position: static !important;
  }

  .payroll-result-row > td:nth-child(3),
  .payroll-result-row > td:nth-child(5),
  .payroll-result-row > td:nth-child(7),
  .payroll-result-row > td:nth-child(8),
  .payroll-result-row > td:nth-child(10) {
    display: none !important;
  }

  .payroll-result-row > td:first-child,
  .payroll-result-row > td:nth-child(2),
  .payroll-result-row > td:last-child {
    grid-column: 1 / -1;
  }

  .payroll-detail-row {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .payroll-detail-row > td {
    display: block !important;
    padding: 0 !important;
  }

  .payroll-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .payroll-breakdown > summary small {
    display: none;
  }

  .payroll-result-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .payroll-result-actions .mini-button.text-mini {
    min-height: 38px;
    padding: 0 4px;
    font-size: 10px;
  }

  .payslip-actions {
    flex-wrap: wrap !important;
  }

  .row-action-menu-popover {
    position: static;
    width: 100%;
    margin-top: 5px;
    box-shadow: none;
  }

  .form-group-card {
    padding: 11px;
  }

  .logs-toolbar {
    grid-template-columns: 1fr;
  }

  .logs-toolbar .apple-search,
  .logs-toolbar .log-result-count {
    grid-column: auto;
  }

  .holiday-month-row {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .holiday-month-row td {
    display: block !important;
    padding: 8px 10px !important;
  }

  body[data-hr-view] .drawer-panel.shift-rule-shell #drawerBody {
    padding: 0 10px 8px !important;
  }

  .shift-editor-hero {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px;
  }

  .shift-editor-hero p {
    display: none;
  }

  .shift-active-switch {
    width: auto;
  }

  .shift-editor-grid {
    grid-template-columns: 1fr;
  }

  .shift-meal-break-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 64px auto 34px;
  }
}

@media (max-width: 480px) {
  .topbar.apple-commandbar .top-controls {
    grid-template-columns: minmax(100px, 1fr) 36px 36px minmax(86px, 0.7fr) !important;
  }

  .topbar.apple-commandbar .month-control,
  .topbar.apple-commandbar .top-icon-button,
  .topbar.apple-commandbar .role-control,
  .topbar.apple-commandbar .role-chip {
    height: 36px;
    min-height: 36px;
  }

  .topbar.apple-commandbar .top-icon-button {
    width: 36px;
  }

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

  .shift-editor-hero h3 {
    font-size: 16px;
  }

  .shift-active-switch span {
    font-size: 10px;
  }
}

/* ==================== 批量操作工具栏 ==================== */
.batch-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--accent-quiet);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
}
.batch-toolbar .muted {
  color: var(--muted);
}
.batch-toolbar .muted strong {
  color: var(--accent-dark);
  font-weight: 700;
  margin: 0 4px;
}

/* 批量标记选项（抽屉内） */
.batch-mark-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.batch-mark-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: all 0.15s;
}
.batch-mark-btn:hover {
  background: var(--accent-quiet);
  border-color: var(--accent);
}
.batch-mark-btn strong {
  color: var(--ink);
  font-weight: 600;
}
.batch-mark-btn .muted {
  color: var(--muted);
  font-size: 12px;
}

/* 表格里 checkbox 列紧凑 */
.attendance-table th:first-child,
.attendance-table td:first-child,
.shifts-table th:first-child,
.shifts-table td:first-child {
  padding-left: 16px;
  padding-right: 8px;
}
.attendance-table input[type="checkbox"],
.shifts-table input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* ==================== 考勤页头增强 ==================== */
.attendance-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.month-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  background: var(--accent-quiet);
  color: var(--accent-dark);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 4px;
}
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 10px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(16, 167, 131, 0.2);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}
.lock-badge svg {
  width: 12px;
  height: 12px;
}

/* ==================== 法定假日 ==================== */
.attendance-holidays-view {
  margin-bottom: 18px;
}
.holiday-month-block {
  margin-bottom: 24px;
}
.holiday-month-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px 0;
  padding-left: 8px;
  border-left: 3px solid var(--accent);
}

/* ==================== 对账进度条 ==================== */
.reconcile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
}
.reconcile-bar strong {
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}
.reconcile-bar .muted {
  color: var(--muted);
}

/* ==================== 报表图表 ==================== */
.report-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.report-tab {
  background: none;
  border: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.report-tab:hover { color: var(--ink); }
.report-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.report-pane { color: var(--ink); }
.report-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 40px;
  color: var(--muted);
}

.chart-svg {
  width: 100%;
  height: auto;
  max-height: 320px;
  color: var(--ink);
}
.chart-svg text { fill: currentColor; }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.chart-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pie-svg {
  max-height: 220px;
  width: 280px;
  flex-shrink: 0;
}
.pie-legend {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend-item .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 6px;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.top-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--soft);
  border-radius: 6px;
  font-size: 13px;
}
.top-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.top-list-item:nth-child(1) .top-rank { background: #d88a22; }
.top-list-item:nth-child(2) .top-rank { background: #10a783; }
.top-list-item:nth-child(3) .top-rank { background: #2478f2; }
.top-name { flex: 1; }
.top-value { font-weight: 600; color: var(--ink); }

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

  .top-controls {
    align-items: stretch;
  }

  .table-toolbar {
    grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(130px, 1fr));
  }

  .table-toolbar.simple {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  .backup-status-panel {
    grid-template-columns: 1fr;
  }

  .attendance-stats {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 920px) {
  .app-shell {
    width: min(100% - 20px, 1540px);
    padding-top: 10px;
  }

  .kpi-grid,
  .quick-grid,
  .batch-grid,
  .settings-grid,
  .card-list,
  .report-grid,
  .report-visual-grid,
  .report-visual-grid.compact,
  .report-insight-grid,
  .split-grid,
  .backup-status-panel,
  .workflow-strip,
  .department-overview-grid,
  .dashboard-grid,
  .todo-grid,
  .exception-summary,
  .mapping-grid,
  .table-toolbar,
  .form-grid,
  .form-grid.six {
    grid-template-columns: 1fr;
  }

  .topbar,
  .report-hero,
  .side-panel,
  .panel-header {
    padding: 12px;
  }

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

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

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

  .record-card {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header,
  .drawer-actions,
  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

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

	  .side-panel > section {
	    display: none;
	  }

  .drawer-panel {
    padding: 16px;
  }

  .drawer-actions {
    bottom: -16px;
    margin: 18px -16px -16px;
    padding: 12px 16px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 14px, 1540px);
  }

  .brand-block {
    align-items: flex-start;
  }

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

  h1 {
    font-size: 23px;
  }

  .metric-card {
    min-height: 92px;
  }

  .top-controls {
    flex-direction: column;
  }

  .top-controls .month-control,
  .top-controls .role-control {
    width: 100%;
  }

  .quick-app-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero,
  .workflow-strip,
  .dashboard-grid,
  .dashboard-side-stack,
  .quick-panel,
  .department-overview-panel,
  .exception-list,
  .exception-summary,
  .batch-grid,
  .settings-grid,
  .backup-status-panel,
  .report-grid,
  .split-grid,
  .mapping-grid,
  .table-toolbar {
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel-actions {
    justify-content: stretch;
  }

  .panel-actions > * {
    flex: 1 1 100%;
  }

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

  .shift-rule-metrics,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .side-panel,
  .table-toolbar,
  .drawer-overlay,
  .confirm-overlay,
  .toast {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .topbar,
  .content-panel {
    border: 0;
    box-shadow: none;
  }
}

/* Apple-style redesign layer, wired to the existing dynamic app. */
:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.82);
  --solid: #ffffff;
  --soft: #f8f9fb;
  --soft-2: #eef2f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #9a9aa1;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.15);
  --accent: #0071e3;
  --accent-dark: #005bbb;
  --accent-quiet: #e8f2ff;
  --cyan: #0e9fa8;
  --cyan-soft: #e9fbfd;
  --blue: #0071e3;
  --blue-soft: #e8f2ff;
  --green: #1d9f70;
  --green-soft: #eaf8f2;
  --gold: #d97706;
  --gold-soft: #fff7e8;
  --red: #d92d3a;
  --red-soft: #fff0f1;
  --purple: #7857d8;
  --purple-soft: #f3efff;
  --gray-soft: #f2f4f7;
  --shadow: 0 18px 50px rgba(23, 34, 56, 0.08), 0 2px 10px rgba(23, 34, 56, 0.04);
  --shadow-soft: 0 8px 24px rgba(23, 34, 56, 0.07);
  --radius: 22px;
}

body {
  min-width: 1120px;
  background:
    radial-gradient(circle at 78% -14%, rgba(0, 113, 227, 0.12), transparent 28%),
    radial-gradient(circle at 18% 0%, rgba(99, 144, 255, 0.08), transparent 24%),
    var(--bg);
  color: var(--ink);
  font:
    14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.36);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 0 18px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  min-height: 74px;
  margin: 0 -18px;
  padding: 0 24px;
  border-width: 0 0 1px;
  border-color: var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #006ee6, #3291ff);
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.25);
  letter-spacing: -0.4px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.brand-block h1 {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.top-controls {
  gap: 8px;
}

.month-control,
.role-control {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  padding: 6px 11px;
}

.month-control label,
.role-control label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.month-control input {
  min-width: 142px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 740;
}

.role-chip {
  height: auto;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 740;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 18px;
}

.metric-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 126px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px 19px;
  text-align: left;
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}

.metric-card[data-kpi-view],
.metric-card[data-action] {
  cursor: pointer;
}

.metric-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  content: "";
}

.metric-card.strong::before {
  background: var(--green);
}

.metric-card.alert::before {
  background: var(--red);
}

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

.metric-card strong {
  display: block;
  margin: 12px 0 5px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -1px;
}

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

.side-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

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

.module-nav button,
.module-link {
  width: 100%;
  min-height: 43px;
  justify-content: flex-start;
  gap: 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 0 11px;
  font-weight: 680;
  text-align: left;
}

.module-nav button:hover,
.module-link:hover {
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.module-nav button.active {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.13), rgba(41, 151, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.14);
  color: var(--accent);
}

.module-nav svg {
  width: 19px;
  height: 19px;
}

.content-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}

#mainView {
  min-height: calc(100vh - 164px);
  padding: 0 0 24px;
}

.panel-header {
  align-items: center;
  margin: 0;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.panel-header h2 {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.8px;
}

.panel-actions,
.panel-header-actions {
  gap: 9px;
}

.primary,
.ghost-button,
.danger-button,
.mini-button,
.payslip-action,
.status-toggle,
.text-button,
.quick-app {
  border-radius: 12px;
  font-weight: 700;
}

.primary {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #2997ff, var(--accent));
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.22);
}

.primary:hover:not(:disabled) {
  box-shadow: 0 14px 30px rgba(0, 113, 227, 0.26);
}

.ghost-button,
.danger-button,
.mini-button,
.payslip-action,
.status-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.ghost-button:hover:not(:disabled),
.mini-button:hover:not(:disabled),
.payslip-action:hover:not(:disabled),
.status-toggle:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--solid);
  box-shadow: var(--shadow-soft);
}

.danger-button,
.mini-button.danger,
.payslip-action.danger {
  background: var(--red-soft);
  border-color: rgba(217, 45, 58, 0.2);
  color: var(--red);
}

.text-button {
  color: var(--accent);
  background: transparent;
}

.text-button:hover {
  background: var(--accent-quiet);
  box-shadow: none;
}

.table-toolbar,
.filter-bar,
.shifts-toolbar,
.reconcile-bar,
.upload-meta,
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.table-toolbar > .search-box,
.filter-bar > .search-box {
  flex: 1 1 320px;
}

.search-box {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 0 12px;
  color: var(--muted);
}

.search-box input {
  color: var(--ink);
  font-weight: 600;
}

.select-pill,
select,
input,
textarea {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--solid);
}

.select-pill,
select {
  min-height: 42px;
  padding: 0 36px 0 12px;
}

.selection-count,
.muted,
.sub-text,
.unit {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  background: rgba(255, 255, 255, 0.54);
}

table,
.employee-table,
.payroll-table,
.payslip-table,
.attendance-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table th,
.employee-table th,
.payroll-table th,
.payslip-table th,
.attendance-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 249, 251, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-align: left;
  white-space: nowrap;
}

table td,
.employee-table td,
.payroll-table td,
.payslip-table td,
.attendance-table td {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

table tbody tr,
.employee-table tbody tr,
.payroll-table tbody tr,
.payslip-table tbody tr,
.attendance-table tbody tr {
  transition: background 0.16s ease;
}

table tbody tr:hover,
.employee-table tbody tr:hover,
.payroll-table tbody tr:hover,
.payslip-table tbody tr:hover,
.attendance-table tbody tr:hover {
  background: rgba(0, 113, 227, 0.035);
}

.person-cell {
  gap: 10px;
}

.person-cell strong,
.amount,
.strong {
  color: var(--ink);
  font-weight: 780;
}

.person-cell span {
  color: var(--muted);
  font-size: 11px;
}

.badge {
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--gray-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.badge.green,
.pill-green,
.status-toggle.green {
  border-color: rgba(29, 159, 112, 0.22);
  background: var(--green-soft);
  color: var(--green);
}

.badge.gold,
.badge.orange,
.pill-gold,
.pill-orange,
.status-toggle.gold {
  border-color: rgba(217, 119, 6, 0.24);
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.red,
.pill-red {
  border-color: rgba(217, 45, 58, 0.22);
  background: var(--red-soft);
  color: var(--red);
}

.badge.blue,
.pill-blue {
  border-color: rgba(0, 113, 227, 0.22);
  background: var(--accent-quiet);
  color: var(--accent);
}

.badge.purple,
.pill-purple,
.todo-card.purple {
  border-color: rgba(120, 87, 216, 0.2);
  background: var(--purple-soft);
  color: var(--purple);
}

.badge.muted,
.pill-muted {
  background: var(--gray-soft);
  color: var(--muted);
}

.dashboard-hero {
  position: relative;
  align-items: stretch;
  min-height: 254px;
  margin: 0;
  padding: 28px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 84% 18%, rgba(100, 190, 255, 0.55), transparent 23%),
    radial-gradient(circle at 66% 110%, rgba(62, 100, 255, 0.5), transparent 31%),
    linear-gradient(125deg, #081328 0%, #0a2f64 55%, #0067cc 100%);
  color: #fff;
  overflow: hidden;
}

.dashboard-hero::after {
  position: absolute;
  right: -70px;
  top: -95px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 56px rgba(255, 255, 255, 0.04),
    0 0 0 112px rgba(255, 255, 255, 0.025);
  content: "";
}

.dashboard-hero > div {
  position: relative;
  z-index: 1;
}

.dashboard-hero .eyebrow,
.dashboard-hero p,
.dashboard-hero small,
.dashboard-hero span {
  color: rgba(255, 255, 255, 0.74);
}

.dashboard-hero h2 {
  margin-top: 8px;
  color: #fff;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.04;
  letter-spacing: -1.8px;
}

.dashboard-hero p {
  max-width: 650px;
  margin-top: 14px;
  font-size: 14px;
}

.hero-pills span,
.hero-pills button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.86);
}

.dashboard-hero .hero-pills button:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.hero-status-card {
  min-width: 330px;
  max-width: 380px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
  color: #fff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero-status-card strong {
  color: #fff;
  font-size: 38px;
  letter-spacing: -1px;
}

.hero-status-card .progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.18);
}

.hero-status-card .progress-fill {
  background: linear-gradient(90deg, #ffffff, #79c4ff);
}

.payroll-progress-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.payroll-progress-meta div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px 10px;
}

.payroll-progress-meta span,
.payroll-progress-meta b {
  display: block;
}

.payroll-progress-meta span {
  font-size: 10px;
}

.payroll-progress-meta b {
  color: #fff;
  font-size: 14px;
  margin-top: 2px;
}

.dashboard-hero-actions .primary {
  background: #fff;
  color: #0a3974;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.dashboard-hero-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dashboard-hero-actions .payroll-entry-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(5, 20, 45, 0.18);
}

.dashboard-hero-actions .payroll-entry-button span,
.dashboard-hero-actions .payroll-entry-button svg {
  color: var(--ink);
  stroke: currentColor;
}

.dashboard-panel,
.report-card,
.report-panel,
.report-insight,
.exception-card,
.backup-status-card,
.account-management,
.permissions-matrix-card,
.attendance-import-section,
.attendance-import-history,
.shift-group-card,
.holiday-calendar-card,
.holiday-list-card,
.drawer-panel,
.confirm-dialog,
.lock-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}

.dashboard-panel {
  margin: 18px;
  padding: 20px;
}

.todo-overview-panel {
  margin-bottom: 0;
}

.todo-grid {
  grid-template-columns: repeat(7, minmax(116px, 1fr));
}

.todo-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--solid);
  padding: 14px;
  text-align: left;
  box-shadow: none;
}

.todo-card:hover {
  box-shadow: var(--shadow-soft);
}

.todo-card.red {
  background: var(--red-soft);
  color: var(--red);
}

.todo-card.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.todo-card.green {
  background: var(--green-soft);
  color: var(--green);
}

.todo-card.blue {
  background: var(--accent-quiet);
  color: var(--accent);
}

.todo-card.muted {
  background: var(--gray-soft);
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.8fr);
  gap: 0;
}

.dashboard-side-stack .dashboard-panel {
  margin-left: 0;
}

.task-item,
.care-row,
.compact-list > div {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.task-item:hover,
.care-row:hover,
.compact-list > div:hover {
  border-color: var(--line);
  background: var(--soft);
}

.care-icon {
  background: linear-gradient(145deg, #e1f3ff, #bddfff);
  color: #12507f;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.08);
}

.quick-app {
  border: 1px solid var(--line);
  background: var(--solid);
  box-shadow: none;
}

.quick-app:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.report-tabs,
.attendance-tabs {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  overflow: auto;
}

.report-tab,
.attendance-tab {
  position: relative;
  height: 50px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 15px;
  white-space: nowrap;
  font-weight: 720;
}

.report-tab.active,
.attendance-tab.active {
  color: var(--accent);
}

.report-tab.active::after,
.attendance-tab.active::after {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.report-hero {
  margin: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 86% 20%, rgba(41, 151, 255, 0.32), transparent 25%),
    linear-gradient(125deg, #0b1f3a, #0a4f9c);
  color: #fff;
}

.report-hero .eyebrow,
.report-hero p,
.report-hero small {
  color: rgba(255, 255, 255, 0.72);
}

.report-hero h3,
.report-hero strong {
  color: #fff;
}

.report-grid,
.report-visual-grid,
.exception-summary,
.settings-grid,
.backup-status-grid {
  margin: 18px;
}

.report-card,
.report-panel,
.report-insight {
  padding: 18px;
}

.attendance-header {
  background: rgba(255, 255, 255, 0.72);
}

.attendance-header h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.month-tag,
.lock-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--accent-quiet);
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0;
}

.breadcrumb-sep,
.breadcrumb-current {
  font-size: 24px;
}

.breadcrumb-sep {
  color: var(--faint);
}

.lock-badge {
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}

.attendance-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px;
  padding: 0;
}

.attendance-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  padding: 12px;
}

.attendance-step .step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--solid);
  color: var(--muted);
  font-weight: 800;
}

.attendance-step.done .step-number,
.attendance-step.active .step-number {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.attendance-step.warning .step-number {
  border-color: var(--gold);
  background: var(--gold);
  color: #fff;
}

.attendance-step strong {
  display: block;
}

.attendance-step span {
  color: var(--muted);
  font-size: 12px;
}

.attendance-stats,
.att-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px;
}

.attendance-stat-card,
.att-stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.attendance-stat-card strong,
.att-stat b {
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -1px;
}

.attendance-filter-bar,
.filter-bar {
  flex-wrap: nowrap;
}

.attendance-filter-bar .search-box {
  min-width: 300px;
}

.reconcile-bar {
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.attendance-import-view {
  display: grid;
  gap: 20px;
  padding: 18px;
}

.attendance-import-section,
.attendance-import-history {
  overflow: hidden;
}

.attendance-import-section {
  padding: 24px;
  border: 1px solid rgba(25, 71, 124, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(36, 120, 242, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94));
  box-shadow: 0 22px 54px rgba(16, 44, 84, 0.08);
}

.attendance-import-top {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 0.9fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.attendance-import-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 104px;
  padding: 20px 22px;
  border: 1px solid rgba(36, 120, 242, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
}

.section-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.attendance-import-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.attendance-import-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 680;
}

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

.attendance-sync-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(36, 120, 242, 0.13);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(20, 64, 120, 0.06);
}

.attendance-sync-card:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 120, 242, 0.28);
  background: #fff;
  box-shadow: 0 18px 34px rgba(20, 64, 120, 0.11);
}

.attendance-sync-card strong,
.attendance-sync-card small {
  display: block;
}

.attendance-sync-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.attendance-sync-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 680;
}

.sync-card-icon,
.upload-zone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: var(--accent);
  background: linear-gradient(180deg, #eef6ff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(36, 120, 242, 0.12);
}

.sync-card-icon {
  width: 46px;
  height: 46px;
}

.sync-card-icon .app-icon,
.upload-zone-icon .app-icon {
  width: 22px;
  height: 22px;
}

.attendance-upload-card {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
}

.attendance-import-section .upload-zone {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 260px;
  margin: 0;
  padding: 30px;
  border: 1.5px dashed rgba(36, 120, 242, 0.35);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 0%, rgba(36, 120, 242, 0.08), transparent 42%),
    linear-gradient(145deg, rgba(246, 250, 255, 0.92), rgba(255, 255, 255, 0.96));
  text-align: center;
  cursor: pointer;
}

.attendance-import-section .upload-zone strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.attendance-import-section .upload-zone p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 680;
}

.upload-zone-icon {
  width: 58px;
  height: 58px;
  border-radius: 20px;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--accent);
  background:
    radial-gradient(circle at 50% 0%, rgba(36, 120, 242, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(239, 247, 255, 0.98), rgba(255, 255, 255, 1));
}

.attendance-upload-side {
  display: grid;
  gap: 12px;
}

.attendance-import-tip,
.attendance-month-card {
  border: 1px solid rgba(25, 71, 124, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(20, 64, 120, 0.06);
}

.attendance-import-tip {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.attendance-import-tip .app-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.attendance-import-tip strong,
.attendance-import-tip small {
  display: block;
}

.attendance-import-tip strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.attendance-import-tip small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 680;
}

.attendance-month-card {
  display: grid;
  gap: 9px;
  padding: 16px;
}

.attendance-month-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.attendance-month-card input {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  background: var(--soft);
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.attendance-import-submit {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 900;
}

.attendance-import-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(36, 120, 242, 0.26);
}

.attendance-import-notice {
  display: grid;
  gap: 4px;
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(16, 185, 129, 0.24);
  background: rgba(236, 253, 245, 0.86);
  color: #047857;
  font-size: 13px;
  font-weight: 720;
}

.attendance-import-notice strong {
  color: #064e3b;
  font-size: 14px;
  font-weight: 860;
}

.attendance-import-notice.error {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(254, 242, 242, 0.9);
  color: #b91c1c;
}

.attendance-import-notice.error strong {
  color: #7f1d1d;
}

.file-name-cell {
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
}

.attendance-shifts-view,
.attendance-holidays-view {
  padding: 18px;
}

.shift-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.shift-group-card {
  overflow: hidden;
  padding: 0;
}

.shift-group-card > header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.shift-group-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), #3d9eff);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.shift-rule-list {
  display: grid;
}

.shift-rule-tile {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.shift-rule-tile:last-child {
  border-bottom: 0;
}

.shift-rule-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.shift-rule-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shift-actions,
.row-actions,
.payroll-actions,
.payslip-actions,
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.actions-col {
  min-width: 120px;
}

.employee-actions-col {
  min-width: 0;
}

.employee-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.payslip-actions .payslip-action,
.payroll-actions .payslip-action,
.employee-actions .mini-button {
  min-height: 34px;
}

.employee-actions .wide-mini {
  min-width: 78px;
}

.employee-actions .text-mini {
  padding-inline: 7px;
}

.status-toggle {
  min-height: 32px;
  padding: 0 11px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn,
.jump-input {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--solid);
}

.page-btn {
  min-width: 34px;
  height: 34px;
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.drawer-overlay,
.confirm-overlay {
  background: rgba(11, 19, 32, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.drawer-panel {
  border-radius: 24px 0 0 24px;
  background: rgba(255, 255, 255, 0.94);
}

.drawer-header,
.drawer-actions {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.form-grid,
.form-grid-3 {
  gap: 12px;
}

.field,
.inline-field,
.form-section {
  border-color: var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.field input,
.field select,
.field textarea {
  background: transparent;
}

.empty-state {
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.toast {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--solid);
  color: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 1280px) {
  body {
    min-width: 980px;
  }

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

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

  .todo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .dashboard-side-stack .dashboard-panel {
    margin-left: 18px;
  }
}

@media (min-width: 1101px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Match the real attendance markup after the visual refresh. */
.attendance-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(248, 249, 251, 0.86);
  overflow-x: auto;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  flex: 0 0 auto;
}

.stepper-num {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--solid);
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
}

.stepper-num-done {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.stepper-num-warn {
  border-color: var(--gold);
  background: var(--gold);
  color: #fff;
}

.stepper-meta strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.stepper-status {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stepper-status-done {
  color: var(--green);
}

.stepper-status-warn {
  color: var(--gold);
}

.stepper-chev {
  color: var(--faint);
  font-size: 24px;
  flex: 0 0 auto;
}

.attendance-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px;
}

.stat-card {
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.stat-card-alert {
  border-color: rgba(217, 45, 58, 0.2);
  background: var(--red-soft);
}

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

.stat-value-row strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -1px;
}

.stat-value-row em {
  color: var(--muted);
  font-style: normal;
}

/* ==================== Apple module polish ==================== */

.apple-module {
  display: grid;
  gap: 18px;
}

.apple-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.apple-page-title h2 {
  margin-top: 3px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  font-weight: 880;
}

.apple-page-title p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
}

.apple-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.apple-head-actions .primary,
.apple-head-actions .ghost-button {
  min-height: 46px;
  border-radius: 14px;
  padding: 0 18px;
  box-shadow: var(--shadow-soft);
}

.apple-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.apple-metric {
  min-height: 128px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.86));
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.apple-metric.green { border-top-color: var(--green); }
.apple-metric.orange { border-top-color: var(--gold); }
.apple-metric.red { border-top-color: var(--red); background: linear-gradient(180deg, #fff, var(--red-soft)); }
.apple-metric.blue { border-top-color: var(--accent); }

.apple-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.apple-metric strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.apple-metric small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.apple-metric small b {
  margin-right: 6px;
  color: var(--green);
}

.apple-metric small b.down {
  color: var(--red);
}

.apple-data-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

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

.apple-card-head h3 {
  font-size: 19px;
  font-weight: 850;
}

.apple-card-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.apple-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.apple-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.apple-search svg {
  position: absolute;
  left: 14px;
  color: var(--muted);
}

.apple-search input {
  min-height: 48px;
  border-radius: 14px;
  padding-left: 44px;
  font-size: 15px;
}

.apple-segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 15px;
  background: var(--gray-soft);
  padding: 4px;
  white-space: nowrap;
}

.apple-segmented button {
  min-height: 40px;
  border-radius: 12px;
  background: transparent;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 780;
}

.apple-segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(31, 75, 122, 0.08);
}

.apple-mini-select {
  min-width: 150px;
  min-height: 48px;
  border-radius: 14px;
}

.apple-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.apple-data-table {
  width: 100%;
  border-collapse: collapse;
}

.apple-data-table th {
  height: 52px;
  background: rgba(247, 250, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.apple-data-table th,
.apple-data-table td {
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
  vertical-align: middle;
}

.apple-data-table tbody tr:nth-child(even) {
  background: rgba(247, 250, 255, 0.46);
}

.apple-person {
  display: flex;
  min-width: 150px;
  align-items: center;
  gap: 12px;
}

.apple-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #dff0ff, #bfe2ff);
  color: #095cae;
  font-size: 13px;
  font-weight: 860;
}

.apple-person strong,
.apple-person small {
  display: block;
}

.apple-person strong {
  font-size: 15px;
  font-weight: 850;
}

.apple-person small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.apple-data-table .actions-col {
  width: 1%;
  min-width: 140px;
  white-space: nowrap;
}

.payslip-table.apple-data-table {
  min-width: 1220px;
}

.payslip-table .actions-col {
  min-width: 430px;
}

.payroll-table.apple-data-table {
  min-width: 1080px;
}

.payroll-table .actions-col {
  min-width: 150px;
}

.payslip-actions,
.payroll-actions,
.apple-data-table .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.payslip-action,
.mini-button.text-mini {
  border-radius: 12px;
}

.apple-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.apple-grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.import-config-grid,
.security-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  align-items: start;
}

.apple-info {
  margin: 18px;
}

.apple-mapping-grid {
  padding: 0 18px 18px;
}

.mapping-side-card,
.exception-advice-card {
  padding-bottom: 8px;
}

.apple-advice-stack {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.apple-advice-stack article {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  padding: 14px;
}

.apple-advice-stack strong,
.apple-advice-stack span {
  display: block;
}

.apple-advice-stack strong {
  font-weight: 850;
}

.apple-advice-stack span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.apple-exception-list {
  padding: 18px;
}

.apple-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-center-module .account-center {
  display: grid;
  gap: 16px;
}

.account-center-module .account-panel {
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.permission-matrix-table .permission-cell {
  justify-content: center;
}

/* ==================== Payroll calculation polish ==================== */

.payroll-calc-page {
  overflow: hidden;
}

.payroll-calc-hero {
  grid-template-columns: minmax(0, 1fr);
  padding: 28px;
  border-radius: 28px;
}

.payroll-calc-actions {
  width: 100%;
  max-width: none;
  justify-content: flex-end;
  gap: 10px;
}

.payroll-calc-actions .ghost-button,
.payroll-calc-actions .primary {
  min-width: 136px;
  min-height: 44px;
  border-radius: 14px;
}

.payroll-calc-stepper {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.payroll-calc-step {
  min-width: 0;
  align-items: flex-start;
}

.payroll-calc-step > div {
  min-width: 0;
}

.payroll-calc-tabs {
  border-radius: 22px;
  padding: 10px;
}

.payroll-calc-kpis {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.payroll-calc-empty-card {
  display: grid;
  min-height: 150px;
  place-items: center;
}

.payroll-calc-table-wrap {
  overflow-x: auto;
  border-radius: 22px;
  background: #fff;
}

.payroll-calc-table th,
.payroll-calc-table td {
  padding: 12px 12px;
}

.payroll-calc-table .actions-col,
.salary-standard-table .salary-actions-col {
  min-width: 156px;
  white-space: nowrap;
}

.salary-standard-table {
  min-width: 1120px;
}

.salary-standard-table th:last-child,
.salary-standard-table td:last-child {
  width: 168px;
}

.salary-standard-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  min-width: 132px;
}

.salary-standard-actions .mini-button {
  min-width: 58px;
  min-height: 36px;
  border-radius: 12px;
}

@media (max-width: 1100px) {
  .apple-page-head,
  .apple-toolbar,
  .apple-grid.two,
  .import-config-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .apple-head-actions,
  .payroll-calc-actions {
    justify-content: flex-start;
  }

  .payroll-advance-card {
    grid-template-columns: 1fr;
  }

  .payroll-advance-controls {
    justify-content: flex-start;
  }

  .apple-metrics,
  .apple-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .apple-metrics,
  .apple-settings-grid {
    grid-template-columns: 1fr;
  }

  .apple-toolbar {
    padding: 12px;
  }

  .payroll-advance-controls,
  .payroll-advance-controls label,
  .payroll-advance-controls .ghost-button,
  .payroll-advance-controls .primary {
    width: 100%;
  }

  .apple-segmented {
    overflow-x: auto;
  }
}

/* ==================== 2026-06-18 UI bugfix and command shell ==================== */

html.hr-invert-mode {
  filter: invert(1) hue-rotate(180deg);
  background: #101216;
}

html.hr-invert-mode img,
html.hr-invert-mode video,
html.hr-invert-mode canvas {
  filter: invert(1) hue-rotate(180deg);
}

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

.app-shell {
  width: min(100%, 1760px);
  padding: 0 18px 36px;
  overflow-x: clip;
}

.topbar.apple-commandbar {
  display: grid;
  grid-template-columns: minmax(250px, auto) minmax(320px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  margin: 0 -18px;
  padding: 12px 28px;
  border-width: 0 0 1px;
  border-radius: 0;
}

.top-search-shell {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(100%, 560px);
  justify-self: end;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0 14px;
  box-shadow: var(--shadow-soft);
}

.top-search-shell svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.top-search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 680;
  outline: 0;
}

.top-search-shell kbd {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 4px 10px rgba(31, 75, 122, 0.08);
}

.top-controls {
  display: flex;
  align-items: center;
}

.top-icon-button {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.top-icon-button svg {
  width: 20px;
  height: 20px;
}

.top-icon-button.active {
  background: var(--ink);
  color: #fff;
}

.top-icon-button.has-dot::after {
  position: absolute;
  top: 11px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--red);
  content: "";
}

.role-control {
  height: 50px;
  padding: 0;
  background: transparent;
  border: 0;
}

.role-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  min-width: 190px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 6px 12px;
  box-shadow: var(--shadow-soft);
}

.role-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #dff0ff, #bfe2ff);
  color: #095cae;
  font-weight: 900;
}

.role-copy {
  min-width: 0;
  text-align: left;
}

.role-copy small,
.role-copy strong {
  display: block;
}

.role-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.role-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.side-panel {
  padding: 20px 16px;
  border: 0;
  border-radius: 0 28px 28px 0;
  background: rgba(255, 255, 255, 0.78);
}

.module-nav {
  gap: 8px;
}

.nav-section-label {
  margin: 8px 16px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.nav-section-label.system-label {
  margin-top: 24px;
}

.module-nav button,
.module-nav .module-link {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  min-height: 54px;
  border-radius: 18px;
  padding: 0 16px;
  color: #6f737b;
  font-size: 16px;
  font-weight: 820;
}

.module-nav button.active,
.module-nav .module-link.active {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.15), rgba(41, 151, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.25);
  color: var(--accent);
}

.module-nav button[hidden],
.module-nav .module-link[hidden] {
  display: none;
}

.module-nav .app-icon {
  width: 22px;
  height: 22px;
}

.nav-count {
  display: inline-flex;
  min-width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(9, 30, 66, 0.07);
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 850;
}

.nav-count.reserve {
  padding: 0 10px;
}

.nav-health-card {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.nav-health-card strong {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.nav-health-card i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(16, 167, 131, 0.12);
}

.nav-health-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 650;
}

.content-panel {
  overflow: visible;
}

#mainView {
  overflow: hidden;
  border-radius: inherit;
}

.apple-module {
  padding: 26px 28px 30px;
}

.apple-page-head {
  padding: 0 4px;
}

.apple-page-title .eyebrow,
.panel-header .eyebrow {
  overflow: visible;
  text-indent: 0;
}

.apple-page-title h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.apple-search svg,
.apple-toolbar .apple-search svg,
.search-box svg,
.top-search-shell svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

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

.payslip-table.apple-data-table,
.payroll-table.apple-data-table {
  min-width: 0;
  table-layout: fixed;
}

.payslip-table th,
.payslip-table td,
.payroll-table th,
.payroll-table td {
  padding-inline: 12px;
}

.payslip-table th,
.payslip-table td {
  padding-inline: 6px;
}

.payslip-table th:nth-child(1),
.payslip-table td:nth-child(1) { width: 80px; }
.payslip-table th:nth-child(2),
.payslip-table td:nth-child(2) { width: 150px; }
.payslip-table th:nth-child(3),
.payslip-table td:nth-child(3) { width: 100px; }
.payslip-table th:nth-child(4),
.payslip-table td:nth-child(4) { width: 95px; }
.payslip-table th:nth-child(5),
.payslip-table td:nth-child(5) { width: 120px; }
.payslip-table th:nth-child(6),
.payslip-table td:nth-child(6) { width: 110px; }
.payslip-table th:nth-child(7),
.payslip-table td:nth-child(7) { width: 80px; }
.payslip-table th:nth-child(8),
.payslip-table td:nth-child(8) { width: 190px; }

.payroll-table th:nth-child(1),
.payroll-table td:nth-child(1) { width: 190px; }
.payroll-table th:nth-child(2),
.payroll-table td:nth-child(2) { width: 130px; }
.payroll-table th:nth-child(3),
.payroll-table td:nth-child(3) { width: 120px; }
.payroll-table th:nth-child(4),
.payroll-table td:nth-child(4) { width: 150px; }
.payroll-table th:nth-child(5),
.payroll-table td:nth-child(5) { width: 140px; }
.payroll-table th:nth-child(6),
.payroll-table td:nth-child(6) { width: 174px; }
.payroll-table th:nth-child(7),
.payroll-table td:nth-child(7) { width: 130px; }
.payroll-table th:nth-child(8),
.payroll-table td:nth-child(8) { width: 150px; }

.payslip-table .actions-col,
.payroll-table .actions-col {
  min-width: 0;
}

.apple-data-table .payslip-actions,
.payslip-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.payslip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 0;
  min-height: 34px;
  border-radius: 11px;
  padding: 0;
  font-size: 12px;
}

.payslip-action svg {
  width: 15px;
  height: 15px;
}

.payslip-action span {
  display: none;
}

.apple-person {
  min-width: 0;
}

.apple-person > span:last-child {
  min-width: 0;
}

.apple-person strong,
.apple-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-hero-total,
.report-hero-total span,
.report-hero-total strong,
.report-hero-total small {
  color: var(--ink) !important;
}

.report-hero-total {
  background: rgba(255, 255, 255, 0.93);
}

.employee-health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: 16px;
  padding: 20px 22px 0;
}

.employee-health-card,
.employee-status-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.employee-health-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.employee-health-card h3,
.employee-status-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.employee-health-card p,
.employee-status-card p,
.employee-status-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.employee-health-card > strong {
  color: var(--green);
  font-size: 34px;
  font-weight: 920;
}

.health-track {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-soft);
}

.health-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #65dcbf);
}

.health-meta {
  display: flex;
  grid-column: 1 / -1;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.health-meta b {
  color: var(--ink);
}

.employee-status-card {
  display: flex;
  align-items: center;
  gap: 22px;
}

.employee-archive-section {
  margin: 18px 22px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.employee-archive-section .section-heading {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.employee-archive-section .section-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.archive-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.archive-employee-table tbody tr {
  background: rgba(247, 250, 255, 0.42);
}

.employee-donut {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--employee-health), var(--gray-soft) 0);
}

.employee-donut::before {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.employee-donut span,
.employee-donut small {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.employee-donut span {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.employee-donut small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.exception-queue-card .apple-exception-list {
  max-height: none;
}

.account-center-module .permission-matrix-wrap {
  overflow-x: auto;
}

.permission-matrix-table {
  min-width: 1120px;
}

.permission-matrix-table th,
.permission-matrix-table td {
  padding: 20px 22px;
}

.permission-matrix-table tr:nth-child(even) {
  background: rgba(247, 250, 255, 0.72);
}

.permission-matrix-table .permission-cell {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.perm-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 92px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 250, 255, 0.9);
  color: var(--muted);
  font-weight: 800;
}

.perm-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.perm-toggle:has(input:checked) {
  border-color: rgba(16, 167, 131, 0.25);
  background: rgba(16, 167, 131, 0.12);
  color: var(--green);
}

.apple-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.apple-settings-grid .settings-card {
  min-height: 210px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

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

.security-grid .apple-data-card {
  border-radius: 24px;
}

.attendance-module .apple-page-title {
  padding-left: 4px;
}

@media (max-width: 1280px) {
  .topbar.apple-commandbar {
    grid-template-columns: 1fr;
  }

  .top-search-shell {
    width: 100%;
    justify-self: stretch;
  }

  .top-controls {
    flex-wrap: wrap;
  }

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

  .side-panel {
    position: static;
    border-radius: 24px;
  }

  .module-nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .nav-section-label,
  .nav-health-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .apple-module {
    padding: 20px 16px 24px;
  }

  .apple-page-head,
  .employee-health-grid {
    grid-template-columns: 1fr;
  }

  .apple-toolbar {
    grid-template-columns: 1fr;
  }

  .apple-metrics,
  .apple-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== 2026-06-18 topbar and sidebar micro polish ==================== */

.topbar.apple-commandbar {
  grid-template-columns: minmax(250px, auto) minmax(360px, 1fr) auto;
  gap: 18px;
  min-height: 82px;
  padding-block: 14px;
}

.top-search-shell {
  grid-template-columns: 22px minmax(0, 1fr);
  width: min(100%, 620px);
  min-height: 54px;
  border-radius: 19px;
  padding: 0 18px;
}

.top-search-shell kbd {
  display: none;
}

.top-search-shell input {
  font-size: 16px;
}

.top-controls {
  gap: 12px;
}

.month-control {
  display: grid;
  min-width: 224px;
  height: 54px;
  align-content: center;
  gap: 2px;
  border-radius: 18px;
  padding: 7px 14px;
}

.month-control label {
  line-height: 1;
}

.month-control input {
  min-width: 180px;
  height: 25px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.top-icon-button {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

.role-control {
  height: 54px;
}

.role-chip {
  min-width: 258px;
  min-height: 54px;
  border-radius: 20px;
  padding-inline: 12px 14px;
}

.role-copy strong {
  font-size: 15px;
  text-overflow: clip;
}

.role-chip .app-icon {
  width: 16px;
  height: 16px;
}

.side-panel {
  top: 92px;
  max-height: none;
  overflow: visible;
  padding: 14px 12px;
}

.module-nav {
  gap: 3px;
}

.nav-section-label {
  margin: 6px 14px 4px;
  font-size: 11px;
  line-height: 1.2;
}

.nav-section-label.system-label {
  margin-top: 12px;
}

.module-nav button,
.module-nav .module-link {
  min-height: 43px;
  border-radius: 14px;
  padding: 0 13px;
  font-size: 15px;
  gap: 10px;
}

.module-nav .app-icon {
  width: 20px;
  height: 20px;
}

.nav-health-card {
  margin-top: 12px;
  border-radius: 18px;
  padding: 13px 14px;
}

.nav-health-card strong {
  gap: 8px;
  font-size: 14px;
}

.nav-health-card p {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

@media (min-width: 1281px) {
  .side-panel {
    max-height: none;
  }
}

@media (max-width: 1480px) {
  .topbar.apple-commandbar {
    grid-template-columns: minmax(220px, auto) minmax(300px, 1fr) auto;
    gap: 12px;
  }

  .top-search-shell {
    width: min(100%, 520px);
  }

  .month-control {
    min-width: 196px;
  }

  .role-chip {
    min-width: 224px;
  }
}

/* ==================== 2026-06-20 command bar alignment polish ==================== */

.topbar.apple-commandbar {
  grid-template-columns: minmax(250px, auto) minmax(240px, 1fr) minmax(560px, auto);
  padding-right: clamp(78px, 5vw, 104px);
}

.top-controls {
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  padding-right: 0;
  transform: translateX(-10px);
}

.month-control {
  display: flex;
  min-width: 232px;
  height: 60px;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px 7px;
}

.month-control label {
  margin: 0;
  line-height: 1.05;
  transform: translateY(4px);
}

.month-control input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 28px;
  transform: translateY(4px);
}

.role-control {
  min-width: 0;
  height: 58px;
}

.role-chip {
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  min-width: 226px;
  max-width: 254px;
  min-height: 58px;
  gap: 12px;
  padding: 7px 12px;
}

.role-avatar {
  width: 40px;
  height: 40px;
  border-radius: 15px;
}

.role-copy small {
  margin-bottom: 3px;
  line-height: 1;
}

.role-copy strong {
  max-width: 132px;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

@media (max-width: 1480px) {
  .topbar.apple-commandbar {
    grid-template-columns: minmax(210px, auto) minmax(220px, 1fr) minmax(500px, auto);
    padding-right: 54px;
  }

  .top-search-shell {
    width: min(100%, 440px);
  }

  .top-controls {
    gap: 10px;
    transform: translateX(-8px);
  }

  .month-control {
    min-width: 206px;
  }

  .role-chip {
    min-width: 210px;
    max-width: 226px;
  }

  .role-copy strong {
    max-width: 126px;
    font-size: 15px;
  }
}

@media (max-width: 1280px) {
  .topbar.apple-commandbar {
    grid-template-columns: 1fr;
    padding-right: 28px;
  }

  .top-controls {
    justify-self: stretch;
    padding-right: 0;
  }
}

/* ==================== 2026-06-20 dashboard probation row polish ==================== */

.probation-list {
  gap: 10px;
}

.compact-list .probation-row {
  position: relative;
  overflow: hidden;
  gap: 5px;
  border: 1px solid rgba(219, 231, 244, 0.92);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  padding: 13px 14px 13px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.compact-list .probation-row::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--accent), #35c1d6);
  content: "";
}

.compact-list .probation-row:nth-child(even) {
  background: linear-gradient(180deg, #fffaf0 0%, #fff6df 100%);
  border-color: rgba(247, 184, 75, 0.26);
}

.compact-list .probation-row:nth-child(even)::before {
  background: linear-gradient(180deg, #e68600, #f7b84b);
}

.compact-list .probation-row strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
}

.compact-list .probation-row span {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.compact-list .probation-row:hover {
  border-color: rgba(36, 120, 242, 0.28);
  background: #eef6ff;
}

/* ==================== 2026-06-20 sticky sidebar and refined motion layer ==================== */

:root {
  --motion-fast: 140ms;
  --motion: 220ms;
  --motion-slow: 520ms;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-spring: cubic-bezier(0.18, 0.89, 0.32, 1.18);
  --hover-shadow: 0 18px 44px rgba(31, 75, 122, 0.12);
  --focus-ring: 0 0 0 4px rgba(36, 120, 242, 0.14);
}

@keyframes yll-soft-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes yll-gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 180% 50%;
  }
}

@keyframes yll-subtle-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(36, 120, 242, 0.14);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(36, 120, 242, 0);
  }
}

@media (min-width: 1024px) {
  .workspace {
    display: block;
    position: relative;
    min-height: calc(100vh - 140px);
    padding-left: 252px;
  }

  .side-panel {
    position: fixed;
    top: 112px;
    left: max(16px, calc((100vw - 1480px) / 2));
    width: 236px;
    z-index: 12;
    max-height: none;
    overflow: visible;
  }

  .side-panel:hover {
    overflow: visible;
  }

  .content-panel {
    width: 100%;
  }
}

.topbar.apple-commandbar,
.side-panel,
.content-panel,
.dashboard-hero,
.dashboard-panel,
.quick-panel,
.metric-card,
.apple-metric,
.apple-data-card,
.settings-card,
.batch-card,
.panel-card,
.payroll-dept-card,
.report-card,
.report-insight-card,
.exception-card,
.backup-status-card,
.account-panel,
.employee-health-card,
.employee-status-card,
.employee-archive-section,
.shift-group-card,
.holiday-calendar-card,
.holiday-list-card,
.payroll-calc-step,
.payroll-calc-kpi,
.stat-card,
.attendance-stat-card {
  transition:
    transform var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease),
    border-color var(--motion) var(--motion-ease),
    background-color var(--motion) var(--motion-ease),
    filter var(--motion) var(--motion-ease);
}

#mainView > *,
.apple-module > *,
.view-stack > *,
.dashboard-grid > *,
.dashboard-side-stack > *,
.apple-metrics > *,
.apple-settings-grid > *,
.employee-health-grid > * {
  animation: yll-soft-rise var(--motion-slow) var(--motion-ease) both;
}

.dashboard-panel:hover,
.quick-panel:hover,
.metric-card:hover,
.apple-metric:hover,
.apple-data-card:hover,
.settings-card:hover,
.batch-card:hover,
.panel-card:hover,
.payroll-dept-card:hover,
.report-card:hover,
.report-insight-card:hover,
.exception-card:hover,
.backup-status-card:hover,
.account-panel:hover,
.employee-health-card:hover,
.employee-status-card:hover,
.shift-group-card:hover,
.holiday-calendar-card:hover,
.holiday-list-card:hover,
.payroll-calc-step:hover,
.payroll-calc-kpi:hover,
.stat-card:hover,
.attendance-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(36, 120, 242, 0.18);
}

.side-panel {
  transition:
    box-shadow var(--motion) var(--motion-ease),
    background-color var(--motion) var(--motion-ease),
    backdrop-filter var(--motion) var(--motion-ease);
}

.side-panel:hover {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 54px rgba(31, 75, 122, 0.13);
}

.module-nav button,
.module-nav .module-link,
.top-icon-button,
.role-chip,
.primary,
.ghost-button,
.mini-button,
.icon-button,
.circle-button,
.text-button,
.payslip-action,
.payroll-entry-button,
.todo-card,
.task-item,
.care-row,
.compact-list > div,
.department-card,
.apple-data-table tbody tr,
tbody tr,
.permission-cell,
.perm-toggle {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease),
    border-color var(--motion) var(--motion-ease),
    background-color var(--motion) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}

.module-nav button:hover,
.module-nav .module-link:hover,
.top-icon-button:hover,
.role-chip:hover,
.primary:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.mini-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.circle-button:hover:not(:disabled),
.text-button:hover:not(:disabled),
.payslip-action:hover:not(:disabled),
.payroll-entry-button:hover,
.todo-card:hover,
.task-item:hover,
.care-row:hover,
.compact-list > div:hover,
.department-card:hover,
.apple-data-table tbody tr:hover,
tbody tr:hover,
.perm-toggle:hover {
  transform: translateY(-1px);
}

.module-nav button:active,
.module-nav .module-link:active,
.top-icon-button:active,
.role-chip:active,
.primary:active:not(:disabled),
.ghost-button:active:not(:disabled),
.mini-button:active:not(:disabled),
.icon-button:active:not(:disabled),
.circle-button:active:not(:disabled),
.text-button:active:not(:disabled),
.payslip-action:active:not(:disabled),
.payroll-entry-button:active,
.todo-card:active,
.task-item:active,
.care-row:active,
.department-card:active {
  transform: translateY(0) scale(0.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.module-nav button.active,
.module-nav .module-link.active {
  animation: yll-subtle-pulse 2.8s ease-in-out infinite;
}

.progress-fill,
.bar-fill,
.hero-status-card .progress-fill,
.health-track span,
.employee-donut,
.report-hero-total,
.apple-metric::before,
.metric-card::before {
  background-size: 180% 100%;
  transition:
    width var(--motion-slow) var(--motion-ease),
    transform var(--motion) var(--motion-ease),
    opacity var(--motion) var(--motion-ease);
}

.progress-fill,
.bar-fill,
.hero-status-card .progress-fill,
.health-track span {
  animation: yll-gradient-flow 5.6s linear infinite;
}

.apple-data-table tbody tr:hover,
tbody tr:hover {
  background: rgba(234, 243, 255, 0.62);
}

.apple-table-wrap,
.table-wrap,
.payroll-calc-table-wrap,
.account-table-wrap,
.permission-matrix-wrap {
  scroll-behavior: smooth;
}

.toast {
  transition:
    transform var(--motion) var(--motion-spring),
    opacity var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease);
}

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

  .dashboard-panel:hover,
  .quick-panel:hover,
  .metric-card:hover,
  .apple-metric:hover,
  .apple-data-card:hover,
  .settings-card:hover,
  .batch-card:hover,
  .panel-card:hover,
  .payroll-dept-card:hover,
  .report-card:hover,
  .report-insight-card:hover,
  .exception-card:hover,
  .backup-status-card:hover,
  .account-panel:hover,
  .employee-health-card:hover,
  .employee-status-card:hover,
  .shift-group-card:hover,
  .holiday-calendar-card:hover,
  .holiday-list-card:hover,
  .payroll-calc-step:hover,
  .payroll-calc-kpi:hover,
  .stat-card:hover,
  .attendance-stat-card:hover,
  .module-nav button:hover,
  .module-nav .module-link:hover,
  .top-icon-button:hover,
  .role-chip:hover,
  .primary:hover:not(:disabled),
  .ghost-button:hover:not(:disabled),
  .mini-button:hover:not(:disabled),
  .icon-button:hover:not(:disabled),
  .circle-button:hover:not(:disabled),
  .text-button:hover:not(:disabled),
  .payslip-action:hover:not(:disabled),
  .payroll-entry-button:hover,
  .todo-card:hover,
  .task-item:hover,
  .care-row:hover,
  .compact-list > div:hover,
  .department-card:hover,
  .apple-data-table tbody tr:hover,
  tbody tr:hover,
  .perm-toggle:hover {
    transform: none !important;
  }
}

/* ==================== 2026-06-20 sidebar document-flow restore ==================== */

@media (min-width: 1024px) {
  .workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding-left: 0;
  }

  .side-panel {
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    scrollbar-width: auto;
  }

  .side-panel:hover {
    overflow: visible;
  }

  .content-panel {
    grid-column: 2;
    min-width: 0;
  }
}

@media (max-width: 1023px) {
  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .side-panel {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .content-panel {
    grid-column: auto;
  }
}

.attendance-summary-table {
  min-width: 0;
  table-layout: fixed;
}

.attendance-summary-table th,
.attendance-summary-table td {
  padding: 10px 6px;
  font-size: 12px;
}

.attendance-summary-table th:nth-child(1),
.attendance-summary-table td:nth-child(1) { width: 8.8%; }
.attendance-summary-table th:nth-child(2),
.attendance-summary-table td:nth-child(2) { width: 5.5%; }
.attendance-summary-table th:nth-child(3),
.attendance-summary-table td:nth-child(3) { width: 6%; }
.attendance-summary-table th:nth-child(4),
.attendance-summary-table td:nth-child(4) { width: 6%; }
.attendance-summary-table th:nth-child(5),
.attendance-summary-table td:nth-child(5) { width: 5.4%; }
.attendance-summary-table th:nth-child(6),
.attendance-summary-table td:nth-child(6) { width: 8%; }
.attendance-summary-table th:nth-child(7),
.attendance-summary-table td:nth-child(7) { width: 5%; }
.attendance-summary-table th:nth-child(8),
.attendance-summary-table td:nth-child(8) { width: 4.8%; }
.attendance-summary-table th:nth-child(9),
.attendance-summary-table td:nth-child(9) { width: 4.8%; }
.attendance-summary-table th:nth-child(10),
.attendance-summary-table td:nth-child(10) { width: 6.2%; }
.attendance-summary-table th:nth-child(11),
.attendance-summary-table td:nth-child(11) { width: 6.2%; }
.attendance-summary-table th:nth-child(12),
.attendance-summary-table td:nth-child(12) { width: 5%; }
.attendance-summary-table th:nth-child(13),
.attendance-summary-table td:nth-child(13) { width: 5.3%; }
.attendance-summary-table th:nth-child(14),
.attendance-summary-table td:nth-child(14) { width: 6%; }
.attendance-summary-table th:nth-child(15),
.attendance-summary-table td:nth-child(15) { width: 4.8%; }
.attendance-summary-table th:nth-child(16),
.attendance-summary-table td:nth-child(16) { width: 12.2%; }

.attendance-summary-table .person-cell,
.attendance-summary-table .date-cell {
  min-width: 0;
}

.attendance-summary-table .person-cell strong,
.attendance-summary-table .date-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-summary-table .badge,
.attendance-summary-table .pill {
  max-width: 100%;
  padding-inline: 7px;
}

.attendance-summary-table .actions-col {
  min-width: 0;
  width: auto;
}

.attendance-summary-table .table-actions {
  flex-wrap: wrap;
  gap: 5px;
}

.attendance-summary-table .table-actions .mini-button {
  min-width: 58px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

/* ==================== 2026-06-22 dashboard todo polish ==================== */

.todo-overview-panel .todo-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.todo-overview-panel .todo-card {
  position: relative;
  min-width: 0;
  min-height: 128px;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(30, 56, 92, 0.09);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.72)),
    var(--solid);
  box-shadow: 0 12px 30px rgba(31, 75, 122, 0.06);
}

.todo-overview-panel .todo-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 42%);
  content: "";
  opacity: 0.74;
}

.todo-overview-panel .todo-card::after {
  position: absolute;
  inset: -55% auto auto -70%;
  width: 78%;
  height: 210%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.56), transparent);
  content: "";
  opacity: 0;
  transform: translateX(-20%) rotate(18deg);
  transition:
    opacity 380ms var(--motion-ease),
    transform 680ms var(--motion-ease);
  pointer-events: none;
}

.todo-overview-panel .todo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(36, 120, 242, 0.2);
  box-shadow: 0 18px 42px rgba(31, 75, 122, 0.11);
}

.todo-overview-panel .todo-card:hover::after {
  opacity: 1;
  transform: translateX(285%) rotate(18deg);
}

.todo-overview-panel .todo-card strong {
  font-size: clamp(28px, 2.2vw, 38px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.todo-overview-panel .todo-card span,
.todo-overview-panel .todo-card small {
  line-height: 1.35;
  white-space: normal;
}

.todo-overview-panel .todo-card.red {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 240, 0.92)),
    var(--red-soft);
}

.todo-overview-panel .todo-card.gold {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 228, 0.94)),
    var(--gold-soft);
}

.todo-overview-panel .todo-card.green {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(232, 248, 243, 0.96)),
    var(--green-soft);
}

.todo-overview-panel .todo-card.blue {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(234, 243, 255, 0.96)),
    var(--accent-quiet);
}

.todo-overview-panel .todo-card.purple {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(245, 240, 255, 0.96)),
    var(--purple-soft);
}

.todo-overview-panel .todo-card.muted {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 250, 0.98)),
    var(--gray-soft);
}

.dashboard-hero,
.dashboard-panel,
.topbar.apple-commandbar,
.metric-card,
.apple-metric,
.side-panel,
.content-panel {
  transform: translateZ(0);
}

.dashboard-hero::after {
  animation: yll-ambient-orbit 12s ease-in-out infinite alternate;
}

.dashboard-panel,
.metric-card,
.apple-metric,
.task-item,
.care-row,
.compact-list > div,
.top-icon-button,
.ghost-button,
.primary,
.mini-button,
.text-button,
.role-chip {
  will-change: transform, box-shadow;
}

.dashboard-panel:hover,
.metric-card:hover,
.apple-metric:hover {
  filter: saturate(1.03);
}

.task-item:hover,
.care-row:hover,
.compact-list > div:hover {
  box-shadow: 0 12px 30px rgba(31, 75, 122, 0.08);
}

.top-icon-button:hover,
.ghost-button:hover:not(:disabled),
.primary:hover:not(:disabled),
.mini-button:hover:not(:disabled),
.text-button:hover:not(:disabled),
.role-chip:hover {
  box-shadow: 0 12px 26px rgba(31, 75, 122, 0.1);
}

@keyframes yll-ambient-orbit {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.92;
  }
  to {
    transform: translate3d(-18px, 20px, 0) scale(1.04);
    opacity: 0.74;
  }
}

@media (max-width: 1400px) {
  .todo-overview-panel .todo-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
  }

  .todo-overview-panel .todo-card {
    min-height: 118px;
    padding: 12px 10px;
  }

  .todo-overview-panel .todo-card strong {
    font-size: clamp(24px, 2vw, 32px);
  }

  .todo-overview-panel .todo-card span,
  .todo-overview-panel .todo-card small {
    font-size: 12px;
  }
}

@media (max-width: 760px) {
  .todo-overview-panel .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Employee archive density polish */
.table-toolbar.employee-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 14px 28px 16px;
}

.employee-search-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr);
  min-width: 0;
}

.table-toolbar.employee-toolbar .employee-search-box {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.employee-filter-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(104px, 1fr)) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.employee-filter-row select,
.employee-filter-row .select-pill {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding-inline: 12px 30px;
}

.employee-toolbar .search-box input {
  width: 100%;
}

.employee-toolbar .selection-count {
  justify-self: end;
  min-width: 58px;
  margin-left: 0;
  text-align: center;
  white-space: nowrap;
}

.employee-special-filter-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 28px 14px;
  padding: 14px 18px;
  border: 1px solid rgba(186, 213, 246, 0.82);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(237, 246, 255, 0.96), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(31, 75, 122, 0.07);
}

.employee-special-filter-notice div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.employee-special-filter-notice span {
  color: var(--muted);
  font-weight: 800;
}

.employee-special-filter-notice strong {
  color: var(--text);
  font-size: 22px;
  letter-spacing: 0;
}

.employee-special-filter-notice small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}

.employee-special-filter-notice button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(188, 211, 240, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--blue);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(31, 75, 122, 0.075);
}

.employee-special-filter-notice button:hover {
  transform: translateY(-1px);
  border-color: rgba(48, 130, 235, 0.44);
}

.employee-table-wrap,
.archive-table-wrap {
  padding: 0 28px 14px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.74), rgba(255, 255, 255, 0.88)),
    rgba(255, 255, 255, 0.6);
}

.employee-table-wrap .employee-table,
.archive-table-wrap .employee-table {
  overflow: hidden;
  border: 1px solid rgba(218, 229, 244, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(31, 75, 122, 0.055);
}

.employee-table th,
.employee-table td {
  padding-inline: 7px;
}

.employee-table th:first-child,
.employee-table td:first-child {
  padding-left: 18px;
}

.employee-table th:last-child,
.employee-table td:last-child {
  padding-right: 18px;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) {
  width: 10.2%;
}

.employee-table th:nth-child(2),
.employee-table td:nth-child(2) {
  width: 11.6%;
}

.employee-table th:nth-child(3),
.employee-table td:nth-child(3) {
  width: 5.5%;
}

.employee-table th:nth-child(4),
.employee-table td:nth-child(4) {
  width: 6.4%;
}

.employee-table th:nth-child(5),
.employee-table td:nth-child(5) {
  width: 5.6%;
}

.employee-table th:nth-child(6),
.employee-table td:nth-child(6) {
  width: 15.5%;
}

.employee-table th:nth-child(7),
.employee-table td:nth-child(7) {
  width: 5.2%;
}

.employee-table th:nth-child(8),
.employee-table td:nth-child(8) {
  width: 5%;
}

.employee-table th:nth-child(9),
.employee-table td:nth-child(9) {
  width: 16.7%;
}

.employee-table th:nth-child(10),
.employee-table td:nth-child(10),
.employee-table .employee-actions-col {
  width: 12.3%;
  min-width: 116px;
  max-width: 132px;
}

.employee-table td:nth-child(6),
.employee-table td:nth-child(9) {
  overflow: visible;
}

.employee-actions {
  max-width: 132px;
  flex-wrap: wrap;
  gap: 5px;
}

.employee-actions .mini-button:not(.text-mini) {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding-inline: 0;
}

.employee-actions .text-mini,
.employee-actions .wide-mini {
  min-width: 50px;
  padding-inline: 7px;
}

@media (max-width: 1320px) {
  .table-toolbar.employee-toolbar {
    padding-inline: 22px;
  }

  .employee-filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  }

  .employee-table-wrap,
  .archive-table-wrap {
    padding-inline: 18px;
  }

  .employee-special-filter-notice {
    margin-inline: 18px;
  }
}

@media (max-width: 980px) {
  .employee-search-row {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .employee-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-toolbar .selection-count {
    justify-self: start;
  }

  .employee-special-filter-notice,
  .employee-special-filter-notice div {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-hero::after,
  .todo-overview-panel .todo-card::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile command surface: keep desktop density, turn small screens into touch-first cards. */
@keyframes mobileSurfaceIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softProgressFlow {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .metric-card,
  .todo-card,
  .apple-card,
  .dashboard-hero,
  .employee-health-card,
  .employee-status-card,
  .payroll-calc-card,
  .backup-card,
  .account-card,
  .report-card {
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  }

  .metric-card:hover,
  .todo-card:hover,
  .apple-card:hover,
  .employee-health-card:hover,
  .employee-status-card:hover,
  .payroll-calc-card:hover,
  .backup-card:hover,
  .account-card:hover,
  .report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 54px rgba(27, 62, 105, 0.11);
  }
}

.contract-progress-fill,
.health-progress-fill,
.progress-fill,
.mini-progress-fill {
  background-size: 180% 100%;
  animation: softProgressFlow 4.8s ease-in-out infinite alternate;
}

@media (max-width: 1180px) {
  .app-shell {
    padding-inline: 18px;
  }

  .workspace {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 18px;
  }

  .topbar.apple-commandbar {
    grid-template-columns: minmax(220px, auto) minmax(260px, 1fr);
  }

  .top-controls {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .app-shell {
    width: 100%;
    padding: 0 10px 24px;
    overflow-x: hidden;
  }

  .topbar.apple-commandbar {
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 -10px 12px;
    padding: 12px;
    border-radius: 0 0 26px 26px;
    background: rgba(249, 251, 255, 0.92);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 14px 34px rgba(32, 70, 115, 0.08);
  }

  .brand-block,
  .brand-block > div {
    min-width: 0;
  }

  .brand-block h1 {
    max-width: 100%;
    font-size: 20px;
    line-height: 1.18;
    white-space: normal;
  }

  .top-search-shell {
    width: 100%;
    max-width: none;
  }

  .top-search-shell .search-box {
    min-height: 48px;
    border-radius: 18px;
  }

  .top-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px 48px;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    transform: none;
  }

  .top-controls .icon-button {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .month-control {
    min-width: 0;
    height: 52px;
    padding: 8px 12px;
    border-radius: 18px;
  }

  .month-control strong {
    font-size: 18px;
    line-height: 1.1;
  }

  .role-control {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 8px 12px;
    border-radius: 18px;
  }

  .role-chip {
    width: 100%;
    min-width: 0;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .side-panel {
    position: relative;
    top: auto;
    width: 100%;
    max-height: none;
    padding: 10px;
    border-radius: 24px;
    overflow: hidden;
    animation: mobileSurfaceIn 280ms ease both;
  }

  .side-panel .nav-section-label,
  .side-panel .nav-health-card,
  .side-panel .system-health-card,
  .side-panel .nav-status-card {
    display: none !important;
  }

  .module-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

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

  .module-nav button,
  .module-nav .module-link {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .module-nav .app-icon {
    width: 18px;
    height: 18px;
  }

  .content-panel,
  #mainView {
    min-width: 0;
  }

  .content-panel {
    border-radius: 24px;
    overflow: hidden;
    animation: mobileSurfaceIn 320ms ease both;
  }

  .dashboard-hero,
  .apple-page-head,
  .panel-header,
  .attendance-apple-head,
  .payroll-calc-hero,
  .security-hero,
  .account-hero,
  .report-hero {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px;
    padding: 18px !important;
    border-radius: 24px;
  }

  .dashboard-hero h2,
  .apple-page-title h2,
  .panel-header h2,
  .attendance-title h2,
  .payroll-calc-hero h2,
  .security-hero h2,
  .account-hero h2,
  .report-hero h2 {
    font-size: 34px !important;
    line-height: 1.08;
    word-break: keep-all;
  }

  .dashboard-hero p,
  .apple-page-title p,
  .panel-header p,
  .attendance-title p,
  .payroll-calc-hero p {
    font-size: 15px;
    line-height: 1.55;
  }

  .apple-head-actions,
  .panel-actions,
  .attendance-head-actions,
  .payroll-calc-actions,
  .security-actions,
  .account-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }

  .apple-head-actions > *,
  .panel-actions > *,
  .attendance-head-actions > *,
  .payroll-calc-actions > *,
  .security-actions > *,
  .account-actions > * {
    width: 100%;
    min-height: 44px;
  }

  .metric-grid,
  .apple-metrics,
  .attendance-stats,
  .employee-health-grid,
  .payroll-calc-kpis,
  .backup-status-grid,
  .account-stats,
  .report-grid,
  .security-action-grid,
  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .todo-overview-panel .todo-grid,
  .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .dashboard-grid,
  .dashboard-side-stack,
  .reports-grid,
  .security-grid,
  .account-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-status-card,
  .payroll-progress-card {
    width: 100%;
  }

  .table-toolbar,
  .employee-toolbar,
  .apple-toolbar,
  .filter-bar,
  .attendance-filter-bar,
  .payroll-calc-toolbar,
  .reports-toolbar,
  .logs-toolbar,
  .security-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .employee-search-row,
  .employee-filter-row,
  .search-row,
  .filter-row {
    grid-template-columns: 1fr !important;
  }

  .employee-toolbar .selection-count {
    justify-self: start;
  }

  .employee-special-filter-notice {
    margin: 0 10px 12px;
  }

  .drawer-panel,
  .confirm-dialog,
  .modal-panel,
  .sheet-panel,
  .score-modal,
  .upload-modal,
  .account-modal {
    width: min(100%, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100svh - 16px) !important;
    border-radius: 24px !important;
  }

  .drawer-body,
  .modal-body,
  .sheet-body,
  .score-modal-body {
    padding-inline: 16px !important;
  }

  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .account-form-grid,
  .permission-grid,
  .drawer-grid {
    grid-template-columns: 1fr !important;
  }

  .drawer-footer,
  .modal-footer,
  .sheet-footer,
  .score-modal-foot {
    gap: 8px;
    padding: 12px 16px !important;
  }

  .drawer-footer .btn,
  .modal-footer .btn,
  .sheet-footer .btn,
  .score-modal-foot .btn {
    flex: 1 1 0;
    min-height: 46px;
  }

  .row-actions,
  .table-actions,
  .employee-actions,
  .action-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .mini-button,
  .btn,
  .icon-button,
  .table-button {
    min-height: 40px;
  }

  .login-card {
    width: min(100%, calc(100vw - 24px));
    border-radius: 26px;
    padding: 24px;
  }
}

@media (max-width: 760px) {
  .table-wrap,
  .apple-table-wrap,
  .employee-table-wrap,
  .archive-table-wrap,
  .attendance-table-wrap,
  .payroll-calc-table-wrap,
  .account-table-wrap,
  .report-table-wrap,
  .logs-table-wrap,
  .security-table-wrap {
    overflow: visible !important;
    padding: 0 10px 14px !important;
    background: transparent !important;
  }

  .table-wrap table,
  .apple-table-wrap table,
  .employee-table-wrap table,
  .archive-table-wrap table,
  .attendance-table-wrap table,
  .payroll-calc-table-wrap table,
  .account-table-wrap table,
  .report-table-wrap table,
  .logs-table-wrap table,
  .security-table-wrap table,
  table.employee-table,
  table.attendance-table,
  table.payroll-calc-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .table-wrap thead,
  .apple-table-wrap thead,
  .employee-table-wrap thead,
  .archive-table-wrap thead,
  .attendance-table-wrap thead,
  .payroll-calc-table-wrap thead,
  .account-table-wrap thead,
  .report-table-wrap thead,
  .logs-table-wrap thead,
  .security-table-wrap thead {
    display: none !important;
  }

  .table-wrap tbody,
  .apple-table-wrap tbody,
  .employee-table-wrap tbody,
  .archive-table-wrap tbody,
  .attendance-table-wrap tbody,
  .payroll-calc-table-wrap tbody,
  .account-table-wrap tbody,
  .report-table-wrap tbody,
  .logs-table-wrap tbody,
  .security-table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .table-wrap tr,
  .apple-table-wrap tr,
  .employee-table-wrap tr,
  .archive-table-wrap tr,
  .attendance-table-wrap tr,
  .payroll-calc-table-wrap tr,
  .account-table-wrap tr,
  .report-table-wrap tr,
  .logs-table-wrap tr,
  .security-table-wrap tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(185, 205, 229, 0.72);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.92));
    box-shadow: 0 16px 34px rgba(34, 76, 122, 0.07);
  }

  .table-wrap td,
  .apple-table-wrap td,
  .employee-table-wrap td,
  .archive-table-wrap td,
  .attendance-table-wrap td,
  .payroll-calc-table-wrap td,
  .account-table-wrap td,
  .report-table-wrap td,
  .logs-table-wrap td,
  .security-table-wrap td {
    display: grid !important;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
  }

  .table-wrap td::before,
  .apple-table-wrap td::before,
  .employee-table-wrap td::before,
  .archive-table-wrap td::before,
  .attendance-table-wrap td::before,
  .payroll-calc-table-wrap td::before,
  .account-table-wrap td::before,
  .report-table-wrap td::before,
  .logs-table-wrap td::before,
  .security-table-wrap td::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
  }

  .table-wrap td:first-child,
  .apple-table-wrap td:first-child,
  .employee-table-wrap td:first-child,
  .archive-table-wrap td:first-child,
  .attendance-table-wrap td:first-child,
  .payroll-calc-table-wrap td:first-child {
    padding-bottom: 4px !important;
  }

  .table-wrap td:first-child::before,
  .apple-table-wrap td:first-child::before,
  .employee-table-wrap td:first-child::before,
  .archive-table-wrap td:first-child::before,
  .attendance-table-wrap td:first-child::before,
  .payroll-calc-table-wrap td:first-child::before {
    content: attr(data-label);
  }

  .table-wrap td[data-label=""],
  .apple-table-wrap td[data-label=""],
  .employee-table-wrap td[data-label=""],
  .archive-table-wrap td[data-label=""],
  .attendance-table-wrap td[data-label=""],
  .payroll-calc-table-wrap td[data-label=""] {
    grid-template-columns: 1fr;
  }

  .table-wrap td[data-label=""]::before,
  .apple-table-wrap td[data-label=""]::before,
  .employee-table-wrap td[data-label=""]::before,
  .archive-table-wrap td[data-label=""]::before,
  .attendance-table-wrap td[data-label=""]::before,
  .payroll-calc-table-wrap td[data-label=""]::before {
    display: none;
  }

  .table-wrap td[colspan],
  .apple-table-wrap td[colspan],
  .employee-table-wrap td[colspan],
  .archive-table-wrap td[colspan],
  .attendance-table-wrap td[colspan],
  .payroll-calc-table-wrap td[colspan] {
    display: block !important;
    text-align: center !important;
  }

  .table-wrap td[colspan]::before,
  .apple-table-wrap td[colspan]::before,
  .employee-table-wrap td[colspan]::before,
  .archive-table-wrap td[colspan]::before,
  .attendance-table-wrap td[colspan]::before,
  .payroll-calc-table-wrap td[colspan]::before {
    display: none;
  }

  .person-cell,
  .org-cell,
  .date-range-cell,
  .health-date-cell,
  .contract-date-cell {
    min-width: 0;
  }

  .employee-actions,
  .table-actions,
  .row-actions {
    display: flex !important;
    grid-column: 1 / -1;
  }

  .employee-actions .mini-button,
  .table-actions .mini-button,
  .row-actions .mini-button {
    flex: 1 1 auto;
  }

  .pagination,
  .table-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 10px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 8px;
  }

  .brand-logo,
  .logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .dashboard-hero h2,
  .apple-page-title h2,
  .panel-header h2,
  .attendance-title h2,
  .payroll-calc-hero h2,
  .security-hero h2,
  .account-hero h2,
  .report-hero h2 {
    font-size: 30px !important;
  }

  .apple-head-actions,
  .panel-actions,
  .attendance-head-actions,
  .payroll-calc-actions,
  .security-actions,
  .account-actions,
  .todo-overview-panel .todo-grid,
  .todo-grid {
    grid-template-columns: 1fr !important;
  }

  .table-wrap td,
  .apple-table-wrap td,
  .employee-table-wrap td,
  .archive-table-wrap td,
  .attendance-table-wrap td,
  .payroll-calc-table-wrap td,
  .account-table-wrap td,
  .report-table-wrap td,
  .logs-table-wrap td,
  .security-table-wrap td {
    grid-template-columns: 1fr;
  }

  .table-wrap td::before,
  .apple-table-wrap td::before,
  .employee-table-wrap td::before,
  .archive-table-wrap td::before,
  .attendance-table-wrap td::before,
  .payroll-calc-table-wrap td::before,
  .account-table-wrap td::before,
  .report-table-wrap td::before,
  .logs-table-wrap td::before,
  .security-table-wrap td::before {
    margin-bottom: -2px;
  }
}

/* Final phone viewport guard: old desktop min-width rules must not leak into mobile. */
@media (max-width: 900px) {
  html,
  body,
  .app-shell,
  .workspace,
  .content-panel,
  #mainView,
  .side-panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body {
    width: 100%;
  }

  .app-shell {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  .workspace {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .content-panel,
  #mainView,
  .dashboard-hero,
  .apple-page-head,
  .attendance-apple-head,
  .payroll-calc-hero,
  .security-hero,
  .account-hero,
  .report-hero {
    width: 100% !important;
  }

  .apple-card,
  .metric-card,
  .dashboard-card,
  .todo-overview-panel,
  .table-wrap,
  .apple-table-wrap,
  .employee-table-wrap,
  .archive-table-wrap,
  .attendance-table-wrap,
  .payroll-calc-table-wrap,
  .account-table-wrap,
  .report-table-wrap,
  .logs-table-wrap,
  .security-table-wrap {
    max-width: 100% !important;
  }
}

@media (max-width: 760px) {
  .apple-table-wrap,
  .table-wrap,
  .employee-table-wrap,
  .archive-table-wrap,
  .attendance-table-wrap,
  .payroll-calc-table-wrap,
  .account-table-wrap,
  .report-table-wrap,
  .logs-table-wrap,
  .security-table-wrap {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: visible !important;
  }

  .apple-table-wrap table,
  .table-wrap table,
  .employee-table-wrap table,
  .archive-table-wrap table,
  .attendance-table-wrap table,
  .payroll-calc-table-wrap table,
  .account-table-wrap table,
  .report-table-wrap table,
  .logs-table-wrap table,
  .security-table-wrap table,
  table,
  .employee-table,
  .payroll-table,
  .payslip-table,
  .attendance-table,
  .attendance-summary-table,
  .attendance-daily-table,
  .attendance-import-table,
  .shifts-table,
  .payroll-calc-table,
  .salary-standard-table,
  .permission-matrix-table,
  .mini-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

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

/* Payroll calculation: compact row actions and usable manual adjustment editor */
.payroll-results-table .payroll-calc-actions-col {
  width: 188px;
  min-width: 188px;
  max-width: 188px;
  white-space: normal;
}

.payroll-result-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  justify-content: stretch;
  min-width: 0;
}

.payroll-result-actions .mini-button.text-mini {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1;
}

.payroll-result-actions .mini-button .app-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.payroll-result-actions .mini-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payroll-adjustment-editor {
  display: grid;
  gap: 18px;
  padding-bottom: 16px;
}

.adjustment-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 14px;
  align-items: end;
}

.adjustment-employee-select,
.adjustment-amount-row label {
  display: grid;
  gap: 8px;
}

.adjustment-impact {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 13px 16px;
  border: 1px solid rgba(36, 120, 242, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.92), rgba(255, 255, 255, 0.96));
}

.adjustment-impact span,
.adjustment-impact small,
.adjustment-section-head span,
.adjustment-employee-card span,
.adjustment-employee-card small {
  color: var(--muted);
}

.adjustment-impact strong {
  color: var(--accent);
  font-size: 22px;
  line-height: 1.05;
}

.adjustment-impact.deduction strong {
  color: #d04444;
}

.adjustment-impact.earning strong {
  color: #168a52;
}

.adjustment-employee-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.adjustment-employee-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.adjustment-employee-card strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.adjustment-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--soft);
}

.adjustment-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
}

.adjustment-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.adjustment-section-head h3 {
  margin: 0;
  font-size: 16px;
}

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

.adjustment-mode-switch label {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 14px 14px 14px 42px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
}

.adjustment-mode-switch label.active {
  border-color: rgba(36, 120, 242, 0.4);
  background: rgba(234, 243, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(36, 120, 242, 0.08);
}

.adjustment-mode-switch label:has(input[value="override"]:checked) {
  border-color: rgba(212, 141, 24, 0.44);
  background: rgba(255, 248, 229, 0.9);
  box-shadow: 0 0 0 4px rgba(212, 141, 24, 0.08);
}

.adjustment-mode-switch label.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.adjustment-mode-switch input {
  position: absolute;
  top: 16px;
  left: 15px;
  width: 18px;
  height: 18px;
}

.adjustment-mode-switch small {
  color: var(--muted);
  line-height: 1.4;
}

.adjustment-mode-notice {
  margin: 0;
}

.adjustment-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.adjustment-preset {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.adjustment-preset strong,
.adjustment-preset small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.adjustment-preset small {
  color: var(--muted);
  line-height: 1.35;
}

.adjustment-preset.active {
  border-color: rgba(36, 120, 242, 0.34);
  background: rgba(234, 243, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(36, 120, 242, 0.08);
}

.adjustment-preset.active.deduction {
  border-color: rgba(208, 68, 68, 0.28);
  background: rgba(255, 242, 242, 0.86);
  box-shadow: 0 0 0 4px rgba(208, 68, 68, 0.08);
}

.adjustment-amount-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 12px;
}

.adjustment-quick-amounts,
.adjustment-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adjustment-quick-amounts button,
.adjustment-reason-chips button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.adjustment-reason-chips button {
  color: var(--muted);
}

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

.adjustment-records-head h4,
.adjustment-records-head small {
  margin: 0;
}

.adjustment-records-head > div {
  display: grid;
  gap: 4px;
}

.payroll-adjustment-records {
  display: grid;
  gap: 10px;
}

.payroll-adjustment-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.payroll-adjustment-record.is-reversed {
  opacity: 0.68;
  background: var(--soft);
}

.payroll-adjustment-record-main,
.payroll-adjustment-record-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.payroll-adjustment-record-main {
  align-items: flex-start;
  flex-direction: column;
}

.payroll-adjustment-effect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.payroll-adjustment-effect-row .positive {
  color: #168a52;
}

.payroll-adjustment-effect-row .negative {
  color: #d04444;
}

.payroll-adjustment-record-actions {
  display: flex;
  align-content: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 210px;
}

.confirm-reason-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  text-align: left;
}

.confirm-reason-field textarea {
  width: 100%;
  resize: vertical;
}

.confirm-payroll-impact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.confirm-payroll-impact > div {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  text-align: left;
}

.confirm-payroll-impact span,
.confirm-payroll-impact small {
  color: var(--muted);
  font-size: 11px;
}

.confirm-payroll-impact .positive {
  color: #168a52;
}

.confirm-payroll-impact .negative {
  color: #d04444;
}

.toast.active.has-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast .toast-action {
  flex: 0 0 auto;
  min-height: 28px;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.payroll-adjustment-history,
.payroll-adjustment-timeline {
  display: grid;
  gap: 12px;
}

.payroll-adjustment-timeline article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.82);
}

.payroll-adjustment-timeline article > span {
  min-width: 44px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(36, 120, 242, 0.1);
  color: var(--accent);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.payroll-adjustment-timeline article > div {
  display: grid;
  gap: 5px;
}

.payroll-adjustment-timeline p,
.payroll-adjustment-timeline time {
  margin: 0;
  color: var(--muted);
}

.payroll-adjustment-timeline time {
  white-space: nowrap;
  font-size: 12px;
}

@media (max-width: 900px) {
  .adjustment-topline,
  .adjustment-employee-card,
  .adjustment-amount-row,
  .payroll-adjustment-record {
    grid-template-columns: 1fr;
  }

  .payroll-adjustment-record-actions {
    justify-content: flex-start;
    max-width: none;
  }

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

  .confirm-payroll-impact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .payroll-results-table .payroll-calc-actions-col {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .payroll-result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 520px) {
  .adjustment-mode-switch,
  .adjustment-preset-grid {
    grid-template-columns: 1fr;
  }

  .payroll-adjustment-timeline article {
    grid-template-columns: 1fr;
  }
}

/* Payroll calculation polish: reliable search, single-row steps, searchable advance settlement */
.payroll-calc-filterbar {
  grid-template-columns: minmax(320px, 1.35fr) minmax(150px, 0.45fr) minmax(150px, 0.45fr) auto auto;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(185, 205, 229, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(34, 76, 122, 0.07);
}

.payroll-search-field {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.payroll-search-field .app-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.payroll-search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 760;
}

.payroll-search-field span {
  min-width: 52px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--accent-quiet);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.payroll-calc-filterbar .select-pill,
.payroll-calc-filterbar .ghost-button {
  min-height: 48px;
  border-radius: 16px;
}

.payroll-calc-stepper {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.payroll-calc-step {
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.9));
}

.payroll-calc-step > span {
  width: 34px;
  height: 34px;
  box-shadow: inset 0 0 0 1px rgba(124, 145, 170, 0.12);
}

.payroll-calc-step > div {
  min-width: 0;
}

.payroll-calc-step strong {
  font-size: 13px;
  line-height: 1.28;
  word-break: keep-all;
}

.payroll-calc-step small {
  min-height: 32px;
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.payroll-calc-step.current {
  border-color: rgba(36, 120, 242, 0.32);
  box-shadow: 0 0 0 3px rgba(36, 120, 242, 0.08), var(--shadow-soft);
}

.payroll-calc-step.current > span {
  background: var(--accent);
  color: #fff;
}

.payroll-calc-step.has-warning {
  border-color: rgba(224, 92, 50, 0.26);
  background: linear-gradient(180deg, rgba(255, 250, 246, 0.98), rgba(255, 255, 255, 0.92));
}

.payroll-calc-step .calc-step-warning {
  display: inline-flex;
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(224, 92, 50, 0.1);
  color: #c2410c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-advance-card {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.2fr);
  align-items: start;
}

.payroll-advance-controls {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto auto;
  align-items: start;
  gap: 12px;
}

.advance-employee-search {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.advance-employee-search label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.advance-search-box {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.advance-search-box .app-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.advance-search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
}

.advance-employee-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(36, 120, 242, 0.16);
  border-radius: 18px;
  background: rgba(240, 247, 255, 0.76);
}

.advance-employee-card strong,
.advance-employee-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advance-employee-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.advance-employee-card dl {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  margin: 0;
}

.advance-employee-card dt,
.advance-employee-card dd {
  margin: 0;
  text-align: right;
}

.advance-employee-card dt {
  color: var(--muted);
  font-size: 11px;
}

.advance-employee-card dd {
  font-size: 12px;
  font-weight: 850;
}

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

.advance-employee-results button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.advance-employee-results button.active {
  border-color: rgba(36, 120, 242, 0.38);
  background: rgba(234, 243, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(36, 120, 242, 0.08);
}

.advance-employee-results strong,
.advance-employee-results span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advance-employee-results span,
.advance-hint,
.advance-empty {
  color: var(--muted);
  font-size: 12px;
}

.advance-hint,
.advance-empty {
  align-self: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--soft);
}

@media (max-width: 1360px) {
  .payroll-calc-stepper {
    grid-template-columns: repeat(8, minmax(126px, 1fr)) !important;
  }

  .payroll-advance-card,
  .payroll-advance-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .payroll-calc-filterbar,
  .payroll-advance-controls,
  .advance-employee-card,
  .advance-employee-results {
    grid-template-columns: 1fr;
  }
}

/* Payroll calculation repair: keep the Apple-style layout contained and readable. */
.payroll-calc-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.payroll-calc-page > * {
  min-width: 0;
  max-width: 100%;
}

.payroll-calc-hero,
.payroll-calc-tabs,
.payroll-calc-stepper,
.payroll-calc-kpis,
.payroll-calc-filterbar,
.payroll-advance-card,
.payroll-dept-grid,
.payroll-calc-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.payroll-calc-stepper {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 10px;
  overflow: visible;
  padding: 0;
}

.payroll-calc-step {
  min-width: 0 !important;
  min-height: 104px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px 12px 11px;
  border: 1px solid rgba(190, 207, 229, 0.72);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.92));
  box-shadow: 0 12px 30px rgba(34, 76, 122, 0.055);
}

.payroll-calc-step > span {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.payroll-calc-step strong {
  max-width: 100%;
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-calc-step small {
  min-height: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.34;
  -webkit-line-clamp: 2;
}

.payroll-calc-step.current {
  border-color: rgba(36, 120, 242, 0.34);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.98), rgba(241, 247, 255, 0.94));
  box-shadow: 0 0 0 3px rgba(36, 120, 242, 0.075), 0 18px 36px rgba(36, 120, 242, 0.08);
}

.payroll-calc-step.has-warning {
  border-color: rgba(230, 112, 70, 0.28);
  background: linear-gradient(180deg, rgba(255, 252, 249, 0.98), rgba(255, 255, 255, 0.92));
}

.payroll-calc-step .calc-step-warning {
  max-width: 100%;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(230, 112, 70, 0.1);
  color: #c74f22;
  font-size: 11px;
  line-height: 1.2;
}

.payroll-calc-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.payroll-calc-filterbar {
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) minmax(132px, 180px) minmax(132px, 180px) minmax(92px, auto) minmax(92px, auto);
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.payroll-search-field {
  min-width: 0;
}

.payroll-search-field input {
  width: 100%;
}

.payroll-calc-filterbar .ghost-button,
.payroll-calc-filterbar .select-pill {
  min-width: 0;
  width: 100%;
}

.payroll-advance-card {
  grid-template-columns: minmax(280px, 0.76fr) minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.88));
}

.payroll-advance-card > div:first-child {
  min-width: 0;
  align-self: center;
}

.payroll-advance-card h3 {
  margin: 4px 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.payroll-advance-card .muted {
  max-width: 620px;
  line-height: 1.65;
}

.payroll-advance-controls {
  min-width: 0;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch;
  gap: 12px;
  justify-content: stretch;
}

.advance-employee-search {
  min-width: 0;
  gap: 10px;
}

.advance-search-box {
  min-width: 0;
  min-height: 52px;
  border-radius: 18px;
}

.advance-search-box input {
  width: 100%;
}

.advance-employee-card {
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  padding: 13px 14px;
  border-radius: 18px;
}

.advance-employee-card dl {
  grid-template-columns: repeat(3, minmax(54px, auto));
}

.advance-employee-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 150px;
  overflow: auto;
  padding: 2px;
}

.advance-employee-results button {
  min-height: 54px;
  border-color: rgba(190, 207, 229, 0.72);
  box-shadow: 0 8px 20px rgba(34, 76, 122, 0.045);
}

.advance-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.advance-action-row .ghost-button,
.advance-action-row .primary {
  min-width: 150px;
  min-height: 48px;
  border-radius: 16px;
}

.payroll-calc-table-wrap {
  overflow-x: auto !important;
  overflow-y: hidden;
}

@media (max-width: 1440px) {
  .payroll-calc-stepper {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .payroll-calc-step {
    min-height: 100px;
    padding: 10px;
  }

  .payroll-calc-step strong {
    font-size: 12px;
  }

  .payroll-calc-step small {
    font-size: 11px;
  }
}

@media (max-width: 1180px) {
  .payroll-calc-stepper {
    overflow-x: auto;
    grid-template-columns: repeat(8, minmax(118px, 1fr)) !important;
    padding-bottom: 8px;
  }

  .payroll-calc-filterbar,
  .payroll-advance-card {
    grid-template-columns: 1fr !important;
  }

  .payroll-calc-kpis,
  .payroll-dept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .payroll-calc-filterbar,
  .advance-employee-card,
  .advance-employee-results,
  .payroll-calc-kpis,
  .payroll-dept-grid {
    grid-template-columns: 1fr !important;
  }

  .payroll-advance-card {
    padding: 20px;
    border-radius: 24px;
  }

  .advance-action-row {
    justify-content: stretch;
  }

  .advance-action-row .ghost-button,
  .advance-action-row .primary {
    flex: 1 1 100%;
  }
}

/* ============================================================
   Cake-aligned attendance and payroll workspaces
   Visual-only overrides: existing actions, fields and data flow stay intact.
   ============================================================ */

.attendance-module,
.payroll-calc-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
  overflow: visible;
}

.attendance-module > *,
.payroll-calc-page > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.attendance-module .attendance-apple-head,
.payroll-calc-page .payroll-calc-hero {
  width: 100%;
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(31, 75, 122, 0.055);
}

.attendance-module .attendance-apple-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.attendance-module .apple-page-title {
  min-width: 0;
  padding: 0;
}

.attendance-module .apple-page-title h2,
.payroll-calc-page .payroll-calc-hero h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: 0;
}

.attendance-module .apple-page-title h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.attendance-module .apple-page-title p:not(.eyebrow),
.payroll-calc-page .payroll-calc-hero p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 540;
  line-height: 1.55;
  letter-spacing: 0;
}

.attendance-module .month-tag,
.attendance-module .breadcrumb-current,
.attendance-module .lock-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
}

.attendance-module .month-tag,
.attendance-module .breadcrumb-current {
  border: 1px solid rgba(36, 120, 242, 0.14);
  background: var(--accent-quiet);
  color: var(--accent-dark);
}

.attendance-module .breadcrumb-sep {
  color: var(--faint);
  font-size: 17px;
  font-weight: 500;
}

.attendance-module .lock-badge {
  gap: 5px;
  border: 1px solid rgba(16, 167, 131, 0.18);
  background: var(--green-soft);
  color: var(--green);
}

.attendance-module .apple-head-actions,
.payroll-calc-page .payroll-calc-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.attendance-module .apple-head-actions {
  justify-content: flex-end;
}

.attendance-module .apple-head-actions > button,
.payroll-calc-page .payroll-calc-actions > button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: none;
}

.attendance-tabs,
.payroll-calc-tabs {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--gray-soft);
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.attendance-tabs::-webkit-scrollbar,
.payroll-calc-tabs::-webkit-scrollbar,
.attendance-stepper::-webkit-scrollbar,
.payroll-calc-stepper::-webkit-scrollbar {
  display: none;
}

.attendance-tab,
.payroll-calc-tabs button {
  min-width: 96px;
  min-height: 34px;
  flex: 1 0 auto;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: none;
}

.attendance-tab:hover,
.payroll-calc-tabs button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.attendance-tab.active,
.payroll-calc-tabs button.active {
  border-color: var(--line);
  background: var(--solid);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(31, 75, 122, 0.08);
}

.attendance-stepper {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow-x: auto;
  box-shadow: none;
}

.attendance-stepper .stepper-item {
  min-width: 132px;
  min-height: 42px;
  display: flex;
  flex: 1 0 132px;
  align-items: center;
  gap: 9px;
}

.attendance-stepper .stepper-num {
  width: 30px;
  height: 30px;
  font-size: 12px;
  font-weight: 780;
}

.attendance-stepper .stepper-meta {
  min-width: 0;
}

.attendance-stepper .stepper-meta strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-stepper .stepper-status {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.attendance-stepper .stepper-chev {
  width: 10px;
  flex: 0 0 10px;
  color: var(--faint);
  font-size: 18px;
  text-align: center;
}

.attendance-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.attendance-stats .stat-card {
  min-width: 0;
  min-height: 102px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  align-items: end;
  gap: 7px 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
  overflow: hidden;
}

.attendance-stats .stat-card-alert {
  border-color: rgba(217, 77, 77, 0.18);
  background: linear-gradient(180deg, var(--panel), var(--red-soft));
}

.attendance-stats .stat-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.attendance-stats .stat-value-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.attendance-stats .stat-value-row strong {
  color: var(--ink);
  font-size: 27px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
}

.attendance-stats .stat-value-row em,
.attendance-stats .stat-sub {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.attendance-stats .stat-sub {
  align-self: end;
  justify-self: end;
  text-align: right;
}

.attendance-summary-view,
.attendance-import-view,
.attendance-daily-view,
.attendance-anomalies-view,
.attendance-leaves-view,
.attendance-shifts-view,
.attendance-holidays-view {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.attendance-filter-bar,
.payroll-calc-filterbar {
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: none;
}

.attendance-filter-bar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(104px, 132px)) auto;
  align-items: center;
  gap: 7px;
  overflow: visible;
}

.attendance-filter-bar .search-box,
.attendance-filter-bar .select-pill,
.attendance-filter-bar .primary,
.payroll-calc-filterbar .payroll-search-field,
.payroll-calc-filterbar .select-pill,
.payroll-calc-filterbar button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 8px;
}

.attendance-filter-bar .primary,
.payroll-calc-filterbar button {
  padding-inline: 12px;
  white-space: nowrap;
}

.reconcile-bar {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 9px 10px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  box-shadow: none;
}

.reconcile-bar .muted {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
}

.reconcile-bar .row-actions,
.reconcile-bar .row-actions button {
  flex: 0 0 auto;
}

.reconcile-bar .row-actions button {
  min-height: 36px;
  border-radius: 8px;
}

.attendance-table-wrap,
.attendance-summary-view .table-wrap,
.payroll-calc-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.payroll-calc-page .payroll-calc-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(400px, auto);
  align-items: end;
  gap: 20px;
}

.payroll-calc-page .payroll-calc-hero > div:first-child {
  min-width: 0;
}

.payroll-calc-page .hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.payroll-calc-page .hero-pills > span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.payroll-calc-page .hero-pills > span:first-child {
  padding: 0;
  border: 0;
  background: transparent;
}

.payroll-calc-page .payroll-calc-actions {
  max-width: 520px;
  justify-content: flex-end;
  align-content: flex-end;
}

.payroll-calc-page .payroll-calc-actions > button {
  flex: 0 0 auto;
  font-size: 12px;
}

.payroll-calc-stepper {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr)) !important;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
  overflow-x: auto;
  overflow-y: hidden;
}

.payroll-calc-stepper .payroll-calc-step {
  min-width: 112px !important;
  min-height: 84px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  grid-template-rows: auto;
  align-content: center;
  align-items: start;
  gap: 8px;
  padding: 11px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.payroll-calc-stepper .payroll-calc-step:last-child {
  border-right: 0;
}

.payroll-calc-stepper .payroll-calc-step.current {
  border-color: var(--line);
  background: var(--accent-quiet);
  box-shadow: inset 0 3px 0 var(--accent);
}

.payroll-calc-stepper .payroll-calc-step.has-warning {
  background: var(--gold-soft);
  box-shadow: inset 0 3px 0 var(--gold);
}

.payroll-calc-stepper .payroll-calc-step > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 760;
}

.payroll-calc-stepper .payroll-calc-step > div {
  min-width: 0;
}

.payroll-calc-stepper .payroll-calc-step strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: 0;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.payroll-calc-stepper .payroll-calc-step small {
  display: -webkit-box;
  min-height: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.payroll-calc-stepper .calc-step-warning {
  max-width: 100%;
  display: block;
  margin-top: 4px;
  padding: 2px 4px;
  overflow: hidden;
  border-radius: 4px;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-calc-kpis {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.payroll-calc-kpis .payroll-calc-kpi {
  min-width: 0;
  min-height: 102px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.payroll-calc-kpis .payroll-calc-kpi::after {
  display: none;
}

.payroll-calc-kpis .payroll-calc-kpi > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.payroll-calc-kpis .payroll-calc-kpi > strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: 0;
}

.payroll-calc-kpis .payroll-calc-kpi > small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.payroll-calc-filterbar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) minmax(120px, 160px) auto auto;
  align-items: center;
  gap: 7px;
}

.payroll-advance-card {
  width: 100%;
  grid-template-columns: minmax(230px, 0.65fr) minmax(0, 1.35fr) !important;
  gap: 20px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.payroll-advance-card h3 {
  margin: 3px 0 6px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0;
}

.payroll-advance-card .muted {
  font-size: 12px;
  line-height: 1.55;
}

.payroll-advance-card .advance-search-box,
.payroll-advance-card .advance-employee-card,
.payroll-advance-card .advance-employee-results button,
.payroll-advance-card .advance-action-row button {
  border-radius: 8px;
  box-shadow: none;
}

.payroll-dept-grid {
  gap: 10px;
}

.payroll-dept-grid > *,
.payroll-calc-empty-card {
  border-radius: 8px;
  box-shadow: none;
}

.attendance-module button:focus-visible,
.attendance-module input:focus-visible,
.attendance-module select:focus-visible,
.payroll-calc-page button:focus-visible,
.payroll-calc-page input:focus-visible,
.payroll-calc-page select:focus-visible {
  outline: 3px solid rgba(36, 120, 242, 0.18);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .payroll-calc-page .payroll-calc-hero {
    grid-template-columns: minmax(280px, 1fr) minmax(340px, auto);
  }

  .payroll-calc-page .payroll-calc-actions {
    max-width: 460px;
  }

  .payroll-calc-stepper {
    grid-template-columns: repeat(8, minmax(112px, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .attendance-module,
  .payroll-calc-page {
    gap: 10px;
    padding: 0 !important;
  }

  .attendance-module .attendance-apple-head,
  .payroll-calc-page .payroll-calc-hero {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    padding: 16px !important;
    border-radius: 10px;
  }

  .attendance-module .apple-page-title h2,
  .payroll-calc-page .payroll-calc-hero h2 {
    font-size: 24px !important;
    line-height: 1.25;
  }

  .attendance-module .apple-page-title p:not(.eyebrow),
  .payroll-calc-page .payroll-calc-hero p:not(.eyebrow) {
    font-size: 13px;
    line-height: 1.5;
  }

  .attendance-module .apple-head-actions,
  .payroll-calc-page .payroll-calc-actions {
    width: 100%;
    max-width: none;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
    justify-content: stretch;
  }

  .attendance-module .apple-head-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .attendance-module .apple-head-actions > button,
  .payroll-calc-page .payroll-calc-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding-inline: 9px;
  }

  .attendance-tabs,
  .payroll-calc-tabs {
    justify-content: flex-start;
  }

  .attendance-tab,
  .payroll-calc-tabs button {
    min-width: 104px;
    flex: 0 0 auto;
  }

  .attendance-stepper .stepper-item {
    min-width: 142px;
    flex: 0 0 142px;
  }

  .attendance-stats,
  .payroll-calc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .attendance-filter-bar,
  .payroll-calc-filterbar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
  }

  .attendance-filter-bar .search-box,
  .payroll-calc-filterbar .payroll-search-field {
    grid-column: 1 / -1;
  }

  .attendance-filter-bar > .primary {
    grid-column: 1 / -1;
  }

  .reconcile-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .reconcile-bar .row-actions,
  .reconcile-bar .row-actions button {
    width: 100%;
  }

  .payroll-advance-card {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    padding: 16px;
    border-radius: 10px;
  }
}

@media (max-width: 520px) {
  .attendance-module .apple-page-title h2 {
    gap: 6px;
  }

  .attendance-module .breadcrumb-sep {
    display: none;
  }

  .attendance-stats .stat-card,
  .payroll-calc-kpis .payroll-calc-kpi {
    min-height: 92px;
  }

  .payroll-calc-page .payroll-calc-actions [data-action="lockPayroll"] {
    grid-column: 1 / -1;
  }
}

/* ============================================================
   2026-07-12 Cake product system
   Unified visual language for every HR surface except /jixiao.
   ============================================================ */

:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --solid: #ffffff;
  --soft: #f8f8fa;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #9a9aa1;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --accent: #087ff5;
  --accent-dark: #0566c8;
  --accent-quiet: #edf6ff;
  --blue: #087ff5;
  --blue-soft: #edf6ff;
  --green: #168a62;
  --green-soft: #edf8f3;
  --gold: #b96f16;
  --gold-soft: #fff7e9;
  --red: #d83a48;
  --red-soft: #fff1f2;
  --cyan: #1d8f9c;
  --cyan-soft: #edf8fa;
  --gray-soft: #f2f2f4;
  --shadow: 0 18px 48px rgba(29, 29, 31, 0.08);
  --shadow-soft: 0 4px 16px rgba(29, 29, 31, 0.045);
  --radius: 8px;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 127, 245, 0.2);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 12px 16px 28px;
  overflow: visible;
}

.topbar.apple-commandbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(240px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 24px rgba(29, 29, 31, 0.055);
  backdrop-filter: blur(22px) saturate(1.2);
}

.brand-block {
  gap: 10px;
}

.brand-block .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: none;
  font-size: 13px;
}

.brand-block .eyebrow {
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-block h1 {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: 0;
}

.top-search-shell {
  width: min(100%, 520px);
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  justify-self: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: none;
}

.top-search-shell input {
  font-size: 13px;
  font-weight: 520;
}

.top-controls {
  min-width: 0;
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 7px;
  padding: 0;
  transform: none;
}

.month-control {
  min-width: 174px;
  width: 174px;
  height: 46px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.month-control label {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  transform: none;
}

.month-control input {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 24px;
  transform: none;
}

.top-icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.top-icon-button:hover,
.role-chip:hover {
  border-color: var(--line-strong);
  background: var(--soft);
  box-shadow: none;
  transform: none;
}

.top-icon-button.has-dot::after {
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--panel);
}

.role-control {
  min-width: 0;
  height: 46px;
}

.role-chip {
  min-width: 196px;
  max-width: 220px;
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.role-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-quiet);
  color: var(--accent-dark);
  font-size: 13px;
}

.role-copy small {
  margin: 0 0 2px;
  font-size: 9px;
}

.role-copy strong {
  max-width: 132px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.15;
}

.workspace {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.side-panel {
  position: sticky;
  top: 84px;
  width: 100%;
  max-height: calc(100vh - 96px);
  align-self: start;
  display: block;
  padding: 9px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: none;
}

.module-nav {
  display: grid;
  gap: 2px;
}

.nav-section-label {
  margin: 8px 9px 4px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: 0;
}

.nav-section-label.system-label {
  margin-top: 10px;
}

.module-nav button,
.module-nav .module-link {
  min-height: 40px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
}

.module-nav button:hover,
.module-nav .module-link:hover {
  border-color: transparent;
  background: var(--soft);
  color: var(--ink);
  transform: none;
}

.module-nav button.active,
.module-nav .module-link.active {
  border-color: rgba(8, 127, 245, 0.12);
  background: var(--accent-quiet);
  color: var(--accent-dark);
  box-shadow: none;
}

.module-nav .app-icon {
  width: 17px;
  height: 17px;
}

.nav-count {
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--gray-soft);
  font-size: 10px;
  font-weight: 700;
}

.module-nav button.active .nav-count,
.module-nav .module-link.active .nav-count {
  background: rgba(8, 127, 245, 0.12);
  color: var(--accent-dark);
}

.nav-health-card {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: none;
}

.nav-health-card strong {
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.nav-health-card i {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 4px rgba(22, 138, 98, 0.1);
}

.nav-health-card p {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.content-panel {
  min-width: 0;
  min-height: calc(100vh - 104px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#mainView {
  min-width: 0;
  overflow: visible;
  border-radius: 0;
}

.apple-module,
.attendance-module,
.payroll-calc-page {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 0;
}

body[data-hr-view="dashboard"] #mainView,
body[data-hr-view="employees"] #mainView {
  display: grid;
  gap: 10px;
}

.apple-page-head,
.panel-header,
.attendance-module .attendance-apple-head,
.payroll-calc-page .payroll-calc-hero {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
}

.apple-page-title,
.panel-header > div:first-child,
.payroll-calc-hero > div:first-child {
  min-width: 0;
}

.apple-page-title h2,
.panel-header h2,
.attendance-module .apple-page-title h2,
.payroll-calc-page .payroll-calc-hero h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: 0;
}

.apple-page-title p:not(.eyebrow),
.panel-header p:not(.eyebrow),
.attendance-module .apple-page-title p:not(.eyebrow),
.payroll-calc-page .payroll-calc-hero p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.apple-page-title .eyebrow,
.panel-header .eyebrow,
.attendance-module .eyebrow,
.payroll-calc-page .eyebrow {
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0;
}

.apple-head-actions,
.panel-actions,
.apple-head-actions,
.attendance-module .apple-head-actions,
.payroll-calc-page .payroll-calc-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.apple-head-actions .primary,
.apple-head-actions .ghost-button,
.panel-actions .primary,
.panel-actions .ghost-button,
.attendance-module .apple-head-actions > button,
.payroll-calc-page .payroll-calc-actions > button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
  white-space: nowrap;
}

.primary,
.ghost-button,
.danger-button,
.mini-button,
.text-button,
.payslip-action,
.status-toggle {
  letter-spacing: 0;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.primary {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.primary:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  box-shadow: none;
  transform: none;
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--soft);
  box-shadow: none;
  transform: none;
}

.text-button {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover:not(:disabled) {
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.apple-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.apple-metric {
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 14px 15px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-top-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.apple-metric.green { border-left-color: var(--green); border-top-color: var(--line); }
.apple-metric.orange { border-left-color: var(--gold); border-top-color: var(--line); }
.apple-metric.red { border-left-color: var(--red); border-top-color: var(--line); background: var(--panel); }
.apple-metric.blue { border-left-color: var(--accent); border-top-color: var(--line); }

.apple-metric::before,
.apple-metric::after {
  display: none;
}

.apple-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.apple-metric strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: 0;
}

.apple-metric small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.apple-data-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.apple-card-head {
  min-height: 64px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.apple-card-head h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.apple-card-head p {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.apple-toolbar {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.apple-search input,
.search-box input,
.advance-search-box input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.apple-search svg {
  left: 12px;
  color: var(--muted);
}

.apple-search input {
  padding-left: 38px;
}

.apple-segmented,
.report-tabs {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--gray-soft);
  white-space: nowrap;
}

.apple-segmented button,
.report-tab {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  box-shadow: none;
}

.apple-segmented button.active,
.report-tab.active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(29, 29, 31, 0.06);
}

.apple-mini-select,
.select-pill,
.table-toolbar select,
.employee-toolbar select,
.payroll-calc-filterbar select {
  min-width: 0;
  min-height: 40px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--panel);
  color: var(--ink);
  font-size: 11px;
  font-weight: 560;
}

.selection-count {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

/* Final component activation. Keep this after every legacy rule. */

body[data-hr-view] .table-wrap,
body[data-hr-view] .apple-table-wrap,
body[data-hr-view] .employee-table-wrap,
body[data-hr-view] .archive-table-wrap,
body[data-hr-view] .attendance-table-wrap,
body[data-hr-view] .payroll-calc-table-wrap,
body[data-hr-view] .report-table-wrap,
body[data-hr-view] .logs-table-wrap {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view] .apple-data-card .apple-table-wrap,
body[data-hr-view] .apple-data-card > .table-wrap {
  border: 0;
  border-radius: 0;
}

body[data-hr-view] table,
body[data-hr-view] .apple-data-table,
body[data-hr-view] .employee-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
}

body[data-hr-view] thead th {
  height: 42px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: nowrap;
}

body[data-hr-view] tbody td {
  min-height: 56px;
  padding: 10px 11px;
  border-bottom: 1px solid #ededf0;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.4;
  vertical-align: middle;
}

body[data-hr-view] tbody tr:last-child td {
  border-bottom: 0;
}

body[data-hr-view] tbody tr:hover td {
  background: #fbfbfc;
}

body[data-hr-view] .person-cell strong,
body[data-hr-view] .org-cell strong,
body[data-hr-view] .apple-person strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

body[data-hr-view] .person-cell span,
body[data-hr-view] .org-cell span,
body[data-hr-view] .apple-person small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

body[data-hr-view] .apple-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-quiet);
  color: var(--accent-dark);
  font-size: 10px;
}

body[data-hr-view] .row-actions,
body[data-hr-view] .table-actions,
body[data-hr-view] .employee-actions,
body[data-hr-view] .payslip-actions,
body[data-hr-view] .payroll-actions {
  gap: 5px;
}

body[data-hr-view] .mini-button,
body[data-hr-view] .payslip-action {
  min-width: 32px;
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

body[data-hr-view] .mini-button.text-mini,
body[data-hr-view] .mini-button.wide-mini {
  width: auto;
  padding: 0 8px;
}

body[data-hr-view] .mini-button.danger,
body[data-hr-view] .payslip-action.danger {
  border-color: rgba(216, 58, 72, 0.18);
  background: var(--red-soft);
  color: var(--red);
}

body[data-hr-view] .empty-state {
  min-height: 170px;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
}

body[data-hr-view="dashboard"] .dashboard-hero,
body[data-hr-view="dashboard"] .todo-hero {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.42fr) !important;
  align-items: stretch;
  gap: 20px;
  margin: 0 !important;
  padding: 22px !important;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--panel) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body[data-hr-view="dashboard"] .dashboard-hero::before,
body[data-hr-view="dashboard"] .dashboard-hero::after {
  display: none !important;
  content: none !important;
}

body[data-hr-view="dashboard"] .dashboard-hero > div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

body[data-hr-view="dashboard"] .dashboard-hero .eyebrow {
  color: var(--accent-dark) !important;
  font-size: 9px;
}

body[data-hr-view="dashboard"] .dashboard-hero h2 {
  margin-top: 5px;
  color: var(--ink) !important;
  font-size: 32px !important;
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: 0;
}

body[data-hr-view="dashboard"] .dashboard-hero p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted) !important;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

body[data-hr-view="dashboard"] .dashboard-hero .hero-pills {
  gap: 6px;
  margin-top: 14px;
}

body[data-hr-view="dashboard"] .dashboard-hero .hero-pills button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--muted) !important;
  font-size: 10px;
  font-weight: 620;
  box-shadow: none;
}

body[data-hr-view="dashboard"] .hero-status-card,
body[data-hr-view="dashboard"] .payroll-progress-card {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 2px 0 2px 20px;
  border: 0 !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body[data-hr-view="dashboard"] .hero-status-card > span,
body[data-hr-view="dashboard"] .hero-status-card > small {
  color: var(--muted) !important;
  font-size: 10px;
}

body[data-hr-view="dashboard"] .hero-status-card > strong {
  color: var(--ink) !important;
  font-size: 30px;
  font-weight: 750;
}

body[data-hr-view="dashboard"] .payroll-progress-meta > div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

body[data-hr-view="dashboard"] .payroll-progress-meta span,
body[data-hr-view="dashboard"] .payroll-progress-meta b {
  color: var(--muted) !important;
  font-size: 9px;
}

body[data-hr-view="dashboard"] .payroll-progress-meta b {
  color: var(--ink) !important;
  font-size: 11px;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button,
body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body[data-hr-view="dashboard"] .dashboard-panel {
  min-width: 0;
  margin: 0 !important;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="dashboard"] .section-heading h3 {
  font-size: 16px;
  font-weight: 700;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
body[data-hr-view="dashboard"] .todo-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 7px;
}

body[data-hr-view="dashboard"] .todo-card,
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card {
  min-width: 0;
  min-height: 94px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--panel) !important;
  color: var(--ink);
  box-shadow: none;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.red { border-left-color: var(--red); }
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.gold { border-left-color: var(--gold); }
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.green { border-left-color: var(--green); }
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.blue { border-left-color: var(--accent); }
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.purple { border-left-color: #7d62b3; }
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.muted { border-left-color: var(--faint); }

body[data-hr-view="dashboard"] .todo-card span {
  color: var(--muted);
  font-size: 10px;
}

body[data-hr-view="dashboard"] .todo-card strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 740;
  line-height: 1;
}

body[data-hr-view="dashboard"] .todo-card small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

body[data-hr-view="dashboard"] .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  align-items: start;
  gap: 10px;
}

body[data-hr-view="dashboard"] .dashboard-side-stack {
  display: grid;
  gap: 10px;
}

body[data-hr-view="dashboard"] .task-item,
body[data-hr-view="dashboard"] .care-row,
body[data-hr-view="dashboard"] .compact-list > div {
  min-width: 0;
  min-height: 54px;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-hr-view="employees"] .employee-health-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.65fr);
  gap: 9px;
  margin: 0;
}

body[data-hr-view="employees"] .employee-health-card,
body[data-hr-view="employees"] .employee-status-card {
  min-width: 0;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="employees"] .employee-health-card h3 {
  font-size: 16px;
  font-weight: 700;
}

body[data-hr-view="employees"] .employee-health-card > strong {
  color: var(--green);
  font-size: 28px;
  font-weight: 740;
}

body[data-hr-view="employees"] .employee-health-card p,
body[data-hr-view="employees"] .employee-status-card p,
body[data-hr-view="employees"] .health-meta span,
body[data-hr-view="employees"] .health-meta b {
  color: var(--muted);
  font-size: 10px;
}

body[data-hr-view="employees"] .table-toolbar.employee-toolbar {
  width: 100%;
  min-height: 0;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  align-items: center;
  gap: 7px !important;
  margin: 0;
  padding: 8px !important;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="employees"] .employee-search-row,
body[data-hr-view="employees"] .employee-filter-row {
  display: contents !important;
}

body[data-hr-view="employees"] .employee-search-box {
  grid-column: span 2;
  width: 100%;
  min-width: 0;
  max-width: none;
}

body[data-hr-view="employees"] .employee-filter-row select,
body[data-hr-view="employees"] .employee-filter-row .selection-count {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

body[data-hr-view="employees"] .employee-special-filter-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(8, 127, 245, 0.16);
  border-radius: 8px;
  background: var(--accent-quiet);
  box-shadow: none;
}

body[data-hr-view="employees"] .employee-table-wrap,
body[data-hr-view="employees"] .archive-table-wrap {
  padding: 0;
  background: var(--panel);
}

body[data-hr-view="employees"] .employee-table-wrap .employee-table,
body[data-hr-view="employees"] .archive-table-wrap .employee-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-hr-view="employees"] .employee-archive-section {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

body[data-hr-view="exceptions"] .apple-grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  gap: 9px;
}

body[data-hr-view="exceptions"] .apple-exception-list,
body[data-hr-view="exceptions"] .exception-list.compact,
body[data-hr-view="exceptions"] .apple-advice-stack {
  display: grid;
  gap: 0;
  padding: 0 15px;
}

body[data-hr-view="exceptions"] .exception-card,
body[data-hr-view="exceptions"] .apple-advice-stack article {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-hr-view="exceptions"] .exception-card:last-child,
body[data-hr-view="exceptions"] .apple-advice-stack article:last-child {
  border-bottom: 0;
}

body[data-hr-view="exceptions"] .exception-card strong,
body[data-hr-view="exceptions"] .apple-advice-stack strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

body[data-hr-view="exceptions"] .exception-card p,
body[data-hr-view="exceptions"] .apple-advice-stack span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

body[data-hr-view="reports"] .report-tabs {
  width: max-content;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
}

body[data-hr-view="reports"] .report-pane {
  min-width: 0;
  display: grid;
  gap: 10px;
}

body[data-hr-view="reports"] .report-hero {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel) !important;
  color: var(--ink) !important;
  box-shadow: none;
}

body[data-hr-view="reports"] .report-hero::before,
body[data-hr-view="reports"] .report-hero::after {
  display: none !important;
  content: none !important;
}

body[data-hr-view="reports"] .report-hero .eyebrow {
  color: var(--accent-dark) !important;
  font-size: 9px;
}

body[data-hr-view="reports"] .report-hero h3 {
  margin-top: 4px;
  color: var(--ink) !important;
  font-size: 22px;
  font-weight: 730;
  letter-spacing: 0;
}

body[data-hr-view="reports"] .report-hero p {
  margin-top: 6px;
  color: var(--muted) !important;
  font-size: 11px;
  line-height: 1.5;
}

body[data-hr-view="reports"] .report-hero-total {
  min-width: 220px;
  padding: 3px 0 3px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: right;
  box-shadow: none;
}

body[data-hr-view="reports"] .report-hero-total span,
body[data-hr-view="reports"] .report-hero-total small {
  color: var(--muted) !important;
  font-size: 10px;
}

body[data-hr-view="reports"] .report-hero-total strong {
  margin: 5px 0;
  color: var(--ink) !important;
  font-size: 24px;
  font-weight: 740;
}

body[data-hr-view="reports"] .report-grid.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

body[data-hr-view="reports"] .report-card {
  min-width: 0;
  min-height: 96px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="reports"] .report-card span,
body[data-hr-view="reports"] .report-card small {
  color: var(--muted);
  font-size: 10px;
}

body[data-hr-view="reports"] .report-card strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 740;
}

body[data-hr-view="reports"] .report-visual-grid,
body[data-hr-view="reports"] .report-visual-grid.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

body[data-hr-view="reports"] .report-visual-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-hr-view="reports"] .report-panel,
body[data-hr-view="reports"] .report-insight {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="reports"] .report-panel-head h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

body[data-hr-view="reports"] .report-panel-head p,
body[data-hr-view="reports"] .report-insight span,
body[data-hr-view="reports"] .report-insight small {
  color: var(--muted);
  font-size: 10px;
}

body[data-hr-view="reports"] .report-insight {
  min-height: 104px;
  border-left: 3px solid var(--accent);
}

body[data-hr-view="reports"] .report-insight.green { border-left-color: var(--green); }
body[data-hr-view="reports"] .report-insight.gold { border-left-color: var(--gold); }
body[data-hr-view="reports"] .report-insight.red { border-left-color: var(--red); }

body[data-hr-view="reports"] .report-insight strong {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

body[data-hr-view="reports"] .bar-track {
  height: 7px;
  border-radius: 4px;
  background: var(--gray-soft);
}

body[data-hr-view="reports"] .bar-fill {
  border-radius: 4px;
  background: var(--accent);
}

body[data-hr-view="importConfig"] .apple-grid.import-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  gap: 9px;
}

body[data-hr-view="importConfig"] .mapping-intro.apple-info {
  margin: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(8, 127, 245, 0.14);
  border-radius: 8px;
  background: var(--accent-quiet);
}

body[data-hr-view="importConfig"] .apple-mapping-grid,
body[data-hr-view="importConfig"] .mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 12px;
}

body[data-hr-view="importConfig"] .apple-mapping-grid label > span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

body[data-hr-view="importConfig"] .apple-mapping-grid input {
  min-height: 40px;
  border-radius: 8px;
  font-size: 11px;
}

body[data-hr-view="importConfig"] .apple-advice-stack,
body[data-hr-view="exceptions"] .apple-advice-stack {
  padding: 0 14px;
}

body[data-hr-view="security"] .settings-grid.apple-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

body[data-hr-view="security"] .settings-card {
  min-width: 0;
  min-height: 185px;
  display: grid;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="security"] .settings-card span,
body[data-hr-view="security"] .settings-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

body[data-hr-view="security"] .settings-card strong {
  margin: 8px 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
}

body[data-hr-view="security"] .settings-card button {
  width: max-content;
  min-height: 36px;
  align-self: end;
  margin-top: 14px;
  padding: 0 10px;
  font-size: 10px;
}

body[data-hr-view="security"] .security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 9px;
}

body[data-hr-view="security"] .backup-status-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

body[data-hr-view="security"] .backup-status-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

body[data-hr-view="security"] .backup-status-card span,
body[data-hr-view="security"] .backup-status-card p {
  color: var(--muted);
  font-size: 10px;
}

body[data-hr-view] .drawer-panel {
  width: min(800px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px 12px 12px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.18);
}

body[data-hr-view] .drawer-header,
body[data-hr-view] .drawer-actions {
  min-height: 62px;
  padding: 12px 18px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
}

body[data-hr-view] .drawer-header h2 {
  font-size: 20px;
  font-weight: 730;
}

body[data-hr-view] #drawerBody {
  padding: 14px 18px 18px;
  overflow-y: auto;
}

body[data-hr-view] .form-grid,
body[data-hr-view] .form-grid-2,
body[data-hr-view] .form-grid-3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

body[data-hr-view] .form-grid label,
body[data-hr-view] .form-section label {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 580;
}

body[data-hr-view] .form-grid label > span,
body[data-hr-view] .form-section label > span {
  display: block;
  margin-bottom: 5px;
}

body[data-hr-view] .form-grid input,
body[data-hr-view] .form-grid select,
body[data-hr-view] .form-section input,
body[data-hr-view] .form-section select,
body[data-hr-view] .form-section textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border-radius: 8px;
  font-size: 12px;
}

body[data-hr-view] .form-section {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-hr-view] .employee-participation-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

body[data-hr-view] .employee-participation-toggle {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

body[data-hr-view] .employee-participation-toggle:has(input:checked) {
  border-color: rgba(8, 127, 245, 0.22);
  background: var(--accent-quiet);
}

body[data-hr-view] .confirm-dialog {
  width: min(430px, calc(100vw - 24px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.18);
}

body[data-hr-view] .toast {
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 13px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #fff;
  font-size: 11px;
}

@media (max-width: 1180px) {
  body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
  body[data-hr-view="dashboard"] .todo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="reports"] .report-visual-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-hr-view] .apple-page-head,
  body[data-hr-view="employees"] .panel-header,
  body[data-hr-view="attendance"] .attendance-apple-head,
  body[data-hr-view="payrollCalculation"] .payroll-calc-hero {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
    padding: 15px !important;
  }

  body[data-hr-view] .apple-head-actions,
  body[data-hr-view="employees"] .panel-actions,
  body[data-hr-view="attendance"] .apple-head-actions,
  body[data-hr-view="payrollCalculation"] .payroll-calc-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  body[data-hr-view] .apple-head-actions > button,
  body[data-hr-view="employees"] .panel-actions > button,
  body[data-hr-view="attendance"] .apple-head-actions > button,
  body[data-hr-view="payrollCalculation"] .payroll-calc-actions > button {
    width: 100%;
    min-width: 0;
  }

  body[data-hr-view] .apple-metrics,
  body[data-hr-view="reports"] .report-grid.report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="dashboard"] .dashboard-hero,
  body[data-hr-view="dashboard"] .todo-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    padding: 17px !important;
  }

  body[data-hr-view="dashboard"] .dashboard-hero h2 {
    font-size: 27px !important;
  }

  body[data-hr-view="dashboard"] .hero-status-card,
  body[data-hr-view="dashboard"] .payroll-progress-card {
    padding: 16px 0 0;
    border-left: 0 !important;
    border-top: 1px solid var(--line) !important;
  }

  body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
  body[data-hr-view="dashboard"] .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="dashboard"] .dashboard-grid,
  body[data-hr-view="employees"] .employee-health-grid,
  body[data-hr-view="exceptions"] .apple-grid.two,
  body[data-hr-view="importConfig"] .apple-grid.import-config-grid,
  body[data-hr-view="security"] .security-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-hr-view="employees"] .table-toolbar.employee-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="employees"] .employee-search-box {
    grid-column: 1 / -1;
  }

  body[data-hr-view="reports"] .report-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-hr-view="reports"] .report-hero-total {
    min-width: 0;
    padding: 13px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  body[data-hr-view="reports"] .report-visual-grid,
  body[data-hr-view="reports"] .report-visual-grid.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-hr-view="security"] .settings-grid.apple-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-hr-view] .drawer-panel {
    width: calc(100vw - 12px);
    max-width: none;
    max-height: calc(100vh - 12px);
    margin: 6px;
  }
}

@media (max-width: 620px) {
  body[data-hr-view] .apple-head-actions,
  body[data-hr-view="employees"] .panel-actions,
  body[data-hr-view="attendance"] .apple-head-actions,
  body[data-hr-view="payrollCalculation"] .payroll-calc-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-hr-view] .form-grid,
  body[data-hr-view] .form-grid-2,
  body[data-hr-view] .form-grid-3,
  body[data-hr-view] .employee-participation-panel,
  body[data-hr-view="importConfig"] .apple-mapping-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-hr-view="employees"] .table-toolbar.employee-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-hr-view="employees"] .employee-search-box,
  body[data-hr-view="employees"] .employee-filter-row > *,
  body[data-hr-view="employees"] .employee-filter-row .selection-count {
    grid-column: 1;
  }
}

@media (max-width: 390px) {
  body[data-hr-view] .apple-metrics,
  body[data-hr-view="reports"] .report-grid.report-kpis {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
  body[data-hr-view="dashboard"] .todo-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 901px) {
  .month-control {
    width: 150px;
    min-width: 150px;
  }

  .top-icon-button {
    width: 42px;
    height: 42px;
  }

  .role-control,
  .role-chip {
    height: 42px;
    min-height: 42px;
  }

  .role-chip {
    min-width: 170px;
    max-width: 180px;
    grid-template-columns: 30px minmax(0, 1fr) 12px;
    padding: 4px 7px;
  }

  .role-avatar {
    width: 30px;
    height: 30px;
  }

  .top-controls {
    gap: 5px;
  }

  .module-nav button,
  .module-nav .module-link {
    min-height: 38px;
  }

  .nav-section-label {
    margin-block: 5px 2px;
  }

  .nav-section-label.system-label {
    margin-top: 7px;
  }

  .nav-health-card {
    margin-top: 6px;
    padding: 8px 9px;
  }

  .nav-health-card p {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

body[data-hr-view] .drawer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body[data-hr-view] #drawerBody {
  min-height: 0;
  height: auto;
  overflow-y: auto;
}

body[data-hr-view] .drawer-panel.shift-rule-shell {
  width: min(1480px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  height: calc(100vh - 28px);
  max-height: calc(100vh - 28px);
  margin: 0;
}

body[data-hr-view] .drawer-panel.shift-rule-shell #drawerBody {
  padding: 0 24px 108px;
}

@media (max-width: 1180px) {
  body[data-hr-view] .drawer-panel.shift-rule-shell {
    width: min(980px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    margin: 0;
  }
}

@media (max-width: 760px) {
  body[data-hr-view] .drawer-panel.shift-rule-shell {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
  }

  body[data-hr-view] .drawer-panel.shift-rule-shell #drawerBody {
    padding: 0 14px 96px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 8px 20px !important;
    overflow-x: hidden !important;
  }

  .topbar.apple-commandbar {
    position: sticky;
    top: 0;
    width: 100% !important;
    min-width: 0;
    min-height: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px;
    margin: 0 !important;
    padding: 9px !important;
    border-radius: 10px;
    overflow: hidden;
  }

  .topbar.apple-commandbar .brand-block,
  .topbar.apple-commandbar .top-search-shell,
  .topbar.apple-commandbar .top-controls {
    width: 100%;
    min-width: 0;
    grid-column: 1;
  }

  .top-search-shell {
    min-height: 42px;
    justify-self: stretch;
  }

  .top-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px 42px !important;
    gap: 6px;
    padding: 0;
    transform: none;
  }

  .month-control,
  .top-icon-button,
  .role-control,
  .role-chip {
    height: 42px;
    min-height: 42px;
  }

  .month-control {
    width: 100% !important;
    min-width: 0 !important;
  }

  .top-icon-button {
    width: 42px;
  }

  .role-control {
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
  }

  .role-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-template-columns: 30px minmax(0, 1fr) 12px;
    padding: 4px 7px;
  }

  .role-avatar {
    width: 30px;
    height: 30px;
  }

  .workspace {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px;
    margin-top: 8px;
  }

  .side-panel {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    padding: 5px;
    overflow: hidden !important;
    border-radius: 10px;
  }

  .module-nav {
    display: flex !important;
    gap: 4px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

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

  .side-panel .nav-section-label,
  .side-panel .nav-health-card {
    display: none !important;
  }

  .module-nav button,
  .module-nav .module-link {
    min-width: max-content;
    min-height: 38px;
    flex: 0 0 auto;
    grid-template-columns: 17px auto;
    padding: 0 10px;
  }

  .module-nav .nav-count {
    display: none;
  }

  .content-panel,
  #mainView {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-hr-view="employees"] .table-toolbar.employee-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="employees"] .employee-search-box {
    grid-column: 1 / -1;
  }

  body[data-hr-view="employees"] .employee-filter-row > *,
  body[data-hr-view="employees"] .employee-filter-row .selection-count {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  body[data-hr-view] .apple-head-actions,
  body[data-hr-view="employees"] .panel-actions,
  body[data-hr-view="attendance"] .apple-head-actions,
  body[data-hr-view="payrollCalculation"] .payroll-calc-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view] .apple-metrics,
  body[data-hr-view="reports"] .report-grid.report-kpis,
  body[data-hr-view="attendance"] .attendance-stats,
  body[data-hr-view="payrollCalculation"] .payroll-calc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
  body[data-hr-view="dashboard"] .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .module-nav button,
  .module-nav .module-link {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }
}

@media (min-width: 360px) and (max-width: 900px) {
  body[data-hr-view="employees"] .table-toolbar.employee-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="employees"] .employee-search-box {
    grid-column: 1 / -1;
  }
}

/* ============================================================
   2026-07-13 Full-width workspace and complete attendance view
   ============================================================ */

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 8px 20px;
}

@media (min-width: 901px) {
  .workspace {
    grid-template-columns: 212px minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
  }

  .side-panel {
    top: 88px;
    max-height: calc(100vh - 96px);
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .topbar.apple-commandbar {
    min-height: 72px;
    grid-template-columns: 196px minmax(160px, 1fr) auto;
    grid-template-rows: 52px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
  }

  .topbar.apple-commandbar .brand-block {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar.apple-commandbar .top-search-shell {
    width: 100%;
    max-width: 520px;
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
  }

  .topbar.apple-commandbar .top-controls {
    width: auto;
    max-width: 100%;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  body[data-hr-view="attendance"] .attendance-filter-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    overflow: visible;
  }

  body[data-hr-view="attendance"] .attendance-filter-bar .search-box {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-column: 1 / -1;
  }

  body[data-hr-view="attendance"] .attendance-filter-bar .select-pill,
  body[data-hr-view="attendance"] .attendance-filter-bar button {
    width: 100%;
    min-width: 0;
  }
}

body[data-hr-view="attendance"] .attendance-summary-view .attendance-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

body[data-hr-view="attendance"] .attendance-summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

body[data-hr-view="attendance"] .attendance-summary-table th,
body[data-hr-view="attendance"] .attendance-summary-table td {
  min-width: 0;
  padding: 10px clamp(8px, 0.65vw, 13px);
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

body[data-hr-view="attendance"] .attendance-summary-table th {
  height: 46px;
  line-height: 1.25;
  white-space: normal;
}

body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(1),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(1) { width: 8%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(2),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(2) { width: 5.5%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(3),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(3) { width: 6.5%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(4),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(4) { width: 8.5%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(5),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(5) { width: 8.5%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(6),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(6) { width: 8.5%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(7),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(7) { width: 13%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(8),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(8) { width: 12%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(9),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(9) { width: 7.5%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(10),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(10) { width: 8%; }
body[data-hr-view="attendance"] .attendance-summary-table th:nth-child(11),
body[data-hr-view="attendance"] .attendance-summary-table td:nth-child(11) { width: 14%; }

body[data-hr-view="attendance"] .attendance-summary-table .person-cell,
body[data-hr-view="attendance"] .attendance-summary-table .date-cell,
body[data-hr-view="attendance"] .attendance-summary-table .summary-org-cell {
  min-width: 0;
}

body[data-hr-view="attendance"] .attendance-summary-table .summary-org-cell,
body[data-hr-view="attendance"] .attendance-summary-table .date-cell {
  display: grid;
  gap: 3px;
}

body[data-hr-view="attendance"] .attendance-summary-table .summary-org-cell strong,
body[data-hr-view="attendance"] .attendance-summary-table .summary-org-cell span,
body[data-hr-view="attendance"] .attendance-summary-table .date-cell span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-hr-view="attendance"] .attendance-summary-table .summary-org-cell strong {
  color: var(--ink);
  font-weight: 680;
}

body[data-hr-view="attendance"] .attendance-summary-table .summary-org-cell span {
  color: var(--muted);
  font-size: 10px;
}

body[data-hr-view="attendance"] .summary-metric-stack {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 3px;
}

body[data-hr-view="attendance"] .summary-metric-stack > span {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(38px, 1fr) auto auto;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

body[data-hr-view="attendance"] .summary-metric-stack small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-hr-view="attendance"] .summary-metric-stack strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
}

body[data-hr-view="attendance"] .summary-metric-stack em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

body[data-hr-view="attendance"] .summary-status-stack {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 5px;
}

body[data-hr-view="attendance"] .summary-status-stack .pill {
  max-width: 100%;
  min-height: 22px;
  padding: 0 7px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-hr-view="attendance"] .summary-status-stack .app-icon {
  width: 12px;
  height: 12px;
}

body[data-hr-view="attendance"] .attendance-summary-table .actions-col {
  width: auto;
  min-width: 0;
  overflow: visible;
}

body[data-hr-view="attendance"] .summary-action-buttons {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

body[data-hr-view="attendance"] .attendance-summary-table .summary-action-buttons .attendance-action-button {
  width: auto !important;
  min-width: 0 !important;
  max-width: 46px;
  height: 44px;
  min-height: 44px;
  flex: 1 1 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 2px !important;
  border-radius: 7px;
}

body[data-hr-view="attendance"] .summary-action-buttons .attendance-action-button .app-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

body[data-hr-view="attendance"] .summary-action-buttons .attendance-action-label {
  display: block;
  color: currentColor;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

body[data-hr-view="attendance"] .summary-action-buttons .mini-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body[data-hr-view="attendance"] .summary-action-buttons .mini-button:disabled {
  opacity: 0.48;
}

body[data-hr-view="reports"] .report-table-wrap {
  width: 100%;
  margin: 0;
}

body[data-hr-view="security"] .backup-history-panel .attendance-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

body[data-hr-view="security"] .backup-history-panel .attendance-table th,
body[data-hr-view="security"] .backup-history-panel .attendance-table td {
  padding: 8px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-hr-view="security"] .backup-history-panel .attendance-table th:nth-child(1),
body[data-hr-view="security"] .backup-history-panel .attendance-table td:nth-child(1) { width: 20%; }
body[data-hr-view="security"] .backup-history-panel .attendance-table th:nth-child(2),
body[data-hr-view="security"] .backup-history-panel .attendance-table td:nth-child(2) { width: 30%; }
body[data-hr-view="security"] .backup-history-panel .attendance-table th:nth-child(3),
body[data-hr-view="security"] .backup-history-panel .attendance-table td:nth-child(3) { width: 20%; }
body[data-hr-view="security"] .backup-history-panel .attendance-table th:nth-child(4),
body[data-hr-view="security"] .backup-history-panel .attendance-table td:nth-child(4) { width: 12%; }
body[data-hr-view="security"] .backup-history-panel .attendance-table th:nth-child(5),
body[data-hr-view="security"] .backup-history-panel .attendance-table td:nth-child(5) { width: 18%; }

body[data-hr-view="security"] .backup-history-panel .row-actions {
  flex-wrap: nowrap;
  gap: 4px;
}

body[data-hr-view="security"] .backup-history-panel .row-actions .mini-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
}

@media (min-width: 761px) and (max-width: 1240px) {
  body[data-hr-view="attendance"] .attendance-summary-view .attendance-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body[data-hr-view="attendance"] .attendance-summary-table,
  body[data-hr-view="attendance"] .attendance-summary-table tbody {
    display: block;
    width: 100%;
  }

  body[data-hr-view="attendance"] .attendance-summary-table thead {
    display: none;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody tr {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody tr:has(td[colspan]) {
    grid-column: 1 / -1;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody td {
    width: 100% !important;
    min-width: 0;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0;
    overflow: visible;
    border: 0;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 620;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody td[colspan] {
    grid-column: 1 / -1;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody td[colspan] {
    display: block;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody td[colspan]::before {
    display: none;
  }

  body[data-hr-view="attendance"] .attendance-summary-table .summary-action-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: flex-start;
  }

  body[data-hr-view="attendance"] .attendance-summary-table tbody td.actions-col {
    grid-column: 1 / -1;
  }

  body[data-hr-view="attendance"] .attendance-summary-table .summary-action-buttons .attendance-action-button {
    width: 100% !important;
    max-width: none;
    flex-direction: row;
    gap: 5px;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  body[data-hr-view="attendance"] .attendance-summary-table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-hr-view="attendance"] .attendance-summary-table tbody td {
    overflow: visible;
  }

  body[data-hr-view="attendance"] .attendance-summary-table .summary-action-buttons {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: auto;
    justify-content: flex-start;
  }

  body[data-hr-view="attendance"] .attendance-summary-table .summary-action-buttons .attendance-action-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none;
    height: 40px;
    min-height: 40px;
    flex: none !important;
    flex-direction: row;
    gap: 6px;
  }
}

/* Final responsive guards: keep late legacy table rules from reopening overflow. */
body[data-hr-view="payrollCalculation"] .payroll-calc-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: clip !important;
}

body[data-hr-view="attendance"] .shift-card-grid {
  align-items: start;
}

body[data-hr-view="attendance"] .shift-group-card {
  align-self: start;
}

body[data-hr-view="attendance"] [data-attendance-results] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body[data-hr-view="attendance"] [data-attendance-results] > .attendance-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

body[data-hr-view="attendance"] .attendance-filter-bar {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  display: grid !important;
  grid-template-columns: minmax(230px, 1fr) repeat(4, minmax(104px, 0.38fr)) auto;
  align-items: center;
  gap: 8px;
}

body[data-hr-view="attendance"] .attendance-filter-bar > *,
body[data-hr-view="attendance"] .attendance-filter-bar .search-box,
body[data-hr-view="attendance"] .attendance-filter-bar select {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
}

body[data-hr-view="attendance"] .attendance-filter-bar > button {
  width: auto;
  white-space: nowrap;
}

body[data-hr-view="payslips"] .payslip-actions > .payslip-action,
body[data-hr-view="payroll"] .payroll-actions > .payslip-action {
  width: auto !important;
  min-width: 50px !important;
  height: 42px !important;
  min-height: 42px !important;
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 7px !important;
}

body[data-hr-view="payslips"] .payslip-actions > .payslip-action span,
body[data-hr-view="payroll"] .payroll-actions > .payslip-action span {
  display: block !important;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

body[data-hr-view="payslips"] .payslip-table th:last-child,
body[data-hr-view="payslips"] .payslip-table td:last-child {
  width: 220px;
}

body[data-hr-view="payrollCalculation"] .payroll-results-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

body[data-hr-view="payrollCalculation"] .payroll-results-table th,
body[data-hr-view="payrollCalculation"] .payroll-results-table td {
  min-width: 0 !important;
  padding: 9px 6px;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 760px) {
  body[data-hr-view="attendance"] .attendance-apple-head {
    min-height: 72px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 38px !important;
    align-items: center;
    gap: 8px !important;
    padding: 9px 10px !important;
  }

  body[data-hr-view="attendance"] .attendance-apple-head .apple-page-title {
    min-width: 0;
  }

  body[data-hr-view="attendance"] .attendance-apple-head h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 20px !important;
  }

  body[data-hr-view="attendance"] .attendance-apple-head .apple-head-actions,
  body[data-hr-view="attendance"] .attendance-apple-head .apple-head-actions button {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
  }

  body[data-hr-view="attendance"] .attendance-apple-head .apple-head-actions button span {
    display: none !important;
  }

  body[data-hr-view="attendance"] .attendance-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="attendance"] .attendance-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="attendance"] .attendance-stats .stat-card {
    min-height: 70px !important;
    padding: 7px !important;
  }

  body[data-hr-view="attendance"] .attendance-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="attendance"] .attendance-filter-bar .search-box,
  body[data-hr-view="attendance"] .attendance-filter-bar > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-hr-view="payslips"] .payslip-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-hr-view="payslips"] .payslip-actions > .payslip-action,
  body[data-hr-view="payslips"] .payslip-actions > .row-action-menu {
    width: 100% !important;
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-tabs {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 4px !important;
    overflow: visible !important;
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-tabs button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 34px;
    padding: 4px 3px !important;
    font-size: 10px !important;
    line-height: 1.2;
    white-space: normal !important;
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-stepper {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1px !important;
    overflow: hidden !important;
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-stepper .payroll-calc-step {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 64px !important;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
    align-items: start;
    gap: 4px !important;
    padding: 8px 5px !important;
    border-bottom: 1px solid var(--line);
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-stepper .payroll-calc-step > span {
    width: 22px !important;
    height: 22px !important;
    font-size: 9px !important;
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-stepper .payroll-calc-step > div {
    min-width: 0;
  }

  body[data-hr-view="payrollCalculation"] .payroll-calc-stepper .payroll-calc-step strong,
  body[data-hr-view="payrollCalculation"] .payroll-calc-stepper .payroll-calc-step small {
    width: 100%;
    display: block;
    overflow: hidden;
    font-size: 8px !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  body[data-hr-view="attendance"] .attendance-stepper {
    width: 100%;
    min-width: 0;
    min-height: 70px;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: start;
    gap: 3px !important;
    padding: 8px 5px !important;
    overflow: hidden !important;
  }

  body[data-hr-view="attendance"] .attendance-stepper .stepper-chev {
    display: none !important;
  }

  body[data-hr-view="attendance"] .attendance-stepper .stepper-item {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 24px auto;
    justify-items: center;
    align-content: start;
    gap: 4px !important;
    padding: 0 1px !important;
    text-align: center;
  }

  body[data-hr-view="attendance"] .attendance-stepper .stepper-num {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    font-size: 10px !important;
  }

  body[data-hr-view="attendance"] .attendance-stepper .stepper-meta {
    width: 100%;
    min-width: 0;
    display: block !important;
  }

  body[data-hr-view="attendance"] .attendance-stepper .stepper-meta strong {
    width: 100%;
    display: block !important;
    overflow: hidden;
    font-size: 8px !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  body[data-hr-view="attendance"] .attendance-stepper .stepper-status {
    display: none !important;
  }

  body[data-hr-view="attendance"] .holiday-table-wrap {
    overflow: visible !important;
  }

  body[data-hr-view="attendance"] .holiday-table,
  body[data-hr-view="attendance"] .holiday-table tbody {
    width: 100% !important;
    display: block !important;
  }

  body[data-hr-view="attendance"] .holiday-table thead {
    display: none !important;
  }

  body[data-hr-view="attendance"] .holiday-table tbody {
    display: grid !important;
    gap: 7px;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 7px 12px !important;
    padding: 11px 12px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: var(--panel) !important;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 0 !important;
    border: 0 !important;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td::before {
    display: none !important;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td:nth-child(1),
  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td:nth-child(2) {
    flex-wrap: wrap;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td:nth-child(3) {
    justify-self: end;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    color: var(--ink);
    font-weight: 750;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td:nth-child(5) {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 10px;
  }

  body[data-hr-view="attendance"] .holiday-table tbody tr:not(.holiday-month-row) > td.actions-col {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 4px !important;
    border-top: 1px solid var(--line) !important;
  }

  body[data-hr-view="attendance"] .holiday-month-row {
    display: block !important;
    border: 0 !important;
    background: transparent !important;
  }

  body[data-hr-view="attendance"] .holiday-month-row td {
    min-height: 30px !important;
    display: flex !important;
    align-items: center;
    padding: 5px 8px !important;
    border: 0 !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: 0 !important;
  }
}

/* ============================================================
   2026-07-14 Dashboard performance-inspired visual pass
   Visual-only overrides: dashboard structure and behavior stay intact.
   ============================================================ */

body[data-hr-view="dashboard"] {
  --dashboard-canvas: #eaf3ff;
  --dashboard-surface: #fbfdff;
  --dashboard-surface-strong: #ffffff;
  --dashboard-surface-soft: #f2f7fd;
  --dashboard-line: #c9dcef;
  --dashboard-line-strong: #afc9e4;
  --dashboard-ink: #0d2847;
  --dashboard-muted: #61768e;
  --dashboard-faint: #8496aa;
  --dashboard-blue: #1676ed;
  --dashboard-navy: #123f73;
  --dashboard-cyan: #0f9fb1;
  --dashboard-green: #11966f;
  --dashboard-gold: #cf8714;
  --dashboard-red: #d84f60;
  --dashboard-violet: #735fd2;
  --dashboard-shadow: 0 1px 2px rgba(22, 62, 105, 0.04), 0 14px 34px rgba(22, 62, 105, 0.09);
  --dashboard-shadow-raised: 0 2px 5px rgba(22, 62, 105, 0.05), 0 18px 40px rgba(22, 62, 105, 0.13);
  background: var(--dashboard-canvas);
  color: var(--dashboard-ink);
}

body[data-hr-view="dashboard"] .app-shell {
  width: 100%;
  max-width: none;
  padding: 12px 14px 28px;
}

body[data-hr-view="dashboard"] .topbar.apple-commandbar {
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #f9fcff;
  box-shadow: 0 10px 28px rgba(30, 78, 128, 0.09);
  backdrop-filter: none;
}

body[data-hr-view="dashboard"] .brand-block .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--dashboard-blue);
  color: #ffffff;
  box-shadow: 0 7px 18px rgba(22, 118, 237, 0.25);
}

body[data-hr-view="dashboard"] .brand-block .eyebrow {
  color: #647c95;
  font-size: 8px;
  font-weight: 760;
}

body[data-hr-view="dashboard"] .brand-block h1 {
  color: var(--dashboard-ink);
  font-size: 18px;
  font-weight: 760;
}

body[data-hr-view="dashboard"] .top-search-shell {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #edf4fb;
  box-shadow: 0 0 0 1px rgba(76, 119, 161, 0.04) inset;
}

body[data-hr-view="dashboard"] .top-search-shell input {
  color: var(--dashboard-ink);
}

body[data-hr-view="dashboard"] .top-search-shell:focus-within {
  border-color: rgba(22, 118, 237, 0.35);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(22, 118, 237, 0.12);
}

body[data-hr-view="dashboard"] .month-control,
body[data-hr-view="dashboard"] .top-icon-button,
body[data-hr-view="dashboard"] .role-chip {
  border-color: var(--dashboard-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 62, 105, 0.045);
}

body[data-hr-view="dashboard"] .month-control:hover,
body[data-hr-view="dashboard"] .top-icon-button:hover,
body[data-hr-view="dashboard"] .role-chip:hover {
  border-color: var(--dashboard-line-strong);
  background: #f6faff;
}

body[data-hr-view="dashboard"] .role-avatar {
  background: #e6f1ff;
  color: #0a68d7;
}

body[data-hr-view="dashboard"] .workspace {
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

body[data-hr-view="dashboard"] .side-panel {
  top: 96px;
  padding: 9px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #f9fcff;
  box-shadow: 0 10px 28px rgba(30, 78, 128, 0.075);
  backdrop-filter: none;
}

body[data-hr-view="dashboard"] .nav-section-label {
  color: #8295aa;
}

body[data-hr-view="dashboard"] .module-nav button,
body[data-hr-view="dashboard"] .module-nav .module-link {
  min-height: 40px;
  border-radius: 7px;
  color: #5f748a;
  font-weight: 650;
}

body[data-hr-view="dashboard"] .module-nav button svg,
body[data-hr-view="dashboard"] .module-nav .module-link svg {
  color: #7f94aa;
}

body[data-hr-view="dashboard"] .module-nav button:hover,
body[data-hr-view="dashboard"] .module-nav .module-link:hover {
  background: #eef5fc;
  color: var(--dashboard-ink);
}

body[data-hr-view="dashboard"] .module-nav button.active,
body[data-hr-view="dashboard"] .module-nav .module-link.active {
  border-color: #b8d6f6;
  background: #e0efff;
  color: #0868d8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

body[data-hr-view="dashboard"] .module-nav button.active svg,
body[data-hr-view="dashboard"] .module-nav .module-link.active svg {
  color: #0871e8;
}

body[data-hr-view="dashboard"] .nav-health-card {
  border-color: #b9e2d5;
  background: #edf9f5;
  color: #176c55;
}

body[data-hr-view="dashboard"] #mainView {
  gap: 13px;
}

body[data-hr-view="dashboard"] .dashboard-hero,
body[data-hr-view="dashboard"] .todo-hero {
  min-height: 274px;
  grid-template-columns: minmax(0, 1fr) minmax(326px, 0.42fr) !important;
  gap: 30px;
  padding: 30px !important;
  border: 1px solid #aac9e8 !important;
  border-radius: 8px !important;
  background: #dcecff !important;
  color: var(--dashboard-ink) !important;
  box-shadow: 0 16px 38px rgba(31, 83, 137, 0.15) !important;
  backdrop-filter: none;
}

body[data-hr-view="dashboard"] .dashboard-hero .eyebrow {
  color: #0870dc !important;
  font-size: 9px;
  font-weight: 800;
}

body[data-hr-view="dashboard"] .dashboard-hero h2 {
  max-width: 100%;
  margin-top: 8px;
  color: var(--dashboard-ink) !important;
  font-size: 37px !important;
  font-weight: 780;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

body[data-hr-view="dashboard"] .dashboard-hero p {
  max-width: 790px;
  margin-top: 12px;
  color: #4d6882 !important;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.72;
}

body[data-hr-view="dashboard"] .dashboard-hero .hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

body[data-hr-view="dashboard"] .dashboard-hero .hero-pills button {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid #b4d0ed;
  border-radius: 7px;
  background: #f8fbff;
  color: #285377 !important;
  font-size: 10px;
  font-weight: 680;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body[data-hr-view="dashboard"] .dashboard-hero .hero-pills button:hover {
  border-color: var(--dashboard-navy);
  background: var(--dashboard-navy);
  color: #ffffff !important;
  transform: translateY(-1px);
}

body[data-hr-view="dashboard"] .hero-status-card,
body[data-hr-view="dashboard"] .payroll-progress-card {
  align-content: center;
  gap: 9px;
  padding: 8px 0 8px 30px;
  border-left-color: #abc9e6 !important;
  color: var(--dashboard-ink) !important;
}

body[data-hr-view="dashboard"] .hero-status-card > span {
  color: #58748f !important;
  font-size: 10px;
  font-weight: 700;
}

body[data-hr-view="dashboard"] .hero-status-card > strong {
  color: var(--dashboard-ink) !important;
  font-size: 40px;
  font-weight: 790;
  line-height: 1;
}

body[data-hr-view="dashboard"] .hero-status-card > small {
  color: #647f98 !important;
  font-size: 10px;
}

body[data-hr-view="dashboard"] .hero-status-card .progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 7px;
  background: #bcd4ea;
}

body[data-hr-view="dashboard"] .hero-status-card .progress-fill {
  border-radius: 7px;
  background: #10a98f;
  box-shadow: none;
}

body[data-hr-view="dashboard"] .payroll-progress-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 4px;
  border-top: 1px solid #abc8e4;
  border-bottom: 1px solid #abc8e4;
}

body[data-hr-view="dashboard"] .payroll-progress-meta > div {
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid #abc8e4;
  border-radius: 0;
  background: transparent;
}

body[data-hr-view="dashboard"] .payroll-progress-meta > div:first-child {
  padding-left: 0;
}

body[data-hr-view="dashboard"] .payroll-progress-meta > div:last-child {
  padding-right: 0;
  border-right: 0;
}

body[data-hr-view="dashboard"] .payroll-progress-meta span {
  color: #657f97 !important;
}

body[data-hr-view="dashboard"] .payroll-progress-meta b {
  color: var(--dashboard-ink) !important;
  font-size: 12px;
  font-weight: 720;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 3px;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button,
body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border-color: #a9c8e6;
  border-radius: 8px;
  background: #ffffff;
  color: #123f73;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 7px 16px rgba(31, 83, 137, 0.12);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button {
  border-color: #2184ee;
  background: #2184ee;
  color: #ffffff;
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button:hover {
  border-color: #86b3df;
  background: #eef7ff;
  transform: translateY(-1px);
}

body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button:hover {
  border-color: #3bc9bd;
  background: #3bc9bd;
  color: #083f5b;
  transform: translateY(-1px);
}

body[data-hr-view="dashboard"] .dashboard-panel {
  padding: 19px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: var(--dashboard-surface);
  box-shadow: var(--dashboard-shadow);
  backdrop-filter: none;
}

body[data-hr-view="dashboard"] .dashboard-panel:hover {
  border-color: var(--dashboard-line-strong);
  box-shadow: var(--dashboard-shadow-raised);
}

body[data-hr-view="dashboard"] .section-heading {
  min-height: 38px;
  align-items: center;
  margin-bottom: 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dashboard-line);
}

body[data-hr-view="dashboard"] .section-heading h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--dashboard-ink);
  font-size: 17px;
  font-weight: 750;
}

body[data-hr-view="dashboard"] .section-heading h3::before {
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--dashboard-blue);
  content: "";
  flex: none;
}

body[data-hr-view="dashboard"] .section-heading .text-button {
  min-height: 28px;
  color: #096cd9;
  font-size: 11px;
  font-weight: 680;
}

body[data-hr-view="dashboard"] .todo-overview-panel {
  border-top: 4px solid var(--dashboard-blue);
  background: #f7fbff;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
body[data-hr-view="dashboard"] .todo-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 8px;
}

body[data-hr-view="dashboard"] .todo-card,
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card {
  min-height: 108px;
  gap: 7px;
  padding: 14px 13px;
  border: 1px solid var(--dashboard-line);
  border-left-width: 4px;
  border-top-width: 1px;
  border-radius: 8px;
  background: #f2f7fd !important;
  box-shadow: 0 3px 10px rgba(22, 62, 105, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body[data-hr-view="dashboard"] .todo-card:hover,
body[data-hr-view="dashboard"] .todo-overview-panel .todo-card:hover {
  border-color: var(--dashboard-line-strong);
  box-shadow: 0 10px 22px rgba(22, 62, 105, 0.1);
  transform: translateY(-2px);
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.red {
  border-left-color: var(--dashboard-red);
  background: #fff1f3 !important;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.gold {
  border-left-color: var(--dashboard-gold);
  background: #fff7e6 !important;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.green {
  border-left-color: var(--dashboard-green);
  background: #edf9f5 !important;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.blue {
  border-left-color: var(--dashboard-blue);
  background: #edf5ff !important;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.purple {
  border-left-color: var(--dashboard-violet);
  background: #f4f0ff !important;
}

body[data-hr-view="dashboard"] .todo-overview-panel .todo-card.muted {
  border-left-color: #8493a3;
  background: #f1f4f7 !important;
}

body[data-hr-view="dashboard"] .todo-card span {
  color: #536b83;
  font-size: 10px;
  font-weight: 680;
}

body[data-hr-view="dashboard"] .todo-card strong {
  color: var(--dashboard-ink);
  font-size: 28px;
  font-weight: 780;
  line-height: 1;
}

body[data-hr-view="dashboard"] .todo-card small {
  color: #73879b;
  font-size: 9px;
  line-height: 1.45;
}

body[data-hr-view="dashboard"] .dashboard-grid {
  grid-template-columns: minmax(0, 1.36fr) minmax(306px, 0.64fr);
  gap: 13px;
}

body[data-hr-view="dashboard"] .dashboard-side-stack {
  gap: 13px;
}

body[data-hr-view="dashboard"] .dashboard-grid > .dashboard-panel {
  border-top: 4px solid #26a3b3;
}

body[data-hr-view="dashboard"] .dashboard-side-stack > .dashboard-panel:nth-child(1) {
  border-top: 4px solid var(--dashboard-violet);
  background: #faf8ff;
}

body[data-hr-view="dashboard"] .dashboard-side-stack > .dashboard-panel:nth-child(2) {
  border-top: 4px solid var(--dashboard-green);
  background: #f4fbf8;
}

body[data-hr-view="dashboard"] .dashboard-side-stack > .dashboard-panel:nth-child(3) {
  border-top: 4px solid var(--dashboard-blue);
  background: #f4f8fe;
}

body[data-hr-view="dashboard"] .dashboard-side-stack > .dashboard-panel:nth-child(1) .section-heading h3::before {
  background: var(--dashboard-violet);
}

body[data-hr-view="dashboard"] .dashboard-side-stack > .dashboard-panel:nth-child(2) .section-heading h3::before {
  background: var(--dashboard-green);
}

body[data-hr-view="dashboard"] .task-list,
body[data-hr-view="dashboard"] .care-list,
body[data-hr-view="dashboard"] .compact-list {
  border-radius: 0;
  background: transparent;
}

body[data-hr-view="dashboard"] .task-item,
body[data-hr-view="dashboard"] .care-row,
body[data-hr-view="dashboard"] .compact-list > div {
  min-height: 59px;
  padding: 10px 5px;
  border-bottom-color: var(--dashboard-line);
  transition: background-color 140ms ease;
}

body[data-hr-view="dashboard"] .task-item:hover,
body[data-hr-view="dashboard"] .care-row:hover,
body[data-hr-view="dashboard"] .compact-list > div:hover {
  background: rgba(218, 233, 248, 0.44);
  transform: none;
}

body[data-hr-view="dashboard"] .task-item strong,
body[data-hr-view="dashboard"] .care-row strong,
body[data-hr-view="dashboard"] .compact-list strong {
  color: var(--dashboard-ink);
  font-weight: 700;
}

body[data-hr-view="dashboard"] .task-item small,
body[data-hr-view="dashboard"] .care-row small,
body[data-hr-view="dashboard"] .compact-list span {
  color: var(--dashboard-muted);
}

body[data-hr-view="dashboard"] .task-item .mini-button {
  width: 35px;
  height: 35px;
  border-color: var(--dashboard-line);
  border-radius: 8px;
  background: #ffffff;
  color: #0c70df;
  box-shadow: 0 3px 9px rgba(22, 62, 105, 0.06);
}

body[data-hr-view="dashboard"] .task-item .mini-button:hover {
  border-color: #8ebcea;
  background: #eaf4ff;
}

body[data-hr-view="dashboard"] .care-icon {
  border-radius: 8px;
  background: #ece7ff;
  color: #654fc6;
}

body[data-hr-view="dashboard"] .empty-state {
  min-height: 112px;
  border-color: var(--dashboard-line);
  border-radius: 8px;
  background: #eef5fc;
  color: var(--dashboard-muted);
}

@media (max-width: 900px) {
  body[data-hr-view="dashboard"] .app-shell {
    padding: 8px 8px 20px !important;
  }

  body[data-hr-view="dashboard"] .topbar.apple-commandbar,
  body[data-hr-view="dashboard"] .side-panel {
    border-radius: 8px;
  }

  body[data-hr-view="dashboard"] .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
  }

  body[data-hr-view="dashboard"] .dashboard-hero,
  body[data-hr-view="dashboard"] .todo-hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 21px;
    padding: 22px !important;
  }

  body[data-hr-view="dashboard"] .dashboard-hero h2 {
    font-size: 30px !important;
    line-height: 1.16;
  }

  body[data-hr-view="dashboard"] .dashboard-hero p {
    font-size: 12px;
    line-height: 1.66;
  }

  body[data-hr-view="dashboard"] .dashboard-hero .hero-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body[data-hr-view="dashboard"] .dashboard-hero .hero-pills button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-hr-view="dashboard"] .hero-status-card,
  body[data-hr-view="dashboard"] .payroll-progress-card {
    padding: 20px 0 0;
    border-top-color: #abc9e6 !important;
  }

  body[data-hr-view="dashboard"] .hero-status-card > strong {
    font-size: 36px;
  }

  body[data-hr-view="dashboard"] .dashboard-panel {
    padding: 16px;
  }

  body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
  body[data-hr-view="dashboard"] .todo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-hr-view="dashboard"] .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  body[data-hr-view="dashboard"] .topbar.apple-commandbar {
    padding: 8px !important;
  }

  body[data-hr-view="dashboard"] .brand-block h1 {
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-hr-view="dashboard"] .dashboard-hero,
  body[data-hr-view="dashboard"] .todo-hero {
    padding: 18px !important;
  }

  body[data-hr-view="dashboard"] .dashboard-hero h2 {
    font-size: 27px !important;
  }

  body[data-hr-view="dashboard"] .dashboard-hero .hero-pills {
    margin-top: 15px;
  }

  body[data-hr-view="dashboard"] .payroll-progress-meta > div {
    padding: 9px 5px;
  }

  body[data-hr-view="dashboard"] .payroll-progress-meta span {
    font-size: 8px !important;
  }

  body[data-hr-view="dashboard"] .payroll-progress-meta b {
    font-size: 11px !important;
  }

  body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button,
  body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button {
    padding: 0 8px;
    font-size: 10px;
  }

  body[data-hr-view="dashboard"] .dashboard-panel {
    padding: 14px;
  }

  body[data-hr-view="dashboard"] .section-heading {
    gap: 8px;
  }

  body[data-hr-view="dashboard"] .section-heading h3 {
    font-size: 15px;
  }

  body[data-hr-view="dashboard"] .todo-card,
  body[data-hr-view="dashboard"] .todo-overview-panel .todo-card {
    min-height: 103px;
    padding: 12px;
  }

  body[data-hr-view="dashboard"] .todo-card strong {
    font-size: 25px;
  }
}

@media (max-width: 350px) {
  body[data-hr-view="dashboard"] .todo-overview-panel .todo-grid,
  body[data-hr-view="dashboard"] .todo-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-hr-view="dashboard"] .dashboard-hero .hero-pills button,
  body[data-hr-view="dashboard"] .dashboard-hero-actions .ghost-button,
  body[data-hr-view="dashboard"] .dashboard-hero-actions .payroll-entry-button,
  body[data-hr-view="dashboard"] .todo-card {
    transition: none;
  }
}

@media (min-width: 901px) {
  body[data-hr-view="dashboard"] .top-controls .role-control {
    width: 170px;
    min-width: 170px;
  }
}

/* Keep annual-leave mobile cards compact after the global table adaptation. */
@media (max-width: 900px) {
  .attendance-leaves-view .annual-ledger-table-wrap {
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .attendance-leaves-view .annual-ledger-table tbody {
    display: grid;
    gap: 8px;
  }

  .attendance-leaves-view .annual-ledger-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(34, 76, 122, 0.07);
  }

  .attendance-leaves-view .annual-ledger-table td {
    display: block !important;
    min-height: 46px;
    padding: 7px !important;
  }

  .attendance-leaves-view .annual-ledger-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #7b8998;
    font-size: 9px;
    font-weight: 740;
  }

  .attendance-leaves-view .annual-ledger-table td:first-child,
  .attendance-leaves-view .annual-ledger-table td:last-child {
    grid-column: 1 / -1;
  }

  .attendance-leaves-view .annual-ledger-table .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .attendance-leaves-view .annual-ledger-table .mini-button {
    width: 100%;
  }
}

/* Attendance · shift rule center (stable card layout) */
body[data-hr-view="attendance"] .attendance-shifts-view {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 18px;
}

body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--solid) 0%, var(--panel) 100%);
}

body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 820;
  line-height: 1.3;
}

body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar .muted {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar .primary {
  min-width: 118px;
  flex: 0 0 auto;
}

body[data-hr-view="attendance"] .shift-card-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body[data-hr-view="attendance"] .shift-group-card,
body[data-hr-view="attendance"] .shift-group-card:hover {
  min-width: 0;
  align-self: start;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dce7f3;
  border-radius: 16px;
  background: var(--solid);
  box-shadow: 0 10px 28px rgba(31, 75, 122, 0.07);
  transform: none;
  transition: none;
}

body[data-hr-view="attendance"] .shift-group-summary {
  min-height: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: linear-gradient(135deg, var(--panel) 0%, var(--solid) 78%);
  cursor: default;
  list-style: none;
}

body[data-hr-view="attendance"] .shift-group-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--shift-tone), #17a7cf);
  box-shadow: 0 7px 18px rgba(36, 120, 242, 0.18);
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

body[data-hr-view="attendance"] .shift-group-copy {
  min-width: 0;
}

body[data-hr-view="attendance"] .shift-group-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.35;
}

body[data-hr-view="attendance"] .shift-group-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

body[data-hr-view="attendance"] .shift-group-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(36, 120, 242, 0.16);
  border-radius: 9px;
  background: var(--accent-quiet);
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
}

body[data-hr-view="attendance"] .shift-group-toggle:hover {
  border-color: rgba(36, 120, 242, 0.3);
  background: rgba(36, 120, 242, 0.12);
}

body[data-hr-view="attendance"] .shift-group-toggle:focus-visible {
  outline: 3px solid rgba(36, 120, 242, 0.2);
  outline-offset: 2px;
}

body[data-hr-view="attendance"] .shift-group-toggle-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

body[data-hr-view="attendance"] .shift-group-card.is-collapsed .shift-group-toggle-chevron {
  transform: translateX(-2px) rotate(-45deg);
}

body[data-hr-view="attendance"] .shift-rule-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--gray-soft);
}

body[data-hr-view="attendance"] .shift-rule-list[hidden] {
  display: none;
}

body[data-hr-view="attendance"] .shift-rule-tile,
body[data-hr-view="attendance"] .shift-rule-tile:last-child {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  padding: 15px;
  border: 1px solid #dfe9f3;
  border-radius: 13px;
  background: var(--solid);
  box-shadow: 0 4px 14px rgba(31, 75, 122, 0.045);
}

body[data-hr-view="attendance"] .shift-rule-top {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

body[data-hr-view="attendance"] .shift-rule-title {
  min-width: 0;
}

body[data-hr-view="attendance"] .shift-rule-title strong,
body[data-hr-view="attendance"] .shift-rule-title span {
  display: block;
}

body[data-hr-view="attendance"] .shift-rule-title strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
  line-height: 1.45;
}

body[data-hr-view="attendance"] .shift-rule-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

body[data-hr-view="attendance"] .shift-rule-top > .badge {
  min-height: 24px;
  flex: 0 0 auto;
  padding-inline: 9px;
  font-size: 10px;
}

body[data-hr-view="attendance"] .shift-rule-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

body[data-hr-view="attendance"] .shift-rule-metrics > div {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #e2ebf4;
  border-radius: 10px;
  background: var(--panel);
}

body[data-hr-view="attendance"] .shift-rule-metrics span,
body[data-hr-view="attendance"] .shift-rule-metrics b {
  min-width: 0;
  display: block;
}

body[data-hr-view="attendance"] .shift-rule-metrics span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.3;
}

body[data-hr-view="attendance"] .shift-rule-metrics b {
  margin: 0;
  overflow: visible;
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.4;
  text-overflow: clip;
  white-space: normal;
}

body[data-hr-view="attendance"] .shift-rule-footer {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

body[data-hr-view="attendance"] .shift-breaks {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

body[data-hr-view="attendance"] .shift-breaks strong {
  margin-right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

body[data-hr-view="attendance"] .shift-breaks span {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--gray-soft);
  color: var(--ink);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.35;
}

body[data-hr-view="attendance"] .shift-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
}

body[data-hr-view="attendance"] .shift-actions .mini-button {
  min-width: 64px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
}

body[data-hr-view="attendance"] .shift-actions .shift-edit-button {
  border-color: rgba(36, 120, 242, 0.18);
  background: var(--accent-quiet);
  color: var(--accent);
}

body[data-hr-view="attendance"] .shift-actions .app-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 980px) {
  body[data-hr-view="attendance"] .shift-rule-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body[data-hr-view="attendance"] .attendance-shifts-view {
    gap: 12px;
    padding: 10px;
  }

  body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }

  body[data-hr-view="attendance"] .attendance-shifts-view .shifts-toolbar .primary {
    width: 100%;
  }

  body[data-hr-view="attendance"] .shift-group-summary {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  body[data-hr-view="attendance"] .shift-group-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 17px;
  }

  body[data-hr-view="attendance"] .shift-group-toggle {
    width: 34px;
    padding: 0;
  }

  body[data-hr-view="attendance"] .shift-group-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  body[data-hr-view="attendance"] .shift-rule-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
}

@media (max-width: 420px) {
  body[data-hr-view="attendance"] .shift-rule-tile {
    padding: 13px;
  }

  body[data-hr-view="attendance"] .shift-rule-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-hr-view="attendance"] .shift-rule-footer {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-hr-view="attendance"] .shift-actions,
  body[data-hr-view="attendance"] .shift-actions .mini-button {
    flex: 1 1 0;
  }
}

/* Keep employee-file child routes compact after the shared navigation rules. */
.module-nav .nav-subgroup-items > button {
  display: flex;
  min-height: 34px;
  grid-template-columns: none;
  justify-content: flex-start;
  padding: 7px 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.module-nav .nav-subgroup-items > button > span {
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

/* Employee personal center: directory, preview and focused workflows */
.employee-portal-metrics > button {
  position: relative;
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 15px 16px;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: var(--solid);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.employee-portal-metrics > button::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.employee-portal-metrics > button:nth-child(2)::before { background: var(--green); }
.employee-portal-metrics > button:nth-child(3)::before { background: var(--gold); }
.employee-portal-metrics > button:nth-child(4)::before { background: #7f6bd8; }

.employee-portal-metrics > button:hover:not(:disabled),
.employee-portal-metrics > button:focus-visible {
  border-color: rgba(36, 120, 242, 0.28);
  box-shadow: 0 9px 24px rgba(31, 75, 122, 0.09);
  transform: translateY(-1px);
}

.employee-portal-metrics > button:focus-visible {
  outline: 3px solid rgba(36, 120, 242, 0.15);
  outline-offset: 2px;
}

.employee-portal-metrics > button:disabled {
  opacity: 0.68;
  cursor: default;
}

.employee-portal-metrics > button > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.employee-portal-metrics > button > strong {
  grid-row: span 2;
  align-self: center;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.employee-portal-metrics > button > small {
  min-width: 0;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-directory-search {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-portal-directory-search .search-box {
  min-width: 0;
  flex: 1 1 auto;
}

.employee-portal-mobile-preview-trigger {
  display: none;
  flex: 0 0 auto;
}

.employee-portal-filter-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid #e5ecf3;
  background: #f8fafc;
}

.employee-portal-primary-filter-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 7px;
}

.employee-portal-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.employee-portal-filter-toolbar select,
.employee-portal-more-filters select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 0 28px 0 9px;
  border: 1px solid #d7e1eb;
  border-radius: 7px;
  background-color: var(--solid);
  color: #334b65;
  font-size: 10px;
}

.employee-portal-filter-actions select {
  width: 190px;
}

.employee-portal-filter-actions .ghost-button {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 10px;
}

.employee-portal-filter-actions .ghost-button.is-active {
  border-color: rgba(36, 120, 242, 0.28);
  background: var(--accent-quiet);
  color: var(--accent-dark);
}

.employee-portal-more-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid #e5ecf3;
  background: #f4f8fc;
}

.employee-portal-more-filters[hidden] {
  display: none;
}

.employee-portal-filter-chips {
  min-height: 39px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid #e5ecf3;
  background: var(--solid);
}

.employee-portal-filter-chips > button {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #d7e6f6;
  border-radius: 999px;
  background: #f1f7fe;
  color: #276ba9;
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.employee-portal-filter-chips > button:hover {
  border-color: rgba(36, 120, 242, 0.3);
  background: var(--accent-quiet);
}

.employee-portal-filter-chips > button > span {
  color: #7297bb;
  font-size: 13px;
  line-height: 1;
}

.employee-portal-filter-chips .employee-portal-clear-all {
  border-color: transparent;
  background: transparent;
  color: var(--red);
}

.employee-portal-filter-empty {
  color: var(--faint);
  font-size: 9px;
}

.employee-portal-issues {
  min-width: 0;
  align-items: center;
}

.employee-portal-issues small {
  min-width: 0;
  overflow: hidden;
  color: #a45a5a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-preview {
  top: 84px;
}

.employee-portal-preview-tools {
  position: relative;
  overflow: visible;
  padding: 12px;
}

.employee-portal-preview-tools > div:first-child > span {
  text-align: right;
}

.employee-portal-profile-alert {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 138, 34, 0.22);
  border-radius: 8px;
  background: var(--gold-soft);
}

.employee-portal-profile-alert > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.employee-portal-profile-alert > span strong {
  color: #8a5b13;
  font-size: 10px;
}

.employee-portal-profile-alert > span small {
  overflow: hidden;
  color: #9e7a40;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-profile-alert > button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #9a6210;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.employee-portal-link-actions {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.employee-portal-link-actions > button,
.employee-portal-link-actions > .primary,
.employee-portal-link-actions > .ghost-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 10px;
}

.employee-portal-readonly {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--gray-soft);
}

.employee-portal-action-menu {
  position: relative;
  flex: 0 0 auto;
}

.employee-portal-action-menu > summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--solid);
  color: #52677e;
  font-size: 10px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.employee-portal-action-menu > summary::-webkit-details-marker {
  display: none;
}

.employee-portal-action-menu > summary::after {
  margin-left: 6px;
  color: var(--faint);
  content: "⌄";
}

.employee-portal-action-menu[open] > summary {
  border-color: rgba(36, 120, 242, 0.28);
  background: var(--accent-quiet);
  color: var(--accent-dark);
}

.employee-portal-action-menu > div {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 218px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #d8e2ed;
  border-radius: 9px;
  background: var(--solid);
  box-shadow: 0 14px 35px rgba(30, 56, 92, 0.18);
}

.employee-portal-action-menu > div > button {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #3c526b;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.employee-portal-action-menu > div > button:hover {
  background: var(--gray-soft);
}

.employee-portal-action-menu > div > button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.employee-portal-action-menu .app-icon {
  width: 14px;
  height: 14px;
}

.employee-portal-danger-action,
.employee-portal-action-menu > div > .employee-portal-danger-action {
  color: var(--red);
}

.employee-portal-action-menu > div > .employee-portal-danger-action:hover {
  background: var(--red-soft);
}

.employee-portal-benefit-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.employee-portal-benefit-tools > span {
  min-width: 0;
  color: #60768d;
  font-size: 9px;
  font-weight: 650;
}

.employee-portal-benefit-tools > button {
  min-height: 31px;
  margin-left: auto;
}

.employee-portal-phone-screen {
  height: min(720px, calc(100dvh - 286px));
  min-height: 480px;
}

.employee-portal-qr.is-compact {
  gap: 11px;
  padding: 2px 0 4px;
}

.employee-portal-qr.is-compact img {
  width: min(100%, 252px);
  padding: 9px;
  border-radius: 11px;
}

.employee-portal-confirm-form,
.employee-portal-correction-decision {
  display: grid;
  gap: 11px;
}

.employee-portal-confirm-form label,
.employee-portal-correction-decision label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.employee-portal-confirm-form input,
.employee-portal-confirm-form select,
.employee-portal-confirm-form textarea,
.employee-portal-correction-decision textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--solid);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.employee-portal-confirm-form textarea,
.employee-portal-correction-decision textarea {
  min-height: 82px;
  resize: vertical;
}

.employee-portal-confirm-form > small,
.employee-portal-cake-claim-form > p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.employee-portal-cake-claim-form > p {
  padding: 9px 10px;
  border: 1px solid rgba(216, 138, 34, 0.22);
  border-radius: 8px;
  background: var(--gold-soft);
  color: #8a5b13;
}

.employee-portal-cake-claim-form > p[hidden],
.employee-portal-cake-claim-form > label[hidden] {
  display: none;
}

.employee-portal-correction-diff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
}

.employee-portal-correction-diff > span {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--gray-soft);
}

.employee-portal-correction-diff > span:last-child {
  border-color: rgba(36, 120, 242, 0.18);
  background: var(--accent-quiet);
}

.employee-portal-correction-diff small {
  color: var(--muted);
  font-size: 8px;
}

.employee-portal-correction-diff strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
}

.employee-portal-correction-diff > b {
  align-self: center;
  color: var(--accent);
  font-size: 15px;
}

.employee-portal-correction-decision > p {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #d7e3ef;
  border-radius: 0 7px 7px 0;
  background: #f8fafc;
  color: #607286;
  font-size: 10px;
  line-height: 1.6;
}

body[data-hr-view] .drawer-panel.employee-portal-compact-drawer {
  width: min(640px, calc(100vw - 24px));
}

body[data-hr-view] .drawer-panel.employee-portal-preview-drawer {
  width: min(510px, calc(100vw - 24px));
}

body[data-hr-view] .drawer-panel.employee-portal-job-drawer {
  width: min(1180px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}

body[data-hr-view] .drawer-panel.employee-portal-job-drawer #drawerBody {
  padding-bottom: 18px;
}

.employee-portal-preview-drawer-body {
  width: min(100%, 430px);
  margin-inline: auto;
}

.employee-portal-preview-drawer-body .employee-portal-phone-screen {
  height: min(690px, calc(100dvh - 285px));
  min-height: 430px;
}

.employee-portal-drawer-actions {
  position: sticky;
  z-index: 8;
  bottom: -18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 20px -18px -18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(31, 75, 122, 0.06);
  backdrop-filter: blur(10px);
}

.employee-portal-drawer-actions > button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 11px;
}

.employee-portal-benefit-example {
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px dashed #c9dced;
  color: #2f6fa9 !important;
  font-weight: 650;
}

.employee-portal-repeatable-section {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #dce6f0;
  border-radius: 10px;
  background: #f9fbfd;
}

.employee-portal-repeatable-section > header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.employee-portal-repeatable-section > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.employee-portal-repeatable-section > header strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.employee-portal-repeatable-section > header span {
  color: var(--muted);
  font-size: 9px;
}

.employee-portal-repeatable-section > header .ghost-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 9px;
}

.employee-portal-repeatable-list {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.employee-portal-repeatable-row,
.employee-portal-performance-row,
.employee-portal-performance-head {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 7px;
}

.employee-portal-repeatable-row {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.employee-portal-performance-row,
.employee-portal-performance-head {
  grid-template-columns: minmax(145px, 1fr) 82px minmax(120px, .8fr) minmax(170px, 1.2fr) 96px;
}

.employee-portal-performance-head {
  padding: 0 1px;
}

.employee-portal-performance-head > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 680;
}

.employee-portal-repeatable-row > input,
.employee-portal-performance-row > input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #d5e0eb;
  border-radius: 7px;
  background: var(--solid);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
}

.employee-portal-repeatable-row > input:focus,
.employee-portal-performance-row > input:focus {
  border-color: rgba(36, 120, 242, 0.48);
  outline: 3px solid rgba(36, 120, 242, 0.1);
}

.employee-portal-repeatable-actions {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  justify-content: end;
  gap: 4px;
}

.employee-portal-repeatable-actions > button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d7e1eb;
  border-radius: 6px;
  background: var(--solid);
  color: #708297;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.employee-portal-repeatable-actions > button:hover {
  border-color: rgba(36, 120, 242, 0.3);
  background: var(--accent-quiet);
  color: var(--accent);
}

.employee-portal-repeatable-actions > button:last-child:hover {
  border-color: rgba(217, 77, 77, 0.25);
  background: var(--red-soft);
  color: var(--red);
}

.employee-portal-job-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.employee-portal-job-summary > article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #dce6f0;
  border-radius: 9px;
  background: var(--solid);
}

.employee-portal-job-summary span {
  color: var(--muted);
  font-size: 8px;
}

.employee-portal-job-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-portal-job-summary strong.is-warning {
  color: var(--red);
}

@media (max-width: 1120px) {
  .employee-portal-filter-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-portal-filter-actions {
    justify-content: flex-start;
  }

  .employee-portal-filter-actions select {
    width: min(100%, 220px);
  }

  .employee-portal-more-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .employee-portal-preview {
    display: none;
  }

  .employee-portal-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-portal-mobile-preview-trigger {
    display: inline-flex;
    min-height: 36px;
    padding: 0 10px;
    font-size: 10px;
  }

  .employee-portal-directory-list {
    max-height: calc(100dvh - 330px);
    min-height: 280px;
  }

  .employee-portal-primary-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .employee-portal-directory-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-portal-primary-filter-grid,
  .employee-portal-more-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-portal-filter-toolbar,
  .employee-portal-more-filters,
  .employee-portal-filter-chips {
    padding-inline: 12px;
  }

  body[data-hr-view] .drawer-panel.employee-portal-job-drawer,
  body[data-hr-view] .drawer-panel.employee-portal-preview-drawer,
  body[data-hr-view] .drawer-panel.employee-portal-compact-drawer {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 6px;
  }

  .employee-portal-performance-head {
    display: none;
  }

  .employee-portal-repeatable-row,
  .employee-portal-performance-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 9px;
    border: 1px solid #e0e8f1;
    border-radius: 8px;
    background: var(--solid);
  }

  .employee-portal-job-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-portal-drawer-actions {
    align-items: stretch;
  }
}

@media (max-width: 520px) {
  .employee-portal-primary-filter-grid,
  .employee-portal-more-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-portal-directory-search,
  .employee-portal-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-portal-filter-actions select,
  .employee-portal-filter-actions .ghost-button,
  .employee-portal-mobile-preview-trigger {
    width: 100%;
  }

  .employee-portal-person-meta {
    display: none;
  }

  .employee-portal-correction-diff {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-portal-correction-diff > b {
    justify-self: center;
    transform: rotate(90deg);
  }

  .employee-portal-repeatable-section > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .employee-portal-repeatable-section > header .ghost-button {
    width: 100%;
  }

  .employee-portal-job-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Personal-center legibility and operation hit areas */
.employee-portal-directory-head > div > span,
.employee-portal-person-org,
.employee-portal-person-side small,
.employee-portal-person-side b,
.employee-portal-preview-tools span,
.employee-portal-readonly,
.employee-portal-filter-empty,
.employee-portal-issues small,
.employee-portal-profile-alert > span small,
.employee-portal-benefit-tools > span,
.employee-portal-confirm-form > small,
.employee-portal-cake-claim-form > p,
.employee-portal-correction-diff small,
.employee-portal-repeatable-section > header span,
.employee-portal-performance-head > span,
.employee-portal-job-summary span {
  font-size: 11px;
}

.employee-portal-person-meta i,
.employee-portal-issues i,
.employee-portal-complete,
.employee-portal-filter-chips > button,
.employee-portal-profile-alert > button,
.employee-portal-action-menu > summary,
.employee-portal-action-menu > div > button,
.employee-portal-confirm-form label,
.employee-portal-correction-decision label {
  font-size: 12px;
}

.employee-portal-filter-toolbar select,
.employee-portal-more-filters select,
.employee-portal-filter-actions .ghost-button,
.employee-portal-mobile-preview-trigger,
.employee-portal-link-actions > button,
.employee-portal-link-actions > .primary,
.employee-portal-link-actions > .ghost-button,
.employee-portal-benefit-tools > button,
.employee-portal-repeatable-row > input,
.employee-portal-performance-row > input,
.employee-portal-drawer-actions > button {
  font-size: 12px;
}

.employee-portal-preview-tools strong,
.employee-portal-profile-alert > span strong,
.employee-portal-repeatable-section > header strong,
.employee-portal-correction-diff strong {
  font-size: 14px;
}

.employee-portal-metrics > button > small,
.employee-portal-person-title > em {
  font-size: 12px;
}

.employee-portal-filter-toolbar select,
.employee-portal-more-filters select,
.employee-portal-filter-actions .ghost-button,
.employee-portal-mobile-preview-trigger,
.employee-portal-link-actions > button,
.employee-portal-link-actions > .primary,
.employee-portal-link-actions > .ghost-button,
.employee-portal-action-menu > summary,
.employee-portal-action-menu > div > button,
.employee-portal-benefit-tools > button,
.employee-portal-drawer-actions > button {
  min-height: 40px;
}

.employee-portal-benefit-tools > button {
  font-size: 12px;
}

.employee-portal-cake-window {
  padding: 9px 10px;
  border: 1px solid rgba(36, 120, 242, 0.16);
  border-radius: 8px;
  background: var(--accent-quiet);
  color: var(--accent-dark) !important;
  font-weight: 650;
}

body[data-hr-view] .confirm-dialog:has(.employee-portal-qr.is-compact) {
  width: min(500px, calc(100vw - 28px));
}

.employee-portal-repeatable-row > input,
.employee-portal-performance-row > input {
  min-height: 40px;
}

.employee-portal-repeatable-row {
  grid-template-columns: minmax(0, 1fr) 116px;
}

.employee-portal-performance-row,
.employee-portal-performance-head {
  grid-template-columns: minmax(145px, 1fr) 82px minmax(120px, .8fr) minmax(170px, 1.2fr) 116px;
}

.employee-portal-repeatable-actions {
  grid-template-columns: repeat(3, 36px);
}

.employee-portal-repeatable-actions > button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  font-size: 15px;
}

.employee-portal-job-summary strong {
  font-size: 14px;
}

@media (max-width: 760px) {
  .employee-portal-repeatable-row,
  .employee-portal-performance-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Payroll recalculation confirmation flow v2 */
.confirm-overlay.payroll-recalculation-dialog-open .confirm-dialog {
  width: min(960px, calc(100vw - 48px));
}

.payroll-recalculation-actions > a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.payroll-missing-level-list .mini-button.is-readonly {
  cursor: default;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.payroll-missing-level-list .mini-button.is-readonly em {
  color: var(--muted);
}

.payroll-recalculation-blockers {
  display: grid;
  gap: 7px;
}

.payroll-recalculation-blockers > span {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(190, 74, 67, 0.18);
  border-radius: 10px;
  background: rgba(190, 74, 67, 0.055);
}

.payroll-recalculation-blockers > span strong {
  font-size: 11px;
}

@media (max-width: 700px) {
  .confirm-overlay.payroll-recalculation-dialog-open {
    padding: 10px;
  }

  .confirm-overlay.payroll-recalculation-dialog-open .confirm-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .payroll-recalculation-summary,
  .payroll-missing-level-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-recalculation-blockers > span {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .payroll-recalculation-table-wrap table,
  .payroll-recalculation-table-wrap tbody,
  .payroll-recalculation-table-wrap tr,
  .payroll-recalculation-table-wrap td {
    display: block;
    width: 100%;
  }

  .payroll-recalculation-table-wrap thead {
    display: none;
  }

  .payroll-recalculation-table-wrap tr {
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
  }

  .payroll-recalculation-table-wrap td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
  }

  .payroll-recalculation-table-wrap td:last-child {
    border-bottom: 0;
  }

  .payroll-recalculation-table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }
}
.salary-archive-intro {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #d7e2ec;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6faff, #eef7f4);
}

.salary-archive-intro strong { font-size: 18px; }
.salary-archive-intro span { color: var(--muted); font-size: 13px; }
.salary-archive-intro p { margin: 6px 0 0; color: #526579; font-size: 13px; line-height: 1.6; }
.salary-archive-list { display: grid; gap: 10px; }

.salary-current-architecture {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #b9dfca;
  border-radius: 12px;
  background: linear-gradient(135deg, #f2fbf6, #fbfefd);
}
.salary-current-architecture.is-missing { border-color: #f0c8c8; background: #fff7f7; }
.salary-current-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.salary-current-heading span,
.salary-current-heading strong { display: block; }
.salary-current-heading > div > span { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.salary-current-heading > div > strong { font-size: 16px; }
.salary-current-architecture > p { margin: 0; color: #526579; font-size: 12px; line-height: 1.6; }
.salary-current-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.salary-current-figures span { min-width: 0; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.82); }
.salary-current-figures small,
.salary-current-figures b { display: block; }
.salary-current-figures small { color: var(--muted); font-size: 10px; }
.salary-current-figures b { margin-top: 4px; overflow-wrap: anywhere; font-size: 13px; }

.salary-archive-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #dce5ed;
  border-radius: 10px;
  background: #fff;
}
.salary-archive-card.is-current { border-color: #91cfaa; box-shadow: 0 0 0 2px rgba(52, 161, 94, .08); }

.salary-archive-card header,
.salary-archive-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.salary-archive-card header strong,
.salary-archive-card header span { display: block; }
.salary-archive-card header span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.salary-archive-card footer small { color: var(--muted); }

.salary-archive-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.salary-archive-amounts span { min-width: 0; padding: 8px; border-radius: 7px; background: #f5f8fb; color: var(--muted); font-size: 11px; }
.salary-archive-amounts b { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.salary-calculation-rules { border-top: 1px solid var(--line); padding-top: 8px; }
.salary-calculation-rules summary { cursor: pointer; color: #315c48; font-size: 12px; font-weight: 700; }
.salary-calculation-rules > div { display: grid; gap: 6px; margin-top: 8px; }
.salary-calculation-rules p { display: grid; grid-template-columns: 90px 1fr; gap: 3px 10px; margin: 0; padding: 8px; border-radius: 7px; background: #f8fafc; font-size: 11px; }
.salary-calculation-rules p strong { grid-row: 1 / span 2; }
.salary-calculation-rules p span { color: #42556a; }
.salary-calculation-rules p small { color: var(--muted); }
.salary-profile-editor > summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.salary-profile-editor > summary span { color: var(--muted); font-size: 12px; }
.salary-profile-editor > .form-grid { margin-top: 14px; }

.employee-auto-stage-field {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #cfe0ee;
  border-radius: 9px;
  background: #f5f9fc;
}
.employee-auto-stage-field > span { color: var(--muted); font-size: 11px; }
.employee-auto-stage-field > strong { color: #24496b; font-size: 14px; }
.employee-auto-stage-field > small { color: #58718a; font-size: 10px; line-height: 1.45; }
.employee-separated-data-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.employee-separated-data-actions p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.payment-separation-notice { display: flex; gap: 10px; margin-bottom: 14px; padding: 12px; border-radius: 10px; background: #f2f7fb; color: #31516e; }
.payment-separation-notice .app-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.payment-separation-notice strong,
.payment-separation-notice span { display: block; }
.payment-separation-notice span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.employee-linked-records {
  display: grid;
  gap: 10px;
}

.employee-linked-records > article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #dbe5ed;
  border-radius: 10px;
  background: #f9fbfd;
}

.employee-linked-record-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #eaf3fb;
  color: #2b5d86;
}

.employee-linked-record-icon .app-icon { width: 19px; height: 19px; }
.employee-linked-records strong,
.employee-linked-records p,
.employee-linked-records small { display: block; }
.employee-linked-records p { margin: 4px 0; color: #526579; font-size: 12px; line-height: 1.5; }
.employee-linked-records small { color: var(--muted); font-size: 10px; }

.employee-linked-records > article.employee-initial-salary-card {
  align-items: start;
  border-color: #bcd6eb;
  background: linear-gradient(145deg, #f4f9fd, #fbfdff);
}

.employee-initial-salary-copy { padding-top: 2px; }

.employee-initial-salary-form {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
  padding-top: 13px;
  border-top: 1px solid #d8e6f1;
}

.employee-initial-salary-form.is-ready {
  border-top-color: #8fc1e7;
}

.employee-initial-salary-form .readonly-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d7e0e8;
  border-radius: 9px;
  background: #f2f6f9;
  color: #31516e;
  font-weight: 750;
}

.employee-initial-salary-form label > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.subdrawer-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.subdrawer-back-row small { color: var(--muted); font-size: 10px; text-align: right; }

.salary-policy-summary {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 15px;
  border: 1px solid #c8dcef;
  border-radius: 12px;
  background: linear-gradient(135deg, #f2f7fd, #fbfdff);
}

.salary-policy-summary.is-not-applicable { border-color: #e2e6ea; background: #fafbfc; }
.salary-policy-summary > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.salary-policy-summary > header span,
.salary-policy-summary > header strong { display: block; }
.salary-policy-summary > header span { margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.salary-policy-summary > header strong { font-size: 15px; }
.salary-policy-summary > p { margin: 0; color: #526579; font-size: 11px; line-height: 1.6; }

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

.salary-policy-levels > span {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(43, 93, 134, .1);
  border-radius: 8px;
  background: rgba(255,255,255,.8);
}

.salary-policy-levels small,
.salary-policy-levels b,
.salary-policy-levels em { display: block; }
.salary-policy-levels small { color: var(--muted); font-size: 10px; }
.salary-policy-levels b { margin-top: 3px; font-size: 14px; }
.salary-policy-levels em { margin-top: 2px; color: #526579; font-size: 9px; font-style: normal; }
.salary-policy-override { padding: 9px 10px; border-radius: 8px; background: #fff6df; color: #765a18; }
.salary-policy-override strong,
.salary-policy-override span { display: block; }
.salary-policy-override span { margin-top: 2px; font-size: 10px; }

.salary-advancement-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(43, 93, 134, .16);
  border-radius: 10px;
  background: rgba(255,255,255,.88);
}

.salary-advancement-card.is-ready,
.salary-advancement-card.is-complete {
  border-color: rgba(32, 132, 91, .2);
  background: #f1faf5;
}

.salary-advancement-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.salary-advancement-card small,
.salary-advancement-card strong { display: block; }
.salary-advancement-card small { color: var(--muted); font-size: 9px; }
.salary-advancement-card > header strong { margin-top: 3px; font-size: 14px; }
.salary-advancement-card > p { margin: 0; color: #526579; font-size: 10px; line-height: 1.55; }

.salary-advancement-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.salary-advancement-facts > span {
  padding: 8px 9px;
  border-radius: 8px;
  background: #f5f8fb;
}

.salary-advancement-facts b { margin-top: 2px; font-size: 11px; }
.salary-advancement-gate { padding-top: 8px; border-top: 1px solid rgba(43, 93, 134, .1); }
.salary-advancement-gate strong { display: inline; margin-right: 3px; color: var(--ink); }

.salary-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.salary-current-edit { justify-self: start; }
.salary-job-history { display: grid; gap: 7px; }
.salary-job-history > div { display: grid; gap: 3px; padding: 9px 10px; border-radius: 8px; background: #f6f8fa; }
.salary-job-history > div strong { font-size: 11px; }
.salary-job-history > div span { color: #526579; font-size: 11px; }
.salary-job-history > div small { color: var(--muted); font-size: 9px; }
.salary-policy-apply-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; background: #eef6fd; color: #315c7d; font-size: 11px; }
.salary-profile-editor label > small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }

@media (max-width: 720px) {
  .salary-archive-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .salary-current-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-separated-data-actions { align-items: stretch; flex-direction: column; }
  .salary-calculation-rules p { grid-template-columns: 1fr; }
  .salary-calculation-rules p strong { grid-row: auto; }
  .salary-advancement-card > header { align-items: stretch; flex-direction: column; }
  .salary-advancement-facts { grid-template-columns: 1fr; }
  .employee-linked-records > article { grid-template-columns: 38px minmax(0, 1fr); }
  .employee-linked-records > article > button,
  .employee-linked-records > article > .muted { grid-column: 1 / -1; }
  .subdrawer-back-row { align-items: stretch; flex-direction: column; }
  .subdrawer-back-row small { text-align: left; }
  .salary-policy-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.employee-create-choice {
  display: grid;
  gap: 24px;
  padding: 4px 2px 20px;
}

.employee-create-choice-intro > span,
.employee-intake-kicker {
  color: var(--accent, #1768a8);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.employee-create-choice-intro h3,
.employee-intake-result h3 {
  margin: 8px 0 7px;
  font-size: 24px;
  letter-spacing: -.03em;
}

.employee-create-choice-intro p,
.employee-intake-result > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.employee-create-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.employee-create-option {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  text-align: left;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(41, 65, 86, .07);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.employee-create-option:hover {
  transform: translateY(-2px);
  border-color: #91b5d0;
  box-shadow: 0 20px 44px rgba(27, 83, 125, .12);
}

.employee-create-option.is-primary {
  border-color: rgba(39, 116, 172, .42);
  background: linear-gradient(145deg, rgba(232, 245, 255, .96), var(--panel));
}

.employee-create-option-icon,
.employee-intake-success-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 22px;
  border-radius: 15px;
  color: #1768a8;
  background: #e5f2fc;
}

.employee-create-option-icon > svg,
.employee-intake-success-icon > svg {
  display: block;
  width: 23px !important;
  height: 23px !important;
  max-width: 23px;
  max-height: 23px;
}
.employee-create-option strong { font-size: 17px; }
.employee-create-option p { flex: 1; margin: 10px 0 22px; color: var(--muted); line-height: 1.65; }
.employee-create-option em { display: inline-flex; align-items: center; gap: 8px; color: #1768a8; font-style: normal; font-weight: 750; }
.employee-create-option em .app-icon { width: 16px; height: 16px; }

.employee-intake-security-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cfe2ef;
  border-radius: 14px;
  color: #315b78;
  background: #f1f8fd;
}

.employee-intake-security-note > .app-icon { width: 22px; height: 22px; }
.employee-intake-security-note span { display: grid; gap: 3px; }
.employee-intake-security-note small { color: var(--muted); }
.employee-intake-result { display: grid; justify-items: center; padding: 10px 2px 24px; text-align: center; }
.employee-intake-success-icon { width: 58px; height: 58px; margin-bottom: 18px; color: #08764d; background: #def5e9; }
.employee-intake-link-field { width: 100%; margin-top: 26px; text-align: left; }
.employee-intake-link-field > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.employee-intake-link-field > div { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.employee-intake-link-field input { min-width: 0; }
.employee-intake-link-field button { white-space: nowrap; }
.employee-intake-link-meta { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.employee-intake-link-meta article { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; text-align: left; background: var(--soft); }
.employee-intake-link-meta small { color: var(--muted); }
.employee-intake-link-meta strong { font-size: 13px; }
.employee-intake-result-actions { width: 100%; display: flex; justify-content: space-between; gap: 10px; }

@media (max-width: 720px) {
  .employee-create-choice-grid,
  .employee-intake-link-meta { grid-template-columns: 1fr; }
  .employee-create-option { min-height: 220px; }
  .employee-intake-link-field > div { grid-template-columns: 1fr; }
  .employee-intake-result-actions { display: grid; }
}

.finance-salary-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid #b9d9cd;
  border-radius: 20px;
  background: linear-gradient(145deg, #edf8f4, #ffffff 62%);
}

.finance-salary-hero h3 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.finance-salary-hero p {
  margin: 0;
  color: var(--muted);
}

.finance-salary-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.finance-salary-amounts article {
  display: grid;
  gap: 6px;
  min-height: 108px;
  padding: 17px;
  border: 1px solid #d9e6e1;
  border-radius: 16px;
  background: var(--panel);
}

.finance-salary-amounts small,
.finance-salary-amounts span,
.finance-salary-version-grid small {
  color: var(--muted);
}

.finance-salary-amounts strong {
  font-size: 23px;
}

.finance-attendance-plan {
  padding: 20px;
  border: 1px solid #cbdcf0;
  border-radius: 18px;
  background: linear-gradient(145deg, #f1f6fd, #ffffff);
}

.finance-attendance-plan header,
.finance-attendance-plan header > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-attendance-plan header > div {
  align-items: baseline;
}

.finance-attendance-plan header strong {
  font-size: 20px;
}

.finance-attendance-plan > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.finance-attendance-plan > div span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.finance-attendance-plan small,
.finance-attendance-plan p {
  color: var(--muted);
}

.finance-attendance-plan p {
  margin: 14px 0 0;
  line-height: 1.65;
}

.finance-salary-version-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.finance-salary-version-grid span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: var(--soft);
}

.finance-salary-editor {
  border-color: #b9d9cd;
}

@media (max-width: 920px) {
  .finance-salary-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-attendance-plan > div,
  .finance-salary-version-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .finance-salary-hero { display: grid; }
  .finance-salary-amounts,
  .finance-attendance-plan > div,
  .finance-salary-version-grid { grid-template-columns: 1fr; }
}
