
:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --text: #1c2420;
  --muted: #627069;
  --line: #d9e0dc;
  --accent: #2f7d68;
  --accent-strong: #175846;
  --warning: #b45f23;
  --danger: #a83a3a;
  --blue: #2f6f9f;
  --shadow: 0 8px 24px rgba(20, 42, 32, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 18px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 2px 18px;
}
.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 16px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
input[type="date"], .text-button, .icon-button, .seg {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
}
input[type="date"] { padding: 0 10px; border-radius: 6px; }
button { cursor: pointer; }
.text-button { padding: 0 12px; border-radius: 6px; }
.icon-button { width: 38px; border-radius: 6px; font-size: 18px; }
.band {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}
.seg {
  border: 0;
  min-width: 72px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
}
.seg.is-active {
  background: var(--accent);
  color: #fff;
}
.status-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 2px 12px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.kpi, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.kpi { padding: 14px; min-height: 92px; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 750; margin-top: 8px; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.panel { padding: 14px; min-width: 0; }
.schedule-panel,
.heatmap-panel {
  grid-column: 1 / -1;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.muted { color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.week-grid {
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(124px, 1fr));
  min-width: 990px;
}
.week-head, .time-cell, .week-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 76px;
}
.week-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 48px;
  padding: 8px;
  background: var(--surface-soft);
  font-weight: 700;
}
.time-cell {
  padding: 8px;
  color: var(--muted);
  background: #fbfcfb;
  font-size: 12px;
}
.week-cell { padding: 6px; background: #fff; }
.week-cell.is-today { background: #f4fbf7; }
.order-block {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #eef7f3;
  font-size: 12px;
  min-height: 42px;
  align-self: stretch;
  justify-self: start;
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(22, 62, 48, .10);
}
.order-block.placeholder { border-left-color: var(--warning); background: #fff4e9; }
.order-title { font-weight: 750; }
.order-meta { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capacity-line {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 6px;
}
.month-weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
}
.month-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  min-height: 92px;
  background: #fff;
}
.month-day.is-today { outline: 2px solid var(--accent); }
.month-date { font-weight: 750; }
.month-metric { margin-top: 8px; font-size: 12px; color: var(--muted); }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; gap: 5px; }
.bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.bar-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}
.bar-track { height: 10px; background: var(--surface-soft); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-fill.blue { background: var(--blue); }
.heatmap-wrap { overflow-x: auto; }
.heatmap {
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(124px, 1fr));
  min-width: 990px;
  gap: 4px;
}
.heatmap-cell, .heatmap-label {
  min-height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.heatmap-label { color: var(--muted); font-weight: 700; }
.heatmap-cell { background: var(--surface-soft); color: var(--text); }
.refund-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}
.refund-rate {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: conic-gradient(var(--danger) var(--rate), var(--surface-soft) 0);
}
.refund-rate span {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  font-weight: 750;
}
.sync-list { display: grid; gap: 8px; }
.sync-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.sync-item:last-child { border-bottom: 0; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.login-panel h1 { margin: 6px 0 18px; }
.login-form { display: grid; gap: 10px; }
.login-form input, .login-form button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}
.login-form button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
@media (max-width: 980px) {
  .app-shell { padding: 12px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions input { flex: 1; }
  .toolbar { flex-direction: column; }
  .segmented { width: 100%; grid-auto-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .schedule-panel,
  .heatmap-panel { grid-column: auto; }
  .month-grid { grid-template-columns: repeat(7, minmax(64px, 1fr)); gap: 4px; }
  .month-day { min-height: 76px; padding: 6px; }
}
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .kpis { grid-template-columns: 1fr; }
  .panel { padding: 12px; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .month-grid { min-width: 560px; }
  #schedule { overflow-x: auto; }
  .refund-card { grid-template-columns: 1fr; }
}
