:root {
  --navy: #172a2a;
  --text: #243634;
  --muted: #7c8883;
  --line: #e4e8e2;
  --bg: #f6f7f3;
  --lime: #d7f184;
  --green: #264b40;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8bab55;
  outline-offset: 3px;
}
button:hover {
  filter: brightness(0.97);
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
.sidebar {
  width: 236px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--navy);
  color: #e4ece4;
  padding: 35px 20px 25px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 31px;
  letter-spacing: -1.7px;
  font-weight: 750;
  padding: 0 9px;
}
.brand-crest {
  width: 39px;
  height: 43px;
  margin-right: 10px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-icon {
  font-size: 21px;
  border: 2px solid var(--lime);
  border-radius: 10px;
  width: 34px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime);
  margin-right: 11px;
  letter-spacing: -4px;
}
.brand-icon span {
  font-size: 23px;
}
.brand-dot {
  color: var(--lime);
}
.nav-label {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #81958a;
  padding: 0 12px;
  margin-bottom: 14px;
}
.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 8px 0;
  scrollbar-width: thin;
}
.nav-more {
  margin: 9px 0 2px;
  border-top: 1px solid #30443d;
  padding-top: 8px;
}
.nav-more summary {
  cursor: pointer;
  list-style: none;
  color: #91a59a;
  font-size: 11px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary span { font-size: 14px; }
.nav-more[open] summary span { transform: rotate(180deg); }
.nav-more-items .nav-item { padding-top: 10px; padding-bottom: 10px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #aab9b0;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 8px;
  padding: 13px 12px;
  text-align: left;
  margin: 4px 0;
  font-size: 13px;
  gap: 12px;
}
.nav-item > span {
  font-size: 20px;
  width: 19px;
  line-height: 20px;
}
.nav-item.active {
  background: var(--lime);
  color: #273b2f;
  font-weight: 600;
}
.nav-item b {
  font-size: 10px;
  margin-left: auto;
  opacity: 0.7;
  font-weight: 500;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 10px 0;
  flex: 0 0 auto;
  background: var(--navy);
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #9fbd73;
  border-radius: 50%;
}
.sidebar-bottom p {
  font-size: 12px;
  line-height: 1.8;
  color: #91a59a;
  margin: 9px 0 13px;
}
.sidebar-line {
  height: 1px;
  background: #344941;
  margin-bottom: 13px;
}
.sidebar-bottom label {
  font-size: 10px;
  color: #9daf9f;
}
.sidebar-bottom select {
  width: 100%;
  border: 0;
  color: #ecf1e6;
  background: #263d35;
  border-radius: 7px;
  padding: 10px 7px;
  margin: 9px 0;
}
.sidebar-bottom small {
  font-size: 9px;
  color: #8b9d90;
}
main {
  margin-left: 236px;
}
.topbar {
  height: 78px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  color: #92998f;
}
.topbar strong {
  font-weight: 500;
  color: #3f5046;
}
.topbar span {
  margin: 0 12px;
}
.topbar-right {
  display: flex;
  align-items: center;
  color: #59695c;
}
.topbar-right .live-dot {
  margin-right: 7px;
}
.avatar {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  background: #edf0e7;
  border: 1px solid #dfe6d3;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
}
.content {
  padding: 34px 38px 20px;
  max-width: 1850px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #83917e;
  font-weight: 600;
}
h1 {
  font-size: 31px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 10px 0;
}
p {
  line-height: 1.6;
}
.page-heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.primary,
.secondary,
.danger {
  border: 0;
  border-radius: 7px;
  padding: 12px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 550;
  font-size: 12px;
  white-space: nowrap;
}
.primary {
  background: var(--green);
  color: white;
}
.primary span {
  font-size: 19px;
  line-height: 16px;
}
.secondary {
  background: white;
  border: 1px solid #dce2d9;
  color: #526050;
}
.compact {
  padding: 8px 12px;
  font-size: 11px;
}
.danger {
  color: #a44040;
  background: #fcf0ee;
  margin-right: auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 27px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px 20px;
}
.stat > div {
  font-size: 11px;
  color: #71806f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat > div span {
  font-size: 19px;
  color: #8c9e7b;
}
.stat > strong {
  font-size: 33px;
  display: block;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 10px 0 4px;
}
.stat > small {
  font-size: 10px;
  color: #86937f;
}
.stat.accent {
  background: #ecf1df;
  border-color: #e0e8cc;
}
.period-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.month-nav strong {
  font-size: 15px;
  font-weight: 550;
  min-width: 210px;
  text-align: center;
}
.month-nav .secondary {
  margin-left: 10px;
}
.icon-btn {
  background: transparent;
  border: 1px solid #dce2d9;
  border-radius: 6px;
  width: 29px;
  height: 29px;
  font-size: 21px;
  line-height: 21px;
  color: #6a7964;
}
.timezone {
  font-size: 10px;
  color: #87907f;
}
.calendar-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.calendar-tools {
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.segmented {
  background: #f2f4ee;
  padding: 3px;
  display: flex;
  border-radius: 7px;
  flex-shrink: 0;
}
.segmented button {
  border: 0;
  background: transparent;
  color: #8b9584;
  font-size: 11px;
  padding: 8px 13px;
  border-radius: 5px;
}
.segmented button.active {
  background: white;
  color: #3b5137;
  box-shadow: 0 1px 4px #23382212;
}
.filters {
  display: flex;
  gap: 9px;
  align-items: center;
}
.search-box {
  border: 1px solid #e2e7de;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  gap: 7px;
  color: #8b9681;
}
.search-box input {
  border: 0;
  outline: 0;
  width: 185px;
  font-size: 10px;
  padding: 9px 0;
  background: transparent;
  color: #506047;
}
.search-box span {
  font-size: 19px;
}
.filters select {
  padding: 8px;
  border: 1px solid #e2e7de;
  border-radius: 6px;
  background: white;
  font-size: 10px;
  color: #5d6c52;
  max-width: 150px;
}
.calendar-scroll {
  overflow: auto;
}
.calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1030px;
}
.calendar thead {
  background: #fbfcf8;
}
.calendar th {
  height: 63px;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 500;
  color: #86917c;
}
.calendar th:first-child {
  width: 185px;
  text-align: left;
  padding: 0 17px;
}
.calendar th .day-num {
  font-size: 16px;
  color: #58654f;
  display: block;
  margin-top: 5px;
  font-weight: 550;
}
.calendar th.is-today .day-num {
  background: var(--green);
  color: #fff;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  margin: 4px auto 0;
}
.calendar th.is-today {
  color: var(--green);
}
.calendar td {
  border-bottom: 1px solid #e9ece5;
  border-right: 1px solid #eff1eb;
  padding: 7px;
  vertical-align: top;
  height: 91px;
}
.calendar tbody tr:last-child td {
  border-bottom: 0;
}
.calendar td:first-child {
  padding: 17px;
  vertical-align: middle;
  background: #fff;
}
.calendar td:last-child {
  border-right: 0;
}
.row-name {
  font-size: 11px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  line-height: 1.4;
}
.row-meta {
  font-size: 9px;
  color: #909984;
  display: block;
  line-height: 1.5;
}
.site-mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  margin-right: 6px;
  background: #b4a1cf;
}
.shift {
  display: block;
  width: 100%;
  border: 0;
  border-left: 3px solid #bea9d5;
  background: #f3edf9;
  color: #6e5489;
  border-radius: 5px;
  padding: 8px 7px;
  text-align: left;
  margin-bottom: 5px;
  min-height: 61px;
}
.shift-time {
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  display: block;
}
.shift-name {
  font-size: 9px;
  display: block;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.87;
}
.shift-hours {
  font-size: 8px;
  display: block;
  margin-top: 5px;
  opacity: 0.75;
}
.shift.blue {
  background: #eef2fa;
  border-color: #9eb7dd;
  color: #557298;
}
.shift.teal {
  background: #eaf4f0;
  border-color: #97c2b1;
  color: #537b6c;
}
.shift.amber {
  background: #fbf4e7;
  border-color: #d6be83;
  color: #978048;
}
.shift.rose {
  background: #faeeee;
  border-color: #d9a5aa;
  color: #9a6b70;
}
.add-cell {
  width: 100%;
  min-height: 60px;
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 6px;
  color: #cbd3c1;
  font-size: 20px;
}
.add-cell:hover {
  border-color: #cbd3c1;
  background: #f6f9f1;
  color: #5b7746;
}
.calendar-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: #939c88;
}
.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #b3c8a2;
  border-radius: 2px;
  margin-right: 5px;
}
.night-legend {
  margin-left: 15px;
}
.info-note {
  display: flex;
  gap: 12px;
  padding: 19px 0;
  color: #788771;
  align-items: flex-start;
}
.info-note > span {
  font-size: 22px;
}
.info-note strong {
  font-size: 11px;
  font-weight: 550;
}
.info-note p {
  font-size: 10px;
  margin: 5px 0;
}
.main-footer {
  display: flex;
  justify-content: space-between;
  color: #9aa28f;
  font-size: 9px;
  margin-top: 25px;
}
.main-footer > span:first-child {
  letter-spacing: 1.4px;
}
.section-intro h2 {
  font-size: 19px;
  font-weight: 550;
  margin: 8px 0;
}
.section-intro p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 20px;
}
.guard-grid,
.site-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.types-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.types-table-scroll {
  margin-top: 4px;
}
.types-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (max-width: 620px) {
  .types-tools {
    align-items: stretch;
    flex-direction: column;
  }
}
.person-card,
.site-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.person-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.person-avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  background: #eaf0df;
  border-radius: 50%;
  color: #617843;
  font-size: 12px;
}
.person-top strong {
  font-size: 12px;
  font-weight: 550;
}
.person-top small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
}
.person-hours {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 19px;
}
.person-hours strong {
  font-size: 26px;
  font-weight: 550;
}
.person-hours span {
  font-size: 10px;
  color: var(--muted);
}
.meter {
  height: 5px;
  background: #edf1e7;
  border-radius: 5px;
  margin-top: 12px;
  width: 100%;
  border: 0;
}
.meter::-webkit-progress-bar {
  background: #edf1e7;
  border-radius: 5px;
}
.meter::-webkit-progress-value {
  background: #afc979;
  border-radius: 5px;
}
.meter::-moz-progress-bar {
  background: #afc979;
}
.site-card h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
.site-card p {
  color: var(--muted);
  font-size: 11px;
}
.site-card .site-stats {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  font-size: 12px;
}
.rule-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
  margin-bottom: 12px;
}
.rule-card h3 {
  font-size: 13px;
  margin: 0 0 8px;
}
.rule-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0;
}
.rule-badge {
  font-size: 10px;
  display: inline-block;
  color: #936747;
  background: #fbf2e5;
  padding: 5px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.empty {
  padding: 50px 20px;
  text-align: center;
  background: white;
  border: 1px dashed #dce3d4;
  border-radius: 10px;
  color: #7e8f72;
  font-size: 13px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  width: 550px;
  max-width: calc(100% - 24px);
  padding: 27px;
  box-shadow: 0 20px 90px #14292033;
  color: var(--text);
}
dialog::backdrop {
  background: #14292166;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  font-size: 24px;
  letter-spacing: -0.6px;
  margin: 8px 0 0;
  font-weight: 600;
}
.dialog-heading .icon-btn {
  border: 0;
  font-size: 27px;
}
form label {
  display: block;
  font-size: 11px;
  font-weight: 550;
  margin-bottom: 16px;
}
form input,
form select,
form textarea {
  display: block;
  width: 100%;
  border: 1px solid #dce3d7;
  background: #fff;
  color: #42513c;
  padding: 11px;
  border-radius: 6px;
  margin-top: 7px;
  font-size: 12px;
}
form textarea {
  resize: vertical;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.balance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.balance-toolbar label {
  display: grid;
  gap: 6px;
}
.balance-toolbar input,
.balance-toolbar select {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}
.balance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.balance-indicator {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12px;
  white-space: normal;
}
.balance-indicator small {
  font-size: 11px;
}
.balance-under {
  background: #fff3d9;
  color: #765100;
}
.balance-over {
  background: #fce4e4;
  color: #9d2424;
}
.balance-met {
  background: #e5f3e8;
  color: #235f36;
}
.balance-missing {
  background: #edf0f2;
  color: #48535c;
}
#shift-balance {
  margin: 8px 0 16px;
}
#shift-balance p {
  display: flex;
}
.form-hint {
  font-size: 10px;
  color: var(--muted);
  margin: -3px 0 19px;
}
.optional {
  font-size: 10px;
  color: #949d8b;
  font-weight: 400;
  margin-left: 5px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 23px;
}
.error-banner,
.form-error {
  background: #fff0ed;
  border: 1px solid #f0cbc3;
  border-radius: 7px;
  padding: 13px;
  color: #a14335;
  font-size: 12px;
  line-height: 1.6;
}
.error-banner {
  margin-bottom: 16px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #e6f1dd;
  border-radius: 9px;
  padding: 15px 25px;
  font-size: 12px;
  box-shadow: 0 5px 25px #0002;
  z-index: 100;
}
.calendar td.is-today {
  background: #fbfcf7;
}
.no-results {
  height: 130px !important;
  text-align: center;
  color: #89957b;
  font-size: 12px;
}
@media (min-width: 1600px) {
  .calendar td {
    height: 110px;
  }
  .shift {
    min-height: 76px;
    padding: 11px;
  }
  .shift-time {
    font-size: 12px;
  }
  .shift-name {
    font-size: 11px;
  }
  .calendar th:first-child {
    width: 210px;
  }
  .row-name {
    font-size: 12px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 205px;
    padding-left: 15px;
    padding-right: 15px;
  }
  main {
    margin-left: 205px;
  }
  .content {
    padding: 25px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .calendar-tools {
    flex-wrap: wrap;
  }
  .guard-grid,
  .site-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    padding: 16px;
  }
  .page-heading p {
    max-width: 310px;
  }
  .filters {
    flex-wrap: wrap;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
    display: block;
  }
  .brand {
    font-size: 24px;
  }
  .brand-icon {
    width: 27px;
    height: 29px;
    font-size: 17px;
  }
  .nav-label,
  .sidebar-bottom p,
  .sidebar-line {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    margin-top: 15px;
  }
  .nav-item {
    justify-content: center;
    white-space: nowrap;
    padding: 10px;
    font-size: 11px;
    gap: 5px;
  }
  .nav-item > span {
    display: none;
  }
  .nav-item b {
    margin-left: 3px;
  }
  .sidebar-bottom {
    padding: 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .sidebar-bottom select {
    width: auto;
    font-size: 11px;
    margin: 0;
  }
  .sidebar-bottom small {
    margin-left: auto;
  }
  main {
    margin: 0;
  }
  .topbar {
    height: 48px;
    padding: 0 16px;
  }
  .topbar-right {
    display: none;
  }
  .content {
    padding: 25px 15px;
  }
  .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 27px;
  }
  .page-heading .primary {
    padding: 10px 13px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat > strong {
    font-size: 28px;
  }
  .timezone {
    display: none;
  }
  .month-nav {
    gap: 5px;
  }
  .month-nav strong {
    min-width: 180px;
    font-size: 13px;
  }
  .month-nav .secondary {
    margin-left: 2px;
  }
  .calendar-tools {
    padding: 12px;
    gap: 14px;
  }
  .filters {
    width: 100%;
  }
  .search-box {
    flex: 1;
  }
  .search-box input {
    width: 100%;
    min-width: 100px;
  }
  .filters select {
    max-width: 125px;
  }
  .filters .secondary {
    display: none;
  }
  .calendar-footer {
    flex-direction: column;
  }
  .guard-grid,
  .site-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .dialog-footer {
    flex-wrap: wrap;
  }
  .info-note p {
    font-size: 10px;
  }
  .main-footer {
    font-size: 8px;
  }
  .rule-card {
    align-items: flex-start;
  }
  .rule-card .danger {
    padding: 8px;
  }
  .sidebar-bottom label {
    font-size: 9px;
  }
}
@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }
  .sidebar,
  .topbar,
  .page-heading .primary,
  .stats,
  .period-toolbar button,
  .calendar-tools,
  .info-note,
  .main-footer,
  .calendar-footer,
  .add-cell {
    display: none !important;
  }
  main {
    margin: 0;
  }
  .content {
    padding: 0;
    max-width: none;
  }
  .page-heading {
    margin: 0 0 10px;
  }
  .page-heading p,
  .eyebrow {
    display: none;
  }
  .calendar-scroll {
    overflow: visible;
  }
  .calendar {
    min-width: 0;
    width: 100%;
    font-size: 8px;
  }
  .calendar th:first-child {
    width: 125px;
  }
  .calendar td {
    padding: 4px !important;
    height: 65px;
  }
  .calendar th {
    height: 40px;
  }
  .shift {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    padding: 4px;
    min-height: 45px;
    break-inside: avoid;
  }
  .shift-time,
  .shift-name {
    font-size: 8px;
  }
  .shift-hours {
    font-size: 7px;
  }
  .row-name {
    font-size: 9px;
  }
  .row-meta {
    font-size: 8px;
  }
  .calendar tr {
    break-inside: avoid;
  }
  .calendar-panel {
    overflow: visible;
  }
  body {
    background: #fff;
  }
}
.period-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}
.month-nav strong::first-letter {
  text-transform: uppercase;
}
.calendar th.weekend,
.calendar td.weekend {
  background: #f3f4f0;
}
.calendar tfoot td {
  height: 43px !important;
  background: #f7f9f2 !important;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  text-align: center;
  border-top: 1px solid #dce3d5;
}
.calendar tfoot td:first-child {
  text-align: left;
}
.calendar .total-col {
  width: 65px;
  text-align: center;
  vertical-align: middle;
  background: #f7f9f2;
  font-size: 12px;
  border-left: 1px solid #e1e7d8;
}
.calendar .total-col .row-meta {
  font-size: 8px;
  margin-top: 5px;
}
.calendar.monthly {
  min-width: 1540px;
}
.calendar.monthly th:first-child {
  width: 168px;
}
.calendar.monthly th {
  height: 54px;
  font-size: 8px;
}
.calendar.monthly th .day-num {
  font-size: 12px;
}
.calendar.monthly td {
  padding: 3px;
  height: 60px;
}
.calendar.monthly td:first-child {
  padding: 10px 12px;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 2px 0 5px #00000005;
}
.calendar.monthly th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fbfcf8;
}
.calendar.monthly .row-meta {
  font-size: 8px;
}
.calendar.monthly .row-name {
  font-size: 10px;
}
.calendar.monthly .shift {
  padding: 6px 2px;
  min-height: 44px;
  border-left-width: 2px;
  text-align: center;
  margin-bottom: 3px;
  position: relative;
}
.calendar.monthly .shift-time {
  font-size: 12px;
  font-weight: 600;
}
.calendar.monthly .shift-name {
  font-size: 7px;
  margin-top: 4px;
}
.calendar.monthly .night-icon {
  position: absolute;
  right: 1px;
  top: 1px;
  font-size: 8px;
}
.calendar.monthly .add-cell {
  min-height: 43px;
  font-size: 15px;
}
.calendar.monthly .total-col {
  width: 65px;
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -2px 0 5px #00000004;
}
.calendar.monthly.with-balances .total-col {
  width: 135px;
}
.calendar.monthly.site-roster {
  min-width: 1680px;
}
.calendar.monthly.site-roster th:first-child {
  width: 190px;
}
.calendar.monthly.site-roster td {
  height: 64px;
}
.calendar.monthly.site-roster .shift {
  min-height: 31px;
  padding: 4px 1px;
}
.calendar.monthly.site-roster .shift-name {
  margin-top: 1px;
}
.calendar.monthly.site-roster .roster-add {
  display: none;
}
.calendar.monthly.site-roster td:hover .roster-add {
  display: block;
  min-height: 18px;
  line-height: 16px;
  margin-top: 2px;
}
.calendar.with-balances .balance-indicator {
  width: 100%;
  box-sizing: border-box;
}
.calendar.monthly tfoot td {
  font-size: 9px;
}
.calendar.monthly th.is-today .day-num {
  width: 24px;
  height: 24px;
  line-height: 24px;
}
@media (max-width: 760px) {
  .period-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .period-controls {
    margin-left: auto;
  }
  .period-controls .segmented button {
    padding: 6px 13px;
  }
  .calendar.monthly {
    min-width: 1400px;
  }
}
@media print {
  .period-controls {
    display: none !important;
  }
  .calendar.monthly {
    min-width: 0;
    font-size: 7px;
  }
  .calendar.monthly th:first-child {
    width: 90px;
  }
  .calendar.monthly .total-col {
    width: 35px;
    position: static;
  }
  .calendar.monthly.site-roster {
    min-width: 0;
  }
  .calendar.monthly.site-roster th:first-child {
    width: 105px;
  }
  .calendar.monthly td:first-child,
  .calendar.monthly th:first-child {
    position: static;
  }
  .calendar.monthly td {
    padding: 1px !important;
    height: 34px;
  }
  .calendar.monthly .shift {
    min-height: 26px;
    padding: 2px 0;
    border-left-width: 1px;
  }
  .calendar.monthly .shift-time {
    font-size: 8px;
  }
  .calendar.monthly .shift-name {
    font-size: 5px;
    margin-top: 2px;
  }
  .calendar.monthly .row-name {
    font-size: 7px;
  }
  .calendar.monthly .row-meta {
    font-size: 5px;
  }
  .calendar.monthly tfoot td {
    font-size: 6px;
  }
}
.calendar.monthly .shift-location {
  display: block;
  font-size: 6px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.calendar.monthly .shift-name {
  font-size: 8px;
}
.type-time {
  font-size: 21px !important;
  font-weight: 550;
  color: #46603c !important;
  margin: 22px 0 !important;
}
.type-time small {
  font-size: 10px;
  font-weight: 400;
}
.calendar.monthly .shift {
  min-height: 51px;
}
.shift-with-add {
  position: relative;
  margin-bottom: 3px;
}
.calendar.monthly .shift-with-add > .shift {
  padding-bottom: 26px;
  margin-bottom: 0;
}
.shift-add-guard {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #b1d6b5;
  border-radius: 6px;
  background: #def2da;
  color: #246335;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.shift-add-guard:hover {
  background: #bce5b2;
}
.shift-add-guard:focus-visible {
  outline: 2px solid #246335;
  outline-offset: 1px;
}
@media print {
  .shift-add-guard {
    display: none;
  }
  .calendar.monthly .shift-with-add > .shift {
    padding-bottom: 2px;
  }
}
@media print {
  .calendar.monthly .shift-location {
    font-size: 4px;
  }
  .calendar.monthly .shift-name {
    font-size: 6px;
  }
  .calendar.monthly .shift {
    min-height: 30px;
  }
}

.guard-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.guard-toolbar label {
  font-size: 12px;
  color: var(--muted);
}
.guard-toolbar select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--text);
  min-width: 230px;
}
.guard-open {
  margin-top: 18px;
}
.guard-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.guard-detail-heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 550;
}
.guard-detail-heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 9px 0 0;
}
.guard-shift-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.guard-shift-info {
  min-width: 0;
}
.guard-shift-card h3 {
  font-size: 15px;
  margin: 0 0 9px;
}
.guard-shift-card p {
  font-size: 12px;
  margin: 7px 0;
}
.guard-shift-card small {
  font-size: 10px;
  color: var(--muted);
}
.guard-shift-time {
  font-weight: 550;
}
.guard-shift-note {
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .guard-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .guard-detail-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .guard-shift-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .guard-detail-heading h2 {
    font-size: 20px;
  }
}
@media print {
  .guard-toolbar,
  .guard-open,
  #guard-back,
  [data-edit-guard-shift] {
    display: none !important;
  }
  .guard-shift-card {
    break-inside: avoid;
  }
}

