@import url("https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;700;800;900&display=swap");

:root {
  --ink: #202124;
  --muted: #667085;
  --paper: #fff9ec;
  --panel: #ffffff;
  --line: #e4dccb;
  --fern: #0f6b5f;
  --gold: #e9a93a;
  --danger: #ad4d20;
  --body-font: "Fira Sans", "Segoe UI", Calibri, Arial, sans-serif;
  --display-font: "novalisregular", Georgia, "Times New Roman", serif;
}

@font-face {
  font-family: "novalisregular";
  src: url("https://raphaelhouse.school.nz/wp-content/themes/bolt-theme/assets/fonts/novalis-webfont.woff2") format("woff2"),
       url("https://raphaelhouse.school.nz/wp-content/themes/bolt-theme/assets/fonts/novalis-webfont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  background: #f2f1eb;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f2f1eb;
  font-family: var(--body-font);
  line-height: 1.5;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background-image:
    url("assets/fair-bg-room.jpg"),
    url("assets/fair-bg-table.jpg"),
    url("assets/fair-bg-plants.jpg"),
    url("assets/fair-bg-crafts.jpg"),
    url("assets/fair-bg-cafe.jpg"),
    url("assets/fair-bg-detail.jpg");
  background-position:
    center 24px,
    calc(100% + 90px) 158px,
    -84px 42%,
    calc(100% + 50px) calc(100% - 110px),
    18% calc(100% + 120px),
    62% 72%;
  background-repeat: no-repeat;
  background-size:
    min(960px, 88vw) auto,
    min(430px, 38vw) auto,
    min(430px, 36vw) auto,
    min(500px, 42vw) auto,
    min(520px, 46vw) auto,
    min(460px, 40vw) auto;
  filter: grayscale(1) saturate(.28) contrast(1.04);
  opacity: .42;
}

body::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255,255,255,.64), rgba(244,244,240,.46) 44%, rgba(255,249,236,.70)),
    rgba(255,255,255,.18);
}

body > * {
  position: relative;
  z-index: 1;
}

button,
select,
input,
textarea {
  font: inherit;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

button.secondary,
.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.danger {
  border-color: #e7c5bd;
  color: #8f3f33;
}

button:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 38px);
  background: rgba(255,249,236,.90);
  border-bottom: 1px solid rgba(255,255,255,.56);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 235px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong,
h1,
h2,
h3 {
  font-family: var(--display-font);
  font-weight: normal;
}

.brand small,
.muted {
  color: var(--muted);
}

#groupNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#groupNav a {
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--accent, var(--fern));
  border-radius: 8px;
  background: #fff;
  color: #2a2f35;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.user-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 250px;
}

.user-card {
  display: grid;
  gap: 1px;
  text-align: right;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
}

.user-card:hover strong {
  text-decoration: underline;
}

.admin-shortcut {
  white-space: nowrap;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}

.panel,
.group-card,
.task-card {
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 50px rgba(4,11,22,.18);
  backdrop-filter: blur(10px);
}

.panel {
  padding: clamp(20px, 4vw, 38px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--fern);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

h2 {
  margin: 30px 0 14px;
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  margin: 7px 0 8px;
  line-height: 1.25;
}

.lede {
  max-width: 760px;
  color: #444b55;
  font-size: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stat {
  border-radius: 8px;
  background: #f5eddb;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 27px;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
}

.group-card {
  min-height: 220px;
  padding: 20px;
  border-top: 7px solid var(--accent);
  color: inherit;
  text-decoration: none;
}

.group-card h3 { color: var(--accent); }

.pill-row,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.task-actions {
  align-items: flex-end;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--fern)), white 84%);
  color: color-mix(in srgb, var(--accent, var(--fern)), black 18%);
  min-height: 26px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.page-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 6px;
  width: min(460px, 100%);
  margin: 0 0 18px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  padding: 6px;
  box-shadow: 0 14px 36px rgba(4,11,22,.20);
  backdrop-filter: blur(10px);
}

.tab-button {
  border-radius: 6px;
  background: transparent;
  color: #2a2f35;
  padding: 11px 16px;
  box-shadow: none;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(4,11,22,.22);
}

.tab-panel[hidden] {
  display: none;
}

.task-focus-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.task-focus-header h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
}

.toolbar input,
.toolbar select,
.add-task-form input,
.add-task-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
}

.add-task-panel {
  margin: 18px 0;
  border-top: 6px solid var(--accent);
}

.add-task-panel h2 {
  margin-top: 0;
}

.add-task-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.add-task-form .description-field {
  grid-column: 1 / -1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.checkbox-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-label input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.task-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-left: 6px solid var(--accent);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.task-description {
  color: #48505b;
  margin: 0;
}

.assignee-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.68);
  padding: 8px 10px;
  font-size: 13px;
}

