:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #65716b;
  --line: #d9e0dc;
  --paper: #f7f6f0;
  --panel: #ffffff;
  --green: #19714f;
  --green-strong: #0f573c;
  --blue: #1f5a8a;
  --amber: #b26819;
  --shadow: 0 18px 55px rgba(24, 38, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.is-logged-in) {
  display: block;
}

button {
  font: inherit;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(25, 113, 79, 0.12), transparent 42%),
    var(--paper);
}

body.is-logged-in .login-screen {
  display: none;
}

body:not(.is-logged-in) .sidebar,
body:not(.is-logged-in) .workspace {
  display: none;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 4px;
  color: var(--ink);
}

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

.login-card h1 {
  margin: 0;
  font-size: 30px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-card input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.login-card .primary {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.login-card .primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #a8362b;
  font-size: 14px;
  font-weight: 700;
}

.login-hints {
  display: grid;
  gap: 4px;
  padding-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #16241d;
  color: #f7fbf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0c35b;
  color: #16241d;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #b8c8bf;
  font-size: 13px;
}

.account-box {
  display: grid;
  gap: 7px;
  margin: -12px 0 22px;
  padding: 12px;
  border: 1px solid #324b3e;
  border-radius: 8px;
  background: #1d3026;
}

.account-box span {
  color: #b8c8bf;
  font-size: 12px;
}

.account-box strong {
  color: #ffffff;
}

.account-box button {
  min-height: 34px;
  border: 1px solid #3d574a;
  border-radius: 8px;
  background: transparent;
  color: #dbe7e0;
  cursor: pointer;
}

nav {
  display: grid;
  gap: 8px;
}

.sidebar-divider {
  height: 1px;
  margin: 22px 0;
  background: #324b3e;
}

.role,
.section-link {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dbe7e0;
  text-align: left;
  cursor: pointer;
}

.role:hover,
.role.active,
.section-link:hover,
.section-link.active {
  background: #24382e;
  border-color: #3d574a;
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.topbar,
.role-panel,
.map-section {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.12;
}

p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.status-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--blue);
  font-weight: 700;
}

.role-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.access-box {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 118px;
  padding: 18px;
  border-radius: 8px;
  background: #edf7f1;
}

.access-box span,
.module small {
  color: var(--muted);
  font-size: 13px;
}

.access-box strong {
  color: var(--green-strong);
  font-size: 24px;
}

.grid {
  max-width: 1180px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.module span {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--amber));
}

.module strong {
  font-size: 18px;
}

.module small {
  display: block;
}

.map-section {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  padding-top: 8px;
}

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

.structure div {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  color: #27332d;
  font-weight: 700;
  text-align: center;
}

.payroll-screen {
  background: #f4f7f7;
}

.payroll-header,
.payroll-summary,
.payroll-layout {
  max-width: 1360px;
  margin: 0 auto;
}

