:root {
  font: 15px system-ui;
  color: #19314c;
  background: #f4f7fb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #d6e1ee;
  border-radius: 7px;
  background: white;
  padding: 9px 14px;
  color: #19314c;
}
button.primary {
  background: #0864f7;
  border-color: #0864f7;
  color: white;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #cedbea;
  border-radius: 6px;
  background: white;
  color: inherit;
}
textarea {
  min-height: 90px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
header {
  height: 64px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 15px;
}
header strong {
  font-size: 20px;
}
header select {
  width: auto;
}
nav {
  width: 200px;
  background: white;
  border-right: 1px solid #e2e8f0;
  padding: 20px 12px;
  position: absolute;
  top: 64px;
  bottom: 0;
}
nav button {
  width: 100%;
  text-align: left;
  margin: 3px 0;
  border: 0;
}
nav button.active {
  background: #e9f2ff;
  color: #0864f7;
}
main {
  margin-left: 200px;
  padding: 28px;
  max-width: 1500px;
}
h1 {
  margin-top: 0;
}
.heading,
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.panel {
  background: white;
  border: 1px solid #e0e7f0;
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}
.muted,
small {
  color: #6b7f95;
}
small {
  display: block;
  margin-top: 4px;
}
.notice {
  padding: 12px;
  background: #edf4ff;
  border-radius: 6px;
  margin: 12px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid #edf1f6;
  padding: 12px 8px;
}
th {
  font-size: 12px;
  color: #6b7f95;
}
td button {
  padding: 6px 9px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.chip {
  display: inline-block;
  padding: 4px 8px;
  background: #edf2f8;
  border-radius: 5px;
  font-size: 12px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cards button {
  padding: 20px;
  text-align: left;
}
.cards b {
  display: block;
}
dialog {
  border: 1px solid #dae4f1;
  border-radius: 12px;
  width: min(680px, 94vw);
  padding: 24px;
  color: inherit;
}
dialog::backdrop {
  background: #132f4b55;
}
dialog form {
  display: grid;
  gap: 15px;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 10px;
}
.error {
  color: #b02736;
}
.login {
  max-width: 420px;
  margin: 15vh auto;
}
.login form {
  display: grid;
  gap: 15px;
}
.planning main {
  margin: 0;
  max-width: none;
  padding: 16px;
}
.planning nav {
  display: none;
}
.planning-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 15px;
}
.map-placeholder {
  min-height: 340px;
  background: linear-gradient(120deg, #e9eef0, #f7fafc);
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid #dce5ee;
}
.queue .job {
  text-align: left;
  width: 100%;
  margin: 7px 0;
  border-left: 4px solid #0864f7;
}
.timeline {
  overflow: auto;
}
.timeline table {
  min-width: 900px;
}
.slot {
  border: 1px solid #93b9ec;
  background: #eaf2ff;
  margin: 4px;
  padding: 8px;
  border-radius: 5px;
}
.slot.awaiting_customer {
  border-style: dashed;
  background: #fff7e7;
}
.slot.confirmed {
  background: #e8f6ed;
  border-color: #94caa7;
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
#status {
  position: fixed;
  bottom: 16px;
  right: 16px;
  max-width: 450px;
  background: #153453;
  color: white;
  border-radius: 8px;
  padding: 0;
}
#status:not(:empty) {
  padding: 14px;
}
.full {
  grid-column: 1/-1;
}
@media (max-width: 950px) {
  .planning-layout,
  .grid {
    grid-template-columns: 1fr;
  }
  nav {
    width: 160px;
  }
  main {
    margin-left: 160px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}
.calendar-scroll {
  overflow: auto;
}
.calendar-header,
.calendar-person {
  display: grid;
  grid-template-columns: 180px minmax(880px, 1fr);
  min-width: 1060px;
}
.calendar-header {
  height: 36px;
}
.calendar-header > div {
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  font-size: 11px;
}
.calendar-person {
  min-height: 70px;
  border-top: 1px solid #e1e8f0;
}
.calendar-person > strong {
  padding: 15px 8px;
}
.calendar-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  min-height: 70px;
}
.calendar-cell {
  border-left: 1px solid #e4eaf2;
  min-height: 70px;
}
.calendar-cell:hover {
  background: #eff6ff;
}
.calendar-event,
.calendar-ghost {
  position: absolute;
  top: 8px;
  height: 46px;
  font-size: 12px;
  padding: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  border-radius: 5px;
  border: 1px solid #8bb1e6;
  background: #e7f0ff;
}
.calendar-event.awaiting_customer {
  background: #fff4dd;
  border: 1px dashed #c48c29;
}
.calendar-event.confirmed {
  background: #e7f6ed;
  border-color: #62a37c;
}
.calendar-ghost {
  background: #dceeffcc;
  border: 2px dashed #277be9;
  pointer-events: none;
  z-index: 4;
}
.calendar-ghost.conflict {
  background: #fff0f0cc;
  border-color: #c93442;
}
.planning-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.planning-controls input[type="date"] {
  width: auto;
}
.crew-option {
  display: flex;
  align-items: center;
  gap: 6px;
}
.crew-option input {
  width: auto;
}
.timeline {
  resize: vertical;
  min-height: 190px;
  max-height: 600px;
  overflow: auto;
}
