:root,
[data-theme="night"] {
  color-scheme: dark;
  --tops-red: #d0121a;
  --page: #101010;
  --card: #1c1c1c;
  --ink: #f4f4f4;
  --muted: #b5b5b5;
  --line: #2c2c2c;
  --line-strong: #555;
  --field: #111111;
  --field-ink: #ffffff;
  --link: #ff5a62;
  --hover: #222222;
  --control-h: 40px;
  --control-radius: 10px;
  --card-radius: 16px;
  --bs-body-bg: #101010;
  --bs-body-color: #f4f4f4;
  --bs-secondary-color: #b5b5b5;
  --bs-border-color: #2c2c2c;
  --bs-tertiary-bg: #1c1c1c;
  --bs-emphasis-color: #f4f4f4;
}

[data-theme="day"] {
  color-scheme: light;
  --tops-red: #d0121a;
  --page: #f4f4f4;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #5e5e5e;
  --line: #e6e6e6;
  --line-strong: #c8c8c8;
  --field: #ffffff;
  --field-ink: #1c1c1c;
  --link: #b01016;
  --hover: #f7f7f7;
  --bs-body-bg: #f4f4f4;
  --bs-body-color: #1c1c1c;
  --bs-secondary-color: #5e5e5e;
  --bs-border-color: #e6e6e6;
  --bs-tertiary-bg: #ffffff;
  --bs-emphasis-color: #1c1c1c;
}

body {
  background: var(--page);
  color: var(--ink);
}

a { color: var(--link); }
a:hover { color: var(--tops-red); }

.tops-bar {
  background:
    radial-gradient(900px 90px at 8% -30%, rgba(255, 255, 255, .28), transparent 46%),
    linear-gradient(105deg, #b10e15 0%, #e31820 46%, #9d1016 100%);
  box-shadow: 0 10px 28px rgba(120, 8, 12, .22);
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: 8px;
  padding-bottom: 8px;
}

.tops-bar-row { gap: 12px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .01em;
}

.brand:hover { color: #fff; }

.brand-name { font-size: 1.05rem; }

.brand-logo, .login-logo {
  background: #fff;
  object-fit: contain;
  border-radius: 10px;
}

.brand-logo { height: 40px; width: auto; padding: 4px 8px; }
.login-logo { height: 88px; width: auto; display: block; margin: 0 auto 16px; padding: 8px 12px; border-radius: 16px; }

.tops-nav {
  align-items: center;
  gap: 12px;
}

.tops-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tops-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 12px;
}

.tops-links a:hover,
.tops-links a:focus,
.tops-links a.is-current {
  color: #fff;
  background: rgba(255, 255, 255, .18);
}

.tops-tools { margin-left: auto; }

.tops-menu {
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 10px;
}

.tops-bar .navbar-toggler-icon {
  filter: invert(1) grayscale(1) brightness(2);
}

.profile-button,
.theme-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
}

.theme-chip { padding: 7px 14px; font-weight: 600; }

.profile-button:hover,
.profile-button:focus,
.theme-chip:hover,
.theme-chip:focus {
  background: rgba(255, 255, 255, .24);
  color: #fff;
}

.profile-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--tops-red);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.profile-id { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; text-align: left; }
.profile-name { font-weight: 700; }
.profile-role { font-size: .75rem; opacity: .86; }

.profile-menu {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  min-width: 15.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
  margin-top: 10px !important;
}

.profile-card {
  padding: 8px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.profile-card strong, .profile-card span { display: block; }
.profile-card span { color: var(--muted); font-size: .85rem; }

.profile-menu a,
.profile-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 10px;
}

.profile-menu a:hover,
.profile-menu a:focus,
.profile-menu button:hover,
.profile-menu button:focus {
  background: var(--hover);
  color: var(--ink);
}

.profile-menu .is-leave,
.profile-menu .is-leave:hover,
.profile-menu .is-leave:focus { color: var(--tops-red); }

