:root {
  --bg: #eef3f8; --card: #fff; --ink: #1d2733; --muted: #5d6b7a; --line: #d8e0e8;
  --brand: #1f4e8c; --brand2: #163a69; --bad: #b42318; --badbg: #fdecea; --okbg: #e8f4ec; --ok: #1b6b3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); }
.brandbar { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 18px 16px; background: #fff; border-bottom: 3px solid var(--brand); }
.brandbar img { height: 84px; width: auto; object-fit: contain; }
.brandbar .bt { text-align: center; }
.brandbar .bt b { display: block; font-size: 1.6rem; color: var(--brand2); letter-spacing: .02em; }
.brandbar .bt span { font-size: 1.05rem; color: var(--muted); }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 32px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: 0 2px 8px rgba(20, 40, 70, .06); }
.card h1 { margin: 0 0 6px; font-size: 1.35rem; }
.card.login { max-width: 420px; margin: 10px auto; }
.card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
label { display: block; margin: 12px 0 0; font-weight: 600; font-size: .95rem; }
label input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-weight: 400; border: 1px solid #b9c5d1; border-radius: 8px; }
label input:focus { outline: 2px solid #8fb3e3; border-color: var(--brand); }
.btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); }
.login .btn { width: 100%; margin-top: 18px; }
.msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--okbg); color: var(--ok); }
.msg.bad { background: var(--badbg); color: var(--bad); }
.links { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.links form, .acts form { display: inline; margin: 0; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.hello .acts { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 150px; padding: 22px 24px 22px 84px; border-radius: 14px; background: #fff; border: 1px solid var(--line); border-left: 8px solid var(--c, var(--brand)); color: var(--ink); text-decoration: none; box-shadow: 0 2px 8px rgba(20, 40, 70, .07); transition: transform .12s, box-shadow .12s; }
.tile:has(a.go:hover), .tile:has(a.go:focus-visible) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 40, 70, .15); }
/* the whole tile opens the app in this tab; "Open in new tab" sits above that */
.tile a.go { color: inherit; text-decoration: none; outline: none; }
.tile a.go::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.tile a.go:focus-visible::after { outline: 3px solid #8fb3e3; }
.tile a.open { position: relative; z-index: 1; align-self: flex-start; text-decoration: none; }
.tile a.open:hover { text-decoration: underline; }
.tile .num { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--c, var(--brand)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.tile b { font-size: 1.45rem; color: var(--c, var(--brand)); }
.tile small { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.tile .open { margin-top: 10px; font-size: .85rem; font-weight: 600; color: var(--c, var(--brand)); }
.t-op { --c: #1f4e8c; }
.t-emot { --c: #b42318; }
.t-elot { --c: #1b6b3a; }
.t-clinic { --c: #7a3fa0; }
.tile.off { --c: #9aa5b1; opacity: .7; cursor: not-allowed; }
.tablewrap { overflow-x: auto; margin-top: 14px; }
table.acc { width: 100%; border-collapse: collapse; font-size: .95rem; }
.acc th, .acc td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.acc th { background: #f3f6f9; font-size: .85rem; }
.acc .c { text-align: center; }
.acc input[type=checkbox] { width: 18px; height: 18px; }
.acc tr.inactive td { color: #98a2ad; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 14px 16px 20px; }
@media (max-width: 700px) {
  .brandbar { gap: 12px; padding: 12px; }
  .brandbar img { height: 52px; }
  .brandbar .bt b { font-size: 1.15rem; }
  .brandbar .bt span { font-size: .9rem; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { min-height: 110px; padding: 16px 16px 16px 74px; }
  .tile .num { left: 16px; }
  .card { padding: 18px 16px; }
}
