:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f2f0;
  --ink: #000000;
  --muted: #848484;
  --line: #dbdedb;
  --primary: #707f75;
  --primary-dark: #4d5a52;
  --primary-2: #e8ede9;
  --warning-bg: #f4f4f2;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Proxima Nova", "Proxima Sera", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #000000;
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.auth-card img {
  width: min(100%, 360px);
  height: auto;
  justify-self: center;
}

.auth-card h1 {
  margin: 2px 0 0;
  font-size: 2rem;
  line-height: 1.1;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 780;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
}

.auth-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell-hidden {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: #000000;
  color: #ffffff;
}

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

.brand img {
  display: block;
  width: min(100%, 238px);
  height: auto;
}

.topbar h2,
.section-header h3,
.panel h3,
.dialog-heading h3 {
  margin: 0;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: rgba(248, 251, 248, 0.74);
  text-align: left;
}

.nav-parent {
  position: relative;
  font-weight: 850;
}

.nav-parent::after {
  content: "▾";
  position: absolute;
  right: 14px;
  transition: transform 0.16s ease;
}

.nav-group:not(.open) .nav-parent::after {
  transform: rotate(-90deg);
}

.nav-sublist {
  display: none;
  gap: 4px;
  padding-left: 12px;
}

.nav-group.open .nav-sublist {
  display: grid;
}

.nav-subitem {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(112, 127, 117, 0.35);
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  font-size: 2rem;
  line-height: 1.15;
}

.topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.account-actions {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.settings-menu {
  position: relative;
}

.settings-button {
  font-size: 2rem;
  line-height: 1;
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: none;
  min-width: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

.settings-dropdown.open {
  display: grid;
}

.settings-dropdown button {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.settings-dropdown button:last-child {
  border-bottom: 0;
}

.settings-dropdown button:hover {
  background: var(--surface-2);
}

.topbar-actions.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search input {
  width: min(34vw, 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
  text-transform: none;
}

.primary-button,
.secondary-button,
.link-button,
.icon-button {
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
}

.icon-button {
  width: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.view-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.year-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  padding: 7px 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#teamView,
#onboardingView,
#rotationsView,
#longRangeView {
  font-size: 90%;
}

#shepherdDetailView {
  font-size: 80%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-metric-group {
  margin-bottom: 0;
}

.metric-grid-inner {
  display: contents;
}

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

.metric {
  padding: 18px;
}

.clickable-metric {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.clickable-metric:hover,
.clickable-metric:focus-within {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 850;
}

.metric p,
.eyebrow {
  margin: 0;
  color: var(--muted);
}

.metric small {
  display: block;
  margin-top: 2px;
  font-size: 0.78em;
  font-weight: 650;
}

.dashboard-block-section {
  margin-top: 26px;
}

.first-dashboard-section {
  margin-top: 0;
}

.dashboard-section-heading {
  margin-bottom: 12px;
}

.dashboard-section-heading h3 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.eyebrow {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.dashboard-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 18px;
}

.panel-heading,
.section-header,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-header {
  margin-bottom: 16px;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.summary-row,
.gap-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.summary-row strong,
.gap-row strong {
  font-size: 0.95rem;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-2);
  color: #000000;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag.primary {
  background: var(--primary-2);
  color: var(--primary);
}

.tag.warning {
  background: var(--warning-bg);
  color: #000000;
  outline: 1px solid var(--primary);
}

.tag.accent {
  background: #eeeeee;
  color: var(--muted);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-row select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.filter-button.active {
  border-color: var(--primary);
  background: var(--primary-2);
  color: var(--primary);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shepherd-table {
  min-width: 540px;
}

.shepherd-table th,
.shepherd-table td {
  padding: 9px 14px;
}

.shepherd-table th {
  vertical-align: middle;
}

.shepherd-table td {
  vertical-align: middle;
}

.shepherd-table tr.meeting-complete-row td {
  background: #e7f3ea;
}

.shepherd-page-actions {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 4;
}

.header-reset-button {
  display: block;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 850;
  text-transform: uppercase;
}

.header-reset-button:hover {
  text-decoration: underline;
}

.reset-row-button {
  min-height: 32px;
}

.meeting-date-input {
  width: 100%;
  max-width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.team-table td {
  vertical-align: middle;
}

th {
  background: #b2b2b2;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.roster-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #b2b2b2;
  color: #ffffff;
}

.roster-table th:first-child,
.roster-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.roster-table td:first-child {
  background: var(--surface);
}

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

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

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

.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: #000000;
}

.instrument-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  background: var(--primary-2);
  color: #000000;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.instrument-pill.vocals-female {
  background: #eee7ff;
  color: #7f57d9;
}

.instrument-pill.vocals-male {
  background: #ffe7e7;
  color: #f04a45;
}

.instrument-pill.guitar-acoustic {
  background: #e6f8fb;
  color: #16a9c5;
}

.instrument-pill.guitar-electric {
  background: #e5f6e9;
  color: #28a85a;
}

.instrument-pill.keys {
  background: #fff2df;
  color: #d9892b;
}

.instrument-pill.bass {
  background: #ffeadf;
  color: #f06d31;
}

.instrument-pill.drums {
  background: #e9e8ff;
  color: #5847d8;
}

.instrument-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 290px;
}

.ministry-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 330px;
}

.team-table td:nth-child(2) {
  min-width: 230px;
}

.team-table td:nth-child(4) {
  min-width: 260px;
}

.ministry-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  color: #000000;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.ministry-sunday {
  background: #e6f0ff;
  color: #2563eb;
}

.ministry-women {
  background: #eee7ff;
  color: #7f57d9;
}

.ministry-college {
  background: #fff2df;
  color: #d9892b;
}

.ministry-fsm {
  background: #e5f6e9;
  color: #28a85a;
}

.ministry-kids {
  background: #ffe7e7;
  color: #f04a45;
}

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

.shepherd-label {
  font-size: 0.72rem;
}

.coverage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e5e5e5;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.small-note {
  color: var(--muted);
  font-weight: 700;
}

.placeholder-panel {
  display: grid;
  gap: 8px;
  max-width: 760px;
  padding: 22px;
}

.placeholder-panel h3 {
  max-width: 620px;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.45;
}

.onboarding-actions {
  margin-bottom: 14px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.kanban-column-header h4 {
  margin: 0;
  font-size: 0.92rem;
}

.kanban-column-header span {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-2);
  color: var(--primary-dark);
  font-weight: 850;
}

.kanban-card-list {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  padding: 12px;
}

.kanban-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  cursor: grab;
}

.kanban-card:hover {
  border-color: var(--primary);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.attachment-list {
  display: grid;
  gap: 6px;
}

.attachment-list a {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 20px;
}

.kanban-empty {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.rotation-blocks {
  display: grid;
  gap: 26px;
}

.rotation-block {
  overflow: hidden;
  border: 3px solid #000000;
  background: var(--surface);
}

.rotation-title {
  border-bottom: 1px solid #000000;
  padding: 8px 12px;
  background: #adadad;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.rotation-table-wrap {
  overflow-x: auto;
}

.rotation-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.rotation-table th,
.rotation-table td {
  border: 1px solid #000000;
  padding: 5px 8px;
  text-align: center;
  vertical-align: middle;
}

.rotation-table tbody tr:last-child td {
  border-bottom: 1px solid #000000;
}

.rotation-table th {
  background: #b7b7b7;
  color: #ffffff;
  font-weight: 850;
}

.rotation-table th:first-child,
.rotation-table td:first-child {
  width: 162px;
  text-align: left;
}

.rotation-table th:nth-last-child(2),
.rotation-table td:nth-last-child(2) {
  border-left-width: 3px;
}

.rotation-table tbody tr:nth-child(even) td:not(:first-child) {
  background: #f4f4f4;
}

.rotation-position-editor {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rotation-position-pill,
.rotation-name-pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.15;
}

.rotation-position-pill {
  flex: 1;
  min-width: 100px;
  cursor: pointer;
  gap: 4px;
}

.rotation-position-input {
  min-width: 4ch;
  max-width: 14ch;
  border: 0;
  background: transparent;
  color: #000000;
  font-weight: 850;
  text-transform: uppercase;
  font: inherit;
  outline: 0;
  cursor: text;
}

.rotation-header-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
  outline: 0;
}

.rotation-header-input:focus {
  box-shadow: inset 0 -1px 0 #ffffff;
}

.rotation-delete-row {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.rotation-delete-row::before {
  content: "×";
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  transform: translateY(-0.5px);
}

.rotation-delete-row:hover {
  background: #ffe0e0;
  color: #b93232;
}

.rotation-position-input:focus {
  box-shadow: inset 0 -1px 0 currentColor;
}

.rotation-color-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 10px;
  z-index: 20;
  display: none;
  width: 120px;
  gap: 4px;
  padding: 6px;
  border: 1px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.rotation-color-menu.open {
  display: grid;
}

.rotation-color-choice {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  color: #000000;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 850;
  text-align: left;
}

.rotation-color-affordance {
  flex: 1;
  min-width: 14px;
  align-self: stretch;
}

.rotation-position-pill:hover .rotation-color-affordance::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 7px 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
}

.rotation-assignment-cell {
  position: relative;
  display: flex;
  min-height: 21px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
  cursor: text;
}

.rotation-assignment-pills {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
}

.rotation-name-pill {
  gap: 4px;
  background: #eef4f0;
  color: #273129;
}

.rotation-name-pill button {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.rotation-name-pill button::before {
  content: "×";
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  transform: translateY(-0.5px);
}

.rotation-assignment-input {
  width: 96px;
  min-width: 64px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  text-align: center;
  outline: 0;
}

.rotation-assignment-cell.has-assignments .rotation-assignment-input {
  display: none;
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
}

.rotation-assignment-cell.has-assignments.is-adding .rotation-assignment-input,
.rotation-assignment-cell.has-assignments:focus-within .rotation-assignment-input {
  display: inline-block;
  width: 96px;
  min-width: 64px;
  opacity: 1;
}

.rotation-assignment-input:focus {
  border-bottom-color: var(--ink);
}

.rotation-suggestion-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 25;
  display: none;
  width: 150px;
  max-height: 160px;
  overflow-y: auto;
  transform: translateX(-50%);
  border: 1px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.rotation-suggestion-list.open {
  display: grid;
}

.rotation-suggestion-list button {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 7px 9px;
  text-align: left;
}

.rotation-suggestion-list button span {
  display: block;
  color: #b93232;
  font-size: 0.62rem;
  font-weight: 850;
  margin-top: 2px;
}

.rotation-suggestion-list button.rotation-conflict-suggestion {
  background: #fff1f1;
}

.rotation-suggestion-list button:hover {
  background: #eef4f0;
}

.rotation-suggestion-list button.rotation-conflict-suggestion:hover {
  background: #ffe4e4;
}

.rotation-add-row {
  margin: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 12px;
}

.rotation-add-row:hover {
  background: #eef4f0;
}

.long-range-layout {
  display: flex;
  gap: 0;
  align-items: start;
  overflow-x: auto;
  border: 3px solid #000000;
  background: #ffffff;
}

.long-range-table-wrap {
  flex: 0 0 auto;
  overflow: visible;
}

.long-range-table {
  width: 1442px;
  min-width: 1442px;
  border-collapse: collapse;
  table-layout: fixed;
}

.long-range-month-col {
  width: 30px;
}

.long-range-day-col {
  width: 42px;
}

.long-range-season-col,
.long-range-worship-col {
  width: 156px;
}

.long-range-teacher-col {
  width: 176px;
}

.long-range-class9-col,
.long-range-class1045-col {
  width: 96px;
}

.long-range-series-col {
  width: 150px;
}

.long-range-text-col {
  width: 120px;
}

.long-range-theme-col {
  width: 170px;
}

.long-range-notes-col {
  width: 250px;
}

.long-range-table th,
.long-range-table td {
  border: 1px solid #8f8f8f;
  padding: 4px 5px;
  vertical-align: middle;
}

.long-range-table th {
  background: #d8d3c8;
  color: #000000;
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.long-range-table tbody tr:nth-child(even) td:not(.long-range-month) {
  background: #f7f7f3;
}

.long-range-table tbody tr:nth-child(even) td.long-range-day {
  background: #f7f7f3;
}

.long-range-month-head {
  position: sticky;
  left: 0;
  z-index: 8;
  width: 30px;
  outline: 1px solid #8f8f8f;
  outline-offset: -1px;
}

.long-range-month {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 30px;
  background: #f2f2ed;
  color: #1b1b1b;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  outline: 1px solid #8f8f8f;
  outline-offset: -1px;
}

.long-range-day {
  position: sticky;
  left: 30px;
  z-index: 5;
  width: 42px;
  background: #ffffff;
  outline: 1px solid #8f8f8f;
  outline-offset: -1px;
  text-align: center;
}

th.long-range-day {
  z-index: 8;
  background: #d8d3c8;
  outline: 1px solid #8f8f8f;
  outline-offset: -1px;
}

.long-range-season,
.long-range-worship {
  width: 156px;
}

.long-range-teacher {
  width: 176px;
}

.long-range-class9,
.long-range-class1045 {
  width: 96px;
}

.long-range-series {
  width: 150px;
}

.long-range-text {
  width: 120px;
}

.long-range-theme {
  width: 170px;
}

.long-range-notes {
  width: 250px;
}

.long-range-input,
.long-range-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: #000000;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 750;
  outline: 0;
}

.long-range-input {
  display: block;
  min-height: 24px;
  resize: none;
  line-height: 1.25;
  align-content: center;
  overflow: hidden;
}

.long-range-day .long-range-input {
  min-height: 20px;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.long-range-classroom-group {
  border-bottom: 1px solid #8f8f8f;
}

.long-range-select {
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 18px 2px 8px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.long-range-input:focus,
.long-range-select:focus {
  box-shadow: inset 0 -1px 0 #000000;
}

.long-range-summary {
  flex: 0 0 210px;
  min-height: 100%;
  border-left: 3px solid #8f8f8f;
  background: #efefea;
}

.long-range-count-section h4 {
  margin: 0;
  border-bottom: 1px solid #8f8f8f;
  padding: 10px 8px;
  background: #d8d3c8;
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.long-range-count-list {
  display: grid;
}

.long-range-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid #d1d1cb;
  padding: 5px 6px;
}

.long-range-count-row strong {
  font-size: 0.7rem;
  text-align: right;
}

.long-range-options-panel {
  border-top: 1px solid #8f8f8f;
  border-bottom: 3px solid #8f8f8f;
}

.long-range-options-panel h4 {
  margin: 0;
  border-bottom: 1px solid #8f8f8f;
  padding: 10px 8px;
  background: #d8d3c8;
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.long-range-option-group {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.long-range-option-group h5 {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.long-range-option-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.long-range-option-add input,
.long-range-option-row select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 750;
  padding: 5px;
}

.long-range-option-add button {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 850;
  padding: 5px 8px;
}

.long-range-option-list {
  display: grid;
  gap: 5px;
}

.long-range-option-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  gap: 5px;
  align-items: center;
}

.long-range-leader-pill {
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 850;
  padding: 4px 7px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.long-range-delete-option {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  color: var(--ink);
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.long-range-delete-option::before {
  content: "×";
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  transform: translateY(-0.5px);
}

.long-range-delete-option:hover {
  background: #ffe0e0;
  color: #b93232;
}

.long-range-option-color-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  display: none;
  width: 124px;
  gap: 4px;
  padding: 6px;
  border: 1px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.long-range-option-color-menu.open {
  display: grid;
}

.long-range-count-pill {
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.62rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lr-pill-muted {
  background: #ececec;
  color: #777777;
}

.lr-pill-0,
.lr-color-red {
  background: #ffe0e0;
  color: #f03942;
}

.lr-pill-1,
.lr-color-green {
  background: #cbf4dc;
  color: #035f35;
}

.lr-pill-2,
.lr-color-teal {
  background: #d9f6fb;
  color: #08718b;
}

.lr-pill-3,
.lr-color-purple {
  background: #eadcff;
  color: #6a46d8;
}

.lr-pill-4,
.lr-color-orange {
  background: #ffe4cf;
  color: #a24a00;
}

.lr-pill-5,
.lr-color-yellow {
  background: #fff1bf;
  color: #7d5b00;
}

.lr-pill-6,
.lr-color-pink {
  background: #ffe0f2;
  color: #a91472;
}

.lr-pill-7,
.lr-color-lime {
  background: #ddffae;
  color: #3f7200;
}

.lr-color-mulberry {
  background: #ffe0f2;
  color: #a91472;
}

.lr-color-gray {
  background: #e9eceb;
  color: #60716a;
}

.rotation-pill-green {
  background: #cbf4dc;
  color: #035f35;
}

.rotation-pill-teal {
  background: #d9f6fb;
  color: #08718b;
}

.rotation-pill-orange {
  background: #ffe4cf;
  color: #a24a00;
}

.rotation-pill-purple {
  background: #eadcff;
  color: #6a46d8;
}

.rotation-pill-red {
  background: #ffe0e0;
  color: #f03942;
}

.rotation-pill-yellow {
  background: #fff1bf;
  color: #7d5b00;
}

.rotation-pill-pink {
  background: #ffe0f2;
  color: #a91472;
}

.rotation-pill-lime {
  background: #ddffae;
  color: #3f7200;
}

.service-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.service-card-header {
  display: grid;
  grid-template-columns: minmax(130px, 0.2fr) minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.date-block {
  border-radius: 8px;
  padding: 12px;
  background: var(--primary-2);
  color: var(--primary);
  font-weight: 850;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  padding: 16px;
}

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

.assignment label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.assignment select,
.dialog-form input,
.dialog-form select,
.dialog-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--surface);
  color: var(--ink);
}

dialog {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(23, 32, 28, 0.28);
}

dialog::backdrop {
  background: rgba(23, 32, 28, 0.42);
}

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

.dialog-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 780;
}

.multi-select {
  position: relative;
}

.multi-select-button {
  width: 100%;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 34px 10px 11px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-button::after {
  content: "▾";
  position: absolute;
  right: 12px;
  color: var(--muted);
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: none;
  width: 100%;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.multi-select.open .multi-select-menu {
  display: grid;
}

.multi-select-option {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
  border-radius: 6px;
  padding: 6px 7px;
  color: var(--ink) !important;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760 !important;
}

.multi-select-option:hover {
  background: var(--surface-2);
}

.multi-select-option input {
  width: 16px;
  height: 16px;
  accent-color: #000000;
}

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

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

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

.danger-button {
  margin-right: auto;
  color: #a33a35;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 16px;
  }

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

  .nav-sublist {
    padding-left: 0;
  }

  .topbar,
  .topbar-actions,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .search input {
    width: 100%;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .kanban-board {
    grid-template-columns: repeat(5, minmax(210px, 1fr));
  }
}

@media (max-width: 680px) {
  .main {
    padding: 18px;
  }

  .nav-list,
  .metric-grid,
  .dashboard-grid,
  .assignment-grid,
  .service-card-header,
  .two-col,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .month-picker {
    align-items: stretch;
    flex-direction: column;
  }
}
