:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #dfe3e8;
  --text: #1f2933;
  --muted: #6b7683;
  --accent: #2f5d8a;
  --warn: #b4541a;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
}
.top a { color: #fff; text-decoration: none; margin-right: 16px; }
.top a:hover { text-decoration: underline; }
.top .who { font-size: 14px; opacity: .9; }

main { max-width: 1100px; margin: 0 auto; padding: 20px; }

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
tr.overdue td { background: #fdf1ec; }

.muted { color: var(--muted); }
.empty { padding: 10px 0; color: var(--muted); }
.error { color: var(--danger); }
.warn {
  background: #fdf3e7;
  border: 1px solid #f0d0a8;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--warn);
}

input, select, textarea, button {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
textarea { width: 100%; }
button, .btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.row-form, .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.row-form .grow { flex: 1 1 260px; }
label.inline { display: inline-flex; align-items: center; gap: 4px; }

/* календарь */
.months { margin-bottom: 10px; }
.months a { margin-right: 16px; color: var(--accent); }
table.calendar { table-layout: fixed; background: var(--card); }
table.calendar td {
  height: 84px;
  vertical-align: top;
  border: 1px solid var(--line);
  padding: 4px;
}
table.calendar td.other-month { background: #fafbfc; color: var(--muted); }
table.calendar td.taken { background: #eef4fa; }
table.calendar td.is-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.daynum { font-weight: 600; font-size: 13px; }
.conflict { font-size: 11px; color: var(--warn); margin: 2px 0; }
a.visit {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
a.visit.done { background: #2e7d52; }
a.visit.cancelled { background: #8b8f95; text-decoration: line-through; }
/* ISO-дата нужна для ссылок и проверок, глазами её читать незачем */
.iso { position: absolute; left: -9999px; }

/* вход */
.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.login-card { width: 300px; }
.login-card label { display: block; margin-bottom: 10px; }
.login-card input { width: 100%; margin-top: 4px; }
.login-card button { width: 100%; }