.guard-view-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 15px;
}
.guard-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.guard-shifts-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.guard-shifts-table th,
.guard-shifts-table td {
  padding: 15px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.guard-shifts-table thead th {
  background: #f2f5ed;
  color: #63735b;
  font-size: 10px;
  font-weight: 600;
}
.guard-shifts-table tbody tr:hover {
  background: #fafcf6;
}
.guard-shifts-table time {
  display: block;
  min-width: 120px;
  line-height: 1.6;
}
.guard-shifts-table small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 6px;
}
.guard-hours-cell {
  white-space: nowrap;
}
.guard-comment-cell {
  min-width: 180px;
  max-width: 310px;
}
.guard-comment-cell span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.guard-shifts-table tfoot th,
.guard-shifts-table tfoot td {
  background: #edf2e2;
  border-bottom: 0;
  vertical-align: middle;
}
.users-table {
  min-width: 760px;
}
.audit-filters {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 18px 0 14px;
  flex-wrap: wrap;
}
.audit-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.audit-filters input,
.audit-filters select {
  min-width: 170px;
  height: 42px;
  border-radius: 10px;
}
.audit-filters button { height: 42px; margin: 0; }
.audit-table { min-width: 720px; }
.audit-time { white-space: nowrap; color: var(--muted); }
.audit-action {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--navy);
  background: #edf2e2;
  font-size: 12px;
  font-weight: 700;
}
.audit-row { cursor: pointer; }
.audit-row:hover td { background: #f5f8ef; }
.audit-row:focus-visible { outline: 2px solid var(--lime); outline-offset: -2px; }
#audit-dialog {
  box-sizing: border-box;
  width: min(760px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
#audit-dialog .audit-dialog-body {
  min-width: 0;
  max-width: 100%;
  max-height: calc(100dvh - 80px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}
.audit-snapshot { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 14px; }
.audit-snapshot h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.audit-snapshot-title { display: block; margin-bottom: 12px; font-size: 17px; }
.audit-snapshot dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.audit-snapshot dl div { min-width: 0; }
.audit-snapshot dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.audit-snapshot dd { margin: 3px 0 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .audit-snapshot dl { grid-template-columns: 1fr; } }
.users-actions {
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
}
.users-actions .compact {
  margin: 0;
}
.user-status-on,
.user-status-off {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
}
.user-status-on {
  color: #2f7447;
  background: #e6f3e9;
}
.user-status-off {
  color: #7c6350;
  background: #f1eee8;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media print {
  .guard-view-toolbar {
    display: none !important;
  }
  .guard-table-scroll {
    overflow: visible;
  }
  .guard-shifts-table {
    min-width: 0;
    font-size: 9px;
  }
  .guard-shifts-table time {
    min-width: 0;
  }
  .guard-comment-cell {
    min-width: 0;
  }
  .guard-shifts-table th,
  .guard-shifts-table td {
    padding: 7px;
  }
  .guard-shifts-table tr {
    break-inside: avoid;
  }
}

.guard-view-toolbar {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.guard-export-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
#guard-print-report {
  display: none;
}
@media print {
  body.printing-guard > aside,
  body.printing-guard > main,
  body.printing-guard > dialog,
  body.printing-guard > .toast {
    display: none !important;
  }
  body.printing-guard #guard-print-report {
    display: block !important;
    color: #222;
  }
  #guard-print-report h1 {
    font-size: 20px;
    margin: 0 0 8px;
  }
  #guard-print-report h2 {
    font-size: 17px;
    margin: 0 0 8px;
  }
  #guard-print-report > p {
    font-size: 11px;
    margin: 5px 0 12px;
  }
  #guard-print-report thead {
    display: table-header-group;
  }
  #guard-print-report tfoot {
    display: table-row-group;
  }
  #guard-print-report .guard-table-scroll {
    border-radius: 0;
    overflow: visible;
  }
  #guard-print-report .guard-shifts-table {
    width: 100%;
    min-width: 0;
  }
  #guard-print-report .guard-shifts-table th,
  #guard-print-report .guard-shifts-table td {
    padding: 7px;
  }
  #guard-print-report .guard-shifts-table th {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

