:root {
  --bg: #f4f5f5;
  --surface: #ffffff;
  --surface-soft: #f8fbfe;
  --text: #282e33;
  --muted: #939699;
  --muted-2: #53585c;
  --border: #eeeeef;
  --border-strong: #c9cbcc;
  --primary: #1973e1;
  --primary-hover: #0f63c7;
  --primary-soft: #edf4fd;
  --primary-border: #dceafa;
  --success: #099b49;
  --success-soft: #ceebdb;
  --warning: #f89200;
  --warning-soft: #fee9cc;
  --danger: #f41f20;
  --danger-soft: #fdd2d2;
  --purple: #b5397f;
  --radius: 8px;
  --shadow: 0 0 6px rgba(40, 46, 51, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.42;
}

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

button {
  border: 0;
  cursor: pointer;
}

.mini-btn {
  min-height: 28px;
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

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

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  color: var(--text);
  padding: 14px 10px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.nav {
  display: grid;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted-2);
  padding: 7px 9px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.nav-link::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--border-strong);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-link.active::before {
  background: var(--primary);
}

.nav-link.disabled {
  color: var(--muted);
  cursor: default;
}

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

.home-root {
  display: grid;
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 54px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.greeting h1 {
  margin: 0 0 2px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}

.greeting p,
.muted {
  color: var(--muted);
}

.greeting p {
  margin: 0;
  font-size: 13px;
}

.employee-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 210px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.employee-pill strong {
  display: block;
  font-size: 13px;
  line-height: 1.15;
}

.employee-pill .muted {
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 360px;
  gap: 14px;
  align-items: start;
}

.main-stack,
.side-stack {
  display: grid;
  gap: 14px;
}

.panel,
.metric-card,
.summary-row,
.next-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel {
  padding: 16px;
}

.panel-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
  color: var(--text);
}

.panel h2 {
  font-size: 18px;
  line-height: 1.25;
}

.panel h3 {
  font-size: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 9999px;
  background: var(--border);
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status.open {
  background: var(--success-soft);
  color: var(--success);
}

.status.pending_close {
  background: var(--warning-soft);
  color: var(--warning);
}

.status.closed {
  background: var(--primary-soft);
  color: var(--primary);
}

.shift-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.fact {
  min-height: 70px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.fact strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 12px;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 700;
}

.btn:hover {
  background: #e8e9ea;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.success:hover {
  background: #087d3c;
}

.btn.warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.metric-card {
  min-height: 88px;
  padding: 12px;
}

.metric-button {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.metric-button:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.metric-card span {
  display: block;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 700;
}

.next-days,
.summary-list {
  display: grid;
  gap: 8px;
}

.next-day {
  padding: 10px;
}

.next-day strong,
.next-day span {
  display: block;
}

.next-day strong {
  font-size: 13px;
}

.next-day span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  font-size: 13px;
}

.summary-row span {
  color: var(--muted);
}

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

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

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

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

.form-grid > .full {
  grid-column: 1 / -1;
}

.field label,
.field > span {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
  outline: none;
}

.field textarea {
  min-height: 74px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 115, 225, 0.14);
}

.field .error {
  min-height: 15px;
  color: var(--danger);
  font-size: 12px;
}

.readonly-total {
  display: flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(40, 46, 51, 0.45);
  z-index: 80;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal.large {
  width: min(820px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.modal p {
  margin: 4px 0 0;
  font-size: 13px;
}

.close-button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--border);
  color: var(--muted-2);
  font-size: 20px;
  line-height: 1;
}

.modal-error,
.notice {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

.modal-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
}

.notice {
  background: var(--warning-soft);
  color: #8a5400;
  border: 1px solid #fdd9a4;
}

.notification-message {
  margin: 0 0 16px;
  white-space: pre-wrap;
  color: var(--text);
}

.shift-top-action {
  white-space: nowrap;
}

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

.history-filters {
  display: flex;
  justify-content: flex-end;
}

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

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

.history-time,
.history-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-time span,
.history-body span,
.history-body small {
  color: var(--muted);
  font-size: 12px;
}

.history-body strong,
.history-body span,
.history-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-history-mini,
.timesheet-history {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.shift-history-mini h3,
.timesheet-history h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.timesheet-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) minmax(90px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

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

.timesheet-history-row small {
  color: var(--muted);
}

.loading,
.empty {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-grid.one-col {
  grid-template-columns: 1fr;
}

.auth-layout {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
}

.auth-card {
  width: min(420px, 100%);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card .brand-mark {
  margin-bottom: 14px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.auth-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.auth-submit {
  width: 100%;
  margin-top: 12px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.auth-links button {
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

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

.admin-subtabs {
  width: fit-content;
  margin-bottom: 14px;
}

.admin-user {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-user[open] {
  background: #fff;
}

.admin-user-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, auto) 24px;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.admin-user-summary::-webkit-details-marker {
  display: none;
}

.admin-user-main {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.admin-user-main strong,
.admin-user-main span,
.admin-user-main small {
  display: block;
}

.admin-user-main span,
.admin-user-main small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-user-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}

.admin-user-badges > span:not(.status) {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.admin-chevron {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.admin-user[open] .admin-chevron {
  transform: rotate(-90deg);
}

.admin-user-details {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.user-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.user-data-grid > div {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.user-data-grid span {
  color: var(--muted);
  font-size: 12px;
}

.user-data-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.admin-access-details {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.admin-access-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.admin-access-details summary::-webkit-details-marker {
  display: none;
}

.admin-access-details summary span,
.admin-access-details summary strong,
.admin-access-details summary small {
  display: block;
  min-width: 0;
}

.admin-access-details summary small {
  color: var(--muted);
  font-size: 12px;
}

.admin-access-details summary b {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.admin-access-details[open] summary b {
  transform: rotate(-90deg);
}

.admin-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.admin-access-grid .toggle-line {
  min-height: 42px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.field.compact {
  gap: 4px;
}

.field.compact span,
.toggle-line span {
  font-size: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  color: var(--muted-2);
  font-weight: 700;
}

.toggle-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.admin-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.finance-tabs {
  display: flex;
  gap: 0;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.finance-tabs button {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-2);
  font-weight: 500;
  white-space: nowrap;
}

.finance-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

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

.finance-accounts {
  display: grid;
  gap: 12px;
}

.finance-account-list {
  display: grid;
  gap: 10px;
}

.finance-total-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

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

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

.finance-account {
  display: grid;
  gap: 14px;
  min-height: 92px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
}

.finance-account.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(25, 115, 225, 0.14);
}

.finance-account span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.finance-account b {
  justify-self: end;
}

.finance-account-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.finance-account-icon.card {
  background: var(--purple);
}

.finance-account-icon.cash {
  background: var(--success);
}

.finance-account-icon.other {
  background: var(--muted);
}

.finance-account-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.finance-content,
.finance-transactions-panel,
.finance-placeholder {
  min-width: 0;
}

.finance-panel-actions,
.finance-actions-menu {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.finance-filters {
  display: grid;
  grid-template-columns: minmax(180px, 220px) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

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

.finance-summary-cards div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

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

.finance-actions-menu {
  justify-content: flex-end;
}

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

.finance-table-head,
.finance-row {
  display: grid;
  grid-template-columns: 155px minmax(260px, 1fr) 112px 112px 112px 170px;
  min-width: 950px;
}

.finance-table-head {
  min-height: 46px;
  align-items: center;
  background: var(--border);
  color: var(--text);
  font-size: 13px;
}

.finance-table-head span,
.finance-row > span,
.finance-row > strong {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.finance-row {
  align-items: start;
  background: #fff;
}

.finance-row.deleted {
  background: #f8fafc;
  color: var(--muted);
}

.finance-row.deleted > span:not(.finance-row-actions),
.finance-row.deleted > strong {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(148, 163, 184, 0.9);
}

.finance-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.finance-row .positive {
  color: var(--success);
}

.finance-row .negative {
  color: var(--danger);
}

.finance-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

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

.finance-mini-list article {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.finance-mini-list article div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.finance-mini-list article span {
  color: var(--muted);
  font-size: 13px;
}

.finance-mini-list article b {
  white-space: nowrap;
}

.finance-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 48px 16px;
  color: var(--muted-2);
  text-align: center;
}

.finance-empty strong {
  color: var(--text);
  font-size: 18px;
}

.finance-empty-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 60px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 28px;
}

.notification-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}

.notification-composer,
.notification-side,
.notification-section {
  display: grid;
  gap: 12px;
}

.notification-composer {
  align-content: start;
}

.notification-section {
  min-width: 0;
}

.section-label {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 800;
}

.compact-segmented {
  width: fit-content;
}

.compact-segmented .seg-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.compact-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notification-recipients[hidden] {
  display: none;
}

.template-row,
.history-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.recipient-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.recipient-toolbar .error {
  margin: 0;
}

.recipient-picker {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.recipient-picker summary {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--muted-2);
  cursor: pointer;
  list-style: none;
}

.recipient-picker summary::-webkit-details-marker {
  display: none;
}

.recipient-picker summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-picker summary b {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 12px;
}

.recipient-picker[open] summary {
  border-bottom: 1px solid var(--border);
}

.notification-recipients {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.recipient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.recipient-chip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.recipient-chip:has(input:disabled) {
  cursor: default;
}

.recipient-chip:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.recipient-chip input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.recipient-chip .avatar {
  width: 28px;
  height: 28px;
}

.recipient-text,
.recipient-text strong,
.recipient-text small {
  display: block;
  min-width: 0;
}

.recipient-text small {
  color: var(--muted);
}

.template-btn {
  margin-left: 0;
}

.saved-template-block {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

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

.saved-template-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
}

.saved-template-item:hover {
  border-color: var(--primary);
}

.saved-template-item[open] {
  background: var(--primary-soft);
}

.saved-template-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.saved-template-item summary::-webkit-details-marker {
  display: none;
}

.saved-template-item summary b {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.saved-template-item[open] summary b {
  transform: rotate(-90deg);
}

.saved-template-item span,
.saved-template-item strong,
.saved-template-item small {
  display: block;
  min-width: 0;
}

.saved-template-item small {
  color: var(--muted);
  font-size: 12px;
}

.saved-template-details {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.saved-template-details p {
  margin: 0;
  color: var(--muted-2);
  white-space: pre-wrap;
}

.compact-empty {
  min-height: 42px;
  padding: 10px 12px;
}

.notification-schedule-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(160px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.notification-section .field input,
.notification-section .field select {
  min-height: 42px;
}

.notification-section .field textarea {
  min-height: 92px;
}

.notification-preview-card {
  display: grid;
  gap: 10px;
}

.employee-notification-preview {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.employee-notification-preview h3,
.employee-notification-preview p {
  margin: 0;
}

.employee-notification-preview p {
  min-height: 58px;
  color: var(--muted-2);
  white-space: pre-wrap;
}

.preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.notification-target-note {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.muted-note {
  background: var(--surface-soft);
  color: var(--muted-2);
}

.notification-history {
  display: grid;
  gap: 8px;
}

.notification-row {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.notification-row strong,
.notification-row span {
  display: block;
}

.notification-row span {
  margin-top: 3px;
  color: var(--muted-2);
  white-space: pre-wrap;
}

.notification-row small {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(520px, calc(100vw - 36px));
  padding: 12px 14px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.calendar-topbar {
  align-items: center;
}

.calendar-toolbar,
.segmented {
  display: flex;
  gap: 6px;
  align-items: center;
}

.segmented {
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
}

.seg-btn {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
}

.seg-btn.active {
  background: var(--border);
  color: var(--text);
}

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 20px;
}

.icon-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.tooltip-btn {
  position: relative;
}

.tooltip-btn::after {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: max-content;
  max-width: 260px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #202830;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow);
}

.tooltip-btn:hover::after,
.tooltip-btn:focus-visible::after {
  display: block;
}

.calendar-tabs-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.calendar-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.calendar-title-row h2 {
  margin: 0;
  text-align: left;
  font-size: 20px;
}

.calendar-view-select {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.calendar-filter-input {
  min-height: 34px;
  width: 190px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.calendar-title-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-title-actions > [data-calendar-view] {
  display: none;
}

.date-filter {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.date-filter-input {
  min-height: 34px;
  max-width: 142px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
}

.schedule-shell {
  overflow: auto;
  max-height: calc(100vh - 190px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.schedule-grid {
  display: grid;
  grid-template-columns: var(--schedule-grid-template, 230px repeat(var(--schedule-days), minmax(var(--schedule-col-width, 128px), 1fr)));
  min-width: var(--schedule-grid-min-width, calc(230px + var(--schedule-days) * var(--schedule-col-width, 128px)));
}

.schedule-grid-days {
  grid-template-columns: var(--schedule-grid-template, 230px repeat(var(--schedule-days), minmax(var(--schedule-col-width, 128px), 1fr)));
}

.schedule-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 10px;
  background: #e9eef5;
  border-right: 1px solid #d8dde5;
  border-bottom: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-head > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-head {
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  cursor: grab;
}

.day-head.dragging {
  opacity: 0.55;
}

.day-head small {
  color: currentColor;
  opacity: 0.7;
  font-size: 13px;
}

.employee-day-head {
  cursor: default;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  z-index: 9;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 4px;
  width: 1px;
  background: rgba(42, 53, 65, 0.22);
  content: "";
}

.column-resize-handle:hover::after,
body.resizing-column .column-resize-handle::after {
  background: var(--primary);
  width: 2px;
}

body.resizing-column,
body.resizing-column * {
  cursor: col-resize !important;
  user-select: none;
}

.schedule-employee-head {
  left: 0;
  z-index: 6;
}

.day-head.today {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.day-head.closed:not(.today),
.schedule-cell.closed {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(147, 150, 153, 0.08) 0,
    rgba(147, 150, 153, 0.08) 6px,
    rgba(255, 255, 255, 0.9) 6px,
    rgba(255, 255, 255, 0.9) 12px
  );
}

.schedule-employee {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 8px 10px;
  background: var(--surface);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
}

.schedule-employee-info {
  min-width: 0;
}

.schedule-employee strong,
.schedule-employee span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-employee strong {
  color: var(--primary);
  font-size: 13px;
}

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

.schedule-employee b {
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-day-label strong {
  color: var(--text);
}

.schedule-day-label {
  grid-template-columns: minmax(0, 1fr);
}

.schedule-day-label.today {
  box-shadow: inset 3px 0 0 var(--primary);
}

.schedule-cell {
  display: flex;
  min-height: 56px;
  align-items: center;
  padding: 6px;
  background-color: #fff;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.schedule-cell:hover {
  background-color: var(--primary-soft);
}

.schedule-cell.readonly {
  cursor: default;
}

.schedule-cell.readonly:hover {
  background-color: #fff;
}

.schedule-chip {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 6px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}

.schedule-chip strong {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-chip small {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.2;
}

.schedule-chip.work {
  background: #e5f1fb;
  border-color: #d4e7f8;
}

.schedule-chip.replacement {
  background: #e8f6ef;
  border-color: var(--success-soft);
}

.schedule-chip.sick_leave,
.schedule-chip.absence {
  background: #ffdada;
  border-color: #ffc3c3;
  color: #b20f10;
}

.schedule-chip.vacation {
  background: #dff3e9;
  border-color: var(--success-soft);
  color: #087a3c;
}

.schedule-chip.day_off {
  background: #fff1db;
  border-color: #ffdca8;
  color: #8a5400;
}

.schedule-chip.not_working {
  background: #f1f1f2;
  border-color: var(--border-strong);
  color: var(--muted-2);
}

.hours-badge,
.status-icon {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 3px;
  background: #d7eaf9;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.status-icon {
  background: rgba(255, 255, 255, 0.55);
}

.intervals-editor {
  display: grid;
  gap: 8px;
}

.schedule-interval-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
}

.schedule-interval-row span {
  color: var(--muted);
}

.month-calendar-shell {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

.month-weekdays {
  background: #f4f5f6;
  border-bottom: 1px solid var(--border-strong);
}

.month-weekdays strong {
  min-height: 34px;
  padding: 9px 10px;
  border-right: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12px;
  text-align: left;
}

.month-weekdays strong:last-child {
  border-right: 0;
}

.month-calendar-grid {
  grid-auto-rows: minmax(118px, 1fr);
}

.month-day {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 5px;
  min-height: 118px;
  padding: 9px;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
}

.month-day:nth-child(7n) {
  border-right: 0;
}

.month-day:hover {
  background: var(--primary-soft);
}

.month-day.empty {
  background: #f8f8f9;
}

.month-day.weekend {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(147, 150, 153, 0.07) 0,
    rgba(147, 150, 153, 0.07) 6px,
    rgba(255, 255, 255, 0.92) 6px,
    rgba(255, 255, 255, 0.92) 12px
  );
}

.month-day.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.month-day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.month-day-head strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
}

.month-day.today .month-day-head strong {
  background: var(--primary);
  color: #fff;
}

.month-day-head span,
.month-day-total,
.month-more {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.month-day-total {
  min-height: 16px;
}

.month-shifts {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}

.month-shift {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 24px;
  padding: 4px 6px;
  border: 1px solid #d4e7f8;
  border-radius: 4px;
  background: #e5f1fb;
  font-size: 12px;
}

.month-shift b,
.month-shift em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-shift b {
  color: var(--text);
  font-weight: 700;
}

.month-shift em {
  color: var(--muted-2);
  font-style: normal;
}

.month-shift.sick_leave,
.month-shift.absence {
  background: #ffdada;
  border-color: #ffc3c3;
}

.month-shift.vacation {
  background: #dff3e9;
  border-color: var(--success-soft);
}

.month-shift.day_off {
  background: #fff1db;
  border-color: #ffdca8;
}

.month-shift.not_working {
  background: #f1f1f2;
  border-color: var(--border-strong);
}

.month-shift.readonly {
  opacity: 0.82;
}

.month-more {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 6px;
}

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

.calendar-report-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.reports-workspace {
  display: grid;
  gap: 14px;
}

.reports-tabs {
  width: max-content;
}

.report-summary-panel {
  display: grid;
  gap: 14px;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.report-metrics div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.report-metrics span,
.plan-summary span {
  color: var(--muted);
  font-size: 13px;
}

.report-metrics strong {
  color: var(--text);
  font-size: 18px;
}

.report-metrics .negative {
  color: var(--danger);
}

.plan-summary {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.plan-progress {
  position: relative;
  min-width: 96px;
  height: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #eef3f8;
}

.plan-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--success), var(--primary));
}

.plan-progress b {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--text);
  font-size: 12px;
}

.calendar-report-table-shell {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.calendar-report-table {
  display: grid;
  grid-template-columns: 190px repeat(2, 82px) repeat(2, 104px) repeat(2, 82px) repeat(5, 104px) 128px;
  min-width: 1330px;
}

.cash-report-table {
  display: grid;
  grid-template-columns: 150px repeat(2, 92px) repeat(7, 112px) 112px;
  min-width: 1140px;
}

.violations-report-table {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 180px repeat(2, 96px) 96px;
  min-width: 820px;
}

.reports-salary-table {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(7, minmax(118px, 0.7fr));
  min-width: 1100px;
}

.report-head,
.report-cell {
  min-height: 48px;
  padding: 9px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.report-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  background: #f4f5f6;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}

.report-cell {
  display: grid;
  align-content: center;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.report-cell.strong {
  font-weight: 800;
}

.report-cell.total {
  background: var(--primary-soft);
  font-weight: 700;
}

.report-date span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.report-date.late,
.report-cell.late-time {
  background: #fff1f2;
  color: var(--danger);
}

.report-empty {
  grid-column: 1 / -1;
  min-height: 140px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.calendar-report-employees {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
}

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

.report-employee {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.report-employee.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.report-employee strong,
.report-employee small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-employee small {
  color: var(--muted);
}

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

.salary-month-title {
  display: inline-flex;
  min-width: 150px;
  justify-content: center;
  color: var(--text);
  font-size: 14px;
}

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

.salary-balance {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

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

.salary-history {
  display: grid;
  gap: 8px;
}

.salary-history-row {
  align-items: flex-start;
}

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

.salary-history-row small {
  color: var(--muted);
}

.salary-history-row .positive {
  color: var(--success);
}

.salary-history-row .negative {
  color: var(--danger);
}

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

.salary-payment-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.salary-payment-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

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

.salary-payment-row b {
  white-space: nowrap;
}

.salary-link {
  text-align: left;
}

.salary-link:hover {
  background: var(--primary-soft);
}

.salary-table-shell {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.salary-table {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(7, minmax(118px, 0.7fr)) minmax(230px, 1fr);
  min-width: 1300px;
}

.salary-table-head,
.salary-table-cell {
  min-height: 54px;
  padding: 9px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.salary-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  background: #f4f5f6;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}

.salary-table-cell {
  display: grid;
  align-content: center;
  gap: 2px;
  border-radius: 0;
}

button.salary-table-cell:hover {
  background: var(--primary-soft);
}

.salary-table-cell strong,
.salary-table-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.salary-table-cell.positive strong {
  color: var(--success);
}

.salary-table-cell.negative strong {
  color: var(--danger);
}

.employee-cell {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.action-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

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

.salary-modal-tabs {
  width: max-content;
  margin-bottom: 12px;
}

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

.salary-detail-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) repeat(5, minmax(100px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.salary-detail-row strong,
.salary-detail-row span {
  display: block;
}

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

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

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

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

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

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

  .calendar-report-employees {
    position: static;
    order: -1;
  }

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

  .notification-schedule-grid {
    grid-template-columns: 1fr;
  }

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

  .salary-metrics,
  .salary-detail-summary,
  .salary-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .salary-detail-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user {
    grid-template-columns: 1fr;
  }

  .admin-user-summary {
    grid-template-columns: minmax(0, 1fr) 24px;
  }

  .admin-user-badges {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .calendar-topbar,
  .calendar-title-row {
    grid-template-columns: 1fr;
  }

  .calendar-title-row h2 {
    text-align: left;
  }

  .calendar-title-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .month-calendar-grid {
    grid-auto-rows: minmax(104px, 1fr);
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    border-right: 0;
    box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.1);
  }

  .brand {
    display: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 4px;
  }

  .nav-link {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 5px 3px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .nav-link::before {
    width: 20px;
    height: 20px;
    margin-right: 0;
    border-radius: 6px;
    background: var(--border-strong);
  }

  .nav-link.active::before {
    background: var(--primary);
  }

  .nav-link.disabled {
    display: none;
  }

  .workspace {
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .topbar,
  .panel-header {
    display: grid;
  }

  .modal-backdrop {
    place-items: start center;
    align-items: start;
    overflow-y: auto;
    padding: 8px;
    overscroll-behavior: contain;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 14px;
    border-radius: 8px;
  }

  .modal > .actions {
    position: sticky;
    bottom: -14px;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 14px -14px -14px !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .modal > .actions .btn {
    width: 100%;
  }

  .employee-pill {
    min-width: 0;
  }

  .admin-subtabs {
    width: 100%;
    align-items: stretch;
  }

  .admin-subtabs .seg-btn {
    flex: 1;
  }

  .finance-filters {
    grid-template-columns: 1fr;
  }

  .finance-actions-menu {
    justify-content: flex-start;
  }

  .finance-panel-actions {
    justify-content: flex-start;
  }

  .history-row,
  .timesheet-history-row {
    grid-template-columns: 1fr;
  }

  .history-filters {
    justify-content: flex-start;
  }

  .shift-facts,
  .form-grid,
  .metrics-grid,
  .salary-metrics,
  .salary-detail-summary,
  .salary-actions-grid,
  .admin-controls {
    grid-template-columns: 1fr;
  }

  .salary-detail-row {
    grid-template-columns: 1fr;
  }

  .month-calendar-shell {
    overflow-x: auto;
  }

  .month-weekdays,
  .month-calendar-grid {
    min-width: 720px;
  }

  .auth-links,
  .admin-actions {
    display: grid;
    justify-content: stretch;
  }

  .calendar-toolbar {
    flex-wrap: wrap;
  }

  .calendar-filter-input,
  .calendar-view-select,
  .date-filter-input {
    width: 100%;
    max-width: none;
  }

  .date-filter,
  .calendar-title-actions {
    width: 100%;
  }

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

  .plan-summary {
    min-width: 0;
  }

  .calendar-report-table {
    min-width: 1220px;
  }

  .greeting h1 {
    font-size: 18px;
  }
}
