* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #222;
}
[hidden] { display: none !important; }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: #1f6feb; color: #fff;
}
header .brand { color: #fff; font-weight: 600; font-size: 18px; text-decoration: none; }
main { max-width: 960px; margin: 20px auto; padding: 0 12px; }
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.narrow { max-width: 360px; margin: 80px auto; }
h1, h2 { margin-top: 0; }
label { display: block; margin-bottom: 12px; font-size: 14px; color: #555; }
input, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid #ccd; border-radius: 6px; font: inherit; color: #222;
}
textarea { resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
button, .button {
  display: inline-block; padding: 8px 16px; border: none; border-radius: 6px;
  background: #1f6feb; color: #fff; font: inherit; cursor: pointer; text-decoration: none;
}
button:disabled { opacity: .6; cursor: wait; }
.secondary { background: #e6e9ef; color: #222; }
header .secondary { background: rgba(255,255,255,.2); color: #fff; }
.danger { background: #d73a49; padding: 4px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.toolbar { display: flex; gap: 12px; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.toolbar input { margin: 0; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #eee; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f0f5ff; }
.muted { color: #888; text-align: center; padding: 16px; }
.error { color: #d73a49; min-height: 1em; margin: 8px 0 0; }
.success { color: #22863a; min-height: 1em; margin: 4px 0 0; }
.treatments { list-style: none; padding: 0; margin: 16px 0 0; }
.treatments li { border-top: 1px solid #eee; padding: 12px 0; }
.treatments .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.treatments .date { font-weight: 600; }
.treatments .content { white-space: pre-wrap; word-break: break-word; }
