:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --line: #d4dbe4;
  --line-soft: #e3e8ee;
  --text: #17202c;
  --muted: #66727f;
  --muted-strong: #44505f;
  --primary: #1f4e79;
  --primary-dark: #183b5d;
  --primary-soft: #e9f2fb;
  --danger: #a9342d;
  --danger-soft: #fff3f2;
  --warning: #8a5a14;
  --warning-soft: #fff8e8;
  --success: #26734d;
  --success-soft: #edf8f1;
  --info: #1f5f8b;
  --info-soft: #eef6fc;
  --shadow: 0 1px 2px rgba(23, 32, 44, 0.06);
  --shadow-lg: 0 10px 24px rgba(23, 32, 44, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  background: var(--bg);
}

body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.worker-body {
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.admin-body {
  background:
    linear-gradient(180deg, #eef2f5 0, #f5f7f9 172px, #f3f5f7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.auth-body {
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef4f5 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 58px;
  padding: 0 clamp(20px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.topbar > *,
.page > * {
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: min(32vw, 420px);
  font-size: 0.96rem;
  font-weight: 850;
  letter-spacing: 0;
}

.brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #203244;
  color: white;
  font-size: 0.88rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 4px;
  padding: 6px 11px;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
}

.topnav a.active {
  background: var(--primary);
  color: white;
}

.topnav a.active:hover {
  background: var(--primary-dark);
  color: white;
}

.topnav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.session-box {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.user-pill {
  max-width: 240px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: white;
  color: var(--muted-strong);
  padding: 5px 9px;
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.auth-body .page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: min(100% - 32px, 420px);
  padding: 24px 0;
}

.login-only {
  display: grid;
  width: 100%;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  min-height: calc(100vh - 160px);
}

.auth-copy h1,
.page-title h1 {
  margin: 0;
  color: #101828;
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.06rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.title-meta {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 6px 11px;
  font-size: 0.85rem;
  font-weight: 750;
}

.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.admin-body .panel {
  box-shadow: none;
}

.panel + .panel {
  margin-top: 16px;
}

.narrow-panel {
  max-width: 680px;
  margin: 36px auto;
}

.auth-panel {
  width: 100%;
  max-width: 380px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.auth-panel > .primary-button {
  margin-top: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.worker-grid {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

.wide-panel {
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 32px;
}

.section-title.compact {
  margin-bottom: 12px;
}

.section-title h1,
.section-title h2 {
  margin: 0;
  color: #101828;
  font-size: 0.96rem;
  font-weight: 850;
  letter-spacing: 0;
}

.stack-form {
  display: grid;
  gap: 12px;
}

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

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

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field span {
  color: var(--muted-strong);
  font-size: 0.79rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid #c5ced9;
  border-radius: 4px;
  background: white;
  color: var(--text);
  padding: 8px 9px;
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-password-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.14);
}

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

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 9px;
  background: white;
  font-weight: 750;
}

.checkline input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.compact-check {
  min-height: 32px;
  padding: 6px 8px;
}

.compact-check span {
  font-size: 0.8rem;
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.inline-permissions {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  margin-bottom: 8px;
}

.permission-form {
  min-width: 340px;
}

.admin-permission-field.is-disabled .checkline {
  background: #f4f6f8;
  color: var(--muted);
  cursor: not-allowed;
}

.admin-permission-field.is-disabled input {
  cursor: not-allowed;
}

.permission-summary {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 360px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.segmented label {
  min-width: 0;
}

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

.segmented span {
  display: grid;
  place-items: center;
  min-height: 38px;
  color: var(--muted);
  font-weight: 800;
}

.segmented input:checked + span {
  background: var(--primary);
  color: white;
}

.primary-button,
.secondary-button,
.small-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 7px 12px;
  font-weight: 820;
  line-height: 1.2;
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: white;
}

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

.secondary-button {
  border-color: #b7c2cf;
  background: var(--surface);
  color: #243447;
}

.secondary-button:hover,
.small-button:hover {
  background: var(--surface-muted);
}

.small-button {
  min-height: 30px;
  border-color: #c5ced9;
  background: white;
  color: #344054;
  font-size: 0.82rem;
}

.danger-button {
  border-color: #e4b2ad;
  background: var(--danger-soft);
  color: var(--danger);
}

.text-button {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
}

.text-button:hover {
  color: var(--text);
}

.full {
  width: 100%;
}

.inline {
  margin-top: 18px;
}

.alert {
  margin-bottom: 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 11px 13px;
  font-weight: 800;
}

.alert-success {
  border-color: #addfc1;
  background: var(--success-soft);
  color: var(--success);
}

.alert-danger {
  border-color: #e4b2ad;
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 14px;
}

.stat-card.highlight {
  border-color: #a8bfd6;
  background: #f2f7fc;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.stat-card strong {
  color: #0f1f31;
  font-size: 1.8rem;
  line-height: 1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 11px;
  text-align: left;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f8fbfd;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f4f7;
  color: #3f4b59;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

td {
  color: #1d2939;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

td strong {
  display: block;
  font-weight: 850;
}

.clickable-table-row {
  cursor: pointer;
}

.clickable-table-row:hover,
.clickable-table-row:focus {
  background: var(--primary-soft);
  outline: 2px solid rgba(31, 78, 121, 0.28);
  outline-offset: -2px;
}

.schedule-status-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.schedule-registration-link {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.schedule-registration-link:hover {
  text-decoration: underline;
}

.table-subtext {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.count-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.count-badge {
  border-color: #d4dbe4;
  background: #f4f6f8;
  color: #344054;
}

.status-pill.planned {
  border-color: #b8d2e8;
  background: var(--info-soft);
  color: var(--info);
}

.status-pill.installed,
.status-pill.active {
  border-color: #b7dbc7;
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.postponed {
  border-color: #e5ca91;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.cancelled,
.status-pill.inactive {
  border-color: #d4dbe4;
  background: #f4f6f8;
  color: #475467;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.row-actions,
.button-row,
.account-actions,
.inline-password-form {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.account-actions {
  align-items: flex-start;
  flex-direction: column;
}

.inline-password-form input {
  width: 150px;
  min-height: 30px;
  border: 1px solid #c5ced9;
  border-radius: 4px;
  padding: 6px 8px;
  outline: none;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: white;
}

.detail-list div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.detail-list dd {
  display: flex;
  align-items: center;
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

/* Account management */
.users-page {
  --account-radius: 7px;
}

.users-page-title {
  margin-bottom: 14px;
}

.page-description {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--account-radius);
  background: var(--surface);
}

.account-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 76px;
  padding: 14px 18px;
  border-right: 1px solid var(--line-soft);
}

.account-stat:last-child {
  border-right: 0;
}

.account-stat > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.account-stat > div > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat strong {
  color: #101828;
  font-size: 1.45rem;
  line-height: 1;
  white-space: nowrap;
}

.account-stat strong small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.account-stat-icon {
  position: relative;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
}

.account-stat-icon.active {
  background: var(--success);
  box-shadow: 0 0 0 5px var(--success-soft);
}

.account-stat-icon.admin {
  background: #6d4aa1;
  box-shadow: 0 0 0 5px #f1ecf8;
}

.account-stat-icon.worker {
  background: var(--warning);
  box-shadow: 0 0 0 5px var(--warning-soft);
}

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

.account-layout > .panel + .panel {
  margin-top: 0;
}

.account-create-panel,
.account-list-panel {
  border-radius: var(--account-radius);
}

.account-create-panel {
  position: sticky;
  top: 74px;
}

.section-heading,
.account-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin: -2px -2px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading h2,
.account-list-title h2 {
  margin: 2px 0 0;
  color: #101828;
  font-size: 1.02rem;
  line-height: 1.25;
}

.section-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 500;
}

.account-create-form {
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 12px;
}

.form-section.compact-section {
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.form-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: -2px;
}

.form-section-title span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.form-section-title small {
  color: var(--muted);
  font-size: 0.7rem;
}

.field .field-hint {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
}

.users-page .field input,
.users-page .field select {
  min-height: 41px;
  border-color: #cbd3dc;
  border-radius: 5px;
  padding: 9px 10px;
}

.users-page input::placeholder {
  color: #98a2b3;
}

.permission-field {
  min-width: 0;
  margin: 0;
  border: 1px solid #cbd8e4;
  border-radius: 6px;
  background: #f8fbfe;
  padding: 11px;
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.permission-field legend {
  padding: 0 5px;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.permission-field > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.7rem;
}

.permission-field.is-disabled {
  border-color: var(--line-soft);
  background: #f6f7f9;
  opacity: 0.68;
}

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

.permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: white;
  padding: 7px 8px;
  cursor: pointer;
}

.permission-option:hover {
  border-color: #b7c7d6;
}

.permission-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.permission-option > span:last-child {
  display: grid;
  min-width: 0;
}

.permission-option strong {
  overflow: hidden;
  color: #344054;
  font-size: 0.73rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-option small {
  color: var(--muted);
  font-size: 0.65rem;
}

.admin-permission-field.is-disabled .permission-option {
  background: #f3f5f7;
  cursor: not-allowed;
}

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

.password-control input {
  width: 100%;
  padding-right: 52px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  min-width: 40px;
  min-height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.password-toggle:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.password-toggle:focus-visible,
.account-settings summary:focus-visible {
  outline: 2px solid rgba(31, 78, 121, 0.35);
  outline-offset: 2px;
}

.create-account-button {
  min-height: 41px;
  gap: 7px;
  border-radius: 5px;
}

.create-account-button span {
  font-size: 1.05rem;
  font-weight: 500;
}

.account-list-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.account-list-header {
  align-items: center;
  padding: 17px 18px 15px;
}

.account-list-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-list-caption {
  max-width: 320px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.account-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 156px) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.account-search {
  position: relative;
  display: block;
  min-width: 0;
}

.account-search svg {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7b8794;
  stroke-linecap: round;
  stroke-width: 1.6;
  pointer-events: none;
}

.account-search input,
.account-filter select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd3dc;
  border-radius: 5px;
  background: white;
  color: var(--text);
  outline: none;
}

.account-search input {
  padding: 7px 10px 7px 35px;
}

.account-filter select {
  padding: 7px 28px 7px 9px;
}

.account-search input:focus,
.account-filter select:focus,
.password-reset-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.14);
}

.account-result-count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.account-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f5f7f9;
}

.account-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  box-shadow: 0 1px 1px rgba(23, 32, 44, 0.03);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.account-card:hover {
  border-color: #b7c3cf;
  box-shadow: 0 3px 10px rgba(23, 32, 44, 0.05);
}

.account-card.is-current {
  border-left: 3px solid var(--primary);
}

.account-card.is-inactive {
  background: #fbfbfc;
}

.account-card.is-inactive .account-avatar,
.account-card.is-inactive .account-identity-copy,
.account-card.is-inactive .account-card-overview {
  opacity: 0.68;
}

.account-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px 11px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid #c9dced;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 900;
}

.account-avatar.admin {
  border-color: #d8c9e9;
  background: #f2edf8;
  color: #61418e;
}

.account-identity-copy {
  min-width: 0;
}

.account-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.account-name-line h3 {
  overflow: hidden;
  margin: 0;
  color: #17202c;
  font-size: 0.94rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-username {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 21px;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.current-badge {
  border: 1px solid #bfd3e6;
  background: var(--primary-soft);
  color: var(--primary);
}

.account-card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.role-badge {
  border: 1px solid #cfd7e0;
  background: #f5f7f9;
  color: #475467;
}

.role-badge.admin {
  border-color: #d8c9e9;
  background: #f5f1fa;
  color: #61418e;
}

.role-badge.super-admin {
  border-color: #d7b96e;
  background: #fff8df;
  color: #76520a;
}

.account-card .status-pill {
  gap: 5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.account-card-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 0 14px 12px 63px;
}

.account-overview-item {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.created-overview {
  min-width: 126px;
}

.overview-label {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 850;
}

.overview-value {
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.permission-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.permission-chip {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid #d5dee7;
  border-radius: 4px;
  background: #f8fafc;
  color: #475467;
  padding: 2px 6px;
  font-size: 0.66rem;
  font-weight: 750;
  white-space: nowrap;
}

.account-settings {
  border-top: 1px solid var(--line-soft);
}

.account-settings summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 8px 14px;
  color: var(--muted-strong);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.account-settings summary::-webkit-details-marker {
  display: none;
}

.account-settings summary:hover {
  background: #f8fafc;
}

.settings-summary-title {
  font-size: 0.75rem;
  font-weight: 850;
}

.settings-summary-description {
  color: var(--muted);
  font-size: 0.7rem;
}

.account-settings summary svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: transform 150ms ease;
}

.account-settings[open] summary svg {
  transform: rotate(180deg);
}

.account-settings[open] summary {
  border-bottom: 1px solid var(--line-soft);
  background: #fafbfd;
}

.account-settings-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  background: #fcfcfd;
}

.settings-block {
  min-width: 0;
  padding: 14px;
}

.permission-settings {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line-soft);
}

.security-settings {
  border-right: 1px solid var(--line-soft);
}

.settings-block-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-block-heading h4 {
  margin: 0;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 850;
}

.settings-block-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.readonly-permissions .permission-option {
  cursor: default;
}

.readonly-permissions .permission-option:hover {
  border-color: var(--line-soft);
}

.readonly-permissions .permission-option:not(.is-selected) {
  background: #f4f5f7;
  opacity: 0.65;
}

.readonly-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #e7edf3;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.permission-option.is-selected .readonly-check {
  background: var(--primary);
  color: white;
}

.permission-form {
  min-width: 0;
}

.settings-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.settings-form-footer > span {
  color: var(--muted);
  font-size: 0.66rem;
}

.settings-form-footer .secondary-button,
.password-reset-form .secondary-button,
.status-settings .secondary-button {
  min-height: 32px;
  font-size: 0.75rem;
}

.password-reset-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.compact-password-control {
  flex: 1 1 160px;
  min-width: 130px;
}

.password-reset-form input {
  width: 100%;
  min-height: 33px;
  border: 1px solid #cbd3dc;
  border-radius: 5px;
  padding: 7px 50px 7px 9px;
  outline: none;
}

.protected-account-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  border: 1px solid #bfd3e6;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 6px 9px;
  font-size: 0.7rem;
  font-weight: 800;
}

.protected-account-note > span {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.58rem;
}

.secondary-button.activate-button {
  border-color: #a9d3bc;
  background: var(--success-soft);
  color: var(--success);
}

.secondary-button.activate-button:hover {
  background: #e2f3e9;
}

.secondary-button.danger-button:hover {
  background: #fde7e5;
}

.account-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 180px;
  place-content: center;
  border: 1px dashed #cbd3dc;
  border-radius: 6px;
  background: white;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.account-empty svg {
  margin-bottom: 5px;
  fill: none;
  stroke: #8b98a7;
  stroke-linecap: round;
  stroke-width: 1.4;
}

.account-empty strong {
  color: var(--muted-strong);
  font-size: 0.86rem;
}

.account-empty p {
  margin: 0;
  font-size: 0.75rem;
}

.empty-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.1rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .account-layout {
    grid-template-columns: minmax(310px, 340px) minmax(0, 1fr);
  }

  .account-card-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .created-overview {
    min-width: 0;
  }

  .account-settings-content {
    grid-template-columns: 1fr;
  }

  .security-settings {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
}

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

  .account-create-panel {
    position: static;
  }

  .account-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .account-create-form .form-section:first-child {
    grid-row: span 2;
  }

  .account-create-form .compact-section {
    padding-top: 0;
    border-top: 0;
  }

  .account-create-form .create-account-button {
    grid-column: 2;
  }

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

  .security-settings {
    border-right: 1px solid var(--line-soft);
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .account-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-stat:nth-child(2) {
    border-right: 0;
  }

  .account-stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

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

  .account-create-form .form-section:first-child {
    grid-row: auto;
  }

  .account-create-form .compact-section {
    padding-top: 13px;
    border-top: 1px solid var(--line-soft);
  }

  .account-create-form .create-account-button {
    grid-column: auto;
  }

  .account-list-header {
    align-items: flex-start;
  }

  .account-list-caption {
    display: none;
  }

  .account-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 145px);
  }

  .account-result-count {
    grid-column: 1 / -1;
  }

  .account-settings-content {
    grid-template-columns: 1fr;
  }

  .security-settings {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
}

@media (max-width: 520px) {
  .account-stat {
    min-height: 67px;
    padding: 11px 12px;
  }

  .account-stat > div {
    display: grid;
    gap: 4px;
  }

  .account-stat strong {
    font-size: 1.25rem;
  }

  .permission-option-grid {
    grid-template-columns: 1fr;
  }

  .account-toolbar {
    grid-template-columns: 1fr;
  }

  .account-result-count {
    grid-column: auto;
  }

  .account-card-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .account-card-badges {
    justify-content: flex-start;
    padding-left: 49px;
  }

  .account-card-overview {
    padding-left: 14px;
  }

  .account-settings summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .settings-summary-description {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .password-reset-form,
  .settings-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-password-control {
    flex-basis: auto;
  }
}

/* PC work management */
.management-lookup-panel {
  max-width: 760px;
  margin: 0 auto 16px;
}

.management-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.management-lookup-form input {
  min-height: 48px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.management-lookup-form .primary-button {
  min-height: 48px;
  min-width: 92px;
}

.pc-lookup-alert {
  max-width: 760px;
  margin-inline: auto;
}

.pc-target-panel,
.pc-log-panel {
  max-width: 980px;
  margin-inline: auto;
}

.pc-target-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.pc-target-heading h2 {
  margin: 2px 0 0;
  color: #101828;
  font-size: 1.28rem;
}

.pc-target-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.pc-target-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill.pending {
  border-color: #b8d2e8;
  background: var(--info-soft);
  color: var(--info);
}

.status-pill.completed {
  border-color: #b7dbc7;
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.returned {
  border-color: #d4dbe4;
  background: #f4f6f8;
  color: #475467;
}

.status-pill.work-type {
  border-color: #c9b9df;
  background: #f5f0fb;
  color: #65458f;
}

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

.pc-detail-list {
  margin-bottom: 14px;
}

.pc-detail-list div {
  grid-template-columns: 100px minmax(0, 1fr);
}

.pc-reference-grid {
  margin-bottom: 14px;
}

.pc-reference-box {
  min-width: 0;
  margin-bottom: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface-muted);
  padding: 12px 14px;
}

.pc-reference-grid .pc-reference-box {
  margin-bottom: 0;
}

.pc-reference-box strong {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.pc-reference-box p,
.pc-reference-box ul {
  margin: 0;
  color: #344054;
  font-size: 0.82rem;
  line-height: 1.6;
}

.pc-reference-box ul {
  display: grid;
  gap: 3px;
  padding-left: 18px;
}

.pc-work-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.pc-task-list {
  display: grid;
  gap: 9px;
}

.pc-task-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfd;
  padding: 9px 10px;
}

.pc-task-choice > strong {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
}

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

.task-binary-choice input[value="yes"]:checked + span {
  background: var(--success);
}

.task-binary-choice input[value="no"]:checked + span {
  background: var(--warning);
}

.pc-work-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(160px, 1fr);
  gap: 10px;
}

.pc-work-actions button {
  min-height: 46px;
}

.postpone-button {
  border-color: #d5b77b;
  background: var(--warning-soft);
  color: var(--warning);
}

.pc-closed-notice {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  border: 1px solid #b7dbc7;
  border-radius: 5px;
  background: var(--success-soft);
  color: var(--success);
  padding: 14px;
}

.pc-closed-notice span {
  font-size: 0.8rem;
}

.pc-log-list {
  display: grid;
  gap: 9px;
}

.pc-log-list article {
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 10px 12px;
}

.pc-log-list article > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pc-log-list time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}

.pc-log-list p {
  margin: 7px 0 0;
  color: var(--muted-strong);
  font-size: 0.8rem;
}

.task-result-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.task-result-list.compact-results {
  display: grid;
  justify-items: start;
  margin-top: 0;
}

.task-result {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--muted-strong);
  padding: 3px 6px;
  font-size: 0.68rem;
  font-weight: 800;
}

.task-result.yes {
  border-color: #b7dbc7;
  background: var(--success-soft);
  color: var(--success);
}

.task-result.no {
  border-color: #e5ca91;
  background: var(--warning-soft);
  color: var(--warning);
}

.dashboard-pc-summary {
  margin-bottom: 16px;
}

.embedded-stat-grid {
  margin-bottom: 0;
}

.pc-work-filter {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(4, minmax(120px, 0.75fr)) auto;
  gap: 10px;
  align-items: end;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  text-align: center;
}

.pagination > :last-child {
  justify-self: end;
}

.import-guide-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted-strong);
  font-size: 0.8rem;
  line-height: 1.5;
}

.import-warning {
  margin: 16px 0 0;
  font-size: 0.76rem;
}

@media (max-width: 1000px) {
  .pc-work-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .management-lookup-form,
  .pc-info-grid,
  .pc-reference-grid,
  .pc-work-filter {
    grid-template-columns: 1fr;
  }

  .management-lookup-form .primary-button {
    width: 100%;
  }

  .pc-target-heading {
    flex-direction: column;
  }

  .pc-target-badges {
    justify-content: flex-start;
  }

  .pc-work-actions {
    grid-template-columns: 1fr;
  }

  .pc-task-choice {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pc-work-actions .postpone-button {
    order: 2;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 14px;
  }

  .topnav {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
  }

  .session-box {
    justify-content: flex-end;
  }

  .auth-layout,
  .content-grid,
  .worker-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .topbar,
  .page,
  .worker-page,
  .worker-page .narrow-panel,
  .worker-page .stack-form {
    min-width: 0;
    max-width: 100%;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    display: none;
  }

  .page {
    width: min(100% - 20px, 1320px);
    padding-top: 16px;
  }

  .session-box {
    min-width: 0;
  }

  .user-pill {
    min-width: 0;
    max-width: min(32vw, 120px);
  }

  .worker-page .narrow-panel {
    width: 100%;
    margin-inline: 0;
  }

  .worker-page select {
    min-width: 0;
    max-width: 100%;
  }

  .auth-body .page {
    width: min(100% - 24px, 420px);
    padding: 20px 0;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .check-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .stat-card {
    min-height: 84px;
    padding: 12px;
  }

  table {
    min-width: 720px;
  }

  .worker-page .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .worker-page table,
  .worker-page thead,
  .worker-page tbody,
  .worker-page tr,
  .worker-page td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .worker-page table {
    background: transparent;
  }

  .worker-page thead {
    display: none;
  }

  .worker-page tbody {
    display: grid;
    gap: 10px;
  }

  .worker-page tr {
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    background: white;
  }

  .worker-page td {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    min-height: 38px;
    border-bottom: 1px solid var(--line-soft);
    padding: 9px 11px;
    font-size: 0.88rem;
  }

  .worker-page td:last-child {
    border-bottom: 0;
  }

  .worker-page td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
  }

  .worker-page td.empty-cell {
    display: block;
    padding: 18px 12px;
  }

  .worker-page td.empty-cell::before {
    content: none;
  }

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

  .permission-form {
    min-width: 260px;
  }

  .account-list-panel {
    padding: 0;
  }

  .account-list-panel .permission-form {
    min-width: 0;
  }
}

/* Schedule registration */
.schedule-title-actions a {
  gap: 7px;
}

.schedule-title-actions svg,
.template-heading svg,
.excel-file-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.section-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.schedules-panel .section-title {
  align-items: flex-start;
}

.schedule-empty-cell {
  height: 150px;
}

.schedule-empty-cell strong {
  margin-bottom: 4px;
  color: var(--muted-strong);
}

.schedule-empty-cell span {
  color: var(--muted);
  font-size: 0.78rem;
}

.common-schedule-label {
  color: var(--muted-strong);
  font-weight: 750;
}

.schedule-form-panel {
  max-width: 760px;
  margin-top: 20px;
}

.schedule-form-heading {
  align-items: flex-start;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.schedule-entry-form {
  gap: 15px;
}

.required-mark {
  color: var(--danger);
  font-style: normal;
  font-weight: 900;
}

.schedule-form-actions {
  justify-content: flex-end;
  margin-top: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.schedule-delete-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e4b2ad;
}

.schedule-delete-form > div {
  display: grid;
  gap: 3px;
}

.schedule-delete-form strong {
  color: var(--danger);
  font-size: 0.82rem;
}

.schedule-delete-form small {
  color: var(--muted);
  font-size: 0.7rem;
}

.site-settings-panel {
  max-width: 720px;
}

.site-title-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface-muted);
  padding: 13px;
}

.site-title-preview > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.site-title-preview small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.site-title-preview strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.92rem;
}

.backup-settings-panel {
  max-width: 920px;
}

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

.backup-action-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 15px;
}

.backup-action-card h3,
.backup-action-card p {
  margin: 0;
}

.backup-action-card h3 {
  font-size: 0.92rem;
}

.backup-action-card p {
  min-height: 42px;
  color: var(--muted);
  font-size: 0.74rem;
}

.restore-card {
  border-color: #e4b2ad;
  background: var(--danger-soft);
}

.reset-card {
  grid-column: 1 / -1;
  border-color: #d98e87;
  background: #fff0ef;
}

.reset-card > p {
  min-height: 0;
}

.site-reset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.backup-security-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  border: 1px solid #e5ca91;
  border-radius: 5px;
  background: var(--warning-soft);
  color: var(--warning);
  padding: 11px 12px;
}

.backup-security-notice > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warning);
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
}

