:root {
  --bg: #f7f2e9;
  --bg-accent: #efe3cf;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffaf3;
  --line: rgba(110, 76, 32, 0.18);
  --text: #21180e;
  --muted: #695948;
  --brand: #c7562d;
  --brand-deep: #7b2d12;
  --brand-soft: rgba(199, 86, 45, 0.12);
  --ok: #2f7d4b;
  --warn: #9b6b15;
  --shadow: 0 24px 70px rgba(82, 51, 17, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(199, 86, 45, 0.16), transparent 30%),
    linear-gradient(160deg, #f3eadc 0%, #f9f5ee 48%, #efe1cb 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(128, 96, 47, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 96, 47, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 52%, transparent 95%);
}

.page-shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  position: relative;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar__identity,
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__identity p {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand-mark--small {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 0.95rem;
}

.hero,
.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.hero__brand {
  display: flex;
  gap: 18px;
  align-items: center;
}

.brand-mark {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: linear-gradient(150deg, var(--brand-deep), var(--brand));
  color: #fff6ed;
  display: grid;
  place-items: center;
  font-family: "Trebuchet MS", "Avenir Next Condensed", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hero h1,
.list-page h1,
.detail-page h1 {
  font-family: "Trebuchet MS", "Avenir Next Condensed", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0;
}

.hero__text,
.section-heading p,
.declaration-copy,
.empty-state p,
.hero__meta p {
  color: var(--muted);
}

.hero__meta {
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 247, 238, 0.92);
  border: 1px solid var(--line);
  min-width: 280px;
}

.hero__meta p {
  margin: 0 0 6px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel__header,
.section-heading--spread,
.header-actions,
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

h2,
h3 {
  margin: 0;
  font-family: "Trebuchet MS", "Avenir Next Condensed", sans-serif;
}

.card-section {
  margin-top: 24px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.9);
  border: 1px solid var(--line);
}

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

.section-heading p {
  margin: 6px 0 0;
}

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

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

.break-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.break-card h4 {
  margin: 0;
  font-family: "Trebuchet MS", "Avenir Next Condensed", sans-serif;
  font-size: 1rem;
}

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

.break-card input {
  max-width: 180px;
  padding: 9px 12px;
  min-height: 42px;
}

.activity-sheet-table {
  min-width: 720px;
}

.activity-sheet-table th,
.activity-sheet-table td {
  padding: 8px;
}

.activity-sheet-table thead th:first-child,
.activity-sheet-table tbody th {
  width: 92px;
}

.activity-sheet-table input {
  min-width: 0;
}

.activity-row--pickup th,
.activity-row--pickup td {
  border-bottom: none;
}

.form-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

label,
.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(121, 85, 45, 0.18);
  background: white;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(199, 86, 45, 0.7);
  box-shadow: 0 0 0 4px rgba(199, 86, 45, 0.14);
  transform: translateY(-1px);
}

.button,
.button--secondary,
.button--ghost,
.text-link,
.icon-button {
  cursor: pointer;
}

.button,
.button--secondary,
.button--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.button {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff8f1;
  box-shadow: 0 14px 28px rgba(123, 45, 18, 0.18);
}

.button--secondary {
  background: #fff3ea;
  color: var(--brand-deep);
  border-color: rgba(199, 86, 45, 0.18);
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

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

th,
td {
  border-bottom: 1px solid rgba(121, 85, 45, 0.12);
  padding: 10px;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.82);
}

th {
  position: sticky;
  top: 0;
  background: #f4e4d5;
  text-align: left;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

td input {
  min-width: 92px;
  padding: 10px 12px;
}

.section-spacing-top {
  margin-top: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(123, 45, 18, 0.18);
  background: #fff4ee;
  color: var(--brand-deep);
  font-size: 1.3rem;
  line-height: 1;
}

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

.check-item,
.status-pill {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.check-item {
  flex-direction: row;
  align-items: center;
  font-weight: 500;
}

.check-item input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.label--wide {
  min-width: 0;
}

.declaration-copy {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-accent);
}

.recent-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.recent-card {
  text-decoration: none;
  color: inherit;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.recent-card p,
.recent-card strong {
  margin: 0;
}

.recent-card span,
.text-link {
  color: var(--brand-deep);
  font-weight: 700;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash-card {
  background: #fff4e6;
  border: 1px solid rgba(199, 86, 45, 0.2);
  color: var(--brand-deep);
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 600;
}

.flash-card--warning {
  background: #fff8e7;
  border-color: rgba(155, 107, 21, 0.28);
  color: #7a5310;
}

.warning-dialog {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.warning-dialog--open {
  display: flex;
}

.warning-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 24, 14, 0.38);
  backdrop-filter: blur(3px);
}

.warning-dialog__panel {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 24px;
  background: #fffaf3;
  border: 1px solid rgba(155, 107, 21, 0.22);
  box-shadow: var(--shadow);
}

.warning-dialog__header,
.warning-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.warning-dialog__header h2 {
  color: #7a5310;
}

.warning-dialog__message {
  margin: 18px 0 20px;
  color: var(--text);
  line-height: 1.5;
}

.warning-dialog__actions {
  justify-content: flex-end;
}

body.warning-dialog-open {
  overflow: hidden;
}

.validation-panel {
  margin-bottom: 18px;
}

.error-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.list-page,
.detail-page {
  padding-top: 8px;
}

.auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(520px, 100%);
}

.auth-panel--wide {
  width: min(980px, 100%);
}

.auth-form,
.profile-grid {
  display: grid;
  gap: 14px;
}

.role-guide {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.login-toggle {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  margin: 18px 0 8px;
  border-radius: 999px;
  background: rgba(255, 243, 234, 0.9);
  border: 1px solid rgba(199, 86, 45, 0.18);
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 700;
}

.toggle-pill--active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff8f1;
}

.login-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.compact-form {
  margin-top: 0;
}

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

.form-actions--left {
  justify-content: flex-start;
}

.sidebar-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 243, 234, 0.88);
  border: 1px solid rgba(199, 86, 45, 0.18);
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
}

.credential-card p {
  margin: 6px 0;
}

.submission-table {
  min-width: 920px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 18px;
}

.metric-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(249, 237, 221, 0.92));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.metric-card strong {
  font-family: "Trebuchet MS", "Avenir Next Condensed", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.detail-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  margin-top: 18px;
}

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

.info-grid dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.info-grid dd {
  margin: 4px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
}

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

.detail-note {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.detail-note p {
  margin: 8px 0 0;
  color: var(--muted);
}

.status-pill {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-pill span {
  display: inline-flex;
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill--complete span {
  background: rgba(47, 125, 75, 0.12);
  color: var(--ok);
}

.status-pill--open span {
  background: rgba(155, 107, 21, 0.14);
  color: var(--warn);
}

.empty-state {
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
}

.empty-state--large {
  text-align: center;
  padding: 42px 24px;
}

@media (max-width: 1120px) {
  .layout,
  .detail-grid,
  .metrics-grid,
  .break-grid,
  .break-times,
  .form-grid--three,
  .form-grid--four,
  .form-grid--two {
    grid-template-columns: 1fr;
  }

  .hero,
  .topbar,
  .panel__header,
  .section-heading--spread,
  .form-actions,
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__meta {
    min-width: 0;
  }

  .checklist-grid,
  .info-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .topbar__actions,
  .topbar__identity {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 14px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .card-section,
  .detail-card {
    padding: 16px;
    border-radius: 18px;
  }

  .brand-mark {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    font-size: 1rem;
  }
}