@media (max-width: 991.98px) {
  .tops-nav.show {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding-bottom: 8px;
  }
  .tops-links, .tops-tools { width: 100%; margin: 0; }
  .tops-links { flex-direction: column; align-items: stretch; padding-top: 6px; gap: 0; }
  .tops-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
  }
  .profile-button { display: none; }
  .profile-menu {
    display: block !important;
    position: static !important;
    transform: none !important;
    width: 100%;
    min-width: 0;
    margin: 4px 0 0 !important;
    padding: 4px 0 0;
    background: transparent;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .28);
    border-radius: 0;
    box-shadow: none;
    color: #fff;
  }
  .profile-card { padding: 8px 12px 10px; border-bottom-color: rgba(255, 255, 255, .28); }
  .profile-card strong { color: #fff; }
  .profile-card span { color: rgba(255, 255, 255, .82); }
  .profile-menu a,
  .profile-menu button { color: #fff; min-height: 44px; }
  .profile-menu a:hover,
  .profile-menu button:hover,
  .profile-menu a:focus,
  .profile-menu button:focus { background: rgba(255, 255, 255, .16); color: #fff; }
  .profile-menu .is-leave,
  .profile-menu .is-leave:hover,
  .profile-menu .is-leave:focus { color: #fff; }
}

@media (max-width: 992px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions .btn { min-width: 0; }
}
@media (max-width: 700px) {
  .page-actions .btn { flex: 1 1 10rem; }
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.dept-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}
.dept-open {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  flex: 1 1 auto;
  min-height: 188px;
}
.dept-open:hover,
.dept-open:focus { background: var(--hover); color: inherit; }
.dept-blurb {
  margin: 0;
  color: var(--muted);
  min-height: 3.6em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dept-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  align-self: flex-start;
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--control-radius);
  background: #1c1c1c;
  color: #fff;
  font-weight: 650;
  font-size: .95rem;
  white-space: nowrap;
}
.dept-open:hover .dept-go,
.dept-open:focus .dept-go { background: var(--tops-red); color: #fff; }
.dept-edit { border-top: 1px solid var(--line); margin-top: auto; }
.dept-edit summary {
  min-height: var(--control-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 650;
}
.dept-edit .role-card { margin: 0 16px 12px; }
.dept-head { display: flex; align-items: flex-start; gap: 12px; }
.dept-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--tops-red);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.dept-mark .icon { width: 1.25rem; height: 1.25rem; }
.role-card {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--page);
}
.role-card .form-label { margin: 4px 0 0; font-size: .78rem; }
.role-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 4px; }
.dept-card.is-add { border-style: dashed; padding: 16px; gap: 12px; }
.dept-card.is-add .dept-head { padding: 0; }

.page-head h1 { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions .btn { min-width: 10.5rem; }
.lead-copy { color: var(--muted); max-width: 46rem; }

.card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.card .text-secondary, .text-secondary { color: var(--muted) !important; }

.table {
  color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--hover);
  --bs-table-hover-color: var(--ink);
}

.table a { color: var(--ink); text-decoration: none; font-weight: 600; }
.table a:hover { color: var(--tops-red); }
.table thead th { color: var(--muted); font-weight: 600; font-size: .85rem; }

.list-group-item {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

.form-control, .form-select {
  background: var(--field);
  color: var(--field-ink);
  border-color: var(--line-strong);
  min-height: var(--control-h);
  border-radius: var(--control-radius);
}
textarea.form-control { min-height: 6rem; height: auto; }

.form-control:focus, .form-select:focus {
  background: var(--field);
  color: var(--field-ink);
  border-color: var(--tops-red);
  box-shadow: 0 0 0 .15rem rgba(208, 18, 26, .28);
}

.form-label { color: var(--ink); font-weight: 600; }
.form-text { color: var(--muted); }

.btn,
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--control-radius);
  font-size: .95rem;
  line-height: 1;
  font-weight: 650;
  white-space: nowrap;
}
.btn-tops {
  background: #1c1c1c;
  color: #fff;
  border: 1px solid #1c1c1c;
}

