/* Settings / first-time setup: school name, logo, bar color with a live preview. Plus the danger zone and reset dialog. */
.setup {
   padding-inline: 16px;
   padding-block: 40px 64px;
}
.setup-card {
   max-width: 660px;
   margin: 0 auto;
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: 12px;
   overflow: hidden;
}
.setup-head {
   display: flex;
   justify-content: space-between;
   align-items: start;
   gap: 12px;
   padding: 24px 24px 0;
}
.setup-head h1 {
   margin: 4px 0 0;
   font-family: var(--font-display);
   font-size: 32px;
   line-height: 1.1;
   text-wrap: balance;
}

/* Step indicator */
.steps {
   list-style: none;
   margin: 20px 24px 0;
   padding: 0;
   display: grid;
   grid-template-columns: repeat(3, minmax(0, 1fr));
   gap: 10px;
}
.steps button {
   width: 100%;
   text-align: left;
   background: none;
   border: 0;
   border-top: 3px solid var(--line);
   padding: 8px 0 0;
   font-weight: 600;
   color: var(--muted);
   cursor: default;
}
.steps .num {
   display: block;
   font-family: var(--font-mono);
   font-size: 11px;
   font-weight: 500;
}
.steps li.done button {
   border-top-color: var(--ok);
   color: var(--fg);
}
.steps li.current button {
   border-top-color: var(--accent);
   color: var(--fg);
}
.setup.editing .steps button {
   cursor: pointer;
}
.setup.editing .steps li:not(.current) button:hover {
   color: var(--fg);
}

/* Live preview of the top bar */
.preview {
   margin: 20px 24px 0;
   border: 1px solid var(--line);
   border-radius: 8px;
   overflow: hidden;
}
.preview-label {
   display: block;
   font-size: 11px;
   text-transform: uppercase;
   letter-spacing: 0.08em;
   color: var(--muted);
   padding: 6px 12px;
   background: var(--surface-2);
   border-bottom: 1px solid var(--line);
}
.preview-bar {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 12px 14px;
   font-family: var(--font-display);
   font-weight: 700;
   font-size: 21px;
   transition:
      background 0.25s,
      color 0.25s;
}
.preview-bar small {
   font-family: var(--font-body);
   font-weight: 500;
   font-size: 11px;
   opacity: 0.7;
   letter-spacing: 0.06em;
   text-transform: uppercase;
}
.pv-who {
   margin-left: auto;
   font-family: var(--font-body);
   font-weight: 400;
   font-size: 12px;
   opacity: 0.8;
   letter-spacing: 0;
}
@media (max-width: 520px) {
   .pv-who {
      display: none;
   }
}
.preview-body {
   background: var(--bg);
   padding: 12px 14px;
   display: flex;
   flex-direction: column;
   gap: 8px;
}
.pv-search {
   display: flex;
   height: 26px;
   border: 2px solid var(--accent);
   border-radius: 6px;
   background: var(--surface);
   overflow: hidden;
   transition: border-color 0.25s;
}
.pv-search i {
   flex: 1;
}
.pv-search b {
   background: var(--accent);
   color: var(--on-accent);
   font-size: 11px;
   font-weight: 600;
   padding: 0 12px;
   display: grid;
   place-items: center;
   transition: background 0.25s;
}
.pv-row {
   display: flex;
   align-items: center;
   gap: 10px;
   height: 26px;
   padding: 0 10px;
   border-radius: 4px;
   background: var(--accent-soft);
   box-shadow: inset 3px 0 0 var(--accent);
   transition: background 0.25s;
}
.pv-row i {
   display: block;
   height: 8px;
   width: 45%;
   border-radius: 99px;
   background: var(--line);
}

