:root {
  --ink: #1e2634;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --page: #f4f6f9;
  --navy: #243b6b;
  --navy-dark: #172948;
  --gold: #b8913f;
  --success: #16784c;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 18px;
}

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

button.secondary {
  background: #eef1f6;
  color: var(--ink);
}

button.secondary:hover {
  background: #dfe5ee;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #8f1d14;
}

label,
legend {
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  margin-top: 6px;
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 430px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(30, 38, 52, 0.12);
  padding: 32px;
  text-align: center;
}

.login-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 12px;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.login-panel h1 {
  font-size: 1.7rem;
  margin-bottom: 24px;
}

.stack {
  display: grid;
  gap: 14px;
  text-align: left;
}

.error {
  color: var(--danger);
  min-height: 22px;
  margin: 0;
  text-align: center;
}

.help-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0;
  text-align: center;
}

.setup-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 16px;
}

.setup-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0;
  text-align: center;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.brand img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.brand h1 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  margin: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tabs button {
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  min-width: 130px;
}

.tabs button.active {
  border-bottom: 3px solid var(--gold);
  color: var(--ink);
}

.report-form,
.view {
  display: grid;
  gap: 16px;
}

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

.menu-option {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 8px;
  min-height: 135px;
  padding: 20px;
  text-align: left;
}

.menu-option:hover {
  background: #f8fafc;
  border-color: var(--gold);
  color: var(--ink);
}

.menu-option span {
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
}

.menu-option small {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.panel h2 {
  font-size: 1.08rem;
  margin-bottom: 16px;
}

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

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

.report-info-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.meeting-notes-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(0, 1fr));
}

.meeting-notes-grid > label:first-child {
  max-width: 260px;
}

.meeting-notes-grid > label:nth-child(2) {
  max-width: 320px;
}

.attendee-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.attendee-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.attendee-row {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  padding: 12px;
}

.check-row,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-bottom: 14px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-row legend,
.check-grid legend {
  width: 100%;
}

.required-note {
  color: var(--danger);
  font-size: 0.78rem;
  margin-left: 6px;
}

.check-row label,
.check-grid label {
  align-items: center;
  display: flex;
  font-weight: 600;
}

.notice {
  border-left: 4px solid var(--gold);
  background: #fff8e6;
  color: #574016;
  margin: 16px 0;
  padding: 12px 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.status {
  color: var(--success);
  font-weight: 700;
  min-height: 22px;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.monthly-controls {
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) auto auto;
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.report-card summary {
  cursor: pointer;
  list-style: none;
}

.report-card summary::-webkit-details-marker {
  display: none;
}

.print-select {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  margin-bottom: 12px;
  padding: 8px 10px;
}

.report-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.report-top h3 {
  margin: 0 0 4px;
}

.report-preview {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
}

.report-preview strong {
  color: #344054;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  background: #eef1f6;
  border-radius: 999px;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 9px;
}

.linked-pill {
  background: #fff4d6;
  color: #7a4b00;
}

.original-pill {
  background: #e7f7ef;
  color: #11633f;
}

.group-pill {
  background: #e8edff;
  color: #2947a9;
}

.removed-pill {
  background: #fee4e2;
  color: #912018;
}

.details-grid {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
}

.card-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading.compact {
  align-items: end;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading h3 {
  margin: 0 0 4px;
}

.help-text.left {
  text-align: left;
}

.inline-check {
  align-items: center;
  display: flex;
  font-weight: 700;
}

.related-panel {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.related-report-options {
  display: grid;
  gap: 8px;
}

.related-report-option {
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.related-report-option small,
.related-report-line span {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.related-report-line + .related-report-line {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.related-report-line strong {
  display: block;
}

.attachment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.attachment-row {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  padding: 12px;
}

.attachment-row img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
}

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

.attachment-summary figure {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.attachment-summary img {
  display: block;
  max-height: 320px;
  object-fit: contain;
  width: 100%;
}

.attachment-summary figcaption {
  background: #f8fafc;
  color: #344054;
  font-weight: 700;
  padding: 8px 10px;
}

.admin-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px;
}

.admin-menu button {
  background: #eef1f6;
  color: var(--ink);
}

.admin-menu button.active {
  background: var(--navy);
  color: #fff;
}

.admin-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.admin-row,
.audit-row {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.admin-row {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.4fr);
}

.admin-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.admin-profile-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

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

.profile-form h3,
.profile-form .form-actions {
  grid-column: 1 / -1;
}

.bargaining-unit-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bargaining-unit-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  padding: 12px;
}

.audit-row {
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 0.9fr) minmax(0, 2fr);
}

.muted {
  color: var(--muted);
  margin-top: 4px;
}

.no-top-border {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-list span {
  background: #eef1f6;
  border-radius: 6px;
  padding: 6px 9px;
}

.monthly-report h3 {
  margin-bottom: 10px;
  margin-top: 18px;
}

.monthly-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.monthly-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  padding: 10px 12px;
}

.monthly-row + .monthly-row {
  border-top: 1px solid var(--line);
}

.monthly-head {
  background: #eef1f6;
  font-weight: 800;
}

.detail-label {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.full {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .app-header,
  .brand,
  .form-actions,
  .card-actions,
  .report-top {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header {
    display: grid;
  }

  .brand {
    display: grid;
    justify-items: start;
  }

  .grid.two,
  .report-info-grid,
  .meeting-notes-grid,
  .attendee-grid,
  .attendee-row,
  .check-grid,
  .search-bar,
  .section-heading.compact,
  .attachment-row,
  .attachment-summary,
  .admin-menu,
  .menu-grid,
  .monthly-controls,
  .monthly-row,
  .admin-row,
  .admin-actions,
  .admin-profile-grid,
  .profile-form,
  .bargaining-unit-card,
  .audit-row,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3,
  .meeting-notes-grid > label:first-child,
  .meeting-notes-grid > label:nth-child(2) {
    grid-column: auto;
    max-width: none;
  }

  .login-panel {
    padding: 24px;
  }

  .panel {
    padding: 14px;
  }
}
