/* КонтролМед: стиль по образцу отчёта по звонкам, одобренного клиентом (шаблон D:\5_ПРОЕКТЫ КЛИЕНТОВ\КонтролМед) */
:root {
  --bg: #E8EDF5; --text: #0E1C2F; --muted: #5B6B83; --soft: #8695AB; --line: #CFD8E6; --line2: #E4E9F2;
  --blue: #104FCD; --blue-dark: #0B3CA3; --blue-soft: #E3ECFF;
  --side: #0E1C2F; --side-line: rgba(255,255,255,.08); --side-group: rgba(255,255,255,.45);
  --green: #1E9A62; --green-soft: #DDF3E7; --red: #CF4B37; --red-dark: #A33A28; --amber: #C88617;
  --card-shadow: 0 1px 2px rgba(11,28,51,.06), 0 6px 18px rgba(11,28,51,.07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
button, select, input, textarea { font: inherit; }

.layout { display: flex; min-height: 100vh; }
.side { flex: none; width: 248px; height: 100vh; position: sticky; top: 0; overflow-y: auto; background: var(--side);
  border-right: 1px solid var(--side-line); display: flex; flex-direction: column; }
.side-top { display: flex; flex-direction: column; gap: 16px; padding: 20px 16px 16px; border-bottom: 1px solid var(--side-line); }
.side-top img { display: block; height: 30px; width: auto; margin-left: 10px; }
.clinic { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; }
.clinic-badge { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--blue);
  color: #fff; font-weight: 700; font-size: 13px; }
.clinic-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.clinic select { width: 100%; background: transparent; color: #fff; border: 1px solid var(--side-line); border-radius: 6px; padding: 4px; }
.clinic select option { color: var(--text); }
.nav { padding: 12px 8px; flex: 1; }
.nav-group { color: var(--side-group); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 14px 10px 6px; }
.nav a, .nav span.soon { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px;
  color: rgba(255,255,255,.85); font-size: 14px; }
.nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.nav a.on { background: var(--blue); color: #fff; }
.nav span.soon { color: rgba(255,255,255,.35); }
.nav .cnt { font-size: 12px; opacity: .8; }
.side-bottom { padding: 12px 18px 18px; border-top: 1px solid var(--side-line); color: rgba(255,255,255,.6); font-size: 13px; }
.side-bottom a { color: rgba(255,255,255,.85); }
.side-bottom form { display: inline; }
.side-bottom button { background: none; border: 0; padding: 0; color: rgba(255,255,255,.85); cursor: pointer; }

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; }
.updated { color: var(--muted); font-size: 13px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.chip:hover { text-decoration: none; border-color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: #fff; border-radius: 10px; box-shadow: var(--card-shadow); padding: 14px 16px; }
.tile b { display: block; font-size: 26px; line-height: 1.2; }
.tile span { color: var(--muted); font-size: 13px; }

.card { background: #fff; border-radius: 10px; box-shadow: var(--card-shadow); padding: 16px 18px; margin-bottom: 12px; }
.task-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--blue-soft); color: var(--blue-dark); }
.pill.urgent { background: #FBE3DE; color: var(--red-dark); }
.pill.today { background: #FDF1DC; color: #7A5006; }
.pill.new { background: var(--green-soft); color: #0F6B42; }
.pill.st { background: #F2F5FA; color: var(--muted); }
.task-text { font-size: 15px; margin: 0 0 6px; }
.task-reason { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.task-links { font-size: 14px; margin-bottom: 10px; }
.task-links a { margin-right: 14px; }
.mark { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line2); padding-top: 10px; }
.mark select, .mark input[type=text], .mark input[type=datetime-local] { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: #fff; }
.mark input[type=text] { flex: 1; min-width: 160px; }
.btn { background: var(--blue); color: #fff; border: 0; border-radius: 6px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--blue-dark); }
.history { font-size: 13px; color: var(--muted); margin-top: 8px; }
.empty { color: var(--muted); padding: 24px 0; }
.msg { background: var(--green-soft); color: #0F6B42; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }

.table-wrap { overflow-x: auto; }
table.tl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tl td, table.tl th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.tl th { color: var(--muted); font-weight: 600; font-size: 13px; }
.talk-text { white-space: pre-wrap; font-size: 13px; color: var(--muted); max-height: 220px; overflow: auto; background: #F7F9FC; border-radius: 6px; padding: 8px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.login { width: 100%; max-width: 360px; background: #fff; border-radius: 12px; padding: 28px 24px; box-shadow: 0 12px 48px rgba(11,28,51,.24); }
.login img { height: 34px; margin-bottom: 18px; }
.login label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
.login input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; }
.login .btn { width: 100%; margin-top: 18px; padding: 10px; }
.login .err { color: var(--red-dark); font-size: 14px; margin-top: 10px; }

@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .nav-group { display: none; }
  .nav span.soon { display: none; }
  .main { padding: 18px 16px 40px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