.btn-tops:hover { background: var(--tops-red); color: #fff; border-color: var(--tops-red); }
.btn-leave { background: var(--tops-red); color: #fff; border: 0; }
.btn-leave:hover { background: #9d1016; color: #fff; }

.btn-outline-secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--hover);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-outline-light:hover { color: #000; }

.alert-danger, .alert-error { background: #3a1214; color: #ffd5d7; border-color: var(--tops-red); }
.alert-warning { background: #2a2416; color: #ffe7a3; border-color: #8a6d1b; }
.alert-success { background: #14261a; color: #d7f5df; border-color: #1f7a3a; }
.alert-info { background: #1a2430; color: #d6e6f5; border-color: #35516d; }

.employee-id {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--tops-red);
  font-weight: 700;
}

.directory-row .employee-id { font-size: 1rem; }

.shadow-sm { box-shadow: none !important; }
.card, .directory, .log, .summary-card { border-radius: var(--card-radius); }

.directory {
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}

.directory-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.directory-row:last-child { border-bottom: 0; }
.directory-row:hover { background: var(--hover); color: inherit; }
.directory-who { min-width: 0; flex: 1; }
.directory-name { display: block; font-weight: 700; color: var(--ink); }
.directory-meta { color: var(--muted); font-size: .92rem; }
.directory-empty { margin: 0; padding: 18px; color: var(--muted); }

.pill {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
}

.list-group-item { border-left: 0; border-right: 0; }
.list-group-flush > .list-group-item:first-child { border-top: 0; }

@media (max-width: 800px) {
  .directory-row { flex-wrap: wrap; gap: 8px; }
  .directory-who { flex-basis: 100%; }
}

dt { color: var(--muted); }
dd { margin-bottom: .45rem; }

.permission-list { margin: 0; padding-left: 1.1rem; }
.permission-list li { margin-bottom: .35rem; }

.theme-toggle { min-width: 4.5rem; }

.people-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.people-filter input,
.people-filter select {
  background: var(--field);
  color: var(--field-ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 0 12px;
}

.people-filter input { min-width: 16rem; flex: 1 1 16rem; }
.people-filter select { min-width: 12rem; }

.people-table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  overflow: auto;
  margin-top: 12px;
}
.people-table {
  width: 100%;
  border-collapse: collapse;
}
.people-table th,
.people-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people-table th:nth-child(4),
.people-table td:nth-child(4) {
  width: 6.5rem;
  overflow: visible;
  text-overflow: clip;
}
.people-table td:nth-child(5) { max-width: 16rem; }
@media (max-width: 760px) {
  .people-table th:nth-child(5),
  .people-table td:nth-child(5) { display: none; }
}
.people-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.people-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.people-table tbody tr:last-child td { border-bottom: 0; }
.people-table tbody tr:hover { background: var(--hover); }
.people-name {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.people-name:hover { color: var(--tops-red); }
.people-id {
  font-weight: 700;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.people-table .status-tag { margin-left: 8px; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.pager p { margin: 0; color: var(--muted); }
.pager-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pager-pages a,
.pager-pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-h);
  height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--control-radius);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.pager-pages a:hover { background: var(--hover); color: var(--ink); }
.pager-pages .is-current {
  background: var(--tops-red);
  border-color: var(--tops-red);
  color: #fff;
}
.pager-pages .is-off { color: var(--muted); background: transparent; }
.pager-pages .is-gap { border: 0; background: transparent; min-width: 1.5rem; padding: 0; }

.clock-gate { max-width: 28rem; margin: 0 auto; }

.kiosk {
  max-width: 26rem;
  margin: 0 auto;
  text-align: center;
}

.kiosk-time {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0;
}

.kiosk-date { color: var(--muted); margin: 6px 0 18px; }

.kiosk-step { text-align: center; }

.kiosk-display {
  width: 100%;
  margin: 0 0 14px;
  padding: 14px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--field);
  color: var(--field-ink);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 22px;
  margin: 8px 0 16px;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.pin-dots .is-on { background: var(--tops-red); border-color: var(--tops-red); }

.dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.dialpad-letters { grid-template-columns: repeat(7, 1fr); gap: 6px; }

.dial-key {
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 1.45rem;
  font-weight: 700;
}

.dial-letter { min-height: 42px; font-size: 0.95rem; }

.dial-muted { font-size: 1rem; color: var(--muted); }

.dial-key:hover,
.dial-key:focus { background: var(--hover); }

.kiosk-go { width: 100%; margin-top: 4px; }

.kiosk-profile { max-width: 22rem; margin: 0 0 8px; text-align: left; }
.kiosk-profile .dialpad { max-width: 18rem; }

.btn-print {
  background: var(--tops-red);
  color: #fff;
  border: 1px solid var(--tops-red);
}
.btn-print:hover, .btn-print:focus { background: #9d1016; color: #fff; border-color: #9d1016; }

.poster-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.poster-stage { display: flex; justify-content: center; }
.poster {
  width: min(90vw, 190mm);
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.6%;
  padding: 4% 4% 3%;
  text-align: center;
  background: #fff;
  color: #161616;
  border: 1px solid #ddd;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
}
.poster-logo { width: 38%; height: auto; }
.poster-company { margin: 0; color: #161616; font-weight: 800; letter-spacing: .04em; font-size: clamp(1rem, 2.2vw, 1.35rem); }
.poster h1 { margin: 0; color: #161616; font-size: clamp(1.35rem, 3vw, 2.2rem); line-height: 1.05; }
.poster-lead { margin: 0; color: #222; font-size: clamp(.95rem, 1.8vw, 1.2rem); }
.poster-qr { width: 94%; line-height: 0; background: #fff; }
.poster-qr svg { width: 100%; height: auto; display: block; }
.poster-url { margin: 0; color: #333; font-size: clamp(.8rem, 1.4vw, .95rem); word-break: break-all; }

.staff-stage { display: flex; justify-content: center; }
.staff-card {
  width: min(100%, 172mm);
  background: #fff;
  color: #161616;
  border: 1px solid #ddd;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.staff-brand { display: flex; align-items: center; gap: 14px; }
.staff-brand img { height: 58px; width: auto; background: transparent; }
.staff-company { margin: 0; color: #161616; font-weight: 800; letter-spacing: .03em; line-height: 1.15; }
.staff-company.is-second { font-weight: 700; color: #333; }
.staff-body {
  display: grid;
  grid-template-columns: 92px 1fr 108px;
  gap: 14px;
  align-items: center;
}
.staff-photo {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: #f3f3f3;
  color: #555;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.staff-photo img { width: 100%; height: 100%; object-fit: cover; }
.staff-photo .icon { width: 2.4rem; height: 2.4rem; }
.staff-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; min-width: 0; }
.staff-facts dt {
  margin: 0;
  color: #666;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.staff-facts dd { margin: 0; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-qr { line-height: 0; }
.staff-qr svg { width: 108px; height: 108px; display: block; }
.staff-state { margin: 0; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.staff-state.is-active { color: #146b32; }
.staff-state.is-inactive,
.staff-state.is-expired,
.staff-state.is-fake { color: #9d1016; }
.staff-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 172mm;
  margin: 16px auto 0;
}
.staff-tools form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.staff-tools label { font-weight: 700; margin: 0; }
.staff-tools input[type="date"],
.staff-tools input[type="file"] { max-width: 100%; }

.scan-box { max-width: 40rem; }
.scan-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.scan-video {
  display: block;
  width: min(100%, 420px);
  margin-top: 12px;
  border-radius: var(--card-radius);
  background: #111;
}
label.btn { cursor: pointer; }

@media (max-width: 700px) {
  .poster-toolbar .btn { width: 100%; }
}

@page { size: A4 portrait; margin: 8mm; }

@media print {
  .tops-bar, .no-print, .alert, .poster-toolbar { display: none !important; }
  html, body, main { background: #fff !important; color: #111 !important; }
  main.container { max-width: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
  .poster-stage { display: block; }
  .poster {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    margin: 0;
    border: 0;
    box-shadow: none;
    break-inside: avoid;
    gap: 2.5mm;
    padding: 0;
    justify-content: flex-start;
  }
  .poster-logo { width: 36mm; }
  .poster-company { font-size: 16pt; }
  .poster h1 { font-size: 26pt; }
  .poster-lead { font-size: 13pt; }
  .poster-qr { width: 100%; }
  .poster-qr svg { width: 100%; height: auto; }
  .poster-url { font-size: 11pt; }
  .staff-stage { display: block; }
  .staff-card {
    width: 170mm;
    margin: 10mm auto;
    box-shadow: none;
    break-inside: avoid;
  }
  .staff-brand img { height: 18mm; }
  .staff-photo { width: 28mm; height: 28mm; }
  .staff-qr svg { width: 32mm; height: 32mm; }
  .staff-body { grid-template-columns: 28mm 1fr 32mm; }
}

.rule-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.rule-check { display: flex; align-items: center; gap: 8px; margin: 0; }

.qr-card { display: flex; gap: 18px; align-items: center; }
.qr-mark { flex: 0 0 auto; background: #fff; border-radius: 12px; padding: 8px; line-height: 0; }
.qr-mark svg { width: 148px; height: 148px; display: block; }

.close-shift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.close-shift input[type="datetime-local"],
.close-shift input[name="note"] {
  background: var(--field);
  color: var(--field-ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 0 12px;
}

@media (max-width: 700px) {
  .qr-card { flex-direction: column; align-items: flex-start; }
}

.range-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.range-form input {
  background: var(--field);
  color: var(--field-ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 0 12px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 14px 16px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-card strong {
  display: block;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.summary-card span { color: var(--muted); font-size: .9rem; }
.summary-card.is-done { border-color: #1f7a3a; }
.summary-card.is-done strong { color: #3dce6e; }
.summary-card.is-open { border-color: #d0121a; }
.summary-card.is-open strong { color: #ff5a62; }
.summary-card.is-missing { border-color: #e2b93b; }
.summary-card.is-missing strong { color: #e2b93b; }

.status-stack { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}
.status-tag.is-done, .status-tag.is-kept { background: #1f7a3a; color: #fff; }
.status-tag.is-open { background: #d0121a; color: #fff; }
.status-tag.is-missing { background: #e2b93b; color: #1c1400; }
.status-tag.is-none { background: #3a3a3a; color: #f4f4f4; }
.status-tag.is-refused { background: transparent; color: #ff8a90; border: 1px solid #d0121a; }
[data-theme="day"] .status-tag.is-none { background: #ececec; color: #333; }
[data-theme="day"] .summary-card.is-done strong { color: #146b32; }
[data-theme="day"] .summary-card.is-open strong { color: #b01016; }
[data-theme="day"] .summary-card.is-missing strong { color: #8a6a08; }

.staff-id {
  display: inline-flex;
  flex-direction: column;
  min-width: 4.5rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.staff-id small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hours-figure {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.1;
}
.hours-figure small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.facts { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 4px; }
.fact { display: inline-flex; flex-direction: column; min-width: 3.6rem; line-height: 1.15; }
.fact small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fact b { font-weight: 650; font-size: .92rem; color: var(--ink); }

.attendance-row { align-items: flex-start; flex-wrap: wrap; }
.attendance-main { display: flex; align-items: center; gap: 16px; flex: 1 1 100%; }

.day-strip { display: flex; flex-wrap: wrap; gap: 6px; max-width: 28rem; }

.day-cell {
  min-width: 3.4rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.day-cell small { display: block; color: var(--muted); }
.day-cell em { display: block; font-style: normal; font-weight: 800; font-size: .68rem; letter-spacing: .02em; text-transform: uppercase; }
.day-cell.is-done { background: rgba(31, 122, 58, .35); color: #d7f5df; border-color: #1f7a3a; }
.day-cell.is-open { background: rgba(208, 18, 26, .4); color: #ffd5d7; border-color: #d0121a; }
.day-cell.is-missing { background: rgba(226, 185, 59, .32); color: #ffe7a3; border-color: #e2b93b; }
.day-cell.is-done small, .day-cell.is-open small, .day-cell.is-missing small { color: inherit; }
[data-theme="day"] .day-cell.is-done { background: #e5f6ea; color: #0d4d22; }
[data-theme="day"] .day-cell.is-open { background: #fde8e8; color: #8f1218; }
[data-theme="day"] .day-cell.is-missing { background: #fff6d8; color: #6a5208; }

.range-presets, .status-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.range-presets a, .status-filters a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--control-radius);
  font-size: .95rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}
.range-presets a.is-current, .status-filters a.is-current {
  background: var(--tops-red);
  border-color: var(--tops-red);
  color: #fff;
}

.calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.month-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-weekdays { margin-bottom: 6px; color: var(--muted); font-size: .8rem; }
.month-day {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: var(--card);
  font-size: .75rem;
}
.month-day.is-empty { background: transparent; border-color: transparent; }
.month-day.is-done { background: rgba(31, 122, 58, .22); border-color: #1f7a3a; }
.month-day.is-open { background: rgba(208, 18, 26, .28); border-color: #d0121a; }
.month-day.is-missing { background: rgba(226, 185, 59, .24); border-color: #e2b93b; }
.month-name { display: block; margin-top: 4px; line-height: 1.25; }
.month-name.is-done { color: #8ee0a8; }
.month-name.is-missing { color: #ffe7a3; font-weight: 700; }
.month-name.is-open { color: #ff8a90; font-weight: 700; }
[data-theme="day"] .month-day.is-done { background: #e5f6ea; }
[data-theme="day"] .month-day.is-open { background: #fde8e8; }
[data-theme="day"] .month-day.is-missing { background: #fff6d8; }
[data-theme="day"] .month-name.is-done { color: #0d4d22; }
[data-theme="day"] .month-name.is-missing { color: #6a5208; }
[data-theme="day"] .month-name.is-open { color: #8f1218; }

@media (max-width: 800px) {
  .month-day { min-height: 64px; padding: 4px; }
  .month-name { font-size: .65rem; }
}

.log {
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}

.log-day {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.log-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log-title { display: block; font-weight: 700; }
.log-row.is-refused .log-title { color: var(--tops-red); }

@media (max-width: 900px) {
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .log-row { grid-template-columns: 4.5rem 1fr; }
  .log-row .pill, .log-row .status-tag { grid-column: 2; justify-self: start; }
}
