:root {
  --ink: #16201b;
  --muted: #68736d;
  --line: #dfe6e1;
  --panel: #ffffff;
  --wash: #f5f7f2;
  --accent: #2f7d59;
  --accent-2: #2452a6;
  --warn: #bd6b13;
}

body {
  background: var(--wash);
  color: var(--ink);
  font-size: 15px;
  padding-bottom: 76px;
}

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

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.app-shell {
  max-width: 1180px;
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}

.panel, .metric, .item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(22, 32, 27, .04);
}

.panel { padding: 16px; }
.metric { padding: 14px; min-height: 96px; }
.metric .value { font-size: 1.45rem; font-weight: 800; }
.metric .label { color: var(--muted); font-size: .85rem; }

.item-card {
  padding: 14px;
  margin-bottom: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: .78rem;
  font-weight: 700;
}

.status-paid { background: #e1f4e8; color: #17633d; }
.status-unpaid { background: #fff1dd; color: #8a4b08; }
.status-partial { background: #e7efff; color: #244f9c; }
.status-open { background: #eef7f1; color: #2f7d59; }
.status-booked { background: #eceff5; color: #4b5563; }

.calendar-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: stretch;
}

.timebox {
  color: var(--muted);
  font-weight: 700;
  font-size: .82rem;
  padding-top: 14px;
}

.slot {
  border-left: 4px solid var(--accent);
}

.slot.booked {
  border-left-color: var(--accent-2);
}

.planner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weekly-grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 32, 27, .04);
}

.weekly-grid {
  display: grid;
  grid-template-columns: 68px repeat(6, minmax(132px, 1fr));
  min-width: 860px;
}

.grid-head,
.grid-time,
.grid-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.grid-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9fbf8;
  padding: 10px 8px;
  font-weight: 800;
  text-align: center;
}

.time-head {
  left: 0;
  z-index: 3;
}

.grid-time {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f9fbf8;
  padding: 10px 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.grid-cell {
  min-height: 74px;
  padding: 6px;
  background: #fff;
}

.grid-session {
  display: grid;
  gap: 2px;
  padding: 7px;
  border-left: 4px solid var(--accent-2);
  border-radius: 6px;
  background: #eef3fb;
  color: #1c3769;
  font-size: .78rem;
  line-height: 1.2;
}

.grid-session span {
  color: #4f6284;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 20;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  color: var(--muted);
  text-decoration: none;
  font-size: .72rem;
  gap: 2px;
}

.bottom-nav i { font-size: 1.12rem; }
.bottom-nav a.active { color: var(--accent); font-weight: 800; }

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #276b4b;
  --bs-btn-hover-border-color: #276b4b;
}

.map-preview {
  min-height: 138px;
  border: 1px dashed #b8c6bd;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef7f1, #eef3fb);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 16px;
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .app-shell { padding: 24px; }
  .bottom-nav {
    top: 0;
    bottom: auto;
    left: auto;
    width: 520px;
    right: 180px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }
  .bottom-nav a { min-height: 58px; }
  .weekday-picker { grid-template-columns: repeat(6, 1fr); }
}
