:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #edf3ec;
  --ink: #1f2a24;
  --muted: #637067;
  --line: #dce4db;
  --brand: #50663d;
  --brand-dark: #35472a;
  --accent: #c68145;
  --danger: #a33a36;
  --danger-soft: #f8e8e6;
  --success: #28644a;
  --success-soft: #e3f3ea;
  --error-soft: #fae7e4;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(31, 42, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

.auth-shell {
  width: min(100%, 460px);
}

.auth-panel,
.entry-panel,
.settings-panel,
.week-summary,
.week-toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 32px;
}

.auth-logo {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 24px;
  border-radius: 50%;
}

.eyebrow,
.section-heading p,
.metric-label,
.brand-lockup p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-panel h1 {
  margin-top: 6px;
  margin-bottom: 24px;
  font-size: 2rem;
}

.stacked-form,
.password-form,
.walk-form,
.edit-form,
.jump-form {
  display: grid;
  gap: 14px;
}

label,
fieldset {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  font-size: 1rem;
}

input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(80, 102, 61, 0.18);
}

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

legend {
  padding: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.staff-fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: end;
}

.staff-fieldset legend {
  grid-column: 1 / -1;
}

.staff-fieldset label {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.staff-fieldset input {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  accent-color: var(--brand);
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

.primary-button:hover,
.primary-button:focus {
  background: var(--brand-dark);
}

.secondary-button,
.nav-button {
  color: var(--brand-dark);
  background: var(--surface-soft);
  border-color: var(--line);
}

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

.danger-button {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc7c2;
  font-size: 0.84rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(245, 247, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-lockup img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 50%;
  flex: 0 0 auto;
}

.brand-lockup h1 {
  margin-top: 2px;
  font-size: 1.4rem;
}

.app-layout {
  width: min(100% - 32px, 1380px);
  margin: 26px auto 48px;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 700;
}

.flash-success {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #b9dfc9;
}

.flash-error {
  color: var(--danger);
  background: var(--error-soft);
  border: 1px solid #efc7c2;
}

.week-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--line);
}

.week-summary div {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
}

.week-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  line-height: 1;
}

.week-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
}

.week-title {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  font-weight: 900;
  text-align: center;
}

.week-title span {
  font-size: 1.2rem;
}

.week-title a {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.jump-form {
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: end;
}

.entry-panel {
  margin-bottom: 18px;
  padding: 20px;
}

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

.section-heading h2 {
  margin-top: 2px;
  font-size: 1.5rem;
}

.walk-form {
  grid-template-columns: 1.05fr 0.75fr 0.65fr 1.15fr 1.2fr 1.4fr auto;
  align-items: end;
}

.notes-field {
  min-width: 180px;
}

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

.day-column {
  min-width: 0;
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.day-column.is-today {
  border-color: var(--accent);
  box-shadow: inset 0 3px 0 var(--accent);
}

.day-column header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.day-column header span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.day-column header strong {
  text-align: right;
}

.empty-day {
  margin: 0;
  padding: 16px 12px;
  color: var(--muted);
  font-weight: 700;
}

.walk-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.walk-item {
  min-width: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.walk-item:last-child {
  border-bottom: 0;
}

.walk-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.walk-main strong,
.walk-main span,
.walk-main em,
.walk-main p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.walk-main strong {
  font-size: 1rem;
}

.walk-main span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.walk-main em {
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 900;
}

.walk-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.edit-details {
  margin-top: 10px;
}

.edit-details summary,
.settings-panel summary {
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.staff-fieldset.compact {
  grid-template-columns: 1fr;
}

.edit-actions {
  display: flex;
  justify-content: flex-start;
}

.walk-item > form {
  margin-top: 8px;
}

.settings-panel {
  margin-top: 18px;
  padding: 18px 20px;
}

.password-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  margin-top: 16px;
}

@media (max-width: 1180px) {
  .week-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .week-title {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .jump-form {
    grid-column: 1 / -1;
  }

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

  .walk-form .primary-button {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .brand-lockup img {
    width: 44px;
    height: 44px;
  }

  .brand-lockup h1 {
    font-size: 1.08rem;
  }

  .ghost-button {
    min-height: 40px;
    padding: 8px 10px;
  }

  .app-layout {
    width: min(100% - 20px, 680px);
    margin-top: 16px;
  }

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

  .week-summary div {
    padding: 16px;
  }

  .week-summary strong {
    font-size: 1.55rem;
  }

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

  .nav-button,
  .jump-form,
  .walk-form,
  .password-form {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day-column {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 12px;
  }

  .auth-panel,
  .entry-panel,
  .settings-panel {
    padding: 18px;
  }

  .auth-panel h1 {
    font-size: 1.55rem;
  }

  .topbar {
    gap: 10px;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-lockup p {
    display: none;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .nav-button {
    width: 100%;
  }
}