#schedule-print-heading {
  display: none;
}
.filters #schedule-pdf,
.filters #print {
  display: inline-flex;
}
@media print {
  #schedule-print-heading {
    display: block;
    padding: 0 0 12px;
  }
  #schedule-print-heading h2 {
    font-size: 17px;
    margin: 0 0 6px;
  }
  #schedule-print-heading p {
    font-size: 10px;
    margin: 0;
  }
  .calendar tfoot {
    display: table-row-group;
  }
}

.pdf-export-scope {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.pdf-options {
  border: 0;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 12px;
}
.pdf-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.pdf-option:has(input:checked) {
  background: #f0f5e5;
  border-color: #9cb76f;
}
.pdf-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--green);
}
.pdf-option strong {
  display: block;
  font-size: 14px;
  font-weight: 550;
}
.pdf-option small {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
}

.accounting-note {
  font-size: 11px;
  color: var(--muted);
  margin: -9px 0 18px;
  line-height: 1.6;
}
@media print {
  .accounting-note {
    font-size: 9px;
    margin: 4px 0 10px;
  }
}

#login-screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: #f5f7f3;
  padding: 24px;
}
#auth-loading {
  display: none;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  background: #f5f7f3;
  color: var(--navy);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.6px;
}
#auth-loading span { color: var(--lime); }
body.auth-pending.logged-out > :not(#auth-loading) {
  display: none !important;
}
body.auth-pending.logged-out #auth-loading { display: flex; }
body.logged-out {
  display: block;
}
body.logged-out > :not(#login-screen):not(.language-switcher) {
  display: none !important;
}
body.logged-out #login-screen {
  display: flex;
}
.login-card {
  width: 420px;
  max-width: 100%;
  padding: 36px;
  background: white;
  border: 1px solid #e2e7de;
  border-radius: 18px;
  box-shadow: 0 16px 60px #182f2910;
}
.login-card h1 {
  color: #23473a;
  font-size: 36px;
  margin: 0 0 30px;
}
.login-card h2 {
  font-size: 22px;
}
.login-card p {
  color: #728074;
  margin: 12px 0 24px;
}
.login-card label {
  display: block;
  margin: 18px 0 8px;
}
.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d8dfd3;
  border-radius: 8px;
}
.login-card button {
  width: 100%;
  margin-top: 24px;
}
.login-card #login-error {
  color: #b42332;
}
#current-user {
  display: block;
  color: white;
  margin: 10px 0;
}
#logout {
  width: 100%;
  margin-top: 10px;
}

