:root {
  --bg: #eef2ec;
  --bg-accent: #dfe8dc;
  --ink: #142019;
  --muted: #4d5c54;
  --panel: #f7faf6;
  --line: #c5d0c4;
  --am: #0b6e4f;
  --pm: #b45309;
  --allday: #1d4ed8;
  --accent: #c45c26;
  --primary: #1f3d2a;
  --danger: #9b1c1c;
  --shadow: 0 10px 30px rgba(20, 32, 25, 0.08);
  --radius: 14px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(196, 92, 38, 0.12), transparent 28%),
    linear-gradient(160deg, #e8efe5 0%, var(--bg) 45%, #e4ebe8 100%);
  min-height: 100%;
}

a { color: var(--primary); }

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 246, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #f4f7f2;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong { font-size: 1.05rem; }
.brand-text small { color: var(--muted); font-size: 0.8rem; }

.nav {
  display: flex;
  gap: 1rem;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
}

.nav a:hover { color: var(--ink); }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hero-bar h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.date-switch {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.25rem;
}

.panel-main { min-height: 28rem; }

.panel h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.panel-head h2 { margin: 0; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: inherit;
}

.input:focus {
  outline: 2px solid rgba(31, 61, 42, 0.25);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #f4f7f2;
}

.btn-accent {
  background: var(--accent);
  color: #fff8f3;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}

.btn-danger-link {
  background: transparent;
  color: var(--danger);
  border: none;
  padding: 0.4rem 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.stat-line {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.job-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--allday);
}

.job-card.type-AM { border-left-color: var(--am); }
.job-card.type-PM { border-left-color: var(--pm); }
.job-card.type-ALLDAY { border-left-color: var(--allday); }

.order-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
}

.order-num.muted {
  background: #d7ddd6;
  color: var(--muted);
}

.job-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #e8eefc;
  color: var(--allday);
}

.tag-AM { background: #d9f2e8; color: var(--am); }
.tag-PM { background: #fde8d2; color: var(--pm); }
.tag-ALLDAY { background: #e8eefc; color: var(--allday); }

.meta, .meta-row, .notes {
  color: var(--muted);
  font-size: 0.88rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.notes { margin: 0.35rem 0 0; }

.inline-edit,
.notes-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.inline-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 9rem;
}

.input-compact {
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
}

.input-notes {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
}

.btn-tiny {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-tiny:hover {
  border-color: var(--primary);
}

.warn { color: var(--danger); font-weight: 600; }

.btn-icon {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.btn-icon:hover { color: var(--danger); }

.map {
  margin-top: 1rem;
  height: 340px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #dbe4d8;
}

.empty {
  padding: 1.5rem 0.25rem;
  color: var(--muted);
}

.pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #d9f2e8;
  color: var(--am);
}

.pill-muted {
  background: #e4e8e3;
  color: var(--muted);
}

.banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fff4e8;
  border: 1px solid #f0d2b0;
}

.banner-ok {
  background: #e7f3ec;
  border-color: #b9d8c6;
}

.flash-wrap {
  max-width: 1180px;
  margin: 0.85rem auto 0;
  padding: 0 1.25rem;
  display: grid;
  gap: 0.45rem;
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: #e7f3ec;
  border: 1px solid #b9d8c6;
}

.flash-error, .flash-warning {
  background: #fff4e8;
  border-color: #f0d2b0;
}

.flash-info {
  background: #eef2f8;
  border-color: #c9d4e5;
}

.narrow {
  max-width: 520px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .hero-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-inner { flex-wrap: wrap; }
}
