:root {
  --bg: #f5efe6;
  --bg-soft: #fbf8f2;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #1f2a37;
  --muted: #687385;
  --line: #ddd1bf;
  --accent: #b24a2e;
  --accent-dark: #8f3620;
  --accent-soft: #f2dfd6;
  --success-bg: #e7f5eb;
  --success-text: #1f6b3d;
  --danger-bg: #fde8e4;
  --danger-text: #9c2f1f;
  --shadow: 0 18px 50px rgba(72, 47, 24, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(178, 74, 46, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(91, 128, 90, 0.14), transparent 28%),
    linear-gradient(180deg, #f7f2ea 0%, #ede4d5 100%);
}

[hidden] {
  display: none !important;
}

#superadmin-edit {
  scroll-margin-top: 18px;
}

body.is-page-loading {
  cursor: progress;
}

body.is-page-loading a,
body.is-page-loading button,
body.is-page-loading input,
body.is-page-loading select {
  cursor: progress;
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  margin-bottom: 24px;
  border: 1px solid rgba(221, 209, 191, 0.7);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-brand--login {
  margin-bottom: 20px;
}

.site-brand__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.site-brand__eyebrow,
.hero-card__eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

.site-brand__title,
.hero-card__title,
.section-head__title {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid rgba(138, 77, 18, 0.28);
  border-radius: var(--radius-md);
  color: #6f3f0d;
  background: #fff3d4;
  box-shadow: 0 12px 32px rgba(138, 77, 18, 0.12);
}

.admin-view-banner span {
  display: block;
  margin-top: 3px;
  color: #8a4d12;
}

.site-nav__link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.site-nav__link {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--line);
}

.site-nav__link:hover,
.button:hover {
  transform: translateY(-1px);
}

.site-nav__link.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.site-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.page-loading-indicator {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(221, 209, 191, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(39, 32, 26, 0.18);
  color: var(--text);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

body.is-page-loading .page-loading-indicator {
  opacity: 1;
  transform: translateY(0);
}

.page-loading-indicator__spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(178, 74, 46, 0.22);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: page-loading-spin 0.75s linear infinite;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.site-footer {
  margin-top: 28px;
  padding: 10px 0 2px;
}

.site-footer__line {
  height: 1px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, transparent 0%, rgba(178, 74, 46, 0.28) 18%, rgba(178, 74, 46, 0.5) 50%, rgba(178, 74, 46, 0.28) 82%, transparent 100%);
}

.site-footer__content {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 18px 10px;
  border: 1px solid rgba(221, 209, 191, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 36px rgba(72, 47, 24, 0.08);
  text-align: center;
}

.site-footer__brand {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
}

.site-footer__meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.login-screen {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
}

.login-card,
.hero-card,
.panel-card,
.stat-card {
  border: 1px solid rgba(221, 209, 191, 0.75);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-card {
  width: min(100%, 520px);
  padding: 34px;
}

.login-card--wide {
  width: min(100%, 580px);
}

.login-card--success {
  display: grid;
  gap: 22px;
}

.login-card--success .site-brand--login {
  margin-bottom: 0;
}

.login-card__section-title {
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.3;
}

.target-login {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.target-login__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.target-login [disabled] {
  cursor: not-allowed;
  opacity: 0.68;
}

.legacy-access {
  margin-top: 18px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 20px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(221, 209, 191, 0.42);
}

.mode-switch__button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mode-switch__button.is-active {
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(39, 32, 26, 0.1);
}

.login-mode[hidden] {
  display: none;
}

.login-card__text,
.hero-card__meta,
.section-head__text,
.qr-placeholder small,
.chooser-hero__text,
.school-card__meta {
  color: var(--muted);
}

.chooser-hero {
  padding: 24px 4px 8px;
}

.chooser-hero__title,
.school-card__title {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.school-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(221, 209, 191, 0.75);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.school-card__eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
}

.hero-card__status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(39, 32, 26, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill--ok {
  background: rgba(41, 127, 78, 0.12);
  color: #1f6d47;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 22px;
}

.stat-card--tab {
  width: 100%;
  border: 1px solid rgba(221, 209, 191, 0.75);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.stat-card--link {
  color: inherit;
  text-decoration: none;
}

.stat-card--active {
  border-color: rgba(178, 74, 46, 0.45);
  background:
    linear-gradient(180deg, rgba(178, 74, 46, 0.08), rgba(178, 74, 46, 0.03)),
    var(--surface);
}

.stat-card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(39, 32, 26, 0.12);
}

.stat-card__label {
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-card__value {
  margin-top: 22px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1;
}

.stat-card__value--small {
  font-size: 1.6rem;
  line-height: 1.2;
}

.stat-card__button-row {
  margin-top: auto;
  padding-top: 16px;
}

.stat-card__action {
  margin-top: auto;
  align-self: flex-start;
  pointer-events: none;
}

.stat-card__caption {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.dashboard-tab-panel--hidden {
  display: none;
}

.qr-placeholder {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 124px;
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(
    45deg,
    rgba(178, 74, 46, 0.06),
    rgba(178, 74, 46, 0.06) 12px,
    rgba(255, 255, 255, 0.8) 12px,
    rgba(255, 255, 255, 0.8) 24px
  );
  text-align: center;
}

.qr-preview {
  display: block;
  width: 132px;
  height: 132px;
  margin: 18px auto 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(221, 209, 191, 0.75);
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.qr-preview-button {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.qr-actions {
  margin-top: 12px;
  justify-content: center;
}

.qr-upload-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.qr-modal[hidden] {
  display: none;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 12, 8, 0.7);
  backdrop-filter: blur(3px);
}

.qr-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 24px;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.qr-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(39, 32, 26, 0.08);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.qr-modal__image {
  display: block;
  width: 100%;
  max-height: 70vh;
  margin: 0 auto 18px;
  border-radius: var(--radius-md);
  background: #fff;
  object-fit: contain;
}

body.qr-modal-open {
  overflow: hidden;
}

.danger-confirm[hidden] {
  display: none;
}

.danger-confirm {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
}

.danger-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 12, 8, 0.62);
  backdrop-filter: blur(3px);
}

.danger-confirm__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 520px);
  padding: 24px;
  border: 1px solid rgba(221, 209, 191, 0.75);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.danger-confirm__eyebrow {
  color: var(--danger-text);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.danger-confirm__title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
}

.danger-confirm__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.danger-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

body.is-confirm-open {
  overflow: hidden;
}

.panel-card {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

.employee-actions-panel {
  display: grid;
  grid-template-columns: minmax(460px, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin: 18px 0 20px;
}

.employee-action-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(221, 209, 191, 0.78);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 242, 0.72);
}

.employee-action-card--link {
  color: inherit;
  text-decoration: none;
}

.employee-action-card--link:hover,
.employee-action-card--link:focus-visible {
  border-color: rgba(178, 74, 46, 0.36);
  box-shadow: 0 14px 26px rgba(39, 32, 26, 0.08);
  outline: none;
}

.employee-action-card--selected {
  background: #f3f6fa;
  border-color: #c9d3df;
}

.employee-action-card__title {
  font-weight: 800;
}

.employee-action-card__meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.employee-action-card__controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.employee-action-card__controls--wide {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.employee-action-card .button {
  min-height: 38px;
  white-space: nowrap;
}

.shift-form-card,
.dashboard-filter-card,
.settings-action-card {
  margin-bottom: 18px;
}

.dashboard-filter-card {
  width: fit-content;
  max-width: 100%;
}

.dashboard-filter-card .employee-action-card__controls {
  grid-template-columns: minmax(180px, 220px) minmax(130px, 150px) auto;
}

.shift-form-card__controls {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(520px, 1fr);
  gap: 12px;
  align-items: end;
}

.shift-form-card__schedule {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 0;
  border: 0;
}

.shift-mode-switch {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.shift-exclude-chip {
  width: fit-content;
}

.shift-exclude-chip--row {
  margin-top: 8px;
  white-space: normal;
}

.shift-cycle-start {
  max-width: 260px;
  margin-bottom: 10px;
}

.shift-cycle-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.shift-schedule-toggle {
  width: fit-content;
  margin: 0 0 10px;
}

.shift-schedule-details {
  margin-top: 6px;
  padding-top: 4px;
  max-width: 100%;
}

.shift-schedule-details summary {
  width: fit-content;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.shift-schedule-details__panel {
  margin-top: 12px;
}

.shift-week-grid {
  display: grid;
  gap: 6px;
  max-width: 100%;
}

.shift-week-grid--compact {
  max-width: 100%;
}

.shift-week-grid__head {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 140px 140px minmax(128px, 150px);
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shift-week-grid__row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 140px 140px minmax(128px, 150px);
  gap: 8px;
  align-items: center;
}

.shift-week-grid__day,
.shift-week-grid__row .checkbox-chip {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
}

.shift-week-grid__day {
  font-weight: 700;
}

.shift-week-grid__weekend {
  width: 100%;
}

.shift-week-grid__row .field__control {
  min-height: 40px;
}

.shift-week-grid__row.is-weekend .field__control {
  background: rgba(244, 240, 233, 0.7);
  color: var(--muted);
  cursor: not-allowed;
}

.shift-form-card > .button {
  align-self: end;
  width: 100%;
}

.settings-nav-panel {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.violation-filter-panel {
  grid-template-columns: minmax(520px, 1.1fr) minmax(320px, 0.9fr);
  align-items: stretch;
}

.violation-filter-panel__periods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.period-choice {
  position: relative;
  display: inline-flex;
  min-width: 88px;
}

.period-choice__input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.period-choice__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(221, 209, 191, 0.95);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.period-choice__input:checked + .period-choice__text {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.period-choice__input:focus-visible + .period-choice__text {
  outline: 3px solid rgba(178, 74, 46, 0.18);
  outline-offset: 2px;
}

.violation-filter-panel__show-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px));
  gap: 10px;
  align-items: end;
}

.violation-filter-panel__apply-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.violation-filter-panel__period-preview {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.violation-filter-panel__download {
  justify-self: start;
}

.violation-filter-panel__toggle {
  margin-top: 2px;
  justify-self: start;
}

.violation-filter-panel__submit {
  justify-self: start;
}

.violation-filter-panel__filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.violation-filter-panel__filter-fields.is-disabled {
  opacity: 0.58;
}

.violation-filter-panel__export-card {
  align-content: start;
  background: #f3f6fa;
  border-color: #c9d3df;
}

.overall-filter-panel {
  grid-template-columns: minmax(520px, 1.1fr) minmax(360px, 0.9fr);
  align-items: stretch;
}

.overall-filter-card,
.overall-export-card {
  align-content: start;
}

.overall-filter-panel__scope,
.overall-filter-panel__export {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.overall-filter-panel__export .button {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.overall-export-card__download {
  align-self: start;
  width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: center;
}

.overall-filter-panel__service {
  grid-column: 1 / -1;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
}

.overall-filter-panel__service .button {
  justify-self: end;
}

.two-column-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 22px;
}

.two-column-grid--balanced {
  grid-template-columns: 1fr 1fr;
}

.two-column-grid--superadmin-stack {
  grid-template-columns: 1fr;
}

.two-column-grid--superadmin-stack > .panel-card:first-child {
  order: 2;
}

.two-column-grid--superadmin-stack > .panel-card:nth-child(2) {
  order: 1;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.settings-form {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin-top: 18px;
}

.form-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 16px 0 0;
}

.status-card--success {
  background: rgba(36, 128, 84, 0.09);
  border-color: rgba(36, 128, 84, 0.24);
}

.status-card--warning {
  background: rgba(178, 124, 31, 0.09);
  border-color: rgba(178, 124, 31, 0.24);
}

.form-grid--inline {
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(140px, 180px)) auto;
  align-items: end;
  margin-bottom: 18px;
}

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

.field--inline {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.field__label {
  font-size: 0.92rem;
  font-weight: 600;
}

.field__control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  font: inherit;
  color: var(--text);
}

.password-field {
  position: relative;
  display: block;
}

.password-field__control {
  padding-right: 54px;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-field__toggle:hover,
.password-field__toggle:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.password-field__icon {
  position: relative;
  width: 22px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px 999px 8px 8px;
  transform: rotate(45deg);
}

.password-field__icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-field__toggle[aria-pressed="true"] .password-field__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(-50%) rotate(90deg);
}

.field__control:disabled,
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field__hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.field.is-disabled {
  opacity: 0.58;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-chip input {
  margin: 0;
}

.search-field {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 8;
  display: grid;
  gap: 6px;
  max-height: 260px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(39, 32, 26, 0.12);
}

.search-dropdown[hidden] {
  display: none;
}

.search-option,
.search-dropdown__empty {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.search-option {
  display: grid;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-option:hover,
.search-option:focus-visible {
  background: rgba(178, 74, 46, 0.08);
  outline: none;
}

.search-option__name {
  font-weight: 600;
}

.search-option__meta,
.search-dropdown__empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row--admin-actions {
  align-items: center;
}

.button-row--admin-actions .button {
  flex: 0 0 auto;
  min-height: 40px;
}

.button-row--registration {
  margin-top: 2px;
}

.button-row--form-actions {
  margin-top: 4px;
}

.superadmin-nav {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.05fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.superadmin-nav__group {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(221, 209, 191, 0.62);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 242, 0.58);
}

.superadmin-nav__label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.superadmin-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.superadmin-nav__links .button {
  min-height: 38px;
  padding: 0 14px;
}

.invite-code-action {
  display: grid;
  gap: 10px;
  align-items: start;
  max-width: min(100%, 460px);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.detail-list--spaced {
  padding: 16px 18px;
  border: 1px solid rgba(221, 209, 191, 0.75);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
}

.filter-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-toolbar--inline {
  align-items: end;
}

.filter-toolbar__date {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-toolbar__compact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.filter-toolbar__field {
  min-width: 180px;
}

.event-search-field {
  width: min(100%, 420px);
  margin: 0 0 18px;
}

.filter-toolbar__range {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 600;
}

.field__control--compact {
  min-width: 0;
  max-width: 220px;
}

.dashboard-command-center {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 2px 0 16px;
}

.dashboard-kpi {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(221, 209, 191, 0.86);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-kpi:hover,
.dashboard-kpi:focus-visible,
.dashboard-kpi.is-active {
  border-color: rgba(178, 74, 46, 0.45);
  box-shadow: 0 12px 28px rgba(39, 32, 26, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.dashboard-kpi--danger {
  background: linear-gradient(180deg, #fff 0%, rgba(253, 232, 228, 0.72) 100%);
}

.dashboard-kpi--warning {
  background: linear-gradient(180deg, #fff 0%, rgba(255, 243, 212, 0.72) 100%);
}

.dashboard-kpi__label,
.dashboard-kpi__hint,
.dashboard-refresh-note,
.dashboard-result-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.dashboard-kpi__value {
  color: var(--text);
  font-size: 2.05rem;
  line-height: 1;
}

.dashboard-list-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 360px) auto;
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
}

.dashboard-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-filter-chip:hover,
.dashboard-filter-chip:focus-visible,
.dashboard-filter-chip.is-active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  outline: none;
}

.dashboard-search {
  display: grid;
  gap: 5px;
}

.dashboard-search__label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-search__input {
  min-height: 38px;
  padding: 8px 12px;
  padding-right: 34px;
}

.dashboard-search__control {
  position: relative;
  display: block;
}

.dashboard-search__clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(104, 115, 133, 0.72);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.dashboard-search__clear:hover,
.dashboard-search__clear:focus-visible {
  color: var(--accent);
  background: rgba(178, 74, 46, 0.08);
  outline: none;
}

.dashboard-toolbar-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.dashboard-result-count {
  color: var(--text);
}

.dashboard-filter-empty {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed rgba(221, 209, 191, 0.95);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 242, 0.72);
  color: var(--muted);
  text-align: center;
}

.dashboard-filter-empty strong {
  color: var(--text);
}

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.table-sort-button {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-transform: inherit;
}

.table-sort-link__hint {
  color: var(--muted);
  font-size: 0.9em;
}

.table-sort-link.is-active .table-sort-link__hint,
.table-sort-link:hover .table-sort-link__hint {
  color: var(--color-accent);
}

.deploy-status-card {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.deploy-status-card__summary {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.deploy-status-card__progress {
  width: 100%;
  height: 14px;
}

.deploy-status-card__log {
  max-height: 260px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: rgba(39, 32, 26, 0.06);
  border: 1px solid rgba(221, 209, 191, 0.75);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}

.local-result-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(31, 157, 85, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(31, 157, 85, 0.08);
}

.local-result-card--invite {
  max-width: 520px;
  margin-top: 12px;
}

.local-result-card--registration {
  gap: 12px;
  padding: 20px;
}

.local-result-card__title {
  font-weight: 700;
}

.local-result-card__text {
  color: var(--muted);
  line-height: 1.4;
}

.local-result-card__code {
  display: block;
  max-width: 100%;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(31, 157, 85, 0.25);
  font-family: Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
}

.button--primary {
  color: #fff;
  background: var(--accent);
}

.button--primary:hover {
  background: var(--accent-dark);
}

.button--ghost,
.button--tiny {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--line);
}

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

.button--tiny,
.button--danger {
  min-height: 36px;
  padding: 0 14px;
}

.table-wrap {
  max-height: min(58vh, 520px);
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.table-wrap--shifts {
  max-height: none;
  overflow: visible;
}

.table-wrap--compact {
  margin-top: 20px;
  max-height: min(46vh, 420px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table--report {
  font-size: 0.95rem;
  min-width: 980px;
}

.data-table--report th:first-child,
.data-table--report td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 240px;
  max-width: 320px;
  background: var(--surface);
  box-shadow: 1px 0 0 rgba(221, 209, 191, 0.75);
}

.data-table--report th:first-child {
  z-index: 3;
}

.data-table--report tbody tr:nth-child(even) td:first-child {
  background: #f8f2e8;
}

.data-table--report th.data-table__number-cell,
.data-table--report td.data-table__number-cell {
  width: 1%;
  min-width: 0;
  max-width: none;
  padding-left: 8px;
  padding-right: 8px;
  text-align: right;
  white-space: nowrap;
}

.data-table--shifts {
  table-layout: fixed;
}

.data-table--shifts th:first-child,
.data-table--shifts td:first-child {
  width: 300px;
}

.data-table--shifts th:last-child,
.data-table--shifts td:last-child {
  width: 220px;
  text-align: right;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(221, 209, 191, 0.75);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table__meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.urv-time-cell__time,
.urv-time-cell__date {
  display: block;
}

.urv-time-cell__date {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.15;
  margin-top: 2px;
  white-space: nowrap;
}

.table-row-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.table-row-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.data-table__status-cell {
  width: 74px;
  min-width: 74px;
  text-align: center;
  white-space: nowrap;
}

.data-table__empty {
  color: var(--muted);
  text-align: center;
}

.table-wrap--access-requests {
  max-height: min(62vh, 620px);
}

.data-table--access-requests th:last-child,
.data-table--access-requests td:last-child {
  min-width: 180px;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: -12px 0 18px rgba(255, 255, 255, 0.78);
}

.data-table--access-requests th:last-child {
  z-index: 3;
}

.data-table--access-requests tr.is-selected td:last-child {
  background: #f8eee9;
}

.table-wrap--web-users {
  max-height: min(68vh, 720px);
}

.data-table--web-users td {
  min-width: 170px;
}

.web-user-tags,
.web-user-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.web-user-list__item {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(221, 209, 191, 0.55);
}

.web-user-list__item:last-child {
  border-bottom: 0;
}

.web-user-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 190px;
}

.web-user-password-form {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  width: min(220px, 100%);
}

.web-user-password-form[hidden] {
  display: none;
}

.web-user-password-form .field__control {
  width: 100%;
  max-width: none;
}

.web-user-password-form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.access-request-id {
  font-weight: 700;
  white-space: nowrap;
}

.access-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.access-status--success {
  color: #17663a;
  background: rgba(31, 157, 85, 0.12);
}

.access-status--warning {
  color: #8a4d12;
  background: #fff3d4;
}

.access-status--danger {
  color: #9f2f24;
  background: rgba(194, 65, 50, 0.12);
}

.access-status--muted {
  color: var(--muted);
  background: rgba(104, 115, 133, 0.1);
}

.access-request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.data-table--maintenance td {
  vertical-align: top;
}

.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.access-action-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.access-action-button:hover,
.access-action-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(39, 32, 26, 0.14);
  outline: none;
}

.access-action-button--approve {
  background: #1f9d55;
}

.access-action-button--reject {
  background: #c24132;
}

.status-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(39, 32, 26, 0.06);
}

.status-dot--online {
  background: #1f9d55;
}

.status-dot--offline {
  background: #c24132;
}

.health-badge {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(39, 32, 26, 0.06);
}

.health-badge--ok {
  background: #1f9d55;
}

.health-badge--warning {
  background: #d69022;
}

.health-badge--error {
  background: #c24132;
}

.button--compact {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.health-details-row td {
  padding-top: 0;
  background: rgba(246, 241, 232, 0.58);
}

.health-details {
  border: 1px solid rgba(221, 209, 191, 0.75);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.76);
}

.health-details__title {
  margin-bottom: 8px;
  font-weight: 700;
}

.health-details__summary {
  display: grid;
  gap: 10px;
}

.health-reason-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(221, 209, 191, 0.75);
  border-left: 4px solid #d69022;
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 242, 0.8);
}

.health-reason-card--error {
  border-left-color: #c24132;
  background: rgba(253, 232, 228, 0.48);
}

.health-reason-card--warning {
  border-left-color: #d69022;
}

.health-reason-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.health-reason-card__message {
  line-height: 1.45;
}

.health-reason-card__action {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(221, 209, 191, 0.7);
}

.health-reason-card__action span,
.health-reason-card__facts {
  color: var(--muted);
  font-size: 0.9rem;
}

.health-reason-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.health-details__subhead {
  margin-top: 8px;
  font-weight: 700;
}

.health-details__items {
  margin: 4px 0 0;
  padding-left: 18px;
}

.health-details__items li + li {
  margin-top: 4px;
}

.health-details__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 18px;
  margin-top: 12px;
  color: var(--text);
  font-size: 0.92rem;
}

.health-details__grid strong {
  display: block;
  margin-bottom: 5px;
}

.health-details__level {
  display: inline-block;
  min-width: 72px;
  margin-right: 8px;
  font-weight: 700;
}

.health-details__level--error {
  color: #9f2f24;
}

.health-details__level--warning {
  color: #9a6114;
}

.data-table--report tbody tr:nth-child(even) {
  background: rgba(221, 209, 191, 0.14);
}

.data-table--clickable tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.data-table--clickable tbody tr:hover,
.data-table--clickable tbody tr.is-selected {
  background: rgba(178, 74, 46, 0.08);
  box-shadow: inset 4px 0 0 var(--accent);
}

.employee-table-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(160px, 0.55fr);
  gap: 10px;
  align-items: center;
  margin: 18px 0 10px;
  padding: 10px;
  border: 1px solid rgba(221, 209, 191, 0.5);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 242, 0.58);
}

.table-filter-field {
  position: relative;
  display: block;
  min-width: 78px;
}

.table-filter-field input {
  width: 100%;
  min-height: 34px;
  padding: 6px 32px 6px 32px;
  border: 1px solid rgba(221, 209, 191, 0.54);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}

.table-filter-field input::placeholder {
  color: rgba(104, 115, 133, 0.72);
}

.table-filter-field input:focus {
  border-color: rgba(178, 74, 46, 0.55);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(178, 74, 46, 0.08);
}

.table-filter-field__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(104, 115, 133, 0.58);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-55%);
}

.table-filter-field__icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(104, 115, 133, 0.58);
  transform: rotate(45deg);
}

.table-filter-field__clear {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(104, 115, 133, 0.72);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.table-filter-field__clear:hover,
.table-filter-field__clear:focus-visible {
  color: var(--accent);
  background: rgba(178, 74, 46, 0.08);
  outline: none;
}

.table-actions {
  white-space: nowrap;
  text-align: right;
}

.dashboard-action-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 112px;
  background: var(--surface);
  box-shadow: -10px 0 18px rgba(255, 255, 255, 0.78);
  text-align: right;
  white-space: nowrap;
}

.data-table th.dashboard-action-cell {
  z-index: 2;
}

.table-actions--web-user {
  white-space: normal;
}

.table-actions__group--double {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-form {
  display: inline-flex;
}

.inline-edit-grid {
  display: contents;
}

tr.is-selected {
  background: rgba(178, 74, 46, 0.08);
}

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

.flash-stack--local {
  margin: 0 0 18px;
}

.flash {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.flash--success {
  color: var(--success-text);
  background: var(--success-bg);
}

.flash--error {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.flash--warning {
  color: #8a4d12;
  background: #fff3d4;
}

.side-drawer[hidden] {
  display: none;
}

.side-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.side-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 55, 0.22);
}

.side-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(430px, calc(100vw - 24px));
  padding: 24px;
  overflow-y: auto;
  border: 1px solid rgba(221, 209, 191, 0.78);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(39, 32, 26, 0.22);
}

.side-drawer--left .side-drawer__panel {
  left: 0;
  animation: side-drawer-slide-left 0.18s ease-out;
}

.side-drawer--right .side-drawer__panel {
  right: 0;
  animation: side-drawer-slide-right 0.18s ease-out;
}

@keyframes side-drawer-slide-left {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes side-drawer-slide-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

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

.side-drawer__title {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.side-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.violation-detail-drawer .side-drawer__panel {
  width: min(560px, calc(100vw - 24px));
}

.violation-detail-drawer__meta,
.violation-detail-drawer__period {
  color: var(--muted);
  font-weight: 700;
}

.violation-detail-drawer__period {
  margin: -6px 0 18px;
}

.violation-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.violation-detail-tabs__button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.violation-detail-tabs__button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.violation-detail-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.violation-detail-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.violation-detail-item__head span {
  color: var(--accent);
  font-weight: 800;
  text-align: right;
}

.violation-detail-item__times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.violation-detail-item__times div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
}

.violation-detail-item__times span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.violation-detail-item__times strong {
  white-space: pre-line;
}

.violation-detail-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.violation-explain {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.violation-explain__title {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
}

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

.violation-explain__grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.violation-explain__grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.violation-explain__grid strong {
  color: var(--text);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.violation-explain__reasons {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.35;
}

.employee-card-photo {
  display: grid;
  place-items: center;
  width: 176px;
  aspect-ratio: 3 / 4;
  margin: 0 auto 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.employee-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
}

.employee-card-photo__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  font-weight: 700;
  background: var(--accent-soft);
}

.employee-card-block {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.employee-card-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.employee-card-block__head h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 900;
}

.employee-card-block__head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.employee-events-drawer .side-drawer__panel {
  width: min(520px, calc(100vw - 24px));
}

.employee-worked-drawer .side-drawer__panel {
  width: min(620px, calc(100vw - 24px));
}

.employee-shift-drawer .side-drawer__panel {
  width: min(520px, calc(100vw - 24px));
}

.employee-shift-drawer .side-drawer__backdrop {
  background: rgba(31, 42, 55, 0.12);
}

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

.employee-worked-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.employee-worked-summary span {
  color: var(--muted);
  font-weight: 800;
}

.employee-worked-summary strong {
  color: var(--text);
  font-size: 1.2rem;
}

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

.employee-worked-day {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(221, 209, 191, 0.78);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.employee-worked-day--issue {
  border-color: rgba(178, 74, 46, 0.35);
  background: #fff;
}

.employee-worked-day__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.employee-worked-day__head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-worked-day__head strong {
  color: var(--text);
}

.employee-worked-day__head span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.employee-worked-day__head b {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.86rem;
  text-align: right;
}

.employee-worked-day__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.employee-worked-day__grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-worked-day__grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.employee-worked-day__grid strong {
  color: var(--text);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.employee-worked-day__reasons {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.35;
}

.employee-event-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(221, 209, 191, 0.78);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

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

.employee-event-row strong,
.employee-event-row b {
  font-size: 0.9rem;
}

.employee-event-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.employee-event-row b {
  flex: 0 0 auto;
  color: var(--accent);
}

@media (min-width: 900px) {
  .employee-shift-drawer .side-drawer__panel {
    right: auto;
    left: 430px;
    width: min(520px, calc(100vw - 454px));
    animation: employee-shift-drawer-slide-out 0.18s ease-out;
  }
}

@keyframes employee-shift-drawer-slide-out {
  from {
    opacity: 0.82;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.side-drawer--left [data-employee-profile-form] {
  display: block;
}

.side-drawer--left [data-employee-profile-form] .button-row {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin: 16px -24px -24px;
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(221, 209, 191, 0.78);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -12px 28px rgba(39, 32, 26, 0.08);
}

.employee-delete-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.employee-delete-form .button {
  justify-self: flex-start;
}

.employee-delete-confirm-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.employee-delete-confirm-form[hidden],
.archive-delete-form[hidden] {
  display: none;
}

.archive-delete-form {
  display: grid;
  gap: 10px;
  min-width: 280px;
  margin-top: 10px;
}

.archive-delete-form .field__control {
  max-width: 180px;
}

.employee-card-fields {
  display: grid;
  gap: 12px;
}

.employee-card-fields .field__control[readonly] {
  color: var(--text);
  background: rgba(251, 248, 242, 0.82);
}

.employee-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.employee-card-stat {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(221, 209, 191, 0.78);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.employee-card-stat--link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.employee-card-stat--button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.employee-card-stat--link:hover,
.employee-card-stat--link:focus-visible,
.employee-card-stat--button:hover,
.employee-card-stat--button:focus-visible {
  border-color: rgba(178, 74, 46, 0.5);
  background: #fff;
  box-shadow: 0 14px 30px rgba(39, 32, 26, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.employee-card-stat--link:active,
.employee-card-stat--button:active {
  transform: translateY(0);
}

.employee-card-stat--muted {
  opacity: 0.72;
}

.employee-card-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.employee-card-stats strong {
  min-width: 0;
  overflow: hidden;
  font-size: 1.2rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-card-stats em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-progress {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(221, 209, 191, 0.78);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.import-progress__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.import-progress__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(221, 209, 191, 0.68);
}

.import-progress__bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.18s ease;
}

.import-progress__meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

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

.access-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.access-choice__label,
.access-choice__code {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.access-choice__title {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .employee-actions-panel,
  .settings-nav-panel,
  .employee-table-filters,
  .shift-form-card__controls,
  .dashboard-filter-card .employee-action-card__controls,
  .violation-filter-panel__show-row,
  .violation-filter-panel__apply-row,
  .violation-filter-panel__filter-fields,
  .overall-filter-panel__exact,
  .overall-filter-panel__service,
  .employee-action-card__controls,
  .employee-action-card__controls--wide {
    grid-template-columns: 1fr;
  }

  .employee-action-card .button {
    width: 100%;
  }

  .violation-filter-panel__periods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }

  .period-choice {
    width: 100%;
  }

  .overall-filter-panel__service {
    grid-column: auto;
  }

  .overall-filter-panel__service .button {
    justify-self: stretch;
  }

  .superadmin-nav {
    grid-template-columns: 1fr;
  }

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

  .dashboard-list-toolbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar-meta {
    justify-items: start;
  }

  .two-column-grid {
    grid-template-columns: 1fr;
  }

  .employee-card-stats {
    grid-template-columns: 1fr;
  }

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

  .access-choice {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .site-header,
  .admin-view-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px;
  }

  .login-card,
  .panel-card,
  .hero-card,
  .stat-card {
    padding: 20px;
    border-radius: 22px;
  }

  .site-nav,
  .button-row,
  .superadmin-nav__links {
    width: 100%;
  }

  .site-nav__link,
  .button,
  .superadmin-nav__links .button {
    width: 100%;
  }

  .dashboard-command-center {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi {
    min-height: 96px;
  }

  .dashboard-filter-chip {
    flex: 1 1 auto;
  }

  .dashboard-search {
    width: 100%;
  }
}
