:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --ink: #1c2321;
  --muted: #6f7469;
  --border: #e7e4da;

  --primary: #1f5a44;
  --primary-tint: #e5efe8;
  --amber: #9c6a11;
  --amber-tint: #faf0dc;
  --rose: #a8433a;
  --rose-tint: #f8e6e3;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot--on { background: var(--primary); }

/* ---------- Greeting ---------- */
.greeting h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  margin: 0 0 6px;
  line-height: 1.15;
}

.wave { font-size: 28px; }

.subline {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--stat-accent, var(--primary));
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  margin: 0 0 10px;
}

.stat-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12.5px;
}

.stat-period { color: var(--muted); }

.stat-change {
  font-weight: 600;
}
.stat-change--up { color: var(--primary); }
.stat-change--down { color: var(--rose); }

/* ---------- Board (calendar + appointments) ---------- */
.board {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.calendar-card, .appointments-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.calendar-header h2, .appointments-header h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  margin: 0;
  text-transform: capitalize;
}

.calendar-nav {
  display: flex;
  gap: 6px;
}

.calendar-nav button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
}

.calendar-nav button:hover { border-color: var(--primary); }

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}

.weekday-row span {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 6px;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 0.85;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  gap: 4px;
}

.day-cell:hover { background: var(--primary-tint); }

.day-cell.is-muted { color: #c9c7bc; cursor: default; }
.day-cell.is-muted:hover { background: transparent; }

.day-cell.is-today { border-color: var(--primary); font-weight: 600; }

.day-cell.is-selected {
  background: var(--primary);
  color: #fff;
}
.day-cell.is-selected:hover { background: var(--primary); }

.day-dots {
  display: flex;
  gap: 2px;
  height: 5px;
}

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.day-dot--onaylandi { background: var(--primary); }
.day-dot--beklemede { background: var(--amber); }
.day-dot--iptal { background: var(--rose); }
.is-selected .day-dot--onaylandi,
.is-selected .day-dot--beklemede,
.is-selected .day-dot--iptal { background: #fff; opacity: 0.85; }

.legend {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }

.legend-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.legend-dot--onaylandi { background: var(--primary); }
.legend-dot--beklemede { background: var(--amber); }
.legend-dot--iptal { background: var(--rose); }

/* ---------- Appointments ---------- */
.appointments-header { margin-bottom: 18px; }

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.appointment-row {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--row-accent, var(--primary));
  background: var(--row-bg, var(--primary-tint));
}

.appointment-time {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  min-width: 50px;
}

.appointment-name {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 2px;
}

.appointment-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}

.appointment-status {
  margin-left: auto;
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--row-accent, var(--primary));
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 24px 4px;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page { padding: 22px 16px 48px; }
  .greeting h1 { font-size: 27px; }
}