.access-copy-row {
  display: flex;
  gap: 8px;
}
.access-copy-row input {
  min-width: 0;
  flex: 1;
  padding: 10px;
  border: 1px solid #d8dfd3;
  border-radius: 8px;
}
.access-copy-row button {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .access-copy-row {
    flex-direction: column;
  }
}

.language-switcher {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #d8e0d1;
  border-radius: 8px;
  background: #fff;
  color: #294035;
  font:
    13px system-ui,
    sans-serif;
  line-height: 1.4;
}
.language-switcher select {
  margin: 0;
  padding: 6px;
  color: #294035;
  background: white;
  border: 0;
  font: inherit;
  line-height: inherit;
}
.language-switcher label {
  margin: 0;
  display: inline;
  font: inherit;
}
body > .language-switcher {
  position: fixed;
  right: 18px;
  top: 12px;
  z-index: 1000;
}
@media print {
  .language-switcher {
    display: none !important;
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.workspace-status {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
@media (max-width: 800px) {
  .workspace-status {
    display: none;
  }
  .topbar {
    height: auto;
    min-height: 58px;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
  }
}

.directory-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.archive-badge {
  display: inline-block;
  margin: 4px 0;
  padding: 2px 8px;
  border-radius: 5px;
  background: #eee8dc;
  color: #766044;
  font-size: 11px;
}
#profile-form,
#site-form {
  padding: 28px;
}
.site-card > button,
.person-card > button {
  margin-top: 8px;
  margin-right: 6px;
}

#unavailability-form {
  padding: 24px;
}
#unavailability-list {
  max-height: 260px;
  overflow: auto;
  margin: 16px 0;
}
.absence-row {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-bottom: 1px solid #dce2d5;
  overflow-wrap: anywhere;
}