.backup-security-notice p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
}

.backup-security-notice strong {
  display: block;
}

.schedule-import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 16px;
  align-items: start;
  max-width: 980px;
  margin: 20px auto 0;
}

.schedule-upload-panel,
.schedule-template-panel {
  border-radius: 7px;
}

.file-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #a9d3bc;
  border-radius: 4px;
  background: var(--success-soft);
  color: var(--success);
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 900;
}

.schedule-upload-form {
  gap: 14px;
}

.excel-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 124px;
  overflow: hidden;
  border: 1px dashed #aebbc8;
  border-radius: 7px;
  background: #f8fafc;
  padding: 20px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.excel-dropzone:hover,
.excel-dropzone:focus-within {
  border-color: var(--primary);
  background: #f4f8fc;
  box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.1);
}

.excel-dropzone.has-file {
  border-style: solid;
  border-color: #8fc7a8;
  background: #f5fbf7;
}

.excel-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.excel-file-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 7px;
  background: var(--success-soft);
  color: var(--success);
}

.excel-dropzone-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.excel-dropzone-copy strong {
  overflow: hidden;
  color: #344054;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-dropzone-copy small {
  color: var(--muted);
  font-size: 0.7rem;
}

.file-select-button {
  pointer-events: none;
}

.upload-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #c9ddec;
  border-radius: 5px;
  background: var(--info-soft);
  color: var(--info);
  padding: 10px 11px;
}

