:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --ink: #172321;
  --muted: #60706d;
  --panel: #fffdf8;
  --line: #d9d0c2;
  --accent: #c84b31;
  --accent-dark: #9f3827;
  --green: #183a37;
  --green-soft: #dfe9e2;
  --sky: #d8e8ef;
  --shadow: 0 18px 50px rgba(31, 42, 38, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(24, 58, 55, 0.12), transparent 32rem),
    linear-gradient(315deg, rgba(200, 75, 49, 0.10), transparent 30rem),
    var(--bg);
}

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

button {
  cursor: pointer;
}

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

.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card h1 {
  margin-bottom: 12px;
}

.login-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.login-auth-panel {
  margin-bottom: 0;
}

.login-message {
  margin-bottom: 0;
}

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

.topbar,
.toolbar,
.calendar-panel,
.side-panel,
.notification-strip {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 8px 8px 0 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.status-pill {
  min-width: 112px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  padding: 10px 14px;
  text-align: center;
  font-weight: 800;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.icon-button,
.text-button,
.link-button,
.primary-button,
.secondary-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  background: var(--green);
  color: #fff;
  font-size: 24px;
}

.text-button,
.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--green);
}

.text-button {
  padding: 0 14px;
}

.week-label {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-top: 16px;
}

.calendar-panel,
.side-panel,
.notification-strip {
  border-radius: 8px;
}

.calendar-panel {
  overflow: hidden;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  min-height: 620px;
}

.day-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
}

.day-column:first-child {
  border-left: 0;
}

.day-column.is-selected {
  background: #fffaf0;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.day-header {
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.day-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.day-date {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 900;
}

.slot-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.booking-card {
  border-left: 5px solid var(--accent);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(23, 35, 33, 0.08);
}

.booking-card.maintenance {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.booking-card button {
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.booking-time {
  font-weight: 900;
}

.booking-pilot {
  margin-top: 4px;
  color: var(--green);
  font-weight: 800;
}

.booking-route {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.empty-day {
  margin: auto;
  color: #8a928f;
  font-size: 14px;
}

.side-panel {
  align-self: start;
  padding: 16px;
}

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

.panel-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.booking-form {
  display: grid;
  gap: 12px;
}

.auth-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--green-soft);
  padding: 12px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-state {
  display: grid;
  gap: 2px;
}

.auth-state span {
  color: var(--muted);
  font-size: 14px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.pilot-display {
  display: grid;
  gap: 6px;
}

.pilot-display span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.pilot-display strong {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

textarea {
  resize: vertical;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  padding: 0 14px;
}

.message {
  min-height: 24px;
  margin: 12px 0 18px;
  color: var(--accent-dark);
  font-weight: 800;
}

.upcoming {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.link-button {
  min-height: 34px;
  background: var(--sky);
  color: var(--green);
  padding: 0 12px;
}

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

.upcoming-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.upcoming-item strong {
  display: block;
}

.upcoming-item span {
  color: var(--muted);
  font-size: 13px;
}

.notification-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
}

.notification-strip div {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.notification-strip strong,
.notification-strip span {
  display: block;
}

.notification-strip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

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

  .weekday-grid {
    display: flex;
    min-height: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .day-column {
    flex: 0 0 min(82vw, 360px);
    min-height: 420px;
    scroll-snap-align: start;
  }

  .notification-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-screen {
    align-items: start;
    padding: 16px;
  }

  .login-card {
    padding: 22px;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-pill {
    width: 100%;
  }

  .week-label {
    flex-basis: 100%;
    margin-left: 0;
    padding: 6px 4px 0;
  }

  .toolbar {
    flex-wrap: wrap;
  }
}