.absence-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}
.absence-filters label {
  display: grid;
  gap: 6px;
  min-width: 190px;
}
.absence-filters .secondary {
  min-height: 42px;
  padding-inline: 18px;
}
body.is-absence-page .period-toolbar,
body.is-absence-page .absence-filters,
body.is-absence-page .absence-period-filters {
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1px solid #dfe6d8;
  border-radius: 12px;
  background: #fff;
}
body.is-absence-page .period-toolbar {
  justify-content: flex-start;
  margin-bottom: 12px;
}
body.is-absence-page .period-toolbar .timezone {
  display: none;
}
body.is-absence-page .month-nav {
  gap: 10px;
}
body.is-absence-page .month-nav strong {
  min-width: 230px;
}
body.is-absence-page .absence-filters {
  display: grid;
  grid-template-columns: 240px 240px;
  justify-content: start;
  gap: 14px;
  margin-bottom: 12px;
}
body.is-absence-page .absence-filters label,
body.is-absence-page .absence-period-filters label {
  min-width: 0;
  color: #5b6a58;
  font-size: 11px;
  font-weight: 600;
}
body.is-absence-page .absence-filters label span,
body.is-absence-page .absence-period-filters label span {
  color: #71806d;
  letter-spacing: 0.1px;
}
body.is-absence-page .absence-filters select,
body.is-absence-page .absence-filters input,
body.is-absence-page .absence-period-filters input {
  min-height: 42px;
  border-color: #d7e0d1;
  border-radius: 8px;
  background: #fcfdfb;
}
body.is-absence-page .absence-filters .secondary {
  align-self: end;
  border-color: #cfdbc8;
}
.absence-period-filters {
  display: grid;
  grid-template-columns: 190px 190px max-content;
  justify-content: start;
  align-items: end;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px 18px;
}
.absence-period-filters[hidden] {
  display: none;
}
.absence-period-filters label {
  display: grid;
  gap: 6px;
}
.absence-period-filters .secondary {
  min-height: 42px;
  padding-inline: 18px;
  border-color: #cfdbc8;
}
#absence-records {
  display: grid;
  gap: 12px;
}
.absence-summary {
  display: flex;
  gap: 12px;
  margin: 4px 0 18px;
}
.absence-stat {
  min-width: 150px;
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #f1f4ee;
  color: #4b5d4a;
}
.absence-stat strong {
  font-size: 23px;
}
.absence-stat span {
  font-size: 11px;
  font-weight: 600;
}
.absence-stat.pending {
  background: #fff2d4;
  color: #8a5900;
}
.absence-stat.conflicts {
  background: #fde6e1;
  color: #a14232;
}
.absence-stat.approved {
  background: #e6f2e8;
  color: #2c6a43;
}
.absence-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid #e1e7dc;
  border-radius: 10px;
  background: #f1f4ee;
}
.absence-tabs button {
  border-radius: 7px;
  padding: 9px 16px;
}
.absence-view-heading {
  margin: 4px 0 14px;
}
.absence-view-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.absence-view-heading p {
  margin: 0;
  color: #71806d;
  font-size: 13px;
}
.absence-table-scroll,
.absence-calendar-scroll {
  overflow: auto;
  border: 1px solid #dce2d5;
  border-radius: 12px;
  background: white;
}
.absence-table,
.absence-calendar {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.absence-table th,
.absence-table td,
.absence-calendar th,
.absence-calendar td {
  padding: 12px;
  border-bottom: 1px solid #e2e7dd;
  text-align: left;
  vertical-align: top;
}
.absence-table th {
  background: #f5f7f1;
  color: #66745f;
  font-size: 11px;
}
.absence-table td small {
  display: block;
  margin-top: 6px;
  color: #72806e;
}
.absence-table .has-conflict td {
  background: #fff9f4;
}
.absence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 210px;
}
.absence-actions button {
  margin: 0;
  white-space: nowrap;
}
.absence-calendar-note {
  color: #71806d;
  margin: 0;
}
.absence-calendar {
  min-width: 0;
  table-layout: fixed;
}
.absence-calendar th:first-child {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8faf5;
}
.absence-calendar thead th {
  text-align: center;
  background: #f5f7f1;
}
.absence-calendar thead th:not(:first-child) {
  padding: 7px 3px;
  font-size: 12px;
}
.absence-calendar thead th span {
  display: block;
  margin-bottom: 3px;
  color: #8b9984;
  font-size: 9px;
  font-weight: 700;
}
.absence-calendar td {
  height: 46px;
  padding: 5px;
  text-align: center;
  overflow: hidden;
}
.absence-day {
  width: 100%;
  min-height: 29px;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}