.upload-notice > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--info);
  color: white;
  font-family: serif;
  font-size: 0.7rem;
  font-weight: 900;
}

.upload-notice p {
  margin: 0;
  font-size: 0.71rem;
  font-weight: 700;
  line-height: 1.5;
}

.template-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.template-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.template-heading h2 {
  margin: 1px 0 0;
  color: #101828;
  font-size: 0.9rem;
}

.template-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.template-download-button {
  min-height: 38px;
}

.template-guide {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.template-guide h3 {
  margin: 0 0 8px;
  color: var(--muted-strong);
  font-size: 0.75rem;
}

.template-guide ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: schedule-column;
}

.template-guide li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 1px 7px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  counter-increment: schedule-column;
}

.template-guide li:last-child {
  border-bottom: 0;
}

.template-guide li::before {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  align-self: start;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef1f4;
  color: var(--muted-strong);
  content: counter(schedule-column);
  font-size: 0.62rem;
  font-weight: 900;
}

.template-guide li span {
  color: #344054;
  font-size: 0.72rem;
  font-weight: 800;
}

.template-guide li small {
  color: var(--muted);
  font-size: 0.65rem;
}

@media (max-width: 860px) {
  .schedule-import-layout {
    grid-template-columns: 1fr;
    max-width: 760px;
  }
}

