:root {
  --blue: #005bb7;
  --blue-dark: #004a94;
  --green: #4caf50;
  --cyan: #00b8d4;
  --bg: #f3f7fb;
  --text: #1a2332;
  --muted: #5a6a7a;
  --line: #e2eaf2;
  --danger: #e53935;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #004a94, #005bb7 55%, #008aa9);
  color: white;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: white; color: var(--blue); display: grid; place-items: center;
  font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 24px;
}
.brand strong { display: block; font-family: "Plus Jakarta Sans", sans-serif; }
.brand small, .who small { opacity: 0.8; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side a {
  color: white; text-decoration: none; padding: 10px 12px; border-radius: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.side a.active, .side a:hover { background: rgba(255,255,255,0.16); }
.badge {
  background: var(--green); color: white; border-radius: 99px; min-width: 20px;
  text-align: center; font-size: 12px; padding: 2px 6px; font-weight: 700;
}
.who { margin-top: auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.who a { padding: 8px 0; opacity: 0.9; }
.main { padding: 28px; }
.top h1 { margin: 0 0 18px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 28px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.card, .panel {
  background: white; border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 6px; font-size: 28px; font-family: "Plus Jakarta Sans", sans-serif; }
.grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
a { color: var(--blue); }
.pill { border-radius: 99px; padding: 3px 8px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.pill-upcoming, .pill-admin { background: #e8f1fb; color: var(--blue); }
.pill-completed, .pill-provider { background: #e8f5e9; color: #2e7d32; }
.pill-cancelled, .pill-patient { background: #fdecea; color: var(--danger); }
.pill-pending { background: #fff4e5; color: #e65100; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
.flash-ok { background: #e8f5e9; color: #2e7d32; }
.flash-error { background: #fdecea; color: #c62828; }
.form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: white; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; gap: 16px; align-items: center; }
.checks label { display: flex; gap: 8px; align-items: center; }
button, .button {
  border: 0; background: var(--blue); color: white; border-radius: 12px; padding: 10px 14px;
  font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
}
button.secondary, .button.secondary { background: white; color: var(--blue); border: 1px solid var(--line); }
button.danger { background: var(--danger); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.muted { color: var(--muted); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #e8f1fb, #f7fafc 45%, #e8f5e9); }
.login { width: min(420px, 100%); background: white; border-radius: 24px; padding: 28px; border: 1px solid var(--line); }
.login h1 { font-family: "Plus Jakarta Sans", sans-serif; margin-bottom: 6px; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.bubble { max-width: 70%; padding: 10px 12px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.bubble.them { background: #e8f1fb; align-self: flex-start; }
.bubble.me { background: var(--blue); color: white; align-self: flex-end; }
.bubble small { display: block; opacity: 0.75; margin-top: 4px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .cards, .grid, .row { grid-template-columns: 1fr; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
}