.absence-day.vacation,
.absence-day.maternity_leave,
.absence-day.paternity_leave,
.absence-day.adoption_leave,
.absence-day.parental_leave,
.absence-day.child_leave {
  background: #d9e9fa;
  color: #315f8f;
}
.absence-day.sick,
.absence-day.carer_leave {
  background: #f9dfe4;
  color: #a14356;
}
.absence-day.day_off,
.absence-day.study_leave,
.absence-day.additional_study_leave,
.absence-day.entrance_exam_leave {
  background: #e5edda;
  color: #557047;
}
.absence-day.blocked {
  background: #eee5f5;
  color: #71518f;
}
.absence-day.unpaid_leave,
.absence-day.unpaid_child_leave {
  background: #f7edd6;
  color: #88652f;
}

.leave-type-native {
  display: none !important;
}
.leave-type-picker {
  position: relative;
}
.leave-type-trigger {
  width: 100%;
  text-align: left;
}
.leave-type-trigger::after {
  content: "⌄";
  float: right;
  font-size: 20px;
  line-height: 16px;
}
.leave-type-menu {
  position: absolute;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(150px, 2fr);
  width: 100%;
  max-width: 100%;
  max-height: 300px;
  height: min(300px, calc(100vh - 320px));
  margin-top: 6px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid #cbd8c5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(21, 45, 35, .18);
}
.leave-type-options {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 7px;
  overflow-y: scroll;
  overscroll-behavior: contain;
}
.leave-type-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}
.leave-type-option:hover,
.leave-type-option:focus,
.leave-type-option[aria-selected="true"] { background: #eaf4d3; outline: 0; }
.leave-type-description {
  min-width: 0;
  overflow: auto;
  align-self: stretch;
  margin: 0;
  padding: 20px;
  border-left: 1px solid #dfe6da;
  background: #f5f8f1;
  color: #516858;
}
@media (max-width: 600px) {
  .leave-type-menu { grid-template-columns: 1fr; max-height: 360px; }
  .leave-type-options { height: 230px; max-height: 230px; }
  .leave-type-description { border-top: 1px solid #dfe6da; border-left: 0; }
}
.absence-day.pending {
  outline: 2px dashed #d39a27;
  outline-offset: -2px;
}
.absence-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #243d35;
  color: #fff;
  box-shadow: 0 8px 20px #1a2f2833;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
}
@media (max-width: 760px) {
  .absence-summary {
    overflow: auto;
  }
  .absence-stat {
    min-width: 130px;
  }
  body.is-absence-page .absence-filters {
    grid-template-columns: 1fr;
  }
  .absence-period-filters {
    grid-template-columns: 1fr;
  }
  .absence-calendar {
    min-width: 980px;
  }
}
.absence-status {
  font-weight: 600;
}
.absence-status.pending {
  color: #8a5900;
}
#absence-review-form {
  padding: 24px;
}
#absence-review-conflicts {
  max-height: 230px;
  overflow: auto;
}
#absence-review-form input[type="checkbox"] {
  width: auto;
}

