/* ------------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 30, 66, .54); }
.modal-card {
  position: relative; background: var(--bg-2); border-radius: 8px;
  width: min(900px, 92vw); max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(9, 30, 66, .3);
}
.modal-card > header {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal-actions { margin-left: auto; display: flex; gap: 8px; }
.modal-body { padding: 16px; overflow: auto; }
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.settings-heading h2 { margin: 2px 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.settings-actions .btn { min-height: 38px; }
.user-settings-notice {
  display: flex; align-items: center; justify-content: flex-start; gap: 16px;
  margin-bottom: 12px; padding: 12px 14px; border: 1px solid #ffbdad;
  border-left: 4px solid #f97316; border-radius: 6px; background: #fff7ed; color: #9a3412;
}
.user-settings-notice p { flex: 0 1 auto; max-width: 760px; margin: 0; }
.user-settings-notice .btn { flex: 0 0 auto; border-color: #f97316; color: #c2410c; }
.dashboard-table-wrap { width: 100%; margin-top: 16px; overflow-x: auto; }
.dashboard-table { width: 100%; border-collapse: collapse; text-align: left; }
.dashboard-table th, .dashboard-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dashboard-table th { color: var(--fg-dim); font-size: 11px; font-weight: 700; white-space: nowrap; }
.dashboard-table td { font-size: 13px; }
.dashboard-table tbody tr.is-active td { background: #f0f7f4; }
.dashboard-table .dashboard-actions { display: flex; gap: 6px; white-space: nowrap; }
.dashboard-table .dashboard-empty { padding: 20px 12px; color: var(--fg-dim); text-align: center; }
.readonly-config {
  max-height: 70vh; margin: 0; padding: 18px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--bg); color: var(--fg); font: 12px/1.5 ui-monospace, Consolas, monospace;
}
.wizard-dialog {
  width: min(900px, 94vw); max-height: 90vh; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); color: var(--fg);
  box-shadow: 0 12px 36px rgba(9, 30, 66, .28);
}
.wizard-dialog::backdrop { background: rgba(9, 30, 66, .58); }
.wizard-header, .wizard-footer { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.wizard-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.wizard-header h2 { margin: 2px 0 0; font-size: 18px; }
.wizard-kicker { color: var(--fg-dim); font-size: 10px; font-weight: 700; }
.wizard-progress-wrap { padding: 12px 18px 0; }
.wizard-progress-label { display: flex; justify-content: space-between; gap: 12px; color: var(--fg-dim); font-size: 12px; }
.wizard-progress-track { height: 4px; margin-top: 7px; overflow: hidden; background: var(--bg-3); }
.wizard-progress { height: 100%; width: 25%; background: var(--accent-2); transition: width .2s ease; }
.wizard-content { max-height: 65vh; overflow: auto; padding: 18px; }
.wizard-step h3 { margin: 0 0 5px; font-size: 16px; }
.wizard-step > label, .wizard-inline-fields label { display: grid; gap: 5px; margin-top: 14px; color: var(--fg-dim); font-size: 12px; }
.wizard-step input, .wizard-step textarea, .wizard-step select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--fg);
}
.wizard-step textarea { resize: vertical; }
.wizard-component-fieldset { margin: 14px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.wizard-component-fieldset legend { padding: 0 5px; color: var(--fg-dim); font-size: 12px; font-weight: 700; }
.wizard-note { padding: 10px 12px; border-left: 3px solid var(--accent-2); background: #f4f8ff; color: var(--fg-dim); font-size: 12px; }
.wizard-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.wizard-filter-grid fieldset { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.wizard-filter-grid legend { padding: 0 5px; color: var(--fg-dim); font-size: 12px; font-weight: 700; }
.wizard-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 10px; max-height: 150px; overflow: auto; }
.wizard-options label { display: flex; align-items: flex-start; gap: 7px; min-width: 0; color: var(--fg); font-size: 12px; overflow-wrap: anywhere; }
.wizard-options input { width: 15px; height: 15px; flex: none; margin: 1px 0 0; }
.wizard-watch { margin-top: 14px; }
.wizard-inline-fields { display: grid; grid-template-columns: minmax(160px, .6fr) minmax(240px, 1fr); gap: 12px; }
.wizard-review { display: grid; gap: 8px; margin-top: 16px; }
.wizard-review-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wizard-review-row b { color: var(--fg-dim); font-size: 12px; }
.wizard-status { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 12px; }
.wizard-footer { border-top: 1px solid var(--line); }
@media (max-width: 620px) {
  .settings-heading { flex-direction: column; }
  .settings-actions { display: grid; grid-template-columns: 1fr; }
  .user-settings-notice { align-items: stretch; flex-direction: column; }
  .user-list li { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .user-list .grow { min-width: 0; overflow-wrap: anywhere; }
  .user-hours { grid-column: 3; grid-row: 2; }
  .user-membership-tag { justify-self: start; }
  .user-vacations { grid-row: 3; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .user-vac-add { grid-column: 1 / -1; }
  .holiday-heading { flex-direction: column; }
  .holiday-form { align-items: stretch; flex-direction: column; }
  .wizard-filter-grid, .wizard-inline-fields { grid-template-columns: 1fr; }
  .wizard-review-row { grid-template-columns: 1fr; gap: 3px; }
  .wizard-progress-label { flex-direction: column; gap: 2px; }
}
.modal-body h4 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; color: var(--fg-dim); letter-spacing: .5px; }
.modal-body .desc { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px; white-space: pre-wrap; word-break: break-word; }
.modal-body .desc img { max-width: 100%; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.field { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.field b { display: block; font-size: 10px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.comment { border-left: 2px solid var(--line); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.comment .who { font-size: 12px; color: var(--fg-dim); margin-bottom: 4px; }
.comment .what { white-space: pre-wrap; word-break: break-word; }

.actions-bar {
  margin-top: 14px; padding: 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; display: grid; gap: 10px;
}
.action-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.action-group .filter-label { width: 70px; padding-top: 0; }
.action-group select {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--fg);
}

.comment-form { display: grid; gap: 8px; justify-items: end; margin-top: 10px; }
.comment-form textarea {
  width: 100%; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--fg); resize: vertical;
}