.payroll-header {
  display: grid;
  grid-template-columns: minmax(220px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.payroll-header h1 {
  font-size: 24px;
  line-height: 1.08;
  white-space: nowrap;
}

.payroll-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  justify-items: end;
  gap: 6px;
  min-width: 0;
}

.actions-main,
.actions-secondary {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.actions-secondary button {
  min-height: 32px;
  font-size: 12px;
}

.payroll-actions button,
.panel-title select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.payroll-actions button {
  padding: 0 9px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}

.payroll-actions .primary {
  background: #0b1a76;
  color: #ffffff;
  border-color: #0b1a76;
}

.payroll-actions .active-action {
  background: #edf7f1;
  border-color: #19714f;
  color: #0f573c;
}

.payroll-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payroll-summary article,
.payroll-main,
.payroll-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 38px rgba(30, 48, 55, 0.08);
}

.payroll-summary article {
  min-height: 112px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 18px;
}

.payroll-summary span,
.payroll-summary small,
.line span,
.notice span,
.access-list span {
  color: var(--muted);
  font-size: 13px;
}

.payroll-summary strong {
  color: #0b1a76;
  font-size: 26px;
}

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

.payroll-layout.manager-planner-mode {
  grid-template-columns: 1fr;
}

.payroll-layout.manager-planner-mode .payroll-side {
  order: -1;
  grid-template-columns: 1fr;
}

.payroll-layout.manager-planner-mode .payroll-main {
  width: 100%;
}

.payroll-layout.tariff-mode {
  grid-template-columns: 1fr;
}

.payroll-layout.tariff-mode .payroll-side {
  display: none;
}

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

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title select {
  padding: 0 12px;
}

.schedule-table {
  width: 100%;
  overflow-x: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tariff-table {
  border: 0;
  overflow: visible;
}

.history-table-mode {
  border: 0;
  overflow: visible;
}

.payroll-layout.history-mode {
  grid-template-columns: 1fr;
}

.payroll-layout.history-mode .payroll-side {
  display: none;
}

.history-board {
  display: grid;
  gap: 14px;
}

.history-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.review-submit-panel {
  align-items: center;
}

.review-submit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.review-submit-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.review-submit-actions button.primary {
  border-color: #19714f;
  background: #19714f;
  color: #ffffff;
}

.history-filter h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.history-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-pills button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.history-pills button.active {
  border-color: #0b1a76;
  background: #eef1ff;
  color: #0b1a76;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 14px;
  align-items: start;
}

.history-table {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(130px, 1fr) 64px repeat(5, minmax(86px, 0.8fr)) minmax(86px, 0.8fr);
  gap: 0;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid #eef2f0;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row > div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid #eef2f0;
  font-size: 13px;
}

.history-row > div:last-child {
  border-right: 0;
}

.history-head {
  min-height: 40px;
  background: #eef3f1;
  color: #46534d;
  font-weight: 900;
  cursor: default;
}

.history-row.active {
  background: #f7fbff;
  box-shadow: inset 4px 0 0 #0b1a76;
}

.status-chip {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf7f1;
  color: #0f573c;
  font-size: 12px;
  font-weight: 900;
}

.history-detail {
  display: grid;
  gap: 12px;
}

.history-detail h2 {
  margin-bottom: 0;
  font-size: 26px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-meta span {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f1f5f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-lines {
  display: grid;
  gap: 7px;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f0;
}

.detail-line div {
  display: grid;
  gap: 3px;
}

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

.history-note {
  padding: 10px;
  border-radius: 8px;
  background: #eef1ff;
  color: #0b1a76;
  font-size: 13px;
  line-height: 1.35;
}

.review-board {
  display: grid;
  gap: 18px;
}

.review-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.review-section-title h2 {
  margin: 0;
  font-size: 21px;
}

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

.review-card-grid.managers {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.review-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.review-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.review-card-head h3 {
  margin: 0 0 2px;
  font-size: 18px;
}

.review-card-head span:not(.status-chip) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.review-card .status-chip {
  padding: 4px 7px;
  font-size: 11px;
}

.review-meta {
  min-height: 22px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.review-card .detail-lines {
  align-content: start;
  gap: 2px;
}

.review-card .detail-line {
  padding: 6px 0;
  font-size: 14px;
}

.review-card .detail-line span {
  font-size: 11px;
}

.review-total {
  min-height: 58px;
  align-items: center;
  margin-top: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: #eef1ff;
}

.review-total > strong {
  color: #0b1a76;
  font-size: 17px;
}

.table-row {
  display: grid;
  grid-template-columns: 116px 54px repeat(var(--month-days, 31), minmax(20px, 1fr)) 46px;
  min-width: 0;
  border-bottom: 1px solid #e8eeeb;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row > div {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 4px 3px;
  border-right: 1px solid #e8eeeb;
  font-size: 11px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.table-row > div:nth-child(1),
.table-row > div:nth-child(2) {
  position: sticky;
  z-index: 2;
  background: inherit;
}

.table-row > div:nth-child(1) {
  left: 0;
}

.table-row > div:nth-child(2) {
  left: 116px;
}

.table-head > div:nth-child(1),
.table-head > div:nth-child(2) {
  z-index: 3;
  background: #eef3f1;
}

.table-row > div:last-child {
  border-right: 0;
}

.employee-block {
  grid-template-rows: repeat(var(--employee-rows, 3), minmax(36px, auto));
  border-top: 6px solid #f0f4f2;
  background: #ffffff;
}

.employee-block > div {
  min-height: 36px;
}

.employee-block .person {
  grid-row: 1 / span var(--employee-rows, 3);
  grid-column: 1;
  justify-content: start;
  align-content: center;
  padding-left: 12px;
  color: #17201b;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.employee-block .work-type {
  color: #334139;
  font-weight: 700;
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f1;
  color: #334139;
  font-weight: 800;
}

.header-spacer {
  background: #f9fbfa;
}

.header-spacer > div {
  min-height: 12px;
  padding: 0;
  border-right-color: transparent;
}

.table-row .person {
  justify-content: start;
  padding-left: 8px;
  font-weight: 800;
}

.muted-row {
  background: #fbfcfb;
}

.group-row {
  background: #16241d;
  color: #ffffff;
  font-weight: 900;
}

.group-row > div {
  min-height: 36px;
  border-color: #30483b;
}

.dot {
  width: 18px;
  height: 18px;
  justify-self: center;
  align-self: center;
  border-radius: 50%;
}

.dot.on {
  background: #19714f;
}

.dot.strong {
  background: #b26819;
}

.mark {
  color: #0b1a76;
  font-weight: 900;
}

.shift-cell,
.money-cell,
.empty-cell {
  cursor: pointer;
  font-weight: 800;
}

.shift-cell {
  color: #19714f;
  background: #edf7f1;
}

.money-cell {
  color: #0b1a76;
  background: #eef1ff;
}

.empty-cell {
  color: transparent;
}

.empty-cell:hover {
  color: #7c8a83;
  background: #f5f8f7;
}

.payroll-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.payroll-card {
  padding: 18px;
}

.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  border-bottom: 1px solid #eef2f0;
}

.line.total {
  margin-top: 8px;
  padding-top: 8px;
  border-bottom: 0;
}

.line.total strong {
  color: #0b1a76;
  font-size: 22px;
}

.notice {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f0;
}

.notice:last-child {
  border-bottom: 0;
}

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

.compact {
  background: #f8fbfa;
}

.editor-card {
  background: #fbfdfd;
}

.planner-card {
  display: grid;
  grid-template-columns: minmax(240px, 290px) max-content minmax(330px, 1fr);
  gap: 12px;
  padding: 12px;
  align-items: start;
}

.planner-head,
.planner-row,
.planner-days-row {
  display: grid;
  gap: 8px;
}

.planner-head {
  grid-column: 1;
  grid-template-columns: 1fr;
  align-content: start;
}

.planner-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.planner-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.planner-row {
  grid-column: 1;
  grid-template-columns: 1fr;
  align-content: start;
  margin-top: -4px;
}

.planner-days-row {
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: max-content;
  align-items: start;
  justify-items: start;
  gap: 0;
}

.planner-calendar-block {
  display: grid;
  gap: 8px;
}

.editor-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.editor-card input,
.editor-card select,
.editor-card textarea,
.adjustment input,
.accrual-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.planner-accruals {
  display: grid;
  grid-column: 3;
  grid-row: 1 / span 2;
  gap: 8px;
  margin-top: 0;
  padding-left: 10px;
  border-left: 1px solid #eef2f0;
}

.planner-accruals .eyebrow {
  margin-bottom: 0;
}

.accrual-workarea {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.accrual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: stretch;
}

.accrual-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) 34px minmax(150px, 1fr);
  gap: 6px;
  align-items: end;
}

.accrual-item label {
  gap: 4px;
  font-size: 12px;
}

.accrual-item.danger input {
  color: #9f2d20;
}

.accrual-item button {
  width: 34px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #7b8780;
  font-weight: 900;
  cursor: pointer;
}

.accrual-item button.has-comment {
  border-color: #0b1a76;
  background: #eef1ff;
  color: #0b1a76;
}

.accrual-comment {
  min-height: 38px;
  display: grid;
  align-content: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.accrual-comment.empty-comment {
  border: 1px dashed #d9e0dc;
  color: #9aa6a0;
}

.secondary-save {
  min-height: 36px;
  border: 1px solid #0b1a76;
  border-radius: 8px;
  background: #ffffff;
  color: #0b1a76;
  font-weight: 800;
  cursor: pointer;
}

.accrual-history {
  display: none;
}

.history-row,
.history-empty {
  padding: 8px;
  border-radius: 8px;
  background: #f8fbfa;
  font-size: 12px;
  line-height: 1.35;
}

.history-row {
  display: grid;
  gap: 2px;
}

.history-row strong {
  color: #0b1a76;
}

.history-row span,
.history-empty {
  color: var(--muted);
}

.history-empty {
  border: 1px dashed #d9e0dc;
}

.editor-card textarea {
  min-height: 78px;
  resize: vertical;
}

.wide-primary {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #0b1a76;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.planner-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  width: 326px;
}

.planner-toolbar button {
  flex: 1 1 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.month-picker {
  display: grid;
  grid-template-columns: repeat(7, 44px);
  gap: 4px;
  width: max-content;
  margin-bottom: 0;
}

.month-picker button {
  aspect-ratio: auto;
  width: 44px;
  min-height: 35px;
  min-width: 0;
  border: 1px solid #dce5e0;
  border-radius: 6px;
  background: #ffffff;
  color: #49564f;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.calendar-weekday,
.calendar-empty {
  width: 44px;
  min-height: 20px;
}

.calendar-weekday {
  display: grid;
  place-items: center;
  color: #6f7d76;
  font-size: 11px;
  font-weight: 900;
}

.calendar-weekday.weekend-label {
  color: #9f6a20;
}

.month-picker button.weekend-day {
  background: #fff8ed;
  border-color: #eed9b7;
}

.month-picker button.weekend-day.active {
  background: #b26819;
  border-color: #b26819;
  color: #ffffff;
}

.month-picker button:hover {
  border-color: #8eb7a5;
  background: #f1f8f5;
}

.month-picker button.active {
  border-color: #19714f;
  background: #19714f;
  color: #ffffff;
}

.planner-total {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 6px 0 0;
  width: 100%;
}

.planner-card .save-status {
  grid-column: 1 / -1;
}

.planner-total span {
  display: grid;
  gap: 2px;
  min-height: 40px;
  align-content: center;
  padding: 7px;
  border-radius: 8px;
  background: #f1f5f4;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.planner-total strong {
  color: #0b1a76;
  font-size: 16px;
}

.rate-source {
  display: grid;
  gap: 4px;
  margin: 2px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #eef1ff;
}

.rate-source strong {
  color: #0b1a76;
  font-size: 14px;
}

.rate-source span,
.tariff-row span,
.tariff-row small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.tariff-row {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f0;
}

.tariff-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.tariff-inputs {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.tariff-inputs.housekeepers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tariff-inputs.managers {
  grid-template-columns: 1fr;
}

.tariff-input {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tariff-input input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.tariff-board {
  display: grid;
  gap: 14px;
}

.tariff-intro {
  display: grid;
  gap: 8px;
}

.tariff-tabs {
  display: flex;
  align-items: end;
  gap: 4px;
  padding-left: 10px;
  border-bottom: 1px solid var(--line);
}

.tariff-tabs button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #eef3f1;
  color: #4b5b52;
  font-weight: 800;
  cursor: pointer;
}

.tariff-tabs button.active {
  min-height: 48px;
  background: #ffffff;
  color: #0b1a76;
  box-shadow: 0 -8px 24px rgba(30, 48, 55, 0.06);
}

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

.tariff-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
}

.tariff-section {
  box-shadow: none;
}

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

.tariff-rule {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.tariff-rule span,
.tariff-rule label {
  color: var(--muted);
  font-size: 13px;
}

.tariff-rule label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.tariff-rule input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.manager-rate-list {
  display: grid;
  gap: 10px;
}

.month-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.month-toolbar label,
.month-toolbar span {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.month-toolbar select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.manager-rate-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(76px, 0.55fr) minmax(150px, 1fr) repeat(5, minmax(96px, 0.7fr));
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.manager-rate-row > div {
  display: grid;
  gap: 3px;
}

.manager-rate-row span,
.manager-rate-row small,
.manager-rate-row label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.manager-rate-row small {
  color: #2f5f48;
  font-weight: 800;
}

.manager-rate-row label {
  display: grid;
  gap: 5px;
  font-weight: 800;
}

.manager-rate-row input,
.manager-rate-row select,
.manager-rate-row textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.manager-rate-row textarea {
  min-height: 62px;
  resize: vertical;
}

.manager-rate-row select {
  cursor: pointer;
}

.checkbox-field {
  justify-items: start;
}

.checkbox-field input {
  width: 24px;
  min-height: 24px;
  accent-color: #0b1a76;
}

.manager-comment {
  grid-column: 1 / -1;
}

.manager-rate-row input:disabled {
  background: #f3f5f4;
  color: #9aa6a0;
  cursor: not-allowed;
}

.save-status {
  margin-top: 0;
  padding: 10px;
  border-radius: 8px;
  background: #edf7f1;
  color: #305243;
  font-size: 13px;
  line-height: 1.35;
}

.adjustment {
  display: grid;
  grid-template-columns: 1fr 116px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-bottom: 1px solid #eef2f0;
}

.adjustment:last-child {
  border-bottom: 0;
}

.adjustment span {
  color: var(--muted);
  font-size: 14px;
}

.adjustment.danger input {
  color: #9f2d20;
}

.decision {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f0;
}

.decision:last-child {
  border-bottom: 0;
}

.decision span {
  color: var(--muted);
  font-size: 13px;
}

.decision small {
  color: #7a857f;
  font-size: 12px;
}

.decision div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.decision button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.empty-note {
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

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

  .role-panel,
  .map-section {
    grid-template-columns: 1fr;
  }

  .grid,
  .structure,
  .payroll-summary,
  .payroll-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .planner-head,
  .planner-row,
  .planner-days-row,
  .accrual-workarea,
  .accrual-grid,
  .manager-rate-row,
  .tariff-rules,
  .tariff-inputs.housekeepers {
    grid-template-columns: 1fr;
  }

  .planner-accruals {
    grid-column: 1;
    grid-row: auto;
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid #eef2f0;
  }

  .month-picker {
    grid-template-columns: repeat(7, 40px);
  }

  .planner-toolbar {
    width: 292px;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 20px 14px;
  }

  .topbar {
    display: grid;
  }

  nav,
  .grid,
  .structure,
  .payroll-summary {
    grid-template-columns: 1fr;
  }

  .payroll-header,
  .panel-title {
    display: grid;
  }

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

  .month-picker {
    grid-template-columns: repeat(7, 32px);
  }

  .month-picker button {
    width: 32px;
    min-height: 28px;
  }
}