#coverage-form {
  padding: 24px;
}
.coverage-week {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid #dce2d5;
  border-radius: 8px;
  margin: 16px 0;
}
.coverage-week label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.coverage-week input,
#coverage-only-gaps {
  width: auto;
}
.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  background: #eef3e5;
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
}
.coverage-site {
  background: white;
  border: 1px solid #dce2d5;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.coverage-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.coverage-heading h3 {
  margin-right: auto;
}
.coverage-warning {
  color: #9b4a23;
}
.coverage-site summary {
  cursor: pointer;
  margin: 16px 0;
}
.coverage-rule,
.coverage-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #e7ece3;
}
.coverage-rule span,
.coverage-gap span {
  flex: 1;
  min-width: 220px;
  line-height: 1.6;
}
#coverage-error {
  color: #9b2734;
}

.site-pool {
  border: 1px solid #dce3d7;
  border-radius: 10px;
  padding: 14px;
  margin-top: 18px;
}
.site-pool p,
#shift-pool-hint {
  font-size: 13px;
  color: #617363;
}
#pool-members {
  max-height: 240px;
  overflow: auto;
}
.pool-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.pool-member-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pool-member-row > button {
  flex-shrink: 0;
}
#pool-add {
  margin-top: 14px;
  white-space: normal;
}
.pool-picker-body {
  padding: 24px;
}
#pool-picker {
  width: min(600px, calc(100vw - 28px));
  max-height: 90vh;
  overflow: auto;
}
#pool-picker input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin: 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
#pool-candidates {
  max-height: 45vh;
  overflow: auto;
}
.pool-candidate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}
.pool-candidate input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.site-pool .pool-member,
.site-pool .pool-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  margin: 0;
}
.site-pool input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.site-pool .pool-member[hidden] {
  display: none;
}