@media (max-width: 640px) {
  .schedule-index-title {
    gap: 14px;
  }

  .schedule-title-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .schedule-title-actions a {
    width: 100%;
    padding-inline: 8px;
  }

  .schedule-form-panel,
  .schedule-import-layout {
    margin-top: 0;
  }

  .excel-dropzone {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 118px;
    padding: 16px;
  }

  .file-select-button {
    display: none;
  }

  .schedule-form-actions > * {
    flex: 1 1 120px;
  }

  .schedule-delete-form {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-action-grid {
    grid-template-columns: 1fr;
  }

  .reset-card {
    grid-column: auto;
  }

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

@media (max-width: 400px) {
  .schedule-title-actions {
    grid-template-columns: 1fr;
  }

  .excel-dropzone {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .excel-dropzone-copy strong {
    max-width: 230px;
  }
}

/* Destructive account actions */
.account-state-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.secondary-button.permanent-delete-button {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
}

.secondary-button.permanent-delete-button:hover {
  border-color: #8f2924;
  background: #8f2924;
}

.account-delete-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid #e4b2ad;
  border-radius: 5px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 9px 10px;
}

.account-delete-warning > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
}

.account-delete-warning p {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.5;
}

.account-delete-warning strong {
  display: block;
  margin-bottom: 1px;
  font-size: 0.7rem;
}

@media (max-width: 520px) {
  .account-state-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-state-actions form,
  .account-state-actions button {
    width: 100%;
  }
}
