:root { --bg:#f6f7f9; --fg:#1d232b; --muted:#6b7480; --card:#fff; --accent:#128c7e; --line:#e3e6ea; }
@media (prefers-color-scheme: dark) { :root { --bg:#12161b; --fg:#e6e9ed; --muted:#8b94a0; --card:#1b2128; --accent:#25d366; --line:#2a313a; } }
* { box-sizing:border-box; }
body { margin:0; font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; background:var(--bg); color:var(--fg); }
a { color:var(--accent); }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:var(--card); border-bottom:1px solid var(--line); }
.topbar nav a { margin-left:16px; text-decoration:none; }
.brand { font-weight:700; font-size:1.2rem; text-decoration:none; }
.container { max-width:760px; margin:24px auto; padding:0 16px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; }
.hero { text-align:center; padding:48px 0; }
.btn { display:inline-block; background:var(--accent); color:#fff; border:0; border-radius:8px; padding:10px 18px; font:inherit; cursor:pointer; text-decoration:none; }
.form input, .form textarea { width:100%; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); font:inherit; }
.form label { display:block; font-weight:600; margin-bottom:4px; }
.helptext, .muted { color:var(--muted); font-size:.9em; }
.errorlist { color:#d33; margin:0; padding-left:18px; }
.list { list-style:none; padding:0; } .list li { padding:8px 16px; border-bottom:1px solid var(--line); } .list li:last-child { border:0; }
.thread { display:flex; flex-direction:column; gap:8px; }
.bubble { max-width:80%; padding:8px 12px; border-radius:10px; background:var(--bg); }
.bubble.out { align-self:flex-end; background:var(--accent); color:#fff; } .bubble.out .muted { color:#e8fff6; }
.bubble small { display:block; margin-top:4px; }
.footer { text-align:center; color:var(--muted); padding:24px 16px; }

/* Auth + patients */
.inline { display:inline; margin-left:16px; }
.linkbtn { background:none; border:0; padding:0; color:var(--accent); font:inherit; cursor:pointer; }
.container.wide { max-width:1100px; }
.narrow { max-width:400px; margin:32px auto; }
.alert { padding:10px 14px; border-radius:8px; margin-bottom:16px; background:var(--card); border:1px solid var(--line); }
.alert.success { border-color:var(--accent); }
.form select { width:100%; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); font:inherit; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.grid .full { grid-column:1 / -1; }
@media (max-width:600px) { .grid { grid-template-columns:1fr; } }
.req { color:#d33; }
.btn.secondary { background:transparent; color:var(--accent); border:1px solid var(--accent); }
.row { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.search { display:flex; gap:8px; align-items:center; margin-bottom:16px; }
.search input { flex:1; padding:9px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); font:inherit; }
.table-wrap { overflow-x:auto; padding:0; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
th { font-size:.85em; color:var(--muted); font-weight:600; }
tbody tr:last-child td { border-bottom:0; }
.pager { text-align:center; } .pager a { margin:0 12px; }
.form input.regno { font-weight:700; letter-spacing:.08em; background:var(--line); cursor:default; max-width:200px; }