#profile-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: 90vh;
  overflow-y: auto;
}
.profile-details {
  border: 1px solid #dce3d7;
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
}
.profile-details legend {
  font-weight: 700;
}
.profile-details h3 {
  margin: 24px 0 12px;
}
.profile-photo {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.profile-photo img {
  width: 110px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
}
.profile-photo input {
  max-width: 100%;
}
.profile-photo small {
  display: block;
  margin: 8px 0;
}
.profile-details > p {
  font-size: 13px;
  color: #657466;
}
@media (max-width: 600px) {
  .profile-photo {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-details {
    padding: 12px;
  }
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.person-top {
  justify-content: space-between;
  align-items: flex-start;
}
.person-heading {
  min-width: 0;
  overflow-wrap: anywhere;
}
.person-position {
  color: var(--muted);
  font-weight: 600;
}
.person-avatar {
  flex: 0 0 37px;
  margin-left: auto;
}
.photo-thumbnail {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f6ef;
  cursor: zoom-in;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}
.photo-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.person-photo {
  width: 76px;
  height: 88px;
  margin-left: auto;
}
.profile-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: start;
  gap: 18px;
}
.profile-photo > div {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
#profile-photo-open {
  grid-column: 2;
  grid-row: 1;
  width: 110px;
  height: 140px;
  justify-self: end;
}
#profile-photo-open[hidden] {
  display: none;
}
#profile-photo-open img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
#photo-viewer {
  width: fit-content;
  max-width: calc(100vw - 32px);
  max-height: 92vh;
  overflow: auto;
  padding: 20px;
}
#photo-viewer .dialog-heading {
  gap: 24px;
  margin-bottom: 8px;
}
#photo-viewer-name {
  margin: 0 0 12px;
}
#photo-viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  margin: auto;
}
#photo-viewer-image[hidden] {
  display: none;
}
@media (max-width: 600px) {
  .profile-photo {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 12px;
  }
  #profile-photo-open {
    width: 80px;
    height: 104px;
  }
  .person-photo {
    width: 68px;
    height: 80px;
  }
}


.contacts-search {
  display: block;
  max-width: 520px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.contacts-search input { margin-top: 7px; }
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.contact-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.contact-card.archived { opacity: .68; }
.contact-card h3 { margin: 0; font-size: 18px; }
.contact-position { margin: 5px 0 18px; color: var(--muted); font-size: 13px; }
.contact-card dl { display: grid; grid-template-columns: 1fr; gap: 13px; margin: 0; }
.contact-card dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.contact-card dd { margin: 4px 0 0; overflow-wrap: anywhere; }

#roles-dialog,
#role-editor-dialog {
  box-sizing: border-box;
  width: min(700px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#role-form fieldset { margin: 18px 0; padding: 14px; border: 1px solid var(--line); }
#role-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
#role-permissions .permission-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
#role-permissions .permission-option:hover { border-color: #a8c96a; background: #f8fbf1; }
#role-permissions .permission-option input {
  display: block;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}
@media (max-width: 600px) {
  #role-permissions { grid-template-columns: 1fr; }
}