/* Form steps */
#setupForm {
   padding: 20px 24px 24px;
   display: flex;
   flex-direction: column;
   gap: 16px;
}
.step {
   display: flex;
   flex-direction: column;
   gap: 14px;
}
.logo-drop {
   display: grid;
   grid-template-columns: 104px minmax(0, 1fr);
   gap: 16px;
   align-items: center;
   border: 2px dashed var(--line);
   border-radius: 10px;
   padding: 16px;
}
.logo-drop.drag {
   border-color: var(--accent);
   background: var(--accent-soft);
}
@media (max-width: 480px) {
   .logo-drop {
      grid-template-columns: minmax(0, 1fr);
   }
}
.logo-drop-preview {
   width: 104px;
   height: 104px;
   border-radius: 8px;
   background: var(--surface-2);
   border: 1px solid var(--line);
   display: grid;
   place-items: center;
   overflow: hidden;
   color: var(--muted);
}
.logo-drop-preview img {
   max-width: 100%;
   max-height: 100%;
   object-fit: contain;
}
.swatches {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
   gap: 8px;
}
.swatch {
   border: 2px solid transparent;
   border-radius: 8px;
   padding: 0;
   background: var(--surface);
   cursor: pointer;
   overflow: hidden;
   text-align: left;
   box-shadow: 0 0 0 1px var(--line);
}
.swatch span {
   display: block;
   height: 32px;
}
.swatch small {
   display: block;
   padding: 4px 8px;
   font-size: 12px;
   color: var(--muted);
}
.swatch[aria-checked="true"] {
   border-color: var(--accent);
   box-shadow: none;
}
.swatch[aria-checked="true"] small {
   color: var(--fg);
   font-weight: 600;
}
.custom-color {
   display: flex;
   align-items: center;
   gap: 10px;
   flex-wrap: wrap;
}
.custom-color label {
   font-size: 12px;
   font-weight: 600;
   color: var(--muted);
}
.custom-color input[type="color"] {
   width: 44px;
   height: 34px;
   border: 1px solid var(--line);
   border-radius: 6px;
   padding: 2px;
   background: var(--surface);
   cursor: pointer;
}
.custom-color input.mono {
   width: 104px;
   border: 1px solid var(--line);
   border-radius: 6px;
   padding: 7px 10px;
   text-transform: uppercase;
}
.setup-foot {
   display: flex;
   justify-content: space-between;
   gap: 10px;
   flex-wrap: wrap;
   border-top: 1px solid var(--line);
   padding-top: 16px;
}
.setup-foot .right {
   display: flex;
   gap: 8px;
   margin-left: auto;
   flex-wrap: wrap;
}

/* Danger zone */
.danger-zone {
   max-width: 660px;
   margin: 16px auto 0;
   background: var(--surface);
   border: 1px solid var(--bad);
   border-radius: 12px;
   padding: 20px 24px;
   display: flex;
   align-items: flex-end;
   justify-content: space-between;
   gap: 16px;
   flex-wrap: wrap;
}
.danger-zone > div {
   flex: 1 1 320px;
   display: flex;
   flex-direction: column;
   gap: 8px;
   min-width: 0;
}
.danger-zone .eyebrow {
   color: var(--bad);
}
.danger-zone h2 {
   margin: 0;
   font-family: var(--font-display);
   font-size: 22px;
}
.danger-zone p {
   margin: 0;
   color: var(--muted);
   font-size: 13px;
}

/* Reset confirmation dialog */
.confirm-modal {
   width: min(520px, 100%);
}
.confirm-modal h2 {
   color: var(--bad);
}
.confirm-body {
   padding: 18px 20px;
   display: flex;
   flex-direction: column;
   gap: 12px;
}
.confirm-body p {
   margin: 0;
}
.confirm-body ul {
   margin: 0;
   padding-left: 20px;
   display: flex;
   flex-direction: column;
   gap: 4px;
}
.confirm-body .warn-box {
   background: var(--bad-soft);
   color: var(--bad);
   border-radius: 8px;
   padding: 10px 12px;
   font-weight: 600;
}
.confirm-body input {
   border: 1px solid var(--line);
   border-radius: 6px;
   padding: 8px 10px;
   font-family: var(--font-mono);
   letter-spacing: 0.08em;
   width: 100%;
}
.confirm-body input:focus {
   outline: none;
   border-color: var(--bad);
   box-shadow: 0 0 0 3px var(--bad-soft);
}
.confirm-step {
   font-size: 12px;
   color: var(--muted);
   font-weight: 600;
   align-self: center;
}

/* Staff & roles */
.staff-card {
   max-width: 660px;
   margin: 16px auto 0;
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: 12px;
   padding: 20px 24px;
   display: flex;
   flex-direction: column;
   gap: 10px;
}
.staff-card h2 {
   margin: 0;
   font-family: var(--font-display);
   font-size: 22px;
}
.staff-card select {
   border: 1px solid var(--line);
   border-radius: 6px;
   padding: 5px 8px;
   background: var(--surface);
}
.staff-card td small {
   display: none;
   color: var(--muted);
   font-size: 12px;
   overflow-wrap: anywhere;
}
@media (max-width: 520px) {
   .staff-card {
      padding: 16px;
   }
   .staff-card td small.show-sm {
      display: block;
   }
}
.staff-card .err:empty {
   display: none;
}