.assignee-label span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.assignee-label strong {
  color: #29323b;
}

.task-description-preview p,
.note p {
  margin: 0;
}

.task-description-preview p + p,
.note p + p {
  margin-top: 8px;
}

.status-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 7px 9px;
  background: #fff;
  font-weight: 800;
}

.task-actions label {
  flex: 1 1 190px;
  min-width: 180px;
}

.task-actions button {
  min-height: 38px;
}

.status-NotStarted {
  background: linear-gradient(180deg, #faf8f1, #f1ede3);
  border-color: #ded6c4;
}

.status-InProgress {
  background: linear-gradient(180deg, #fff7dc, #f7e8a9);
  border-color: #ead17d;
}

.status-Done {
  background: linear-gradient(180deg, #d8f1df, #9bcda8);
  border-color: #347a46;
}

.notes {
  display: grid;
  gap: 8px;
}

.notes-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note {
  border-radius: 8px;
  background: #f7f3ea;
  padding: 10px;
}

.note small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 2px;
}

.notes-more {
  display: grid;
  gap: 8px;
}

.notes-more summary {
  cursor: pointer;
  color: var(--fern);
  font-weight: 900;
}

.note-form {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(13, 18, 25, .48);
  padding: 18px;
}

.task-modal {
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 28px 90px rgba(4,11,22,.34);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-top: 8px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 22px;
}

.modal-header h2 {
  margin: 0;
}

.edit-task-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  padding: 22px;
}

.edit-task-form input,
.edit-task-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.edit-task-form .title-field,
.edit-task-form .description-field,
.edit-task-form .checkbox-label,
.modal-actions {
  grid-column: 1 / -1;
}

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

.modal-comments {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 22px;
}

.modal-note-form {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.profile-panel {
  max-width: 840px;
  margin: 0 auto;
}

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

.profile-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.profile-form label:last-of-type,
.profile-actions {
  grid-column: 1 / -1;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.access-panel {
  max-width: 840px;
  margin: 0 auto;
}

.signed-out-home {
  text-align: center;
  padding: clamp(36px, 8vw, 82px);
}

.signed-out-home .lede {
  margin-left: auto;
  margin-right: auto;
}

.signed-out-home button {
  min-width: 150px;
  margin-top: 8px;
}

.admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.admin-filters {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 6px;
  width: min(460px, 100%);
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.admin-filter {
  border-radius: 6px;
  background: transparent;
  color: #2a2f35;
  padding: 10px 14px;
}

.admin-filter.active {
  background: var(--ink);
  color: #fff;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #252525;
  color: #fff;
}

.admin-table select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
  font-weight: 800;
}

.admin-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  min-width: 330px;
}

.admin-group-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 800;
}

.admin-group-options input {
  flex: 0 0 auto;
}

.admin-table .delete-user {
  width: 100%;
}

.user-status {
  color: #2c3742;
  font-weight: 800;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  background: rgba(255,255,255,.7);
}

.site-footer {
  width: min(1240px, calc(100% - 32px));
  margin: -42px auto 28px;
  color: rgba(32,33,36,.62);
  font-size: 12px;
}

@media (max-width: 940px) {
  body::before {
    background-image:
      url("assets/fair-bg-room.jpg"),
      url("assets/fair-bg-table.jpg");
    background-position:
      center 18px,
      calc(100% + 80px) calc(100% - 70px);
    background-size:
      min(760px, 118vw) auto,
      min(360px, 68vw) auto;
    opacity: .34;
  }

  .app-header,
  .hero {
    display: block;
  }

  #groupNav,
  .user-panel {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .user-card {
    text-align: left;
  }

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

@media (max-width: 680px) {
  .app-header {
    position: static;
    padding: 12px;
  }

  .brand {
    min-width: 0;
  }

  #groupNav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  #groupNav a {
    text-align: center;
    padding: 9px 6px;
  }

  main {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .site-footer {
    width: min(100% - 20px, 1240px);
    margin-top: -50px;
  }

  h1 {
    font-size: clamp(32px, 12vw, 46px);
  }

  .panel {
    padding: 18px;
  }

  .stats,
  .group-grid,
  .task-list {
    grid-template-columns: 1fr;
  }

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

  .page-tabs,
  .task-focus-header {
    width: 100%;
  }

  .page-tabs,
  .task-focus-header {
    display: grid;
  }

  .page-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar input,
  .toolbar select,
  .add-task-form input,
  .add-task-form select,
  .edit-task-form input,
  .edit-task-form select,
  .task-actions label,
  .task-actions button,
  .note-form button,
  .modal-note-form button {
    width: 100%;
  }

  .task-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .modal-header,
  .edit-task-form,
  .modal-comments {
    padding: 16px;
  }

  .modal-header,
  .modal-actions {
    display: grid;
  }

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

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