:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --surface-strong: #e8edf2;
  --text: #18212d;
  --muted: #647184;
  --line: #d7dee6;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #dff3ef;
  --ink: #263238;
  --danger: #b42318;
  --focus: #2563eb;
  --shadow: 0 12px 28px rgba(24, 33, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(14px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand,
.top-actions,
.week-band,
.actions,
.section-heading,
.car-main,
.item-actions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  flex: 0 0 44px;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.top-actions {
  gap: 10px;
}

.status-pill,
.board-count {
  min-width: 76px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.status-pill.error {
  border-color: #f5c2bd;
  color: var(--danger);
  background: #fff6f5;
}

.status-pill.ok {
  border-color: #9fd6cf;
  color: var(--accent-strong);
  background: #f3fbf9;
}

.shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 28px) 36px;
}

.week-band {
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.week-field {
  display: grid;
  flex: 1;
  min-width: 160px;
  gap: 4px;
}

.week-field span,
.metric span,
label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

textarea {
  margin-top: 6px;
  resize: vertical;
  line-height: 1.4;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  min-width: 42px;
  place-items: center;
  background: var(--surface-strong);
  color: var(--text);
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

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

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

.ghost-button {
  background: var(--surface-strong);
  color: var(--text);
}

.compact {
  min-height: 42px;
  padding: 0 12px;
}

.summary-band {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: 10px;
  margin: 14px 0;
}

.metric {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #c9dfdb;
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 12px 14px;
}

.metric strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.1;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.day-shortcut {
  min-height: 54px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.day-shortcut strong,
.day-shortcut span {
  display: block;
}

.day-shortcut strong {
  font-size: 0.86rem;
}

.day-shortcut span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.day-shortcut.active {
  border-color: var(--accent);
  background: #f2fbf9;
  color: var(--accent-strong);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.entry-panel {
  position: sticky;
  top: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

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

label {
  display: grid;
  gap: 6px;
}

.actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.board-panel {
  min-width: 0;
}

.days-grid {
  display: grid;
  gap: 10px;
}

.day-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.day-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.day-title {
  min-width: 0;
}

.day-title h3 {
  margin: 0;
  font-size: 0.98rem;
}

.day-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.count {
  min-width: 36px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 5px 9px;
  text-align: center;
  font-weight: 800;
}

.car-list {
  display: grid;
}

.car-row {
  padding: 12px 14px;
}

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

.car-main {
  justify-content: space-between;
  gap: 10px;
}

.plate {
  font-size: 1rem;
  font-weight: 800;
}

.car-meta,
.car-notes {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.car-notes {
  color: #354152;
}

.item-actions {
  gap: 6px;
}

.item-actions .icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
}

.delete-button {
  color: var(--danger);
}

.empty {
  margin: 0;
  padding: 18px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: space-between;
  }

  .summary-band {
    grid-template-columns: 1fr 1fr;
  }

  .summary-band .metric:first-child {
    grid-column: 1 / -1;
  }

  .day-strip {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .day-shortcut {
    min-width: 116px;
    scroll-snap-align: start;
  }

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

  .entry-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 1.22rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .top-actions,
  .week-band,
  .actions {
    align-items: stretch;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .week-band {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
  }

  .week-band .compact {
    grid-column: 1 / -1;
  }

  .summary-band {
    grid-template-columns: 1fr;
  }

  .summary-band .metric:first-child {
    grid-column: auto;
  }

  .actions {
    flex-direction: column;
  }

  .car-main {
    align-items: flex-start;
  }
}
